|
@@ -9,7 +9,7 @@
|
|
|
<span class="work-title">{{activity.title}}</span>
|
|
<span class="work-title">{{activity.title}}</span>
|
|
|
<view class="work-info-box">
|
|
<view class="work-info-box">
|
|
|
<image class="remen-icon" src="../../static/icon/remen.png"></image>
|
|
<image class="remen-icon" src="../../static/icon/remen.png"></image>
|
|
|
- <span class="vote-count">{{activity.voteCount}}</span>
|
|
|
|
|
|
|
+ <span class="vote-count">{{activity.heatValue}}</span>
|
|
|
<span class="work-rank">排行榜第{{activity.rank}}名</span>
|
|
<span class="work-rank">排行榜第{{activity.rank}}名</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -47,10 +47,12 @@
|
|
|
<share-popup ref="sharePopup" @confirm="shareConfirm"></share-popup>
|
|
<share-popup ref="sharePopup" @confirm="shareConfirm"></share-popup>
|
|
|
<timeline-popup ref="timelinePopup"></timeline-popup>
|
|
<timeline-popup ref="timelinePopup"></timeline-popup>
|
|
|
<sms-alert ref="smsAlert" @exchange="cmccVote"></sms-alert>
|
|
<sms-alert ref="smsAlert" @exchange="cmccVote"></sms-alert>
|
|
|
|
|
+ <vote-success ref="voteSuccess" @support="showShare"></vote-success>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import voteSuccess from "@/components/alert/voteSuccess.vue"
|
|
|
import sharePopup from "@/components/alert/sharePopup.vue"
|
|
import sharePopup from "@/components/alert/sharePopup.vue"
|
|
|
import timelinePopup from "@/components/alert/timelinePopup.vue"
|
|
import timelinePopup from "@/components/alert/timelinePopup.vue"
|
|
|
import votePopup from '@/components/alert/votePopup.vue'
|
|
import votePopup from '@/components/alert/votePopup.vue'
|
|
@@ -59,6 +61,7 @@
|
|
|
import smsAlert from "@/components/alert/smsAlert.vue"
|
|
import smsAlert from "@/components/alert/smsAlert.vue"
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
|
|
+ voteSuccess,
|
|
|
smsAlert,
|
|
smsAlert,
|
|
|
sharePopup,
|
|
sharePopup,
|
|
|
timelinePopup,
|
|
timelinePopup,
|
|
@@ -67,25 +70,23 @@
|
|
|
uqrcode
|
|
uqrcode
|
|
|
},
|
|
},
|
|
|
async onLoad(props) {
|
|
async onLoad(props) {
|
|
|
|
|
+ this.isCustomBack=props.isCustomBack || true
|
|
|
this.$refs.loading.showLoading()
|
|
this.$refs.loading.showLoading()
|
|
|
//作品id
|
|
//作品id
|
|
|
this.id = props.id;
|
|
this.id = props.id;
|
|
|
//获取详情
|
|
//获取详情
|
|
|
- this.fetchData()
|
|
|
|
|
|
|
+ await this.fetchData()
|
|
|
//处理授权结果
|
|
//处理授权结果
|
|
|
this.handelAuthResult(props)
|
|
this.handelAuthResult(props)
|
|
|
//处理创建订单结果
|
|
//处理创建订单结果
|
|
|
this.handelOrderResult(props)
|
|
this.handelOrderResult(props)
|
|
|
|
|
+ //处理海报参数
|
|
|
|
|
+ this.handelShareParams()
|
|
|
//隐藏loading
|
|
//隐藏loading
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- this.$refs.loading.hide()
|
|
|
|
|
- this.loading = false
|
|
|
|
|
|
|
+ this.hideLoading()
|
|
|
}, 400)
|
|
}, 400)
|
|
|
},
|
|
},
|
|
|
- onReady() {
|
|
|
|
|
- //处理海报参数
|
|
|
|
|
- this.handelShareParams()
|
|
|
|
|
- },
|
|
|
|
|
computed: {
|
|
computed: {
|
|
|
content() {
|
|
content() {
|
|
|
return decodeURIComponent(this.activity.content)
|
|
return decodeURIComponent(this.activity.content)
|
|
@@ -93,6 +94,11 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ //是否自定义返回,防止授权时返回到webview页面
|
|
|
|
|
+ isCustomBack:true,
|
|
|
|
|
+
|
|
|
|
|
+ defaultAvatar:'https://vote.guosen-fumao.cn/obsfile/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
|
|
|
|
|
+
|
|
|
loading: false,
|
|
loading: false,
|
|
|
//作品id
|
|
//作品id
|
|
|
id: '',
|
|
id: '',
|
|
@@ -123,12 +129,17 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ hideLoading(){
|
|
|
|
|
+ this.$refs.loading.hide()
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ },
|
|
|
async fetchData() {
|
|
async fetchData() {
|
|
|
this.activity = (await this.$api.activity.getWorksDetail(this.id)).data.data
|
|
this.activity = (await this.$api.activity.getWorksDetail(this.id)).data.data
|
|
|
},
|
|
},
|
|
|
async handelShareParams() {
|
|
async handelShareParams() {
|
|
|
|
|
+ console.log(this.activity.productNo);
|
|
|
this.posetrParams = {
|
|
this.posetrParams = {
|
|
|
- avatar: 'https://gx.vote.activity.obs.cn-south-1.myhuaweicloud.com:443/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
|
|
|
|
|
|
|
+ avatar: this.defaultAvatar,
|
|
|
title: '我是普法帮帮代言人',
|
|
title: '我是普法帮帮代言人',
|
|
|
subTitle: '邀请您为'+this.activity.productNo+'号作品投票!'
|
|
subTitle: '邀请您为'+this.activity.productNo+'号作品投票!'
|
|
|
}
|
|
}
|
|
@@ -138,10 +149,11 @@
|
|
|
this.$u.mpShare = {
|
|
this.$u.mpShare = {
|
|
|
title: '我是普法帮帮代言人,' + this.posetrParams.subTitle,
|
|
title: '我是普法帮帮代言人,' + this.posetrParams.subTitle,
|
|
|
path: '/pages/index/home?path=' + encodePath,
|
|
path: '/pages/index/home?path=' + encodePath,
|
|
|
- imageUrl: ''
|
|
|
|
|
|
|
+ imageUrl: this.activity.imgUrl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let qrText = this.$config.PRODUCT_PATH + '?path=' + encodePath
|
|
let qrText = this.$config.PRODUCT_PATH + '?path=' + encodePath
|
|
|
|
|
+ console.log(qrText);
|
|
|
this.qrCodeImg = (await this.$refs.uqrcode.make({
|
|
this.qrCodeImg = (await this.$refs.uqrcode.make({
|
|
|
size: 150,
|
|
size: 150,
|
|
|
text: qrText
|
|
text: qrText
|
|
@@ -154,6 +166,7 @@
|
|
|
this.authResult = JSON.parse(options.authResult)
|
|
this.authResult = JSON.parse(options.authResult)
|
|
|
if (this.authResult.resultCode == '0000') {
|
|
if (this.authResult.resultCode == '0000') {
|
|
|
//授权成功,直接弹出礼物框
|
|
//授权成功,直接弹出礼物框
|
|
|
|
|
+ this.hideLoading()
|
|
|
this.showVote()
|
|
this.showVote()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -182,6 +195,7 @@
|
|
|
if (this.$cache.get('orderResult')) {
|
|
if (this.$cache.get('orderResult')) {
|
|
|
this.orderResult=this.$cache.get('orderResult')
|
|
this.orderResult=this.$cache.get('orderResult')
|
|
|
this.orderResult.goodsId=item.id
|
|
this.orderResult.goodsId=item.id
|
|
|
|
|
+ this.$cache.put('orderResult',this.orderResult,1*60*60)
|
|
|
}
|
|
}
|
|
|
this.selectGoods=item
|
|
this.selectGoods=item
|
|
|
if (item.point == 0) {
|
|
if (item.point == 0) {
|
|
@@ -239,11 +253,22 @@
|
|
|
}
|
|
}
|
|
|
let res = await this.$api.order.exchange(params)
|
|
let res = await this.$api.order.exchange(params)
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
- this.$refs.toast.info('助力成功')
|
|
|
|
|
|
|
+ this.voteSuccess()
|
|
|
|
|
+ this.$refs.smsAlert.hideSms()
|
|
|
}else{
|
|
}else{
|
|
|
this.$refs.toast.error(res.data.msg)
|
|
this.$refs.toast.error(res.data.msg)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ voteSuccess(){
|
|
|
|
|
+ try{
|
|
|
|
|
+ let avatar=this.$cache.get('userInfo').avatar || this.defaultAvatar
|
|
|
|
|
+ let voteCount=this.selectGoods.votePointRate
|
|
|
|
|
+ let pointNum=this.vuex_active_setting.voteAndPointRate
|
|
|
|
|
+ this.$refs.voteSuccess.showSuccess(avatar,voteCount,pointNum)
|
|
|
|
|
+ }catch(e){
|
|
|
|
|
+ this.$refs.toast.info('助力成功')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
async freeVote() {
|
|
async freeVote() {
|
|
|
let params = {
|
|
let params = {
|
|
|
helpGoodsId: this.selectGoods.id,
|
|
helpGoodsId: this.selectGoods.id,
|
|
@@ -255,8 +280,12 @@
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
this.$refs.votePopup.hideVote()
|
|
this.$refs.votePopup.hideVote()
|
|
|
this.fetchData()
|
|
this.fetchData()
|
|
|
|
|
+
|
|
|
|
|
+ let avatar=this.$cache.get('userInfo').avatar
|
|
|
|
|
+ let voteCount=this.selectGoods.votePointRate
|
|
|
|
|
+ let pointNum=this.vuex_active_setting.voteAndPointRate
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- this.$refs.toast.info("助力成功")
|
|
|
|
|
|
|
+ this.voteSuccess()
|
|
|
}, 200)
|
|
}, 200)
|
|
|
} else {
|
|
} else {
|
|
|
this.$refs.votePopup.hideVote()
|
|
this.$refs.votePopup.hideVote()
|
|
@@ -266,9 +295,11 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
customBack() {
|
|
customBack() {
|
|
|
- uni.switchTab({
|
|
|
|
|
- url: '/pages/index/home'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (this.isCustomBack) {
|
|
|
|
|
+ uni.switchTab({
|
|
|
|
|
+ url: '/pages/index/home'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
//分享
|
|
//分享
|
|
|
async showPoster() {
|
|
async showPoster() {
|