|
|
@@ -73,6 +73,7 @@
|
|
|
<vote-success ref="voteSuccess" @support="skipShop"></vote-success>
|
|
|
<home-btn></home-btn>
|
|
|
<webAuthAlert ref="webAuthAlert" tipsContent="首次现金投票助力需用户授权" @confirm="webAuthConfirm"></webAuthAlert>
|
|
|
+ <verificationCodeAlert ref="verificationCodeAlert" :codeImg="verificationCodeImg" @handleRefreshCode="getVerificationCode" @confirm="codeConfirm"></verificationCodeAlert>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -84,6 +85,7 @@
|
|
|
import poster from "@/components/poster/poster.vue"
|
|
|
import smsAlert from "@/components/alert/smsAlert.vue"
|
|
|
import webAuthAlert from "@/components/alert/webAuthAlert.vue"
|
|
|
+ import verificationCodeAlert from '@/components/alert/verificationCodeAlert.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
voteSuccess,
|
|
|
@@ -92,7 +94,8 @@
|
|
|
timelinePopup,
|
|
|
votePopup,
|
|
|
poster,
|
|
|
- webAuthAlert
|
|
|
+ webAuthAlert,
|
|
|
+ verificationCodeAlert
|
|
|
},
|
|
|
async onLoad(props) {
|
|
|
// #ifdef MP-WEIXIN
|
|
|
@@ -189,6 +192,8 @@
|
|
|
},
|
|
|
//活动设置
|
|
|
activitySetting: {},
|
|
|
+ //验证码图片
|
|
|
+ verificationCodeImg: ''
|
|
|
}
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
@@ -343,8 +348,10 @@
|
|
|
//移动积分礼物
|
|
|
if(item.payType === 'POINT_EXCHANGE_GOODS'){
|
|
|
if (item.point == 0 ) {
|
|
|
+ this.getVerificationCode();
|
|
|
+ this.$refs.verificationCodeAlert.show = true;
|
|
|
//免费投票
|
|
|
- this.freeVote()
|
|
|
+ // this.freeVote()
|
|
|
return
|
|
|
}
|
|
|
this.$refs.votePopup.hideVote()
|
|
|
@@ -440,7 +447,8 @@
|
|
|
let params = {
|
|
|
orderId: res.data.data.bankOrderId,
|
|
|
orderUrl: url,
|
|
|
- color: this.vuex_theme.bgColor
|
|
|
+ color: this.vuex_theme.bgColor,
|
|
|
+ type: 'VOTE_ORDER'
|
|
|
}
|
|
|
this.$api.yeepay.saveOrderUrlAndColor(params)
|
|
|
this.$shareConfig.H5Pay(JSON.parse(res.data.data.prePayTn)).then((res) => {
|
|
|
@@ -487,16 +495,35 @@
|
|
|
this.$refs.toast.info('助力成功')
|
|
|
}
|
|
|
},
|
|
|
- async freeVote() {
|
|
|
+ codeConfirm(code){
|
|
|
+ this.freeVote(code)
|
|
|
+ },
|
|
|
+ //获取验证码
|
|
|
+ async getVerificationCode() {
|
|
|
+ let params = {
|
|
|
+ helpGoodsId: this.selectGoods.id,
|
|
|
+ productId: this.activity.id,
|
|
|
+ userId: this.vuex_userId
|
|
|
+ }
|
|
|
+ let res = await this.$api.order.verificationCode(params)
|
|
|
+ if (res.data.success) {
|
|
|
+ this.verificationCodeImg = res.data.data
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async freeVote(code) {
|
|
|
let params = {
|
|
|
helpGoodsId: this.selectGoods.id,
|
|
|
userId: this.vuex_userId,
|
|
|
num: 1,
|
|
|
productId: this.activity.id,
|
|
|
}
|
|
|
+ if(this.selectGoods.point == 0){params.code = code;}
|
|
|
let res = await this.$api.order.exchange(params)
|
|
|
if (res.data.success) {
|
|
|
this.$refs.votePopup.hideVote()
|
|
|
+ this.$refs.verificationCodeAlert.show = false;
|
|
|
+ this.$refs.verificationCodeAlert.codevalue = '';
|
|
|
this.fetchData()
|
|
|
|
|
|
let avatar = this.$cache.get('userInfo').avatar
|
|
|
@@ -506,10 +533,11 @@
|
|
|
this.voteSuccess()
|
|
|
}, 200)
|
|
|
} else {
|
|
|
- this.$refs.votePopup.hideVote()
|
|
|
+ this.$u.toast(res.data.msg)
|
|
|
+ this.$refs.verificationCodeAlert.codevalue = '';
|
|
|
setTimeout(() => {
|
|
|
- this.$refs.toast.error(res.data.msg)
|
|
|
- }, 200)
|
|
|
+ this.getVerificationCode();
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
},
|
|
|
customBack() {
|