|
@@ -15,7 +15,7 @@
|
|
|
</div>
|
|
|
<div class="section__body">
|
|
|
<div class="container">
|
|
|
- <div class="course-info">
|
|
|
+ <div class="course-info">
|
|
|
<div class="course-info__header clearfix">
|
|
|
<div
|
|
|
class="left-box"
|
|
@@ -1825,6 +1825,7 @@
|
|
|
<div class="right-box">
|
|
|
<img v-show="!isTaking" :src="faceUrl" alt="" />
|
|
|
<video v-show="isTaking" id="video" :src="stream"></video>
|
|
|
+ <div class="mask"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="take-photo__footer">
|
|
@@ -2416,7 +2417,7 @@ import Footer from "@/components/footer/index";
|
|
|
import Header from "@/components/header/index";
|
|
|
import ToolBar from "@/components/toolbar/index";
|
|
|
import GoodsItem from "@/components/goodsItem/index";
|
|
|
-
|
|
|
+import * as imageConversion from "image-conversion";
|
|
|
import { mapGetters, mapMutations } from "vuex";
|
|
|
import * as baseUrls from "@/axios.js";
|
|
|
import pdf from "vue-pdf";
|
|
@@ -2860,7 +2861,7 @@ export default {
|
|
|
}, 1000);
|
|
|
}
|
|
|
} else {
|
|
|
- console.log('------')
|
|
|
+ console.log("------");
|
|
|
this.studyRecordQueryLiveLast();
|
|
|
}
|
|
|
// let noteSecond = this.$route.query.noteSecond;
|
|
@@ -2963,7 +2964,7 @@ export default {
|
|
|
this.playSectionId = res.data.sectionId;
|
|
|
this.vid = res.data.recordingUrl;
|
|
|
this.sectionItem = res.data;
|
|
|
- console.log('回放啊')
|
|
|
+ console.log("回放啊");
|
|
|
this.playVideo(res.data);
|
|
|
}
|
|
|
}
|
|
@@ -3012,7 +3013,7 @@ export default {
|
|
|
async takeOk() {
|
|
|
this.loading = true;
|
|
|
let compareFaceData = await this.faceRecognition();
|
|
|
- this.compareFaceData = compareFaceData
|
|
|
+ this.compareFaceData = compareFaceData;
|
|
|
if (compareFaceData >= 80) {
|
|
|
const waitYS = await this.imageInfos();
|
|
|
this.postCoursePhotoRecord()
|
|
@@ -3060,20 +3061,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- changePhotoListStamp(params, fileList) {
|
|
|
- const file = params.raw;
|
|
|
- const fileType = file.type;
|
|
|
- const isImage = fileType.indexOf("image") != -1;
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
- // 这里常规检验,看项目需求而定
|
|
|
- if (!isImage) {
|
|
|
- this.$message.error("只能上传图片格式png、jpg、gif!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error("只能上传图片大小小于2M");
|
|
|
- return;
|
|
|
- }
|
|
|
+ async changePhotoListStamp(params, fileList) {
|
|
|
+ let file = await this.uploadRules(params);
|
|
|
if (fileList.length == 1) {
|
|
|
fileList.splice(0, 1);
|
|
|
}
|
|
@@ -3101,22 +3090,28 @@ export default {
|
|
|
this.$emit("current", e);
|
|
|
this.curPageNum = e;
|
|
|
},
|
|
|
-
|
|
|
- changePhotoListHeader1(params, fileList) {
|
|
|
- console.log(params);
|
|
|
- const file = params.raw;
|
|
|
- const fileType = file.type;
|
|
|
- const isImage = fileType.indexOf("image") != -1;
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
- // 这里常规检验,看项目需求而定
|
|
|
- if (!isImage) {
|
|
|
- this.$message.error("只能上传图片格式png、jpg、gif!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error("只能上传图片大小小于2M");
|
|
|
- return;
|
|
|
- }
|
|
|
+ uploadRules(params) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ const file = params.raw;
|
|
|
+ const fileType = file.type;
|
|
|
+ const isImage = fileType.indexOf("image") != -1;
|
|
|
+ const sizeToM = file.size / 1024 / 1024;
|
|
|
+ if (!isImage) {
|
|
|
+ this.$message.error("只能上传图片格式png、jpg、gif!");
|
|
|
+ reject(false);
|
|
|
+ }
|
|
|
+ if (sizeToM > 2) {
|
|
|
+ imageConversion.compressAccurately(file, 1024 * 2).then((res) => {
|
|
|
+ res = new File([res], file.name, { type: res.type });
|
|
|
+ resolve(res);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ resolve(file);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async changePhotoListHeader1(params, fileList) {
|
|
|
+ let file = await this.uploadRules(params);
|
|
|
if (fileList.length == 1) {
|
|
|
fileList.splice(0, 1);
|
|
|
}
|
|
@@ -3140,19 +3135,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
async changePhotoListHeader2(params, fileList) {
|
|
|
- const file = params.raw;
|
|
|
- const fileType = file.type;
|
|
|
- const isImage = fileType.indexOf("image") != -1;
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
- // 这里常规检验,看项目需求而定
|
|
|
- if (!isImage) {
|
|
|
- this.$message.error("只能上传图片格式png、jpg、gif!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error("只能上传图片大小小于2M");
|
|
|
- return;
|
|
|
- }
|
|
|
+ let file = await this.uploadRules(params);
|
|
|
|
|
|
if (fileList.length == 1) {
|
|
|
fileList.splice(0, 1);
|
|
@@ -3195,19 +3178,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
async changePhotoListHeader3(params, fileList) {
|
|
|
- const file = params.raw;
|
|
|
- const fileType = file.type;
|
|
|
- const isImage = fileType.indexOf("image") != -1;
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
- // 这里常规检验,看项目需求而定
|
|
|
- if (!isImage) {
|
|
|
- this.$message.error("只能上传图片格式png、jpg、gif!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error("只能上传图片大小小于2M");
|
|
|
- return;
|
|
|
- }
|
|
|
+ let file = await this.uploadRules(params);
|
|
|
|
|
|
if (fileList.length == 1) {
|
|
|
fileList.splice(0, 1);
|
|
@@ -4139,7 +4110,7 @@ export default {
|
|
|
self.listData.forEach((item) => {
|
|
|
if (item.fieldKey == "idcard") {
|
|
|
this.infoForm.idcard = this.userInfo.idCard;
|
|
|
- this.disCard = this.infoForm.idcard ? true : false
|
|
|
+ this.disCard = this.infoForm.idcard ? true : false;
|
|
|
}
|
|
|
if (item.fieldKey == "telphone") {
|
|
|
this.infoForm.telphone = this.userInfo.telphone;
|
|
@@ -4147,7 +4118,7 @@ export default {
|
|
|
|
|
|
if (item.fieldKey == "name") {
|
|
|
this.infoForm.name = this.userInfo.realname || "";
|
|
|
- this.disName = this.infoForm.name ? true : false
|
|
|
+ this.disName = this.infoForm.name ? true : false;
|
|
|
}
|
|
|
});
|
|
|
self.isRequired = self.listData.every((ims) => {
|
|
@@ -4751,28 +4722,28 @@ export default {
|
|
|
// 新增用户视频学习日志
|
|
|
studyLog(moduleId, chapterId, sectionId) {
|
|
|
this.$axios({
|
|
|
- url: '/user/study/log',
|
|
|
- method: 'post',
|
|
|
+ url: "/user/study/log",
|
|
|
+ method: "post",
|
|
|
data: {
|
|
|
goodsId: this.goodsId,
|
|
|
courseId: this.courseId,
|
|
|
- moduleId: moduleId || 0,
|
|
|
- chapterId: chapterId || 0,
|
|
|
+ moduleId: moduleId || 0,
|
|
|
+ chapterId: chapterId || 0,
|
|
|
sectionId: sectionId || 0,
|
|
|
fromPlat: 2, //来源平台 1小程序 2PC网站
|
|
|
goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
- }
|
|
|
+ },
|
|
|
}).then((res) => {
|
|
|
- console.log('直播的用户学习日志:', res)
|
|
|
- })
|
|
|
+ console.log("直播的用户学习日志:", res);
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 点击节
|
|
|
*/
|
|
|
async getResource(section) {
|
|
|
- console.log('回放回放', section)
|
|
|
- this.clickSectionItem = section
|
|
|
+ console.log("回放回放", section);
|
|
|
+ this.clickSectionItem = section;
|
|
|
//逻辑
|
|
|
|
|
|
if (section.type == 2) {
|
|
@@ -4830,7 +4801,11 @@ export default {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
- this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
|
|
|
+ this.studyLog(
|
|
|
+ (section.moduleId = 0),
|
|
|
+ (section.chapterId = 0),
|
|
|
+ section.typeId
|
|
|
+ );
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
@@ -4910,7 +4885,11 @@ export default {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
- this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
|
|
|
+ this.studyLog(
|
|
|
+ (section.moduleId = 0),
|
|
|
+ (section.chapterId = 0),
|
|
|
+ section.typeId
|
|
|
+ );
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
@@ -4954,7 +4933,11 @@ export default {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
- this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
|
|
|
+ this.studyLog(
|
|
|
+ (section.moduleId = 0),
|
|
|
+ (section.chapterId = 0),
|
|
|
+ section.typeId
|
|
|
+ );
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -4965,14 +4948,15 @@ export default {
|
|
|
}
|
|
|
this.clickLock = true;
|
|
|
if (
|
|
|
- section.sectionType != 3 && this.playSectionId &&
|
|
|
+ section.sectionType != 3 &&
|
|
|
+ this.playSectionId &&
|
|
|
(this.playSectionId == section.sectionId ||
|
|
|
this.playSectionId == section.menuId) &&
|
|
|
this.moduleId == (section.moduleId || 0) &&
|
|
|
this.chapterId == (section.chapterId || 0)
|
|
|
) {
|
|
|
//切换为同一频道不作为
|
|
|
- console.log('---====', this.moduleId, this.chapterId)
|
|
|
+ console.log("---====", this.moduleId, this.chapterId);
|
|
|
this.clickLock = false;
|
|
|
return;
|
|
|
}
|
|
@@ -5068,7 +5052,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async initVideo(option) {
|
|
|
- console.log('initVideo', option)
|
|
|
+ console.log("initVideo", option);
|
|
|
if (option.sectionType == 1 || option.sectionType == 3) {
|
|
|
//录播
|
|
|
|
|
@@ -5206,9 +5190,10 @@ export default {
|
|
|
console.log(option, "<-----option", this.clickSectionItem);
|
|
|
|
|
|
if (option.sectionType == 3) {
|
|
|
- console.log('huifang')
|
|
|
+ console.log("huifang");
|
|
|
// 回放
|
|
|
- if (Object.keys(this.clickSectionItem).length) { //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
|
|
|
+ if (Object.keys(this.clickSectionItem).length) {
|
|
|
+ //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
|
|
|
this.$router.push({
|
|
|
path: "/living-room/" + option.liveUrl,
|
|
|
query: {
|
|
@@ -5222,10 +5207,10 @@ export default {
|
|
|
sectionType: 3,
|
|
|
goodsName: option.name,
|
|
|
vid: option.recordingUrl, // 回放vid
|
|
|
- }
|
|
|
- })
|
|
|
- this.clickSectionItem = {}
|
|
|
- return
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.clickSectionItem = {};
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
if (option.sectionType == 1) {
|
|
@@ -5268,7 +5253,7 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
this.clickLock = false;
|
|
|
}, 3000);
|
|
|
- this.studyLog(this.moduleId, this.chapterId, this.playSectionId)
|
|
|
+ this.studyLog(this.moduleId, this.chapterId, this.playSectionId);
|
|
|
// uni.$emit("levelId", this.levelId);
|
|
|
// uni.$emit("getSection", this.menuItem);
|
|
|
// uni.$emit("isRebuild", this.isRebuild);
|
|
@@ -5313,7 +5298,7 @@ export default {
|
|
|
moduleId: option.moduleId || 0,
|
|
|
sectionType: 2,
|
|
|
goodsName: option.name,
|
|
|
- },
|
|
|
+ },
|
|
|
});
|
|
|
// this.loadPlayerScriptzb(this.loadPlayerzb);
|
|
|
// setTimeout(() => {
|
|
@@ -5823,7 +5808,7 @@ export default {
|
|
|
console.log(this);
|
|
|
console.log(PlayDuration, "PlayDuration");
|
|
|
let data = {
|
|
|
- fromPlat: 2, //来源平台 1小程序 2网站
|
|
|
+ fromPlat: 2, //来源平台 1小程序 2网站
|
|
|
photo: self.ossAvatarUrl,
|
|
|
sectionId: parseInt(this.playSectionId),
|
|
|
goodsId: parseInt(this.goodsId),
|
|
@@ -5836,7 +5821,7 @@ export default {
|
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
};
|
|
|
if (this.ossAvatarUrl) {
|
|
|
- data.similarity = this.compareFaceData // 相似度
|
|
|
+ data.similarity = this.compareFaceData; // 相似度
|
|
|
}
|
|
|
if (status > 0) {
|
|
|
data.status = status;
|
|
@@ -7475,6 +7460,18 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+
|
|
|
+ .mask {
|
|
|
+ width: 55%;
|
|
|
+ height: 200px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ margin: 30px auto 0;
|
|
|
+ box-shadow: 0 0 0 2000px rgba(0,0,0,0.4);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|