Browse Source

修改bug

dev
岳鹏龙 1 year ago
parent
commit
04520c1869
  1. 8
      src/api/login.ts
  2. 11
      src/api/votingElection.ts
  3. 6
      src/pages/login/login.vue
  4. 30
      src/pages/votingElection/index.vue

8
src/api/login.ts

@ -20,3 +20,11 @@ export function getAdminPhone() {
method: 'GET' method: 'GET'
}) })
} }
//用户签到
export function getSign(data: { meetId: string; openid: string }) {
return request.http({
url: '/api/sign',
method: 'GET',
data
})
}

11
src/api/votingElection.ts

@ -1,7 +1,7 @@
import { request } from '@/utils/http' import { request } from '@/utils/http'
// 获取投票选举(正在进行) // 获取投票选举(正在进行)
export function getVoteprogress(id: number) { export function getVoteprogress(id: string) {
return request.http({ return request.http({
url: '/api/vote_progress?meetId='+ id, url: '/api/vote_progress?meetId='+ id,
method: 'GET' method: 'GET'
@ -33,3 +33,12 @@ export function getMember_mobile(data: any) {
data data
}) })
} }
// 判断用户是否签到
export function getIs_sign(data: any) {
return request.http({
url: '/api/is_sign',
method: 'GET',
data
})
}

6
src/pages/login/login.vue

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { debounce } from 'feng-uniapp-exploit/utils/index' import { debounce } from 'feng-uniapp-exploit/utils/index'
import { getMobile } from '@/api/login' import { getMobile, getSign } from '@/api/login'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const userStore = useUserStore() const userStore = useUserStore()
@ -57,7 +57,7 @@ const onGetPhoneNumber = debounce(async (e: phoneEvent) => {
} }
}) })
const meetid = ref(0) const meetid = ref('')
const onLoginSuccess = () => { const onLoginSuccess = () => {
uni.showToast({ uni.showToast({
@ -70,6 +70,8 @@ const onLoginSuccess = () => {
}, 1000) }, 1000)
} }
}) })
getSign({openid: userStore.openId, meetId: meetid.value})
} }
onLoad((options: any) => { onLoad((options: any) => {
console.log('扫码参数1:', options); console.log('扫码参数1:', options);

30
src/pages/votingElection/index.vue

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { getVoteprogress, voteMember, getMember_mobile } from '../../api/votingElection' import { getVoteprogress, voteMember, getMember_mobile, getIs_sign } from '../../api/votingElection'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
import { isEmptyObject } from '@/utils/common' import { isEmptyObject } from '@/utils/common'
@ -11,7 +11,7 @@ const reListRef = ref()
const xjList = ref<any>({}) const xjList = ref<any>({})
const meetid = ref(0) const meetid = ref('')
@ -19,12 +19,12 @@ onLoad((options: any) => {
console.log('扫码2:', options); console.log('扫码2:', options);
if(options.meetId){ if(options.meetId){
meetid.value = options.meetId meetid.value = options.meetId
let params = { // let params = {
mobile: userStore.mobile, // mobile: userStore.mobile,
openid: userStore.openId, // openid: userStore.openId,
meetId: options.meetId // meetId: options.meetId
} // }
getMember_mobile(params) // getMember_mobile(params)
} }
}) })
@ -41,6 +41,20 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
} }
}) })
}) })
// getIs_sign({openid: userStore.openId, meetId: meetid.value}).then((res: any)=> {
// if(res.code === 0) {
// uni.showToast({
// title: '',
// icon: 'none',
// success: () => {
// setTimeout(() => {
// uni.reLaunch({ url: '/pages/login/login' })
// }, 500)
// }
// })
// } else {
// }
// })
},1000) },1000)
} }

Loading…
Cancel
Save