|
@@ -114,6 +114,22 @@
|
|
|
<view class="btn2" @click="buy">立即购买 </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 已购买过课程的弹窗 -->
|
|
|
+ <u-popup v-model="bugCourseModel" mode="center" border-radius="40">
|
|
|
+ <view class="had_bugCourse">
|
|
|
+ <image src="/pages3/static/imgs/hadBug.png" class="share"></image>
|
|
|
+ <view class="tips">
|
|
|
+ <view class="warns">温馨提示</view>
|
|
|
+ <view class="words">您<text>已购买过</text>该商品课程</view>
|
|
|
+ <view class="words">可立即前往学习</view>
|
|
|
+ </view>
|
|
|
+ <view class="tip_botton">
|
|
|
+ <view class="cancel_btn" @click="changeKown()">知道了</view>
|
|
|
+ <view class="confirm_btn" @click="toStudy()">去学习</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -148,7 +164,9 @@ export default {
|
|
|
isFirstEnter:true, //是否首次进入
|
|
|
timer:null,
|
|
|
businessData:{},
|
|
|
- startTime:0
|
|
|
+ startTime:0,
|
|
|
+ bugCourseModel: false, // 弹窗
|
|
|
+ hadBuyCourse: {}, // 已购买课程信息
|
|
|
};
|
|
|
},
|
|
|
computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList','playSectionId','hideBuyState']) },
|
|
@@ -157,6 +175,7 @@ export default {
|
|
|
this.getDetail()
|
|
|
this.goodsCourseList()
|
|
|
this.appCommonGoodsCourseModuleFreeExamList();
|
|
|
+ this.getIsBuy() // 判断是否已经购买过该课程
|
|
|
wx.showShareMenu({
|
|
|
withShareTicket: true,
|
|
|
menus: ["shareAppMessage", "shareTimeline"]
|
|
@@ -436,7 +455,135 @@ export default {
|
|
|
uni.switchTab({
|
|
|
url: '/pages/shopping/shoppingCart'
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ getIsBuy() {
|
|
|
+ this.$http({
|
|
|
+ url: '/order/buyGoodsNotExpired',
|
|
|
+ method: 'get',
|
|
|
+ data: { goodsId: this.id }
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ if (res.data.data) { // 有data返回是已经购买过的课程
|
|
|
+ this.hadBuyCourse = res.data.data
|
|
|
+ this.bugCourseModel = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeKown() {
|
|
|
+ this.bugCourseModel = false
|
|
|
+ },
|
|
|
+ toStudy() {
|
|
|
+ // console.log('==============')
|
|
|
+ // let item = this.hadBuyCourse
|
|
|
+ // if (item.goodsType == 6) { // 进入直播课
|
|
|
+ // this.toLive(item)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // // /course/goodsRebuildStatus查询用户商品重修状态
|
|
|
+ // let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
|
|
|
+
|
|
|
+ // if (rebuildStatus == 0) {
|
|
|
+ // this.$navTo.togo('/pages2/learn/details', {
|
|
|
+ // gradeId: item.gradeId,
|
|
|
+ // goodsId: item.goodsId,
|
|
|
+ // orderGoodsId: item.orderGoodsId,
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // // /lock/lockStatus
|
|
|
+ // this.$api.lockLockStatus({
|
|
|
+ // action: 'jxjy',
|
|
|
+ // uuid:this.$method.getUuid()
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.data.code == 200) { //有其他端在操作,不能学习
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: res.data.msg,
|
|
|
+ // mask: true,
|
|
|
+ // duration: 3000
|
|
|
+ // })
|
|
|
+ // } else if (res.data.code == 500) { //可以学习
|
|
|
+ // this.$http({
|
|
|
+ // url: '/course/courseList',
|
|
|
+ // method: 'get',
|
|
|
+ // data: {
|
|
|
+ // pageNum: 1,
|
|
|
+ // pageSize: 1,
|
|
|
+ // goodsId: item.goodsId,
|
|
|
+ // gradeId: item.gradeId,
|
|
|
+ // orderGoodsId: item.orderGoodsId,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // if(res.data.total > 1) {
|
|
|
+ // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${item.orderGoodsId}`);
|
|
|
+ // } else if(res.data.total == 1) {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon:'none',
|
|
|
+ // title:'暂无可观看的视频课程'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // toLive(item) {
|
|
|
+ // this.$api.courseCourseList({
|
|
|
+ // pageNum: 1,
|
|
|
+ // pageSize: 1,
|
|
|
+ // goodsId: item.goodsId,
|
|
|
+ // gradeId: 0,
|
|
|
+ // orderGoodsId: item.orderGoodsId,
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.data.code == 200) {
|
|
|
+ // if(res.data.total > 1) {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
|
|
|
+ // })
|
|
|
+ // } else if(res.data.total == 1) {
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url:'/pages3/live/detail?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0&courseId='+ res.data.rows[0].courseId
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon:'none',
|
|
|
+ // title:'暂无可观看的直播课程'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ /**
|
|
|
+ * @param {Object} goodsId 商品id
|
|
|
+ * 查询商品重修状态
|
|
|
+ */
|
|
|
+ // courseGoodsRebuildStatus(goodsId, gradeId) {
|
|
|
+ // return new Promise(resolve => {
|
|
|
+ // this.$http({
|
|
|
+ // url: '/course/goodsRebuildStatus',
|
|
|
+ // method: 'get',
|
|
|
+ // data: {
|
|
|
+ // goodsId: goodsId,
|
|
|
+ // gradeId: gradeId
|
|
|
+ // },
|
|
|
+ // // noLoading: true,
|
|
|
+ // // compleLoading: true, // 请求成功是否还要继续显示加载中
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // resolve(res.data.data)
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -446,6 +593,7 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss" scope>
|
|
|
+@import './index.scss';
|
|
|
.video_t2 {
|
|
|
font-size: 24rpx;
|
|
|
font-family: PingFang SC;
|
|
@@ -492,27 +640,14 @@ export default {
|
|
|
background-color: #ffffff;
|
|
|
margin-top: 16rpx;
|
|
|
overflow: hidden;
|
|
|
- // border-radius: 24rpx 24rpx 0rpx 0rpx;
|
|
|
- // position: relative;
|
|
|
- // top: -27rpx;
|
|
|
- // left: 0;
|
|
|
}
|
|
|
.cou_title {
|
|
|
- // height: 210rpx;
|
|
|
padding: 24rpx 32rpx 40rpx 32rpx;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
.prices {
|
|
|
- // .price_sym {
|
|
|
- // font-size: 20rpx;
|
|
|
- // color: #333333;
|
|
|
- // position: relative;
|
|
|
- // top: -23rpx;
|
|
|
- // left: 0;
|
|
|
- // margin-right: 10rpx;
|
|
|
- // }
|
|
|
.price_word {
|
|
|
font-size: 40rpx;
|
|
|
font-weight: 800;
|
|
@@ -568,9 +703,6 @@ export default {
|
|
|
.icon_up{
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
- }
|
|
|
- .contentBox{
|
|
|
-
|
|
|
}
|
|
|
.courseItemBox{
|
|
|
background: #FFFFFF;
|
|
@@ -611,61 +743,7 @@ export default {
|
|
|
margin-right: 11rpx;
|
|
|
font-size: 24rpx;
|
|
|
}
|
|
|
- .bottomBox{
|
|
|
- position: fixed;
|
|
|
- bottom: 0;
|
|
|
- width: 100%;
|
|
|
- left: 0;
|
|
|
- height: 132rpx ;
|
|
|
- background-color: #FFFFFF;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- padding: 0 24rpx;
|
|
|
- box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.1000);
|
|
|
- .icons {
|
|
|
- display: flex;
|
|
|
- .share_w {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #333;
|
|
|
- margin-top: 6rpx;
|
|
|
- }
|
|
|
- .icon_item {
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .ones {
|
|
|
- margin-left: 32rpx;
|
|
|
- margin-right: 60rpx;
|
|
|
- position: relative;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- /deep/ button::after{
|
|
|
- border: none;
|
|
|
- }
|
|
|
- .bt_share {
|
|
|
- width: 38rpx;
|
|
|
- height: 38rpx;
|
|
|
- position: absolute;
|
|
|
- top: 3rpx;
|
|
|
- left: 0;
|
|
|
- z-index: 100;
|
|
|
- opacity: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .share {
|
|
|
- width: 38rpx;
|
|
|
- height: 38rpx;
|
|
|
- position: relative;
|
|
|
- top: 3rpx;
|
|
|
- z-index: 99;
|
|
|
- margin-bottom: 4rpx;
|
|
|
- }
|
|
|
- .shopcar {
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
.blackFont{
|
|
|
margin: 0 4rpx;
|
|
|
}
|