Browse Source

修改代码

dev
沈明 1 year ago
parent
commit
af1c2b27cd
  1. 37
      src/pages/votingElection/index.vue

37
src/pages/votingElection/index.vue

@ -3,6 +3,8 @@ import { getVoteprogress, voteMember } from '../../api/votingElection'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const userStore = useUserStore() const userStore = useUserStore()
const showDialogRef = ref()
const xjList = ref<any>({}) const xjList = ref<any>({})
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => { const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => {
@ -98,7 +100,6 @@ const submit = () => {
} }
} }
const showDialog = ref(false)
const navto = (url: string, mode: pageMode = 'navigateTo') => uni.$util.goToPage({ url: url ?? 'pages/index/index', mode }) const navto = (url: string, mode: pageMode = 'navigateTo') => uni.$util.goToPage({ url: url ?? 'pages/index/index', mode })
const isEmptyObject = (obj: any) => { const isEmptyObject = (obj: any) => {
if (obj == null) return true if (obj == null) return true
@ -107,13 +108,15 @@ const isEmptyObject = (obj: any) => {
} }
onShow(() => { onShow(() => {
if (userStore.mobile === '') { nextTick(() => {
uni.navigateTo({ if (userStore.mobile === '') {
url: '/pages/login/login' uni.navigateTo({
}) url: '/pages/login/login'
} else if (isEmptyObject(userStore.userInfo)) { })
showDialog.value = true } else if (isEmptyObject(userStore.userInfo)) {
} showDialogRef.value.show = true
}
})
}) })
</script> </script>
@ -160,25 +163,13 @@ onShow(() => {
<view class="tjtp" @click="submit">提交投票</view> <view class="tjtp" @click="submit">提交投票</view>
</view> </view>
</view> </view>
<view style="display: grid; align-items: center; justify-content: center; width: 100%; height: 100vh; align-content: center" v-else> <view style="display: grid; align-items: center; justify-content: center; width: 100%; height: 100vh; align-content: center" v-else>
<img style="width: 188px; height: 140px" src="@/static/img/Group.png" alt="" /> <img style="width: 188px; height: 140px" src="@/static/img/Group.png" alt="" />
<text class="nodata">暂时没有选举 请刷新重试</text> <text class="nodata">暂时没有选举 请刷新重试</text>
</view> </view>
<u-modal
title="提示" <ex-dialog ref="showDialogRef" title="提示" @confirm="navto('pages/mine/index', 'reLaunch')">请您签到之后再进行投票</ex-dialog>
:show="showDialog"
width="650rpx"
:confirm-color="'#2979ff'"
:cancel-color="'#606266'"
:show-confirm-button="true"
:show-cancel-button="false"
:close-on-click-overlay="true"
@confirm="navto('pages/mine/index', 'reLaunch')"
@cancel="showDialog = false"
@close="showDialog = false"
>
请您签到之后再进行投票
</u-modal>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save