Merge branch 'gaohao' of https://e.coding.net/g-cphe0354/duanju/video_app into test
This commit is contained in:
commit
70594ec8cb
|
|
@ -41,8 +41,8 @@
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- :autoplay="item.autoPlay" -->
|
<!-- :autoplay="item.autoPlay" -->
|
||||||
<!-- 没有视频权限则显示封面图 -->
|
<!-- 没有视频权限则显示封面图 -->
|
||||||
<image v-else @click="openShowPay(current,index,item.videoUrl);showControls = true"
|
<image v-else @click="openShowPay(current,index,item.videoUrl);showControls = true" :src="item.titleImg"
|
||||||
:src="item.titleImg" class="swipers-items-imgsbg" mode="aspectFill"></image>
|
class="swipers-items-imgsbg" mode="aspectFill"></image>
|
||||||
<!-- 返回图标 -->
|
<!-- 返回图标 -->
|
||||||
<!-- #ifndef MP-TOUTIAO -->
|
<!-- #ifndef MP-TOUTIAO -->
|
||||||
<view @click.stop="goBack()" style="color: #ffffff;">
|
<view @click.stop="goBack()" style="color: #ffffff;">
|
||||||
|
|
@ -199,22 +199,10 @@
|
||||||
{{getRedEnvelopeTips}}
|
{{getRedEnvelopeTips}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="list-item" v-if="info&&info.price">
|
|
||||||
<view class="list-item-box flex align-center justify-center" @click="payVideo(2,'all')">
|
|
||||||
<image src="../../static/images/me/rmIcon.png" mode=""></image>
|
|
||||||
{{info.price}}元解锁全剧
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-item" v-if="info&&info.wholesalePrice">
|
|
||||||
<view class="list-item-box flex align-center justify-center" @click="payVideo(2,10)">
|
|
||||||
<image src="../../static/images/me/rmIcon.png" mode=""></image>
|
|
||||||
{{info.wholesalePrice}}元解锁10集视频
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="list-item" v-if="zhengbu === '是' && isWxIosPay == true">
|
<view class="list-item" v-if="zhengbu === '是' && isWxIosPay == true">
|
||||||
<view class="list-item-box flex align-center justify-center" @click="payVideo(1)">
|
<view class="list-item-box flex align-center justify-center" @click="payVideo(1)">
|
||||||
<image src="../../static/images/me/rmIcon.png" mode=""></image>
|
<image src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||||
{{countPrice*scale}}金币解锁单集视频
|
{{countPrice*scale}}金币解锁单集视频
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-item" v-if="danbu === '是' && isWxIosPay == true">
|
<view class="list-item" v-if="danbu === '是' && isWxIosPay == true">
|
||||||
|
|
@ -666,7 +654,7 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
console.log('onSHow video');
|
console.log('onSHow video');
|
||||||
|
|
||||||
//当应用从后台进入前台时自动播放
|
//当应用从后台进入前台时自动播放
|
||||||
if (this.videoContext) {
|
if (this.videoContext) {
|
||||||
this.videoContext.play()
|
this.videoContext.play()
|
||||||
|
|
@ -760,7 +748,7 @@
|
||||||
this.meunTop = 37
|
this.meunTop = 37
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
// const windowResizeCallback = (res) => {
|
// const windowResizeCallback = (res) => {
|
||||||
// console.log('变化后的窗口宽度=' + res.size.windowWidth)
|
// console.log('变化后的窗口宽度=' + res.size.windowWidth)
|
||||||
// console.log('变化后的窗口高度=' + res.size.windowHeight)
|
// console.log('变化后的窗口高度=' + res.size.windowHeight)
|
||||||
|
|
@ -856,7 +844,7 @@
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
//点击封面打开弹窗
|
//点击封面打开弹窗
|
||||||
openShowPay(val, inx, url) {
|
openShowPay(val,inx,url) {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
console.log(inx)
|
console.log(inx)
|
||||||
console.log(url)
|
console.log(url)
|
||||||
|
|
@ -1268,11 +1256,10 @@
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {Object} type 类型
|
* @param {Object} type 类型
|
||||||
* @param {Object} num 集数
|
|
||||||
* 1:购买整部视频
|
* 1:购买整部视频
|
||||||
* 2:购买单集视频
|
* 2:购买单集视频
|
||||||
*/
|
*/
|
||||||
payVideo(type, num) {
|
payVideo(type) {
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')) {
|
||||||
// #ifdef MP-TOUTIAO
|
// #ifdef MP-TOUTIAO
|
||||||
if (!this.checked) {
|
if (!this.checked) {
|
||||||
|
|
@ -1283,7 +1270,7 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
this.submitPay(type, num)
|
this.submitPay(type)
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/login/login"
|
url: "/pages/login/login"
|
||||||
|
|
@ -1313,15 +1300,13 @@
|
||||||
this.showMoney = data
|
this.showMoney = data
|
||||||
},
|
},
|
||||||
//使用金币购买
|
//使用金币购买
|
||||||
submitPay(type, num) {
|
submitPay(type) {
|
||||||
let data = {
|
let data = {
|
||||||
courseId: this.courseId
|
courseId: this.courseId
|
||||||
}
|
}
|
||||||
if(!num){
|
|
||||||
//单集解锁
|
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
this.$Request.getT('/app/order/insertCourseOrders', data).then(res => {
|
||||||
}
|
|
||||||
this.$Request.getT((num && num == 10)?'/app/order/insertCourseOrders/limit10': '/app/order/insertCourseOrders', data).then(res => {
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.ordersId = res.data.orders.ordersId //记录订单id
|
this.ordersId = res.data.orders.ordersId //记录订单id
|
||||||
this.payMoney = res.data.orders.payMoney //记录订单价格
|
this.payMoney = res.data.orders.payMoney //记录订单价格
|
||||||
|
|
@ -1337,7 +1322,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (res.status && res.status == 1) {
|
if ( res.status && res.status == 1) {
|
||||||
this.showPay = false //关闭购买选择弹窗
|
this.showPay = false //关闭购买选择弹窗
|
||||||
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
|
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
|
||||||
true);
|
true);
|
||||||
|
|
@ -1483,12 +1468,12 @@
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
//选择播放
|
//选择播放
|
||||||
selectPlay(item, type) { //price //videoUrl
|
selectPlay(item,type) {//price //videoUrl
|
||||||
// 根据选择的courseDetailsId拿到meunList列表中的相同数据的下标
|
// 根据选择的courseDetailsId拿到meunList列表中的相同数据的下标
|
||||||
const index = this.meunList.findIndex(menu => menu.courseDetailsId === item.courseDetailsId);
|
const index = this.meunList.findIndex(menu => menu.courseDetailsId === item.courseDetailsId);
|
||||||
this.videoList = [this.meunList[index]]
|
this.videoList = [this.meunList[index]]
|
||||||
this.current = 0
|
this.current = 0
|
||||||
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')
|
this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1588,8 +1573,8 @@
|
||||||
|
|
||||||
let indexs = -1
|
let indexs = -1
|
||||||
if (courseDetailsId) { //从记录进来的
|
if (courseDetailsId) { //从记录进来的
|
||||||
console.log(courseDetailsId)
|
console.log(courseDetailsId)
|
||||||
console.log(this.meunList)
|
console.log(this.meunList)
|
||||||
this.meunList.map((item, index) => {
|
this.meunList.map((item, index) => {
|
||||||
if (item.courseDetailsId == courseDetailsId) {
|
if (item.courseDetailsId == courseDetailsId) {
|
||||||
indexs = index
|
indexs = index
|
||||||
|
|
@ -1598,7 +1583,7 @@
|
||||||
console.log(indexs)
|
console.log(indexs)
|
||||||
if (indexs != -1) { //找到了
|
if (indexs != -1) { //找到了
|
||||||
if (Number(indexs + 1) === this.meunList.length) { //最后一条
|
if (Number(indexs + 1) === this.meunList.length) { //最后一条
|
||||||
console.log("最后一条")
|
console.log("最后一条")
|
||||||
if (this.meunList.length == 1) { //只有一条
|
if (this.meunList.length == 1) { //只有一条
|
||||||
this.videoList = this.meunList.slice(0,
|
this.videoList = this.meunList.slice(0,
|
||||||
3)
|
3)
|
||||||
|
|
@ -1617,7 +1602,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (Number(indexs) === Number(this.meunList.length - 1)) { //倒数第二条
|
} else if (Number(indexs) === Number(this.meunList.length - 1)) { //倒数第二条
|
||||||
console.log("倒数第二条")
|
console.log("倒数第二条")
|
||||||
if (this.meunList.length == 1) { //只有一条
|
if (this.meunList.length == 1) { //只有一条
|
||||||
this.videoList = this.meunList.slice(0,
|
this.videoList = this.meunList.slice(0,
|
||||||
3)
|
3)
|
||||||
|
|
@ -1639,7 +1624,7 @@
|
||||||
} else {
|
} else {
|
||||||
console.log("如果不是最后一条,也不是倒数第二条")
|
console.log("如果不是最后一条,也不是倒数第二条")
|
||||||
//如果不是最后一条,也不是倒数第二条,则从找到的位置开始往后拿三条数据放入数组
|
//如果不是最后一条,也不是倒数第二条,则从找到的位置开始往后拿三条数据放入数组
|
||||||
if (indexs == 0) {
|
if ( indexs == 0 ) {
|
||||||
this.videoList = [
|
this.videoList = [
|
||||||
this.meunList[this.meunList
|
this.meunList[this.meunList
|
||||||
.length - 2],
|
.length - 2],
|
||||||
|
|
@ -1647,7 +1632,7 @@
|
||||||
.length - 1],
|
.length - 1],
|
||||||
this.meunList[0],
|
this.meunList[0],
|
||||||
]
|
]
|
||||||
} else if (indexs == 1) {
|
} else if ( indexs == 1) {
|
||||||
this.videoList = [
|
this.videoList = [
|
||||||
this.meunList[this.meunList
|
this.meunList[this.meunList
|
||||||
.length - 1],
|
.length - 1],
|
||||||
|
|
@ -1655,10 +1640,10 @@
|
||||||
this.meunList[1],
|
this.meunList[1],
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
this.videoList = this.meunList.slice(indexs - 2,
|
this.videoList = this.meunList.slice(indexs-2,
|
||||||
indexs - 2 + 3)
|
indexs-2 + 3)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//没找到直接拿前三条数据即可
|
//没找到直接拿前三条数据即可
|
||||||
|
|
@ -1666,7 +1651,7 @@
|
||||||
}
|
}
|
||||||
} else { //新的视频
|
} else { //新的视频
|
||||||
// //视频数组//直接拿前三条
|
// //视频数组//直接拿前三条
|
||||||
|
|
||||||
this.videoList = this.meunList.slice(0, 3)
|
this.videoList = this.meunList.slice(0, 3)
|
||||||
indexs = 0
|
indexs = 0
|
||||||
|
|
||||||
|
|
@ -1721,8 +1706,8 @@
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (t == 'select') {
|
if ( t == 'select') {
|
||||||
this.selectPlay(this.videoList[this.current], true)
|
this.selectPlay(this.videoList[this.current],true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1921,15 +1906,21 @@
|
||||||
},
|
},
|
||||||
//播放时的回掉
|
//播放时的回掉
|
||||||
videoPlay(videoId) {
|
videoPlay(videoId) {
|
||||||
|
console.log(courseDetailsId)
|
||||||
this.$Request.getT('app/course/viewCourse', {
|
console.log(this.playFlag)
|
||||||
courseId: this.courseId,
|
// this.courseDetailsId = courseDetailsId
|
||||||
courseDetailsId: this.courseDetailsId,
|
if (!this.playFlag) {
|
||||||
type: 'start'
|
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,true);
|
||||||
}).then(res => {
|
|
||||||
this.playFlag = true
|
this.playFlag = true
|
||||||
console.log('播放开始')
|
httpsRequest.getT('app/course/viewCourse', {
|
||||||
})
|
courseId: this.courseId,
|
||||||
|
courseDetailsId: courseDetailsId,
|
||||||
|
type: 'start'
|
||||||
|
}).then(res => {
|
||||||
|
console.log('播放开始')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
//监听视频播放完成
|
//监听视频播放完成
|
||||||
ended() {
|
ended() {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
return {
|
return {
|
||||||
query: {
|
query: {
|
||||||
discSpinningRecordId: null,
|
discSpinningRecordId: null,
|
||||||
source: 1,
|
|
||||||
phone: "",
|
phone: "",
|
||||||
address: "",
|
address: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
|
|
@ -47,9 +46,7 @@
|
||||||
if ( options.id ) {
|
if ( options.id ) {
|
||||||
this.query.discSpinningRecordId = options.id
|
this.query.discSpinningRecordId = options.id
|
||||||
}
|
}
|
||||||
if ( options.source ) {
|
|
||||||
this.query.source = options.source
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,17 @@
|
||||||
>{{item.label}}</view>
|
>{{item.label}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item" v-for="(item,index) in list" :key="index">
|
<view class="item" v-for="(item,index) in list" :key="index">
|
||||||
<view class="color-666 u-font-24">中奖时间 2024-09-11 10:20:11</view>
|
<view class="color-666 u-font-24">{{tabIndex==1?'中奖时间':'兑换时间'}} {{item.createTime}}</view>
|
||||||
<view class="u-m-t-24 u-flex u-row-between">
|
<view class="u-m-t-24 u-flex u-row-between">
|
||||||
<view class="u-flex-1 u-flex u-col-top">
|
<view class="u-flex-1 u-flex u-col-top">
|
||||||
<u-image width="128rpx" height="128rpx" src="/static/red-pack.png"></u-image>
|
<!-- <u-image width="128rpx" height="128rpx" src="/static/red-pack.png"></u-image> -->
|
||||||
<view class="u-m-l-16">
|
<view class="u-m-l-16">
|
||||||
<view>大额红包</view>
|
<view v-if="tabIndex == 1">{{item.name}}</view>
|
||||||
<view class="color-999 u-font-24 u-m-t-16">×1</view>
|
<view v-else>{{item.prizeName}}</view>
|
||||||
|
<view v-if="tabIndex == 1" class="color-999 u-font-24 u-m-t-16">×{{item.number}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="" v-if="tabIndex==1&&item.targetId&&item.type==3">
|
||||||
<view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view>
|
<view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view>
|
||||||
<!-- <view class="btn-circle duihuan finish">已完成</view> -->
|
<!-- <view class="btn-circle duihuan finish">已完成</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -47,9 +48,8 @@
|
||||||
tab: [{label: '抽奖记录', type: 1},{label: '兑换记录', type: 2}],
|
tab: [{label: '抽奖记录', type: 1},{label: '兑换记录', type: 2}],
|
||||||
tabIndex: 1,
|
tabIndex: 1,
|
||||||
query: {
|
query: {
|
||||||
page: 10,
|
page: 1,
|
||||||
limit: 1,
|
limit: 10,
|
||||||
source: 1,
|
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
status: 'nomore',
|
status: 'nomore',
|
||||||
|
|
@ -58,17 +58,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if ( options.source ) {
|
|
||||||
this.query.source = options.source
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.list = [];
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toDuiHuan(item){
|
toDuiHuan(item){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/me/gift/duihuan?source=${this.query.source}&id=${item.id}`
|
url:`/me/gift/duihuan?id=${item.id}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tabClick(item){
|
tabClick(item){
|
||||||
|
|
@ -86,18 +85,20 @@
|
||||||
this.$Request.getT(url, this.query).then(res => {
|
this.$Request.getT(url, this.query).then(res => {
|
||||||
if (res.code == 0 ) {
|
if (res.code == 0 ) {
|
||||||
if ( this.tabIndex == 1) {
|
if ( this.tabIndex == 1) {
|
||||||
this.list = res.data.records
|
this.list = [...this.list,...res.data.records]
|
||||||
this.total = res.data.total
|
this.total = res.data.total
|
||||||
} else {
|
} else {
|
||||||
this.list = res.page.list
|
this.list = [...this.list,...res.page.list]
|
||||||
this.total = res.page.totalCount
|
this.total = res.page.totalCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
if (this.page * this.limit < this.total) {
|
console.log(this.query.page)
|
||||||
this.page = this.page + 1;
|
console.log(this.query.limit)
|
||||||
|
if (this.query.page * this.query.limit < this.total) {
|
||||||
|
this.query.page = this.query.page + 1;
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -229,8 +229,7 @@
|
||||||
if (item.jumpType == 0) {
|
if (item.jumpType == 0) {
|
||||||
if (item.buttonTitle.indexOf("领取") != -1) {
|
if (item.buttonTitle.indexOf("领取") != -1) {
|
||||||
this.taskReceive(item.id)
|
this.taskReceive(item.id)
|
||||||
}
|
} else if (item.buttonTitle.indexOf("观看视频") != -1) {
|
||||||
if (item.buttonTitle.indexOf("观看视频") != -1) {
|
|
||||||
// 首次加载广告
|
// 首次加载广告
|
||||||
this.urlCallback = {
|
this.urlCallback = {
|
||||||
userId: uni.getStorageSync('userId'),
|
userId: uni.getStorageSync('userId'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue