Files
dvcp_v2_wxcp_app/src/project/fengdu/AppVote/voteDetail.vue

61 lines
1.4 KiB
Vue
Raw Normal View History

2022-12-29 14:35:15 +08:00
<template>
<section class="voteDetail">
<u-parse :html="detail.endDisplay"/>
<AiBottomBtn background="#fff">
<div flex class="pad-l32 pad-r16 pad-b16 pad-t16">
<AiHighlight class="fill color-999" content="当前票数:@v" value="21345" color="#FF6900"/>
<div class="text circle mar-l16" @click="handleVote">投票</div>
</div>
</AiBottomBtn>
</section>
</template>
<script>
2022-12-29 14:49:43 +08:00
import {mapState, mapActions} from "vuex"
2022-12-29 14:35:15 +08:00
export default {
name: "voteDetail",
appName: "投票详情",
2022-12-29 14:49:43 +08:00
computed: {
...mapState(['user']),
},
2022-12-29 14:35:15 +08:00
data() {
return {
detail: {}
}
},
methods: {
2022-12-29 14:49:43 +08:00
...mapActions(['getWechatToken', 'getCode']),
2022-12-29 14:35:15 +08:00
getDetail() {
this.$http.post("/app/vote/detail", null, {}).then(res => {
if (res?.data) {
this.detail = res.data
document.title = this.detail.name
}
})
},
handleVote() {
if (!this.user.token) {//未登录,获取openId和token
this.$http.get("/app/appdvcpconfig/getMpAppid", {withoutToken: true}).then(res => {
if (res?.code == 0 && res?.data) {
this.getCode({scope: "snsapi_userinfo", appid: res.data})
}
})
} else {//已登录,直接投票
}
},
},
onShow() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.voteDetail {
background: #F3F6F9;
min-height: 100vh;
}
</style>