|
|
@@ -2,7 +2,7 @@
|
|
|
<view :style="vuex_skin">
|
|
|
<u-navbar :custom-back="customBack" :is-back="true" title="作品详情"></u-navbar>
|
|
|
<view class="" v-show="!loading">
|
|
|
- <video class="works-video" ::autoplay="true" :src="activity.videoUrl"></video>
|
|
|
+ <video class="works-video" :autoplay="true" :src="activity.videoUrl"></video>
|
|
|
<view style="padding: 20rpx 30rpx 50rpx 30rpx;background: white;">
|
|
|
<view class="title" style="border-bottom: 1rpx solid #EEEEEE ;">
|
|
|
<span class="bg-red work-no"> {{activity.productNo}}号</span>
|
|
|
@@ -22,7 +22,7 @@
|
|
|
<view class="basis-xs">
|
|
|
<image style="width: 84rpx;height: 84rpx;" src="../../static/icon/ic_zhuanfa.png"></image>
|
|
|
</view>
|
|
|
- <view class="basis-lg flex flex-direction">
|
|
|
+ <view class="basis-lg flex flex-direction" style="margin-left: -20rpx;">
|
|
|
<view style="font-size: 28rpx;color: #353535;">转发邀请投票</view>
|
|
|
<view style="font-size: 22rpx;color: #AEACAF;padding-top: 10rpx;">
|
|
|
成功邀请一位好友投票,获得{{vuex_active_setting.voteAndHeatRate}}热力值</view>
|
|
|
@@ -46,8 +46,7 @@
|
|
|
<uqrcode class="canvas-hide" ref="uqrcode"></uqrcode>
|
|
|
<share-popup ref="sharePopup" @confirm="shareConfirm"></share-popup>
|
|
|
<timeline-popup ref="timelinePopup"></timeline-popup>
|
|
|
-
|
|
|
-
|
|
|
+ <sms-alert ref="smsAlert" @exchange="cmccVote"></sms-alert>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -57,8 +56,10 @@
|
|
|
import votePopup from '@/components/alert/votePopup.vue'
|
|
|
import poster from "@/components/poster/poster.vue"
|
|
|
import uqrcode from "@/components/uqrcode/uqrcode.vue"
|
|
|
+ import smsAlert from "@/components/alert/smsAlert.vue"
|
|
|
export default {
|
|
|
components: {
|
|
|
+ smsAlert,
|
|
|
sharePopup,
|
|
|
timelinePopup,
|
|
|
votePopup,
|
|
|
@@ -66,16 +67,15 @@
|
|
|
uqrcode
|
|
|
},
|
|
|
async onLoad(props) {
|
|
|
- console.log("onLoad");
|
|
|
this.$refs.loading.showLoading()
|
|
|
- const {
|
|
|
- id
|
|
|
- } = props;
|
|
|
- this.activity = (await this.$api.activity.getWorksDetail(id)).data.data
|
|
|
+ //作品id
|
|
|
+ this.id = props.id;
|
|
|
+ //获取详情
|
|
|
+ this.fetchData()
|
|
|
//处理授权结果
|
|
|
this.handelAuthResult(props)
|
|
|
//处理创建订单结果
|
|
|
-
|
|
|
+ this.handelOrderResult(props)
|
|
|
//隐藏loading
|
|
|
setTimeout(() => {
|
|
|
this.$refs.loading.hide()
|
|
|
@@ -94,18 +94,23 @@
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
+ //作品id
|
|
|
+ id: '',
|
|
|
//订单结果
|
|
|
orderResult: {},
|
|
|
//授权结果
|
|
|
authResult: {},
|
|
|
//分享
|
|
|
qrCodeImg: '',
|
|
|
+ //选中的道具
|
|
|
+ selectGoods:{},
|
|
|
+
|
|
|
posetrParams: {
|
|
|
avatar: '',
|
|
|
title: '我是普法帮帮代言人',
|
|
|
subTitle: '邀请您为888号作品投票!'
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
activity: {},
|
|
|
customStyle: {
|
|
|
color: 'white',
|
|
|
@@ -114,26 +119,29 @@
|
|
|
width: '500rpx',
|
|
|
margin: '25rpx auto'
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async fetchData() {
|
|
|
+ this.activity = (await this.$api.activity.getWorksDetail(this.id)).data.data
|
|
|
+ },
|
|
|
async handelShareParams() {
|
|
|
this.posetrParams = {
|
|
|
- avatar: 'https://music.nanyue6688.com/obsfile/9867edfa4d34464bb1f5f938da5c2730-avatar.png',
|
|
|
+ avatar: 'https://gx.vote.activity.obs.cn-south-1.myhuaweicloud.com:443/446d9e043f3748e4a47ea4d0de81b140-3b748fea4150c469b8eb66f98cd29e2.png',
|
|
|
title: '我是普法帮帮代言人',
|
|
|
subTitle: `邀请您为${this.activity.productNo}号作品投票!`
|
|
|
}
|
|
|
- let userId=this.vuex_userId || '000000' //游客
|
|
|
- let sharePath='/pages/activity/activityDetail?id='+this.activity.id+'&userId='+userId
|
|
|
- let encodePath=encodeURIComponent(sharePath)
|
|
|
+ let userId = this.vuex_userId || '000000' //游客
|
|
|
+ let sharePath = '/pages/activity/activityDetail?id=' + this.activity.id + '&userId=' + userId
|
|
|
+ let encodePath = encodeURIComponent(sharePath)
|
|
|
this.$u.mpShare = {
|
|
|
- title: '我是普法帮帮代言人,'+this.posetrParams.subTitle,
|
|
|
- path: '/pages/index/home?path='+encodePath,
|
|
|
- imageUrl: ''
|
|
|
+ title: '我是普法帮帮代言人,' + this.posetrParams.subTitle,
|
|
|
+ path: '/pages/index/home?path=' + encodePath,
|
|
|
+ imageUrl: ''
|
|
|
}
|
|
|
-
|
|
|
- let qrText=this.$config.PRODUCT_PATH +'?path=' +encodePath
|
|
|
+
|
|
|
+ let qrText = this.$config.PRODUCT_PATH + '?path=' + encodePath
|
|
|
this.qrCodeImg = (await this.$refs.uqrcode.make({
|
|
|
size: 150,
|
|
|
text: qrText
|
|
|
@@ -156,13 +164,13 @@
|
|
|
}
|
|
|
},
|
|
|
handelOrderResult(options) {
|
|
|
- if (options.orderResult == undefined) {
|
|
|
- return
|
|
|
+ if (options.orderPass&&this.$cache.get('orderResult')) {
|
|
|
+ this.orderResult = this.$cache.get('orderResult')
|
|
|
+ this.createOrder()
|
|
|
}
|
|
|
- this.orderResult = JSON.parse(options.orderResult)
|
|
|
},
|
|
|
async showVote() {
|
|
|
- this.$refs.votePopup.showVote(this.vuex_phone);
|
|
|
+ this.$refs.votePopup.showVote(this.vuex_phone, this.id);
|
|
|
},
|
|
|
init() {
|
|
|
if (this.vuex_phone) {
|
|
|
@@ -171,11 +179,89 @@
|
|
|
},
|
|
|
//去投票
|
|
|
toVote(item) {
|
|
|
+ this.orderResult=this.$cache.get('orderResult')
|
|
|
+ this.orderResult.goodsId=item.id
|
|
|
+ this.selectGoods=item
|
|
|
+ if (item.point == 0) {
|
|
|
+ //免费投票
|
|
|
+ this.freeVote()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.votePopup.hideVote()
|
|
|
+ //移动积分投票,创建订单
|
|
|
+ if (this.$cache.get('orderResult')) {
|
|
|
+ this.createOrder()
|
|
|
+ return
|
|
|
+ }
|
|
|
let params = {
|
|
|
url: 'https://ldt.guosen-fumao.cn/wapp/order.html',
|
|
|
- title: '创建订单'
|
|
|
+ goodsId: this.selectGoods.id
|
|
|
+ }
|
|
|
+ this.$jump('/pages/webview/createOrder' + this.$u.queryParams(params))
|
|
|
+ },
|
|
|
+ //移动积分创建订单
|
|
|
+ async createOrder() {
|
|
|
+ if (this.$isEmpty(this.orderResult.fingerprint) ||
|
|
|
+ this.$isEmpty(this.orderResult.sessionId) ||
|
|
|
+ this.$isEmpty(this.orderResult.goodsId)) {
|
|
|
+ this.$refs.toast.error('创建订单失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ fingerprint: this.orderResult.fingerprint,
|
|
|
+ helpGoodsId: this.orderResult.goodsId,
|
|
|
+ sessionId: this.orderResult.sessionId,
|
|
|
+ num: 1,
|
|
|
+ phone: this.vuex_phone,
|
|
|
+ userId: this.vuex_userId
|
|
|
+ }
|
|
|
+ let res=await this.$api.order.create(params)
|
|
|
+ if (res.data.success) {
|
|
|
+ this.orderResult.outOrderId=res.data.data
|
|
|
+ this.orderResult.mobile=this.vuex_phone
|
|
|
+ console.log(this.orderResult,"/***********");
|
|
|
+ this.$refs.smsAlert.showSmsAndSend(this.orderResult)
|
|
|
+ }else{
|
|
|
+ this.$refs.toast.error(res.data.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async cmccVote(item){
|
|
|
+ this.$refs.smsAlert.hideSms()
|
|
|
+ let params = {
|
|
|
+ ...item,
|
|
|
+ machinetype:'phone',
|
|
|
+ productId:this.id,
|
|
|
+ helpGoodsId: this.orderResult.goodsId,
|
|
|
+ userId: this.vuex_userId,
|
|
|
+ num: 1,
|
|
|
+ }
|
|
|
+ let res = await this.$api.order.exchange(params)
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$refs.toast.info('助力成功')
|
|
|
+ }else{
|
|
|
+ this.$refs.toast.error(res.data.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async freeVote() {
|
|
|
+ let params = {
|
|
|
+ helpGoodsId: this.selectGoods.id,
|
|
|
+ userId: this.vuex_userId,
|
|
|
+ num: 1,
|
|
|
+ productId: this.activity.id,
|
|
|
+ }
|
|
|
+ let res = await this.$api.order.exchange(params)
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$refs.votePopup.hideVote()
|
|
|
+ this.fetchData()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.toast.info("助力成功")
|
|
|
+ }, 200)
|
|
|
+ } else {
|
|
|
+ this.$refs.votePopup.hideVote()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.toast.error(res.data.msg)
|
|
|
+ }, 200)
|
|
|
}
|
|
|
- this.$jump('/pages/webview/webview' + this.$u.queryParams(params))
|
|
|
},
|
|
|
customBack() {
|
|
|
uni.switchTab({
|
|
|
@@ -198,7 +284,7 @@
|
|
|
this.$refs.timelinePopup.show()
|
|
|
}
|
|
|
},
|
|
|
- showShare(){
|
|
|
+ showShare() {
|
|
|
this.$refs.sharePopup.show()
|
|
|
}
|
|
|
},
|
|
|
@@ -236,13 +322,14 @@
|
|
|
}
|
|
|
|
|
|
.vote-count {
|
|
|
- padding: 0 40rpx 0 20rpx;
|
|
|
+ padding: 0 40rpx 0 10rpx;
|
|
|
font-size: 40rpx;
|
|
|
color: #353535;
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
|
|
|
.work-rank {
|
|
|
+ margin-left: -10rpx;
|
|
|
color: #353535;
|
|
|
background: #FDEBEC;
|
|
|
border-radius: 21px 21px 21px 21px;
|