vip功能
This commit is contained in:
@@ -2,32 +2,17 @@
|
||||
<view class="container commonPageBox commonDetailPage" style="height: auto !important">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<!-- <z-nav-bar :title="pageTitle ? pageTitle : '课程详情'"> -->
|
||||
<z-nav-bar title="课程介绍"></z-nav-bar>
|
||||
<view class="contentBox commonPageContentBox">
|
||||
<u-alert v-if="goBuyTitle && isAndorid" style="
|
||||
background: linear-gradient(90deg, #258feb 0%, #00e1ec 100%);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
" type="warning" @click="handleClickGetVip" :title="goBuyTitle" :show-icon="true"></u-alert>
|
||||
<template slot="rightSlot" slot-scope="slotProps">
|
||||
<text class="saveBtn vipBtn flexbox buyBtn" v-if="goBuyType == 0">
|
||||
<view v-if="goBuyTitle && isAndorid" class="describe_block">
|
||||
<view style=" display: flex; justify-content: center;">
|
||||
<uni-icons type="info" size="20" color="#fff"></uni-icons>
|
||||
<text>{{goBuyTitle}}</text>
|
||||
</view>
|
||||
<button class="saveBtn flexbox buyBtn" v-if="goBuyType == 0" @click="handleClickGetVip">
|
||||
立即购买
|
||||
</text>
|
||||
<text class="flexbox" style="color: #f0f0f0" v-if="goBuyType == 1">
|
||||
立即续费
|
||||
</text>
|
||||
<text class="saveBtn vipBtn flexbox" v-if="goBuyType == 2">
|
||||
立即升级
|
||||
</text>
|
||||
|
||||
<view> </view>
|
||||
</template>
|
||||
</u-alert>
|
||||
|
||||
<!-- <scroll-view scroll-y="true" class="scroll-Y"> -->
|
||||
</button>
|
||||
</view>
|
||||
<view class="curseImg" style="padding-top: 80rpx">
|
||||
<image v-if="!course.image" src="/static/nobg.jpg" mode="widthFix"></image>
|
||||
<image v-else :src="course.image" mode="widthFix"></image>
|
||||
@@ -37,9 +22,6 @@
|
||||
<view class="course_info">
|
||||
<view class="flexbox course_title" v-if="course.id">
|
||||
<text class="courseTitle title">{{ course.title }}</text>
|
||||
|
||||
<!-- <view class="start_learn_btn PM_font"
|
||||
@click="onPageJump('/pages/course/myCourseLearn', course.id)">进入学习</view> -->
|
||||
</view>
|
||||
<view class="containerBg" v-if="course.content && course.content != ''">
|
||||
<view class="prof">
|
||||
@@ -66,7 +48,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- {{selfStudyCertificate.length}}-{{classInfo.id}}-{{classInfo.state}}- -->
|
||||
<!-- 自考入口 没有加入班级的时候暴漏入口-->
|
||||
<view class="selfStudyBox"
|
||||
v-if="course.canzk == '1' && librayList[curIndex] && (!classInfo.id || classInfo.state == '2' || selfStudyCertificate.length >= 0)">
|
||||
@@ -86,10 +67,6 @@
|
||||
<text style="color: #999; font-size: 26rpx;">第{{index + 1}}次自考成绩</text>
|
||||
<text class="score PM_font">{{item.score}}分</text>
|
||||
<view class="seePaper" @click.stop="seePaper(item.id)">
|
||||
<!-- <image
|
||||
src="../../static/icon/testPaperIcon.png"
|
||||
mode="widthFix"
|
||||
></image> -->
|
||||
查看试卷
|
||||
</view>
|
||||
</view>
|
||||
@@ -109,10 +86,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class=" " style="margin-top: 20rpx; text-align: center;">
|
||||
|
||||
<!-- <view class=""> -->
|
||||
<!-- {{canJoinTestTime}} -->
|
||||
<!-- {{selfStudyPaperList.length % 2}} -->
|
||||
<template v-if="selfStudyCertificate.length <= 0 && (!classInfo.id || classInfo.state == '2')">
|
||||
|
||||
<template v-if="!testingPaper.id">
|
||||
@@ -141,10 +114,6 @@
|
||||
</template>
|
||||
<button style="padding: 0 20rpx" v-if="selfStudyCertificate.length > 0" type="primary"
|
||||
@click="onPageJump('/pages/certificate/certificate')">查看证书</button>
|
||||
<!-- </view> -->
|
||||
<!-- <view class="" v-if="!classInfo.id">
|
||||
<button style="background-color: #00e1ec;" type="primary" size="mini">查看可加入的小班</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -168,8 +137,7 @@
|
||||
加入班级开始更加系统的学习</text>
|
||||
</view>
|
||||
<view class="btntext">
|
||||
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看
|
||||
>></text>
|
||||
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">查看>></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -201,7 +169,7 @@
|
||||
</template>
|
||||
<view class="containerBg2">
|
||||
<!-- 目录 -->
|
||||
<view :class="['coursePart','flexbox', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipBgColor':'']"
|
||||
<view :class="['coursePart','flexbox', (userVip!=null) ? 'vipBgColor':'']"
|
||||
v-if="librayList.length > 1">
|
||||
<view :class="['item','flexbox',curId == item.id? 'active': '' ]"
|
||||
v-for="(item, index) in librayList" :key="index" @click="clicklib(item,index)">
|
||||
@@ -211,14 +179,13 @@
|
||||
</view>
|
||||
<!-- end -->
|
||||
<template v-if="librayList[curIndex]">
|
||||
<view :class="['endBox',(userMsg.vip == 1 || userMsg.vip == 2) ? 'vipBgColor':'']"
|
||||
v-if="librayList[curIndex].isBuy == 1 || userMsg.vip == 2 || userMsg.vip == 1">
|
||||
<view :class="['endBox',(userVip!=null) ? 'vipBgColor':'']"
|
||||
v-if="librayList[curIndex].isBuy == 1 || userVip!=null">
|
||||
<!-- 已经可以观看的情况 -->
|
||||
<view class="box">
|
||||
<view class="flexbox" v-if="userMsg.vip == 1 || userMsg.vip == 2">
|
||||
<view class="flexbox" v-if="userVip!=null">
|
||||
<!-- vip到期时间 -->
|
||||
<text>VIP畅学权益有效期截止到:{{userMsg.userVip.endTime}} </text>
|
||||
<!-- <uni-tag type="warning" text="去学习"></uni-tag> -->
|
||||
<text>VIP畅学权益有效期截止到:{{userVip.endTime}} </text>
|
||||
</view>
|
||||
<view class="flexbox" v-else>
|
||||
<template v-if="librayList[curIndex].startTime == null">
|
||||
@@ -228,8 +195,7 @@
|
||||
<!-- 实际购买课程到期时间 -->
|
||||
<text style="line-height: 50rpx;">课程有效期截止到:{{librayList[curIndex].endTime}} </text>
|
||||
<!-- 自己买的可以续费 -->
|
||||
<text class="xufeiBtn"
|
||||
@click="handleClickGetGoodsList(librayList[curIndex])">续费</text>
|
||||
<text class="xufeiBtn" @click="handleClickGetGoodsList(librayList[curIndex])">续费</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -238,18 +204,15 @@
|
||||
<view class="libOther">
|
||||
<!-- 没有观看权限的时候 -->
|
||||
<view class="text">
|
||||
您未购买此目录课程或已到期,购买后或开通超级VIP 即可学习本目录课程
|
||||
您未购买此目录课程或已到期,购买后或开通VIP即可学习本目录课程
|
||||
</view>
|
||||
<view class="tag-view flex_box">
|
||||
<u-button class="btn" type="warning" size="small"
|
||||
@click="handleClickGetGoodsList(librayList[curIndex])" text="购买课程"></u-button>
|
||||
<u-button class="btn" type="success" size="small"
|
||||
@click="goNewPay(librayList[curIndex])" text="复读" v-if="showNewPayBtn"></u-button>
|
||||
<!-- <text class="xufeiBtn"
|
||||
@click="goNewPay(librayList[curIndex])" >复读</text> -->
|
||||
<u-button size="small" v-if="isAndorid" class="btn" type="primary"
|
||||
@click="onPageJump('/pages/mine/vip/index')" text="开通VIP"></u-button>
|
||||
<!-- <uni-tag size="normal" style="margin-left: 20rpx;" text="" type="success" /> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -257,9 +220,9 @@
|
||||
|
||||
<view class="shiting_content">
|
||||
<view
|
||||
:class="['chapter_content', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipchapter_content' : '']"
|
||||
:class="['chapter_content', (userVip!=null) ? 'vipchapter_content' : '']"
|
||||
v-if="chapterList.length > 0">
|
||||
<view class="vipSee" v-if="userMsg && (userMsg.vip == 1 || userMsg.vip == 2)">
|
||||
<view class="vipSee" v-if="userVip!=null">
|
||||
<text>VIP畅学权益生效中</text>
|
||||
</view>
|
||||
<view @click="gotoDetail(item, index)" class="item" v-for="(item, index) in chapterList"
|
||||
@@ -268,14 +231,13 @@
|
||||
<view class="flexbox" style="align-items: center;">
|
||||
<view
|
||||
:class="['textBox','flex_box', librayList[curIndex].isBuy == 0 ? 'lock' : '']">
|
||||
<text class="hidden1">{{ item.title }}</text>
|
||||
<!-- {{item.isAudition}}-{{librayList[curIndex].isBuy}}-{{userMsg.vip}} -->
|
||||
<text class="hidden1" style="width: 86%;">{{ item.title }}</text>
|
||||
<uni-tag
|
||||
v-if="item.isAudition == 1 && librayList[curIndex].isBuy == 0 && (userMsg.vip != 1 && userMsg.vip != 2)"
|
||||
v-if="item.isAudition == 1 && librayList[curIndex].isBuy == 0 && userVip==null"
|
||||
style="margin-left: 10rpx" :inverted="true" text="试听" size="mini"
|
||||
type="success" />
|
||||
<template
|
||||
v-if="librayList[curIndex] && librayList[curIndex].isBuy == 1 || (userMsg.vip == 1 || userMsg.vip == 2)">
|
||||
v-if="librayList[curIndex] && librayList[curIndex].isBuy == 1 || userVip!=null">
|
||||
<uni-tag v-if="item.isLearned == 0" style="margin-left: 10rpx;"
|
||||
:inverted="true" text="未学" size="mini" type="primary" />
|
||||
<uni-tag v-if="item.isLearned == 1" style="margin-left: 10rpx;"
|
||||
@@ -285,7 +247,7 @@
|
||||
</view>
|
||||
<view class="shitingTag">
|
||||
<u-icon
|
||||
v-if="librayList[curIndex].isBuy == 0 && (userMsg.vip == 0 || userMsg.vip == 3) && item.isAudition == 0"
|
||||
v-if="librayList[curIndex].isBuy == 0 && userVip==null && item.isAudition == 0"
|
||||
name="lock" color="#258feb" size="28"></u-icon>
|
||||
</view>
|
||||
|
||||
@@ -300,19 +262,12 @@
|
||||
<view class="" style="margin: 16rpx;">
|
||||
<text style="font-size: 28rpx; color:#666">学习进度</text>
|
||||
</view>
|
||||
<!-- <uni-section class="mb-10" style="padding: 0 20rpx" title="" type="line"
|
||||
v-if="librayList.length > 0 && librayList[curIndex].completion > 0"> -->
|
||||
<!-- {{librayList[curIndex]}} -->
|
||||
<view class="progress-box">
|
||||
<progress v-if="course.id" :percent="courseCompletion" show-info stroke-width="3" />
|
||||
</view>
|
||||
<!-- </uni-section> -->
|
||||
</view>
|
||||
<view class="linkPro" v-if="tjProList.length > 0">
|
||||
<uni-section style="padding: 0 20rpx" class="mb-10 graybg" title="相关书籍" type="line">
|
||||
<!-- <template v-slot:right>
|
||||
<span class="more" @click="pageJupm()">查看更多 >></span>
|
||||
</template> -->
|
||||
</uni-section>
|
||||
<view class="list supermarketBox">
|
||||
<scroll-view class="scroll-view_H" scroll-x="true">
|
||||
@@ -333,19 +288,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view style="background: rgba(255, 255, 255, 0.85) !important">
|
||||
<!-- <uni-section style="padding: 0 20rpx" class="mb-10 graybg" title="留言板" type="line">
|
||||
<template v-slot:right>
|
||||
<view class="flexbox" style="align-items: center" @click="addSay()">
|
||||
<u-icon name="edit-pen" color="#2979ff" size="28"></u-icon>
|
||||
<text>发布留言</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-section> -->
|
||||
<view class="flex_box flex_between" style="margin: 16rpx; padding: 40rpx 0;">
|
||||
<text style="font-size: 28rpx; color:#666">留言板</text>
|
||||
<view class="flexbox" style="align-items: center" @click="addSay()">
|
||||
<!-- <u-icon name="edit-pen" color="#2979ff" size="28"></u-icon> -->
|
||||
<!-- <uni-icons type="chatboxes" color="#2979ff" size="28"></uni-icons> -->
|
||||
<text style="color:#2979ff; font-size: 30rpx; font-weight: bold;">发布留言</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -359,28 +304,6 @@
|
||||
<u-divider v-show="status == 1" text="加载中..."></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <u-popup key="1" v-if="pricespop" :show="true" :round="10" @close="closePup">
|
||||
<view class="proListPrice" v-if="proPriceList.length > 0" style="background-color: #fff;">
|
||||
<view class="title"> 请选择 </view>
|
||||
<view class="list">
|
||||
<view :class="['item', curProId == item.productId ? 'active' : '']"
|
||||
v-for="(item, index) in proPriceList" :key="index" @click="choosePrice(item)">
|
||||
{{ item.productName }} - ¥{{ item.price }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tbn flexbox" style="padding-bottom: 20px">
|
||||
<view class="saveBtnss gouwuche flexbox" @click="">
|
||||
<uni-icons type="cart" size="28" style="color: #666"></uni-icons>
|
||||
<text>加入购物车</text>
|
||||
</view>
|
||||
<view style="margin-left: 40rpx" class="saveBtnss buybtn flexbox" @click="openBuyInfoModal">
|
||||
<u-icon name="bag" color="#fff" size="28"></u-icon>
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup> -->
|
||||
<view>
|
||||
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle="bgiStyle"
|
||||
:iconStyle="iconStyle"></u-back-top>
|
||||
@@ -541,10 +464,10 @@
|
||||
},
|
||||
],
|
||||
isHideCourseInfo: false,
|
||||
goBuyTitle: "",
|
||||
goBuyType: "",
|
||||
goBuyTitle: "", //顶部文案显示
|
||||
goBuyType: "", //顶部按钮状态标识
|
||||
playData: {},
|
||||
vip: {},
|
||||
vip: {}, //vip数据
|
||||
catalogueId: null,
|
||||
fixed: false,
|
||||
bgiStyle: {
|
||||
@@ -599,24 +522,7 @@
|
||||
supportFlag: false,
|
||||
selectGoodsData: {},
|
||||
|
||||
buyOptions: [
|
||||
// {
|
||||
// icon: 'chat',
|
||||
// text: '客服'
|
||||
// },
|
||||
// {
|
||||
// icon: 'shop',
|
||||
// text: '店铺',
|
||||
// // info: 2,
|
||||
// infoBackgroundColor: '#007aff',
|
||||
// infoColor: "#f5f5f5"
|
||||
// },
|
||||
// {
|
||||
// icon: 'cart',
|
||||
// text: '购物车',
|
||||
// info: 2
|
||||
// }
|
||||
],
|
||||
buyOptions: [],
|
||||
customButtonGroup1: [{
|
||||
with: 200,
|
||||
text: "立即购买",
|
||||
@@ -647,6 +553,8 @@
|
||||
showNewPayBtn:false,
|
||||
newPaymentProList:[],
|
||||
isFudu:false, // 是否复读
|
||||
//是否有vip
|
||||
userVip: null
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
@@ -657,9 +565,10 @@
|
||||
// this.pageTitle = e.title
|
||||
console.log(e, "传入分类id");
|
||||
this.getUserInfo();
|
||||
|
||||
this.courseId = e.id;
|
||||
// this.getCateList(this.courseId)
|
||||
// await this.getData(e.id);
|
||||
//是否是vip
|
||||
this.getCourseByVip();
|
||||
this.getSayList();
|
||||
this.getOS()
|
||||
},
|
||||
@@ -678,7 +587,6 @@
|
||||
async onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
console.log('this.courseId', this.courseId);
|
||||
this.canJoinTestTime = false
|
||||
await this.getData(this.courseId);
|
||||
// #ifdef APP-PLUS
|
||||
@@ -686,22 +594,16 @@
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
await this.request()
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
this.selectGoodsData = {};
|
||||
this.protocolShow = false;
|
||||
this.$refs.commonSelectGoods.close();
|
||||
// this.showSearchList = false
|
||||
// this.searchList = []
|
||||
},
|
||||
onHide() {
|
||||
this.selectGoodsData = {};
|
||||
this.protocolShow = false;
|
||||
// this.handleClickClose();
|
||||
this.$refs.commonSelectGoods.close();
|
||||
// this.showSearchList = false
|
||||
// this.searchList = []
|
||||
},
|
||||
async onPullDownRefresh() {
|
||||
await this.getData(this.courseId);
|
||||
@@ -1063,7 +965,6 @@
|
||||
this.$commonJS.showToast("商品已下架");
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
// url: '../bookShop/commodityDetail?id=' + item.id
|
||||
url: `/pages/goods/index/index?navTitle=''&title=''&id=${data.productId}`,
|
||||
});
|
||||
}
|
||||
@@ -1082,25 +983,18 @@
|
||||
},
|
||||
//课程详情
|
||||
async gotoDetail(v, courseIndex) {
|
||||
console.log("准备进入学习页面", v);
|
||||
this.currentCateIndex = courseIndex;
|
||||
let _myurl = ''
|
||||
// if(this.oprateOsName == 'ios'){
|
||||
// _myurl = '/pages/course/chapterDetail'
|
||||
// }else{
|
||||
// h5 和安卓
|
||||
_myurl = '/pages/course/chapterDetailAndorid'
|
||||
// }
|
||||
if (this.librayList[this.curIndex].isBuy == 1 || v.isAudition == 1 ||
|
||||
this.vip.type == "1" || this.vip.type == "2") {
|
||||
if (this.librayList[this.curIndex].isBuy == 1 || v.isAudition == 1 || this.userVip!=null) {
|
||||
let noRecored = false
|
||||
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
|
||||
v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ?
|
||||
noRecored = true : ''
|
||||
uni.navigateTo({
|
||||
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
|
||||
});
|
||||
} else if (this.vip.type != "1" && this.librayList[this.curIndex].type == 2) {
|
||||
this.$commonJS.showToast("请开通超V后观看本课程");
|
||||
} else if (this.userVip==null && this.librayList[this.curIndex].type == 2) {
|
||||
this.$commonJS.showToast("请开通VIP后观看本课程");
|
||||
} else {
|
||||
this.$commonJS.showToast("请先购买课程");
|
||||
}
|
||||
@@ -1110,20 +1004,16 @@
|
||||
this.$forceUpdate();
|
||||
},
|
||||
onHandleClickBuy(e) {
|
||||
console.log("this.selectGoodsData at line 589:", this.selectGoodsData);
|
||||
|
||||
var mynavData = JSON.stringify({
|
||||
goods: [this.selectGoodsData],
|
||||
typeId: 0,
|
||||
navTitle: this.course.title,
|
||||
title: this.course.title,
|
||||
isFudu: this.isFudu
|
||||
// sourceType: "curriculum",
|
||||
}); // 这里转换成 字符串
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/order/index?data=${mynavData}`,
|
||||
});
|
||||
// }
|
||||
},
|
||||
openBuyInfoModal() {
|
||||
this.pricespop = false;
|
||||
@@ -1194,8 +1084,6 @@
|
||||
|
||||
//获取相关关联课程商品
|
||||
handleClickGetGoodsList(v) {
|
||||
// console.log("data at line 313:", data);
|
||||
|
||||
if (v.type == 0) {
|
||||
//免费
|
||||
this.$http
|
||||
@@ -1206,7 +1094,6 @@
|
||||
catalogueId: v.id,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
@@ -1214,14 +1101,13 @@
|
||||
console.log("res at line 493:", res);
|
||||
if (res.code == 0) {
|
||||
this.getCourseDescriptionData(v);
|
||||
// this.$commonJS.showToast("");
|
||||
}
|
||||
this.$forceUpdate();
|
||||
});
|
||||
} else if (v.type == 2 && this.userMsg.vip != 1) {
|
||||
} else if (v.type == 2 && this.userVip==null) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前课程目录是超V专享,开通超V可观看',
|
||||
content: '当前课程目录是VIP专享,开通VIP可观看',
|
||||
confirmText: '好的',
|
||||
showCancel: false
|
||||
})
|
||||
@@ -1239,7 +1125,6 @@
|
||||
id: v.id,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
@@ -1256,19 +1141,53 @@
|
||||
this.$forceUpdate();
|
||||
})
|
||||
},
|
||||
//获取信息
|
||||
getUserInfo() {
|
||||
this.$http.post("common/user/getUserInfo").then((res) => {
|
||||
console.log("res at line 505:", res);
|
||||
this.userMsg = res.result
|
||||
if (res.result.userVip) {
|
||||
this.vip = res.result.userVip;
|
||||
} else {
|
||||
this.vip = {
|
||||
type: 0
|
||||
};
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取是否是vip
|
||||
getCourseByVip(){
|
||||
this.$http
|
||||
.request({
|
||||
url: 'common/userVip/ownCourseCatalogueByVip',
|
||||
method: "POST",
|
||||
data: {
|
||||
courseId: this.courseId,
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
//如果有userVip,说明是符合课程的vip身份
|
||||
if(res.userVip){
|
||||
this.userVip = res.userVip;
|
||||
let type = res.userVip.type;
|
||||
let role = '';
|
||||
if(type==4){
|
||||
role = '中医学';
|
||||
}else if(type==5){
|
||||
role = '针灸学';
|
||||
}else if(type==6){
|
||||
role = '肿瘤学';
|
||||
}else if(type==7){
|
||||
role = '国学';
|
||||
}else if(type==8){
|
||||
role = '心理学';
|
||||
}
|
||||
this.goBuyTitle = '尊贵的'+role+'VIP,您的有效期到'+res.userVip.endTime;
|
||||
this.goBuyType = 1;
|
||||
}else{ //否则没有开通vip
|
||||
this.goBuyTitle = '购买VIP,即可畅享更多专属权益';
|
||||
this.goBuyType = 0;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 评论
|
||||
showSayModule(data) {
|
||||
console.log(data, "父级收到值了");
|
||||
@@ -1665,9 +1584,9 @@
|
||||
url: `/pages/course/myCourseLearn?id=${this.course.id}`,
|
||||
});
|
||||
},
|
||||
//获取课程数据
|
||||
async getData(id) {
|
||||
this.courseList = [];
|
||||
// console.log("at line 1167:", "调用了几次");
|
||||
var that = this;
|
||||
uni.showLoading({
|
||||
title:'获取课程信息'
|
||||
@@ -1675,12 +1594,11 @@
|
||||
await $http
|
||||
.request({
|
||||
url: "sociology/course/getCourseDetail",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
method: "POST",
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
@@ -1695,40 +1613,11 @@
|
||||
}
|
||||
if (res.code == 0) {
|
||||
this.course = res.data.course;
|
||||
//0 购买 1 续费 2 升级
|
||||
// console.log("this.vip.type at line 1045:", this.vip);
|
||||
switch (this.vip.type) {
|
||||
case 0:
|
||||
this.goBuyTitle = "购买VIP,即可免费观看吴门医述所有课程";
|
||||
this.goBuyType = 0;
|
||||
break;
|
||||
case 1 || 2:
|
||||
var vipName = "";
|
||||
if (this.vip.type == 1) {
|
||||
vipName = "超级VIP";
|
||||
}
|
||||
if (this.vip.type == 2) {
|
||||
vipName = "吴门医述VIP";
|
||||
}
|
||||
//超级VIP
|
||||
this.goBuyTitle = `尊贵的${vipName},您的有效期到 ${
|
||||
this.vip.endTime && this.vip.endTime.split(" ")[0]
|
||||
}`;
|
||||
this.goBuyType = 1;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
//众妙之门
|
||||
this.goBuyTitle =
|
||||
"尊贵的众妙之门VIP,升级至超级VIP,即可免费观看吴门医述所有课程";
|
||||
|
||||
this.goBuyType = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
this.$forceUpdate();
|
||||
this.pageTitle = this.course.title;
|
||||
this.librayList = [...res.data.catalogues];
|
||||
console.log('获取课程详情=》', res.data);
|
||||
|
||||
if (this.librayList.length > 0) {
|
||||
var ll = this.librayList.map(item => item.completion)
|
||||
var sums = 0
|
||||
@@ -1744,27 +1633,19 @@
|
||||
} else {
|
||||
this.courseCompletion = 0
|
||||
}
|
||||
console.log('lllllll', this.courseCompletion);
|
||||
that.$forceUpdate();
|
||||
if (this.librayList.length > 0) {
|
||||
if (this.catalogueId) {
|
||||
this.curId = this.catalogueId
|
||||
let _list = this.librayList
|
||||
_list = _list.map(item => item.id)
|
||||
// console.log('_list过滤后的_list',_list);
|
||||
this.curIndex = _list.findIndex((element) => element == this.catalogueId)
|
||||
console.log('其他页面返回来,_list过滤后的curIndex', this.curIndex, this.catalogueId);
|
||||
} else {
|
||||
this.catalogueId = this.librayList[0].id;
|
||||
this.curId = this.librayList[0].id;
|
||||
this.curIndex = 0
|
||||
console.log('首次加载');
|
||||
}
|
||||
console.log('this.librayList[0]',this.librayList[0]);
|
||||
this.clicklib(this.librayList[0], 0)
|
||||
// this.chapterList = await this.getChapterList(this.catalogueId)
|
||||
console.log('目录列表', this.librayList)
|
||||
// console.log('外面得到的方法列表', this.chapterList);
|
||||
}
|
||||
this.clicklib(this.librayList[0], 0)
|
||||
if (
|
||||
res.data.shopProductList &&
|
||||
res.data.shopProductList.length > 0
|
||||
@@ -1773,13 +1654,11 @@
|
||||
} else {
|
||||
this.tjProList;
|
||||
}
|
||||
// console.log("list at line 1233:", list);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.hideLoading()
|
||||
console.log(e, "获取课程数据报错666");
|
||||
});
|
||||
},
|
||||
goBuy() {
|
||||
@@ -1818,7 +1697,6 @@
|
||||
},
|
||||
choosePrice(item) {
|
||||
this.selectGoodsData = item;
|
||||
// console.log(item, 'choosePrice')
|
||||
this.curProId = item.productId;
|
||||
},
|
||||
async chooseChapter(item, index) {
|
||||
@@ -1826,12 +1704,6 @@
|
||||
// 未购买仅试听
|
||||
// let data = null
|
||||
this.courseList[index].tryListen = await this.getPath(item, index);
|
||||
console.log(this.courseList, "1*********");
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/course/learn?courseId=${this.course.id}&catalogueId
|
||||
// =${this.curId}&chapterId=${item.id}`
|
||||
// })
|
||||
}
|
||||
},
|
||||
async getPath(item, index) {
|
||||
@@ -1852,14 +1724,12 @@
|
||||
datas = res.data.videos;
|
||||
console.log(res);
|
||||
});
|
||||
console.log("datas at line 1300:", datas);
|
||||
return datas;
|
||||
},
|
||||
// 选择复读选项
|
||||
async goNewPay(item){
|
||||
this.showNewPayBtn ? await this.getNewPaymentList(item.id) : ''
|
||||
if(this.newPaymentProList.length > 0){
|
||||
// this.getCourseDescriptionData(v);
|
||||
this.goodsList = this.newPaymentProList;
|
||||
this.selectGoodsData = this.goodsList[0];
|
||||
this.$refs.commonSelectGoods.open();
|
||||
@@ -1872,20 +1742,14 @@
|
||||
}
|
||||
},
|
||||
async clicklib(item, index) {
|
||||
console.log('hhhhhhhhhhhhhhhhhhh++++++++', item);
|
||||
|
||||
// if (item.id == this.curId) {
|
||||
// return;
|
||||
// }
|
||||
this.catalogueId = item.id
|
||||
this.curIndex = index;
|
||||
this.curId = item.id;
|
||||
|
||||
if(item.isBuy == 0 && this.userMsg.vip != 2 && this.userMsg.vip != 1 ){
|
||||
console.log('hhhhhhhhhhhhhhhhhhh++++++++');
|
||||
if(item.isBuy == 0 && this.userVip==null ){
|
||||
this.showNewPayBtn = await this.checkRenewPayment(item.id)
|
||||
console.log('可以复读吗?', this.showNewPayBtn );
|
||||
}else{ // this.showNewPayBtn = await this.checkRenewPayment(item.id)
|
||||
}else{
|
||||
console.log('不用复读');
|
||||
}
|
||||
this.chapterList = await this.getChapterList(item.id);
|
||||
@@ -2032,17 +1896,12 @@
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.endBox {
|
||||
// @include theme("vipbtnbg");
|
||||
.endBox {
|
||||
color: #333;
|
||||
font-size: 26rpx;
|
||||
// margin: 20rpx 0;
|
||||
padding: 10rpx 20rpx;
|
||||
|
||||
.box {
|
||||
// background-color: #258feb;
|
||||
}
|
||||
|
||||
|
||||
.flexbox {
|
||||
justify-content: space-between;
|
||||
}
|
||||
@@ -2500,35 +2359,15 @@
|
||||
.gouwuche {
|
||||
border: 1px solid #666;
|
||||
padding-right: 20rpx;
|
||||
|
||||
text {
|
||||
// color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vipBtn {
|
||||
@include theme("vipbtnbg");
|
||||
border-radius: 100rpx;
|
||||
justify-content: center;
|
||||
width: auto;
|
||||
padding: 0 20rpx;
|
||||
color: #fff;
|
||||
margin: 10rpx auto;
|
||||
}
|
||||
|
||||
.buyBtn {
|
||||
background: #f42c32 !important;
|
||||
// background:
|
||||
}
|
||||
|
||||
.buyBox {
|
||||
// position: fixed;
|
||||
// z-index: 2;
|
||||
// bottom: 100rpx;
|
||||
// left: 0;
|
||||
@include pleft_right(4px);
|
||||
// @include mshadow(10px, 1);
|
||||
padding: 20rpx 10rpx;
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
@@ -2538,7 +2377,6 @@
|
||||
#ece6fa 30%,
|
||||
#d7e8f0 60%,
|
||||
#fff 100%);
|
||||
// background: rgba(255, 255, 255, 0.9);
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
@@ -2626,38 +2464,23 @@
|
||||
.containerBg1 {
|
||||
border-top: 1px solid #fff;
|
||||
margin-top: -4rpx;
|
||||
// position: relative;
|
||||
z-index: 1;
|
||||
|
||||
border-radius: 30rpx 30rpx 0 0;
|
||||
// background-color: #fff;
|
||||
// overflow: hidden;
|
||||
}
|
||||
|
||||
.containerBg {
|
||||
// background-color: #f4f7ff;
|
||||
// overflow: hidden;
|
||||
padding: 0 20rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.buyBox {}
|
||||
|
||||
.vipBgColor {
|
||||
// background-color: #8265f9 !important;
|
||||
}
|
||||
|
||||
.coursePart {
|
||||
margin-top: 20rpx;
|
||||
@include ptop_bottm(10px);
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
@include pleft_right(10px);
|
||||
align-items: flex-end;
|
||||
// @include mshadow(10px, 1);
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
padding-top: 20rpx;
|
||||
// background-color: $themeColor;
|
||||
|
||||
.item {
|
||||
justify-content: center;
|
||||
@@ -2748,12 +2571,7 @@
|
||||
.catalogueTitle {
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
// background-image: linear-gradient(108deg, #cae9f9 0%, #e1f6fc8c 50%);
|
||||
|
||||
// background-image: linear-gradient(180deg, #cfe0ff 0%, #fff 50%);
|
||||
// padding: 0 20rpx;
|
||||
font-size: 40rpx;
|
||||
|
||||
.learnBtn {
|
||||
margin-bottom: 20rpx;
|
||||
width: 150rpx;
|
||||
@@ -2840,10 +2658,6 @@
|
||||
line-height: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
// margin-top: 20rpx;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
}
|
||||
|
||||
.fdButtonBoxRed {
|
||||
@@ -2950,7 +2764,6 @@
|
||||
padding: 20rpx;
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
// background-image: url(@/static/bg1.jpg);
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@@ -2981,9 +2794,7 @@
|
||||
font-size: 46rpx;
|
||||
color: $themeColor;
|
||||
background-color: #f5f5f5;
|
||||
// line-height: 46rpx;
|
||||
padding: 20rpx;
|
||||
// border-leradius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
@@ -3000,13 +2811,11 @@
|
||||
|
||||
.center {
|
||||
line-height: 40rpx;
|
||||
// padding:0 10rpx;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100%;
|
||||
margin-top: 60rpx;
|
||||
|
||||
font-size: 24rpx;
|
||||
line-height: 26rpx;
|
||||
color: #b0b0b0;
|
||||
@@ -3058,11 +2867,6 @@
|
||||
color: #1e2f3e;
|
||||
}
|
||||
}
|
||||
|
||||
.textBox.lock {
|
||||
width: calc(100% - 60rpx);
|
||||
}
|
||||
|
||||
.shitingTag {
|
||||
display: flex;
|
||||
}
|
||||
@@ -3073,12 +2877,9 @@
|
||||
|
||||
.course_info_box {
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
// padding:20rpx;
|
||||
.course_info {
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
background: #f2f8ff;
|
||||
// border-radius:20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
@@ -3090,15 +2891,6 @@
|
||||
font-size: 42rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 4rpx;
|
||||
|
||||
// border:4rpx solid #1FB2F8;
|
||||
// box-shadow: 0 2px 12px 0 rgba(255,255,255,.1);
|
||||
// border-radius:40rpx;
|
||||
// color:#fff;
|
||||
// width:200rpx;
|
||||
// height:70rpx;
|
||||
// display:inline-block;
|
||||
// padding:10rpx 20rpx;
|
||||
}
|
||||
|
||||
.vipchapter_content {
|
||||
@@ -3168,10 +2960,6 @@
|
||||
// box-shadow: 0 2px 12px 0 rgba(255,255,255,.1);
|
||||
// border-radius:40rpx;
|
||||
color: #fff;
|
||||
// width:200rpx;
|
||||
// height:70rpx;
|
||||
// display:inline-block;
|
||||
// padding:10rpx 20rpx;
|
||||
font-size: 72rpx;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -3225,12 +3013,30 @@
|
||||
.seePaper {
|
||||
color: #35a6ff;
|
||||
font-size: 32rpx;
|
||||
// width: 50rpx;
|
||||
// height: 50rpx;
|
||||
|
||||
// image {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
}
|
||||
.describe_block{
|
||||
padding: 15rpx 20rpx;
|
||||
background: linear-gradient(90deg, #258feb 0%, #00e1ec 100%);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.describe_block text{
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
.describe_block button{
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
padding: 0 15rpx;
|
||||
border-radius: 10rpx;
|
||||
line-height: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -414,27 +414,24 @@
|
||||
// 直接购买
|
||||
buy(val){
|
||||
var mynavData = JSON.stringify({
|
||||
goods: [
|
||||
{
|
||||
productImages: val.productImages,
|
||||
productId: val.productId,
|
||||
productName: val.productName,
|
||||
price: val.activityPrice && val.activityPrice != 0 ? val.activityPrice:val.price,
|
||||
goodsType: val.goodsType,
|
||||
},
|
||||
],
|
||||
|
||||
navTitle: val.productName,
|
||||
title: val.productName,
|
||||
typeId: 0,
|
||||
}); // 这里转换成 字符串
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/order/index?data=${mynavData}`,
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url:`/pages/bookShop/settlement?type=2&list=${val.id}`
|
||||
// })
|
||||
goods: [
|
||||
{
|
||||
productImages: val.productImages,
|
||||
productId: val.productId,
|
||||
productName: val.productName,
|
||||
price: val.activityPrice && val.activityPrice != 0 ? val.activityPrice:val.price,
|
||||
goodsType: val.goodsType,
|
||||
},
|
||||
],
|
||||
|
||||
navTitle: val.productName,
|
||||
title: val.productName,
|
||||
typeId: 0,
|
||||
}); // 这里转换成 字符串
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/goods/order/index?data=${mynavData}`,
|
||||
});
|
||||
},
|
||||
closePup(e){
|
||||
this.pricespop = false
|
||||
|
||||
Reference in New Issue
Block a user