From a478881e6d56d7fd4c639958c31e8c57206ddab4 Mon Sep 17 00:00:00 2001 From: yuepenglong <1547476325@qq.com> Date: Thu, 10 Apr 2025 16:07:51 +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/votingElection.ts | 4 +-- src/pages/login/login.vue | 11 ++++++- src/pages/votingElection/index.vue | 52 +++++++++++++++++------------- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/src/api/votingElection.ts b/src/api/votingElection.ts index bbe3b43..72e9ddb 100644 --- a/src/api/votingElection.ts +++ b/src/api/votingElection.ts @@ -1,9 +1,9 @@ import { request } from '@/utils/http' // 获取投票选举(正在进行) -export function getVoteprogress() { +export function getVoteprogress(id: number) { return request.http({ - url: '/api/vote_progress', + url: '/api/vote_progress?meetId='+ id, method: 'GET' }) } diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index 5e41b4d..a53e9b6 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -57,6 +57,8 @@ const onGetPhoneNumber = debounce(async (e: phoneEvent) => { } }) +const meetid = ref(0) + const onLoginSuccess = () => { uni.showToast({ title: '登录成功', @@ -64,11 +66,18 @@ const onLoginSuccess = () => { success: () => { setTimeout(() => { userStore.showtoast = false - uni.reLaunch({ url: '/pages/votingElection/index' }) + uni.reLaunch({ url: '/pages/votingElection/index?meetId='+ meetid.value }) }, 1000) } }) } +onLoad((options: any) => { + console.log('扫码参数1:', options); + if(options.scene){ + meetid.value = options.scene + } + +}) onShow(() => { if (userStore.mobile) { diff --git a/src/pages/votingElection/index.vue b/src/pages/votingElection/index.vue index eaae296..9ac500b 100644 --- a/src/pages/votingElection/index.vue +++ b/src/pages/votingElection/index.vue @@ -11,17 +11,37 @@ const reListRef = ref() const xjList = ref({}) +const meetid = ref(0) + + + +onLoad((options: any) => { + console.log('扫码2:', options); + if(options.meetId){ + meetid.value = options.meetId + let params = { + mobile: userStore.mobile, + openid: userStore.openId, + meetId: options.meetId + } + getMember_mobile(params) + } + +}) + const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => { - getVoteprogress().then((res) => { - const { data } = res as { data: { candidate: any[] } } - xjList.value = data || {} - onSuccess({ - data: { - data: data.candidate || [], - total: (data.candidate || []).length - } - }) - }) + setTimeout(()=> { + getVoteprogress(meetid.value).then((res) => { + const { data } = res as { data: { candidate: any[] } } + xjList.value = data || {} + onSuccess({ + data: { + data: data.candidate || [], + total: (data.candidate || []).length + } + }) + }) + },1000) } const buttlist = ref([ @@ -125,18 +145,6 @@ onShow(() => { } }) }) -onLoad((options: any) => { - console.log('扫码参数1:', options.scene); - if(options.scene){ - let params = { - mobile: userStore.mobile, - openid: userStore.openId, - meetId: options.scene - } - getMember_mobile(params) - } - -})