|
|
@@ -18,7 +18,9 @@
|
|
|
</view>
|
|
|
<view>
|
|
|
<u-row>
|
|
|
- <u-col span="8" offset="1"><view class="video_t1">2020年二级建造师教育选修</view></u-col>
|
|
|
+ <u-col span="8" offset="1">
|
|
|
+ <view class="video_t1">{{ pageData.courseName }}</view>
|
|
|
+ </u-col>
|
|
|
<u-col span="3"><view class="video_t1">共60课时</view></u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
@@ -37,16 +39,28 @@
|
|
|
</view>
|
|
|
</u-col>
|
|
|
<u-col span="3" text-align="right">
|
|
|
- <view class="video_t2">
|
|
|
+ <view class="video_t2" @click="activeStatus = !activeStatus">
|
|
|
共60节课
|
|
|
- <u-icon name="arrow-right" size="28"></u-icon>
|
|
|
+ <u-icon name="arrow-right" size="28" style="transition: all 0.2s;margin-left:10rpx" :class="activeStatus ? 'rotoct' : ''"></u-icon>
|
|
|
</view>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
- <view class="scroll_box">
|
|
|
+ <!-- <view class="scroll_box">
|
|
|
<scroll-view class="r_sliper" scroll-x="true">
|
|
|
- <view v-for="(item, index) in list" :key="index" style="margin-right: 20rpx;display:inline-block"><view class="r_t2">二级建造师市政..</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>
|
|
|
+ </view> -->
|
|
|
+ <view class="catalogBox" :class="activeStatus ? 'changeCatalogBox' : ''">
|
|
|
+ <view
|
|
|
+ class="catalogA"
|
|
|
+ v-for="(item, index) in chapterList"
|
|
|
+ :key="index"
|
|
|
+ :class="activeStatusCata === index ? 'activesq' : ''"
|
|
|
+ @click="activeList(item, index)"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ <span style="color: #1677FF;">试看</span>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
@@ -63,7 +77,7 @@
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
- <view class="t2">这是一段课程介绍文本,课程介绍内容可在后台设置编辑,以富 文本形式呈现,常见的由图片和文本组成。</view>
|
|
|
+ <view class="t2" v-html="pageData.introduction"></view>
|
|
|
<u-line color="#D6D6DB" />
|
|
|
</view>
|
|
|
<!-- 出题名师-->
|
|
|
@@ -79,9 +93,10 @@
|
|
|
</u-row>
|
|
|
<u-row>
|
|
|
<view style="margin: 25rpx;display: flex;">
|
|
|
- <view><image src="/static/avatar1.png" class="teacher_img"></image></view>
|
|
|
+ <view><image :src="$method.splitImgHost(teacherInfo.avatar)" class="teacher_img"></image></view>
|
|
|
<view class="teacher_t">
|
|
|
- 建工学院名誉院长,建造师建筑资深导师,北京工业大学教授,建造师考试大纲编委会编委。参与过国家一级注册建造师考试大纲、考试辅导书、习题集等书的编写。
|
|
|
+ <view>{{ teacherInfo.teacherName }}</view>
|
|
|
+ <view>{{ teacherInfo.introduce }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-row>
|
|
|
@@ -128,7 +143,7 @@
|
|
|
<view class="sc_t">收藏</view>
|
|
|
</view>
|
|
|
<view style="text-align: center;margin-left: 30rpx;">
|
|
|
- <view class="price_t1">¥699</view>
|
|
|
+ <view class="price_t1">¥{{ pageData.price }}</view>
|
|
|
<view class="price_t2">¥699</view>
|
|
|
</view>
|
|
|
<view class="buy" @click="jumpBuy">立即购买</view>
|
|
|
@@ -155,6 +170,8 @@ export default {
|
|
|
name: '相关推荐'
|
|
|
}
|
|
|
],
|
|
|
+ activeStatus: false, //课程目录下拉样式变化是否开启
|
|
|
+ activeStatusCata: 0, //当前选中章节
|
|
|
current: 0,
|
|
|
h1: 0,
|
|
|
h2: 0,
|
|
|
@@ -174,10 +191,14 @@ export default {
|
|
|
ts: '',
|
|
|
startStatus: false,
|
|
|
queryData: {},
|
|
|
- pageData: {}
|
|
|
+ pageData: {},
|
|
|
+ chapterList: [],
|
|
|
+ teacherInfo: {}
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ const Verify = require('@/wxcomponents/verify_mpsdk/main.js');
|
|
|
+ Verify.init();
|
|
|
this.queryData = options;
|
|
|
this.getCourseInfo();
|
|
|
},
|
|
|
@@ -247,15 +268,87 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ activeList(item, index) {
|
|
|
+ this.activeStatusCata = index;
|
|
|
+ this.$navTo.togo('/pages2/course/detail', item);
|
|
|
+ },
|
|
|
+ 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(() => {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getCourseInfo() {
|
|
|
- var self = this
|
|
|
+ var self = this;
|
|
|
this.$api.courseInfo(this.queryData.courseId).then(res => {
|
|
|
console.log(res.data.data);
|
|
|
if (res.data.code === 200) {
|
|
|
self.pageData = res.data.data;
|
|
|
+ self.getChapter(res.data.data.courseId);
|
|
|
+ self.getTeacher(res.data.data.teacherIds);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ getChapter(v) {
|
|
|
+ var self = this;
|
|
|
+ var data = {
|
|
|
+ courseId: v
|
|
|
+ };
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getTeacher(v) {
|
|
|
+ var data = {
|
|
|
+ teacherIds: v
|
|
|
+ };
|
|
|
+ this.$api.teacherList(data).then(res => {
|
|
|
+ this.teacherInfo = res.data.rows[0];
|
|
|
+ });
|
|
|
+ },
|
|
|
startVideo() {
|
|
|
uni.getStorageSync('union_id');
|
|
|
if (!uni.getStorageSync('union_id')) {
|
|
|
@@ -263,17 +356,18 @@ export default {
|
|
|
url: '/pages/login/login'
|
|
|
});
|
|
|
} else {
|
|
|
- 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('报错');
|
|
|
- });
|
|
|
+ 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('报错');
|
|
|
+ // });
|
|
|
}
|
|
|
},
|
|
|
touchMove(e) {
|
|
|
@@ -341,6 +435,46 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style scope>
|
|
|
+.catalogBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ overflow-x: auto;
|
|
|
+ padding-left: 38rpx;
|
|
|
+ max-height: 305rpx;
|
|
|
+ overflow-y: auto;
|
|
|
+ transition: all 0.4s;
|
|
|
+}
|
|
|
+.catalogBox > .catalogA {
|
|
|
+ min-width: 200rpx;
|
|
|
+ height: 48rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ // text-align: center;
|
|
|
+ border: 2rpx solid transparent;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ word-break: break-all;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ background: rgba(22, 119, 255, 0.05);
|
|
|
+ padding-left: 19rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding-right: 15rpx;
|
|
|
+ margin-right: 16rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ margin-top: 15rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #666;
|
|
|
+}
|
|
|
+.catalogBox > .activesq {
|
|
|
+ border-color: #1677ff;
|
|
|
+}
|
|
|
+.changeCatalogBox {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.catalogBox::-webkit-scrollbar {
|
|
|
+ display: none; /* Chrome Safari */
|
|
|
+}
|
|
|
.box {
|
|
|
position: relative;
|
|
|
top: 600rpx;
|
|
|
@@ -471,7 +605,9 @@ export default {
|
|
|
.video_box {
|
|
|
position: relative;
|
|
|
}
|
|
|
-
|
|
|
+.rotoct {
|
|
|
+ transform: rotate(90deg);
|
|
|
+}
|
|
|
page {
|
|
|
background: #ffffff;
|
|
|
}
|