wangguoyu 6 mēneši atpakaļ
vecāks
revīzija
64aa93ebbb
2 mainītis faili ar 32 papildinājumiem un 7 dzēšanām
  1. 12 0
      api/shipin.js
  2. 20 7
      pages/study/lookShipin.vue

+ 12 - 0
api/shipin.js

@@ -24,3 +24,15 @@ export function getVideoAuthYk(data = {}) {
     timeout: 20000
   })
 }
+
+export function videoWancheng(data = {}) {
+  return request({
+    'url': '/app/user/wancheng',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 20 - 7
pages/study/lookShipin.vue

@@ -25,7 +25,7 @@
 		<uni-popup ref="popupRef" :animation="false" :is-mask-click="false"
 			mask-background-color="rgba(255, 255, 255, 0.6);">
 			<view class="course-score-dialog">
-				<view class="text-score">20</view>
+				<view class="text-score">{{credit}}</view>
 				<view class="course-btn-box">
 					<view @click="goBack" class="return-btn"></view>
 					<view @click="goNext" class="continue-btn"></view>
@@ -48,6 +48,7 @@
 	import {
 		getVideoAuth,
 		getVideoAuthYk,
+		videoWancheng
 	} from "@/api/shipin.js"
 	import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
 	import {
@@ -68,6 +69,7 @@
 				hideFlag: 'show',
 				videoId: "", //阿里云视频id
 				cardId: '',
+				credit: '',
 				nianji: '',
 				zhangId: '',
 				seekTime: '',
@@ -82,12 +84,7 @@
 		},
 		onLoad(options) {
 			if (!cacheManager.get('auth')) {
-				console.log(
-			JSON.parse(	options.youkePageData)	
-		
-				);
 			const youkeData = 	JSON.parse(	options.youkePageData)	
-				
 				// 游客
 				this.videoId = youkeData.jieList[0].videoId
 				this.nianji = youkeData.nianji
@@ -129,6 +126,7 @@
 				console.log(this.pageData);
 				this.videoId = this.pageData.videoId
 				this.jieName = this.pageData.jieName
+				this.credit = this.pageData.credit
 				this.progressMarkers = this.pageData.jiedianList
 				this.getLive(); //获取播放凭证
 			},
@@ -159,7 +157,22 @@
 				})
 			},
 			playEnd(data) {
-				this.$refs.popupRef.open();
+				const AuthCode = getUserIdentity();
+				console.log(AuthCode);
+				if(AuthCode =='Visitor'){
+					return  false
+				}else {
+					this.$refs.popupRef.open();
+					let req = {
+						credit:this.credit,
+						jieId:this.jieId,
+						
+					}
+					videoWancheng(req).then(res=>{
+						
+					})
+				}
+				
 			},
 			goBack() {
 				this.$refs.popupRef.close();