沈明 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. 46
      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. 374
      src/pages/mine/index.vue
  11. 64
      src/pages/votingElection/index.vue

12
src/App.vue

@ -8,13 +8,13 @@
onLaunch(() => { onLaunch(() => {
// routingIntercept() // routingIntercept()
}) });
onShow(() => { onShow(() => {
console.log('App Show') console.log("App Show");
}) });
onHide(() => { onHide(() => {
console.log('App Hide') console.log("App Hide");
}) });
// //
// provide('globalObj', <globalObjInt>{ // provide('globalObj', <globalObjInt>{
// // // //
@ -25,5 +25,5 @@ onHide(() => {
<style lang="scss"> <style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
@import 'uview-plus/index.scss'; @import "uview-plus/index.scss";
</style> </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" : "新未来", "name": "问卷系统",
"appid" : "__UNI__1AE1F37", "appid": "__UNI__1AE1F37",
"description" : "v3+ts+uniapp模版", "description": "v3+ts+uniapp模版",
"versionName" : "1.0.68", "versionName": "1.0.68",
"versionCode" : 168, "versionCode": 168,
"transformPx" : false, "transformPx": false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
"compatible" : { "compatible": {
"ignoreVersion" : true "ignoreVersion": true
}, },
/* */ /* */
"modules" : { "modules": {
"Barcode" : {}, "Barcode": {},
"Camera" : {}, "Camera": {},
"VideoPlayer" : {}, "VideoPlayer": {},
"Share" : {}, "Share": {},
"Geolocation" : {}, "Geolocation": {},
"Maps" : {} "Maps": {}
}, },
/* */ /* */
"distribute" : { "distribute": {
/* android */ /* android */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<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.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"minSdkVersion" : 21 "minSdkVersion": 21
}, },
/* ios */ /* ios */
"ios" : { "ios": {
"dSYMs" : false "dSYMs": false
}, },
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs": {
"ad" : {}, "ad": {},
"share" : { "share": {
"weixin" : { "weixin": {
"appid" : "wxd448c878a54da98d", "appid": "wxd448c878a54da98d",
"UniversalLinks" : "" "UniversalLinks": ""
} }
}, },
"geolocation" : { "geolocation": {
"amap" : { "amap": {
"name" : "amap_18648278829CcsBXVUm1", "name": "amap_18648278829CcsBXVUm1",
"__platform__" : [ "ios", "android" ], "__platform__": [
"appkey_ios" : "435934cdfcc901e4872a70391d92cccd", "ios",
"appkey_android" : "435934cdfcc901e4872a70391d92cccd" "android"
],
"appkey_ios": "435934cdfcc901e4872a70391d92cccd",
"appkey_android": "435934cdfcc901e4872a70391d92cccd"
} }
}, },
"maps" : { "maps": {
"amap" : { "amap": {
"name" : "amap_18648278829CcsBXVUm1", "name": "amap_18648278829CcsBXVUm1",
"appkey_ios" : "435934cdfcc901e4872a70391d92cccd", "appkey_ios": "435934cdfcc901e4872a70391d92cccd",
"appkey_android" : "435934cdfcc901e4872a70391d92cccd" "appkey_android": "435934cdfcc901e4872a70391d92cccd"
} }
} }
}, },
"icons" : { "icons": {
"android" : { "android": {
"hdpi" : "src/static/logo.png", "hdpi": "src/static/logo.png",
"xhdpi" : "src/static/logo.png", "xhdpi": "src/static/logo.png",
"xxhdpi" : "src/static/logo.png", "xxhdpi": "src/static/logo.png",
"xxxhdpi" : "src/static/logo.png" "xxxhdpi": "src/static/logo.png"
} }
}, },
"splashscreen" : { "splashscreen": {
"iosStyle" : "common", "iosStyle": "common",
"androidStyle" : "default", "androidStyle": "default",
"android" : { "android": {
"hdpi" : "C:/Users/Lenovo/Desktop/480x762.9/res/drawable-xhdpi/480x762.9.png", "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", "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" "xxhdpi": "C:/Users/Lenovo/Desktop/1080x1882.9/res/drawable-xhdpi/1080x1882.9.png"
}, },
"ios" : { "ios": {
"storyboard" : "C:/Users/Lenovo/Desktop/CustomStoryboard.zip" "storyboard": "C:/Users/Lenovo/Desktop/CustomStoryboard.zip"
} }
} }
} }
}, },
/* */ /* */
"quickapp" : {}, "quickapp": {},
/* */ /* */
"mp-weixin" : { "mp-weixin": {
"appid" : "", "appid": "",
"setting" : { "setting": {
"urlCheck" : false, "urlCheck": false,
"es6" : true, "es6": true,
"postcss" : false, "postcss": false,
"minified" : true "minified": true
}, },
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "3" "vueVersion": "3"
} }

26
src/pages.json

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

46
src/pages/electionList/index.vue

@ -1,39 +1,36 @@
<script setup lang="ts"> <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) => { const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => {
onSuccess({ onSuccess({
data: { data: {
data:[ data: [{ name: "测试一" }, { name: "测试二" }],
{ name: '测试一' }, total: 4,
{ name: '测试二' } },
], });
total: 4 };
}
})
}
</script> </script>
<template> <template>
<view class="electionList"> <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 }"> <template v-slot="{ row, index }">
<view class="items" :uid="'items' + index"> <view class="items" :uid="'items' + index">
<view class="flex"> <view class="flex">
<view class="flex1"> <view class="flex1">
<view class="flex-center-start"> <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 b">进行中</text>
<!-- <text class="status f">未开始</text> --> <!-- <text class="status f">未开始</text> -->
<!-- <text class="status e">已结束</text> --> <!-- <text class="status e">已结束</text> -->
</view> </view>
<view class="time">{{ '投票时间:2024-03-01 至 2024-03-07' }}</view> <view class="time">{{ "投票时间:2024-03-01 至 2024-03-07" }}</view>
</view> </view>
<view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo"> <view :class="{ arrow: true, active: row.showInfo }" @click="row.showInfo = !row.showInfo">
<u-icon name="arrow-down" color="#9CA3AF" /> <u-icon name="arrow-down" color="#9CA3AF" />
</view> </view>
</view> </view>
<view class="info" v-if="row.showInfo"> <view class="info" v-if="row.showInfo">
<view class="flex info-items"> <view class="flex info-items" v-for="(v, k) of 2" :key="k">
<view class="head"></view> <view class="head"></view>
<view class="content flex1"> <view class="content flex1">
<view class="name flex-center-start"> <view class="name flex-center-start">
@ -45,39 +42,24 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
</view> </view>
<view class="progress"> <view class="progress">
<u-line-progress :percentage="60" height="8rpx" active-color="#ff0000" :show-text="false" /> <u-line-progress :percentage="60" height="8rpx" active-color="#2563EB" :show-text="false" />
<view class="progress-text">60%</view> <view class="progress-text">60%</view>
</view> </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"> <view class="info-bts" @click.stop="navto('pages/electionList/info')">查看投票详情</view>
<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> </view>
</view> </view>
</template> </template>
</EcList> </ex-list>
</view> </view>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.electionList { .electionList {
width: 100%; width: 100%;
min-height: 100vh;
box-sizing: border-box; box-sizing: border-box;
min-height: calc(100vh - 100rpx);
padding: 32rpx; padding: 32rpx;
background-color: #f9fafb; 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> <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> </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>

374
src/pages/mine/index.vue

@ -1,313 +1,195 @@
<script setup lang="ts"> <script setup lang="ts">
import useUserStore from '@/store/user' // import useUserStore from "@/store/user";
import { getHeaderImage } from '@/utils/common'
const userStore = useUserStore() // const userStore = useUserStore();
// const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params });
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 })
</script> </script>
<template> <template>
<view class="user-container"> <view class="userview">
<view class="header-box" :style="{ paddingTop: `${(statusBarHeight as number) * 2 + 20}rpx` }"> <!-- 搜索信息 -->
<view class="title">我的</view> <block v-if="false">
<view class="flex user-box" @click="navto('pages/mine/info')"> <view class="userview-search box flex">
<view class="headimg"> <view class="userview-search-label">姓名</view>
<image class="img" :src="getHeaderImage(userStore.userInfo.head_image)" mode="widthFix" /> <input class="flex1" type="text" placeholder="请输入您的姓名" placeholder-class="placeholder" />
<view class="userview-search-bts">搜索</view>
</view> </view>
<view class="flex-start-evenly column">
<view class="name">{{ userStore?.userInfo?.nickname || '' }}</view> <view class="userview-info box" :class="{ border: index === 0 }" v-for="(row, index) in 2" :key="index">
<view class="phone">{{ userphone }}</view> <view class="flex-center-between userview-info-item">
</view> <view class="userview-info-item-label">姓名</view>
<view class="flex1 flex-center-end"> <view class="userview-info-item-content flex">
<u-icon name="arrow-right" size="14" color="#fff" /> <text>陈思远</text>
</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>
</view> </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="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" />
</view> </view>
<view style="margin-right: auto"> <view class="flex-center-between userview-info-item">
<view class="report-tip">预计最高还能省</view> <view class="userview-info-item-label">工作单位</view>
<u-count-to ref="uCountTo" :end-val="data.estimate" color="#fff" font-size="36rpx" /> <view class="userview-info-item-content flex">
<text>未来科技有限公司</text>
</view> </view>
</view> </view>
<view class="report-tip" style="color: #fff">
<text>累计综合收款费率</text>
<text class="report-price">{{ data.cumulative }}%</text>
</view> </view>
<view class="flex-center-evenly">
<view class="bts plain">确认信息</view>
<view class="bts">新建信息</view>
</view> </view>
</block>
<view class="option-list"> <!-- 详细信息 -->
<view class="option-list-head flex-center-between"> <block v-if="true">
<view class="option-list-head-title">我的订单</view> <view class="userview-info box">
<view class="option-list-head-tip flex" @click="navto('pages/order/list')"> <view class="flex-center-between userview-info-item">
<text>查看全部</text> <view class="userview-info-item-label">姓名</view>
<u-icon name="arrow-right" size="16" color="#DEDEDE" /> <view class="userview-info-item-content flex">
<text>陈思远</text>
</view> </view>
</view> </view>
<view class="option-list-body"> <view class="flex-center-between userview-info-item">
<view class="flex column" @click="navto('pages/order/list', { status: 'unpaid' })"> <view class="userview-info-item-label">电话</view>
<view class="img-box bg flex"> <view class="userview-info-item-content flex">
<image src="http://cdn-pos.lingji.vip/static/icon/mine/besent.png" mode="widthFix" /> <text>138 8888 8888</text>
</view> </view>
<view class="text">待付款</view>
</view> </view>
<view class="flex column" @click="navto('pages/order/list', { status: 'paid' })"> <view class="flex-center-between userview-info-item">
<view class="img-box bg flex"> <view class="userview-info-item-label">性别</view>
<image src="http://cdn-pos.lingji.vip/static/icon/mine/unsend.png" mode="widthFix" /> <view class="userview-info-item-content flex">
<text></text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view> </view>
<view class="text">待发货</view>
</view> </view>
<view class="flex column" @click="navto('pages/order/list', { status: 'shipped' })"> <view class="flex-center-between userview-info-item">
<view class="img-box bg flex"> <view class="userview-info-item-label">民族</view>
<image src="http://cdn-pos.lingji.vip/static/icon/mine/received.png" mode="widthFix" /> <view class="userview-info-item-content flex">
<text>汉族</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view> </view>
<view class="text">待收货</view>
</view> </view>
<view class="flex column" @click="navto('pages/order/list', { status: 'finished' })"> <view class="flex-center-between userview-info-item">
<view class="img-box bg flex"> <view class="userview-info-item-label">年龄</view>
<image src="http://cdn-pos.lingji.vip/static/icon/mine/completed.png" mode="widthFix" /> <view class="userview-info-item-content flex">
<text>28</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</view> </view>
<view class="text">已完成</view>
</view> </view>
<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>
<view class="flex-center-between userview-info-item">
<view class="option-list wb"> <view class="userview-info-item-label">职位</view>
<view class="option-list-head flex-center-between"> <view class="userview-info-item-content flex">
<view class="option-list-head-title">其它</view> <text>高级产品经理</text>
<u-icon name="edit-pen-fill" color="#2563EB" size="38rpx" />
</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>
<view class="text">{{ v.label }}</view>
</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>
<view class="bts">确认信息</view>
</block>
</view> </view>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.user-container { .userview {
background-color: #fff;
.header-box {
width: 100%; width: 100%;
background-image: url(http://cdn-pos.lingji.vip/static/images/mine/bg.png); padding: 32rpx;
background-repeat: no-repeat; min-height: calc(100vh - 94px);
background-size: cover; box-sizing: border-box;
padding-bottom: 24rpx; background-color: #f9fafb;
.title { .box {
font-size: 32rpx; margin-bottom: 32rpx;
font-weight: 500; border-radius: 24rpx;
color: #fff; background-color: #ffffff;
text-align: center; box-shadow: 0 2rpx 4rpx 0 rgba(0, 0, 0, 0.05);
} }
.user-box { &-search {
width: 100%; color: #4b5563;
padding: 0 32rpx; font-size: 24rpx;
margin-top: 48rpx; line-height: 40rpx;
margin-bottom: 46rpx; padding: 46rpx 32rpx;
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 { &-label {
width: 120%; margin-right: 44rpx;
position: absolute;
top: -10%;
left: -10%;
}
} }
.name { &-bts {
font-size: 32rpx; color: #2563eb;
font-weight: 400;
color: #fff;
}
.phone {
font-size: 14px;
font-weight: 400;
color: #fff;
} }
} }
> .options { &-info {
image {
min-width: 32rpx;
height: 36rpx;
margin-right: 24rpx;
}
text {
color: #fff;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: normal;
letter-spacing: 0rpx; line-height: 40rpx;
} padding: 0 32rpx 32rpx;
border: 1rpx solid #fff;
.options-line { &.border {
width: 0rpx; border-color: #2563eb;
height: 48rpx;
border-right: 2rpx solid #ffffff2e;
} }
}
}
.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 { &.admin {
color: #fff; padding: 32rpx;
text-align: left; color: #6b7280;
font-size: 36rpx; margin: 0 0 60rpx;
font-weight: bold;
font-style: oblique;
line-height: 46rpx;
letter-spacing: 2rpx;
margin-bottom: 24rpx;
}
&-tip { .phone {
font-size: 20rpx; color: #2563eb;
font-weight: 400;
letter-spacing: 0rpx;
line-height: 29rpx;
color: #ffe9d4;
text-align: left;
} }
} }
.option-list { &-item {
padding: 22rpx 28rpx 40rpx; padding: 60rpx 0 24rpx;
border-bottom: 16rpx solid #f5f5f5; border-top: 1rpx solid #e5e7eb;
&.wb { &:first-child {
border-color: #fff; border: none;
} }
&-head { &-label {
margin-bottom: 30rpx; color: #4b5563;
&-title {
color: #333;
font-size: 32rpx;
font-weight: 400;
line-height: 46rpx;
letter-spacing: 0rpx;
} }
&-tip { &-content {
color: #a6a6a6; color: #1f2937;
font-size: 24rpx;
font-weight: 400;
letter-spacing: 0rpx;
line-height: 35rpx;
}
}
&-body {
display: grid;
grid-template-columns: repeat(4, 1fr);
row-gap: 30rpx;
.img-box {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
&.bg { > text {
background: #f5f8ff; margin-right: 16rpx;
}
} }
image {
width: 58rpx;
} }
} }
.text { .bts {
color: #333; color: #fff;
font-size: 26rpx; font-size: 28rpx;
font-weight: 400; line-height: 40rpx;
text-align: center; text-align: center;
line-height: 38rpx; border-radius: 8rpx;
letter-spacing: 0rpx; padding: 24rpx 80rpx;
margin-top: 4rpx; 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: {
data: [ data: [
{ {
img: '/static/img/grxx.png', img: "/static/img/grxx.png",
name: '陈志远', name: "陈志远",
class: '现任财务总监' class: "现任财务总监",
}, },
{ {
img: '/static/img/grxx.png', img: "/static/img/grxx.png",
name: '陈志远', name: "陈志远",
class: '现任财务总监' class: "现任财务总监",
}, },
{ {
img: '/static/img/grxx.png', img: "/static/img/grxx.png",
name: '陈志远', name: "陈志远",
class: '现任财务总监' class: "现任财务总监",
}, },
{ {
img: '/static/img/grxx.png', img: "/static/img/grxx.png",
name: '陈志远', name: "陈志远",
class: '现任财务总监' class: "现任财务总监",
}, },
{ {
img: '/static/img/grxx.png', img: "/static/img/grxx.png",
name: '陈志远', name: "陈志远",
class: '现任财务总监' class: "现任财务总监",
} },
], ],
total: 0 total: 0,
} },
}) });
} };
const selectIndex = ref(0) const selectIndex = ref(0);
const buttlist = ref([ const buttlist = ref([
{ {
butname: '同意' butname: "同意",
}, },
{ {
butname: '反对' butname: "反对",
}, },
{ {
butname: '弃权' butname: "弃权",
} },
]) ]);
const selectBut = (index: number) => { const selectBut = (index: number) => {
selectIndex.value = index selectIndex.value = index;
} };
</script> </script>
<template> <template>
@ -81,13 +81,7 @@ const selectBut = (index: number) => {
</view> </view>
</view> </view>
<view class="bottomp"> <view class="bottomp">
<view <view class="minbut" v-for="(item, index) in buttlist" :key="'minbut' + index" @click="selectBut(index)" :class="{ active: selectIndex === index }">
class="minbut"
v-for="(item, index) in buttlist"
:key="'minbut' + index"
@click="selectBut(index)"
:class="{ active: selectIndex === index }"
>
{{ item.butname }} {{ item.butname }}
</view> </view>
</view> </view>

Loading…
Cancel
Save