This commit is contained in:
2025-04-18 16:32:32 +08:00
parent 09c087508f
commit 8e44473164
74 changed files with 24833 additions and 10335 deletions

View File

@@ -139,7 +139,7 @@
</view>
<view class="right">
<u-icon
<!-- <u-icon
v-if="
userVip == null &&
slotProps.data.type != 0 &&
@@ -151,7 +151,7 @@
color="#FF2B57"
size="30"
style="display: inline-block; margin-left: 10rpx"
></u-icon>
></u-icon> -->
<text
v-if="
@@ -168,9 +168,51 @@
</view>
</view>
</view>
</template>
<template slot="contentList" slot-scope="slotProps">
<view
v-if="
userVip == null &&
slotProps.data.type != 0 &&
slotProps.data.isBuy != 1
"
style="margin-bottom: 20rpx;"
>
<view class="libOther">
<!-- 没有观看权限的时候 -->
<view class="text">
您未购买此目录课程或已到期购买后或开通VIP即可学习本目录课程
</view>
<view class="tag-view flex_box">
<u-button
class="btn"
type="warning"
size="small"
@click="handleClickGetGoodsList(slotProps.data)"
text="购买课程"
></u-button>
<u-button
class="btn"
type="success"
size="small"
@click="goNewPay(slotProps.data)"
text="复读"
v-if="showNewPayBtn[slotProps.index]&&showNewPayBtn[slotProps.index].status"
></u-button>
<u-button
size="small"
class="btn"
type="primary"
@click="onPageJump('/pages/mine/vip/index')"
text="开通VIP"
></u-button>
</view>
</view>
</view>
<view class="containerBg2">
<view class="shiting_content">
<view class="catalogueList">
@@ -217,7 +259,7 @@
slotProps1.row.isAudition == 0
"
name="lock"
color="#258feb"
color="#3AB3AE "
size="24"
></u-icon>
</view>
@@ -229,7 +271,7 @@
slotProps.data.isBuy == 0
"
name="lock"
color="#258feb"
color="#3AB3AE "
size="24"
></u-icon>
</view>
@@ -276,6 +318,7 @@
</template>
</common-anchor-link>
<common-select-goods
:isFudu="isFudu"
ref="commonSelectGoods"
:selectGoodsData="selectGoodsData"
:goodsList="goodsList"
@@ -345,6 +388,10 @@ export default {
},
data() {
return {
fuduId:null,
isFudu:false,
showNewPayBtn: [],
isHideCourseInfo: false,
courseList: [],
showGoBuy: true,
@@ -427,6 +474,8 @@ export default {
list: "sociology/course/getCourseDetail",
goodsList: "sociology/product/getProductListForCourse",
startStudyForMF: "sociology/course/startStudyForMF",
newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 检查复读地址
newPaymentList:"common/courseRelearn/relearnShopProductList", // 获取复读列表
},
userVip: null, //是否有vip
textList: [], //转化文字集合
@@ -458,7 +507,87 @@ export default {
this.getCourseDescriptionData();
});
},
methods: {
methods: { // 选择复读选项
async goNewPay(item){
await this.getNewPaymentList(item.id)
if(this.newPaymentProList.length > 0){
this.goodsList = this.newPaymentProList;
this.selectGoodsData = this.goodsList[0];
this.$refs.commonSelectGoods.open();
this.isFudu = true
this.show = true;
//存复读需要的id
this.fuduId = item.id;
}else{
this.show = false
this.isFudu = false
this.$commonJS.showToast('暂无复读方案');
}
},
async getNewPaymentList(id){
uni.showLoading({
title:'加载中'
})
await this.$http
.request({
url: this.urlList.newPaymentList,
method: "POST",
data: {
catalogueId: id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("复读列表", res);
uni.hideLoading()
if(res.code != 0){return this.$commonJS.showToast(res.errMsg);}
// if (res.code == 0) {
this.newPaymentProList = res.productList
// }
this.$forceUpdate();
}).catch(e => {
uni.hideLoading()
console.log('e',e);
this.newPaymentProList = []
this.$commonJS.showToast(e.errMsg);
});
},
// 查询目录续费情况
async checkRenewPayment(id) {
var ss = false;
await this.$http
.request({
url: this.urlList.newPayment,
method: "POST",
data: {
courseCatalogueId: id,
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("res at line 493:", res);
if (res.code != 0) {
// return this.$commonJS.showToast(res.errMsg);
}
if (res.code == 0) {
ss = res.canRelearn;
}
this.$forceUpdate();
})
.catch((e) => {
console.log("e", e);
ss = false;
this.$commonJS.showToast(e.errMsg);
});
return ss;
},
//点击顶部按钮
handleClickGetVip() {
uni.navigateTo({
@@ -585,6 +714,8 @@ export default {
navTitle: this.options.navTitle,
title: this.options.title,
sourceType: "curriculum",
isFudu: this.isFudu,
fuduId: this.fuduId
}); // 这里转换成 字符串
uni.navigateTo({
url: `/pages/goods/order/index?data=${mynavData}`,
@@ -618,6 +749,11 @@ export default {
}
this.$forceUpdate();
});
this.$nextTick(() => {
setTimeout(() => {
this.getCourseDescriptionData();
}, 500);
});
} else if (v.type == 2 && this.userVip == null) {
uni.showModal({
title: "提示",
@@ -628,11 +764,7 @@ export default {
} else {
this.getProductListForCourse(v);
}
this.$nextTick(() => {
setTimeout(() => {
this.getCourseDescriptionData();
}, 500);
});
},
getProductListForCourse(v) {
@@ -799,8 +931,16 @@ export default {
that.curriculumData = res.data.course;
that.cateList = [...res.data.catalogues];
for (let i = 0; i < that.cateList.length; i++) {
this.showNewPayBtn[i]={status:false}
console.log('at line 876:',this.showNewPayBtn[i] )
var list = await that.getChapterList(that.cateList[i]);
if (that.cateList[i].isBuy == 0 && this.userVip == null) {
that.showNewPayBtn[i].status = await this.checkRenewPayment(that.cateList[i].id);
console.log("可以复读吗?", this.showNewPayBtn);
} else {
console.log("不用复读");
} console.log('this.showNewPayBtn at line 877:', this.showNewPayBtn)
that.allDataList[i] = {
...that.cateList[i],
courseList: [...list],
@@ -812,7 +952,11 @@ export default {
}, 200);
this.$forceUpdate();
});
},
}, onPageJump(url, id) {
uni.navigateTo({
url: `${url}?id=${id}`,
});
},
getPriceData() {
var that = this;
setTimeout(() => {
@@ -1667,7 +1811,7 @@ export default {
.describe_block {
padding: 15rpx 20rpx;
background: linear-gradient(90deg, #258feb 0%, #00e1ec 100%);
background: linear-gradient(90deg, #3ab3ae 0%, #00e1ec 100%);
position: fixed;
left: 0;
width: 100%;
@@ -1691,5 +1835,26 @@ export default {
border-radius: 10rpx;
line-height: 50rpx;
height: 50rpx;
}
}.libOther {
border: 1px solid #fff;
border-radius: 10rpx;
text-align: center;
background-color: rgba(0, 0, 0, .4);
padding: 10rpx;
.text {
font-size: 26rpx;
line-height: 40rpx;
margin-bottom: 20rpx;
color: #fff;
}
}.tag-view {
justify-content: center;
margin-bottom: 20rpx;
.btn {
width: 40%;
margin: 0 20rpx;
}
}
</style>