Browse Source

修改bug

dev
岳鹏龙 12 months ago
parent
commit
a478881e6d
  1. 4
      src/api/votingElection.ts
  2. 11
      src/pages/login/login.vue
  3. 34
      src/pages/votingElection/index.vue

4
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'
})
}

11
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) {

34
src/pages/votingElection/index.vue

@ -11,8 +11,27 @@ const reListRef = ref()
const xjList = ref<any>({})
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) => {
setTimeout(()=> {
getVoteprogress(meetid.value).then((res) => {
const { data } = res as { data: { candidate: any[] } }
xjList.value = data || {}
onSuccess({
@ -22,6 +41,7 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
}
})
})
},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)
}
})
</script>
<template>

Loading…
Cancel
Save