From cd996684020269c3c0ce8a58257636fcbc009e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=B3=E9=B9=8F=E9=BE=99?= <1547476325@qq.com> Date: Tue, 13 May 2025 11:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.ts | 2 +- src/pages.json | 2 +- src/pages/electionList/info.vue | 8 +- src/pages/mine/index.vue | 77 ++- src/pages/votingElection/index.vue | 861 ++++++++++++++--------------- src/store/user.ts | 20 +- 6 files changed, 509 insertions(+), 461 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index 81ce8ce..4e67679 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -31,7 +31,7 @@ export function getMember_mobile(data: any) { }) } -export function list(data: { name: string, meetId: string }) { +export function list(data: any) { return request.http({ url: '/api/member_name', method: 'GET', diff --git a/src/pages.json b/src/pages.json index af32e8a..a0eaa51 100644 --- a/src/pages.json +++ b/src/pages.json @@ -57,7 +57,7 @@ "path": "pages/mine/index", "style": { "navigationBarTitleText": "个人信息", - "enablePullDownRefresh": true + "enablePullDownRefresh": false } }, { diff --git a/src/pages/electionList/info.vue b/src/pages/electionList/info.vue index bb9fa31..d3a0e54 100644 --- a/src/pages/electionList/info.vue +++ b/src/pages/electionList/info.vue @@ -60,16 +60,16 @@ onLoad((opt) => { 同意 - {{ v.agree_num }} 票({{ toFixed2(v.ageree_percent) }}%) + {{ v.agree_num }} 票({{ toFixed2(v.agree_percent) }}%) - + 反对 - {{ v.disagree_num }} 票({{ toFixed2(v.giveup_percent) }}%) + {{ v.disagree_num }} 票({{ toFixed2(v.disagree_percent) }}%) - + diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index 10d291a..c2bdb39 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -8,6 +8,7 @@ const userStore = useUserStore() const isHandleUserInfo = computed(() => Object.keys(userStore.userInfo).length === 0) const keyword = ref('') +const keyword2 = ref('') const list = ref([]) @@ -19,35 +20,47 @@ const navto = (url: string, params = {}) => uni.$util.goToPage({ url, params }) -const getList = uni.$util.throttle(() => { - if (keyword.value === '') { - uni.showToast({ title: '请输入姓名', icon: 'none' }) - return - } - - // uni.showLoading({ mask: true, title: '加载中...' }) - - listApi({ name: keyword.value, meetId: userStore.meetId }) - .then((res) => { - const { data } = res as { data: dateListtype[] } - list.value = data || [] - // uni.hideLoading() - }) - .catch(() => uni.hideLoading()) +const getList = uni.$util.throttle((type) => { + console.log(keyword.value,keyword2.value); + if(type === 1) { + if (keyword.value === '') { + uni.showToast({ title: type==1?'请输入姓名':'请输入单位', icon: 'none' }) + return + } + listApi({ name: keyword.value, meetId: userStore.meetId }) + .then((res) => { + const { data } = res as { data: dateListtype[] } + list.value = data || [] + }) + } else { + if (keyword2.value === '') { + uni.showToast({ title: type==1?'请输入姓名':'请输入单位', icon: 'none' }) + return + } + listApi({ work_unit: keyword2.value, meetId: userStore.meetId }) + .then((res) => { + const { data } = res as { data: dateListtype[] } + list.value = data || [] + }) + } }) const updateUserInfo = () => { + getSign({ openid: userStore.openId, meetId: userStore.meetId }) userStore.bindUser(list.value[activeKey.value].id as number).then(() => { reset() uni.showToast({ title: '提交成功,等待投票!', icon: 'none' }) - userStore.getUserInfo() }) - getSign({ openid: userStore.openId, meetId: userStore.meetId }) + setTimeout(()=> { + userStore.getUserInfomobile() + + },1000) } const reset = () => { activeKey.value = 0 keyword.value = '' + keyword2.value = '' list.value = [] } @@ -99,8 +112,13 @@ onPullDownRefresh(() => userStore.getUserInfo()) 姓名 - 搜索 + 搜索 + + 单位 + + 搜索 + userStore.getUserInfo()) 确认信息 - 新建信息 + 新建信息 @@ -174,13 +192,13 @@ onPullDownRefresh(() => userStore.getUserInfo()) - + * 姓名和电话信息需要管理员修改 @@ -264,6 +282,7 @@ onPullDownRefresh(() => userStore.getUserInfo()) } &-bts { + padding: 0 20rpx; color: #2563eb; } } @@ -327,5 +346,21 @@ onPullDownRefresh(() => userStore.getUserInfo()) background-color: #eff6ff; } } + .bts1 { + color: #2563eb; + 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; + } + } } diff --git a/src/pages/votingElection/index.vue b/src/pages/votingElection/index.vue index fa8bbfb..481b0ec 100644 --- a/src/pages/votingElection/index.vue +++ b/src/pages/votingElection/index.vue @@ -1,445 +1,442 @@