Forráskód Böngészése

Merge branch '2025鹅状元数学' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025鹅状元数学

tanxue 3 hete
szülő
commit
99afe1d3d9

+ 61 - 0
api/chanpinJiSuanTeXun.js

@@ -9,4 +9,65 @@ export function getChanpin2DengjiSave(data = {}) {
         data,
         timeout: 20000
     })
+}
+
+
+export function getJisuanChanpinDanyuanInfo(data = {}) {
+    return request({
+        'url': '/app/jisuan/chanpin/danyuan/dagang/info',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}
+
+export function getJisuanChanpinJieInfo(data = {}) {
+    return request({
+        'url': '/app/jisuan/chanpin/jie/info',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}
+
+export function getJisuanChanpinSave(data = {}) {
+    return request({
+        'url': '/app/jisuan/chanpin/save',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}
+
+export function getJisuanChanpinWancheng(data = {}) {
+    return request({
+        'url': '/app/jisuan/chanpin/wancheng',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}
+
+export function getJisuanChanpinDanyuanMulu(data = {}) {
+    return request({
+        'url': '/app/jisuan/chanpin/danyuan/list',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
 }

+ 12 - 0
api/chanpinneirong.js

@@ -46,3 +46,15 @@ export function shuxueChanpinDengjiInfo(data = {}) {
     timeout: 20000
   })
 }
+
+export function shuxueSave2(data = {}) {
+  return request({
+    'url': '/app/jisuan/chanpin/save',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 24 - 0
api/shop.js

@@ -36,6 +36,30 @@ export function getAppCp1Info(data = {}) {
 	})
 }
 
+export function getAppCp2Buy(data = {}) {
+	return request({
+		url: "/app/shop/jisuan/buy",
+		headers: {
+			isToken: true
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
+}
+
+export function getAppCp2Info(data = {}) {
+	return request({
+		url: "/app/shop/jisuan/info",
+		headers: {
+			isToken: true
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
+}
+
 
 export function orderPayAli(data = {}) {
 	return request({

+ 20 - 0
pages.json

@@ -97,6 +97,12 @@
 			}
 		},
 		{
+			"path": "pages/jisuantexun/lookShipin",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},
+		{
 			"path" : "pages/chanpinMy/yinsizhengce",
 			"style" :
 			{
@@ -118,6 +124,20 @@
 			}
 		},
 		{
+			"path" : "pages/chanpinShop/cp2/intro",
+			"style" :
+			{
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path" : "pages/chanpinShop/cp2/dingdan",
+			"style" :
+			{
+				"navigationStyle": "custom"
+			}
+		},
+		{
 			"path" : "pages/chanpinMy/duihuanma",
 			"style" :
 			{

+ 4 - 1
pages/chanpinShop/components/shuxueList.vue

@@ -2,9 +2,11 @@
 	<view class="shop-card-list" v-if="list.length">
     <template  v-for="{chanpin,value:item} in list">
       <cp1 v-if="chanpin == 'tujiemuti'" :item="item" :key="item.chanpinId"></cp1>
+      <cp2 v-if="chanpin == 'jisuantexun'" :item="item" :key="item.chanpinId"></cp2>
     </template>
-
+    <view class="ezy-no-more">没有更多</view>
 	</view>
+
 	<view class="ezy-no-sj" v-else>
 		<icon></icon>
 		<text>暂无数据</text>
@@ -14,6 +16,7 @@
 <script setup>
 
 import cp1 from '../cp1/card.vue';
+import cp2 from '../cp2/card.vue';
 
 	const props = defineProps({
 		list: {

+ 35 - 0
pages/chanpinShop/cp2/card.vue

@@ -0,0 +1,35 @@
+<template>
+  <view class="shop-card-box" @click="handleClick">
+      <!-- 封面 -->
+      <image :src="item.cover" class="shop-img"></image>
+      <view class="card-right-box">
+        <!-- 名称 -->
+        <view class="card-title">{{item.name}}</view>
+        <!-- 简介 -->
+        <view class="card-content">{{item.intro}}</view>
+        <!-- 共计 -->
+        <view class="card-price">¥{{item.price}}</view>
+      </view>
+  </view>
+</template>
+
+<script setup>
+import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+const props = defineProps({
+  item: {
+    type: Object
+  }
+})
+
+	// 选择产品等级
+function handleClick() {
+	uni.navigateTo({
+		url: '/pages/chanpinShop/cp2/intro'
+	})
+}
+
+</script>
+
+<style scoped>
+
+</style>

+ 276 - 0
pages/chanpinShop/cp2/dingdan.vue

@@ -0,0 +1,276 @@
+<template>
+	<view class="ezy-qrdd-page">
+		<view class="icon-title-navBar-box">
+			<view class="nav-bar-icon" @click="handleBack"></view>
+			<text class="nav-bar-title">确认订单</text>
+		</view>
+		<view class="qrdd-body-box">
+			<!-- 卡片 -->
+			<view class="dd-item-box">
+				<!-- 封面 -->
+				<image class="item-img-box" :src="data.cover" mode=""></image>
+				<view class="item-content-box">
+					<!-- 名称 -->
+					<view class="item-name">{{data.name}}</view>
+					<!-- 简介 -->
+					<view class="item-intro">{{data.intro}}</view>
+					<!-- 价格 -->
+					<view class="item-xianjia">¥{{xianjia}}</view>
+				</view>
+				<view class="item-play-btn"></view>
+			</view>
+			<!-- 等级 -->
+			<view class="qrdd-border-box">
+				<view class="kcxxdj-title">课程学习等级</view>
+				<view class="kcxxdj-tc-box">
+					<!-- 套餐 -->
+					<ezyActiveVue class="ezy-btn-active tc-item" v-for="item in data.taocanList"
+						@click="handleSelectTaoCan(item)" :class="{active: item.taocanId == activeTaocan.taocanId}">
+						{{item.name}}
+					</ezyActiveVue>
+				</view>
+			</view>
+
+			<!-- 商品总价 -->
+			<view class="qrdd-border-box">
+				<view class="border-row">
+					<view>商品总价</view>
+					<view>¥{{yuanjia}}</view>
+				</view>
+				<view class="border-row">
+					<view>优惠券</view>
+					<view class="jg-text">-¥{{youhui}}</view>
+				</view>
+				<view class="border-row sum-row">
+					<view class="sum-text">合计</view>
+					<view class="jg-text">¥{{xianjia}}</view>
+				</view>
+			</view>
+			<!-- 支付模式 -->
+			<template v-if="currentPlatform != 'ios'">
+				<radio-group @change="radioChange" class="qrdd-border-box">
+					<label class="border-row" v-for="(item, index) in items" :key="item.value">
+						<view class="zzfs-name-box">
+							<icon :class="{
+							  'wechat-icon': item.name === '微信',
+							  'alipay-icon': item.name === '支付宝'
+							}"></icon>
+							<text>{{item.name}}</text>
+						</view>
+						<radio :value="item.value" :checked="index === current" style="transform:scale(0.7)" />
+					</label>
+				</radio-group>
+			</template>
+		</view>
+
+		<!-- 支付区 -->
+		<view class="qrdd-footer-box">
+			<view class="jg-box">
+				<view class="sum-row">
+					<text class="sum-text">合计:</text>
+					<text class="xj-text-text">¥{{xianjia}}</text>
+				</view>
+				<view class="yh-text">共优惠¥{{youhui}}</view>
+			</view>
+			<view @click="handlePay" class="ljzf-btn">立即支付</view>
+		</view>
+		<!-- <view class="shop-mask">遮盖层</view> -->
+	</view>
+	
+	<kaiTongFongShiVue ref="kaiRef" @ykIoszhifu="ykIoszhifu" @success="handlePay"></kaiTongFongShiVue>
+</template>
+
+<script setup>
+	import {
+		reactive,
+		ref,
+		computed,
+	} from "vue";
+	import {
+		onLoad,
+		onShow
+	} from "@dcloudio/uni-app"
+	import * as shopHttp from "@/api/shop.js"
+	import kaiTongFongShiVue from "../components/kaiTongFongShi.vue";
+	import {
+		usePay
+	} from "../usePay.js";
+	import {
+		getUserIsYouke
+	} from "@/utils/common.js"
+	import cacheManager from "@/utils/cacheManager.js";
+	import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+  import {getAppCp2Buy} from "../../../api/shop";
+	
+	
+	const currentPlatform = ref(null);
+
+	function isIOSorAndroid() {
+		const systemInfo = uni.getSystemInfoSync();
+
+		if (systemInfo.platform == 'ios') {
+			currentPlatform.value = 'ios'
+		} else {
+			currentPlatform.value = 'android'
+		}
+	}
+
+	const data = reactive({
+		chanpinId: null,
+		cover: null,
+		intro: null,
+		name: null,
+		taocanList: []
+	})
+
+	const activeTaocan = ref(null)
+	const kaiRef = ref(null)
+
+	const current = ref(0)
+	const items = ref([{
+		name: '微信',
+		value: '0'
+	}, {
+		name: '支付宝',
+		value: '1'
+	}])
+
+
+
+	const youhui = computed(() => {
+		if (!activeTaocan.value) {
+			return '0.00'
+		} else {
+			return activeTaocan.value.youhui
+		}
+	})
+
+	const xianjia = computed(() => {
+		if (!activeTaocan.value) {
+			return '0.00'
+		} else {
+			return activeTaocan.value.xianjia
+		}
+	})
+
+	const yuanjia = computed(() => {
+		if (!activeTaocan.value) {
+			return '0.00'
+		} else {
+			return activeTaocan.value.yuanjia
+		}
+	})
+
+	const {
+		OrderPay
+	} = usePay({
+		createOrderError: () => {}, // 创建订单失败
+		checkError: () => {}, // 校验失败
+		payError: () => {}, // 支付失败
+		paySuccess: () => {
+			// 支付成功删除contentInfo 缓存
+			cacheManager.remove("contentInfo");
+			// zhifu='success' 用于判断在订单页 游客模式ios支付成功情况,要去弹出弹窗
+			uni.navigateTo({
+				url: "/pages/chanpinMy/order?zhifu=success"
+			})
+			// uni.showLoading({
+			// 	title: '跳转中...',
+			// 	mask: true
+			// });
+			// uni.switchTab({
+			// 	url: "/pages/chanpinMy/my" // 你的F页面实际路径(不变)
+			// });
+			// setTimeout(() => {
+			// 	uni.navigateTo({
+			// 		url: "/pages/chanpinMy/order?zhifu=success", // 你的D页面路径+保留zhifu=success传参
+			// 		success: () => {
+			// 			uni.hideLoading();
+			// 		},
+			// 		fail: () => {
+			// 			uni.hideLoading();
+			// 			toast("跳转失败,请重试");
+			// 		}
+			// 	});
+			// }, 300);
+
+
+
+		}, //支付成功
+		applePayError: () => {}, // 苹果内购失败
+	});
+
+	onLoad(() => {
+		isIOSorAndroid();
+		initPage();
+		if (currentPlatform.value == 'ios') {
+			// ios 无微信与支付宝
+			current.value = -1;
+		}
+	})
+
+	function ykIoszhifu() {
+		console.log('12311');
+		const options = {
+			chanpinId: data.chanpinId,
+			taocanId: activeTaocan.value.taocanId
+		};
+		options.applePid = activeTaocan.value.applePid;
+		console.log('options', options);
+		console.log('activeTaocan.value.applePid', activeTaocan.value.applePid);
+		OrderPay('apple', options)
+	}
+
+
+	function radioChange(d) {
+		current.value = d.detail.value;
+	}
+
+	function handleSelectTaoCan(item) {
+		activeTaocan.value = item;
+	}
+
+	function initPage() {
+		shopHttp.getAppCp2Buy().then(res => {
+			Object.assign(data, res.data)
+
+			activeTaocan.value = res.data.taocanList[0]
+		})
+	}
+
+	function handlePay() {
+		if (getUserIsYouke()) {
+			// 游客
+			kaiRef.value.handleShow();
+		} else {
+			// 非游客
+			const options = {
+				chanpinId: data.chanpinId,
+				taocanId: activeTaocan.value.taocanId
+			};
+
+			if (currentPlatform.value == 'ios') {
+				options.applePid = activeTaocan.value.applePid;
+				console.log('apple支付入参', options)
+				// 苹果
+				OrderPay('apple', options)
+			} else if (currentPlatform.value != 'ios' && current.value == '0') {
+				console.log('wx支付入参', options)
+				// 微信
+				OrderPay('wx', options)
+			} else if (currentPlatform.value != 'ios' && current.value == '1') {
+				console.log('ali支付入参', options)
+				// 支付宝
+				OrderPay('ali', options)
+			}
+		}
+	}
+
+	function handleBack() {
+		uni.navigateBack()
+	}
+</script>
+
+<style>
+
+</style>

+ 80 - 0
pages/chanpinShop/cp2/intro.vue

@@ -0,0 +1,80 @@
+<template>
+	<view class="ezy-shop-info-page">
+		<view class="icon-title-navBar-box">
+			<view class="nav-bar-icon" @click="handleBack"></view>
+			<text class="nav-bar-title">商品详情</text>
+		</view>
+		<view class="shop-info-body">
+			<view class="img-content-box">
+				<img :src="imageUrl" alt="" />
+			</view>
+			<view class="fx-btn-row">
+				<view @click="fenxiang" class="fx-btn">
+					<icon class="fx-icon"></icon>
+					<view>分享</view>
+				</view>
+				<ezyActiveVue @click="handleStudy" class="ezy-btn-active bmxx-btn">立即报名学习</ezyActiveVue>
+			</view>
+		</view>
+		
+
+<!--  分享  -->
+    <SharePopup ref="sharePopup" :type="2" title="商品详情" desc="商品详情"
+                :image="imageUrl" currentPage="tupian"
+                @success="handleShareSuccess" @error="handleShareError" />
+	</view>
+</template>
+
+<script setup>
+	import {
+		reactive,
+		ref
+	} from "vue";
+	import {
+		onLoad,
+		onShow
+	} from "@dcloudio/uni-app"
+	import * as shopHttp from "@/api/shop.js"
+  import {getAppCp1Info} from "@/api/shop";
+  import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+  import SharePopup from "@/components/sharePopUp/index.vue"
+  import {toast} from "uview-plus";
+	
+	const imageUrl = ref(null);
+  const sharePopup = ref(null);
+
+	onLoad(() => {
+		initPage()
+	})
+
+	function initPage() {
+		shopHttp.getAppCp2Info().then(res => {
+			imageUrl.value = res.data.image;
+		})
+	}
+
+  function handleShareError() {
+    toast('分享失败')
+  }
+
+  function handleShareSuccess() {
+    toast('分享成功')
+  }
+	
+	function fenxiang() {
+    sharePopup.value.open();
+  }
+	function handleStudy() {
+		uni.navigateTo({
+			url: '/pages/chanpinShop/cp2/dingdan'
+		})
+	}
+	
+	function handleBack() {
+		uni.navigateBack()
+	}
+</script>
+
+<style>
+
+</style>

+ 1 - 1
pages/chanpinXuanze/components/shuxueList.vue

@@ -4,7 +4,7 @@
      <cp1 v-if="chanpin == 'tujiemuti'" :item="item" :key="item.chanpinId"></cp1>
      <cp2 v-if="chanpin == 'jisuantexun'" :item="item" :key="item.chanpinId"></cp2>
     </template>
-    <view class="ezy-no-more" v-if="list.length">没有更多</view>
+    <view class="ezy-no-more">没有更多</view>
 	</view>
 	<view class="ezy-no-sj" v-else>
 		<icon></icon>

+ 11 - 14
pages/chanpinneirong/chanpin2.vue

@@ -72,7 +72,7 @@
 	import cacheManager from "@/utils/cacheManager.js";
 	import {
 		shuxueChanpinDengjiInfo,
-		shuxueSave
+		shuxueSave2
 	} from "@/api/chanpinneirong.js"
 	import {
 		onLoad,
@@ -238,46 +238,43 @@
 			},
 
 			getJieAndDanyuan(data, jieId) {
-				for (let danyuan of data.jieList) {
-					for (let jie of danyuan.jieList) {
+				for (let jie of data.jieList) {
 						if (jie.jieId == jieId) {
 							return {
-								danyuan,
 								jie
 							}
 						}
-					}
+					
 				}
 				return null;
 			},
 
 			async saveAndNavigate(jieId, type, da, code) {
 
-				console.log('this.banbenId', this.banbenId);
-				console.log('this.danyuanIddanyuanId', da.jieId);
+				console.log('da', da);
 				if (code == 'jixu') {
-					if (!this.banbenId || !da.jieId) {
-						toast("banbenId或者jieId 丢失")
+					if (!da.jieId) {
+						toast("jieId 丢失")
 						return false
 					}
 				}
 
 				let req = {
-					"banbenId": this.banbenId,
-					"jieId": da.jieId,
-					"jieId": jieId
+					"dengjiId": da.dengjiId,
+					"jieId": da.jieId
 				}
 				console.log('req', req);
-				const res = await shuxueSave(req);
+				const res = await shuxueSave2(req);
 				if (res.code == 0) {
 					let curJieAndDanyuan = this.getJieAndDanyuan(this.neirongInfo, jieId);
+					console.log('curJieAndDanyuan',curJieAndDanyuan);
+					
 					if (!curJieAndDanyuan) {
 						toast("未找到课程信息");
 						return false;
 					}
 
 					const cacheData = cacheManager.get('contentInfo') || {};
-					cacheData.curDanyuanName = curJieAndDanyuan.danyuan.danyuanName;
 					cacheData.curKechengName = curJieAndDanyuan.jie.jieIntro;
 					cacheData.jieId = curJieAndDanyuan.jie.jieId;
 					cacheData.curJieId = jieId;

+ 59 - 0
pages/jisuantexun/components/tishiDl.vue

@@ -0,0 +1,59 @@
+<template>
+	<!-- 弹窗 -->
+	<view>
+		<uni-popup ref="popupRef" :animation="false" :is-mask-click="false" mask-background-color="rgba(0,0,0, 0.76);">
+			<view class="ezy-tip-dialog tip-e-dialog ">
+				<view class="close-btn" @click="handleClose"></view>
+				<view class="e-img kx-e-img"></view>
+				<view class="text-score">完成了本节基础课程的学习</view>
+				<view class="time-tip-box" v-if="times">({{count}}S)</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script setup>
+	import {
+		nextTick,
+		ref
+	} from "vue"
+
+	const times = ref(null)
+	const count = ref(5);
+	const popupRef = ref(null);
+
+
+	function initTime() {
+		times.value = setTimeout(() => {
+			if (count.value == 0) {
+				handleClose();
+				return;
+			}
+			count.value--;
+			initTime()
+		}, 1000)
+	}
+
+	function clearTime() {
+		clearTimeout(times.value);
+		times.value = null;
+		count.value = 5;
+	}
+
+	function handleClose() {
+		clearTime();
+		popupRef.value.close();
+	}
+
+	function open() {
+		popupRef.value.open();
+		nextTick(() => initTime())
+	}
+
+	defineExpose({
+		open
+	})
+</script>
+
+<style>
+</style>

+ 222 - 0
pages/jisuantexun/components/videoPlay.vue

@@ -0,0 +1,222 @@
+<template>
+	<view class="ezy-video-box course-video-box">
+		<view ref="videoContent" id="video-play1" :playAuth="playAuth1" :count="count" :change:count="renderScript.stopPlayer"
+			:change:playAuth="renderScript.receiveMsg" :videoId="videoId1" :change:videoId="renderScript.videoIdFun"
+			:hideFlag="hideFlag1" :change:hideFlag="renderScript.hideFlagFun" :progressMarkers="progressMarkers1"
+			:change:progressMarkers="renderScript.progressMarkersMsg" :seekTime="seekTime1"
+			:change:seekTime="renderScript.seekTimeFun" class="ezy-video">
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "videoPlay",
+		props: {
+			cId: {
+				type: String,
+			},
+			progressMarkers1: {
+				type: Array,
+				default: () => ([])
+			},
+			videoId1: {
+				type: String,
+			},
+			playAuth1: {
+				type: String,
+			},
+			seekTime1: {
+				type: String
+			},
+			hideFlag1: {
+				type: String
+			}
+		},
+		data() {
+			return {
+				count: 0
+			}
+		},
+		methods: {
+			handleStop() {
+				this.count++;
+			},
+			playEnd() {
+				this.$emit('playEnd')
+			}
+		}
+	}
+</script>
+
+<script module="renderScript" lang="renderjs">
+	export default {
+		data() {
+
+			return {
+				player: null,
+				playAuth: '',
+				videoId: '',
+				progressMarkers: [],
+				isFullScreen: false,
+				seekTime: '',
+			}
+		},
+		methods: {
+			stopPlayer() {
+				console.log('暂停stopPlayer1')
+				this.player && this.player.pause();
+			},
+			receiveMsg(newValue, oldValue, ownerInstance, instance) {
+				if (newValue) {
+					this.playAuth = ''
+					this.playAuth = newValue
+					this.loadWebPlayerSDK()
+
+				}
+			},
+			videoIdFun(newValue, oldValue, ownerInstance, instance) {
+				if (newValue) {
+					this.videoId = ''
+					this.videoId = newValue
+				}
+			},
+			hideFlagFun(newValue, oldValue, ownerInstance, instance) {
+				if (this.player) {
+					this.player.pause()
+				}
+			},
+			progressMarkersMsg(newValue, oldValue, ownerInstance, instance) {
+				if (newValue) {
+					this.progressMarkers = newValue
+				}
+			},
+			seekTimeFun(newValue, oldValue, ownerInstance, instance) {
+				if (newValue) {
+					this.player.play()
+					this.player.seek(newValue)
+				}
+			},
+			playAli() {
+				let that = this
+				//配置播放器
+				if (!this.playAuth) {
+					return false;
+				}
+				var player = new Aliplayer({
+					id: 'video-play1',
+					"vid": this.videoId,
+					"playauth": this.playAuth,
+					extraInfo: {
+						poster: 'noposter'
+					},
+					fullscreenEvents: {
+						fullscreenChange: (isFull) => {
+							this.isFullScreen = isFull
+						}
+					},
+					"skinLayout": [{
+							"name": "bigPlayButton",
+							"align": "blabs",
+							"x": 30,
+							"y": 80
+						},
+						{
+							"name": "H5Loading",
+							"align": "cc"
+						},
+						{
+							"name": "controlBar",
+							"align": "blabs",
+							"x": 0,
+							"y": 0,
+							"children": [{
+									"name": "progress",
+									"align": "blabs",
+									"x": 0,
+									"y": 44
+								},
+								{
+									"name": "playButton",
+									"align": "tl",
+									"x": 15,
+									"y": 12
+								},
+								{
+									"name": "fullScreenButton",
+									"align": "tr",
+									"x": 10,
+									"y": 12
+								},
+								{
+									"name": "timeDisplay",
+									"align": "tr",
+									"x": 10,
+									"y": 5
+								}
+							]
+						}
+					],
+					"qualitySort": "asc",
+					"format": "mp4",
+					"mediaType": "video",
+					"encryptType": 1,
+					"progressMarkers": this.progressMarkers,
+					"autoplay": false,
+					"isLive": false,
+					"rePlay": false,
+					"playsinline": true,
+					"preload": false,
+					"controlBarVisibility": "hover",
+					"useH5Prism": true
+
+				}, function(player) {});
+				this.player = player;
+
+
+				player.on('canplay', function() {
+					player.tag.play();
+
+				});
+
+				player.on('ended', function(data) {
+					that.exitFullScreen();
+					that.$ownerInstance.callMethod('playEnd', {
+						data: 'end'
+					})
+				});
+			},
+			exitFullScreen() {
+				if (document.exitFullscreen) {
+					document.exitFullscreen(); // 标准方法
+				} else if (document.mozCancelFullScreen) { // Firefox
+					document.mozCancelFullScreen();
+				} else if (document.webkitExitFullscreen) { // Chrome, Safari & Opera
+					document.webkitExitFullscreen();
+				} else if (document.msExitFullscreen) { // IE/Edge
+					document.msExitFullscreen();
+				}
+			},
+
+			loadWebPlayerSDK() {
+				return new Promise((resolve, reject) => {
+					const s_tag = document.createElement('script'); // 引入播放器js
+					s_tag.type = 'text/javascript';
+					s_tag.src = 'https://g.alicdn.com/de/prismplayer/2.9.6/aliplayer-min.js';
+					s_tag.charset = 'utf-8';
+					s_tag.onload = () => {
+						//	console.log(this.playAuth);
+						this.playAli()
+						resolve();
+					}
+					document.body.appendChild(s_tag);
+					const l_tag = document.createElement('link'); // 引入播放器css
+					l_tag.rel = 'stylesheet';
+					l_tag.href =
+						'https://g.alicdn.com/de/prismplayer/2.9.6/skins/default/aliplayer-min.css';
+					document.body.appendChild(l_tag);
+				});
+			},
+		}
+	}
+</script>

+ 181 - 0
pages/jisuantexun/lookShipin.vue

@@ -0,0 +1,181 @@
+<template>
+	<view class="ezy-ksp-page">
+		<view class="icon-title-navBar-box">
+			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">{{jieInfo.jieIntro}}</text>
+		</view>
+		<view class="ezy-page-body ksp-page-body">
+			<!-- 核心基础题 -->
+			<videoPlayVue ref="c1" :key="1" :videoId1="videoId" :progressMarkers1="progressMarkers"
+				:playAuth1="playAuth" :hideFlag1="hideFlag" :seek-time1="seekTime" class="ksp-video-box"
+				@playEnd="playEnd"></videoPlayVue>
+			<view class="ksp-scroll-view">
+				<view class="ksp-item-list" v-for="(item,index) in jieInfo.jiedianList1" :key="index">
+					<view class="list-head">
+						<view class="list-title">{{item.name}}</view>
+<!--						<ezyActiveVue class="ezy-btn-active list-btn" @click="markersClick(item)"></ezyActiveVue>-->
+					</view>
+					<view class="list-body">
+						<rich-text :nodes="item.title"></rich-text>
+					</view>
+				</view>
+			</view>
+			<!-- 无数据 -->
+			<template v-if="!videoId">
+				<view class="ezy-no-sj">
+					<icon></icon>
+					<text>暂无数据</text>
+				</view>
+			</template>
+		</view>
+		<!-- 弹窗 -->
+		<tishiDlVue ref="popupRef"></tishiDlVue>
+	</view>
+
+</template>
+
+<script>
+	import {
+		ref
+	} from 'vue';
+	import {
+		onLoad,
+		onReady
+	} from '@dcloudio/uni-app';
+	import {
+		getVideoAuth,
+		getVideoAuthYk,
+		videoWancheng
+	} from "@/api/shipin.js"
+	import {
+		toast,
+		convertTimeToSeconds
+	} from "@/utils/common";
+	import cacheManager from "@/utils/cacheManager.js";
+	import * as httpApi from "@/api/chanpinJiSuanTeXun.js";
+	import tishiDlVue from './components/tishiDl.vue';
+	import videoPlayVue from './components/videoPlay.vue';
+	import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+	export default {
+		data() {
+			return {
+				danyuanId: null,
+				jieInfo: {
+					cover1: '',
+					cover2: '',
+					jieId: '',
+					jieIntro: '',
+					jieName: '',
+					jiedianList1: [],
+					jiedianList2: [],
+					type: '',
+					video1: '',
+					video2: '',
+				},
+
+				jieId: '',
+				shipinTitle: '',
+
+				pageData: null, //上个页面获取的视频参数(视频id)
+				playAuth: "", //播放凭证
+				progressMarkers: [],
+				hideFlag: 'show',
+				videoId: "", //阿里云视频id
+				seekTime: '',
+			}
+		},
+		components: {
+			tishiDlVue,
+			videoPlayVue,
+			ezyActiveVue
+		},
+		onLoad(options) {
+			this.init(options)
+		},
+		onHide() {
+			this.hideFlag = 'hide'
+		},
+		onUnload() {
+			this.hideFlag = 'hide'
+		},
+		methods: {
+			//  当前节学习完成
+			saveJieWancheng() {
+				httpApi.getJisuanChanpinWancheng({
+					jieId: this.jieInfo.jieId
+				}).then(res => {
+					if (res.data) {
+						// 更新单员状态
+						cacheManager.updateShuxueWanchengStatus(this.jieInfo.jieId)
+						// 学习完成提示弹窗
+						this.$refs.popupRef.open();
+					}
+				})
+			},
+			// 当前节学习开始
+			saveJinduStart() {
+				httpApi.getJisuanChanpinSave({
+					jieId: this.jieInfo.jieId
+				})
+			},
+			courseBjFun() {
+				return 'static/images/course/couse-shuxue-bj.png'
+			},
+			courseIconFun() {
+				return 'static/images/course/shuxue-icon.png'
+			},
+			getDataInfo() {
+				httpApi.getJisuanChanpinJieInfo({
+					jieId: this.jieId
+				}).then(res => {
+					// 时间节点转换
+					res.data.jiedianList1.forEach(item => item.offset = convertTimeToSeconds(item.time1))
+					// 重新赋值
+					Object.assign(this.jieInfo, res.data)
+					// 触发当前节学习进度
+					// this.saveJinduStart();
+					// 	针对视频进行赋值
+					this.videoId = this.jieInfo.video1;
+					// 针对节点赋值
+					this.progressMarkers = this.jieInfo.jiedianList1;
+					// 执行方法
+					this.getLive(); //获取播放凭证
+				})
+			},
+			init(options) {
+				this.jieId = options.jieId;
+				this.getDataInfo()
+			},
+			playEnd(data) {
+				// #ifdef APP-PLUS
+				plus.screen.lockOrientation('portrait-primary');
+				// #endif
+				this.saveJieWancheng();
+			},
+			getLive() {
+				if (!this.videoId) {
+					toast("video缺失!")
+					return false
+				}
+				let req = {
+					videoId: this.videoId
+				}
+
+				getVideoAuth(req).then(res => {
+					this.playAuth = res.data
+				})
+			},
+			markersClick(data) {
+				this.seekTime = ""
+				this.$nextTick(() => {
+					this.seekTime = data.offset
+				});
+			},
+			goUpPage() {
+				uni.switchTab({
+					url: "/pages/chanpinneirong/index"
+				})
+			},
+		},
+	}
+</script>