123
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<view class="recharge" v-else>
|
||||
<view class="header_top">
|
||||
<text style="font-size: 32rpx;">解锁后可继续观看</text>
|
||||
<image @tap="close_pay_box" src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/fanhui.png"
|
||||
<image @tap="close_pay_box" :src="config.webUrl + '/static/wechat/static/fanhui.png'"
|
||||
style="width: 36rpx;height: 36rpx;"></image>
|
||||
</view>
|
||||
<view class="vider_juji">
|
||||
@@ -68,10 +68,11 @@
|
||||
<view :class="['vipCarFooter',{'footerRedColor':item.is_red!=1}]">
|
||||
{{ item.remark ? item.remark : '' }}
|
||||
</view>
|
||||
<image v-if="item.is_finger" class="hands"
|
||||
src="https://wx.yaohe.hnjrdzkj.xyz/static/wechat/static/hands.gif" mode=""></image>
|
||||
<image v-if="item.is_finger" class="hands" :src="config.webUrl + '/static/wechat/static/hands.gif'"
|
||||
mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="adBox" v-if="adLoaded" @click="showAd">看广告解锁</view>
|
||||
<view class="explainList">
|
||||
<text class="explainItem"> 充值代表接受
|
||||
<text class="explainText" @click="goAgreement(1)">《充值/退款协议》</text>
|
||||
@@ -81,23 +82,7 @@
|
||||
<text class="explainItem"> 本小程序共有{{ allVideoNum }}部剧正在热播</text>
|
||||
</view>
|
||||
|
||||
|
||||
<uni-popup ref="back_ref" type="center">
|
||||
<view class="teamPupCont">
|
||||
<view class="closeIcon" @click="closePup">
|
||||
<uni-icons type="closeempty" size="16" color="#ffffff"></uni-icons>
|
||||
</view>
|
||||
<view class="textBox">
|
||||
<view class="textLine">用户只能发起一次邀请</view>
|
||||
<view class="textLine">有效时间为24小时</view>
|
||||
<view class="textLine">分享好友拼团,拼成退差价</view>
|
||||
</view>
|
||||
<button open-type="share" class="inviteBtn">立即邀请</button>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -107,6 +92,8 @@
|
||||
} from '@/utils/request'
|
||||
import PAY from '@/utils/pay'
|
||||
const playletPlugin = requirePlugin('playlet-plugin')
|
||||
import config from "@/utils/config";
|
||||
import insertAd from '@/utils/insertAd'
|
||||
export default {
|
||||
name: "payDom",
|
||||
props: {
|
||||
@@ -145,7 +132,8 @@
|
||||
payItemData: {},
|
||||
g_order_id: "",
|
||||
is_check: false,
|
||||
allVideoNum: 0
|
||||
allVideoNum: 0,
|
||||
adLoaded: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -156,8 +144,8 @@
|
||||
this.system = uni.getSystemInfoSync().osName;
|
||||
this.initChargeDialog();
|
||||
this.getVideoData();
|
||||
this.getAllVideoNum();
|
||||
this.getPayList();
|
||||
this.initAd();
|
||||
},
|
||||
playerId(newValue, oldvalue) {
|
||||
console.log('this.initChargeDialog', newValue)
|
||||
@@ -165,6 +153,31 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化广告
|
||||
initAd() {
|
||||
let pms = this.getPlayerManager();
|
||||
// 监听加载成功 → 显示按钮
|
||||
insertAd.insertAdonLoad(() => {
|
||||
this.adLoaded = true;
|
||||
});
|
||||
// 监听加载失败 → 隐藏按钮
|
||||
insertAd.insertAdonError(() => {
|
||||
this.adLoaded = false;
|
||||
});
|
||||
// 监听关闭
|
||||
insertAd.insertAdonClose((isEnded) => {
|
||||
if (isEnded) {
|
||||
console.log('广告看完,发放奖励');
|
||||
// TODO: 调用你的解锁接口
|
||||
pms.emitCustomEvent('adEnd', this.im)
|
||||
}
|
||||
});
|
||||
// 开始加载广告
|
||||
insertAd.insertAdload();
|
||||
},
|
||||
showAd() {
|
||||
insertAd.insertAdshow();
|
||||
},
|
||||
goAgreement(num) {
|
||||
const pm = this.getPlayerManager()
|
||||
pm.navigateTo({
|
||||
@@ -206,7 +219,7 @@
|
||||
onHideChargeDialog() {
|
||||
// this.$refs.back_ref.close();
|
||||
},
|
||||
close_pay_box(){
|
||||
close_pay_box() {
|
||||
const pm = this.getPlayerManager()
|
||||
pm.hideChargeDialog();
|
||||
},
|
||||
@@ -249,11 +262,11 @@
|
||||
video_list_id: this.vid
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 1){
|
||||
if (res.code == 1) {
|
||||
this.payListGroupId = uni.getStorageSync('config').pay_tpl;
|
||||
// this.payListGroupId = 2;
|
||||
this.list_pay = res.data
|
||||
}else if(res.code ==50){
|
||||
} else if (res.code == 50) {
|
||||
this.is_check = true;
|
||||
}
|
||||
|
||||
@@ -381,89 +394,20 @@
|
||||
})
|
||||
},
|
||||
|
||||
// wxxcx_xuni(data) {
|
||||
// console.log(data)
|
||||
// let that = this,
|
||||
// pms = that.getPlayerManager();
|
||||
// uni.requestVirtualPayment({
|
||||
// signData: JSON.stringify({
|
||||
// buyQuantity: data.signData.buyQuantity,
|
||||
// currencyType: data.signData.currencyType,
|
||||
// env: data.signData.env,
|
||||
// goodsPrice: data.signData.goodsPrice,
|
||||
// offerId: data.signData.offerId,
|
||||
// outTradeNo: data.signData.outTradeNo,
|
||||
// platform: data.signData.platform,
|
||||
// productId: data.signData.productId,
|
||||
// attach: data.signData.attach,
|
||||
// }),
|
||||
// paySig: data.paySig,
|
||||
// signature: data.signature,
|
||||
// mode: 'short_series_coin',
|
||||
// success(res) {
|
||||
// let payParam = {
|
||||
// status: 'paySuccess',
|
||||
// serialNo: that.serialNo,
|
||||
// gOrderId: "",
|
||||
// vid: that.vid,
|
||||
// oid: data.oid
|
||||
// }
|
||||
// if (that.payItemData.pay_type == 4) {
|
||||
// // that.$refs.back_ref.open('center');
|
||||
// that.payEnd(payParam)
|
||||
// } else {
|
||||
// pms.emitCustomEvent('chargeEnd', payParam)
|
||||
// }
|
||||
// },
|
||||
// fail({errMsg, errCode}) {
|
||||
// console.log(errMsg, errCode, data.signature)
|
||||
// },
|
||||
// })
|
||||
// },
|
||||
// wxxcx(data) {
|
||||
// let that = this,
|
||||
// pms = that.getPlayerManager();
|
||||
// uni.requestPayment({
|
||||
// "provider": 'wxpay',
|
||||
// "appId": data.appId,
|
||||
// "timeStamp": data.timeStamp + '',
|
||||
// "nonceStr": data.nonceStr,
|
||||
// "package": data.package,
|
||||
// "signType": 'MD5',
|
||||
// "paySign": data.sign,
|
||||
// success: function (res1) {
|
||||
// let payParam = {
|
||||
// status: 'paySuccess',
|
||||
// serialNo: that.serialNo,
|
||||
// gOrderId: "",
|
||||
// vid: that.vid,
|
||||
// oid: data.oid
|
||||
// }
|
||||
// if (that.payItemData.pay_type == 4) {
|
||||
// // that.$refs.back_ref.open('center');
|
||||
//
|
||||
// that.payEnd(payParam)
|
||||
// } else {
|
||||
// pms.emitCustomEvent('chargeEnd', payParam)
|
||||
// }
|
||||
// console.log('success:' + JSON.stringify(res1));
|
||||
// },
|
||||
// fail: function (err1) {
|
||||
// console.log('fail:' + JSON.stringify(err1));
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
|
||||
|
||||
closePup() {
|
||||
// this.$refs.back_ref.close();
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.adBox {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
background: linear-gradient(to right, #FF5205, #FF0591);
|
||||
color: #fff;
|
||||
border-radius: 48rpx;
|
||||
}
|
||||
|
||||
.noRecharge {
|
||||
font-size: 40rpx;
|
||||
line-height: 200rpx;
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx94a6522b1d640c3b",
|
||||
"appid" : "wx6de5fc276420b278",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"postcss" : true,
|
||||
|
||||
+12
-12
@@ -31,18 +31,18 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/tabs/recommend",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "enablePullDownRefresh": false,
|
||||
// // #ifdef MP-WEIXIN
|
||||
// "usingComponents": {
|
||||
// "drama-feed-list": "plugin://playlet-plugin/drama-feed-list"
|
||||
// }
|
||||
// // #endif
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/tabs/recommend",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false,
|
||||
// #ifdef MP-WEIXIN
|
||||
"usingComponents": {
|
||||
"drama-feed-list": "plugin://playlet-plugin/drama-feed-list"
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tabs/bingeWatch",
|
||||
"style": {
|
||||
|
||||
+3
-30
@@ -124,7 +124,7 @@
|
||||
</view>
|
||||
<view class="u-flex-col u-col-bottom">
|
||||
<u-icon @click="show=false" stop name="close" color="#999" size="16"></u-icon>
|
||||
<view @click.stop="govideo(LookInfo.vl_id)"
|
||||
<view @click.stop="govideo(LookInfo.vid)"
|
||||
class="u-bnt-tabbar-FF5205-FF0591 u-radius-40 u-p-l-20 u-p-r-20 u-p-t-10 u-p-b-10 u-font-24 u-m-t-10">
|
||||
继续播放</view>
|
||||
</view>
|
||||
@@ -382,37 +382,10 @@
|
||||
},
|
||||
// 进入短剧播放页面
|
||||
govideo(vlid) {
|
||||
if (tt.canIUse('video-player')) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/index/VideoPlayer?vl_id=' + vlid
|
||||
url: '/pagesA/player/detailPlayer?vid=' + vlid + '&mid=' + 0
|
||||
})
|
||||
return
|
||||
this.$api.videoGroupInfo({
|
||||
vl_id: vlid,
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
if (res.data.video_look == false) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/VideoPlayer?tt_album_id=' + res.data.album_id +
|
||||
'&tt_episode_id=' + res.data.video_info[0].episode_id + '&vl_id=' +
|
||||
vlid
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/VideoPlayer?tt_album_id=' + res.data.album_id +
|
||||
'&tt_episode_id=' + res.data.video_info[res.data.video_look.weigh -
|
||||
1].episode_id + '&vl_id=' + vlid
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$getMsg(res.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$getMsg('当前版本过低,请升级抖音后观看')
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
+5
-35
@@ -42,10 +42,10 @@
|
||||
<scroll-view scroll-y style="height: 51vh;" v-if="list.length>0" @scrolltolower="getbottom()">
|
||||
<view class="u-p-l-20 u-p-r-20 u-p-b-30">
|
||||
<view v-if="current == 0" class="u-flex u-m-t-30" v-for="(item,index) in list" :key="index">
|
||||
<u-image :src="item.img" @click="govideo(item.vl_id)" width="100rpx" height="140rpx"
|
||||
<u-image :src="item.img" @click="govideo(item.vid,item.mid)" width="100rpx" height="140rpx"
|
||||
radius="5"></u-image>
|
||||
<view class="u-flex-1 u-m-l-20 u-flex u-row-between">
|
||||
<view @click="govideo(item.vl_id)">
|
||||
<view @click="govideo(item.vid,item.mid)">
|
||||
<view class="u-font-28 u-word-break u-line-1">{{item.vname}}</view>
|
||||
<view class="u-font-24 u-m-t-30 u-color-999">{{item.mid}}集</view>
|
||||
</view>
|
||||
@@ -53,7 +53,7 @@
|
||||
</view>
|
||||
<view v-else class="u-flex u-flex-wrap u-col-top">
|
||||
<view class="u-w-200 u-m-t-30 u-m-r-16" v-for="(item,index) in list" :key="index"
|
||||
@click="govideo(item.vl_id)">
|
||||
@click="govideo(item.vid,item.mid)">
|
||||
<image :src="item.img" class="u-w-200 u-h-280 u-radius-10" mode="aspectFill">
|
||||
</image>
|
||||
<view class="u-word-break u-line-1 u-m-t-10 u-font-26">{{item.vname}}</view>
|
||||
@@ -216,40 +216,10 @@
|
||||
this.$getMsg('已添加成功', 1500, false, 'success')
|
||||
},
|
||||
// 进入短剧播放页面
|
||||
govideo(vlid) {
|
||||
if (tt.canIUse('video-player')) {
|
||||
govideo(vid, min) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/index/VideoPlayer?vl_id=' + vlid
|
||||
url: '/pagesA/player/detailPlayer?vid=' + vlid + '&mid=' + min || 0
|
||||
})
|
||||
return
|
||||
this.$api.videoGroupInfo({
|
||||
vl_id: vlid,
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
if (res.data.video_look == false) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/VideoPlayer?tt_album_id=' + res.data
|
||||
.album_id +
|
||||
'&tt_episode_id=' + res.data.video_info[0].episode_id +
|
||||
'&vl_id=' +
|
||||
vlid
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/VideoPlayer?tt_album_id=' + res.data
|
||||
.album_id +
|
||||
'&tt_episode_id=' + res.data.video_info[res.data
|
||||
.video_look.weigh -
|
||||
1].episode_id + '&vl_id=' + vlid
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$getMsg(res.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$getMsg('当前版本过低,请升级抖音后观看')
|
||||
}
|
||||
},
|
||||
getbottom() {
|
||||
//避免多次触发
|
||||
|
||||
@@ -127,7 +127,6 @@ export default {
|
||||
|
||||
|
||||
methods: {
|
||||
|
||||
// 获取页面宽高数据& 系统信息
|
||||
getPageDefault() {
|
||||
console.log(this.system, uni.getSystemInfoSync())
|
||||
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
|
||||
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
console.log(e,999999)
|
||||
this.userinfo = uni.getStorageSync("userinfo");
|
||||
this.getPageDefault();
|
||||
this.checkQueryData(e);
|
||||
|
||||
+126
-128
@@ -3,14 +3,16 @@
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="header" :style="{marginTop:searchBarTop + 'px',height:searchBarHeight + 'px'}">
|
||||
<view style="height: 45px;display: flex;width: 100%;padding-left: 15rpx; " @tap.stop="back_load">
|
||||
<image src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/on_back.png" style="width: 44rpx;height: 44rpx;"></image>
|
||||
<image :src="config.webUrl + '/static/wechat/static/on_back.png'" style="width: 44rpx;height: 44rpx;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="header">
|
||||
<view style="height: 45px;display: flex;width: 100%;padding-top: 10px; " @tap.stop="back_load">
|
||||
<image src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/on_back.png" style="width: 44rpx;height: 44rpx;"></image>
|
||||
<image :src="config.webUrl + '/static/wechat/static/on_back.png'" style="width: 44rpx;height: 44rpx;">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
@@ -21,28 +23,15 @@
|
||||
<view class="swiperItemContent" style="color: #ffffff;">
|
||||
<view class="payVideo" v-if="videoIndex == swiperCurrent && videoItem.pays == '2'">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<video-player class="video"
|
||||
:album-id="videoItem.album_id"
|
||||
:cloud-type="1"
|
||||
:autoplay="true"
|
||||
:episode-id="videoItem.episode_id"
|
||||
:controls="true"
|
||||
:loop="false"
|
||||
:enable-progress-gesture="false"
|
||||
@ended="videoPlayerEnded"
|
||||
:show-fullscreen-btn='false'
|
||||
@loadedmetadata="loadedmetadata"
|
||||
@error="videoPalyerErr">
|
||||
<video-player class="video" :album-id="videoItem.album_id" :cloud-type="1" :autoplay="true"
|
||||
:episode-id="videoItem.episode_id" :controls="true" :loop="false"
|
||||
:enable-progress-gesture="false" @ended="videoPlayerEnded" :show-fullscreen-btn='false'
|
||||
@loadedmetadata="loadedmetadata" @error="videoPalyerErr">
|
||||
</video-player>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP || H5-->
|
||||
<video class="video"
|
||||
:id="videoItem._id"
|
||||
:poster="videoItem.img"
|
||||
:autoplay="true"
|
||||
object-fit="contain"
|
||||
@ended="videoPlayerEnded"
|
||||
@loadedmetadata="loadedmetadata"
|
||||
<video class="video" :id="videoItem._id" :poster="videoItem.img" :autoplay="true"
|
||||
object-fit="contain" @ended="videoPlayerEnded" @loadedmetadata="loadedmetadata"
|
||||
:src="videoItem.src"></video>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
@@ -52,17 +41,20 @@
|
||||
|
||||
<view class="rightBtnList" v-if="videoIndex == swiperCurrent && videoItem.pays == 2">
|
||||
<view class="btnItem" @click="userChangeLike(videoItem)" v-if="userInfo.id">
|
||||
<image class="videoBtnImg" v-if="videoItem.like=='2'" src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/aixinRed.png"
|
||||
mode="scaleToFill"></image>
|
||||
<image class="videoBtnImg" v-else src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/aixin.png"
|
||||
mode="scaleToFill"></image>
|
||||
<image class="videoBtnImg" v-if="videoItem.like=='2'"
|
||||
:src="config.webUrl + '/static/wechat/static/aixinRed.png'" mode="scaleToFill"></image>
|
||||
<image class="videoBtnImg" v-else :src="config.webUrl + '/static/wechat/static/aixin.png'"
|
||||
mode="scaleToFill">
|
||||
</image>
|
||||
<view class="btnText">{{videoItem.like_n>0?videoItem.like_n:'0'}}</view>
|
||||
</view>
|
||||
<view class="btnItem" @click="userChangeStar(videoItem)" v-if="userInfo.id">
|
||||
<image class="videoBtnImg" v-if="videoInfo.iszj=='2'" src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/scRed.png"
|
||||
mode="scaleToFill"></image>
|
||||
<image class="videoBtnImg" v-else src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/sc.png"
|
||||
mode="scaleToFill"></image>
|
||||
<image class="videoBtnImg" v-if="videoInfo.iszj=='2'"
|
||||
:src="config.webUrl + '/static/wechat/static/scRed.png'" mode="scaleToFill">
|
||||
</image>
|
||||
<image class="videoBtnImg" v-else :src="config.webUrl + '/static/wechat/static/sc.png'"
|
||||
mode="scaleToFill">
|
||||
</image>
|
||||
<!-- <text class="btnText" >{{videoItem.like_n>0?videoItem.iszj_n : '0'}}</text>-->
|
||||
<view class=" btnTextRed" v-if="videoInfo.iszj=='2'">已追</view>
|
||||
<view class="btnText" v-else>追剧</view>
|
||||
@@ -70,15 +62,19 @@
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="btnItem" @click="copyShareLink(videoItem)" v-if="userInfo.id">
|
||||
<image class="videoBtnImg" src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/icon/share-fill.png" mode=""></image>
|
||||
<image class="videoBtnImg"
|
||||
:src="config.webUrl + '/static/wechat/static/icon/share-fill.png'" mode="">
|
||||
</image>
|
||||
<view class="btnText">分享</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="videoFooter" v-if="videoIndex == swiperCurrent && videoInfo.id" @click="showChoice">
|
||||
<view class="videoName">
|
||||
<image class="footerTv" src="https://wxtietong.hnjrdzkj.xyz/static/wechat/static/video.png" mode="scaleToFill"></image>
|
||||
<text class="footerTvText">{{videoInfo.name}} · 当前第{{videoItem.weigh}}集/全{{videoInfo.sum}}集</text>
|
||||
<image class="footerTv" :src="config.webUrl + '/static/wechat/static/video.png'"
|
||||
mode="scaleToFill"></image>
|
||||
<text class="footerTvText">{{videoInfo.name}} ·
|
||||
当前第{{videoItem.weigh}}集/全{{videoInfo.sum}}集</text>
|
||||
</view>
|
||||
<view class="choiceVideo">
|
||||
<text class="choiceVideoTexts">选集</text>
|
||||
@@ -90,13 +86,8 @@
|
||||
|
||||
</swiper>
|
||||
|
||||
<recharge ref="rechargePups"
|
||||
:userBeans="userBeansNum"
|
||||
:play-video-info="playVideoDetail"
|
||||
:video-info="videoInfo"
|
||||
:pageHeight="pupHeight"
|
||||
@rechargeSuccess="rechargeSuccess"
|
||||
></recharge>
|
||||
<recharge ref="rechargePups" :userBeans="userBeansNum" :play-video-info="playVideoDetail"
|
||||
:video-info="videoInfo" :pageHeight="pupHeight" @rechargeSuccess="rechargeSuccess"></recharge>
|
||||
<selectVideo ref="choiceVideoPup" @choiceVideoItem="changePlaying" :play-video-info="playVideoDetail"
|
||||
:video-info="videoInfo">
|
||||
</selectVideo>
|
||||
@@ -106,13 +97,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import selectVideo from "@/components/select/video.vue"
|
||||
import recharge from "@/pagesA/components/recharge/rechargePup.vue"
|
||||
import PAY from "@/utils/pay"
|
||||
import login from "@/utils/login";
|
||||
import config from "@/utils/config";
|
||||
export default {
|
||||
import selectVideo from "@/components/select/video.vue"
|
||||
import recharge from "@/pagesA/components/recharge/rechargePup.vue"
|
||||
import PAY from "@/utils/pay"
|
||||
import login from "@/utils/login";
|
||||
import config from "@/utils/config";
|
||||
export default {
|
||||
components: {
|
||||
selectVideo,
|
||||
recharge
|
||||
@@ -157,8 +147,8 @@ export default {
|
||||
userBeansNum: 0,
|
||||
videoId: '',
|
||||
imageUrl: "",
|
||||
searchBarTop:0,
|
||||
searchBarHeight:0,
|
||||
searchBarTop: 0,
|
||||
searchBarHeight: 0,
|
||||
winHeight: '800px',
|
||||
pupHeight: "400px",
|
||||
onPlayVideo: null,
|
||||
@@ -167,7 +157,7 @@ export default {
|
||||
|
||||
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
console.log(config.webUrl);
|
||||
this.userinfo = uni.getStorageSync("userinfo");
|
||||
this.getPageDefault();
|
||||
this.checkQueryData(e);
|
||||
@@ -199,7 +189,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
// #ifdef MP-WEIXIN
|
||||
login.wxLogin().then(res=>{
|
||||
login.wxLogin().then(res => {
|
||||
this.openid = uni.getStorageSync("openid");
|
||||
if (e.adv_id && e.code) {
|
||||
this.bindUser(e).then(res => {
|
||||
@@ -218,13 +208,15 @@ export default {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/login/login'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
uni.switchTab({url: '/pages/tabs/home'})
|
||||
uni.switchTab({
|
||||
url: '/pages/tabs/home'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -235,7 +227,6 @@ export default {
|
||||
|
||||
|
||||
methods: {
|
||||
|
||||
// 获取页面宽高数据& 系统信息
|
||||
getPageDefault() {
|
||||
console.log(this.system, uni.getSystemInfoSync())
|
||||
@@ -252,9 +243,9 @@ export default {
|
||||
this.wxlx = 'wxgzh';
|
||||
}
|
||||
//#endif
|
||||
this.winHeight = uni.getWindowInfo().windowHeight+"px";
|
||||
console.log(uni.getWindowInfo().windowHeight+"px")
|
||||
this.pupHeight =( uni.getWindowInfo().windowHeight - 40 )+ "px";
|
||||
this.winHeight = uni.getWindowInfo().windowHeight + "px";
|
||||
console.log(uni.getWindowInfo().windowHeight + "px")
|
||||
this.pupHeight = (uni.getWindowInfo().windowHeight - 40) + "px";
|
||||
uni.setStorage({
|
||||
key: 'isbuy',
|
||||
data: 1
|
||||
@@ -311,27 +302,28 @@ export default {
|
||||
that.$httpRequest({
|
||||
url: '/api/user/callbackBinding',
|
||||
data: upData,
|
||||
methods:"GET"
|
||||
methods: "GET"
|
||||
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
uni.setStorageSync('get_ad_code', res.data.code);
|
||||
resolve(res)
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取播放器信息
|
||||
getWechartVideoDel(data) {
|
||||
console.log(data, "我要跳了 啊啊啊");
|
||||
let that = this
|
||||
that.$httpRequest({
|
||||
url: '/api/video/videoIdToDramaId',
|
||||
data: {
|
||||
vid: data.vid,
|
||||
},
|
||||
methods:"GET"
|
||||
}).then(videoRes=>{
|
||||
console.log(videoRes)
|
||||
methods: "GET"
|
||||
}).then(videoRes => {
|
||||
console.log(videoRes, "我要跳了")
|
||||
let fxpid = uni.getStorageSync("userinfo").id,
|
||||
invite = uni.getStorageSync("userinfo").invite || '';
|
||||
let param = JSON.stringify({
|
||||
@@ -341,7 +333,7 @@ export default {
|
||||
invite: invite
|
||||
})
|
||||
// 获取活动指定的是那一集并跳转到指定剧集
|
||||
if(data.vs_id){
|
||||
if (data.vs_id) {
|
||||
that.$httpRequest({
|
||||
url: '/api/video/getPushDataInfo',
|
||||
data: {
|
||||
@@ -350,7 +342,7 @@ export default {
|
||||
methods: "GET",
|
||||
isLoading: true,
|
||||
}).then(advRes => {
|
||||
let nums = advRes.data.weigh?advRes.data.weigh: 0
|
||||
let nums = advRes.data.weigh ? advRes.data.weigh : 0
|
||||
uni.redirectTo({
|
||||
url: `plugin-private://wx94a6522b1d640c3b/pages/playlet/playlet?dramaId=${videoRes.data.drama_id}&srcAppid=${videoRes.data.appid?videoRes.data.appid:that.$config.mini_appid}&serialNo=${nums?nums:1}&extParam=${param}`
|
||||
})
|
||||
@@ -358,13 +350,13 @@ export default {
|
||||
console.log('get activity err');
|
||||
console.log(advErr);
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: `plugin-private://wx94a6522b1d640c3b/pages/playlet/playlet?dramaId=${videoRes.data.drama_id}&srcAppid=${videoRes.data.appid?videoRes.data.appid:that.$config.mini_appid}&serialNo=${data.num?data.num:1}&extParam=${param}`
|
||||
})
|
||||
}
|
||||
console.log(videoRes.data.appid?that.$config.mini_appid:videoRes.data.appid)
|
||||
}).catch(videoErr=>{
|
||||
console.log(videoRes.data.appid ? that.$config.mini_appid : videoRes.data.appid)
|
||||
}).catch(videoErr => {
|
||||
console.log('get video id error')
|
||||
console.log(videoErr)
|
||||
})
|
||||
@@ -375,15 +367,15 @@ export default {
|
||||
get_user_info() {
|
||||
let that = this;
|
||||
that.$httpRequest({
|
||||
url:'/api/user/index'
|
||||
}).then(res=>{
|
||||
url: '/api/user/index'
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.removeStorageSync("userinfo")
|
||||
uni.setStorageSync('userinfo', res.data);
|
||||
that.userInfo = res.data;
|
||||
that.userBeansNum = res.data.beans;
|
||||
}
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
@@ -408,10 +400,10 @@ export default {
|
||||
title: '分享标题',
|
||||
summary: '分享总结',
|
||||
imageUrl: '',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
fail: function(err) {
|
||||
console.log("fail:" + JSON.stringify(err));
|
||||
}
|
||||
})
|
||||
@@ -452,22 +444,24 @@ export default {
|
||||
getVideoList(isSync, num) {
|
||||
let that = this
|
||||
if (that.page.isNextPage) {
|
||||
console.log('get video List',)
|
||||
console.log('get video List', )
|
||||
that.$httpRequest({
|
||||
url:'/api/video/videoinfo',
|
||||
data:{
|
||||
url: '/api/video/videoinfo',
|
||||
data: {
|
||||
page: that.page.currentPage,
|
||||
limit: that.page.pageSize,
|
||||
vid: that.videoId,
|
||||
}
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
if (res.total < that.page.pageSize * that.page.currentPage) {
|
||||
that.page.isNextPage = false;
|
||||
}
|
||||
if (that.page.currentPage == 1) {
|
||||
res.videodata.iszj = res.data[0].iszj;
|
||||
that.videoInfo = res.videodata;
|
||||
uni.setNavigationBarTitle({title: res.videodata.name})
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.videodata.name
|
||||
})
|
||||
res.data.forEach(item => {
|
||||
item._id = 'ks_' + item.id;
|
||||
})
|
||||
@@ -488,9 +482,8 @@ export default {
|
||||
})
|
||||
} else if (isSync && that.videoListData.length < num + 1) {
|
||||
that.getVideoList(isSync, num);
|
||||
} else {
|
||||
}
|
||||
}).catch(err=>{
|
||||
} else {}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
@@ -504,15 +497,15 @@ export default {
|
||||
// 检查金豆余额是否足够支付
|
||||
if (that.userBeansNum >= that.playVideoDetail.beans) {
|
||||
// 用户是否开启自动金豆支付
|
||||
if(that.userInfo.type){ //1自动扣费 2手动支付
|
||||
if (that.userInfo.type) { //1自动扣费 2手动支付
|
||||
// 金豆支付
|
||||
that.beansPaying();
|
||||
}else{
|
||||
} else {
|
||||
// 弹出支付询问弹窗
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否支付' + that.playVideoDetail.beans + '金豆观看视频',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.beansPaying();
|
||||
} else if (res.cancel) {
|
||||
@@ -530,7 +523,8 @@ export default {
|
||||
that.getVideoSrc()
|
||||
} else {
|
||||
that.$nextTick(() => {
|
||||
that.onPlayVideo = uni.createVideoContext(that.videoListData[that.swiperCurrent]._id, that);
|
||||
that.onPlayVideo = uni.createVideoContext(that.videoListData[that.swiperCurrent]._id,
|
||||
that);
|
||||
console.log('check end play videos ')
|
||||
that.onPlayVideo.play();
|
||||
})
|
||||
@@ -539,21 +533,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
beansPaying(){
|
||||
beansPaying() {
|
||||
let that = this;
|
||||
let upData = {
|
||||
buytype: "金豆",
|
||||
beans: that.playVideoDetail.beans,
|
||||
id: that.playVideoDetail.id,
|
||||
smid: that.playVideoDetail.id,
|
||||
wxlx:"wxxcx",
|
||||
wxlx: "wxxcx",
|
||||
uid: that.userInfo.id,
|
||||
token: that.userInfo.token,
|
||||
sum: 1,
|
||||
ad_code: uni.getStorageSync('get_ad_code'),
|
||||
pricebuy: that.playVideoDetail.isvip == 2 ? that.playVideoDetail.vippriceq : that.playVideoDetail.priceq,
|
||||
pricebuy: that.playVideoDetail.isvip == 2 ? that.playVideoDetail.vippriceq : that.playVideoDetail
|
||||
.priceq,
|
||||
openid: uni.getStorageSync('openid'),
|
||||
lx: 2,//1全集购买 2单集购买
|
||||
lx: 2, //1全集购买 2单集购买
|
||||
}
|
||||
|
||||
PAY.pays.beansPay(upData).then(res => {
|
||||
@@ -565,7 +560,7 @@ export default {
|
||||
// that.onPlayVideo.play();
|
||||
// 更新播放
|
||||
that.upPlayNum();
|
||||
}else if(res.data.code ==0 && res.data.msg =='msg: "金豆不足"'){
|
||||
} else if (res.data.code == 0 && res.data.msg == 'msg: "金豆不足"') {
|
||||
this.$refs.rechargePups.showRechargePup();
|
||||
}
|
||||
}).catch(err => {
|
||||
@@ -588,14 +583,14 @@ export default {
|
||||
getVideoSrc() {
|
||||
let that = this;
|
||||
that.$httpRequest({
|
||||
url:'/api/video/memberUnlockVideo',
|
||||
url: '/api/video/memberUnlockVideo',
|
||||
method: "GET",
|
||||
data:{
|
||||
data: {
|
||||
smid: that.playVideoDetail.id,
|
||||
vid: that.videoInfo.id,
|
||||
},
|
||||
isLoading: true,
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.showLoading()
|
||||
this.videoListData[this.swiperCurrent].src = res.data.src
|
||||
@@ -604,7 +599,7 @@ export default {
|
||||
that.onPlayVideo.play();
|
||||
})
|
||||
}
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
@@ -634,14 +629,14 @@ export default {
|
||||
let that = this
|
||||
if (uni.getStorageSync("userinfo")) {
|
||||
that.$httpRequest({
|
||||
url:'/api/video/bfjl',
|
||||
url: '/api/video/bfjl',
|
||||
method: "GET",
|
||||
data:{
|
||||
data: {
|
||||
vid: that.videoInfo.id,
|
||||
mid: that.playVideoDetail.id,
|
||||
uid: that.userInfo.id
|
||||
},
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
console.log('up play end')
|
||||
})
|
||||
}
|
||||
@@ -650,15 +645,15 @@ export default {
|
||||
userChangeStar() {
|
||||
let that = this;
|
||||
that.$httpRequest({
|
||||
url:'/api/user/videorecord',
|
||||
url: '/api/user/videorecord',
|
||||
method: "GET",
|
||||
data:{
|
||||
data: {
|
||||
uid: that.userInfo.id,
|
||||
vid: that.videoId,
|
||||
mid: that.playVideoDetail.id,
|
||||
ad_code: uni.getStorageSync('get_ad_code')
|
||||
},
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
that.videoInfo.iszj = that.videoInfo.iszj == 1 ? 2 : 1
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -671,13 +666,13 @@ export default {
|
||||
userChangeLike() {
|
||||
let that = this;
|
||||
that.$httpRequest({
|
||||
url:'/api/user/tapLove',
|
||||
url: '/api/user/tapLove',
|
||||
method: "GET",
|
||||
data:{
|
||||
data: {
|
||||
vid: that.videoId,
|
||||
mid: that.playVideoDetail.id
|
||||
},
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
that.playVideoDetail.like = that.playVideoDetail.like == 1 ? 2 : 1
|
||||
let likeNUm = that.playVideoDetail.like_n
|
||||
that.playVideoDetail.like_n = that.playVideoDetail.like == 1 ? likeNUm - 1 : likeNUm + 1
|
||||
@@ -692,7 +687,7 @@ export default {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否将此剧加入追剧列表?',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.userChangeStar()
|
||||
} else if (res.cancel) {
|
||||
@@ -713,21 +708,22 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
onShareAppMessage: function (res) {
|
||||
onShareAppMessage: function(res) {
|
||||
let that = this;
|
||||
// #ifdef MP-WEIXIN || MP-TOUTIAO
|
||||
let invite = this.userinfo.invite ? this.userinfo.invite : "";
|
||||
let video = that.originList[that.originIndex];
|
||||
var href = '/pagesA/player/detailPlayer?vid=' + this.videoId + '&fxpid=' + this.userinfo.id + '&mid=0' + '&invite=' +
|
||||
var href = '/pagesA/player/detailPlayer?vid=' + this.videoId + '&fxpid=' + this.userinfo.id + '&mid=0' +
|
||||
'&invite=' +
|
||||
invite + '&tt_album_id=' + video.album_id + '&tt_episode_id=' + video.episode_id
|
||||
const obj = {
|
||||
title: that.title_text,
|
||||
imageUrl: '',
|
||||
path: href,
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
console.log(res, "转发成功")
|
||||
},
|
||||
fail: function (res) {
|
||||
fail: function(res) {
|
||||
wx.showToast({
|
||||
title: '发送失败',
|
||||
icon: 'none'
|
||||
@@ -738,17 +734,17 @@ export default {
|
||||
// #endif
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pages {
|
||||
.pages {
|
||||
background-color: #000000;
|
||||
height: 100vh;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.header {
|
||||
.header {
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -757,38 +753,40 @@ export default {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper {
|
||||
.swiper {
|
||||
width: 750rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.swiperItemContent {
|
||||
.swiperItemContent {
|
||||
position: relative;
|
||||
width: 750rpx;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.payVideo {
|
||||
.payVideo {
|
||||
width: 750rpx;
|
||||
height: calc(100vh - 100rpx);
|
||||
|
||||
.video {
|
||||
width: 750rpx;
|
||||
height: calc(100vh - 100rpx);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.noPayVideo {
|
||||
.noPayVideo {
|
||||
width: 750rpx;
|
||||
height: 100%;
|
||||
|
||||
.videoCove {
|
||||
width: 800rpx;
|
||||
height: calc(100% - 70rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rightBtnList {
|
||||
.rightBtnList {
|
||||
position: absolute;
|
||||
right: 34rpx;
|
||||
top: calc(50% - 200rpx);
|
||||
@@ -800,6 +798,7 @@ export default {
|
||||
margin-top: 40rpx;
|
||||
background: none;
|
||||
text-align: center;
|
||||
|
||||
.videoBtnImg {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
@@ -828,10 +827,10 @@ export default {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.choiceTitleLine {
|
||||
.choiceTitleLine {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -849,9 +848,9 @@ export default {
|
||||
border-radius: 8rpx;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.videoFooter {
|
||||
.videoFooter {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -861,6 +860,7 @@ export default {
|
||||
height: 80rpx;
|
||||
font-size: 22rpx;
|
||||
color: #FFFFFF;
|
||||
|
||||
.footerTv {
|
||||
width: 40rpx;
|
||||
height: 26rpx;
|
||||
@@ -907,7 +907,5 @@ export default {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
let showtype = false
|
||||
|
||||
// 激励视频广告实例(微信小程序)
|
||||
const rewardedAd = wx.createRewardedVideoAd({
|
||||
adUnitId: 'adunit-xxxxxxxxxx', // TODO: 替换为你的微信激励广告单元ID
|
||||
});
|
||||
|
||||
// 加载激励视频广告
|
||||
function insertAdload() {
|
||||
rewardedAd.load().catch((err) => {
|
||||
console.log('激励广告加载失败', err);
|
||||
});
|
||||
}
|
||||
|
||||
// 显示激励视频广告
|
||||
function insertAdshow() {
|
||||
if (showtype) {
|
||||
console.log("显示广告");
|
||||
rewardedAd.show().catch((err) => {
|
||||
console.log('激励广告显示失败', err);
|
||||
rewardedAd.load();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 监听广告加载成功(支持回调)
|
||||
function insertAdonLoad(onSuccess) {
|
||||
rewardedAd.onLoad(() => {
|
||||
showtype = true;
|
||||
console.log('激励广告加载成功');
|
||||
onSuccess && onSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
// 监听错误(支持回调)
|
||||
function insertAdonError(onFail) {
|
||||
rewardedAd.onError((err) => {
|
||||
console.log('激励广告错误', err);
|
||||
showtype = false;
|
||||
onFail && onFail();
|
||||
setTimeout(() => {
|
||||
insertAdload();
|
||||
}, 30000);
|
||||
});
|
||||
}
|
||||
|
||||
// 监听广告关闭(微信特有:可判断是否看完)
|
||||
function insertAdonClose(callback) {
|
||||
rewardedAd.onClose((res) => {
|
||||
console.log('激励广告关闭', res);
|
||||
if (res && res.isEnded) {
|
||||
callback && callback(true);
|
||||
} else {
|
||||
callback && callback(false);
|
||||
}
|
||||
insertAdload();
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
insertAdload,
|
||||
insertAdshow,
|
||||
insertAdonError,
|
||||
insertAdonLoad,
|
||||
insertAdonClose
|
||||
}
|
||||
+18
-15
@@ -1,20 +1,22 @@
|
||||
|
||||
import {httpRequest} from "./request.js";
|
||||
const login={
|
||||
wxLogin(){
|
||||
return new Promise((resolve,reject)=>{
|
||||
import {
|
||||
httpRequest
|
||||
} from "./request.js";
|
||||
const login = {
|
||||
wxLogin() {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res) => {
|
||||
httpRequest({
|
||||
url:'/api/user/getOpenid',
|
||||
data:{
|
||||
url: '/api/user/getOpenid',
|
||||
data: {
|
||||
code: res.code, //wx.login 登录成功后的code
|
||||
ad_code: uni.getStorageSync('get_ad_code'),
|
||||
invite: uni.getStorageSync("invite_number")
|
||||
},
|
||||
|
||||
}).then((opRes)=>{
|
||||
}).then((opRes) => {
|
||||
if (res.code == 1) {
|
||||
uni.setStorageSync("openid", opRes.data.openid)
|
||||
if (opRes.msg == '登录成功') {
|
||||
uni.setStorageSync("userinfo", opRes.data.userinfo);
|
||||
@@ -28,7 +30,8 @@ const login={
|
||||
reject(logPErr)
|
||||
})
|
||||
}
|
||||
}).catch(opErr=>{
|
||||
}
|
||||
}).catch(opErr => {
|
||||
reject(opErr)
|
||||
})
|
||||
},
|
||||
@@ -42,25 +45,25 @@ const login={
|
||||
Loginops(openData) {
|
||||
return new Promise((resolve, reject) => {
|
||||
httpRequest({
|
||||
url:'/api/user/getphone',
|
||||
url: '/api/user/getphone',
|
||||
method: 'GET',
|
||||
data: {
|
||||
openid: openData.data.openid,
|
||||
pid: '0',
|
||||
invite: uni.getStorageSync('invite_number') ||'',
|
||||
invite: uni.getStorageSync('invite_number') || '',
|
||||
ad_code: uni.getStorageSync('get_ad_code') || ''
|
||||
},
|
||||
}).then(uRes=>{
|
||||
if(uRes.code ==1){
|
||||
}).then(uRes => {
|
||||
if (uRes.code == 1) {
|
||||
uni.setStorageSync("userinfo", uRes.data.userinfo);
|
||||
uni.setStorageSync("token", uRes.data.userinfo.token);
|
||||
uni.setStorageSync("config", uRes.data.config);
|
||||
resolve('login success')
|
||||
}
|
||||
}).catch(uErr=>{
|
||||
}).catch(uErr => {
|
||||
reject(uErr)
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
export default login
|
||||
export default login
|
||||
+235
-149
@@ -1,7 +1,12 @@
|
||||
var playletPlugin = requirePlugin("playlet-plugin");
|
||||
var serialNo = null
|
||||
import configs from '@/utils/config.js';
|
||||
import {httpRequest} from '@/utils/request'
|
||||
import {login} from './login'
|
||||
import {
|
||||
httpRequest
|
||||
} from '@/utils/request'
|
||||
import {
|
||||
login
|
||||
} from './login'
|
||||
import PAY from '@/utils/pay'
|
||||
// 点击按钮触发此函数跳转到播放器页面
|
||||
function navigateToPlayer(obj) {
|
||||
@@ -9,11 +14,17 @@ function navigateToPlayer(obj) {
|
||||
// 变量${srcAppid}是提审方appid
|
||||
// 变量${serialNo}第几集
|
||||
// 变量${extParam}是分享参数,分享的卡片和二维码会在分享的链接上携带此参数
|
||||
const { extParam, dramaId, srcAppid=configs.mini_appid,serialNo=1 } = obj
|
||||
const {
|
||||
extParam,
|
||||
dramaId,
|
||||
srcAppid = configs.mini_appid,
|
||||
serialNo = 1
|
||||
} = obj
|
||||
wx.navigateTo({
|
||||
url: `plugin-private://wx94a6522b1d640c3b/pages/playlet/playlet?dramaId=${dramaId}&srcAppid=${srcAppid}&serialNo=${serialNo}&extParam=${extParam || ''}`
|
||||
})
|
||||
}
|
||||
|
||||
function deepClone(obj) {
|
||||
if (typeof obj !== 'object' || !obj) return obj
|
||||
let newObj = obj instanceof Array ? [] : {}
|
||||
@@ -29,30 +40,30 @@ function deepClone(obj) {
|
||||
|
||||
const proto = {
|
||||
data: { // 可通过this.data访问
|
||||
playerId: '',//播放器id
|
||||
playerId: '', //播放器id
|
||||
arr: [],
|
||||
vid:"",//剧id
|
||||
info:{},
|
||||
mid:"",//剧集id
|
||||
userInfo:{},
|
||||
is_record:0,//是否追剧 0未追 1已追
|
||||
pay_oid:'',
|
||||
vid: "", //剧id
|
||||
info: {},
|
||||
mid: "", //剧集id
|
||||
userInfo: {},
|
||||
is_record: 0, //是否追剧 0未追 1已追
|
||||
pay_oid: '',
|
||||
},
|
||||
_onPlayerLoad(info) {
|
||||
let that = this,
|
||||
shareInterval = null;
|
||||
console.log("_onPlayerLoad",info);
|
||||
if(info.extParam){
|
||||
if(info.extParam.indexOf("%")<0){
|
||||
console.log("_onPlayerLoad", info);
|
||||
if (info.extParam) {
|
||||
if (info.extParam.indexOf("%") < 0) {
|
||||
this.data.info = info;
|
||||
}else if(info.extParam){
|
||||
info.extParam = decodeURIComponent(info.extParam )
|
||||
} else if (info.extParam) {
|
||||
info.extParam = decodeURIComponent(info.extParam)
|
||||
this.data.info = info;
|
||||
}else{}
|
||||
} else {}
|
||||
this.data.vid = JSON.parse(info.extParam).vid;
|
||||
if(JSON.parse(info.extParam).g_order_id){//存储分享后的gid
|
||||
uni.setStorageSync('g_order_id',JSON.parse(info.extParam).g_order_id);
|
||||
uni.setStorageSync('g_order_vid',JSON.parse(info.extParam).vid);
|
||||
if (JSON.parse(info.extParam).g_order_id) { //存储分享后的gid
|
||||
uni.setStorageSync('g_order_id', JSON.parse(info.extParam).g_order_id);
|
||||
uni.setStorageSync('g_order_vid', JSON.parse(info.extParam).vid);
|
||||
}
|
||||
}
|
||||
this.data.playerId = info.playerId
|
||||
@@ -60,33 +71,37 @@ const proto = {
|
||||
this.pm = pm
|
||||
|
||||
let user = uni.getStorageSync('userinfo');
|
||||
if(user.token){
|
||||
if (user.token) {
|
||||
this.data.userInfo = uni.getStorageSync('userinfo');
|
||||
console.log('onPlayerLoad info', info, 'data', this.data)
|
||||
that.getVideoId();
|
||||
that.getEncryptData({serialNo: info.serialNo}).then(setRes => {
|
||||
that.getEncryptData({
|
||||
serialNo: info.serialNo
|
||||
}).then(setRes => {
|
||||
// encryptedData是后台加密后的数据,具体实现见官方文档的加密章节
|
||||
let lists = [setRes.data];
|
||||
pm.setCanPlaySerialList({
|
||||
data: setRes.encryptedData,
|
||||
freeList:lists
|
||||
freeList: lists
|
||||
// freeList: [{ // 1~10集是免费剧,data里面的字段也必须至少设置1~10集可播放
|
||||
// start_serial_no: setRes.data.start_serial_no,
|
||||
// end_serial_no: setRes.data.end_serial_no
|
||||
// }],
|
||||
})
|
||||
});
|
||||
}else{
|
||||
login.wxLogin().then(res=>{
|
||||
} else {
|
||||
login.wxLogin().then(res => {
|
||||
this.data.userInfo = uni.getStorageSync('userinfo');
|
||||
console.log('onPlayerLoad info', info, 'data', this.data)
|
||||
that.getVideoId();
|
||||
that.getEncryptData({serialNo: info.serialNo}).then(setRes => {
|
||||
that.getEncryptData({
|
||||
serialNo: info.serialNo
|
||||
}).then(setRes => {
|
||||
// encryptedData是后台加密后的数据,具体实现见官方文档的加密章节
|
||||
let lists = [setRes.data];
|
||||
pm.setCanPlaySerialList({
|
||||
data: setRes.encryptedData,
|
||||
freeList:lists
|
||||
freeList: lists
|
||||
})
|
||||
});
|
||||
});
|
||||
@@ -103,18 +118,20 @@ const proto = {
|
||||
})
|
||||
// 参考文档章节“数据上报”
|
||||
pm.onDataReport((obj) => {
|
||||
if(obj.event === playletPlugin.REPORT_DATA_EVENTS.LIKE || obj.event === playletPlugin.REPORT_DATA_EVENTS.UNLIKE){//监听点赞、取消点赞操作
|
||||
if (obj.event === playletPlugin.REPORT_DATA_EVENTS.LIKE || obj.event === playletPlugin
|
||||
.REPORT_DATA_EVENTS.UNLIKE) { //监听点赞、取消点赞操作
|
||||
console.log("user like")
|
||||
this.userLikeChange();
|
||||
}else if(obj.event === playletPlugin.REPORT_DATA_EVENTS.FAV || obj.event === playletPlugin.REPORT_DATA_EVENTS.UNFAV){//监听在追,取消在追操作
|
||||
} else if (obj.event === playletPlugin.REPORT_DATA_EVENTS.FAV || obj.event === playletPlugin
|
||||
.REPORT_DATA_EVENTS.UNFAV) { //监听在追,取消在追操作
|
||||
console.log("user zhui ju")
|
||||
this.changeStar()
|
||||
}else if(obj.event === playletPlugin.REPORT_DATA_EVENTS.CHANGE_SERIAL){//监听切换剧集操作
|
||||
} else if (obj.event === playletPlugin.REPORT_DATA_EVENTS.CHANGE_SERIAL) { //监听切换剧集操作
|
||||
console.log("user changePlay log")
|
||||
this.changePlayLog()
|
||||
}else if(obj.event === playletPlugin.REPORT_DATA_EVENTS.SHARE){//监听分享操作
|
||||
} else if (obj.event === playletPlugin.REPORT_DATA_EVENTS.SHARE) { //监听分享操作
|
||||
console.log("user share")
|
||||
}else {
|
||||
} else {
|
||||
// console.log("其他操作")
|
||||
}
|
||||
|
||||
@@ -127,14 +144,12 @@ const proto = {
|
||||
pm.updateOpenArea({
|
||||
showLeft: false,
|
||||
showRight: false,
|
||||
leftsideAreaList: [
|
||||
{
|
||||
leftsideAreaList: [{
|
||||
left: 16, // 类似绝对定位的样式
|
||||
top: 20,
|
||||
width: 72,
|
||||
height: 32
|
||||
},
|
||||
],
|
||||
}, ],
|
||||
ext: 'extInfo',
|
||||
})
|
||||
},
|
||||
@@ -163,37 +178,45 @@ const proto = {
|
||||
this.getVideoId()
|
||||
// 设置分享参数
|
||||
pm.setExtParam(JSON.stringify({
|
||||
vid:this.data.vid,
|
||||
fxpid:this.data.userInfo.id,
|
||||
invite:this.data.userInfo.invite||''
|
||||
vid: this.data.vid,
|
||||
fxpid: this.data.userInfo.id,
|
||||
invite: this.data.userInfo.invite || ''
|
||||
}))
|
||||
},
|
||||
// 检测是否可以播放
|
||||
onCheckIsCanPlay(param) {
|
||||
var that = this;
|
||||
let intervalTime=null;
|
||||
console.log('onCheckIsCanPlay param',param);
|
||||
if(uni.getStorageSync('userinfo').token){
|
||||
that.getVideoId().then(video=>{
|
||||
that.beansPay(video.data.id,param.serialNo);
|
||||
let intervalTime = null;
|
||||
serialNo = param.serialNo
|
||||
console.log('onCheckIsCanPlay param', param);
|
||||
if (uni.getStorageSync('userinfo').token) {
|
||||
that.getVideoId().then(video => {
|
||||
that.beansPay(video.data.id, param.serialNo);
|
||||
})
|
||||
}else{
|
||||
intervalTime = setInterval(()=>{
|
||||
if(uni.getStorageSync('userinfo').token){
|
||||
} else {
|
||||
intervalTime = setInterval(() => {
|
||||
if (uni.getStorageSync('userinfo').token) {
|
||||
clearInterval(intervalTime)
|
||||
that.getVideoId().then(video=>{
|
||||
that.beansPay(video.data.id,param.serialNo);
|
||||
that.getVideoId().then(video => {
|
||||
that.beansPay(video.data.id, param.serialNo);
|
||||
})
|
||||
}else {
|
||||
console.log('no users login')}
|
||||
},100)
|
||||
} else {
|
||||
console.log('no users login')
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
getEncryptData(obj) {
|
||||
const {code, serialNo } = obj;
|
||||
const {
|
||||
code,
|
||||
serialNo
|
||||
} = obj;
|
||||
let that = this;
|
||||
// TODO: 此接口请求后台,返回下面的setCanPlaySerialList接口需要的加密参数
|
||||
const { srcAppid, dramaId } = this.pm.getInfo()
|
||||
const {
|
||||
srcAppid,
|
||||
dramaId
|
||||
} = this.pm.getInfo()
|
||||
|
||||
console.log('getEncryptData start', srcAppid, dramaId, serialNo)
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -202,20 +225,20 @@ const proto = {
|
||||
success(res) {
|
||||
// console.log('code',res.code)
|
||||
httpRequest({
|
||||
url:"/api/video/videoInfoWechatV1",
|
||||
method:"GET",
|
||||
data:{
|
||||
code:res.code,
|
||||
vid:that.data.vid,
|
||||
oid:that.data.pay_oid
|
||||
url: "/api/video/videoInfoWechatV1",
|
||||
method: "GET",
|
||||
data: {
|
||||
code: res.code,
|
||||
vid: that.data.vid,
|
||||
oid: that.data.pay_oid
|
||||
}
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
console.log('videoPlayer getCanPlayList res', res)
|
||||
resolve({
|
||||
data:res.data.data,
|
||||
data: res.data.data,
|
||||
encryptedData: res.data.enData
|
||||
})
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
console.log(err)
|
||||
})
|
||||
@@ -223,19 +246,19 @@ const proto = {
|
||||
})
|
||||
})
|
||||
},
|
||||
pageBack(){
|
||||
pageBack() {
|
||||
let that = this;
|
||||
if(that.data.is_record==1){
|
||||
if (that.data.is_record == 1) {
|
||||
// that.pm.navigateBack()
|
||||
that.pm.switchTab({
|
||||
url: '/pages/tabs/home'
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.showModal({
|
||||
title:"提示",
|
||||
content:"是否将此剧加入追剧列表",
|
||||
success(modelRes){
|
||||
if(modelRes.confirm){
|
||||
title: "提示",
|
||||
content: "是否将此剧加入追剧列表",
|
||||
success(modelRes) {
|
||||
if (modelRes.confirm) {
|
||||
console.log('success');
|
||||
that.changeStar();
|
||||
}
|
||||
@@ -247,27 +270,27 @@ const proto = {
|
||||
}
|
||||
|
||||
},
|
||||
getVideoId(){
|
||||
getVideoId() {
|
||||
let that = this;
|
||||
let infos = this.pm.getInfo();
|
||||
console.log('getVideoId start',infos);
|
||||
console.log('getVideoId start', infos);
|
||||
// 获取当前需支付剧集ID(媒资库的ID不能用,需要用我们自己的剧集ID)
|
||||
return new Promise((resolve, reject) => {
|
||||
httpRequest({
|
||||
url:"/api/video/dramaIdToVideoId",
|
||||
method:"GET",
|
||||
data:{
|
||||
drama_id:infos.dramaId,
|
||||
no:infos.serialNo
|
||||
url: "/api/video/dramaIdToVideoId",
|
||||
method: "GET",
|
||||
data: {
|
||||
drama_id: infos.dramaId,
|
||||
no: infos.serialNo
|
||||
}
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
this.data.mid = res.data.id;
|
||||
if(res.data.drama_vid != that.data.vid){
|
||||
if (res.data.drama_vid != that.data.vid) {
|
||||
that.data.vid = res.data.drama_vid
|
||||
}
|
||||
this.data.is_record = res.data.is_record
|
||||
resolve(res)
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
reject(err)
|
||||
})
|
||||
@@ -277,127 +300,190 @@ const proto = {
|
||||
|
||||
|
||||
// 金豆购买剧集
|
||||
beansPay(mid,serialNo){
|
||||
beansPay(mid, serialNo) {
|
||||
let buyData = uni.getStorageSync("buydata");
|
||||
let that = this;
|
||||
console.log('beansPay begin',mid,serialNo)
|
||||
let upData={
|
||||
sum:1,
|
||||
buytype:"金豆",
|
||||
pricebuy:buyData.isvip ==2?buyData.vippriceq:buyData.priceq,
|
||||
token:uni.getStorageSync("userinfo").token,
|
||||
uid:uni.getStorageSync("userinfo").id,
|
||||
ad_code:uni.getStorageSync('get_ad_code'),
|
||||
lx:2,//1 全章购买 2单集购买
|
||||
smid:mid,//单集ID
|
||||
wxlx:'wxxcx',
|
||||
id:that.data.vid ,//剧ID
|
||||
console.log('beansPay begin', mid, serialNo)
|
||||
let upData = {
|
||||
sum: 1,
|
||||
buytype: "金豆",
|
||||
pricebuy: buyData.isvip == 2 ? buyData.vippriceq : buyData.priceq,
|
||||
token: uni.getStorageSync("userinfo").token,
|
||||
uid: uni.getStorageSync("userinfo").id,
|
||||
ad_code: uni.getStorageSync('get_ad_code'),
|
||||
lx: 2, //1 全章购买 2单集购买
|
||||
smid: mid, //单集ID
|
||||
wxlx: 'wxxcx',
|
||||
id: that.data.vid, //剧ID
|
||||
openid: uni.getStorageSync("openid")
|
||||
}
|
||||
// 支付
|
||||
PAY.pays.beansPay(upData).then((res)=>{
|
||||
console.log('beansPay res',res)
|
||||
that.getEncryptData({serialNo: serialNo}).then(enRes => {
|
||||
PAY.pays.beansPay(upData).then((res) => {
|
||||
console.log('beansPay res', res)
|
||||
that.getEncryptData({
|
||||
serialNo: serialNo
|
||||
}).then(enRes => {
|
||||
that.pm.isCanPlay({
|
||||
data: enRes.encryptedData,
|
||||
serialNo: serialNo,
|
||||
status:res.code ==1?1:2
|
||||
status: res.code == 1 ? 1 : 2
|
||||
})
|
||||
})
|
||||
}).catch(err=>{
|
||||
if(err.msg =='金豆不足'){
|
||||
that.getEncryptData({serialNo: serialNo}).then(enRes => {
|
||||
}).catch(err => {
|
||||
if (err.msg == '金豆不足') {
|
||||
that.getEncryptData({
|
||||
serialNo: serialNo
|
||||
}).then(enRes => {
|
||||
that.pm.isCanPlay({
|
||||
data: enRes.encryptedData,
|
||||
serialNo: serialNo,
|
||||
status:2
|
||||
status: 2
|
||||
})
|
||||
})
|
||||
}
|
||||
console.log('jinDouPay fail',err)
|
||||
console.log('jinDouPay fail', err)
|
||||
})
|
||||
|
||||
},
|
||||
// 更新喜欢状态
|
||||
userLikeChange(){
|
||||
userLikeChange() {
|
||||
let that = this;
|
||||
that.getVideoId({dramaId:that.data.info.dramaId,serialNo:that.data.info.serialNo}).then(res=>{
|
||||
that.getVideoId({
|
||||
dramaId: that.data.info.dramaId,
|
||||
serialNo: that.data.info.serialNo
|
||||
}).then(res => {
|
||||
httpRequest({
|
||||
url:"/api/user/tapLove",
|
||||
method:"GET",
|
||||
data:{
|
||||
vid:that.data.vid,
|
||||
mid:res.data.id
|
||||
url: "/api/user/tapLove",
|
||||
method: "GET",
|
||||
data: {
|
||||
vid: that.data.vid,
|
||||
mid: res.data.id
|
||||
}
|
||||
}).then(res=>{
|
||||
console.log('userLikeChange res',res)
|
||||
}).then(res => {
|
||||
console.log('userLikeChange res', res)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 更新追剧状态
|
||||
changeStar(){
|
||||
changeStar() {
|
||||
let that = this;
|
||||
let subData = {
|
||||
vid:that.data.vid,
|
||||
token:uni.getStorageSync("userinfo").token,
|
||||
uid:uni.getStorageSync("userinfo").id,
|
||||
mid:""
|
||||
vid: that.data.vid,
|
||||
token: uni.getStorageSync("userinfo").token,
|
||||
uid: uni.getStorageSync("userinfo").id,
|
||||
mid: ""
|
||||
}
|
||||
that.getVideoId({dramaId:that.data.info.dramaId,serialNo:that.data.info.serialNo}).then(res=>{
|
||||
that.getVideoId({
|
||||
dramaId: that.data.info.dramaId,
|
||||
serialNo: that.data.info.serialNo
|
||||
}).then(res => {
|
||||
|
||||
httpRequest({
|
||||
url:"/api/user/videorecord",
|
||||
method:"GET",
|
||||
data:{
|
||||
vid:that.data.vid,
|
||||
mid:res.data.id
|
||||
url: "/api/user/videorecord",
|
||||
method: "GET",
|
||||
data: {
|
||||
vid: that.data.vid,
|
||||
mid: res.data.id
|
||||
}
|
||||
}).then(rest=>{
|
||||
console.log('userLikeChange res',rest)
|
||||
}).catch(errs=>{
|
||||
}).then(rest => {
|
||||
console.log('userLikeChange res', rest)
|
||||
}).catch(errs => {
|
||||
console.log(errs)
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
// 更新播放记录
|
||||
changePlayLog(){
|
||||
changePlayLog() {
|
||||
let that = this;
|
||||
that.getVideoId({dramaId:that.data.info.dramaId,serialNo:that.data.info.serialNo}).then(res=>{
|
||||
console.log('changePlayLog mid',res)
|
||||
that.getVideoId({
|
||||
dramaId: that.data.info.dramaId,
|
||||
serialNo: that.data.info.serialNo
|
||||
}).then(res => {
|
||||
console.log('changePlayLog mid', res)
|
||||
httpRequest({
|
||||
url:"/api/video/bfjl",
|
||||
method:"GET",
|
||||
data:{
|
||||
vid:that.data.vid,
|
||||
mid:res.data.id
|
||||
url: "/api/video/bfjl",
|
||||
method: "GET",
|
||||
data: {
|
||||
vid: that.data.vid,
|
||||
mid: res.data.id
|
||||
}
|
||||
}).then(rest=>{
|
||||
console.log('changePlayLog res',rest)
|
||||
}).catch(errs=>{
|
||||
console.log('change PlayLog fail',errs)
|
||||
}).then(rest => {
|
||||
console.log('changePlayLog res', rest)
|
||||
}).catch(errs => {
|
||||
console.log('change PlayLog fail', errs)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 支付完
|
||||
chargeEnd(payRes){
|
||||
|
||||
adEnd(mid) {
|
||||
let buyData = uni.getStorageSync("buydata");
|
||||
let that = this;
|
||||
console.log("paySuccess",payRes)
|
||||
let upData = {
|
||||
sum: 1,
|
||||
buytype: 'adUnlock'
|
||||
pricebuy: buyData.isvip == 2 ? buyData.vippriceq : buyData.priceq,
|
||||
token: uni.getStorageSync("userinfo").token,
|
||||
uid: uni.getStorageSync("userinfo").id,
|
||||
ad_code: uni.getStorageSync('get_ad_code'),
|
||||
lx: 2, //1 全章购买 2单集购买
|
||||
smid: mid, //单集ID
|
||||
wxlx: 'wxxcx',
|
||||
id: that.data.vid, //剧ID
|
||||
openid: uni.getStorageSync("openid")
|
||||
}
|
||||
// 支付
|
||||
PAY.pays.beansPay(upData).then((res) => {
|
||||
console.log('beansPay res', res)
|
||||
that.getEncryptData({
|
||||
serialNo: serialNo.serialNo
|
||||
}).then(enRes => {
|
||||
that.pm.isCanPlay({
|
||||
data: enRes.encryptedData,
|
||||
serialNo: serialNo.serialNo,
|
||||
status: res.code == 1 ? 1 : 2
|
||||
})
|
||||
})
|
||||
}).catch(err => {
|
||||
if (err.msg == '金豆不足') {
|
||||
that.getEncryptData({
|
||||
serialNo: serialNo.serialNo
|
||||
}).then(enRes => {
|
||||
that.pm.isCanPlay({
|
||||
data: enRes.encryptedData,
|
||||
serialNo: serialNo.serialNo,
|
||||
status: 2
|
||||
})
|
||||
})
|
||||
}
|
||||
console.log('jinDouPay fail', err)
|
||||
})
|
||||
},
|
||||
|
||||
// 支付完
|
||||
chargeEnd(payRes) {
|
||||
let that = this;
|
||||
console.log("paySuccess", payRes)
|
||||
let share_g_order_vid = uni.getStorageSync('g_order_vid');
|
||||
if(payRes.status == "paySuccess"){
|
||||
if (payRes.status == "paySuccess") {
|
||||
that.data.pay_oid = payRes.oid;
|
||||
this.onCheckIsCanPlay({dramaId:that.data.info.dramaId,serialNo:payRes.serialNo,oid:payRes.oid })
|
||||
this.onCheckIsCanPlay({
|
||||
dramaId: that.data.info.dramaId,
|
||||
serialNo: payRes.serialNo,
|
||||
oid: payRes.oid
|
||||
})
|
||||
that.pm.setExtParam(JSON.stringify({
|
||||
vid:this.data.vid,
|
||||
fxpid:this.data.userInfo.id,
|
||||
invite:this.data.userInfo.invite||'',
|
||||
g_order_id:payRes.gOrderId,
|
||||
g_order_vid:payRes.vid
|
||||
vid: this.data.vid,
|
||||
fxpid: this.data.userInfo.id,
|
||||
invite: this.data.userInfo.invite || '',
|
||||
g_order_id: payRes.gOrderId,
|
||||
g_order_vid: payRes.vid
|
||||
|
||||
}))
|
||||
that.pm.hideChargeDialog();
|
||||
if(payRes.gOrderId && share_g_order_vid != payRes.vid){
|
||||
that.pm.updateOpenArea({showLeft: true});
|
||||
if (payRes.gOrderId && share_g_order_vid != payRes.vid) {
|
||||
that.pm.updateOpenArea({
|
||||
showLeft: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user