Files
dvcp_v2_wxcp_app/src/project/fengdu/AppVote/voteDetail.vue
2022-12-29 14:35:15 +08:00

58 lines
1.3 KiB
Vue

<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>
import AiHighlight from "../../../components/AiHighlight";
export default {
name: "voteDetail",
components: {AiHighlight},
appName: "投票详情",
data() {
return {
detail: {}
}
},
methods: {
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>