Pārlūkot izejas kodu

fix:学习模块直播课程调整。0元支付订单编号。下载讲义图标动态

xuqiaoying 3 gadi atpakaļ
vecāks
revīzija
fd59f70076

+ 2 - 2
common/request.js

@@ -5,11 +5,11 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 52 - 9
pages/learn/index.vue

@@ -81,7 +81,7 @@
 						<view class="c_downs">
 							<view class="lefts">
 								<image class="lefet_img" :src="$method.splitImgHost(item.coverUrl, true)" mode=""></image>
-								<!-- <view class="live_icon">直播</view> -->
+								<view v-if="item.goodsType == 6" class="live_icon">直播</view>
 							</view>
 							<view class="rights">
 								<template
@@ -486,9 +486,10 @@ export default {
 	onLoad() {
 		// 1668873600 ,2022.11.20的时间戳
 		this.leftDays = 1668873600 - parseInt(curTime/1000)
-		this.getCourseLiveQues()
+		// this.getCourseLiveQues()
 	},
 	async onShow() {
+		this.getCourseLiveQues()
 		await this.commonSystemTime()
 		this.sysTime = +this.$method.timest()
 	},
@@ -590,8 +591,41 @@ export default {
 				url:`../../pages/webview/index?url=`+encode
 			})
 		},
+		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:'暂无可观看的直播课程'
+						})
+					}
+				
+				}
+			})
+		},
 		async studyIn(v, i, item, index) {
-			console.log('item', item)
+			// console.log('item', item)
+			if (item.goodsType == 6) { // 进入直播课
+				this.toLive(item)
+				return
+			}
+
+			// 进入视频课
 			this.activeItem = item
 			if (item.interfaceAccountId > 0) { //学习账号已开通
 
@@ -696,8 +730,7 @@ export default {
 							duration: 3000
 						})
 					} else if (res.data.code == 500) { //可以学习
-
-						if (item.courseNum == 1) { // 课程数量
+						// if (item.courseNum == 1) { // 课程数量
 							// /course/courseList查询商品下的课程列表
 							this.$api.courseCourseList({
 								pageNum: 1,
@@ -707,16 +740,26 @@ export default {
 								orderGoodsId: item.orderGoodsId,
 							}).then(res => {
 								if (res.data.code == 200) {
-									uni.navigateTo({
+
+									if(res.data.total > 1) {
+										this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&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:'暂无可观看的视频课程'
+										})
+									}
+
 								}
 							});
 							return;
-						}
+						// }
 						
-						this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);						
+						// this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);						
 					}
 				})
 

+ 1 - 1
pages2/order/confirm_pay.vue

@@ -132,7 +132,7 @@ export default {
 					uni.setStorageSync('updateCart',1) //提醒刷新购物车
 					if(this.totalPrice == 0) { //免费商品
 						uni.redirectTo({
-						    url: `/pages2/order/confirm_success?sn=${res.data.orderSn}&isBk=${self.isBK}`
+						    url: `/pages2/order/confirm_success?sn=${res.data.data.orderSn}&isBk=${self.isBK}`
 						});
 					} else {
 						let data = res.data.data

+ 1 - 1
pages3/live/detail.vue

@@ -110,7 +110,7 @@
         <!--目录 -->
         <view v-show="current == 0">
 					<view class="top__header" v-if="livingItem" @click="goLive(livingItem)">
-						<image class="img" src="/pages5/static/live.png" mode="widthFix"></image>
+						<image class="img" src="/pages3/static/imgs/live.png" mode="widthFix"></image>
 						<view class="note">正在直播中</view>
 						<view class="title">{{livingItem.sectionName}}</view>
 					</view>

+ 12 - 4
pages3/polyv/detail.vue

@@ -114,9 +114,9 @@
         <!--目录 -->
         <view v-show="current == 0">
 					<view class="top__header" v-if="livingItem" @click="goLive(livingItem)">
-						<image class="img" src="/pages5/static/live.png" mode="widthFix"></image>
+						<image class="img" src="/pages3/static/imgs/live.png" mode="widthFix"></image>
 						<view class="note">正在直播中</view>
-						<view class="title">{{livingItem.name}}</view>
+						<view class="title">{{livingItem.sectionName}}</view>
 					</view>
           <view class="menuBox" v-for="(item, index) in menuList" :key="index">
             <!--模块 -->
@@ -178,9 +178,8 @@
               <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
             </view>
             <view class="btn" @click="openDocument">
-              <!-- <u-icon name="download" color="#007AFF" size="40"></u-icon> -->
               <image v-if="!downLoading" src="/pages3/static/imgs/downLoad.png" style="width: 40rpx;height: 40rpx;"></image>
-              <image v-else src="/pages3/static/imgs/downLoading.png" style="width: 40rpx;height: 40rpx;"></image>
+              <image v-else src="/pages3/static/imgs/downLoading.png" class="loading_down" style="width: 40rpx;height: 40rpx;"></image>
             </view>
           </view>
         </view>
@@ -2595,6 +2594,15 @@ export default {
     box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
     border-radius: 16rpx 16rpx 16rpx 16rpx;
   }
+  @keyframes rotation{
+      from {-webkit-transform: rotate(0deg);}
+      to {-webkit-transform: rotate(360deg);}
+  }
+  .loading_down {
+    transform: rotate(360deg);
+    animation: rotation 3s linear infinite;
+  }
+  
 }
 
 .lecture-content {

BIN
pages3/static/imgs/live.png