丰都投票界面已完成
This commit is contained in:
108
src/project/fengdu/AppVote/AppVote.vue
Normal file
108
src/project/fengdu/AppVote/AppVote.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<section class="AppVote">
|
||||
<AiGroup title="前置图文" noBorder description>
|
||||
<u-parse :html="detail.frontDisplay"/>
|
||||
</AiGroup>
|
||||
<div class="voteItem" flex @click="handleDetail(1)">
|
||||
<div class="fill">
|
||||
<b class="mar-b8" v-text="`月落乌啼霜满天`"/>
|
||||
<div class="color-999 line3" v-text="`微信公众号是开发者或商家在微信公众平台上申请的应用账号,该帐号与QQ账号互通,该帐号与账号互通…`"/>
|
||||
</div>
|
||||
<div class="thumb">
|
||||
<span v-text="`12345票`"/>
|
||||
</div>
|
||||
</div>
|
||||
<AiGroup title="结尾图文" noBorder description>
|
||||
<u-parse :html="detail.endDisplay"/>
|
||||
</AiGroup>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapActions} from "vuex"
|
||||
|
||||
export default {
|
||||
name: "AppVote",
|
||||
appName: "公众投票",
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getWechatToken', 'getCode']),
|
||||
getDetail() {
|
||||
this.$http.post("/app/vote/detail", null, {})
|
||||
},
|
||||
getList() {
|
||||
this.$http.post("/app/vote/list", null, {})
|
||||
},
|
||||
handleDetail(id) {
|
||||
uni.navigateTo({url: './voteDetail?id=' + id})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getDetail()
|
||||
// this.getList()
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppVote {
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
.voteItem {
|
||||
height: 240px;
|
||||
border: 1px solid #CCCCCC;
|
||||
border-radius: 16px;
|
||||
margin: 0 32px 24px;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
font-family: PingFangSC;
|
||||
|
||||
b {
|
||||
font-size: 34px;
|
||||
color: #333333;
|
||||
display: block;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.line3 {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.thumb {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
margin-left: 24px;
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
background-color: #eee;
|
||||
|
||||
& > span {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
padding: 0 8px;
|
||||
line-height: 44px;
|
||||
background: #FF883C;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
57
src/project/fengdu/AppVote/voteDetail.vue
Normal file
57
src/project/fengdu/AppVote/voteDetail.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user