|
@@ -19,7 +19,7 @@
|
|
|
<view>
|
|
<view>
|
|
|
<u-row>
|
|
<u-row>
|
|
|
<u-col span="8" offset="1">
|
|
<u-col span="8" offset="1">
|
|
|
- <view class="video_t1">{{ pageData.courseName }}</view>
|
|
|
|
|
|
|
+ <view class="video_t1">{{ infoData.name || pageData.courseName }}</view>
|
|
|
</u-col>
|
|
</u-col>
|
|
|
<u-col span="3"><view class="video_t1">共60课时</view></u-col>
|
|
<u-col span="3"><view class="video_t1">共60课时</view></u-col>
|
|
|
</u-row>
|
|
</u-row>
|
|
@@ -50,16 +50,16 @@
|
|
|
<view v-for="(item, index) in chapterList" :key="index" style="margin-right: 20rpx;display:inline-block"><view class="r_t2">{{item.name}}</view></view>
|
|
<view v-for="(item, index) in chapterList" :key="index" style="margin-right: 20rpx;display:inline-block"><view class="r_t2">{{item.name}}</view></view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view> -->
|
|
</view> -->
|
|
|
|
|
+
|
|
|
<view class="catalogBox" :class="activeStatus ? 'changeCatalogBox' : ''">
|
|
<view class="catalogBox" :class="activeStatus ? 'changeCatalogBox' : ''">
|
|
|
<view
|
|
<view
|
|
|
class="catalogA"
|
|
class="catalogA"
|
|
|
v-for="(item, index) in chapterList"
|
|
v-for="(item, index) in chapterList"
|
|
|
:key="index"
|
|
:key="index"
|
|
|
- :class="activeStatusCata === index ? 'activesq' : ''"
|
|
|
|
|
|
|
+ :class="activeStatusCata === item.chapterId ? 'activesq' : ''"
|
|
|
@click="activeList(item, index)"
|
|
@click="activeList(item, index)"
|
|
|
>
|
|
>
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
- <span style="color: #1677FF;">试看</span>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -149,6 +149,26 @@
|
|
|
<view class="buy" @click="jumpBuy">立即购买</view>
|
|
<view class="buy" @click="jumpBuy">立即购买</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <u-popup v-model="showBox" mode="bottom" border-radius="14">
|
|
|
|
|
+ <view class="content">
|
|
|
|
|
+ <scroll-view scroll-y="true" style="height: 300rpx;">
|
|
|
|
|
+ <view v-if="boxList.length > 0">
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="(item, index) in boxList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ style="height: 60rpx;line-height: 60rpx;border-bottom: 1rpx solid #eee;display: flex;align-items: center;justify-content: space-between;"
|
|
|
|
|
+ :style="infoData.sectionId === item.sectionId ? 'color:#1677ff;' : ''"
|
|
|
|
|
+ @click="getsec(item)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view>{{ item.name }}</view>
|
|
|
|
|
+ <u-icon v-if="infoData.sectionId === item.sectionId" name="checkbox-mark"></u-icon>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else>暂无内容</view>
|
|
|
|
|
+ </scroll-view>
|
|
|
|
|
+ <view class="confrim-btn" style="margin-top: 10rpx;"><u-button @click="showBox = false">取消</u-button></view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -186,14 +206,20 @@ export default {
|
|
|
windowHeight: 0,
|
|
windowHeight: 0,
|
|
|
modules4Bottom: 0,
|
|
modules4Bottom: 0,
|
|
|
isClick: false,
|
|
isClick: false,
|
|
|
- vid: 'd5f6d309fe0b016d3844b194a8b32249_d', // 视频ID
|
|
|
|
|
|
|
+ // vid: 'd5f6d309fe0b016d3844b194a8b32249_d', // 视频ID
|
|
|
|
|
+ vid: '', // 视频ID
|
|
|
sign: '',
|
|
sign: '',
|
|
|
ts: '',
|
|
ts: '',
|
|
|
startStatus: false,
|
|
startStatus: false,
|
|
|
- queryData: {},
|
|
|
|
|
|
|
+ queryData: {}, //页面跳转内容
|
|
|
pageData: {},
|
|
pageData: {},
|
|
|
|
|
+ infoData: {},
|
|
|
chapterList: [],
|
|
chapterList: [],
|
|
|
- teacherInfo: {}
|
|
|
|
|
|
|
+ teacherInfo: {},
|
|
|
|
|
+ faceGetState: true, //模拟今天是否人脸识别
|
|
|
|
|
+ showBox: false,
|
|
|
|
|
+ boxList: [],
|
|
|
|
|
+ payStatus: true //是否购买该课程
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -201,6 +227,7 @@ export default {
|
|
|
Verify.init();
|
|
Verify.init();
|
|
|
this.queryData = options;
|
|
this.queryData = options;
|
|
|
this.getCourseInfo();
|
|
this.getCourseInfo();
|
|
|
|
|
+ this.getChapter(options.courseId);
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
let that = this;
|
|
let that = this;
|
|
@@ -269,58 +296,33 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
activeList(item, index) {
|
|
activeList(item, index) {
|
|
|
- this.activeStatusCata = index;
|
|
|
|
|
- this.$navTo.togo('/pages2/course/detail', item);
|
|
|
|
|
- },
|
|
|
|
|
- async certification() {
|
|
|
|
|
var self = this;
|
|
var self = this;
|
|
|
- const faceBiz = await self.$api.facecertificationPicBizToken();
|
|
|
|
|
- self.BizToken = faceBiz.data.data.bizToken;
|
|
|
|
|
- wx.startVerify({
|
|
|
|
|
- data: {
|
|
|
|
|
- token: self.BizToken
|
|
|
|
|
- },
|
|
|
|
|
- success: result => {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- console.log(999,result)
|
|
|
|
|
- self.$api.facecertificationPicDetectInfo(self.BizToken).then(faceRec => {
|
|
|
|
|
- if(faceRec.data.data === 0){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '识别成功',
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- }else{
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '识别失败',
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
- })
|
|
|
|
|
- console.log('识别失败')
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }, 500);
|
|
|
|
|
- },
|
|
|
|
|
- fail: err => {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- console.log('识别功能失败')
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: err,
|
|
|
|
|
- showCancel: false
|
|
|
|
|
- });
|
|
|
|
|
- }, 500);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ var dataset = {
|
|
|
|
|
+ chapterId: item.chapterId
|
|
|
|
|
+ };
|
|
|
|
|
+ this.$api.coursesectionlist(dataset).then(result => {
|
|
|
|
|
+ result.data.rows.forEach((items, indexs) => {
|
|
|
|
|
+ items.value = items.sectionId;
|
|
|
|
|
+ items.label = items.name;
|
|
|
|
|
+ });
|
|
|
|
|
+ self.boxList = result.data.rows;
|
|
|
});
|
|
});
|
|
|
|
|
+ this.showBox = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ getsec(item) {
|
|
|
|
|
+ this.startStatus = false;
|
|
|
|
|
+ this.infoData = item;
|
|
|
|
|
+ this.vid = this.infoData.vid;
|
|
|
|
|
+ this.activeStatusCata = item.chapterId;
|
|
|
|
|
+ this.showBox = false;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
getCourseInfo() {
|
|
getCourseInfo() {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
this.$api.courseInfo(this.queryData.courseId).then(res => {
|
|
this.$api.courseInfo(this.queryData.courseId).then(res => {
|
|
|
console.log(res.data.data);
|
|
console.log(res.data.data);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
self.pageData = res.data.data;
|
|
self.pageData = res.data.data;
|
|
|
- self.getChapter(res.data.data.courseId);
|
|
|
|
|
self.getTeacher(res.data.data.teacherIds);
|
|
self.getTeacher(res.data.data.teacherIds);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -331,15 +333,14 @@ export default {
|
|
|
courseId: v
|
|
courseId: v
|
|
|
};
|
|
};
|
|
|
this.$api.coursechapterlist(data).then(res => {
|
|
this.$api.coursechapterlist(data).then(res => {
|
|
|
- this.chapterList = res.data.rows;
|
|
|
|
|
- res.data.rows.forEach((item, index) => {
|
|
|
|
|
- var dataset = {
|
|
|
|
|
- chapterId: item.chapterId
|
|
|
|
|
- };
|
|
|
|
|
- self.$api.coursesectionlist(dataset).then(result => {
|
|
|
|
|
- console.log(result);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ var chaList = res.data.rows;
|
|
|
|
|
+ var dataset = {
|
|
|
|
|
+ chapterId: res.data.rows[0].chapterId
|
|
|
|
|
+ };
|
|
|
|
|
+ self.$api.coursesectionlist(dataset).then(result => {
|
|
|
|
|
+ self.getsec(result.data.rows[0])
|
|
|
});
|
|
});
|
|
|
|
|
+ this.chapterList = chaList;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getTeacher(v) {
|
|
getTeacher(v) {
|
|
@@ -351,26 +352,82 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
startVideo() {
|
|
startVideo() {
|
|
|
- uni.getStorageSync('union_id');
|
|
|
|
|
- if (!uni.getStorageSync('union_id')) {
|
|
|
|
|
|
|
+ if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/login/login'
|
|
url: '/pages/login/login'
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- this.certification();
|
|
|
|
|
- // this.$api
|
|
|
|
|
- // .polyvVideoSign(this.vid)
|
|
|
|
|
- // .then(res => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- // this.startStatus = true;
|
|
|
|
|
- // // this.sign = res.data.data.sign;
|
|
|
|
|
- // // this.ts = res.data.data.ts;
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch(err => {
|
|
|
|
|
- // console.log('报错');
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ //模拟今天是否人脸识别
|
|
|
|
|
+ if (!this.faceGetState) {
|
|
|
|
|
+ this.certification();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.payStatus) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '暂未购买该课程',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.vid === null) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '视频加载失败',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .polyvVideoSign(this.vid)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.startStatus = true;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.log('报错');
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async certification() {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ const faceBiz = await self.$api.facecertificationPicBizToken();
|
|
|
|
|
+ self.BizToken = faceBiz.data.data.bizToken;
|
|
|
|
|
+ wx.startVerify({
|
|
|
|
|
+ data: {
|
|
|
|
|
+ token: self.BizToken
|
|
|
|
|
+ },
|
|
|
|
|
+ success: result => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ self.$api.facecertificationPicDetectInfo(self.BizToken).then(faceRec => {
|
|
|
|
|
+ if (faceRec.data.data === 0) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '识别成功',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '识别失败',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('识别失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: err => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ console.log('识别功能失败');
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: err,
|
|
|
|
|
+ showCancel: false
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
touchMove(e) {
|
|
touchMove(e) {
|
|
|
this.isClick = false;
|
|
this.isClick = false;
|
|
|
},
|
|
},
|
|
@@ -415,7 +472,6 @@ export default {
|
|
|
key: 'union_id',
|
|
key: 'union_id',
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
|
// 继续操作
|
|
// 继续操作
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
fail: function(err) {
|
|
fail: function(err) {
|
|
|
//重新登入
|
|
//重新登入
|
|
@@ -434,6 +490,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style scope>
|
|
<style scope>
|
|
|
|
|
+.content {
|
|
|
|
|
+ padding: 24rpx;
|
|
|
|
|
+ text-align: left;
|
|
|
|
|
+}
|
|
|
.catalogBox {
|
|
.catalogBox {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|