沈明 1 year ago
parent
commit
9a051da32e
  1. 12
      src/App.vue
  2. 147
      src/components/ex-list/ex-list.vue
  3. 165
      src/manifest.json
  4. 26
      src/pages.json
  5. 76
      src/pages/electionList/index.vue
  6. 162
      src/pages/electionList/info.vue
  7. 199
      src/pages/electionResults/index.vue
  8. 112
      src/pages/index/guide.vue
  9. 107
      src/pages/mine/add.vue
  10. 406
      src/pages/mine/index.vue
  11. 64
      src/pages/votingElection/index.vue

12
src/App.vue

@ -8,13 +8,13 @@
onLaunch(() => {
// routingIntercept()
})
});
onShow(() => {
console.log('App Show')
})
console.log("App Show");
});
onHide(() => {
console.log('App Hide')
})
console.log("App Hide");
});
//
// provide('globalObj', <globalObjInt>{
// //
@ -25,5 +25,5 @@ onHide(() => {
<style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import 'uview-plus/index.scss';
@import "uview-plus/index.scss";
</style>

147
src/components/ex-list/ex-list.vue

@ -1,147 +0,0 @@
<script setup lang="ts">
import { onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { ref, reactive, toRefs, nextTick, onMounted } from 'vue'
type argument = {
customListType?: 'default' | 'custom' | 'scroll'
isPerformSearch?: boolean
isPullDownRefresh?: boolean
onFormSearch: (formData: any, onSuccess: Function) => void
onRender?: Function
options?: { [n: string]: string | number | boolean }
emptyText?: string
emptyHeight?: number
}
const props = withDefaults(defineProps<argument>(), {
customListType: 'default',
isPerformSearch: true,
isPullDownRefresh: true,
onFormSearch: () => {
console.log('onFormSearch')
},
onRender: () => {
console.log('onRender')
},
options: () => {
return {}
},
emptyText: '暂无数据~',
emptyHeight: 60
})
let { options, isPerformSearch, isPullDownRefresh, onFormSearch, onRender } = toRefs(props)
const list = ref<any[]>([])
const status = ref('loading')
const initing = ref(true)
const loading = ref(true)
const query = reactive({
page: 1,
limit: 10,
total: 0
})
const loadData = (callback?: Function) => {
uni.showLoading({ title: '数据加载中' })
loading.value = true
const params = { ...query, ...options.value } as { [n: string]: string | number | boolean }
delete params.total
setTimeout(() => {
onFormSearch.value(params, ({ data }: { data: { data: any; total: number } }) => {
loading.value = false
initing.value = false
callback && callback()
query.page = params.page as number
query.limit = params.limit as number
query.total = data.total || 0
list.value = [...list.value, ...data.data]
status.value = query.page * query.limit >= query.total ? 'nomore' : 'loading'
onRender.value && onRender.value(data)
uni.hideLoading()
})
}, 100)
}
const refreshFn = (callback?: Function) => {
query.page = 1
query.total = 0
list.value = []
initing.value = true
loadData(callback)
}
const onScrolltolower = () => {
if (query.page * query.limit >= query.total) {
status.value = 'nomore'
} else {
if (loading.value) return
setTimeout(() => {
status.value = 'loading'
query.page += 1
loadData()
}, 1000)
}
}
onMounted(() => {
if (isPerformSearch.value) {
nextTick(() => {
refreshFn()
})
}
})
onPullDownRefresh(() => {
if (isPullDownRefresh.value) refreshFn(() => uni.stopPullDownRefresh())
})
onReachBottom(() => {
if (props.customListType !== 'scroll') {
onScrolltolower()
}
})
defineExpose({
list,
refreshFn
})
</script>
<template>
<view v-if="!initing">
<block v-if="list.length > 0">
<template v-if="customListType === 'custom'">
<slot v-bind:data="list" />
<u-loadmore :status="status" />
</template>
<template v-else-if="customListType === 'scroll'">
<scroll-view class="scroll-view" scroll-y @scrolltolower="onScrolltolower">
<view v-for="(item, index) in list" :key="index">
<slot v-bind:row="item" v-bind:index="index" />
</view>
<u-loadmore :status="status" />
</scroll-view>
</template>
<template v-else>
<view v-for="(item, index) in list" :key="index">
<slot v-bind:row="item" v-bind:index="index" />
</view>
<u-loadmore :status="status" />
</template>
</block>
<ex-empty v-show="list.length <= 0 && status === 'nomore'" :height="emptyHeight" :tips="emptyText" />
</view>
</template>
<style lang="scss" scoped>
.scroll-view {
width: 100%;
height: 100%;
}
</style>

165
src/manifest.json

@ -1,38 +1,38 @@
{
"name" : "新未来",
"appid" : "__UNI__1AE1F37",
"description" : "v3+ts+uniapp模版",
"versionName" : "1.0.68",
"versionCode" : 168,
"transformPx" : false,
"name": "问卷系统",
"appid": "__UNI__1AE1F37",
"description": "v3+ts+uniapp模版",
"versionName": "1.0.68",
"versionCode": 168,
"transformPx": false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"compatible" : {
"ignoreVersion" : true
"compatible": {
"ignoreVersion": true
},
/* */
"modules" : {
"Barcode" : {},
"Camera" : {},
"VideoPlayer" : {},
"Share" : {},
"Geolocation" : {},
"Maps" : {}
"modules": {
"Barcode": {},
"Camera": {},
"VideoPlayer": {},
"Share": {},
"Geolocation": {},
"Maps": {}
},
/* */
"distribute" : {
"distribute": {
/* android */
"android" : {
"permissions" : [
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
@ -49,83 +49,86 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"minSdkVersion" : 21
"minSdkVersion": 21
},
/* ios */
"ios" : {
"dSYMs" : false
"ios": {
"dSYMs": false
},
/* SDK */
"sdkConfigs" : {
"ad" : {},
"share" : {
"weixin" : {
"appid" : "wxd448c878a54da98d",
"UniversalLinks" : ""
"sdkConfigs": {
"ad": {},
"share": {
"weixin": {
"appid": "wxd448c878a54da98d",
"UniversalLinks": ""
}
},
"geolocation" : {
"amap" : {
"name" : "amap_18648278829CcsBXVUm1",
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "435934cdfcc901e4872a70391d92cccd",
"appkey_android" : "435934cdfcc901e4872a70391d92cccd"
"geolocation": {
"amap": {
"name": "amap_18648278829CcsBXVUm1",
"__platform__": [
"ios",
"android"
],
"appkey_ios": "435934cdfcc901e4872a70391d92cccd",
"appkey_android": "435934cdfcc901e4872a70391d92cccd"
}
},
"maps" : {
"amap" : {
"name" : "amap_18648278829CcsBXVUm1",
"appkey_ios" : "435934cdfcc901e4872a70391d92cccd",
"appkey_android" : "435934cdfcc901e4872a70391d92cccd"
"maps": {
"amap": {
"name": "amap_18648278829CcsBXVUm1",
"appkey_ios": "435934cdfcc901e4872a70391d92cccd",
"appkey_android": "435934cdfcc901e4872a70391d92cccd"
}
}
},
"icons" : {
"android" : {
"hdpi" : "src/static/logo.png",
"xhdpi" : "src/static/logo.png",
"xxhdpi" : "src/static/logo.png",
"xxxhdpi" : "src/static/logo.png"
"icons": {
"android": {
"hdpi": "src/static/logo.png",
"xhdpi": "src/static/logo.png",
"xxhdpi": "src/static/logo.png",
"xxxhdpi": "src/static/logo.png"
}
},
"splashscreen" : {
"iosStyle" : "common",
"androidStyle" : "default",
"android" : {
"hdpi" : "C:/Users/Lenovo/Desktop/480x762.9/res/drawable-xhdpi/480x762.9.png",
"xhdpi" : "C:/Users/Lenovo/Desktop/720x1242.9/res/drawable-xhdpi/720x1242.9.png",
"xxhdpi" : "C:/Users/Lenovo/Desktop/1080x1882.9/res/drawable-xhdpi/1080x1882.9.png"
"splashscreen": {
"iosStyle": "common",
"androidStyle": "default",
"android": {
"hdpi": "C:/Users/Lenovo/Desktop/480x762.9/res/drawable-xhdpi/480x762.9.png",
"xhdpi": "C:/Users/Lenovo/Desktop/720x1242.9/res/drawable-xhdpi/720x1242.9.png",
"xxhdpi": "C:/Users/Lenovo/Desktop/1080x1882.9/res/drawable-xhdpi/1080x1882.9.png"
},
"ios" : {
"storyboard" : "C:/Users/Lenovo/Desktop/CustomStoryboard.zip"
"ios": {
"storyboard": "C:/Users/Lenovo/Desktop/CustomStoryboard.zip"
}
}
}
},
/* */
"quickapp" : {},
"quickapp": {},
/* */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : false,
"minified" : true
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": true
},
"usingComponents" : true
"usingComponents": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics" : {
"enable" : false
"uniStatistics": {
"enable": false
},
"vueVersion" : "3"
}
"vueVersion": "3"
}

26
src/pages.json

@ -18,6 +18,13 @@
"path": "pages/electionList/index",
"style": {
"navigationBarTitleText": "选举列表",
"enablePullDownRefresh": true
}
},
{
"path": "pages/electionList/info",
"style": {
"navigationBarTitleText": "选举结果详情",
"enablePullDownRefresh": false
}
},
@ -46,28 +53,25 @@
}
},
{
"name": "guide",
"path": "pages/index/guide",
"name": "user",
"path": "pages/mine/index",
"style": {
"navigationBarTitleText": "用户指南",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"navigationBarTitleText": "个人信息",
"enablePullDownRefresh": true
}
},
{
"name": "user",
"path": "pages/mine/index",
"path": "pages/mine/add",
"style": {
"navigationBarTitleText": "个人信息",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#2563EB",
"backgroundColor": "#F8F8F8"
},
"tabBar": {

76
src/pages/electionList/index.vue

@ -1,83 +1,65 @@
<script setup lang="ts">
import EcList from '@/components/ex-list/ex-list.vue'
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params });
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => {
onSuccess({
data: {
data:[
{ name: '测试一' },
{ name: '测试二' }
],
total: 4
}
})
}
data: [{ name: "测试一" }, { name: "测试二" }],
total: 4,
},
});
};
</script>
<template>
<view class="electionList">
<EcList ref="reListRef" custom-list-type="scroll" :on-form-search="doSearch">
<ex-list ref="reListRef" custom-list-type="scroll" :on-form-search="doSearch">
<template v-slot="{ row, index }">
<view class="items" :uid="'items' + index">
<view class="flex">
<view class="flex1">
<view class="flex-center-start">
<text class="text-ellipsis title">{{ '2024年度学生会主席选举' }}</text>
<text class="text-ellipsis title">{{ "2024年度学生会主席选举" }}</text>
<text class="status b">进行中</text>
<!-- <text class="status f">未开始</text> -->
<!-- <text class="status e">已结束</text> -->
</view>
<view class="time">{{ '投票时间:2024-03-01 至 2024-03-07' }}</view>
<view class="time">{{ "投票时间:2024-03-01 至 2024-03-07" }}</view>
</view>
<view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo">
<u-icon name="arrow-down" color="#9CA3AF" />
</view>
</view>
<view class="info" v-if="row.showInfo">
<view class="flex info-items">
<view class="head"></view>
<view class="content flex1">
<view class="name flex-center-start">
<text>陈佳怡</text>
<!-- <text class="status">当选</text> -->
<text class="status un">未当选</text>
</view>
<view class="votes">得票数286</view>
</view>
<view class="progress">
<u-line-progress :percentage="60" height="8rpx" active-color="#ff0000" :show-text="false" />
<view class="progress-text">60%</view>
</view>
</view>
<view class="flex info-items">
<view class="head"></view>
<view class="content flex1">
<view class="name flex-center-start">
<text>陈佳怡</text>
<text class="status">当选</text>
<!-- <text class="status un">未当选</text> -->
</view>
<view class="votes">得票数286</view>
</view>
<view class="progress">
<u-line-progress :percentage="60" height="8rpx" active-color="#ff0000" :show-text="false" />
<view class="progress-text">60%</view>
</view>
</view>
<view class="info-bts">查看投票详情</view>
<view class="flex info-items" v-for="(v, k) of 2" :key="k">
<view class="head"></view>
<view class="content flex1">
<view class="name flex-center-start">
<text>陈佳怡</text>
<!-- <text class="status">当选</text> -->
<text class="status un">未当选</text>
</view>
<view class="votes">得票数286</view>
</view>
<view class="progress">
<u-line-progress :percentage="60" height="8rpx" active-color="#2563EB" :show-text="false" />
<view class="progress-text">60%</view>
</view>
</view>
<view class="info-bts" @click.stop="navto('pages/electionList/info')">查看投票详情</view>
</view>
</view>
</template>
</EcList>
</ex-list>
</view>
</template>
<style scoped lang="scss">
.electionList {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
min-height: calc(100vh - 100rpx);
padding: 32rpx;
background-color: #f9fafb;

162
src/pages/electionList/info.vue

@ -0,0 +1,162 @@
<script setup lang="ts"></script>
<template>
<view class="electionList-info">
<view class="head">
<view class="title">2024年度业主委员会主任选举</view>
<view class="status">
<text style="color: #4b5563; margin-right: 16rpx">已结束</text>
<text style="color: #6b7280">2024-01-15 10:00 ~ 2024-01-16 10:00</text>
</view>
</view>
<view class="countview flex-center-between">
<view class="flex column items">
<u-count-to :startVal="0" :endVal="20" bold fontSize="48rpx" color="#2563EB" />
<view class="tip">参选人数</view>
</view>
<view class="flex column items">
<u-count-to :startVal="0" :endVal="20" bold fontSize="48rpx" color="#2563EB" />
<view class="tip">候选人数</view>
</view>
<view class="flex column items">
<u-count-to :startVal="0" :endVal="20" bold fontSize="48rpx" color="#2563EB" />
<view class="tip">当选人数</view>
</view>
</view>
<view class="content" v-for="(v, k) of 4" :key="k">
<view class="flex">
<view class="headimg"></view>
<view class="name">陈志明</view>
<view class="status">当选</view>
<!-- <view class="status un">未当选</view> -->
</view>
<view class="progress">
<view class="flex-center-between progress-text">
<text>同意</text>
<text class="b">98 (62.8%)</text>
</view>
<u-line-progress :percentage="62.8" height="8rpx" active-color="#2563EB" :show-text="false" />
</view>
<view class="progress">
<view class="flex-center-between progress-text">
<text>反对</text>
<text class="e">35 (22.4%)</text>
</view>
<u-line-progress :percentage="22.4" height="8rpx" active-color="#ef4444" :show-text="false" />
</view>
<view class="progress">
<view class="flex-center-between progress-text">
<text>弃权</text>
<text class="f">23 (14.8%)</text>
</view>
<u-line-progress :percentage="14.8" height="8rpx" active-color="#9CA3AF" :show-text="false" />
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.electionList-info {
width: 100%;
min-height: 100vh;
padding: 32rpx;
box-sizing: border-box;
background-color: #f9fafb;
.head {
margin-bottom: 48rpx;
.title {
font-size: 40rpx;
font-weight: bold;
line-height: 56rpx;
color: #000000;
text-align: left;
margin-bottom: 16rpx;
}
.status {
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
}
}
.countview {
padding: 32rpx 60rpx;
border-radius: 24rpx;
margin-bottom: 32rpx;
background-color: #fff;
.tip {
color: #4b5563;
}
}
.content {
padding: 32rpx;
border-radius: 24rpx;
margin-bottom: 32rpx;
background-color: #fff;
.headimg {
width: 128rpx;
height: 128rpx;
border-radius: 50%;
overflow: hidden;
background-color: #4b556377;
margin-right: 22rpx;
}
.name {
font-size: 36rpx;
font-weight: 500;
line-height: 56rpx;
color: #000000;
margin-right: auto;
}
.status {
width: 136rpx;
text-align: center;
font-size: 36rpx;
font-weight: normal;
border-radius: 999rpx;
padding: 16rpx 0;
line-height: 40rpx;
color: #2563eb;
background: rgba(37, 99, 235, 0.1);
&.un {
color: #f44336;
background: rgba(244, 67, 54, 0.1);
}
}
.progress {
margin-top: 24rpx;
height: min-content;
&-text {
color: #000;
font-size: 28rpx;
line-height: 40rpx;
margin-bottom: 8rpx;
.b {
color: #2563eb;
}
.f {
color: #6b7280;
}
.e {
color: #ef4444;
}
}
}
}
}
</style>

199
src/pages/electionResults/index.vue

@ -1,7 +1,200 @@
<script setup lang="ts">
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params });
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => {
onSuccess({
data: {
data: [{ name: "测试一" }, { name: "测试二" }],
total: 4,
},
});
};
</script>
<template>
<view>选举结果</view>
<view class="electionList">
<ex-list ref="reListRef" custom-list-type="scroll" :on-form-search="doSearch">
<template v-slot="{ row, index }">
<view class="items" :uid="'items' + index">
<view class="flex">
<view class="flex1">
<view class="flex-center-start">
<text class="text-ellipsis title">{{ "2024年度学生会主席选举" }}</text>
<!-- <text class="status b">进行中</text> -->
<!-- <text class="status f">未开始</text> -->
<text class="status e">已结束</text>
</view>
<view class="time">{{ "投票时间:2024-03-01 至 2024-03-07" }}</view>
</view>
<view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo">
<u-icon name="arrow-down" color="#9CA3AF" />
</view>
</view>
<view class="info" v-if="row.showInfo">
<view class="flex info-items" v-for="(v, k) of 2" :key="k">
<view class="head"></view>
<view class="content flex1">
<view class="name flex-center-start">
<text>陈佳怡</text>
<!-- <text class="status">当选</text> -->
<text class="status un">未当选</text>
</view>
<view class="votes">得票数286</view>
</view>
<view class="progress">
<u-line-progress :percentage="60" height="8rpx" active-color="#2563EB" :show-text="false" />
<view class="progress-text">60%</view>
</view>
</view>
<view class="info-bts" @click.stop="navto('pages/electionList/info')">查看投票详情</view>
</view>
</view>
</template>
</ex-list>
</view>
</template>
<script lang="ts" setup></script>
<style scoped lang="scss">
.electionList {
width: 100%;
min-height: 100vh;
box-sizing: border-box;
padding: 32rpx;
background-color: #f9fafb;
.items {
padding: 32rpx;
border-radius: 12px;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.001)), #ffffff;
box-sizing: border-box;
border: 1px solid #f3f4f6;
box-shadow:
0px 1px 2px -1px rgba(0, 0, 0, 0.1),
0px 1px 3px 0px rgba(0, 0, 0, 0.1);
margin-bottom: 32rpx;
.text-ellipsis {
overflow: hidden;
white-space: noraml;
text-overflow: ellipsis;
}
.title {
color: #000;
font-size: 32rpx;
font-weight: 500;
line-height: 48rpx;
}
.status {
font-size: 24rpx;
border-radius: 20rpx;
padding: 0 16rpx;
margin-left: 16rpx;
white-space: nowrap;
&.b {
color: #fff;
background-color: #2563eb;
}
&.f {
color: #6b7280;
background-color: #e5e7eb;
}
&.e {
color: #fff;
background-color: #ef4444;
}
}
.time {
padding-top: 8rpx;
color: #6b7280;
line-height: 40rpx;
font-size: 28rpx;
}
.arrow {
transition: 0.3s all ease-in;
&.active {
transform: rotateZ(180deg);
}
}
.info {
&-items {
margin-top: 32rpx;
.head {
width: 96rpx;
height: 96rpx;
border-radius: 50%;
overflow: hidden;
background-color: #6b7280;
margin-right: 24rpx;
}
.content {
height: min-content;
.name {
font-size: 28rpx;
font-weight: 500;
line-height: 40rpx;
color: #000000;
.status {
font-size: 20rpx;
font-weight: normal;
border-radius: 999rpx;
padding: 8rpx 24rpx;
line-height: 20rpx;
color: #2563eb;
background: rgba(37, 99, 235, 0.1);
&.un {
color: #f44336;
background: rgba(244, 67, 54, 0.1);
}
}
}
.votes {
font-size: 28rpx;
line-height: 40rpx;
color: #6b7280;
}
}
.progress {
width: 192rpx;
height: min-content;
&-text {
padding-top: 8rpx;
color: #6b7280;
font-size: 24rpx;
line-height: 32rpx;
}
}
}
<style lang="scss" scoped></style>
&-bts {
padding: 16rpx;
margin: 48rpx 0 24rpx;
font-size: 28rpx;
font-weight: normal;
line-height: 42rpx;
text-align: center;
color: #ffffff;
background-color: #2563eb;
border-radius: 8rpx;
}
}
}
}
</style>

112
src/pages/index/guide.vue

@ -1,112 +0,0 @@
<script setup lang="ts">
import useUserStore from '@/store/user'
const userStore = useUserStore()
const phone = ref('')
const kefuRef = ref()
const list = ref<
{
id?: number
name?: string
guide: { guide_id?: number; title?: string }[]
}[]
>([])
const kefuConfirm = () => {
uni.makePhoneCall({
phoneNumber: phone.value,
success: (response) => {
console.log('success', response)
},
fail: (err) => {
console.log('fail', err)
}
})
}
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params })
onShow(() => {
// getKeySetting('service_telephone').then(({ data: { value } }: any) => (phone.value = value.trim()))
// listApi().then(({ data }: any) => (list.value = data || []))
})
</script>
<template>
<ex-header title="用户指南" />
<view class="guide-view">
<view class="kefu-btn flex" @click="kefuRef.show = true">
<image src="http://cdn-pos.lingji.vip/static/icon/customer.png" mode="widthFix" style="width: 40rpx" />
<text style="margin-left: 14rpx">联系客服</text>
</view>
<view class="pages-view">
<u-collapse accordion :border="true">
<block v-for="(v, k) of list" :key="k">
<u-collapse-item :title="v.name">
<view
:key="ck"
v-for="(cv, ck) of v.guide"
:class="{ 'pages-view-content': true, 'text-ellipsis': true, border: ck < v.guide.length - 1 }"
@click.stop="navto('pages/setting/agreement', { type: 'guide', id: cv.guide_id })"
>
{{ cv.title }}
</view>
</u-collapse-item>
</block>
</u-collapse>
</view>
<ex-dialog ref="kefuRef" title="联系客服" show-cancel-button confirm-text="拨号" confirm-color="#43CF7C" @confirm="kefuConfirm">
<view class="flex column">
<image style="width: 84rpx" :src="`http://cdn-pos.lingji.vip/static/icon/phone-${userStore.useType}.png`" mode="widthFix" />
<view style="margin-top: 36rpx; font-size: 60rpx; font-weight: 700; color: #383838; text-align: center">
{{ phone }}
</view>
</view>
</ex-dialog>
</view>
</template>
<style scoped lang="scss">
.guide-view {
padding: 26rpx 28rpx;
.kefu-btn {
color: #fff;
padding: 32rpx;
margin-bottom: 26rpx;
background: linear-gradient(90deg, #4778ff 0%, #4778ffb8 100%);
}
.pages-view {
background-color: #fff;
&-content {
padding: 16rpx;
color: #9a9bad;
text-align: left;
font-size: 28rpx;
font-weight: 400;
letter-spacing: 0;
line-height: 48rpx;
&.border {
border-bottom: 1rpx solid #dbdbdb;
}
}
:deep(.u-collapse) {
.u-cell__body {
padding: 24rpx 28rpx;
}
.u-collapse-item__content__text {
padding: 0 28rpx;
border-bottom: 4rpx solid #f5f5f5 !important;
&.content-class {
border: none !important;
}
}
}
}
}
</style>

107
src/pages/mine/add.vue

@ -0,0 +1,107 @@
<script setup lang="ts">
// import useUserStore from "@/store/user";
// const userStore = useUserStore();
</script>
<template>
<view class="userview">
<view class="userview-info box">
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">姓名</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">电话</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">性别</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">民族</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">年龄</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">工作单位</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">职位</view>
<view class="userview-info-item-content flex">
<input placeholder="请输入" style="text-align: right" />
</view>
</view>
</view>
<view class="bts">确认信息</view>
</view>
</template>
<style scoped lang="scss">
.userview {
width: 100%;
padding: 32rpx;
min-height: calc(100vh - 94px);
box-sizing: border-box;
background-color: #f9fafb;
.box {
margin-bottom: 60rpx;
border-radius: 24rpx;
background-color: #ffffff;
box-shadow: 0 2rpx 4rpx 0 rgba(0, 0, 0, 0.05);
}
&-info {
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
padding: 0 32rpx 32rpx;
border: 1rpx solid #fff;
&-item {
padding: 60rpx 0 24rpx;
border-top: 1rpx solid #e5e7eb;
&:first-child {
border: none;
}
&-label {
color: #4b5563;
}
&-content {
color: #1f2937;
}
}
}
.bts {
color: #fff;
font-size: 28rpx;
line-height: 40rpx;
text-align: center;
border-radius: 8rpx;
padding: 24rpx 80rpx;
letter-spacing: 4rpx;
border: 1rpx solid #2563eb;
background-color: #2563eb;
}
}
</style>

406
src/pages/mine/index.vue

@ -1,313 +1,195 @@
<script setup lang="ts">
import useUserStore from '@/store/user'
import { getHeaderImage } from '@/utils/common'
// import useUserStore from "@/store/user";
const userStore = useUserStore()
const OBJ = {
other: [
{
label: '地址管理',
icon: 'position',
url: 'pages/address/index'
},
{
label: '用户指南',
icon: 'guide',
url: 'pages/index/guide'
},
{
label: '意见反馈',
icon: 'suggest',
url: 'pages/feedback/index'
},
{
label: '设置',
icon: 'setting',
url: 'pages/setting/index'
}
]
}
const { statusBarHeight } = uni.getSystemInfoSync()
const userphone = computed(() => uni.$util.hidePhone(userStore.userInfo.phone || '17612341234'))
const data = reactive({
cumulative: '',
estimate: 0,
formalities: 0
})
const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params })
// const userStore = useUserStore();
// const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params });
</script>
<template>
<view class="user-container">
<view class="header-box" :style="{ paddingTop: `${(statusBarHeight as number) * 2 + 20}rpx` }">
<view class="title">我的</view>
<view class="flex user-box" @click="navto('pages/mine/info')">
<view class="headimg">
<image class="img" :src="getHeaderImage(userStore.userInfo.head_image)" mode="widthFix" />
<view class="userview">
<!-- 搜索信息 -->
<block v-if="false">
<view class="userview-search box flex">
<view class="userview-search-label">姓名</view>
<input class="flex1" type="text" placeholder="请输入您的姓名" placeholder-class="placeholder" />
<view class="userview-search-bts">搜索</view>
</view>
<view class="userview-info box" :class="{ border: index === 0 }" v-for="(row, index) in 2" :key="index">
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">姓名</view>
<view class="userview-info-item-content flex">
<text>陈思远</text>
</view>
</view>
<view class="flex-start-evenly column">
<view class="name">{{ userStore?.userInfo?.nickname || '' }}</view>
<view class="phone">{{ userphone }}</view>
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">电话</view>
<view class="userview-info-item-content flex">
<text>138 8888 8888</text>
</view>
</view>
<view class="flex1 flex-center-end">
<u-icon name="arrow-right" size="14" color="#fff" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">工作单位</view>
<view class="userview-info-item-content flex">
<text>未来科技有限公司</text>
</view>
</view>
</view>
<view class="options flex-center-evenly">
<view class="flex" @click="navto('pages/mine/wallet')">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/kb.png" mode="heightFix" />
<text>钱包</text>
</view>
<view class="options-line"></view>
<view class="flex" @click="navto('pages/mine/revenue')">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/sr.png" mode="heightFix" />
<text>收入明细</text>
</view>
<view class="flex-center-evenly">
<view class="bts plain">确认信息</view>
<view class="bts">新建信息</view>
</view>
</view>
<view class="report">
<view class="report-title">我的省钱报告</view>
<view class="flex" style="margin-bottom: 32rpx">
<view style="margin-right: 100rpx">
<view class="report-tip">累计节省手续费</view>
<u-count-to ref="uCountTo" :end-val="data.formalities" color="#fff" font-size="36rpx" />
</block>
<!-- 详细信息 -->
<block v-if="true">
<view class="userview-info box">
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">姓名</view>
<view class="userview-info-item-content flex">
<text>陈思远</text>
</view>
</view>
<view style="margin-right: auto">
<view class="report-tip">预计最高还能省</view>
<u-count-to ref="uCountTo" :end-val="data.estimate" color="#fff" font-size="36rpx" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">电话</view>
<view class="userview-info-item-content flex">
<text>138 8888 8888</text>
</view>
</view>
</view>
<view class="report-tip" style="color: #fff">
<text>累计综合收款费率</text>
<text class="report-price">{{ data.cumulative }}%</text>
</view>
</view>
<view class="option-list">
<view class="option-list-head flex-center-between">
<view class="option-list-head-title">我的订单</view>
<view class="option-list-head-tip flex" @click="navto('pages/order/list')">
<text>查看全部</text>
<u-icon name="arrow-right" size="16" color="#DEDEDE" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">性别</view>
<view class="userview-info-item-content flex">
<text></text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view>
</view>
</view>
<view class="option-list-body">
<view class="flex column" @click="navto('pages/order/list', { status: 'unpaid' })">
<view class="img-box bg flex">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/besent.png" mode="widthFix" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">民族</view>
<view class="userview-info-item-content flex">
<text>汉族</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view>
<view class="text">待付款</view>
</view>
<view class="flex column" @click="navto('pages/order/list', { status: 'paid' })">
<view class="img-box bg flex">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/unsend.png" mode="widthFix" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">年龄</view>
<view class="userview-info-item-content flex">
<text>28</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view>
<view class="text">待发货</view>
</view>
<view class="flex column" @click="navto('pages/order/list', { status: 'shipped' })">
<view class="img-box bg flex">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/received.png" mode="widthFix" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">工作单位</view>
<view class="userview-info-item-content flex">
<text>未来科技有限公司</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view>
<view class="text">待收货</view>
</view>
<view class="flex column" @click="navto('pages/order/list', { status: 'finished' })">
<view class="img-box bg flex">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/completed.png" mode="widthFix" />
<view class="flex-center-between userview-info-item">
<view class="userview-info-item-label">职位</view>
<view class="userview-info-item-content flex">
<text>高级产品经理</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view>
<view class="text">已完成</view>
</view>
</view>
</view>
<view class="option-list wb">
<view class="option-list-head flex-center-between">
<view class="option-list-head-title">其它</view>
</view>
<view class="option-list-body">
<block v-for="(v, k) of OBJ.other" :key="k">
<view class="flex column" @click="navto(v.url)">
<view class="img-box flex">
<image :src="`http://cdn-pos.lingji.vip/static/icon/mine/${v.icon}.png`" mode="widthFix" />
</view>
<view class="text">{{ v.label }}</view>
</view>
</block>
<view class="userview-info box admin">
<view>* 姓名和电话信息需要管理员修改</view>
<view>
<text>管理员电话</text>
<text class="phone">400-123-4567</text>
</view>
</view>
</view>
<view class="bts">确认信息</view>
</block>
</view>
</template>
<style scoped lang="scss">
.user-container {
background-color: #fff;
.header-box {
width: 100%;
background-image: url(http://cdn-pos.lingji.vip/static/images/mine/bg.png);
background-repeat: no-repeat;
background-size: cover;
padding-bottom: 24rpx;
.title {
font-size: 32rpx;
font-weight: 500;
color: #fff;
text-align: center;
}
.user-box {
width: 100%;
padding: 0 32rpx;
margin-top: 48rpx;
margin-bottom: 46rpx;
align-items: stretch;
.headimg {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
background-clip: content-box;
background-color: #000000a6;
border: 10rpx solid rgba(255, 255, 255, 0.3);
overflow: hidden;
position: relative;
margin-right: 22rpx;
> .img {
width: 120%;
position: absolute;
top: -10%;
left: -10%;
}
}
.userview {
width: 100%;
padding: 32rpx;
min-height: calc(100vh - 94px);
box-sizing: border-box;
background-color: #f9fafb;
.box {
margin-bottom: 32rpx;
border-radius: 24rpx;
background-color: #ffffff;
box-shadow: 0 2rpx 4rpx 0 rgba(0, 0, 0, 0.05);
}
.name {
font-size: 32rpx;
font-weight: 400;
color: #fff;
}
&-search {
color: #4b5563;
font-size: 24rpx;
line-height: 40rpx;
padding: 46rpx 32rpx;
.phone {
font-size: 14px;
font-weight: 400;
color: #fff;
}
&-label {
margin-right: 44rpx;
}
> .options {
image {
min-width: 32rpx;
height: 36rpx;
margin-right: 24rpx;
}
text {
color: #fff;
font-size: 28rpx;
font-weight: 400;
letter-spacing: 0rpx;
}
.options-line {
width: 0rpx;
height: 48rpx;
border-right: 2rpx solid #ffffff2e;
}
&-bts {
color: #2563eb;
}
}
.report {
width: calc(100% - 56rpx);
margin: 28rpx 28rpx 8rpx;
border-radius: 8rpx;
padding: 26rpx 26rpx 28rpx;
background-image: url(http://cdn-pos.lingji.vip/static/images/mine/bg1.png);
background-repeat: no-repeat;
background-size: cover;
&-title {
color: #fff;
text-align: left;
font-size: 36rpx;
font-weight: bold;
font-style: oblique;
line-height: 46rpx;
letter-spacing: 2rpx;
margin-bottom: 24rpx;
}
&-info {
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
padding: 0 32rpx 32rpx;
border: 1rpx solid #fff;
&-tip {
font-size: 20rpx;
font-weight: 400;
letter-spacing: 0rpx;
line-height: 29rpx;
color: #ffe9d4;
text-align: left;
&.border {
border-color: #2563eb;
}
}
.option-list {
padding: 22rpx 28rpx 40rpx;
border-bottom: 16rpx solid #f5f5f5;
&.admin {
padding: 32rpx;
color: #6b7280;
margin: 0 0 60rpx;
&.wb {
border-color: #fff;
.phone {
color: #2563eb;
}
}
&-head {
margin-bottom: 30rpx;
&-item {
padding: 60rpx 0 24rpx;
border-top: 1rpx solid #e5e7eb;
&-title {
color: #333;
font-size: 32rpx;
font-weight: 400;
line-height: 46rpx;
letter-spacing: 0rpx;
&:first-child {
border: none;
}
&-tip {
color: #a6a6a6;
font-size: 24rpx;
font-weight: 400;
letter-spacing: 0rpx;
line-height: 35rpx;
&-label {
color: #4b5563;
}
}
&-body {
display: grid;
grid-template-columns: repeat(4, 1fr);
row-gap: 30rpx;
&-content {
color: #1f2937;
.img-box {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
&.bg {
background: #f5f8ff;
}
image {
width: 58rpx;
> text {
margin-right: 16rpx;
}
}
}
}
.text {
color: #333;
font-size: 26rpx;
font-weight: 400;
text-align: center;
line-height: 38rpx;
letter-spacing: 0rpx;
margin-top: 4rpx;
}
.bts {
color: #fff;
font-size: 28rpx;
line-height: 40rpx;
text-align: center;
border-radius: 8rpx;
padding: 24rpx 80rpx;
letter-spacing: 4rpx;
border: 1rpx solid #2563eb;
background-color: #2563eb;
&.plain {
color: #2563eb;
background-color: #eff6ff;
}
}
}

64
src/pages/votingElection/index.vue

@ -9,52 +9,52 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
data: {
data: [
{
img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监'
img: "/static/img/grxx.png",
name: "陈志远",
class: "现任财务总监",
},
{
img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监'
img: "/static/img/grxx.png",
name: "陈志远",
class: "现任财务总监",
},
{
img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监'
img: "/static/img/grxx.png",
name: "陈志远",
class: "现任财务总监",
},
{
img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监'
img: "/static/img/grxx.png",
name: "陈志远",
class: "现任财务总监",
},
{
img: '/static/img/grxx.png',
name: '陈志远',
class: '现任财务总监'
}
img: "/static/img/grxx.png",
name: "陈志远",
class: "现任财务总监",
},
],
total: 0
}
})
}
total: 0,
},
});
};
const selectIndex = ref(0)
const selectIndex = ref(0);
const buttlist = ref([
{
butname: '同意'
butname: "同意",
},
{
butname: '反对'
butname: "反对",
},
{
butname: '弃权'
}
])
butname: "弃权",
},
]);
const selectBut = (index: number) => {
selectIndex.value = index
}
selectIndex.value = index;
};
</script>
<template>
@ -81,13 +81,7 @@ const selectBut = (index: number) => {
</view>
</view>
<view class="bottomp">
<view
class="minbut"
v-for="(item, index) in buttlist"
:key="'minbut' + index"
@click="selectBut(index)"
:class="{ active: selectIndex === index }"
>
<view class="minbut" v-for="(item, index) in buttlist" :key="'minbut' + index" @click="selectBut(index)" :class="{ active: selectIndex === index }">
{{ item.butname }}
</view>
</view>

Loading…
Cancel
Save