混淆,改动代码
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<swiper-item class="swipers-item" v-for="(item,index) in swiperList" :key="item.courseDetailsId">
|
||||
<view class="swipers-items" v-if="current == index">
|
||||
<!-- 视频 -->
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="contain"
|
||||
<video :show-fullscreen-btn="false" @controlstoggle="controlStoggles" object-fit="contain"
|
||||
v-if="current === index && item.videoUrl" :play-strategy="2" :show-loading="true"
|
||||
codec="software" :muted="false" :show-center-play-btn="true" :loop="true" @ended="ended"
|
||||
@timeupdate="timeupdate" @play="videoPlay('myVideo'+item.courseDetailsId, item.courseDetailsId)"
|
||||
@@ -46,7 +46,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" v-if="isCollect">
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<view class="swipers-items-right-item-img" @click.stop="collectVideo()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian_s.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
@@ -57,7 +57,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="swipers-items-right-item" v-else>
|
||||
<view class="swipers-items-right-item-img" @click.stop="shoucang()">
|
||||
<view class="swipers-items-right-item-img" @click.stop="collectVideo()">
|
||||
<image class="swipers-items-right-item-imgs" src="../../static/images/me/shuqian.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
@@ -188,7 +188,7 @@
|
||||
<text class="popuppay-title-l">
|
||||
购买后继续观看
|
||||
</text>
|
||||
<image @click="closePopusPay()" class="popuppay-title-r"
|
||||
<image @click="closePopupPay()" class="popuppay-title-r"
|
||||
src="../../static/images/me/closeIconss.png" mode=""></image>
|
||||
</view>
|
||||
<!-- 余额 -->
|
||||
@@ -390,7 +390,6 @@
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log("走了iOS播放器。。。。。。。。。。。。。。。");
|
||||
//当应用从后台进入前台时自动播放
|
||||
if (this.videoContext) {
|
||||
this.videoContext.play()
|
||||
@@ -398,7 +397,7 @@
|
||||
this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否'
|
||||
let that = this
|
||||
uni.$on('back', (data) => {
|
||||
if (data.flag == true) {
|
||||
if (data.flag) {
|
||||
that.showPay = false
|
||||
that.getDataList(that.courseId, that.courseDetailsId, true);
|
||||
that.getMyLoveStatus()
|
||||
@@ -468,14 +467,14 @@
|
||||
|
||||
// #endif
|
||||
this.$nextTick(() => {
|
||||
this.closePopusPay()
|
||||
this.closePopupPay()
|
||||
})
|
||||
if (this.courseId) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
|
||||
}
|
||||
httpsRequest.getT('app/course/getRedEnvelopeTips').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.getRedEnvelopeTips = res.data
|
||||
}
|
||||
})
|
||||
@@ -494,7 +493,7 @@
|
||||
console.log('this bottom padding = ' + this.paddingBottom);
|
||||
|
||||
httpsRequest.getT("app/common/type/919", {}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
const sysInfo = uni.getSystemInfoSync();
|
||||
let isIos = sysInfo.platform == 'ios'
|
||||
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
|
||||
@@ -535,7 +534,7 @@
|
||||
*/
|
||||
getScale() {
|
||||
httpsRequest.getT("app/common/type/914", {}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.scale = Number(res.data.value)
|
||||
}
|
||||
});
|
||||
@@ -574,7 +573,7 @@
|
||||
},
|
||||
//选集弹窗的回调
|
||||
changeXj(e) {
|
||||
if (e.show == false) {
|
||||
if (!e.show) {
|
||||
//关闭弹窗的时候重置scrollIntoViews,防止关闭后第二次点就不能自动滑动到当前集的位置
|
||||
this.scrollIntoViews = 'video0'
|
||||
}
|
||||
@@ -615,7 +614,7 @@
|
||||
});
|
||||
},
|
||||
isCheckPay(status, name, order) {
|
||||
if (status == 0) {
|
||||
if (status === 0) {
|
||||
this.setPayment(name, order);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
@@ -625,7 +624,7 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
iphonepay() {
|
||||
iphonePay() {
|
||||
let that = this
|
||||
plus.payment.getChannels((res) => {
|
||||
let channel = res.find(i => i.id === 'appleiap')
|
||||
@@ -681,7 +680,7 @@
|
||||
httpsRequest.postT('/app/ios/isoPayApp?receipt=' + receipt + '&ordersId=' + that.iosPayId).then(
|
||||
res => {
|
||||
uni.hideLoading();
|
||||
if (res.status == 0) {
|
||||
if (res.status === 0) {
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
duration: 2000,
|
||||
@@ -693,7 +692,7 @@
|
||||
},
|
||||
// 充值
|
||||
pay() {
|
||||
if (this.checked == false) {
|
||||
if (!this.checked) {
|
||||
uni.showToast({
|
||||
title: '请阅读并同意《付费须知说明》',
|
||||
icon: 'none'
|
||||
@@ -704,7 +703,7 @@
|
||||
uni.showLoading({
|
||||
title: '支付中...'
|
||||
})
|
||||
if (this.openWay == 2) {
|
||||
if (this.openWay === 2) {
|
||||
// 微信APP支付 根据订单id获取支付信息
|
||||
httpsRequest.postT("/app/wxPay/payMoney", {
|
||||
classify: 1,
|
||||
@@ -712,7 +711,7 @@
|
||||
}).then(ret => {
|
||||
this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
} else if (this.openWay == 1) {
|
||||
} else if (this.openWay === 1) {
|
||||
let paytype = 'h5'
|
||||
// #ifdef APP
|
||||
paytype = 'app'
|
||||
@@ -725,7 +724,7 @@
|
||||
});
|
||||
// this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data));
|
||||
});
|
||||
} else if (this.openWay == 3) {
|
||||
} else if (this.openWay === 3) {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
let data = {
|
||||
payClassifyId: this.wallet[this.wallCurr].payClassifyId,
|
||||
@@ -742,7 +741,7 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (this.openWay == 4) {
|
||||
} else if (this.openWay === 4) {
|
||||
let userId = uni.getStorageSync('userId');
|
||||
let data = {
|
||||
// money: this.wallet[this.current].price
|
||||
@@ -772,7 +771,7 @@
|
||||
getMyMoney() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
httpsRequest.getT('/app/moneyDetails/selectUserMoney').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.moneyNum = res.data.money
|
||||
}
|
||||
})
|
||||
@@ -826,7 +825,7 @@
|
||||
*/
|
||||
getMoneyList() {
|
||||
httpsRequest.getT('/app/payClassify/selectPayClassifyList').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
let priceObj = this.findMinMaxPricesWithIndexes(res.data)
|
||||
this.wallet = res.data
|
||||
this.wallet[priceObj.minPriceIndex].remarks = '特惠'
|
||||
@@ -843,7 +842,7 @@
|
||||
this.wallet = arr
|
||||
}
|
||||
// #ifdef APP
|
||||
this.iphonepay()
|
||||
this.iphonePay()
|
||||
// #endif
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -854,11 +853,11 @@
|
||||
})
|
||||
},
|
||||
//关闭支付弹窗
|
||||
closePopusPay() {
|
||||
closePopupPay() {
|
||||
this.$refs.popuppay.close()
|
||||
},
|
||||
//打开支付弹窗
|
||||
openPopusPay() {
|
||||
openPopupPay() {
|
||||
this.$refs.popuppay.open('bottom')
|
||||
},
|
||||
// 获取收藏状态
|
||||
@@ -878,7 +877,7 @@
|
||||
})
|
||||
},
|
||||
//显示/隐藏适配控制器的回调
|
||||
controlstoggles(e) {
|
||||
controlStoggles(e) {
|
||||
this.showControls = e.detail.show
|
||||
this.showBack = this.showControls
|
||||
console.log(e.detail.show, '显示/隐藏控制栏')
|
||||
@@ -962,16 +961,16 @@
|
||||
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.ordersId = res.data.orders.ordersId //记录订单id
|
||||
this.payMoney = res.data.orders.payMoney //记录订单价格
|
||||
|
||||
if (type == 1) { //金币
|
||||
if (type === 1) { //金币
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else if (type == 2) { //支付宝
|
||||
} else if (type === 2) { //支付宝
|
||||
this.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = res.data.orders.payMoney //需要支付的价格
|
||||
this.openPopusPay() //显示充值弹窗
|
||||
this.openPopupPay() //显示充值弹窗
|
||||
}
|
||||
|
||||
|
||||
@@ -989,13 +988,13 @@
|
||||
httpsRequest.postT("/app/order/payOrders", {
|
||||
orderId: orderId,
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
this.closePopusPay()
|
||||
this.closePopupPay()
|
||||
this.closePay()
|
||||
that.showPay = false
|
||||
that.showMoney = false
|
||||
@@ -1037,7 +1036,7 @@
|
||||
this.videoList = [...this.videoList, ...this.meunList.slice(index + 1, index + 3)]
|
||||
}
|
||||
//只剩一条数据
|
||||
if (lengths == 1) {
|
||||
if (lengths === 1) {
|
||||
//把剩下的一条给放进去
|
||||
this.videoList = [
|
||||
//选中的那条
|
||||
@@ -1049,7 +1048,7 @@
|
||||
]
|
||||
}
|
||||
//选择的就是最后一条数据
|
||||
if (lengths == 0) {
|
||||
if (lengths === 0) {
|
||||
//后两条拿总数组的前两条就可以了
|
||||
this.videoList = [...this.videoList, ...this.meunList.slice(0, 2)]
|
||||
}
|
||||
@@ -1062,7 +1061,7 @@
|
||||
// const index = this.meunList.findIndex(menu => menu.courseDetailsId === item.courseDetailsId);
|
||||
// this.videoList = [this.meunList[index]]
|
||||
this.current = index
|
||||
if (this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type) {
|
||||
if (this.videoList[this.current].videoUrl === '' && this.videoList[this.current].price <= 0 && !type) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
|
||||
return;
|
||||
}
|
||||
@@ -1104,7 +1103,7 @@
|
||||
this.$refs.popup.close()
|
||||
},
|
||||
//收藏
|
||||
shoucang() {
|
||||
collectVideo() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
let data = {
|
||||
courseId: this.courseId,
|
||||
@@ -1112,7 +1111,7 @@
|
||||
type: this.isCollect == false ? 1 : 0
|
||||
}
|
||||
httpsRequest.postJson('/app/courseCollect/insertCourseCollect', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
this.getMyLoveStatus()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user