Commit 15e79249 authored by IvyXia123's avatar IvyXia123

星星测试提交

parent 8aae6476
...@@ -4416,6 +4416,16 @@ ...@@ -4416,6 +4416,16 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
}, },
"fundebug-javascript": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/fundebug-javascript/-/fundebug-javascript-1.9.0.tgz",
"integrity": "sha512-i+a9IIGyhIOPEBLbaH6plnMrPTukZ0YN7fXFZRQ6O+CwyQxNqQYye1PEax1LZeD3OJLp5UNRjtAlNSwb5grN3Q=="
},
"fundebug-vue": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/fundebug-vue/-/fundebug-vue-0.0.1.tgz",
"integrity": "sha512-dk6D5FASmvhUwepc5SL6221B9NHw6hZ7ZLU/nWuyRcrBrrOWbxiH30CrEYwr6VK76UlUb6mpJ+Mzr2r7sfqk8w=="
},
"get-caller-file": { "get-caller-file": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
......
<template>
<div class="growthRecord" @scroll="scrollEvent">
<div class="year-header" id="yearHeader" ref="yearHeader">{{ dataTimer }}</div>
<div class="growthRecord-content" v-for="(item, index) in scoringCategoryData" :key="index">
<!-- 年 -->
<div class="growthRecord-content-year">{{ item.year }}</div>
<div class="growthRecord-content-children" :data-timer="itemChild.cur_date" v-for="itemChild in item.monthArr">
<!-- 月,日 -->
<div class="growthRecord-content-left">
<span class="day">{{ itemChild.month.split('-')[1] }}</span><span class="mouth">{{ itemChild.month.split('-')[0] }}</span>
</div>
<!-- 月日对应的content -->
<div class="growthRecord-content-right">
<div class="growthRecord-content-right-sleeping">{{ itemChild.element_title }}</div>
<div class="growthRecord-content-right-title">
<span class="title">{{ itemChild.category_name.split(' ')[0] + ' ' +itemChild.category_name.split(' ')[1] }}</span>
<img class="scoring-category-active" :src="scoringCategoryImage.scoringCategory1Active" alt="">
<span class="num">{{ itemChild.interest }}</span>
<img class="scoring-category-active" :src="scoringCategoryImage.scoringCategory2Active" alt="">
<span class="num">{{ itemChild.concent }}</span>
<img class="scoring-category-active" :src="scoringCategoryImage.scoringCategory3Active" alt="">
<span class="num">{{ itemChild.parent_child }}</span>
</div>
<div class="rowthRecord-content-sub">
<span class="text">{{ itemChild.growth_record }}</span>
<!-- <span class=""><img class="xiajiantou" :src="scoringCategoryImage.xiajiantou" alt=""></span>-->
</div>
<div class="timer">{{ itemChild.created_at.split(' ')[1] }}</div>
</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import { getUserGrowthListApi } from "../service/api";
import { scoringCategory } from "../util/imgUrl";
export default {
name: 'growthRecord',
data() {
return {
dataTimer: '', // 获取滚动时间
scoringCategoryData: [], // 获取数据
scoringCategoryImage: scoringCategory // 获取图片
}
},
methods: {
async userGrowthRecordList() {
const userGrowthRecordData = await getUserGrowthListApi();
console.log(userGrowthRecordData)
userGrowthRecordData.map(item => {
// 重新转化数据
item.monthArr = [];
Object.values(item.month).map(itemchild => item.monthArr.push(itemchild[0]))
})
this.scoringCategoryData = userGrowthRecordData;
// 初始化滚动值
this.dataTimer = userGrowthRecordData[0].monthArr[0].cur_date;
},
/**
* 滚动监听
* @param e
*/
scrollEvent(e) {
let scroll = document.documentElement.scrollTop || document.body.scrollTop,
growthRecordContentChildren = document.querySelectorAll('.growthRecord-content-children');
for(let i = 0; i < growthRecordContentChildren.length; i++) {
let top = growthRecordContentChildren[i].offsetTop, // 获取 dom 离顶端的高度
height = growthRecordContentChildren[i].offsetHeight, // 获取 dom 高度
dataTimer = growthRecordContentChildren[i].getAttribute('data-timer'); // 获取 dom 里的时间
if(scroll >= top && scroll <= top + height)
this.dataTimer = dataTimer;
}
}
},
mounted() {
window.addEventListener('scroll', this.scrollEvent, false)
this.userGrowthRecordList()
}
}
</script>
<style lang="less" type="text/less">
@import "../util/public";
.growthRecord {
width: 100%;
padding: 20 * @toVw;
box-sizing: border-box;
.year-header {
width: 100%;
height: 30 * @toVw;
padding-left: 20 * @toVw;
position: fixed;
line-height: 30 * @toVw;
background: #F8F8F8;
top: 0;
left: 0;
z-index: 10;
font-size: 14 * @toVw;
}
.growthRecord-content {
width: 100%;
/* 年 */
.growthRecord-content-year {
padding: 16 * @toVw 0;
font-size: 24 * @toVw;
font-weight: 500;
color: #333333;
}
/* 月,日 */
.growthRecord-content-children {
width: 100%;
overflow: hidden;
padding-bottom: 15 * @toVw;
.growthRecord-content-left {
width: 60 * @toVw;
float: left;
.day {
font-size: 22 * @toVw;
font-weight: 500;
color: #333;
}
.mouth {
padding-left: 2px;
font-size: 14 * @toVw;
color: #333;
}
}
/* 月日对应的content */
.growthRecord-content-right {
width: calc(100% - 16vw);
padding: 12 * @toVw;
float: left;
background: #e2f3fe;
border-radius: 5 * @toVw;
box-sizing: border-box;
.growthRecord-content-right-sleeping {
padding-bottom: 11 * @toVw;
font-size: 14 * @toVw;
font-weight: 500;
color: #333;
}
.growthRecord-content-right-title {
.title {
padding-right: 12 * @toVw;
vertical-align: middle;
font-size: 13 * @toVw;
font-weight: 500;
color: #333;
}
.scoring-category-active {
width: 20 * @toVw;
height: 20 * @toVw;
padding-left: 13 * @toVw;
vertical-align: middle;
}
.num {
vertical-align: middle;
font-size: 13 * @toVw;
color: #666666;
}
}
.rowthRecord-content-sub {
position: relative;
padding-top: 10 * @toVw;
line-height: 21 * @toVw;
font-size: 14 * @toVw;
color: #666666;
.text {
word-wrap: break-word;
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
/*text-align-last:justify;*/
/*text-align:justify;*/
/*text-justify:distribute-all-lines;*/
}
.xiajiantou {
width: 17 * @toVw;
height: 10 * @toVw;
position: absolute;
bottom: 0;
right: 0;
}
}
.timer {
padding-top: 10 * @toVw;
color: #666666;
font-size: 12 * @toVw;
}
}
}
}
}
</style>
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
<van-cell title="我的订单" ref="order" to="/order" @click="toOrder" is-link> <van-cell title="我的订单" ref="order" to="/order" @click="toOrder" is-link>
<img slot="icon" :src="image.order" /> <img slot="icon" :src="image.order" />
</van-cell> </van-cell>
<van-cell title="成长记录" ref="star" to="/growthRecord" @click="toStar" is-link>
<img slot="icon" :src="image.yizi" />
</van-cell>
<van-cell v-if="acitivityType==1" title="我的星星" ref="star" to="/starRank" @click="toStar" is-link> <van-cell v-if="acitivityType==1" title="我的星星" ref="star" to="/starRank" @click="toStar" is-link>
<img slot="icon" :src="image.mine_icon_star" /> <img slot="icon" :src="image.mine_icon_star" />
<!-- <div class="starNum" v-if="starNum">{{starNum}}</div> --> <!-- <div class="starNum" v-if="starNum">{{starNum}}</div> -->
......
...@@ -159,672 +159,403 @@ ...@@ -159,672 +159,403 @@
</template> </template>
<script> <script>
import { Toast } from "vant"; import { Toast } from "vant";
import { Popup } from "mint-ui"; import { Popup } from "mint-ui";
import tapToVideo from "../../assets/tapToVideo.png"; import tapToVideo from "../../assets/tapToVideo.png";
import { ImagePreview } from "vant"; import { ImagePreview } from "vant";
import { import {
getUserCollectApi, getUserCollectApi,
addUserCollectApi, addUserCollectApi,
delUserCollectApi, delUserCollectApi,
subUserLessonApi, subUserLessonApi,
getUserWatchApi getUserWatchApi
} from "../../service/api"; } from "../../service/api";
import finishStuat from "../../assets/newLesson/finishStudy.png"; import finishStuat from "../../assets/newLesson/finishStudy1.png";
import noFinishDia from "./nofinishdia"; import noFinishDia from "./nofinishdia";
import sharePage from "./share"; import sharePage from "./share";
import starBlock from "./star"; import starBlock from "./star";
import audioGood from "../../assets/good.mp3"; import audioGood from "../../assets/good.mp3";
import audioGreat from "../../assets/great.mp3"; import audioGreat from "../../assets/great.mp3";
import audioPerfect from "../../assets/perfect.mp3"; import audioPerfect from "../../assets/perfect.mp3";
export default { export default {
name: "fun", name: "fun",
props: ["contentData"], props: ["contentData"],
components: { components: {
noFinishDia, noFinishDia,
starBlock, starBlock,
sharePage, sharePage,
[Popup.name]: Popup [Popup.name]: Popup
},
data() {
return {
imgModel: false,
userCourse: {},
finishStuat: finishStuat,
popupVisible: false,
collectPop: false,
index: 0,
star: false,
popupVisible2: false,
hasCollect: false,
ageShow: false,
imgPop: false,
startTime: "00:00",
overTime: "00:00",
range: 0,
showObj: {
audio: null,
change: false
},
share_show: false,
tapToVideo: tapToVideo,
playFlag: false,
offset: 0,
timer: null,
playType: Number(localStorage.getItem("playType")) | 0,
audioPoint: "",
stay_time: ""
};
},
mounted() {
this.changeAge(this.contentData.age);
this.userCourse = JSON.parse(localStorage.getItem("userCourse"));
if (this.userCourse.periods_list) {
this.checkCollect();
}
},
methods: {
ImagePreviewF(index) {
ImagePreview({
images: [this.showObj.audio[index].image],
lazyLoad: true,
startPosition: 0,
showIndex: false
});
},
changeStar(data) {
this.star = data;
},
backList() {
this.$emit("backList");
},
closeShare() {
this.share_show = false;
},
sendConsole(data) {
this.$sa.track("watchClick", {
buttonName: data,
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
},
// 改变收藏状态
changeCollect() {
if (this.hasCollect) {
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "取消收藏",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
delUserCollectApi(this.hasCollect).then(res => {
this.hasCollect = false;
Toast("取消收藏");
this.checkCollect();
});
} else {
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "添加收藏",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let json = {
category_id: lessonDetail.id,
type: 1,
title: this.showObj.audio[this.index].title,
sub_title: "来自于 " + lessonDetail.title,
url: this.showObj.audio[this.index].url,
cover: this.showObj.audio[this.index].image
};
addUserCollectApi(json)
.then(res => {
Toast("收藏成功,快去主页收藏夹看一看吧");
this.checkCollect();
})
.catch(this.checkCollect());
}
}, },
// 获取收藏状态 data() {
checkCollect() { return {
let json = { imgModel: false,
url: this.showObj.audio[this.index].url userCourse: {},
finishStuat: finishStuat,
popupVisible: false,
collectPop: false,
index: 0,
star: false,
popupVisible2: false,
hasCollect: false,
ageShow: false,
imgPop: false,
startTime: "00:00",
overTime: "00:00",
range: 0,
showObj: {
audio: null,
change: false
},
share_show: false,
tapToVideo: tapToVideo,
playFlag: false,
offset: 0,
timer: null,
playType: Number(localStorage.getItem("playType")) | 0,
audioPoint: "",
stay_time: ""
}; };
// debugger
getUserCollectApi(json).then(res => {
this.hasCollect = res.list.length < 1 ? false : res.list[0].id;
});
}, },
// 播放音频 mounted() {
onPlay(flag) { if(this.$route.params.evaluate === 1)
if (flag) { this.finishStudy()
// 神策埋点 点击操作 this.changeAge(this.contentData.age);
this.$sa.track("watchClick", { this.userCourse = JSON.parse(localStorage.getItem("userCourse"));
dayModule: JSON.parse( if (this.userCourse.periods_list) {
localStorage.getItem("lessonDetail") this.checkCollect();
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "播放音频",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
} }
setTimeout(()=>{
this.$refs.audio.play();
},100)
// this.$refs.audio.play();
// this.$nextTick(()=>{
// // console.log(this.$refs.audio)
// this.$refs.audio.play();
// })
}, },
// 播放暂停 methods: {
onStop(flag) { ImagePreviewF(index) {
if (flag) { ImagePreview({
// 神策埋点 点击操作 images: [this.showObj.audio[index].image],
lazyLoad: true,
startPosition: 0,
showIndex: false
});
},
changeStar(data) {
this.star = data;
},
backList() {
this.$emit("backList");
},
closeShare() {
this.share_show = false;
},
sendConsole(data) {
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
buttonName: data,
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "暂停播放",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
}
this.$refs.audio.pause();
this.playFlag = false;
// console.log(this.$refs.imgItem)
var iTransform = getComputedStyle(this.$refs.imgItem).transform;
var cTransform = getComputedStyle(this.$refs.imageBlock).transform;
this.$refs.imageBlock.style.transform =
cTransform === "none" ? iTransform : iTransform.concat(" ", cTransform);
this.$refs.imgItem.classList.remove("swin");
},
lastOne() {
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "上一首",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
if (this.index > 0) {
this.index--;
this.keepPlay();
} else if (this.playType === 0 && this.showObj.audio.length > 1) {
this.index = this.showObj.audio.length - 1;
this.keepPlay();
} else {
Toast("已经是第一首");
}
},
changeIndex(i) {
this.index = i;
this.popupVisible = false;
this.keepPlay();
},
keepPlay() {
if (this.playFlag) {
this.$nextTick(() => {
this.onPlay();
});
} else {
this.$nextTick(() => {
this.onStop();
});
}
},
nextOne(flag) {
if (flag) {
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName: elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0, 0,
9 9
) + ) +
"-" + "-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName, themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "下一首",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString() elementID: this.$route.query.elementId.toString()
}); });
} },
if (this.index < this.showObj.audio.length - 1) { // 改变收藏状态
this.index++; changeCollect() {
this.keepPlay(); if (this.hasCollect) {
} else if (this.playType === 0 && this.showObj.audio.length > 1) {
this.index = 0;
this.keepPlay();
} else {
Toast("已经是最后一首");
}
},
// 音频准备就绪
canPlay() {
let audio = this.$refs.audio;
this.offset = Math.ceil(parseInt(audio.duration) | 0);
this.$nextTick(() => {
this.getDuration();
});
},
// 播放中方法
playing() {
let audio = this.$refs.audio;
this.playFlag = true;
this.$refs.imgItem.classList.add("swin");
this.timer = setInterval(() => {
let min = null;
if (parseInt(audio.currentTime / 60) < 10) {
min = "0" + parseInt(audio.currentTime / 60);
} else {
min = parseInt(audio.currentTime / 60);
}
let sec = parseInt(audio.currentTime % 60);
if (sec < 10) {
sec = "0" + sec;
}
this.startTime = min + ":" + sec; /* 00:00 */
this.range = parseInt(audio.currentTime);
if (this.range === this.offset && this.offset !== 0) {
this.range = 0; /*播放结束后进度条归零*/
this.startTime = "00:00"; /*播放结束后时间归零*/
this.onOver();
clearInterval(this.timer);
}
}, 1000);
},
// 暂停计时器
stopTime() {
clearInterval(this.timer);
},
// 获取音频总长度
getDuration() {
let min = null;
if (this.offset === 0) {
this.overTime = "正在加载中...";
} else {
if (parseInt(this.offset / 60) < 10) {
min = "0" + parseInt(this.offset / 60);
} else {
min = parseInt(this.offset / 60);
}
let sec = parseInt(this.offset % 60);
if (sec < 10) {
sec = "0" + sec;
}
this.overTime = min + ":" + sec; /* 00:00 */
}
},
// 播放完毕
onOver() {
switch (this.playType) {
case 0:
if (this.index < this.showObj.audio.length - 1) {
this.index++;
} else {
this.index = 0;
}
this.$nextTick(() => {
this.onPlay();
});
break;
case 1:
this.range = 0;
this.$nextTick(() => {
this.onPlay();
});
break;
case 2:
if (this.index < this.showObj.audio.length - 1) {
this.index++;
this.$nextTick(() => {
this.onPlay();
});
} else {
this.index = 0;
this.$nextTick(() => {
this.onStop();
});
}
}
},
// 改变循环状态
changeType() {
this.playType < 2 ? this.playType++ : (this.playType = 0);
window.localStorage.setItem("playType", this.playType);
switch (this.playType) {
case 1:
// 神策埋点 点击操作 // 神策埋点 点击操作
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")) themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "单曲循环", buttonName: "取消收藏",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString() elementID: this.$route.query.elementId.toString()
}); });
Toast("单曲循环"); delUserCollectApi(this.hasCollect).then(res => {
break; this.hasCollect = false;
case 2: Toast("取消收藏");
this.checkCollect();
});
} else {
// 神策埋点 点击操作 // 神策埋点 点击操作
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName: elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0, 0,
9 9
) + ) +
"-" + "-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "添加收藏",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let json = {
category_id: lessonDetail.id,
type: 1,
title: this.showObj.audio[this.index].title,
sub_title: "来自于 " + lessonDetail.title,
url: this.showObj.audio[this.index].url,
cover: this.showObj.audio[this.index].image
};
addUserCollectApi(json)
.then(res => {
Toast("收藏成功,快去主页收藏夹看一看吧");
this.checkCollect();
})
.catch(this.checkCollect());
}
},
// 获取收藏状态
checkCollect() {
let json = {
url: this.showObj.audio[this.index].url
};
// debugger
getUserCollectApi(json).then(res => {
this.hasCollect = res.list.length < 1 ? false : res.list[0].id;
});
},
// 播放音频
onPlay(flag) {
if (flag) {
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")) themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "顺序播放", buttonName: "播放音频",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString() elementID: this.$route.query.elementId.toString()
}); });
Toast("顺序播放"); }
break; this.$nextTick(()=>{
case 0: this.$refs.audio.play();
})
},
// 播放暂停
onStop(flag) {
if (flag) {
// 神策埋点 点击操作 // 神策埋点 点击操作
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName: elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "暂停播放",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
}
this.$refs.audio.pause();
this.playFlag = false;
// console.log(this.$refs.imgItem)
var iTransform = getComputedStyle(this.$refs.imgItem).transform;
var cTransform = getComputedStyle(this.$refs.imageBlock).transform;
this.$refs.imageBlock.style.transform =
cTransform === "none" ? iTransform : iTransform.concat(" ", cTransform);
this.$refs.imgItem.classList.remove("swin");
},
lastOne() {
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0, 0,
9 9
) + ) +
"-" + "-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "上一首",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
if (this.index > 0) {
this.index--;
this.keepPlay();
} else if (this.playType === 0 && this.showObj.audio.length > 1) {
this.index = this.showObj.audio.length - 1;
this.keepPlay();
} else {
Toast("已经是第一首");
}
},
changeIndex(i) {
this.index = i;
this.popupVisible = false;
this.keepPlay();
},
keepPlay() {
if (this.playFlag) {
this.$nextTick(() => {
this.onPlay();
});
} else {
this.$nextTick(() => {
this.onStop();
});
}
},
nextOne(flag) {
if (flag) {
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")) themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "列表循环", buttonName: "下一首",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString() elementID: this.$route.query.elementId.toString()
}); });
Toast("列表循环"); }
break; if (this.index < this.showObj.audio.length - 1) {
} this.index++;
}, this.keepPlay();
changeAge(value) { } else if (this.playType === 0 && this.showObj.audio.length > 1) {
if (this.contentData.content.age && value === 2) { this.index = 0;
this.showObj = { this.keepPlay();
audio: this.contentData.content.audio2,
change: this.contentData.content.change2
};
} else {
this.showObj = {
audio: this.contentData.content.audio,
change: this.contentData.content.change
};
}
this.playFlag = false;
this.startTime = "00:00";
this.overTime = "00:00";
},
finishStudy() {
this.sendConsole("完成今日学习");
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let query = JSON.parse(sessionStorage.getItem("classQuery"));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = {
page_type: 0,
page_id: 5,
stay_time: lookTime
};
subUserLessonApi(
query.elementId,
query.category_id,
query.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7
) {
this.popupVisible2 = true;
// debugger
} else { } else {
getUserWatchApi({ category_id: query.category_id }).then(res => { Toast("已经是最后一首");
this.$store.dispatch("setWatchDetail", res);
this.share_show = true;
// debugger
});
setTimeout(() => {
if (this.$store.state.lookStatus == 0) {
this.audioPoint = audioGood;
} else if (this.$store.state.lookStatus == 1) {
this.audioPoint = audioGreat;
} else {
this.audioPoint = audioPerfect;
}
this.$refs.audioDom.load();
setTimeout(() => {
this.$refs.audioDom.play();
}, 100);
}, 300);
} }
});
// this.$refs.sharePage.playAudio()
// this.$refs.sharePage.initPage()
}
},
watch: {
contentData: {
handler: function() {
//特别注意,不能用箭头函数,箭头函数,this指向全局
this.changeAge(this.contentData.age);
this.index = 0;
this.checkCollect();
}, },
deep: true // 音频准备就绪
}, canPlay() {
index(value) { let audio = this.$refs.audio;
this.checkCollect(); this.offset = Math.ceil(parseInt(audio.duration) | 0);
}, this.$nextTick(() => {
range(value, value2) { this.getDuration();
let audio = this.$refs.audio; });
if (Math.abs(value - value2) > 2) { },
// 播放中方法
playing() {
let audio = this.$refs.audio;
this.playFlag = true;
this.$refs.imgItem.classList.add("swin");
this.timer = setInterval(() => { this.timer = setInterval(() => {
let min = null; let min = null;
if (parseInt(audio.currentTime / 60) < 10) { if (parseInt(audio.currentTime / 60) < 10) {
...@@ -838,466 +569,331 @@ export default { ...@@ -838,466 +569,331 @@ export default {
} }
this.startTime = min + ":" + sec; /* 00:00 */ this.startTime = min + ":" + sec; /* 00:00 */
this.range = parseInt(audio.currentTime); this.range = parseInt(audio.currentTime);
if (this.range == this.offset && this.offset !== 0) { if (this.range === this.offset && this.offset !== 0) {
this.range = 0; /*播放结束后进度条归零*/ this.range = 0; /*播放结束后进度条归零*/
this.startTime = "00:00"; /*播放结束后时间归零*/ this.startTime = "00:00"; /*播放结束后时间归零*/
this.onOver(); this.onOver();
clearInterval(this.timer); clearInterval(this.timer);
} }
}, 1000); }, 1000);
audio.currentTime = value; },
// 暂停计时器
stopTime() {
clearInterval(this.timer);
},
// 获取音频总长度
getDuration() {
let min = null;
if (this.offset === 0) {
this.overTime = "正在加载中...";
} else {
if (parseInt(this.offset / 60) < 10) {
min = "0" + parseInt(this.offset / 60);
} else {
min = parseInt(this.offset / 60);
}
let sec = parseInt(this.offset % 60);
if (sec < 10) {
sec = "0" + sec;
}
this.overTime = min + ":" + sec; /* 00:00 */
}
},
// 播放完毕
onOver() {
switch (this.playType) {
case 0:
if (this.index < this.showObj.audio.length - 1) {
this.index++;
} else {
this.index = 0;
}
this.$nextTick(() => {
this.onPlay();
});
break;
case 1:
this.range = 0;
this.$nextTick(() => {
this.onPlay();
});
break;
case 2:
if (this.index < this.showObj.audio.length - 1) {
this.index++;
this.$nextTick(() => {
this.onPlay();
});
} else {
this.index = 0;
this.$nextTick(() => {
this.onStop();
});
}
}
},
// 改变循环状态
changeType() {
this.playType < 2 ? this.playType++ : (this.playType = 0);
window.localStorage.setItem("playType", this.playType);
switch (this.playType) {
case 1:
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "单曲循环",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
Toast("单曲循环");
break;
case 2:
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "顺序播放",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
Toast("顺序播放");
break;
case 0:
// 神策埋点 点击操作
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "列表循环",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
Toast("列表循环");
break;
}
},
changeAge(value) {
if (this.contentData.content.age && value === 2) {
this.showObj = {
audio: this.contentData.content.audio2,
change: this.contentData.content.change2
};
} else {
this.showObj = {
audio: this.contentData.content.audio,
change: this.contentData.content.change
};
}
this.playFlag = false;
this.startTime = "00:00";
this.overTime = "00:00";
},
finishStudy() {
this.sendConsole("完成今日学习");
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let query = JSON.parse(sessionStorage.getItem("classQuery"));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = {
page_type: 0,
page_id: 5,
stay_time: lookTime
};
subUserLessonApi(
query.elementId,
query.category_id,
query.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7
) {
this.popupVisible2 = true;
// debugger
} else {
getUserWatchApi({ category_id: query.category_id }).then(res => {
this.$store.dispatch("setWatchDetail", res);
// 从评价页面返回过来
if(this.$route.params.evaluate === 1){
this.share_show = true;
this.$route.params.evaluate = 0
} else {
this.$router.push({path: '/evaluate'})
}
// debugger
});
setTimeout(() => {
if (this.$store.state.lookStatus == 0) {
this.audioPoint = audioGood;
} else if (this.$store.state.lookStatus == 1) {
this.audioPoint = audioGreat;
} else {
this.audioPoint = audioPerfect;
}
this.$refs.audioDom.load();
setTimeout(() => {
this.$refs.audioDom.play();
}, 100);
}, 300);
}
});
// this.$refs.sharePage.playAudio()
// this.$refs.sharePage.initPage()
}
},
watch: {
contentData: {
handler: function() {
//特别注意,不能用箭头函数,箭头函数,this指向全局
this.changeAge(this.contentData.age);
this.index = 0;
this.checkCollect();
},
deep: true
},
index(value) {
this.checkCollect();
},
range(value, value2) {
let audio = this.$refs.audio;
if (Math.abs(value - value2) > 2) {
this.timer = setInterval(() => {
let min = null;
if (parseInt(audio.currentTime / 60) < 10) {
min = "0" + parseInt(audio.currentTime / 60);
} else {
min = parseInt(audio.currentTime / 60);
}
let sec = parseInt(audio.currentTime % 60);
if (sec < 10) {
sec = "0" + sec;
}
this.startTime = min + ":" + sec; /* 00:00 */
this.range = parseInt(audio.currentTime);
if (this.range == this.offset && this.offset !== 0) {
this.range = 0; /*播放结束后进度条归零*/
this.startTime = "00:00"; /*播放结束后时间归零*/
this.onOver();
clearInterval(this.timer);
}
}, 1000);
audio.currentTime = value;
}
} }
} }
} };
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.playImage { .playImage {
background-size: 40 * @toVw 290 * @toVw; background-size: 40 * @toVw 290 * @toVw;
display: inline-block; display: inline-block;
}
.imgBox {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
.box {
width: 100%;
height: 100vh;
transform: translateX(0px);
img {
position: absolute;
width: 80vw;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
}
._282918034425091245 {
height: 8 * @toVw;
width: 9 * @toVw;
background-position: 0 0;
}
._154722344142123489 {
height: 5 * @toVw;
width: 9 * @toVw;
background-position: 0 -8 * @toVw;
vertical-align: bottom;
}
.next {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -13 * @toVw;
}
.listPlay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -29 * @toVw;
}
.replay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -45 * @toVw;
}
.toBig {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -61 * @toVw;
}
.replayAll {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -77 * @toVw;
}
.collectDefault {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -93 * @toVw;
}
.collect {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -109 * @toVw;
}
.last {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -125 * @toVw;
}
.list {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -141 * @toVw;
}
.close {
height: 17 * @toVw;
width: 17 * @toVw;
background-position: 0 -157 * @toVw;
}
.zDefaultIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -174 * @toVw;
float: right;
}
.zIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -192 * @toVw;
float: right;
}
.play {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -210 * @toVw;
}
.stop {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -250 * @toVw;
}
.iconfont {
color: #cccccc;
}
.icon-icon_stop {
font-size: 50 * @toVw;
color: #69c0ff;
}
.icon-icon_begin {
font-size: 50 * @toVw;
color: #69c0ff;
}
.icon-icon_left {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_right {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_list {
font-size: 20 * @toVw;
}
.icon-icon_change1 {
font-size: 21 * @toVw;
width: 20 * @toVw;
}
.icon-icon_change {
font-size: 20 * @toVw;
width: 20 * @toVw;
}
.icon-icon_changge {
font-size: 19 * @toVw;
width: 20 * @toVw;
}
.hp-left {
position: relative;
.collect {
position: absolute;
right: 38 * @toVw;
bottom: 48 * @toVw;
}
}
.icon-icon_like1 {
color: #ff7d77;
}
.collect-block {
padding: 10 * @toVw;
border-radius: 4 * @toVw;
background: white;
}
@-webkit-keyframes spin {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.swin {
-webkit-animation: spin 8s linear 1s 5 alternate;
animation: spin 8s linear infinite;
}
.pause {
animation-play-state: paused;
-webkit-animation-play-state: paused;
}
.noanimation {
-webkit-animation: none !important;
animation: none !important;
}
.content {
background: white;
width: 315 * @toVw;
position: absolute;
top: 70 * @toVw;
left: 20 * @toVw;
right: 20 * @toVw;
bottom: 0;
overflow: auto;
margin: auto;
display: block;
border-radius: 8 * @toVw;
text-align: center;
padding: 10 * @toVw;
.image-block {
width: 188 * @toVw;
height: 188 * @toVw;
margin-top: 5 * @toVw;
box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd;
overflow: hidden;
border-radius: 999 * @toVw;
box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1);
border: 4px solid rgba(255, 255, 255, 1);
img {
width: 188 * @toVw;
height: 188 * @toVw;
border-radius: 999 * @toVw;
}
}
.title-block {
margin-top: 20 * @toVw;
margin-bottom: 20 * @toVw;
&.hp {
display: none;
}
.title {
font-size: 16 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.tips {
font-size: 14 * @toVw;
margin-top: 6 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
}
.range-block {
width: 250 * @toVw;
margin-top: 10 * @toVw;
.time-block {
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
text-align: left;
&:after {
content: "";
display: block;
clear: both;
}
.left-time {
float: left;
}
.right-time {
float: right;
}
}
input[type="range"] {
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-appearance: none;
border: none;
outline: none;
background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat, #d8d8d8;
background-size: 75% 100%; /*设置左右宽度比例*/
width: 100%;
border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
-webkit-appearance: none;
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]:focus {
-webkit-appearance: none;
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
border: none;
outline: none;
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
}
.btn-group {
margin-top: 15 * @toVw;
width: 280 * @toVw;
display: -webkit-flex;
&.hp {
display: none;
}
}
}
.list-popup {
width: 375 * @toVw;
max-height: 345 * @toVw;
overflow: auto;
border-radius: 8 * @toVw 8 * @toVw 0 0;
background: white;
padding-top: 20 * @toVw;
.list-block {
display: block;
width: auto;
margin: 0 20 * @toVw;
padding: 12 * @toVw 36 * @toVw;
border-bottom: 1 * @toVw solid #dddddd;
&.active {
color: #49e2a5;
}
}
.close-btn {
text-align: center;
padding: 20 * @toVw;
}
}
.mint-popup {
}
.imgPop-block {
// max-height: 500 * @toVw;
// height: 100vh;
// width: 100vw;
overflow: auto;
img {
// width: 100vw;
width: 300 * @toVw;
}
}
.btn-block {
position: relative;
// margin-top: 15*@toVw;
text-align: center;
.age-block {
height: 28 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
position: absolute;
padding: 0 13 * @toVw;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.age-change-block {
position: absolute;
top: 37 * @toVw;
left: 0;
width: 66 * @toVw;
border-radius: 8 * @toVw;
border: 1 * @toVw solid #666666;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
& > div {
padding: 6 * @toVw 11 * @toVw;
text-align: left;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
}
}
}
.change-block {
border-radius: 1000 * @toVw;
width: 144 * @toVw;
border: 1 * @toVw solid #40a9ff;
&:after {
content: "";
display: block;
clear: both;
}
div {
float: left;
width: 50%;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
height: 28 * @toVw;
line-height: 28 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(204, 204, 204, 1);
&.active {
background: #40a9ff;
color: white;
}
}
} }
} .imgBox {
.change-block-HP { position: fixed;
display: none;
}
.parent-finish {
// position: absolute;
// bottom: 0 * @toVw;
width: 100%;
left: 0;
top: 430 * @toVw;
.finish-block {
// position: absolute;
width: 100%; width: 100%;
height: 100%;
top: 0;
left: 0; left: 0;
padding: 0; .box {
margin: 20 * @toVw 0 0; width: 100%;
text-align: center; height: 100vh;
bottom: 0; transform: translateX(0px);
img { img {
width: 202 * @toVw; position: absolute;
width: 80vw;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
} }
} }
} ._282918034425091245 {
@media screen and (orientation: landscape) { height: 8 * @toVw;
@toVw: 100/667vw;
.finish-block {
display: none;
}
.playImage {
background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2")
no-repeat;
background-size: 40 * @toVw 225 * @toVw;
display: inline-block;
}
._154722344142123489 {
height: 5 * @toVw;
width: 9 * @toVw; width: 9 * @toVw;
background-position: 0 0; background-position: 0 0;
} }
._282918034425091245 { ._154722344142123489 {
height: 8 * @toVw; height: 5 * @toVw;
width: 9 * @toVw; width: 9 * @toVw;
background-position: 0 -4 * @toVw; background-position: 0 -8 * @toVw;
vertical-align: bottom; vertical-align: bottom;
} }
.last { .next {
height: 16 * @toVw; height: 16 * @toVw;
width: 16 * @toVw; width: 16 * @toVw;
background-position: 0 -13 * @toVw; background-position: 0 -13 * @toVw;
...@@ -1312,7 +908,7 @@ export default { ...@@ -1312,7 +908,7 @@ export default {
width: 16 * @toVw; width: 16 * @toVw;
background-position: 0 -45 * @toVw; background-position: 0 -45 * @toVw;
} }
.next { .toBig {
height: 16 * @toVw; height: 16 * @toVw;
width: 16 * @toVw; width: 16 * @toVw;
background-position: 0 -61 * @toVw; background-position: 0 -61 * @toVw;
...@@ -1322,43 +918,62 @@ export default { ...@@ -1322,43 +918,62 @@ export default {
width: 16 * @toVw; width: 16 * @toVw;
background-position: 0 -77 * @toVw; background-position: 0 -77 * @toVw;
} }
.list { .collectDefault {
height: 16 * @toVw; height: 16 * @toVw;
width: 16 * @toVw; width: 16 * @toVw;
background-position: 0 -93 * @toVw; background-position: 0 -93 * @toVw;
} }
.collect {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -109 * @toVw;
}
.last {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -125 * @toVw;
}
.list {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -141 * @toVw;
}
.close {
height: 17 * @toVw;
width: 17 * @toVw;
background-position: 0 -157 * @toVw;
}
.zDefaultIcon { .zDefaultIcon {
height: 18 * @toVw; height: 18 * @toVw;
width: 18 * @toVw; width: 18 * @toVw;
background-position: 0 -109 * @toVw; background-position: 0 -174 * @toVw;
float: right; float: right;
} }
.zIcon { .zIcon {
height: 18 * @toVw; height: 18 * @toVw;
width: 18 * @toVw; width: 18 * @toVw;
background-position: 0 -127 * @toVw; background-position: 0 -192 * @toVw;
float: right; float: right;
} }
.play { .play {
height: 40 * @toVw; height: 40 * @toVw;
width: 40 * @toVw; width: 40 * @toVw;
background-position: 0 -145 * @toVw; background-position: 0 -210 * @toVw;
} }
.stop { .stop {
height: 40 * @toVw; height: 40 * @toVw;
width: 40 * @toVw; width: 40 * @toVw;
background-position: 0 -185 * @toVw; background-position: 0 -250 * @toVw;
}
.iconfont {
color: #cccccc;
} }
.icon-icon_stop { .icon-icon_stop {
height: 50 * @toVw; font-size: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff; color: #69c0ff;
} }
.icon-icon_begin { .icon-icon_begin {
height: 50 * @toVw; font-size: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff; color: #69c0ff;
} }
.icon-icon_left { .icon-icon_left {
...@@ -1377,538 +992,926 @@ export default { ...@@ -1377,538 +992,926 @@ export default {
font-size: 20 * @toVw; font-size: 20 * @toVw;
} }
.icon-icon_change1 { .icon-icon_change1 {
font-size: 20 * @toVw; font-size: 21 * @toVw;
width: 20 * @toVw;
} }
.icon-icon_change { .icon-icon_change {
font-size: 20 * @toVw; font-size: 20 * @toVw;
width: 20 * @toVw;
} }
.icon-icon_changge { .icon-icon_changge {
font-size: 20 * @toVw; font-size: 19 * @toVw;
width: 20 * @toVw;
} }
.hp-left { .hp-left {
position: relative; position: relative;
margin-top: 8vh;
// margin-bottom: 1vh;
// margin-left: 0;
.collect { .collect {
display: none; position: absolute;
right: 38 * @toVw;
bottom: 48 * @toVw;
}
}
.icon-icon_like1 {
color: #ff7d77;
}
.collect-block {
padding: 10 * @toVw;
border-radius: 4 * @toVw;
background: white;
}
@-webkit-keyframes spin {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
} }
} }
.audio-page { .swin {
-webkit-animation: spin 8s linear 1s 5 alternate;
animation: spin 8s linear infinite;
}
.pause {
animation-play-state: paused;
-webkit-animation-play-state: paused;
}
.noanimation {
-webkit-animation: none !important;
animation: none !important;
}
.content {
background: white;
width: 315 * @toVw;
position: absolute; position: absolute;
top: 5 * @toVw; top: 70 * @toVw;
bottom: 5 * @toVw; left: 20 * @toVw;
left: 5 * @toVw; right: 20 * @toVw;
right: 5 * @toVw; bottom: 0;
overflow: auto; overflow: auto;
margin: auto;
display: block;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
.content { text-align: center;
position: static; padding: 10 * @toVw;
height: 100%; .image-block {
width: 100%; width: 188 * @toVw;
display: -webkit-flex; height: 188 * @toVw;
border-radius: 8 * @toVw; margin-top: 5 * @toVw;
padding: 0; box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd;
.hp-left { overflow: hidden;
flex: 1; border-radius: 999 * @toVw;
margin-right: 80 * @toVw; box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1);
.hp-top { border: 4px solid rgba(255, 255, 255, 1);
display: -webkit-flex; img {
display: flex; width: 188 * @toVw;
width: 100%; height: 188 * @toVw;
} border-radius: 999 * @toVw;
} }
.image-block { }
flex: 1; .title-block {
width: 150 * @toVw; margin-top: 20 * @toVw;
height: 150 * @toVw; margin-bottom: 20 * @toVw;
box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd; &.hp {
overflow: hidden; display: none;
display: block; }
margin: auto; .title {
border-radius: 99 * @toVw; font-size: 16 * @toVw;
box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1); font-family: PingFang-SC-Medium;
border: 4px solid rgba(255, 255, 255, 1); font-weight: 500;
img { color: rgba(102, 102, 102, 1);
width: 100%;
border-radius: 999 * @toVw;
}
} }
.btnBox { .tips {
flex: 1; font-size: 14 * @toVw;
margin-top: 6 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
} }
.title-block { }
margin-top: 24 * @toVw; .range-block {
display: none; width: 250 * @toVw;
&.hp { margin-top: 10 * @toVw;
display: -webkit-flex; .time-block {
// display: block; font-size: 12 * @toVw;
width: 300 * @toVw; font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
text-align: left;
&:after {
content: "";
display: block;
clear: both;
} }
.title { .left-time {
font-size: 16 * @toVw; float: left;
font-family: PingFang-SC-Medium;
font-weight: 500;
// width: 100*@toVw;
color: rgba(102, 102, 102, 1);
} }
.tips { .right-time {
font-size: 14 * @toVw; float: right;
margin-top: 6 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
} }
} }
.range-block { input[type="range"] {
width: 422 * @toVw; -webkit-transform: translateZ(0);
margin-top: 16 * @toVw; transform: translateZ(0);
// margin-left: 1vw; -webkit-appearance: none;
.time-block { border: none;
font-size: 12 * @toVw; outline: none;
font-family: PingFang-SC-Medium; background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat, #d8d8d8;
font-weight: 500; background-size: 75% 100%; /*设置左右宽度比例*/
color: rgba(102, 102, 102, 1); width: 100%;
text-align: left; border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/
&:after { }
content: ""; input[type="range"]::-webkit-slider-thumb {
display: block; -webkit-appearance: none;
clear: both;
}
.left-time {
float: left;
}
.right-time {
float: right;
}
}
input[type="range"] {
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-appearance: none;
background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat,
#d8d8d8;
background-size: 75% 100%; /*设置左右宽度比例*/
width: 100%;
border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/
}
input[type="range"]::-webkit-slider-runnable-track {
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
} }
.btn-group { input[type="range"]::-webkit-slider-runnable-track {
margin-top: 15vh; -webkit-appearance: none;
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]:focus {
-webkit-appearance: none;
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
border: none;
outline: none;
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
}
.btn-group {
margin-top: 15 * @toVw;
width: 280 * @toVw;
display: -webkit-flex;
&.hp {
display: none; display: none;
width: 200 * @toVw; }
&.hp { }
display: -webkit-flex; }
.list-popup {
width: 375 * @toVw;
max-height: 345 * @toVw;
overflow: auto;
border-radius: 8 * @toVw 8 * @toVw 0 0;
background: white;
padding-top: 20 * @toVw;
.list-block {
display: block;
width: auto;
margin: 0 20 * @toVw;
padding: 12 * @toVw 36 * @toVw;
border-bottom: 1 * @toVw solid #dddddd;
&.active {
color: #49e2a5;
}
}
.close-btn {
text-align: center;
padding: 20 * @toVw;
}
}
.mint-popup {
}
.imgPop-block {
// max-height: 500 * @toVw;
// height: 100vh;
// width: 100vw;
overflow: auto;
img {
// width: 100vw;
width: 300 * @toVw;
}
}
.btn-block {
position: relative;
// margin-top: 15*@toVw;
text-align: center;
.age-block {
height: 28 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
position: absolute;
padding: 0 13 * @toVw;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.age-change-block {
position: absolute;
top: 37 * @toVw;
left: 0;
width: 66 * @toVw;
border-radius: 8 * @toVw;
border: 1 * @toVw solid #666666;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
& > div {
padding: 6 * @toVw 11 * @toVw;
text-align: left;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
} }
} }
} }
.list-popup { .change-block {
width: 375 * @toVw; border-radius: 1000 * @toVw;
max-height: 345 * @toVw; width: 144 * @toVw;
overflow: auto; border: 1 * @toVw solid #40a9ff;
border-radius: 8 * @toVw 8 * @toVw 0 0; &:after {
background: white; content: "";
padding-top: 20 * @toVw;
.list-block {
display: block; display: block;
width: auto; clear: both;
margin: 0 20 * @toVw; }
padding: 12 * @toVw 36 * @toVw; div {
border-bottom: 1 * @toVw solid #dddddd; float: left;
width: 50%;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
height: 28 * @toVw;
line-height: 28 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(204, 204, 204, 1);
&.active { &.active {
color: #49e2a5; background: #40a9ff;
color: white;
} }
} }
.close-btn {
text-align: center;
padding: 20 * @toVw;
}
} }
.imgPop-block { }
max-height: 500 * @toVw; .change-block-HP {
overflow: auto; display: none;
}
.parent-finish {
// position: absolute;
// bottom: 0 * @toVw;
width: 100%;
left: 0;
top: 430 * @toVw;
.finish-block {
// position: absolute;
width: 100%;
left: 0;
padding: 0;
margin: 20 * @toVw 0 0;
text-align: center;
bottom: 0;
img { img {
max-width: 300 * @toVw; width: 202 * @toVw;
} }
} }
.btn-block { }
@media screen and (orientation: landscape) {
@toVw: 100/667vw;
.finish-block {
display: none;
}
.playImage {
background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2")
no-repeat;
background-size: 40 * @toVw 225 * @toVw;
display: inline-block;
}
._154722344142123489 {
height: 5 * @toVw;
width: 9 * @toVw;
background-position: 0 0;
}
._282918034425091245 {
height: 8 * @toVw;
width: 9 * @toVw;
background-position: 0 -4 * @toVw;
vertical-align: bottom;
}
.last {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -13 * @toVw;
}
.listPlay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -29 * @toVw;
}
.replay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -45 * @toVw;
}
.next {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -61 * @toVw;
}
.replayAll {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -77 * @toVw;
}
.list {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -93 * @toVw;
}
.zDefaultIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -109 * @toVw;
float: right;
}
.zIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -127 * @toVw;
float: right;
}
.play {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -145 * @toVw;
}
.stop {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -185 * @toVw;
}
.icon-icon_stop {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_begin {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_left {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_right {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_list {
font-size: 20 * @toVw;
}
.icon-icon_change1 {
font-size: 20 * @toVw;
}
.icon-icon_change {
font-size: 20 * @toVw;
}
.icon-icon_changge {
font-size: 20 * @toVw;
}
.hp-left {
position: relative; position: relative;
min-width: 90 * @toVw; margin-top: 8vh;
margin-top: 0; // margin-bottom: 1vh;
display: block; // margin-left: 0;
height: 100%; .collect {
.age-block { display: none;
display: block;
position: static;
padding: 0;
height: 28 * @toVw;
width: 88 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
} }
.age-change-block { }
.audio-page {
position: absolute;
top: 5 * @toVw;
bottom: 5 * @toVw;
left: 5 * @toVw;
right: 5 * @toVw;
overflow: auto;
border-radius: 8 * @toVw;
.content {
position: static; position: static;
width: 80 * @toVw; height: 100%;
margin-top: 10 * @toVw; width: 100%;
display: -webkit-flex;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
border: 1 * @toVw solid #666666; padding: 0;
font-size: 12 * @toVw; .hp-left {
font-family: PingFang-SC-Medium; flex: 1;
font-weight: 500; margin-right: 80 * @toVw;
color: rgba(102, 102, 102, 1); .hp-top {
& > div { display: -webkit-flex;
padding: 6 * @toVw 11 * @toVw; display: flex;
text-align: left; width: 100%;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
} }
} }
} .image-block {
.change-block-HP { flex: 1;
position: fixed; width: 150 * @toVw;
top: ~"calc(82vh)"; height: 150 * @toVw;
right: 40 * @toVw; box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd;
display: block; overflow: hidden;
width: 78 * @toVw; display: block;
img { margin: auto;
width: 100%; border-radius: 99 * @toVw;
box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1);
border: 4px solid rgba(255, 255, 255, 1);
img {
width: 100%;
border-radius: 999 * @toVw;
}
}
.btnBox {
flex: 1;
}
.title-block {
margin-top: 24 * @toVw;
display: none;
&.hp {
display: -webkit-flex;
// display: block;
width: 300 * @toVw;
}
.title {
font-size: 16 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
// width: 100*@toVw;
color: rgba(102, 102, 102, 1);
}
.tips {
font-size: 14 * @toVw;
margin-top: 6 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
}
.range-block {
width: 422 * @toVw;
margin-top: 16 * @toVw;
// margin-left: 1vw;
.time-block {
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
text-align: left;
&:after {
content: "";
display: block;
clear: both;
}
.left-time {
float: left;
}
.right-time {
float: right;
}
}
input[type="range"] {
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-appearance: none;
background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat,
#d8d8d8;
background-size: 75% 100%; /*设置左右宽度比例*/
width: 100%;
border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/
}
input[type="range"]::-webkit-slider-runnable-track {
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
}
.btn-group {
margin-top: 15vh;
display: none;
width: 200 * @toVw;
&.hp {
display: -webkit-flex;
}
} }
} }
.change-block { .list-popup {
display: none; width: 375 * @toVw;
} max-height: 345 * @toVw;
} overflow: auto;
} border-radius: 8 * @toVw 8 * @toVw 0 0;
} background: white;
@media screen and (min-aspect-ratio: ~"20/8") { padding-top: 20 * @toVw;
@toVw: 100/900vw; .list-block {
.playImage { display: block;
background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2") width: auto;
no-repeat; margin: 0 20 * @toVw;
background-size: 40 * @toVw 225 * @toVw; padding: 12 * @toVw 36 * @toVw;
display: inline-block; border-bottom: 1 * @toVw solid #dddddd;
} &.active {
._154722344142123489 { color: #49e2a5;
height: 5 * @toVw; }
width: 9 * @toVw; }
background-position: 0 0; .close-btn {
} text-align: center;
._282918034425091245 { padding: 20 * @toVw;
height: 8 * @toVw;
width: 9 * @toVw;
background-position: 0 -4 * @toVw;
vertical-align: bottom;
}
.last {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -13 * @toVw;
}
.listPlay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -29 * @toVw;
}
.replay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -45 * @toVw;
}
.next {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -61 * @toVw;
}
.replayAll {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -77 * @toVw;
}
.list {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -93 * @toVw;
}
.zDefaultIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -109 * @toVw;
float: right;
}
.zIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -127 * @toVw;
float: right;
}
.play {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -145 * @toVw;
}
.stop {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -185 * @toVw;
}
.icon-icon_stop {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_begin {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_left {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_right {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_list {
font-size: 20 * @toVw;
}
.icon-icon_change1 {
font-size: 20 * @toVw;
}
.icon-icon_change {
font-size: 20 * @toVw;
}
.icon-icon_changge {
font-size: 20 * @toVw;
}
.audio-page {
position: absolute;
top: 5 * @toVw;
bottom: 5 * @toVw;
left: 5 * @toVw;
right: 5 * @toVw;
overflow: auto;
border-radius: 8 * @toVw;
.content {
position: static;
height: 100%;
width: 100%;
display: -webkit-flex;
border-radius: 8 * @toVw;
padding: 0;
.hp-left {
flex: 1;
margin-right: 20 * @toVw;
.hp-top {
display: -webkit-flex;
width: 100%;
} }
} }
.image-block { .imgPop-block {
width: 150 * @toVw; max-height: 500 * @toVw;
height: 150 * @toVw; overflow: auto;
box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd;
overflow: hidden;
display: block;
margin: auto;
border-radius: 75 * @toVw;
box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1);
border: 4px solid rgba(255, 255, 255, 1);
img { img {
width: 100%; max-width: 300 * @toVw;
} }
} }
.title-block { .btn-block {
margin-top: 24 * @toVw; position: relative;
.title { min-width: 90 * @toVw;
font-size: 16 * @toVw; margin-top: 0;
display: block;
height: 100%;
.age-block {
display: block;
position: static;
padding: 0;
height: 28 * @toVw;
width: 88 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
} }
.tips { .age-change-block {
font-size: 14 * @toVw; position: static;
margin-top: 6 * @toVw; width: 80 * @toVw;
font-family: PingFang-SC-Medium; margin-top: 10 * @toVw;
font-weight: 500; border-radius: 8 * @toVw;
color: rgba(153, 153, 153, 1); border: 1 * @toVw solid #666666;
}
}
.range-block {
width: auto;
margin-top: 16 * @toVw;
.time-block {
font-size: 12 * @toVw; font-size: 12 * @toVw;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
text-align: left; & > div {
&:after { padding: 6 * @toVw 11 * @toVw;
content: ""; text-align: left;
display: block; &:first-child {
clear: both; border-bottom: 1 * @toVw solid #eee;
} }
.left-time {
float: left;
}
.right-time {
float: right;
} }
} }
input[type="range"] { .change-block-HP {
-webkit-transform: translateZ(0); position: fixed;
transform: translateZ(0); top: ~"calc(82vh)";
-webkit-appearance: none; right: 40 * @toVw;
background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat, display: block;
#d8d8d8; width: 78 * @toVw;
background-size: 75% 100%; /*设置左右宽度比例*/ img {
width: 100%; width: 100%;
border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/ }
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]:focus {
outline: none;
} }
input[type="range"]::-webkit-slider-thumb { .change-block {
-webkit-appearance: none; display: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
}
.btn-group {
margin-top: 15vh;
display: none;
width: 200 * @toVw;
&.hp {
display: -webkit-flex;
} }
} }
} }
.list-popup { }
width: 375 * @toVw; @media screen and (min-aspect-ratio: ~"20/8") {
max-height: 345 * @toVw; @toVw: 100/900vw;
overflow: auto; .playImage {
border-radius: 8 * @toVw 8 * @toVw 0 0; background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png?v=2")
background: white; no-repeat;
padding-top: 20 * @toVw; background-size: 40 * @toVw 225 * @toVw;
.list-block { display: inline-block;
display: block;
width: auto;
margin: 0 20 * @toVw;
padding: 12 * @toVw 36 * @toVw;
border-bottom: 1 * @toVw solid #dddddd;
&.active {
color: #49e2a5;
}
}
.close-btn {
text-align: center;
padding: 20 * @toVw;
}
} }
.imgPop-block { ._154722344142123489 {
max-height: 500 * @toVw; height: 5 * @toVw;
overflow: auto; width: 9 * @toVw;
img { background-position: 0 0;
max-width: 300 * @toVw;
}
} }
.btn-block { ._282918034425091245 {
position: relative; height: 8 * @toVw;
min-width: 90 * @toVw; width: 9 * @toVw;
margin-top: 0; background-position: 0 -4 * @toVw;
display: block; vertical-align: bottom;
height: 100%; }
.age-block { .last {
display: block; height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -13 * @toVw;
}
.listPlay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -29 * @toVw;
}
.replay {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -45 * @toVw;
}
.next {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -61 * @toVw;
}
.replayAll {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -77 * @toVw;
}
.list {
height: 16 * @toVw;
width: 16 * @toVw;
background-position: 0 -93 * @toVw;
}
.zDefaultIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -109 * @toVw;
float: right;
}
.zIcon {
height: 18 * @toVw;
width: 18 * @toVw;
background-position: 0 -127 * @toVw;
float: right;
}
.play {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -145 * @toVw;
}
.stop {
height: 40 * @toVw;
width: 40 * @toVw;
background-position: 0 -185 * @toVw;
}
.icon-icon_stop {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_begin {
height: 50 * @toVw;
width: 50 * @toVw;
font-size: 48 * @toVw;
color: #69c0ff;
}
.icon-icon_left {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_right {
height: 37 * @toVw;
width: 37 * @toVw;
font-size: 32 * @toVw;
color: #69c0ff;
}
.icon-icon_list {
font-size: 20 * @toVw;
}
.icon-icon_change1 {
font-size: 20 * @toVw;
}
.icon-icon_change {
font-size: 20 * @toVw;
}
.icon-icon_changge {
font-size: 20 * @toVw;
}
.audio-page {
position: absolute;
top: 5 * @toVw;
bottom: 5 * @toVw;
left: 5 * @toVw;
right: 5 * @toVw;
overflow: auto;
border-radius: 8 * @toVw;
.content {
position: static; position: static;
height: 100%;
width: 100%;
display: -webkit-flex;
border-radius: 8 * @toVw;
padding: 0; padding: 0;
height: 28 * @toVw; .hp-left {
width: 88 * @toVw; flex: 1;
line-height: 28 * @toVw; margin-right: 20 * @toVw;
border: 1 * @toVw solid #666; .hp-top {
border-radius: 100 * @toVw; display: -webkit-flex;
font-size: 12 * @toVw; width: 100%;
font-family: PingFang-SC-Medium; }
font-weight: 500; }
color: rgba(102, 102, 102, 1); .image-block {
width: 150 * @toVw;
height: 150 * @toVw;
box-shadow: 0 0 30 * @toVw 5 * @toVw #ddd;
overflow: hidden;
display: block;
margin: auto;
border-radius: 75 * @toVw;
box-shadow: 0px 0px 4px 0px rgba(96, 173, 240, 1);
border: 4px solid rgba(255, 255, 255, 1);
img {
width: 100%;
}
}
.title-block {
margin-top: 24 * @toVw;
.title {
font-size: 16 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.tips {
font-size: 14 * @toVw;
margin-top: 6 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
}
.range-block {
width: auto;
margin-top: 16 * @toVw;
.time-block {
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
text-align: left;
&:after {
content: "";
display: block;
clear: both;
}
.left-time {
float: left;
}
.right-time {
float: right;
}
}
input[type="range"] {
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-appearance: none;
background: -webkit-linear-gradient(#69c0ff, #69c0ff) no-repeat,
#d8d8d8;
background-size: 75% 100%; /*设置左右宽度比例*/
width: 100%;
border-radius: 10 * @toVw; /*这个属性设置使填充进度条时的图形为圆角*/
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
height: 4 * @toVw;
border-radius: 2 * @toVw;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
border-radius: 50%; /*外观设置为圆形*/
height: 16 * @toVw;
width: 16 * @toVw;
margin-top: -6 * @toVw; /*使滑块超出轨道部分的偏移量相等*/
background: #69c0ff;
}
}
.btn-group {
margin-top: 15vh;
display: none;
width: 200 * @toVw;
&.hp {
display: -webkit-flex;
}
}
} }
.age-change-block { .list-popup {
position: static; width: 375 * @toVw;
width: 80 * @toVw; max-height: 345 * @toVw;
margin-top: 10 * @toVw; overflow: auto;
border-radius: 8 * @toVw; border-radius: 8 * @toVw 8 * @toVw 0 0;
border: 1 * @toVw solid #666666; background: white;
font-size: 12 * @toVw; padding-top: 20 * @toVw;
font-family: PingFang-SC-Medium; .list-block {
font-weight: 500; display: block;
color: rgba(102, 102, 102, 1); width: auto;
& > div { margin: 0 20 * @toVw;
padding: 6 * @toVw 11 * @toVw; padding: 12 * @toVw 36 * @toVw;
text-align: left; border-bottom: 1 * @toVw solid #dddddd;
&:first-child { &.active {
border-bottom: 1 * @toVw solid #eee; color: #49e2a5;
} }
} }
.close-btn {
text-align: center;
padding: 20 * @toVw;
}
} }
.change-block-HP { .imgPop-block {
position: absolute; max-height: 500 * @toVw;
top: ~"calc(100vh - 12.5vw)"; overflow: auto;
display: block;
width: 78 * @toVw;
img { img {
width: 100%; max-width: 300 * @toVw;
} }
} }
.change-block { .btn-block {
display: none; position: relative;
min-width: 90 * @toVw;
margin-top: 0;
display: block;
height: 100%;
.age-block {
display: block;
position: static;
padding: 0;
height: 28 * @toVw;
width: 88 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
}
.age-change-block {
position: static;
width: 80 * @toVw;
margin-top: 10 * @toVw;
border-radius: 8 * @toVw;
border: 1 * @toVw solid #666666;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
& > div {
padding: 6 * @toVw 11 * @toVw;
text-align: left;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
}
}
}
.change-block-HP {
position: absolute;
top: ~"calc(100vh - 12.5vw)";
display: block;
width: 78 * @toVw;
img {
width: 100%;
}
}
.change-block {
display: none;
}
} }
} }
} }
}
</style> </style>
<style> <style>
.van-image-preview__image { .van-image-preview__image {
/* max-height: 150%; */ /* max-height: 150%; */
/* bottom: none; */ /* bottom: none; */
} }
</style> </style>
<template>
<div class="evaluate-page">
<div class="evaluate-content">
<!-- title -->
<div class="evaluate-content-title">
记录下宝贝的精彩表现吧!
</div>
<!-- 打分 -->
<ul class="evaluate-content-scoring">
<li>
<div class="scoring-category-titlle">兴趣度:</div>
<div class="scoring-category-icons">
<img v-for="(item, index) in 5" @click="scoringCategoryClick(index, 1)" :src="imageNum <= index ? scoringCategoryImage.scoringCategory1 : scoringCategoryImage.scoringCategory1Active" alt="">
</div>
</li>
<li>
<div class="scoring-category-titlle">专注度:</div>
<div class="scoring-category-icons">
<img v-for="(item, index) in 5" @click="scoringCategoryClick(index, 2)" :src="imageNum2 <= index ? scoringCategoryImage.scoringCategory2 : scoringCategoryImage.scoringCategory2Active" alt="">
</div>
</li>
<li>
<div class="scoring-category-titlle">互动度:</div>
<div class="scoring-category-icons">
<img v-for="(item, index) in 5" @click="scoringCategoryClick(index, 3)" :src="imageNum3 <= index ? scoringCategoryImage.scoringCategory3 : scoringCategoryImage.scoringCategory3Active" alt="">
</div>
</li>
</ul>
<!-- 输入框 -->
<div class="checkbox-put">
<div contenteditable="true" class="checkbox-put-contenteditable" v-text="myHtmlCode" @input="handleInput" placeholder="点击输入宝贝今天的学习表现、收获…"></div>
<div class="checkbox-text">*可输入15-100字</div>
</div>
<!-- btn -->
<div class="growth-btn" @click="userCategoryClick">
<img :src="growthRecord" alt="">
</div>
<!-- 提示 -->
<div class="growth-text">
保存后可随时至“我的”-“成长记录”里查看
</div>
<div class="skip-text" @click="skipTextClick">跳过</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import { postUserGrowthAddApi, subUserLessonApi, getUserGrowthRecordApi } from "../../service/api";
import { scoringCategory } from "../../util/imgUrl";
import growthRecord from "../../assets/growth_record.png";
export default {
name: 'evaluate',
data() {
return {
cache: {},
imageNum : 0, // 兴趣度
imageNum2 : 0, // 专注度
imageNum3 : 0, // 互动度
myHtmlCode: '',
growthRecord: growthRecord,
scoringCategoryImage: scoringCategory,
}
},
methods: {
/**
* 点击
*/
scoringCategoryClick(num, state) {
if(state === 1)
this.imageNum = num + 1;
else if(state === 2)
this.imageNum2 = num + 1;
else
this.imageNum3 = num + 1;
this.cache = { imageNum: this.imageNum, imageNum2: this.imageNum2, imageNum3: this.imageNum3 }
localStorage.setItem('cache', JSON.stringify(this.cache))
},
handleInput(e){
let checkboxPutContenteditable = document.querySelector('.checkbox-put-contenteditable');
this.cache = Object.assign({}, this.cache, { inner: checkboxPutContenteditable.innerHTML })
localStorage.setItem('cache', JSON.stringify(this.cache))
},
/**
* 提交成长记录
* @returns {Promise.<void>}
*/
async userCategoryClick() {
let checkboxPutContenteditable = document.querySelector('.checkbox-put-contenteditable');
let classQuery = JSON.parse(sessionStorage.getItem("classQuery")), // 获取elementId,category_id,periods_id
nowTime = Date.parse(new Date()), // 时间
lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")),// 获取延长时间
lookTime = (nowTime - lessonDetail.nowTime) / 1000,
watchLog = { page_type: 0, page_id: 7, stay_time: lookTime };
let data = { interest: this.imageNum, concert: this.imageNum2, parent_child: this.imageNum3, growth_record: checkboxPutContenteditable.innerHTML }
if(this.imageNum !== 0 || this.imageNum !== 0 || this.imageNum !== 0) {
// 提交评价页面
const postUserGrowthAddData = await postUserGrowthAddApi(classQuery.elementId, classQuery.category_id, classQuery.periods_id, data)
// 提交看课数据
const subUserLessonDatac = subUserLessonApi(classQuery.elementId, classQuery.category_id, classQuery.periods_id, watchLog)
localStorage.removeItem("cache");
this.$router.push({name: 'newLesson', params: { evaluate: 1, type: 3}, query: { periods_id: classQuery.periods_id, category_id: classQuery.category_id, elementId: classQuery.elementId }})
}
},
skipTextClick() {
let classQuery = JSON.parse(sessionStorage.getItem("classQuery"))
this.$router.push({name: 'newLesson', params: { evaluate: 3, type: 3 }, query: { periods_id: classQuery.periods_id, category_id: classQuery.category_id, elementId: classQuery.elementId }})
},
/**
* 初始化
*/
async userCategoryInit() {
let cacheObj = JSON.parse(localStorage.getItem('cache'))
console.log(cacheObj)
if( cacheObj ) {
// 从缓存里获取
this.imageNum = cacheObj.imageNum || 0;
this.imageNum2 = cacheObj.imageNum2 || 0;
this.imageNum3 = cacheObj.imageNum3 || 0;
this.myHtmlCode = cacheObj.inner || '';
}else {
// 从接口获取
let classQuery = JSON.parse(sessionStorage.getItem("classQuery"))
const getUserGrowthRecordData = await getUserGrowthRecordApi(classQuery.elementId, classQuery.category_id, classQuery.periods_id);
this.imageNum = getUserGrowthRecordData.interest;
this.imageNum2 = getUserGrowthRecordData.concent;
this.imageNum3 = getUserGrowthRecordData.parent_child;
this.myHtmlCode = getUserGrowthRecordData.growth_record;
}
}
},
mounted() {
this.userCategoryInit()
}
}
</script>
<style lang="less" type="text/less">
@import "../../util/public";
.evaluate-page {
width: 100%;
height: 100%;
background: #EEEEEE;
padding: 10 * @toVw 20 * @toVw 0;
box-sizing: border-box;
.evaluate-content {
width: 100%;
margin: auto;
padding: 0 26 * @toVw 10 * @toVw;
background: #fff;
border-radius: 8 * @toVw;
box-sizing: border-box;
/* title */
.evaluate-content-title {
padding: 20 * @toVw 0;
text-align: center;
letter-spacing: 1px;
font-size: 18 * @toVw;
font-weight: 500;
color: #40A9FF;
}
/* 打分 */
.evaluate-content-scoring {
width: 100%;
font-size: 0;
padding-bottom: 21 * @toVw;
li {
padding-top: 15 * @toVw;
.scoring-category-titlle {
width: 56 * @toVw;
display: inline-block;
vertical-align: middle;
font-size: 14 * @toVw;
color: #333333;
}
.scoring-category-icons {
width: calc(100% - 16vw);
display: inline-block;
vertical-align: middle;
img {
width: 28 * @toVw;
height: 28 * @toVw;
margin-left: 10 * @toVw;
}
}
}
}
/* 输入框 */
.checkbox-put {
width: 100%;
padding-bottom: 29 * @toVw;
.checkbox-put-contenteditable {
width: 100%;
height: 170 * @toVw;
padding: 10 * @toVw;
overflow: auto;
border: 1px solid #E2E2E2;
border-radius: 10 * @toVw;
box-sizing: border-box;
font-size: 14 * @toVw;
outline: none;
&:empty:before{
content: attr(placeholder);
color:#bbb;
}
}
.checkbox-text {
padding-top: 5 * @toVw;
font-size: 12 * @toVw;
color: #666666;
}
}
/* btn */
.growth-btn {
width: 200 * @toVw;
height: 47 * @toVw;
border-radius: 24 * @toVw;
img {
width: 100%;
height: 100%;
}
}
/* 提示 */
.growth-text {
padding-top: 10 * @toVw;
text-align: center;
letter-spacing: 1px;
font-size: 12 * @toVw;
color: #666666;
}
.skip-text {
padding-top: 10 * @toVw;
text-decoration: underline;
text-align: center;
font-size: 12 * @toVw;
color: #40A9FF;
}
}
}
</style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</i> </i>
<i :class="{headerHP:true, defaultFun:nowShow !== 3,funHP:nowShow===3}" @click="type=3"> <i :class="{headerHP:true, defaultFun:nowShow !== 3,funHP:nowShow===3}" @click="type=3">
<img :src="HP.listen1" alt /> <img :src="HP.listen1" alt />
</i> </i>ƒ
<i class="headerHP home" @click="backList"> <i class="headerHP home" @click="backList">
<img :src="HP.back" alt /> <img :src="HP.back" alt />
</i> </i>
...@@ -37,368 +37,377 @@ ...@@ -37,368 +37,377 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
subUserLessonApi, subUserLessonApi,
getUserWatchApi, getUserWatchApi,
getwechatParam, getwechatParam,
getCountTimeApi getCountTimeApi
} from "../../service/api"; } from "../../service/api";
import { Toast } from "vant"; import { Toast } from "vant";
import lookBlock from "./look"; import lookBlock from "./look";
import videoBlock from "./video"; import videoBlock from "./video";
import backUrl from "../../assets/newLesson/back.png"; import backUrl from "../../assets/newLesson/back.png";
import { HP } from "../../util/imgUrl.js"; import { HP } from "../../util/imgUrl.js";
import audioBlock from "./audio"; import audioBlock from "./audio";
import sharePage from "./share"; import sharePage from "./share";
export default { export default {
name: "index", name: "index",
data() { data() {
let query; let query;
if (this.$store.state.classQuery.periods_id) { if (this.$store.state.classQuery.periods_id) {
query = this.$store.state.classQuery; query = this.$store.state.classQuery;
} else { } else {
// debugger
query = JSON.parse(sessionStorage.getItem("classQuery"));
}
// debugger // debugger
query = JSON.parse(sessionStorage.getItem("classQuery")); return {
} backUrl: backUrl,
// debugger periods_id: query.periods_id,
return { category_id: query.category_id,
backUrl: backUrl, elementId: query.elementId,
periods_id: query.periods_id, lesson: JSON.parse(localStorage.getItem("lessonDetail")),
category_id: query.category_id, nowShow: 0,
elementId: query.elementId, page_id: 1,
lesson: null, stillTime: 0,
nowShow: 0, watchDetail: null,
page_id: 1, timeInterval: null,
stillTime: 0, nowLesson: {
watchDetail: null, type: "",
timeInterval: null, content: null,
nowLesson: { age: 1
type: "", },
content: null, HP: HP,
age: 1 type: 1,
}, saveTime:null,
HP: HP, minute:'',
type: 1, percent:'',
saveTime:null, title:'',
minute:'', domTitle:''
percent:'', };
title:'', },
domTitle:'' watch: {
}; type() {
}, this.changeTitle(this.type);
watch: { }
type() { },
this.changeTitle(this.type); components: {
} lookBlock,
}, videoBlock,
components: { audioBlock,
lookBlock, sharePage
videoBlock, },
audioBlock, mounted() {
sharePage // 直接跳转和提交跳转
}, if(this.$route.params.evaluate === 1 || this.$route.params.evaluate === 3) {
mounted() { this.nowShow = parseInt(this.$route.params.type)
// this.changeTitle(this.type); this.type = parseInt(this.$route.params.type)
this.initPage(); this.changeTitle(parseInt(this.$route.params.type))
}, }else {
beforeDestroy(){ this.initPage();
clearInterval(this.saveTime) }
}, },
methods: { /**
enableShare: function(option) { * 离开页面前关闭--这个记录看课时长
let that = this; */
getwechatParam({ beforeDestroy(){
api_list: "onMenuShareAppMessage,onMenuShareTimeline", clearInterval(this.saveTime)
url: window.location.href.split("#")[0] },
}).then(wechatRes => { methods: {
wx.config({ enableShare: function(option) {
debug: false, let that = this;
appId: wechatRes.appId, getwechatParam({
timestamp: parseInt(wechatRes.timestamp), api_list: "onMenuShareAppMessage,onMenuShareTimeline",
nonceStr: wechatRes.nonceStr, url: window.location.href.split("#")[0]
signature: wechatRes.signature, }).then(wechatRes => {
jsApiList: wechatRes.jsApiList wx.config({
}); debug: false,
wx.ready(function() { appId: wechatRes.appId,
wx.onMenuShareTimeline({ timestamp: parseInt(wechatRes.timestamp),
title: option.product_title, // 分享标题 nonceStr: wechatRes.nonceStr,
desc: option.desc, // 分享描述 signature: wechatRes.signature,
link: option.shareUrl, // 分享链接 jsApiList: wechatRes.jsApiList
imgUrl:
option.shareIcon ||
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
// debugger
let lessonDetail = JSON.parse(
localStorage.getItem("lessonDetail")
);
let nowTime = Date.parse(new Date());
let json = {
page_type: 0,
page_id: 6,
stay_time: 0
};
subUserLessonApi(
that.elementId,
that.category_id,
that.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem(
"lessonDetail",
JSON.stringify(lessonDetail)
);
});
},
cancel: function() {}
}); });
wx.onMenuShareAppMessage({ wx.ready(function() {
title: option.product_title, // 分享标题 wx.onMenuShareTimeline({
desc: option.desc, // 分享描述 title: option.product_title, // 分享标题
link: option.shareUrl, // 分享链接 desc: option.desc, // 分享描述
imgUrl: link: option.shareUrl, // 分享链接
option.shareIcon || imgUrl:
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标 option.shareIcon ||
success: function() { "https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
let lessonDetail = JSON.parse( success: function() {
localStorage.getItem("lessonDetail") // debugger
); let lessonDetail = JSON.parse(
let nowTime = Date.parse(new Date()); localStorage.getItem("lessonDetail")
let json = { );
page_type: 0, let nowTime = Date.parse(new Date());
page_id: 6, let json = {
stay_time: 0 page_type: 0,
}; page_id: 6,
subUserLessonApi( stay_time: 0
that.elementId, };
that.category_id, subUserLessonApi(
that.periods_id, that.elementId,
json that.category_id,
).then(res => { that.periods_id,
lessonDetail.total_watch_time = res.total_watch_time; json
lessonDetail.nowTime = nowTime; ).then(res => {
lessonDetail.star_num = res.total_star_num; lessonDetail.total_watch_time = res.total_watch_time;
localStorage.setItem( lessonDetail.nowTime = nowTime;
"lessonDetail", lessonDetail.star_num = res.total_star_num;
JSON.stringify(lessonDetail) localStorage.setItem(
"lessonDetail",
JSON.stringify(lessonDetail)
);
});
},
cancel: function() {}
});
wx.onMenuShareAppMessage({
title: option.product_title, // 分享标题
desc: option.desc, // 分享描述
link: option.shareUrl, // 分享链接
imgUrl:
option.shareIcon ||
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
let lessonDetail = JSON.parse(
localStorage.getItem("lessonDetail")
); );
}); let nowTime = Date.parse(new Date());
}, let json = {
cancel: function() {} page_type: 0,
page_id: 6,
stay_time: 0
};
subUserLessonApi(
that.elementId,
that.category_id,
that.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem(
"lessonDetail",
JSON.stringify(lessonDetail)
);
});
},
cancel: function() {}
});
}); });
}); });
}); },
}, onShare(URL) {
onShare(URL) { this.enableShare({
this.enableShare({ product_title: `我家宝宝正在【唱唱启蒙英语】挑战童谣,已坚持${this.watchDetail.total_day}天`, // 分享标题
product_title: `我家宝宝正在【唱唱启蒙英语】挑战童谣,已坚持${this.watchDetail.total_day}天`, // 分享标题 desc:
desc: JSON.parse(localStorage.getItem("userDesc")).nickname +
JSON.parse(localStorage.getItem("userDesc")).nickname + `赠您【领取超值课程】特权,来唱唱和百万家庭一起快乐启蒙英语吧!`, //
`赠您【领取超值课程】特权,来唱唱和百万家庭一起快乐启蒙英语吧!`, // shareIcon: "https://cdn.singsingenglish.com/logo/logo.jpg",
shareIcon: "https://cdn.singsingenglish.com/logo/logo.jpg", shareUrl: URL
shareUrl: URL });
}); },
}, backList() {
backList() { let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")); let nowTime = Date.parse(new Date());
let nowTime = Date.parse(new Date()); let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; this.$sa.track("watchClick", {
this.$sa.track("watchClick", { buttonName: "返回课程列表",
buttonName: "返回课程列表", partName:
partName: this.nowShow == 1
this.nowShow == 1 ? "爸妈看一看"
? "爸妈看一看" : this.nowShow == 2
: this.nowShow == 2 ? "宝贝玩一玩"
? "宝贝玩一玩" : this.nowShow == 3
: this.nowShow == 3 ? "磨磨小耳朵"
? "磨磨小耳朵" : "",
: "", elementID: this.lesson.id.toString(),
elementID: this.lesson.id.toString(), dayModule: this.lesson.domTitle.slice(0, 9),
dayModule: this.lesson.domTitle.slice(0, 9), weekName: this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
weekName: this.lesson.domTitle.slice(10, this.lesson.domTitle.length), elementName:
elementName:
this.lesson.domTitle.slice(0, 9) +
"-" +
this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
themeID: this.lesson.themeID,
themeName: this.lesson.themeName,
goodsID: this.lesson.goodsID,
classID: this.lesson.classID
});
let json = {
page_type: 0,
page_id: this.page_id,
stay_time: lookTime
};
subUserLessonApi(
this.elementId,
this.category_id,
this.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
let query = {
periods_id: this.periods_id,
course_type: this.course_type,
parent_category_id: this.parent_category_id,
back_id: this.category_id
};
// console.log(query);
// debugger
this.$router.push({ name: "map", query: query });
});
},
changeTitle(type) {
// if(type==type)
Toast.loading({
mask: true,
message: ""
});
this.nowShow = type;
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
let json = {
page_type: 0,
page_id: this.page_id,
stay_time: lookTime
};
subUserLessonApi(
this.elementId,
this.category_id,
this.periods_id,
json
).then(res => {
Toast.clear();
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
switch (type) {
case 1:
// 神策埋点 板块切换
this.$sa.track("learnPart", {
partName: "爸妈看一看",
elementID: this.lesson.id.toString(),
dayModule: this.lesson.domTitle.slice(0, 9),
weekName: this.lesson.domTitle.slice(
10,
this.lesson.domTitle.length
),
elementName:
this.lesson.domTitle.slice(0, 9) + this.lesson.domTitle.slice(0, 9) +
"-" + "-" +
this.lesson.domTitle.slice(10, this.lesson.domTitle.length), this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
themeID: this.lesson.themeID, themeID: this.lesson.themeID,
themeName: this.lesson.themeName, themeName: this.lesson.themeName,
goodsID: this.lesson.goodsID, goodsID: this.lesson.goodsID,
classID: this.lesson.classID, classID: this.lesson.classID
is_view_today: });
!!new Date().setHours(0, 0, 0, 0) === let json = {
new Date(this.lesson.push_time).setHours(0, 0, 0, 0) page_type: 0,
}); page_id: this.page_id,
this.page_id = 1; stay_time: lookTime
this.nowLesson = { };
type: "text", subUserLessonApi(
title: 1, this.elementId,
partName: "爸妈看一看", this.category_id,
content: this.lesson.content.look, this.periods_id,
age: this.nowLesson.age json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
let query = {
periods_id: this.periods_id,
course_type: this.course_type,
parent_category_id: this.parent_category_id,
back_id: this.category_id
}; };
// debugger // console.log(query);
break; // debugger
case 2: this.$router.push({ name: "map", query: query });
// 神策埋点 板块切换 });
this.$sa.track("learnPart", { },
partName: "宝贝玩一玩", changeTitle(type) {
elementID: this.lesson.id.toString(), // if(type==type)
dayModule: this.lesson.domTitle.slice(0, 9), Toast.loading({
weekName: this.lesson.domTitle.slice( mask: true,
10, message: ""
this.lesson.domTitle.length });
), this.nowShow = type;
elementName: let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
this.lesson.domTitle.slice(0, 9) + let nowTime = Date.parse(new Date());
"-" + let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
this.lesson.domTitle.slice(10, this.lesson.domTitle.length), let json = {
themeID: this.lesson.themeID, page_type: 0,
themeName: this.lesson.themeName, page_id: this.page_id,
goodsID: this.lesson.goodsID, stay_time: lookTime
classID: this.lesson.classID, };
is_view_today: subUserLessonApi(
!!new Date().setHours(0, 0, 0, 0) === this.elementId,
new Date(this.lesson.push_time).setHours(0, 0, 0, 0) this.category_id,
}); this.periods_id,
this.page_id = 2; json
if (this.lesson.content.play.type) { ).then(res => {
Toast.clear();
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
switch (type) {
case 1:
// 神策埋点 板块切换
this.$sa.track("learnPart", {
partName: "爸妈看一看",
elementID: this.lesson.id.toString(),
dayModule: this.lesson.domTitle.slice(0, 9),
weekName: this.lesson.domTitle.slice(
10,
this.lesson.domTitle.length
),
elementName:
this.lesson.domTitle.slice(0, 9) +
"-" +
this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
themeID: this.lesson.themeID,
themeName: this.lesson.themeName,
goodsID: this.lesson.goodsID,
classID: this.lesson.classID,
is_view_today:
!!new Date().setHours(0, 0, 0, 0) ===
new Date(this.lesson.push_time).setHours(0, 0, 0, 0)
});
this.page_id = 1;
this.nowLesson = { this.nowLesson = {
type: "audio", type: "text",
title: 2, title: 1,
partName: "宝贝玩一玩", partName: "爸妈看一看",
content: this.lesson.content.play, content: this.lesson.content.look,
age: this.nowLesson.age age: this.nowLesson.age
}; };
} else { // debugger
this.nowLesson = { break;
type: "video", case 2:
title: 2, // 神策埋点 板块切换
this.$sa.track("learnPart", {
partName: "宝贝玩一玩", partName: "宝贝玩一玩",
content: this.lesson.content.play, elementID: this.lesson.id.toString(),
age: this.nowLesson.age dayModule: this.lesson.domTitle.slice(0, 9),
}; weekName: this.lesson.domTitle.slice(
} 10,
break; this.lesson.domTitle.length
case 3: ),
this.$sa.track("learnPart", { elementName:
partName: "磨磨小耳朵", this.lesson.domTitle.slice(0, 9) +
elementID: this.lesson.id.toString(), "-" +
dayModule: this.lesson.domTitle.slice(0, 9), this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
weekName: this.lesson.domTitle.slice( themeID: this.lesson.themeID,
10, themeName: this.lesson.themeName,
this.lesson.domTitle.length goodsID: this.lesson.goodsID,
), classID: this.lesson.classID,
elementName: is_view_today:
this.lesson.domTitle.slice(0, 9) + !!new Date().setHours(0, 0, 0, 0) ===
"-" + new Date(this.lesson.push_time).setHours(0, 0, 0, 0)
this.lesson.domTitle.slice(10, this.lesson.domTitle.length), });
themeID: this.lesson.themeID, this.page_id = 2;
themeName: this.lesson.themeName, if (this.lesson.content.play.type) {
goodsID: this.lesson.goodsID, this.nowLesson = {
classID: this.lesson.classID, type: "audio",
is_view_today: title: 2,
!!new Date().setHours(0, 0, 0, 0) === partName: "宝贝玩一玩",
new Date(this.lesson.push_time).setHours(0, 0, 0, 0) content: this.lesson.content.play,
}); age: this.nowLesson.age
this.page_id = 5; };
if (this.lesson.content.fun.type) { } else {
this.nowLesson = { this.nowLesson = {
type: "audio", type: "video",
title: 3, title: 2,
partName: "磨磨小耳朵", partName: "宝贝玩一玩",
content: this.lesson.content.fun, content: this.lesson.content.play,
age: this.nowLesson.age age: this.nowLesson.age
}; };
} else { }
this.nowLesson = { break;
type: "video", case 3:
this.$sa.track("learnPart", {
partName: "磨磨小耳朵", partName: "磨磨小耳朵",
title: 3, elementID: this.lesson.id.toString(),
content: this.lesson.content.fun, dayModule: this.lesson.domTitle.slice(0, 9),
age: this.nowLesson.age weekName: this.lesson.domTitle.slice(
}; 10,
} this.lesson.domTitle.length
break; ),
} elementName:
}, this.lesson.domTitle.slice(0, 9) +
countTimeFn(){ "-" +
this.saveTime = setInterval(()=>{ this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
themeID: this.lesson.themeID,
themeName: this.lesson.themeName,
goodsID: this.lesson.goodsID,
classID: this.lesson.classID,
is_view_today:
!!new Date().setHours(0, 0, 0, 0) ===
new Date(this.lesson.push_time).setHours(0, 0, 0, 0)
});
this.page_id = 5;
if (this.lesson.content.fun.type) {
this.nowLesson = {
type: "audio",
title: 3,
partName: "磨磨小耳朵",
content: this.lesson.content.fun,
age: this.nowLesson.age
};
} else {
this.nowLesson = {
type: "video",
partName: "磨磨小耳朵",
title: 3,
content: this.lesson.content.fun,
age: this.nowLesson.age
};
}
break;
}
},
countTimeFn(){
this.saveTime = setInterval(()=>{
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")); let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date()); let nowTime = Date.parse(new Date());
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
...@@ -408,290 +417,185 @@ export default { ...@@ -408,290 +417,185 @@ export default {
stay_time: lookTime stay_time: lookTime
}; };
subUserLessonApi( subUserLessonApi(
this.elementId, this.elementId,
this.category_id, this.category_id,
this.periods_id, this.periods_id,
json json
).then(res => { ).then(res => {
Toast.clear(); Toast.clear();
lessonDetail.total_watch_time = res.total_watch_time; lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime; lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num; lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
},120000)
// debugger
this.$store.dispatch('setTimeout',this.saveTime)
},
initPage() {
Toast.loading({
mask: true,
message: ""
}); });
},120000) this.parent_category_id = this.$route.query.parent_category_id;
// debugger this.course_type = this.$route.query.course_type;
this.$store.dispatch('setTimeout',this.saveTime) this.countTimeFn()
}, // this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
initPage() { // debugger
Toast.loading({ getUserWatchApi({category_id:this.category_id}).then(res => {
mask: true, this.watchDetail = res;
message: "" this.$store.dispatch("setWatchDetail", this.watchDetail);
}); this.userDetail = JSON.parse(localStorage.getItem("userDesc"));
this.parent_category_id = this.$route.query.parent_category_id; this.minute = (res.stay_time / 60).toFixed();
this.course_type = this.$route.query.course_type; // this.minute = (360/60).toFixed()
this.countTimeFn() if (this.minute < 1) {
this.lesson = JSON.parse(localStorage.getItem("lessonDetail")); this.minute = 1;
// debugger }
getUserWatchApi({category_id:this.category_id}).then(res => { // this.minute<1?1:1
this.watchDetail = res; if (this.minute < 8) {
this.$store.dispatch("setWatchDetail", this.watchDetail); if (this.minute < 5) {
this.userDetail = JSON.parse(localStorage.getItem("userDesc")); this.percent = 75 + Math.floor(49 * Math.random()) / 10;
this.minute = (res.stay_time / 60).toFixed();
// this.minute = (360/60).toFixed()
if (this.minute < 1) {
this.minute = 1;
}
// this.minute<1?1:1
if (this.minute < 8) {
if (this.minute < 5) {
this.percent = 75 + Math.floor(49 * Math.random()) / 10;
} else {
this.percent = 81 + Math.floor(89 * Math.random()) / 10;
}
} else if (this.minute <= 12) {
this.percent = 91 + Math.floor(39 * Math.random()) / 10;
} else { } else {
this.percent = 96 + Math.floor(39 * Math.random()) / 10; this.percent = 81 + Math.floor(89 * Math.random()) / 10;
} }
Toast.clear(); } else if (this.minute <= 12) {
let obj = { this.percent = 91 + Math.floor(39 * Math.random()) / 10;
user_id: this.userDetail.user_id, } else {
minute: this.minute, this.percent = 96 + Math.floor(39 * Math.random()) / 10;
percent: this.percent, }
title: this.lesson.title, Toast.clear();
domTitle: this.lesson.domTitle let obj = {
}; user_id: this.userDetail.user_id,
let URL = minute: this.minute,
percent: this.percent,
title: this.lesson.title,
domTitle: this.lesson.domTitle
};
let URL =
process.env.API_URL + process.env.API_URL +
"#/shareGoods?info=" + "#/shareGoods?info=" +
encodeURIComponent(JSON.stringify(obj)); encodeURIComponent(JSON.stringify(obj));
this.onShare(URL); this.onShare(URL);
// this.onShare(URL); // this.onShare(URL);
this.nowShow = 1; this.nowShow = 1;
document.title = `${this.lesson.domTitle}`; document.title = `${this.lesson.domTitle}`;
this.nowLesson = { this.nowLesson = {
type: "text", type: "text",
partName: "爸妈看一看", partName: "爸妈看一看",
title: 1, title: 1,
content: this.lesson.content.look, content: this.lesson.content.look,
age: this.nowLesson.age age: this.nowLesson.age
}; };
let json = { let json = {
page_type: 0, page_type: 0,
page_id: 1, page_id: 1,
stay_time: 1 stay_time: 1
}; };
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")); let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date()); let nowTime = Date.parse(new Date());
subUserLessonApi( subUserLessonApi(
this.elementId, this.elementId,
this.category_id, this.category_id,
this.periods_id, this.periods_id,
json json
).then(res => { ).then(res => {
// console.log(493,res) // console.log(493,res)
lessonDetail.total_watch_time = res.total_watch_time; lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime; lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num; lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
Toast.clear(); Toast.clear();
}); });
this.$sa.track("learnPart", { this.$sa.track("learnPart", {
partName: "爸妈看一看", partName: "爸妈看一看",
elementID: this.lesson.id.toString(), elementID: this.lesson.id.toString(),
dayModule: this.lesson.domTitle.slice(0, 9), dayModule: this.lesson.domTitle.slice(0, 9),
weekName: this.lesson.domTitle.slice(10, this.lesson.domTitle.length), weekName: this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
elementName: elementName:
this.lesson.domTitle.slice(0, 9) + this.lesson.domTitle.slice(0, 9) +
"-" + "-" +
this.lesson.domTitle.slice(10, this.lesson.domTitle.length), this.lesson.domTitle.slice(10, this.lesson.domTitle.length),
themeID: this.lesson.themeID, themeID: this.lesson.themeID,
themeName: this.lesson.themeName, themeName: this.lesson.themeName,
goodsID: this.lesson.goodsID, goodsID: this.lesson.goodsID,
classID: this.lesson.classID, classID: this.lesson.classID,
is_view_today: is_view_today:
!!new Date().setHours(0, 0, 0, 0) === !!new Date().setHours(0, 0, 0, 0) ===
new Date(this.lesson.push_time).setHours(0, 0, 0, 0) new Date(this.lesson.push_time).setHours(0, 0, 0, 0)
});
if (
this.lesson.content.play.video.length < 1 &&
this.lesson.content.play.audio.length < 1
) {
this.nowLesson.old = true;
}
}); });
if ( }
this.lesson.content.play.video.length < 1 &&
this.lesson.content.play.audio.length < 1
) {
this.nowLesson.old = true;
}
});
} }
} };
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.lessonHeader {
background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/lessonHeader3.png?v=2")
no-repeat;
background-size: 102 * @toVw 334 * @toVw;
display: inline-block;
}
.header-h {
display: none;
}
.home {
height: 46 * @toVw;
width: 46 * @toVw;
background-position: 0 0;
}
.play {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -46 * @toVw;
}
.look {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -94 * @toVw;
}
.fun {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -142 * @toVw;
}
.defaultFun {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -190 * @toVw;
}
.defaultLook {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -238 * @toVw;
}
.defaultPlay {
height: 48 * @toVw;
width: 102 * @toVw;
background-position: 0 -286 * @toVw;
}
.header {
display: flex;
display: -webkit-flex;
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 5 * @toVw 0;
z-index: 2;
background: rgba(255, 255, 255, 1);
box-shadow: 0 * @toVw 2 * @toVw 3 * @toVw 0 * @toVw rgba(0, 0, 0, 0.1);
}
.newLesson {
background: #f8f8f8;
}
.backImg {
position: fixed;
bottom: 40 * @toVw;
right: 20 * @toVw;
z-index: 99999999;
width: 60 * @toVw;
}
@media screen and (orientation: landscape) {
@toVw: 100/667vw;
.backImg {
position: fixed;
bottom: 40 * @toVw;
right: 20 * @toVw;
z-index: 99999999;
width: 60 * @toVw;
}
.lessonHeader { .lessonHeader {
display: none; background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/lessonHeader3.png?v=2")
no-repeat;
background-size: 102 * @toVw 334 * @toVw;
display: inline-block;
} }
.header { .header-h {
display: none; display: none;
} }
.actBanKuai {
background-color: white;
border: 1 * @toVw solid transparent;
border-left-color: black;
border-top-color: black;
border-bottom-color: black;
border-radius: 8 * @toVw 0 0 8 * @toVw;
}
.headerHP {
background-size: 62 * @toVw 434 * @toVw;
display: inline-block;
}
.home { .home {
height: 62 * @toVw; height: 46 * @toVw;
width: 62 * @toVw; width: 46 * @toVw;
background-position: 0 0; background-position: 0 0;
} }
.lookHP { .play {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -62 * @toVw; background-position: 0 -46 * @toVw;
.actBanKuai;
} }
.playHP { .look {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -124 * @toVw; background-position: 0 -94 * @toVw;
.actBanKuai;
} }
.funHP { .fun {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -186 * @toVw; background-position: 0 -142 * @toVw;
.actBanKuai;
} }
.defaultFun { .defaultFun {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -248 * @toVw; background-position: 0 -190 * @toVw;
} }
.defaultLook { .defaultLook {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -310 * @toVw; background-position: 0 -238 * @toVw;
} }
.defaultPlay { .defaultPlay {
height: 62 * @toVw; height: 48 * @toVw;
width: 62 * @toVw; width: 102 * @toVw;
background-position: 0 -372 * @toVw; background-position: 0 -286 * @toVw;
} }
.header-h { .header {
display: block; display: flex;
width: 62 * @toVw; display: -webkit-flex;
position: absolute; position: absolute;
left: 17.5 * @toVw; top: 0;
top: 20 * @toVw; left: 0;
width: 100%;
padding: 5 * @toVw 0;
z-index: 2; z-index: 2;
.headerHP { background: rgba(255, 255, 255, 1);
display: block; box-shadow: 0 * @toVw 2 * @toVw 3 * @toVw 0 * @toVw rgba(0, 0, 0, 0.1);
img {
width: 42 * @toVw;
margin-left: 10 * @toVw;
margin-top: 5 * @toVw;
}
}
} }
.index-content-block { .newLesson {
position: absolute; background: #f8f8f8;
top: 20 * @toVw;
left: 80 * @toVw;
right: 20 * @toVw;
bottom: 20 * @toVw;
background: white;
border: 1 * @toVw solid #000;
border-radius: 0 8 * @toVw 8 * @toVw 8 * @toVw;
&.radius {
border-radius: 8 * @toVw;
}
} }
}
@media screen and (min-aspect-ratio: ~"20/8") {
@toVw: 100/900vw;
.backImg { .backImg {
position: fixed; position: fixed;
bottom: 40 * @toVw; bottom: 40 * @toVw;
...@@ -699,93 +603,197 @@ export default { ...@@ -699,93 +603,197 @@ export default {
z-index: 99999999; z-index: 99999999;
width: 60 * @toVw; width: 60 * @toVw;
} }
.lessonHeader {
display: none; @media screen and (orientation: landscape) {
} @toVw: 100/667vw;
.header { .backImg {
display: none; position: fixed;
} bottom: 40 * @toVw;
.actBanKuai { right: 20 * @toVw;
background-color: white; z-index: 99999999;
border: 1 * @toVw solid transparent; width: 60 * @toVw;
border-left-color: black; }
border-top-color: black; .lessonHeader {
border-bottom-color: black; display: none;
border-radius: 8 * @toVw 0 0 8 * @toVw; }
} .header {
.headerHP { display: none;
// background:url('https://static-cdn.changchangenglish.com/new-sing/static/images/index-h.png?v=2') no-repeat; }
background-size: 62 * @toVw 434 * @toVw; .actBanKuai {
display: inline-block; background-color: white;
&.lookHP { border: 1 * @toVw solid transparent;
border-left-color: black;
border-top-color: black;
border-bottom-color: black;
border-radius: 8 * @toVw 0 0 8 * @toVw;
}
.headerHP {
background-size: 62 * @toVw 434 * @toVw;
display: inline-block;
}
.home {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 0; background-position: 0 0;
.actBanKuai;
} }
&.defaultPlay { .lookHP {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -62 * @toVw; background-position: 0 -62 * @toVw;
.actBanKuai;
} }
&.playHP { .playHP {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -124 * @toVw; background-position: 0 -124 * @toVw;
.actBanKuai; .actBanKuai;
} }
&.defaultLook { .funHP {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -186 * @toVw; background-position: 0 -186 * @toVw;
.actBanKuai;
} }
&.home { .defaultFun {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -248 * @toVw; background-position: 0 -248 * @toVw;
} }
&.defaultFun { .defaultLook {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -310 * @toVw; background-position: 0 -310 * @toVw;
} }
&.funHP { .defaultPlay {
height: 62 * @toVw; height: 62 * @toVw;
width: 62 * @toVw; width: 62 * @toVw;
background-position: 0 -372 * @toVw; background-position: 0 -372 * @toVw;
.actBanKuai; }
.header-h {
display: block;
width: 62 * @toVw;
position: absolute;
left: 17.5 * @toVw;
top: 20 * @toVw;
z-index: 2;
.headerHP {
display: block;
img {
width: 42 * @toVw;
margin-left: 10 * @toVw;
margin-top: 5 * @toVw;
}
}
}
.index-content-block {
position: absolute;
top: 20 * @toVw;
left: 80 * @toVw;
right: 20 * @toVw;
bottom: 20 * @toVw;
background: white;
border: 1 * @toVw solid #000;
border-radius: 0 8 * @toVw 8 * @toVw 8 * @toVw;
&.radius {
border-radius: 8 * @toVw;
}
} }
} }
@media screen and (min-aspect-ratio: ~"20/8") {
.header-h { @toVw: 100/900vw;
display: block; .backImg {
width: 62 * @toVw; position: fixed;
position: absolute; bottom: 40 * @toVw;
left: 17.5 * @toVw; right: 20 * @toVw;
top: 20 * @toVw; z-index: 99999999;
z-index: 2; width: 60 * @toVw;
}
.lessonHeader {
display: none;
}
.header {
display: none;
}
.actBanKuai {
background-color: white;
border: 1 * @toVw solid transparent;
border-left-color: black;
border-top-color: black;
border-bottom-color: black;
border-radius: 8 * @toVw 0 0 8 * @toVw;
}
.headerHP { .headerHP {
// background:url('https://static-cdn.changchangenglish.com/new-sing/static/images/index-h.png?v=2') no-repeat;
background-size: 62 * @toVw 434 * @toVw;
display: inline-block;
&.lookHP {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 0;
.actBanKuai;
}
&.defaultPlay {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -62 * @toVw;
}
&.playHP {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -124 * @toVw;
.actBanKuai;
}
&.defaultLook {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -186 * @toVw;
}
&.home {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -248 * @toVw;
}
&.defaultFun {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -310 * @toVw;
}
&.funHP {
height: 62 * @toVw;
width: 62 * @toVw;
background-position: 0 -372 * @toVw;
.actBanKuai;
}
}
.header-h {
display: block; display: block;
img { width: 62 * @toVw;
width: 42 * @toVw; position: absolute;
margin-left: 10 * @toVw; left: 17.5 * @toVw;
margin-top: 5 * @toVw; top: 20 * @toVw;
z-index: 2;
.headerHP {
display: block;
img {
width: 42 * @toVw;
margin-left: 10 * @toVw;
margin-top: 5 * @toVw;
}
} }
} }
} .index-content-block {
.index-content-block { position: absolute;
position: absolute; top: 20 * @toVw;
top: 20 * @toVw; left: 80 * @toVw;
left: 80 * @toVw; right: 20 * @toVw;
right: 20 * @toVw; bottom: 20 * @toVw;
bottom: 20 * @toVw; background: white;
background: white; border: 1 * @toVw solid #000;
border: 1 * @toVw solid #000; border-radius: 0 8 * @toVw 8 * @toVw 8 * @toVw;
border-radius: 0 8 * @toVw 8 * @toVw 8 * @toVw; &.radius {
&.radius { border-radius: 8 * @toVw;
border-radius: 8 * @toVw; }
} }
} }
}
</style> </style>
...@@ -2,10 +2,21 @@ ...@@ -2,10 +2,21 @@
<div class='box'> <div class='box'>
<div class="share-page" id="capture"> <div class="share-page" id="capture">
<div class="share-block"> <div class="share-block">
<div class="content" v-if="userDetail" ref="imageWrapper"> <div class="content" v-if="userDetail" ref="imageWrapper"> <!-- v-if="userDetail" -->
<img :src="img_logo" class="imgLogo" /> <img :src="img_logo" class="imgLogo" />
<div class="main-content"> <div class="main-content">
<div class="topBox"> <div class="topBox">
<div v-if="starNum == 3">
<div class="diyikexing animated">
<img :src="diyikexing" alt="">
</div>
<div class="dierkexing animated1">
<img :src="dierkexing" alt="">
</div>
<div class="dierkexing1 animated2">
<img :src="diyikexing" alt="">
</div>
</div>
<img class="shareTitle" :src="shareTitle" /> <img class="shareTitle" :src="shareTitle" />
<div class="head-block"> <div class="head-block">
<img :src="userDetail.avatar" /> <img :src="userDetail.avatar" />
...@@ -107,603 +118,609 @@ ...@@ -107,603 +118,609 @@
</template> </template>
<script> <script>
import { Toast } from "vant"; import { Toast } from "vant";
import shareBg from "../../assets/newLesson/shareBg.png"; import shareBg from "../../assets/newLesson/shareBg.png";
import shareTitle from "../../assets/newLesson/img_title.png"; import shareTitle from "../../assets/newLesson/img_title.png";
import share_close from "../../assets/newLesson/share_close.png"; import share_close from "../../assets/newLesson/share_close.png";
import icon_baby from "../../assets/newLesson/icon_baby.png"; import icon_baby from "../../assets/newLesson/icon_baby.png";
import icon_day from "../../assets/newLesson/icon_day.png"; import icon_day from "../../assets/newLesson/icon_day.png";
import icon_min from "../../assets/newLesson/icon_min.png"; import icon_min from "../../assets/newLesson/icon_min.png";
import img_link from "../../assets/newLesson/img_link.png"; import img_link from "../../assets/newLesson/img_link.png";
import good from "../../assets/newLesson/good.png"; import good from "../../assets/newLesson/good.png";
import great from "../../assets/newLesson/great.png"; import great from "../../assets/newLesson/great.png";
import perfect from "../../assets/newLesson/perfect.png"; import perfect from "../../assets/newLesson/perfect.png";
import icon_change from "../../assets/newLesson/icon_change@2x.png"; import icon_change from "../../assets/newLesson/icon_change@2x.png";
import icon_right from "../../assets/newLesson/icon_right@2x.png"; import icon_right from "../../assets/newLesson/icon_right@2x.png";
import img_monkey from "../../assets/newLesson/img_monkey@2x.png"; import img_monkey from "../../assets/newLesson/img_monkey@2x.png";
import img_tip from "../../assets/newLesson/img_tip@2x.png"; import img_tip from "../../assets/newLesson/img_tip@2x.png";
import QRCode from "qrcodejs2"; import dierkexing from "../../assets/evaluate/dierkexing.png";
import html2canvas from "html2canvas"; import diyikexing from "../../assets/evaluate/diyikexing.png";
import { import QRCode from "qrcodejs2";
getwechatParam, import html2canvas from "html2canvas";
getUserWatchApi, import {
getShortApi, getwechatParam,
subUserLessonApi, getUserWatchApi,
postErrorLogApi getShortApi,
} from "../../service/api"; subUserLessonApi,
import share_code_bg from "../../assets/newLesson/share-code-bg.png"; postErrorLogApi
import img_logo from "../../assets/newLesson/logo@2x.png"; } from "../../service/api";
import share_tips from "../../assets/Bitmap@2x.png"; import share_code_bg from "../../assets/newLesson/share-code-bg.png";
import img_logo from "../../assets/newLesson/logo@2x.png";
import share_tips from "../../assets/Bitmap@2x.png";
export default { export default {
name: "share", name: "share",
data() { data() {
return { return {
img_monkey: img_monkey, img_monkey: img_monkey,
img_tip: img_tip, img_tip: img_tip,
oimgPoint: false, oimgPoint: false,
canvasData: "", canvasData: "",
QRCodeB: "", QRCodeB: "",
img_link: img_link, img_link: img_link,
shareVisible: false, shareVisible: false,
shareBg: shareBg, shareBg: shareBg,
share_close: share_close, share_close: share_close,
share_tips: share_tips, share_tips: share_tips,
shareTitle: shareTitle, shareTitle: shareTitle,
icon_baby: icon_baby, icon_baby: icon_baby,
icon_day: icon_day, icon_day: icon_day,
icon_min: icon_min, icon_min: icon_min,
userDetail: null, userDetail: null,
dataURL: null, dataURL: null,
watchDetail: null, watchDetail: null,
share_code_bg: share_code_bg, share_code_bg: share_code_bg,
lesson: {}, lesson: {},
domTitle: "", domTitle: "",
imgPoint: good, imgPoint: good,
minute: "", minute: "",
percent: 0, percent: 0,
saveTime: "", saveTime: "",
lastTime: "", lastTime: "",
icon_change: icon_change, icon_change: icon_change,
textIndex: 1, textIndex: 1,
textContent: "", textContent: "",
htmlContent: "", htmlContent: "",
icon_right: icon_right, icon_right: icon_right,
timeout: "", timeout: "",
nickname: "", nickname: "",
img_logo: img_logo, img_logo: img_logo,
animationBg:false animationBg:false,
}; dierkexing: dierkexing, // 三颗星第一第三颗
}, diyikexing: diyikexing, // 第二课星
props: ["contentData"], starNum: 0
mounted() { };
// console.log(this.contentData) },
Toast.loading({ props: ["contentData"],
mask: true, mounted() {
message: "", this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num
duration: 300 Toast.loading({
}); mask: true,
this.initPage(); message: "",
}, duration: 300
beforeDestroy() { });
console.log(Date.parse(new Date()) - this.lastTime); this.initPage();
this.lesson.nowTime += Date.parse(new Date()) - this.lastTime; },
localStorage.setItem("lessonDetail", JSON.stringify(this.lesson)); beforeDestroy() {
console.log(this.lesson.nowTime); console.log(Date.parse(new Date()) - this.lastTime);
}, this.lesson.nowTime += Date.parse(new Date()) - this.lastTime;
methods: { localStorage.setItem("lessonDetail", JSON.stringify(this.lesson));
touchStart() { console.log(this.lesson.nowTime);
let query = JSON.parse(sessionStorage.getItem("classQuery")); },
this.timeout = setTimeout(() => { methods: {
// postErrorLogApi({'routes_url':new Date().toString(),'result_text':this.userDetail.user_id}).then((res)=>{ touchStart() {
// console.log(res) let query = JSON.parse(sessionStorage.getItem("classQuery"));
// }) this.timeout = setTimeout(() => {
// minute
postErrorLogApi({'routes_url':new Date().toString(),'result_text':this.userDetail.user_id}).then((res)=>{
console.log(res)
})
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "完成分享",
partName: this.contentData.partName,
elementID: query.elementId.toString()
});
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date());
let json = {
page_type: 0,
page_id: 4,
stay_time: 0
};
subUserLessonApi(
query.elementId,
query.category_id,
query.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
});
}, 800);
},
touchEnd() {
clearInterval(this.timeout);
},
copyText() {
this.$sa.track("buttonClick", {
tabTitle: "打卡商品页",
moduleTitle: "功能按钮",
buttonType: "按钮点击",
buttonName: "复制心得"
});
this.$copyText(this.textContent).then(e => {
Toast("复制成功");
});
},
changeText() {
if (this.textIndex == 1) {
this.textContent = `我是${this.userDetail.nickname},我家宝宝正在唱唱启蒙英语学习,已坚持${this.watchDetail.total_day}天啦,宝宝的英语一天比一天有进步了,成就感满满,继续坚持[拳头]~`;
this.textIndex = 2;
} else if (this.textIndex == 2) {
this.textContent = `陪宝宝在唱唱启蒙英语学习的第${this.watchDetail.total_day}天,宝宝又学会了一首新童谣《${this.lesson.title}》,每天都有新收获,坚持就是胜利,练就英语小神童[胜利]`;
this.textIndex = 3;
} else {
this.textContent = `我是${this.userDetail.nickname},我正在参加唱唱启蒙英语👉【${this.lesson.course_title}】打卡活动,打卡第${this.watchDetail.total_day}天,我坚持,我最棒[强]!`;
this.textIndex = 1;
}
},
showShare() {
this.shareVisible = true;
// this.$refs.audioDom.play()
this.playAudio();
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName, themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "完成分享", buttonName: "分享到微信",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: query.elementId.toString() elementID: this.$route.query.elementId.toString()
});
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
let nowTime = Date.parse(new Date());
let json = {
page_type: 0,
page_id: 4,
stay_time: 0
};
subUserLessonApi(
query.elementId,
query.category_id,
query.periods_id,
json
).then(res => {
lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
}); });
}, 800); },
}, initPage() {
touchEnd() { this.watchDetail = this.$store.state.watchDetail;
clearInterval(this.timeout); // debugger
}, this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
copyText() { this.lesson.domTitle = this.lesson.domTitle.substring(0, 9);
this.$sa.track("buttonClick", { console.log(this.watchDetail, 170);
tabTitle: "打卡商品页", console.log(this.lesson);
moduleTitle: "功能按钮", this.lastTime = Date.parse(new Date());
buttonType: "按钮点击", clearInterval(this.$store.state.timeout);
buttonName: "复制心得" this.userDetail = JSON.parse(localStorage.getItem("userDesc"));
}); this.nickname = this.userDetail.nickname;
this.$copyText(this.textContent).then(e => { if (this.nickname.length >= 6) {
Toast("复制成功"); this.nickname = this.nickname.slice(0, 4) + "...";
});
},
changeText() {
if (this.textIndex == 1) {
this.textContent = `我是${this.userDetail.nickname},我家宝宝正在唱唱启蒙英语学习,已坚持${this.watchDetail.total_day}天啦,宝宝的英语一天比一天有进步了,成就感满满,继续坚持[拳头]~`;
this.textIndex = 2;
} else if (this.textIndex == 2) {
this.textContent = `陪宝宝在唱唱启蒙英语学习的第${this.watchDetail.total_day}天,宝宝又学会了一首新童谣《${this.lesson.title}》,每天都有新收获,坚持就是胜利,练就英语小神童[胜利]`;
this.textIndex = 3;
} else {
this.textContent = `我是${this.userDetail.nickname},我正在参加唱唱启蒙英语👉【${this.lesson.course_title}】打卡活动,打卡第${this.watchDetail.total_day}天,我坚持,我最棒[强]!`;
this.textIndex = 1;
}
},
showShare() {
this.shareVisible = true;
// this.$refs.audioDom.play()
this.playAudio();
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "分享到微信",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
},
initPage() {
this.watchDetail = this.$store.state.watchDetail;
// debugger
this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
this.lesson.domTitle = this.lesson.domTitle.substring(0, 9);
console.log(this.watchDetail, 170);
console.log(this.lesson);
this.lastTime = Date.parse(new Date());
clearInterval(this.$store.state.timeout);
this.userDetail = JSON.parse(localStorage.getItem("userDesc"));
this.nickname = this.userDetail.nickname;
if (this.nickname.length >= 6) {
this.nickname = this.nickname.slice(0, 4) + "...";
}
this.minute = (this.watchDetail.stay_time / 60).toFixed();
// this.minute = (600/60).toFixed()
if (this.minute < 1) {
this.minute = 1;
}
// this.minute<1?1:1
if (this.minute < 8) {
this.imgPoint = good;
this.$store.dispatch("setLookStatus", 0);
if (this.minute < 5) {
this.percent = 75 + Math.floor(49 * Math.random()) / 10;
} else {
this.percent = 81 + Math.floor(89 * Math.random()) / 10;
} }
} else if (this.minute <= 12) { this.minute = (this.watchDetail.stay_time / 60).toFixed();
this.$store.dispatch("setLookStatus", 1); // this.minute = (600/60).toFixed()
this.percent = 91 + Math.floor(39 * Math.random()) / 10; if (this.minute < 1) {
this.imgPoint = great; this.minute = 1;
} else {
this.$store.dispatch("setLookStatus", 2);
console.log(Math.floor(39 * Math.random()));
this.percent = 96 + Math.floor(39 * Math.random()) / 10;
this.imgPoint = perfect;
}
// Toast.clear();
let query = JSON.parse(sessionStorage.getItem("classQuery"));
let obj = {
user_id: this.userDetail.user_id,
minute: this.minute,
percent: this.percent,
title: this.lesson.title,
domTitle: this.lesson.domTitle,
category_id: query.category_id
};
let URL = `${process.env.API_URL}#/navShare?invite_code=CC-UDK-${this.userDetail.user_id}`;
// let URL =
// 'https://wechat.changchangenglish.com/' +
// "#/shareGoods?info=" +
// encodeURIComponent(JSON.stringify(obj));
console.log(URL);
this.onShare(URL);
this.toDataURLBase64(
this.userDetail.avatar.replace("http://", "https://"),
avatar => {
this.toDataURLBase64(this.shareConBg, cal => {
this.shareConBg = cal;
this.userDetail.avatar = avatar;
this.$nextTick(() => {
// this.$refs.share_image.initPage();
});
});
} }
); // this.minute<1?1:1
this.textContent = `我是${this.userDetail.nickname},我正在参加唱唱启蒙英语【${this.lesson.course_title}】打卡活动,打卡第${this.watchDetail.total_day}天,我坚持,我最棒[强]!`; if (this.minute < 8) {
this.qrcode(URL); this.imgPoint = good;
let that = this; this.$store.dispatch("setLookStatus", 0);
setTimeout(() => { if (this.minute < 5) {
this.oimgPoint = true; this.percent = 75 + Math.floor(49 * Math.random()) / 10;
}, 900); } else {
setTimeout(() => { this.percent = 81 + Math.floor(89 * Math.random()) / 10;
that.$nextTick(() => {
if (document.getElementById("capture")) {
html2canvas(document.getElementById("capture"), {
async: true,
scrollX: 0,
scale: 2,
letterRendering: true,
useCORS: true,
logging: true
})
.then(canvas => {
setTimeout(() => {
this.animationBg = true;
},500)
let dataURL = canvas.toDataURL("image/jpg", 1.0);
this.canvasData = dataURL;
})
.catch(res => {
alert(res);
console.log();
});
} }
}); } else if (this.minute <= 12) {
}, 1200); this.$store.dispatch("setLookStatus", 1);
}, this.percent = 91 + Math.floor(39 * Math.random()) / 10;
enableShare: function(option) { this.imgPoint = great;
let query = JSON.parse(sessionStorage.getItem("classQuery")); } else {
let that = this; this.$store.dispatch("setLookStatus", 2);
getwechatParam({ console.log(Math.floor(39 * Math.random()));
api_list: "onMenuShareAppMessage,onMenuShareTimeline", this.percent = 96 + Math.floor(39 * Math.random()) / 10;
url: window.location.href.split("#")[0] this.imgPoint = perfect;
}).then(wechatRes => { }
wx.config({ // Toast.clear();
debug: false, let query = JSON.parse(sessionStorage.getItem("classQuery"));
appId: wechatRes.appId, let obj = {
timestamp: parseInt(wechatRes.timestamp), user_id: this.userDetail.user_id,
nonceStr: wechatRes.nonceStr, minute: this.minute,
signature: wechatRes.signature, percent: this.percent,
jsApiList: wechatRes.jsApiList title: this.lesson.title,
}); domTitle: this.lesson.domTitle,
wx.ready(function() { category_id: query.category_id
wx.onMenuShareTimeline({ };
title: option.product_title, // 分享标题 let URL = `${process.env.API_URL}#/navShare?invite_code=CC-UDK-${this.userDetail.user_id}`;
desc: option.desc, // 分享描述 // let URL =
link: option.shareUrl, // 分享链接 // 'https://wechat.changchangenglish.com/' +
imgUrl: // "#/shareGoods?info=" +
option.shareIcon || // encodeURIComponent(JSON.stringify(obj));
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标 console.log(URL);
success: function() { this.onShare(URL);
// setTimeout(() => { this.toDataURLBase64(
// that.$sa.track("watchClick", { this.userDetail.avatar.replace("http://", "https://"),
// dayModule: JSON.parse( avatar => {
// localStorage.getItem("lessonDetail") this.toDataURLBase64(this.shareConBg, cal => {
// ).domTitle.slice(0, 9), this.shareConBg = cal;
// weekName: JSON.parse( this.userDetail.avatar = avatar;
// localStorage.getItem("lessonDetail") this.$nextTick(() => {
// ).domTitle.slice( // this.$refs.share_image.initPage();
// 10, });
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// .length
// ),
// elementName:
// JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(0, 9) +
// "-" +
// JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(
// 10,
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// .length
// ),
// themeID: JSON.parse(localStorage.getItem("lessonDetail"))
// .themeID,
// themeName: JSON.parse(localStorage.getItem("lessonDetail"))
// .themeName,
// goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
// .goodsID,
// classID: JSON.parse(localStorage.getItem("lessonDetail"))
// .classID,
// buttonName: "完成分享",
// partName: that.contentData.partName,
// elementID: query.elementId.toString()
// });
// let lessonDetail = JSON.parse(
// localStorage.getItem("lessonDetail")
// );
// let nowTime = Date.parse(new Date());
// let json = {
// page_type: 0,
// page_id: 4,
// stay_time: 0
// };
// subUserLessonApi(
// query.elementId,
// query.category_id,
// query.periods_id,
// json
// ).then(res => {
// lessonDetail.total_watch_time = res;
// lessonDetail.nowTime = nowTime;
// localStorage.setItem(
// "lessonDetail",
// JSON.stringify(lessonDetail)
// );
// });
// that.$emit("backList");
// }, 500);
},
cancel: function() {
that.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle
.length
),
elementName:
JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9) +
"-" +
JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle
.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail"))
.themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
.goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail"))
.classID,
buttonName: "取消分享",
partName: that.contentData.partName,
elementID: query.elementId.toString()
}); });
that.$emit("backList"); }
);
this.textContent = `我是${this.userDetail.nickname},我正在参加唱唱启蒙英语【${this.lesson.course_title}】打卡活动,打卡第${this.watchDetail.total_day}天,我坚持,我最棒[强]!`;
this.qrcode(URL);
let that = this;
setTimeout(() => {
this.oimgPoint = true;
}, 900);
setTimeout(() => {
that.$nextTick(() => {
if (document.getElementById("capture")) {
html2canvas(document.getElementById("capture"), {
async: true,
scrollX: 0,
scale: 2,
letterRendering: true,
useCORS: true,
logging: true
})
.then(canvas => {
setTimeout(() => {
this.animationBg = true;
},500)
let dataURL = canvas.toDataURL("image/jpg", 1.0);
this.canvasData = dataURL;
})
.catch(res => {
alert(res);
console.log();
});
} }
}); });
wx.onMenuShareAppMessage({ }, 1200);
title: option.product_title, // 分享标题 },
desc: option.desc, // 分享描述 enableShare: function(option) {
link: option.shareUrl, // 分享链接 let query = JSON.parse(sessionStorage.getItem("classQuery"));
imgUrl: let that = this;
option.shareIcon || getwechatParam({
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标 api_list: "onMenuShareAppMessage,onMenuShareTimeline",
success: function() { url: window.location.href.split("#")[0]
// that.$sa.track("watchClick", { }).then(wechatRes => {
// dayModule: JSON.parse( wx.config({
// localStorage.getItem("lessonDetail") debug: false,
// ).domTitle.slice(0, 9), appId: wechatRes.appId,
// weekName: JSON.parse( timestamp: parseInt(wechatRes.timestamp),
// localStorage.getItem("lessonDetail") nonceStr: wechatRes.nonceStr,
// ).domTitle.slice( signature: wechatRes.signature,
// 10, jsApiList: wechatRes.jsApiList
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle });
// .length wx.ready(function() {
// ), wx.onMenuShareTimeline({
// elementName: title: option.product_title, // 分享标题
// JSON.parse( desc: option.desc, // 分享描述
// localStorage.getItem("lessonDetail") link: option.shareUrl, // 分享链接
// ).domTitle.slice(0, 9) + imgUrl:
// "-" + option.shareIcon ||
// JSON.parse( "https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
// localStorage.getItem("lessonDetail") success: function() {
// ).domTitle.slice( // setTimeout(() => {
// 10, // that.$sa.track("watchClick", {
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle // dayModule: JSON.parse(
// .length // localStorage.getItem("lessonDetail")
// ), // ).domTitle.slice(0, 9),
// themeID: JSON.parse(localStorage.getItem("lessonDetail")) // weekName: JSON.parse(
// .themeID, // localStorage.getItem("lessonDetail")
// themeName: JSON.parse(localStorage.getItem("lessonDetail")) // ).domTitle.slice(
// .themeName, // 10,
// goodsID: JSON.parse(localStorage.getItem("lessonDetail")) // JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// .goodsID, // .length
// classID: JSON.parse(localStorage.getItem("lessonDetail")) // ),
// .classID, // elementName:
// buttonName: "完成分享", // JSON.parse(
// partName: that.contentData.partName, // localStorage.getItem("lessonDetail")
// elementID: query.elementId.toString() // ).domTitle.slice(0, 9) +
// }); // "-" +
// let lessonDetail = JSON.parse( // JSON.parse(
// localStorage.getItem("lessonDetail") // localStorage.getItem("lessonDetail")
// ); // ).domTitle.slice(
// let nowTime = Date.parse(new Date()); // 10,
// let json = { // JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// page_type: 0, // .length
// page_id: 4, // ),
// stay_time: 0 // themeID: JSON.parse(localStorage.getItem("lessonDetail"))
// }; // .themeID,
// subUserLessonApi( // themeName: JSON.parse(localStorage.getItem("lessonDetail"))
// query.elementId, // .themeName,
// query.category_id, // goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
// query.periods_id, // .goodsID,
// json // classID: JSON.parse(localStorage.getItem("lessonDetail"))
// ).then(res => { // .classID,
// lessonDetail.total_watch_time = res; // buttonName: "完成分享",
// lessonDetail.nowTime = nowTime; // partName: that.contentData.partName,
// localStorage.setItem( // elementID: query.elementId.toString()
// "lessonDetail", // });
// JSON.stringify(lessonDetail) // let lessonDetail = JSON.parse(
// ); // localStorage.getItem("lessonDetail")
// }); // );
// that.$emit("backList"); // let nowTime = Date.parse(new Date());
}, // let json = {
cancel: function() { // page_type: 0,
that.$sa.track("watchClick", { // page_id: 4,
dayModule: JSON.parse( // stay_time: 0
localStorage.getItem("lessonDetail") // };
).domTitle.slice(0, 9), // subUserLessonApi(
weekName: JSON.parse( // query.elementId,
localStorage.getItem("lessonDetail") // query.category_id,
).domTitle.slice( // query.periods_id,
10, // json
JSON.parse(localStorage.getItem("lessonDetail")).domTitle // ).then(res => {
.length // lessonDetail.total_watch_time = res;
), // lessonDetail.nowTime = nowTime;
elementName: // localStorage.setItem(
JSON.parse( // "lessonDetail",
localStorage.getItem("lessonDetail") // JSON.stringify(lessonDetail)
).domTitle.slice(0, 9) + // );
"-" + // });
JSON.parse( // that.$emit("backList");
localStorage.getItem("lessonDetail") // }, 500);
},
cancel: function() {
that.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle JSON.parse(localStorage.getItem("lessonDetail")).domTitle
.length .length
), ),
themeID: JSON.parse(localStorage.getItem("lessonDetail")) elementName:
.themeID, JSON.parse(
themeName: JSON.parse(localStorage.getItem("lessonDetail")) localStorage.getItem("lessonDetail")
.themeName, ).domTitle.slice(0, 9) +
goodsID: JSON.parse(localStorage.getItem("lessonDetail")) "-" +
.goodsID, JSON.parse(
classID: JSON.parse(localStorage.getItem("lessonDetail")) localStorage.getItem("lessonDetail")
.classID, ).domTitle.slice(
buttonName: "取消分享", 10,
partName: that.contentData.partName, JSON.parse(localStorage.getItem("lessonDetail")).domTitle
elementID: query.elementId.toString() .length
}); ),
} themeID: JSON.parse(localStorage.getItem("lessonDetail"))
.themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
.goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail"))
.classID,
buttonName: "取消分享",
partName: that.contentData.partName,
elementID: query.elementId.toString()
});
that.$emit("backList");
}
});
wx.onMenuShareAppMessage({
title: option.product_title, // 分享标题
desc: option.desc, // 分享描述
link: option.shareUrl, // 分享链接
imgUrl:
option.shareIcon ||
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
// that.$sa.track("watchClick", {
// dayModule: JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(0, 9),
// weekName: JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(
// 10,
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// .length
// ),
// elementName:
// JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(0, 9) +
// "-" +
// JSON.parse(
// localStorage.getItem("lessonDetail")
// ).domTitle.slice(
// 10,
// JSON.parse(localStorage.getItem("lessonDetail")).domTitle
// .length
// ),
// themeID: JSON.parse(localStorage.getItem("lessonDetail"))
// .themeID,
// themeName: JSON.parse(localStorage.getItem("lessonDetail"))
// .themeName,
// goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
// .goodsID,
// classID: JSON.parse(localStorage.getItem("lessonDetail"))
// .classID,
// buttonName: "完成分享",
// partName: that.contentData.partName,
// elementID: query.elementId.toString()
// });
// let lessonDetail = JSON.parse(
// localStorage.getItem("lessonDetail")
// );
// let nowTime = Date.parse(new Date());
// let json = {
// page_type: 0,
// page_id: 4,
// stay_time: 0
// };
// subUserLessonApi(
// query.elementId,
// query.category_id,
// query.periods_id,
// json
// ).then(res => {
// lessonDetail.total_watch_time = res;
// lessonDetail.nowTime = nowTime;
// localStorage.setItem(
// "lessonDetail",
// JSON.stringify(lessonDetail)
// );
// });
// that.$emit("backList");
},
cancel: function() {
that.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle
.length
),
elementName:
JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9) +
"-" +
JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle
.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail"))
.themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail"))
.themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail"))
.goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail"))
.classID,
buttonName: "取消分享",
partName: that.contentData.partName,
elementID: query.elementId.toString()
});
}
});
}); });
}); });
}); },
}, onShare(URL) {
onShare(URL) { console.log(451);
console.log(451); if (this.watchDetail && this.watchDetail.total_day) {
if (this.watchDetail && this.watchDetail.total_day) { this.enableShare({
this.enableShare({ product_title: `我家宝宝正在【唱唱启蒙英语】唱学英语,已坚持${this.watchDetail.total_day}天`, // 分享标题
product_title: `我家宝宝正在【唱唱启蒙英语】唱学英语,已坚持${this.watchDetail.total_day}天`, // 分享标题 desc:
desc: JSON.parse(localStorage.getItem("userDesc")).nickname +
JSON.parse(localStorage.getItem("userDesc")).nickname + `赠您【领取超值课程】特权,来唱唱和百万家庭一起快乐启蒙英语吧!`, //
`赠您【领取超值课程】特权,来唱唱和百万家庭一起快乐启蒙英语吧!`, // shareIcon:
shareIcon: process.env.IMAGE_URL_HEAD +
process.env.IMAGE_URL_HEAD + "new-sing/number_Day" +
"new-sing/number_Day" + this.watchDetail.total_day +
this.watchDetail.total_day + ".jpg",
".jpg", shareUrl: URL
shareUrl: URL });
}); }
} },
}, toDataURLBase64(src, callback) {
toDataURLBase64(src, callback) { let xhttp = new XMLHttpRequest();
let xhttp = new XMLHttpRequest(); xhttp.onload = function() {
xhttp.onload = function() { let fileReader = new FileReader();
let fileReader = new FileReader(); fileReader.onloadend = function() {
fileReader.onloadend = function() { callback(fileReader.result);
callback(fileReader.result); };
fileReader.readAsDataURL(xhttp.response);
}; };
fileReader.readAsDataURL(xhttp.response); xhttp.responseType = "blob";
}; xhttp.open("GET", src, true);
xhttp.responseType = "blob"; xhttp.send();
xhttp.open("GET", src, true); },
xhttp.send(); getOffsetRect(ele) {
}, var box = ele.getBoundingClientRect();
getOffsetRect(ele) { var body = document.body,
var box = ele.getBoundingClientRect(); docElem = document.documentElement;
var body = document.body, //获取页面的scrollTop,scrollLeft(兼容性写法)
docElem = document.documentElement; var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,
//获取页面的scrollTop,scrollLeft(兼容性写法) scrollLeft =
var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop, window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
scrollLeft = var clientTop = docElem.clientTop || body.clientTop,
window.pageXOffset || docElem.scrollLeft || body.scrollLeft; clientLeft = docElem.clientLeft || body.clientLeft;
var clientTop = docElem.clientTop || body.clientTop, var top = box.top + scrollTop - clientTop,
clientLeft = docElem.clientLeft || body.clientLeft; left = box.left + scrollLeft - clientLeft;
var top = box.top + scrollTop - clientTop, return {
left = box.left + scrollLeft - clientLeft; //Math.round 兼容火狐浏览器bug
return { top: Math.round(top),
//Math.round 兼容火狐浏览器bug left: Math.round(left)
top: Math.round(top), };
left: Math.round(left) },
}; qrcode(data) {
}, // debugger
qrcode(data) { let spx = document.body.clientWidth / 375;
// debugger if (this.QRCodeB) {
let spx = document.body.clientWidth / 375; this.QRCodeB.makeCode(data);
if (this.QRCodeB) { } else {
this.QRCodeB.makeCode(data); this.QRCodeB = new QRCode("qrcode", {
} else { width: 100 * spx,
this.QRCodeB = new QRCode("qrcode", { height: 100 * spx, // 高度
width: 100 * spx, text: data, // 二维码内容
height: 100 * spx, // 高度 image: "",
text: data, // 二维码内容 errorCorrectionLevel: "L"
image: "", });
errorCorrectionLevel: "L" }
}); },
playAudio() {
// this.$refs.audioDom.load()
// this.$refs.audioDom.play()
} }
},
playAudio() {
// this.$refs.audioDom.load()
// this.$refs.audioDom.play()
} }
} };
};
</script> </script>
<style lang="less"> <style lang="less">
...@@ -773,469 +790,550 @@ export default { ...@@ -773,469 +790,550 @@ export default {
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
@tocurrentvw : 1/2 * @toVw; @tocurrentvw : 1/2 * @toVw;
@tocurrentvh : 1/2 * @toVh; @tocurrentvh : 1/2 * @toVh;
.share_close { .share_close {
position: fixed; position: fixed;
width: 20 * @toVw; width: 20 * @toVw;
top: 26 * @toVw; top: 26 * @toVw;
right: 14 * @toVw; right: 14 * @toVw;
z-index: 1301; z-index: 1301;
color: white; color: white;
font-size: 16 * @toVw; font-size: 16 * @toVw;
} }
.share-btn { .share-btn {
position: fixed; position: fixed;
top: 510 * @toVw; top: 510 * @toVw;
left: 31 * @toVw; left: 31 * @toVw;
z-index: 1301; z-index: 1301;
text-align: center; text-align: center;
width: 314 * @toVw; width: 314 * @toVw;
height: 49 * @toVw; height: 49 * @toVw;
display: flex; display: flex;
justify-content: center; justify-content: center;
background: linear-gradient( background: linear-gradient(
0deg, 0deg,
rgba(243, 180, 3, 1) 1%, rgba(243, 180, 3, 1) 1%,
rgba(252, 231, 171, 1) 100% rgba(252, 231, 171, 1) 100%
); );
text-shadow: 0px 1 * @toVw 1 * @toVw rgba(170, 127, 4, 0.7); text-shadow: 0px 1 * @toVw 1 * @toVw rgba(170, 127, 4, 0.7);
// box-shadow:0px 3*@toVw 16*@toVw 0px rgba(200,96,37,0.59); // box-shadow:0px 3*@toVw 16*@toVw 0px rgba(200,96,37,0.59);
border-radius: 22 * @toVw; border-radius: 22 * @toVw;
color: white; color: white;
line-height: 49 * @toVw; line-height: 49 * @toVw;
font-size: 18 * @toVw; font-size: 18 * @toVw;
box-shadow: 0px 3 * @toVw 16 * @toVw 0px rgba(250, 208, 88, 0.59); box-shadow: 0px 3 * @toVw 16 * @toVw 0px rgba(250, 208, 88, 0.59);
background: linear-gradient( background: linear-gradient(
0deg, 0deg,
rgba(237, 151, 1, 1) 1%, rgba(237, 151, 1, 1) 1%,
rgba(252, 217, 118, 1) 99% rgba(252, 217, 118, 1) 99%
); );
box-shadow: 0px 3px 16px 0px rgba(250, 208, 88, 0.59); box-shadow: 0px 3px 16px 0px rgba(250, 208, 88, 0.59);
.iconfont { .iconfont {
font-size: 22 * @toVw; font-size: 22 * @toVw;
margin: 0; margin: 0;
}
img {
width: 270 * @toVw;
}
span {
font-weight: 580;
font-weight: bold;
margin: 0;
}
} }
img { .canvasImg {
width: 270 * @toVw; position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1300;
} }
span { .white-pannel {
font-weight: 580; position: absolute;
font-weight: bold; z-index: 1301;
margin: 0; top: 0;
width: 100%;
height: 510 * @toVw;
background: transparent;
pointer-events: none;
border: 7 * @toVw solid white;
border-radius: 12 * @toVw;
box-shadow: 0 0 0 20px white;
box-sizing: border-box;
.trs {
position: absolute;
top: 500 * @toVw;
// width: 100%;
left:-7 * @toVw;
right:-7 * @toVw;
background: white;
height: 33vh;
}
} }
} .borderDiv {
.canvasImg {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1300;
}
.white-pannel {
position: absolute;
z-index: 1301;
top: 0;
width: 100%;
height: 510 * @toVw;
background: transparent;
pointer-events: none;
border: 7 * @toVw solid white;
border-radius: 12 * @toVw;
box-shadow: 0 0 0 20px white;
box-sizing: border-box;
.trs {
position: absolute; position: absolute;
top: 500 * @toVw; z-index: 1301;
// width: 100%; top: 0;
left:-7 * @toVw; width: 100%;
right:-7 * @toVw; pointer-events: none;
background: white; height: 510 * @toVw;
height: 33vh; box-sizing: border-box;
border: 7 * @toVw solid white;
} }
} .box{
.borderDiv {
position: absolute;
z-index: 1301;
top: 0;
width: 100%;
pointer-events: none;
height: 510 * @toVw;
box-sizing: border-box;
border: 7 * @toVw solid white;
}
.box{
position: fixed;
top: 0;
left: 0;
width: 100%;
min-height:100vh;
z-index:1300;
overflow:hidden;
}
.share-page {
position: fixed;
background: url("https://cdn.singsingenglish.com/new-sing/6c6766b21eceef9ddf36597efe3cc152f46ac7f0.png");
background-size: 100%;
top: 0;
left: 0;
// bottom: 0;
right: 0;
min-height: 650 * @toVw;
z-index: 1300;
.imgLogo {
position: fixed; position: fixed;
top: 15 * @toVw; top: 0;
left: 15 * @toVw; left: 0;
width: 48 * @toVw; width: 100%;
min-height:100vh;
z-index:1300;
overflow:hidden;
} }
.share-block { .share-page {
position: absolute; position: fixed;
border-radius: 8 * @toVw; background: url("https://cdn.singsingenglish.com/new-sing/6fd01609c6fc980286734364d539bf50f6ea08cd.png");
top: 20 * @toVw; background-size: 100%;
left: 20 * @toVw; top: 0;
right: 20 * @toVw; left: 0;
// background: white; // bottom: 0;
bottom: 0; right: 0;
overflow: auto; min-height: 650 * @toVw;
.bg-title { z-index: 1300;
position: absolute; .imgLogo {
top: 0; position: fixed;
left: 0; top: 15 * @toVw;
right: 0; left: 15 * @toVw;
height: 60 * @toVw; width: 48 * @toVw;
background-size: 100% 100%;
z-index: -1;
} }
.bg-desc { .share-block {
position: absolute; position: absolute;
top: 58 * @toVw; border-radius: 8 * @toVw;
left: 0; top: 20 * @toVw;
right: 0; left: 20 * @toVw;
bottom: 0; right: 20 * @toVw;
// background: white; // background: white;
z-index: -1; bottom: 0;
border-radius: 0 0 8 * @toVw 8 * @toVw; /*overflow: auto;*/
} .bg-title {
#cvs-img {
position: absolute;
width: 100%;
// top: -3*@toVw;
left: 0;
z-index: 1;
}
.content {
width: 100%;
height: (480-53) * @toVw;
padding-top: 104 * @toVw;
// margin-top: 20*@toVw;
background-size: 100% 100%;
position: relative;
.content-black {
position: absolute; position: absolute;
z-index: -1;
width: 100%;
height: 100%;
top: 0; top: 0;
left: 0;
right: 0; right: 0;
height: 60 * @toVw;
background-size: 100% 100%;
z-index: -1;
}
.bg-desc {
position: absolute;
top: 58 * @toVw;
left: 0; left: 0;
right: 0;
bottom: 0; bottom: 0;
// background: white;
z-index: -1;
border-radius: 0 0 8 * @toVw 8 * @toVw;
} }
} #cvs-img {
.audio {
position: fixed;
opacity: 0;
}
.main-content {
width: 322 * @toVw;
height: 200 * @toVw;
background: white;
border-radius: 8 * @toVw;
position: relative;
.img_link {
position: absolute; position: absolute;
width: 260 * @toVw; width: 100%;
bottom: -49 * @toVw; // top: -3*@toVw;
left: 33 * @toVw; left: 0;
z-index: 1;
} }
.imgPoint { .content {
position: absolute; width: 100%;
width: 85 * @toVw; height: (480-53) * @toVw;
top: 40 * @toVw; padding-top: 110 * @toVw;
left: 80 * @toVw; // margin-top: 20*@toVw;
opacity: 0; background-size: 100% 100%;
@keyframes pointMove { position: relative;
from { .content-black {
top: 40 * @toVw; position: absolute;
left: 80 * @toVw; z-index: -1;
transform: scale(2, 2); width: 100%;
opacity: 0; height: 100%;
} top: 0;
to { right: 0;
top: -60 * @toVw; left: 0;
left: 229 * @toVw; bottom: 0;
transform: scale(1, 1);
opacity: 1;
}
} }
animation: pointMove 0.375s 0.5s ease;
animation-fill-mode: forwards;
} }
.oimgPoint { .audio {
position: absolute; position: fixed;
width: 85 * @toVw; opacity: 0;
top: -60 * @toVw;
left: 229 * @toVw;
} }
.topBox { .main-content {
position: absolute; width: 322 * @toVw;
top: -34 * @toVw; height: 200 * @toVw;
left: 48 * @toVw; background: white;
.shareTitle { border-radius: 8 * @toVw;
width: 223 * @toVw; position: relative;
.img_link {
position: absolute;
width: 260 * @toVw;
bottom: -49 * @toVw;
left: 33 * @toVw;
} }
} .imgPoint {
.main-text { position: absolute;
padding-top: 48 * @toVw; width: 85 * @toVw;
text-align: center; top: 40 * @toVw;
margin: auto; left: 80 * @toVw;
margin-bottom: 0; opacity: 0;
display: flex; @keyframes pointMove {
.item { from {
flex: 1; top: 40 * @toVw;
margin: 0; left: 80 * @toVw;
.text1 { transform: scale(2, 2);
color: #5f696e; opacity: 0;
font-size: 13 * @toVw; }
margin: 8 * @toVw 0; to {
top: -60 * @toVw;
left: 229 * @toVw;
transform: scale(1, 1);
opacity: 1;
}
} }
img { animation: pointMove 0.375s 0.5s ease;
width: 46 * @toVw; animation-fill-mode: forwards;
}
.oimgPoint {
position: absolute;
width: 85 * @toVw;
top: -60 * @toVw;
left: 229 * @toVw;
}
.topBox {
position: absolute;
top: -34 * @toVw;
left: 48 * @toVw;
.shareTitle {
width: 223 * @toVw;
}
.diyikexing {
width: 35 * @toVw;
height: 34 * @toVw;
position: absolute;
z-index: 1000;
top: -50 * @toVw;
left: 40 * @toVw;
img {
width: 100%;
height: 100%;
}
} }
.text2 { .dierkexing1 {
font-size: 11 * @toVw; width: 35 * @toVw;
color: #5f696e; height: 34 * @toVw;
span { position: absolute;
color: #ec7e1f; z-index: 1000;
font-size: 22 * @toVw; top: -50 * @toVw;
font-weight: bold; right: 40 * @toVw;
img {
width: 100%;
height: 100%;
}
}
.dierkexing {
width: 41 * @toVw;
height: 39 * @toVw;
position: absolute;
top: -86 * @toVw;
left: 92 * @toVw;
z-index: 1000;
img {
width: 100%;
height: 100%;
} }
} }
} }
} .main-text {
.head-block { padding-top: 48 * @toVw;
position: absolute; text-align: center;
text-align: center; margin: auto;
border-radius: 200 * @toVw; margin-bottom: 0;
// left: 50%; display: flex;
width: 100%; .item {
text-align: center; flex: 1;
top: -52 * @toVw; margin: 0;
img { .text1 {
border: 8 * @toVw solid #72cefa; color: #5f696e;
font-size: 13 * @toVw;
margin: 8 * @toVw 0;
}
img {
width: 46 * @toVw;
}
.text2 {
font-size: 11 * @toVw;
color: #5f696e;
span {
color: #ec7e1f;
font-size: 22 * @toVw;
font-weight: bold;
}
}
}
}
.head-block {
position: absolute;
text-align: center;
border-radius: 200 * @toVw; border-radius: 200 * @toVw;
width: 62 * @toVw; // left: 50%;
margin-top: 7 * @toVw; width: 100%;
height: 62 * @toVw; text-align: center;
top: -52 * @toVw;
img {
border: 8 * @toVw solid #72cefa;
border-radius: 200 * @toVw;
width: 62 * @toVw;
margin-top: 7 * @toVw;
height: 62 * @toVw;
}
}
.content-title {
width: 226 * @toVw;
// height: 54 * @toVw;
line-height: 26 * @toVw;
margin-top: 40 * @toVw;
color: #55343a;
// background: white;
font-size: 14 * @toVw;
text-align: center;
background-size: 99.99% 99.99%;
position: absolute;
top: -14 * @toVw;
color: white;
vertical-align: top;
display: flex;
justify-content: center;
// left: 50%;
// margin-left: -112.5*@toVw;
span {
margin: 0;
}
.ellipsisCss {
max-width: 86 * @toVw;
}
} }
} }
.content-title { .sing-content {
width: 226 * @toVw; background: white;
// height: 54 * @toVw; border-radius: 10 * @toVw;
line-height: 26 * @toVw; margin-top: 30 * @toVw;
margin-top: 40 * @toVw; padding: 20 * @toVw 0;
color: #55343a;
// background: white;
font-size: 14 * @toVw;
text-align: center; text-align: center;
background-size: 99.99% 99.99%; .text1 {
position: absolute; margin: 0 0 20 * @toVw;
top: -14 * @toVw; font-size: 13 * @toVw;
color: white;
vertical-align: top;
display: flex;
justify-content: center;
// left: 50%;
// margin-left: -112.5*@toVw;
span {
margin: 0;
} }
.ellipsisCss { .text2 {
max-width: 86 * @toVw; color: #1d6588;
font-size: 22 * @toVw;
font-weight: bold;
margin-bottom: 10 * @toVw;
width: 318 * @toVw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text3 {
color: #1d6588;
} }
} }
} }
.sing-content { .qrbox {
background: white; background: #1a9bda;
border-radius: 10 * @toVw; top: 514 * @toVw;
margin-top: 30 * @toVw; // top: 414* @toVw;
padding: 20 * @toVw 0; color: white;
text-align: center; position: absolute;
.text1 { left: 0;
margin: 0 0 20 * @toVw; width: 100%;
font-size: 13 * @toVw; display: flex;
} padding: 18 * @toVw;
.text2 { box-sizing: border-box;
color: #1d6588; font-weight: bold;
font-size: 22 * @toVw; p {
font-weight: bold; font-size: 18 * @toVw;
margin-bottom: 10 * @toVw; margin-bottom: 10 * @toVw;
width: 318 * @toVw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text3 {
color: #1d6588;
} }
} .left {
} flex: 1;
.qrbox { .point {
background: #1a9bda; border: 1px solid white;
top: 514 * @toVw; height: 30 * @toVw;
// top: 414* @toVw; width: 191 * @toVw;
color: white; text-align: center;
position: absolute; line-height: 30 * @toVw;
left: 0; border-radius: 5 * @toVw;
width: 100%; margin-left: 0;
display: flex; img {
padding: 18 * @toVw; width: 14 * @toVw;
box-sizing: border-box; position: relative;
font-weight: bold; top: 2 * @toVw;
p { }
font-size: 18 * @toVw;
margin-bottom: 10 * @toVw;
}
.left {
flex: 1;
.point {
border: 1px solid white;
height: 30 * @toVw;
width: 191 * @toVw;
text-align: center;
line-height: 30 * @toVw;
border-radius: 5 * @toVw;
margin-left: 0;
img {
width: 14 * @toVw;
position: relative;
top: 2 * @toVw;
} }
} }
} .right {
.right { .qrcode {
.qrcode { display: inline-block;
display: inline-block; border: 3px solid white;
border: 3px solid white; // background:white;
// background:white; font-size: 0;
font-size: 0; img {
img { }
} }
} }
} }
} .tips {
.tips { background: rgba(0, 0, 0, 0.8);
background: rgba(0, 0, 0, 0.8); position: fixed;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding-right: 19 * @toVw;
z-index: 99999999;
text-align: right;
img {
width: 80%;
}
.closeBox {
position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
padding-right: 19 * @toVw;
z-index: 99999999;
text-align: right;
img {
width: 80%;
}
.closeBox {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
} }
} .pannel {
.pannel { width: 616 * @tocurrentvw;
width: 616 * @tocurrentvw; height: 380 * @tocurrentvw;
height: 380 * @tocurrentvw; border-radius: 16 * @tocurrentvw;
border-radius: 16 * @tocurrentvw; position: fixed;
position: fixed; z-index: 2;
z-index: 2; top: 48vh;
top: 48vh; left: 67 * @tocurrentvw;
left: 67 * @tocurrentvw; border: 2 * @tocurrentvw dashed #fff;
border: 2 * @tocurrentvw dashed #fff; color: white;
color: white; .pannel-container {
.pannel-container { width: 558 * @tocurrentvw;
width: 558 * @tocurrentvw; height: 324 * @tocurrentvw;
height: 324 * @tocurrentvw; margin: 28 * @tocurrentvw;
margin: 28 * @tocurrentvw; // background-color: pink;
// background-color: pink;
display: flex;
flex-direction: column;
justify-content: flex-start;
.pannel-header {
display: flex; display: flex;
margin: 0; flex-direction: column;
align-items: center; justify-content: flex-start;
height: 40 * @tocurrentvw; .pannel-header {
font-size: 28 * @tocurrentvw; display: flex;
color: #fff; margin: 0;
text-align: left; align-items: center;
img {
display: block;
width: 38 * @tocurrentvw;
height: 40 * @tocurrentvw; height: 40 * @tocurrentvw;
font-size: 28 * @tocurrentvw;
color: #fff;
text-align: left;
img {
display: block;
width: 38 * @tocurrentvw;
height: 40 * @tocurrentvw;
}
} }
} .pannel-main {
.pannel-main { text-align: left;
text-align: left; margin-top: 18 * @toVw;
margin-top: 18 * @toVw; img {
img { height: 18 * @toVw;
height: 18 * @toVw; vertical-align: text-bottom;
vertical-align: text-bottom; }
} }
} .pannel-footer {
.pannel-footer { margin: 0;
margin: 0; img {
img { position: relative;
position: relative; top: 2 * @toVw;
top: 2 * @toVw; width: 16 * @toVw;
width: 16 * @toVw; }
} }
} }
.transparentBtn {
margin-top: 30 * @toVw;
}
}
}
@keyframes mymove
{
0%{
transform: scale(1); /*开始为原始大小*/
}
50%{
transform: scale(1.5);
} }
.transparentBtn { 100%{
margin-top: 30 * @toVw; transform: scale(1);
} }
} }
}
@media screen and (min-width: 600px) { @-webkit-keyframes mymove /*Safari and Chrome*/
.box{ {
overflow:auto; 0%{
} transform: scale(1); /*开始为原始大小*/
.white-pannel { }
.trs { 50%{
height: 30vh; transform: scale(1.5);
}
100%{
transform: scale(1);
}
}
.animated {
animation: mymove 1s .5s ease;
animation-fill-mode: forwards;
}
.animated1 {
animation: mymove 1s 1s ease;
animation-fill-mode: forwards;
}
.animated2 {
animation: mymove 1s 1.5s ease;
animation-fill-mode: forwards;
}
@media screen and (min-width: 600px) {
.box{
overflow:auto;
}
.white-pannel {
.trs {
height: 30vh;
}
}
} }
}
}
</style> </style>
<style lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.van-toast { .van-toast {
top: 35%; top: 35%;
} }
.pannel-main { .pannel-main {
img { img {
height: 18 * @toVw; height: 18 * @toVw;
vertical-align: text-bottom; vertical-align: text-bottom;
}
} }
}
</style> </style>
<style lang=""> <style lang="">
/* body{ /* body{
pointer-events: none; pointer-events: none;
} */ } */
</style> </style>
...@@ -4,16 +4,21 @@ ...@@ -4,16 +4,21 @@
<mt-popup <mt-popup
v-model="popupVisible" style="background: transparent"> v-model="popupVisible" style="background: transparent">
<div class="pop-block"> <div class="pop-block">
<img :src="starNum == 0 ? star1 : starNum == 3 ? star3 : star2 " class="star-all"/> <img :src="starNum == 1 ? star1 : starNum == 2 ? star2 : star3 " class="star-all"/>
<div class="list"> <div class="list">
1.完成今日学习 1.开始课程学习
<div class="star-content"> <div class="star-content">
<img :src="starNum == 0 ? star_default : star_active"> <img :src="starNum >= 1 ? star_active : star_default">
<img :src="starNum < 2 ? star_default : star_active">
</div> </div>
</div> </div>
<div class="list"> <div class="list">
2.分享学习记录 2.完成今日学习
<div class="star-content">
<img :src="starNum >= 2 ? star_active : star_default">
</div>
</div>
<div class="list">
3.提交成长记录
<div class="star-content"> <div class="star-content">
<img :src="starNum == 3 ? star_active : star_default"> <img :src="starNum == 3 ? star_active : star_default">
</div> </div>
...@@ -21,7 +26,7 @@ ...@@ -21,7 +26,7 @@
<div class="btn-block"> <div class="btn-block">
<div class="btn" @click="showShare"> <div class="btn" @click="showShare">
<span v-if="starNum < 2">继续看课</span> <span v-if="starNum < 2">继续看课</span>
<span v-if="starNum == 2">分享赚星星</span> <span v-if="starNum == 2">去记录</span>
<span v-if="starNum == 3">关闭</span> <span v-if="starNum == 3">关闭</span>
</div> </div>
</div> </div>
...@@ -110,7 +115,7 @@ ...@@ -110,7 +115,7 @@
width: 230*@toVw; width: 230*@toVw;
padding:50*@toVw 10*@toVw 10*@toVw 10*@toVw; padding:50*@toVw 10*@toVw 10*@toVw 10*@toVw;
position: relative; position: relative;
height: 142*@toVw; // height: 142*@toVw;
.star-all{ .star-all{
width: 154*@toVw; width: 154*@toVw;
position: absolute; position: absolute;
......
...@@ -46,18 +46,18 @@ ...@@ -46,18 +46,18 @@
v-if="showObj.video[videoIndex]" v-if="showObj.video[videoIndex]"
v-show="!share_show && !popupVisible" v-show="!share_show && !popupVisible"
> >
<!-- :src="showObj.video[videoIndex].url" --> <!-- :src="showObj.video[videoIndex].url" -->
<video v-show="!star" <video v-show="!star"
ref="videoDom" ref="videoDom"
style="object-fit:fill" style="object-fit:fill"
x5-video-player-type="h5" x5-video-player-fullscreen="true" x-webkit-airplay="true" playsinline x5-video-player-type="h5" x5-video-player-fullscreen="true" x-webkit-airplay="true" playsinline
:src="showObj.video[videoIndex].url" :src="showObj.video[videoIndex].url"
@ended="videoEnd" @ended="videoEnd"
@error="errorLog" @error="errorLog"
@play="videoPlay()" @play="videoPlay()"
controlslist="nodownload" controlslist="nodownload"
:controls="vcontrols" :controls="vcontrols"
:poster="showObj.video[videoIndex].url+'?vframe/jpg/offset/3'" :poster="showObj.video[videoIndex].url+'?vframe/jpg/offset/3'"
></video> ></video>
<div class="video-bj" v-show="star"> <div class="video-bj" v-show="star">
<img :src="showObj.video[videoIndex].url+'?vframe/jpg/offset/3'" alt=""> <img :src="showObj.video[videoIndex].url+'?vframe/jpg/offset/3'" alt="">
...@@ -134,730 +134,609 @@ ...@@ -134,730 +134,609 @@
</div> </div>
</template> </template>
<script> <script>
import luolacoming from "../../assets/newLesson/luoLacoming.png"; import luolacoming from "../../assets/newLesson/luoLacoming.png";
import luolalaila from "../../assets/newLesson/luolalaila.png"; import luolalaila from "../../assets/newLesson/luolalaila.png";
import { subUserLessonApi, getUserWatchApi,postErrorLogApi } from "../../service/api"; import { subUserLessonApi, getUserWatchApi,postErrorLogApi } from "../../service/api";
import tapToAudio from "../../assets/tapToAudio.png"; import tapToAudio from "../../assets/tapToAudio.png";
import finishStuat from "../../assets/newLesson/finishStudy.png"; import finishStuat from "../../assets/newLesson/finishStudy1.png";
import noFinishDia from "./nofinishdia"; import noFinishDia from "./nofinishdia";
import sharePage from "./share"; import sharePage from "./share";
import starBlock from "./star"; import starBlock from "./star";
import { Popup } from "mint-ui"; import { Popup } from "mint-ui";
import audioGood from "../../assets/good.mp3"; import audioGood from "../../assets/good.mp3";
import audioGreat from "../../assets/great.mp3"; import audioGreat from "../../assets/great.mp3";
import audioPerfect from "../../assets/perfect.mp3"; import audioPerfect from "../../assets/perfect.mp3";
import leftIcon from "../../assets/shop/left.png"; import leftIcon from "../../assets/shop/left.png";
import { Toast } from "vant"; import { Toast } from "vant";
// import videojs from "videojs"; // import videojs from "videojs";
export default { export default {
name: "play", name: "play",
components: { components: {
noFinishDia, noFinishDia,
sharePage, sharePage,
starBlock, starBlock,
[Popup.name]: Popup [Popup.name]: Popup
}, },
data() { data() {
return { return {
vcontrols: true, vcontrols: true,
clarityType: "1280", clarityType: "1280",
secClarity: false, secClarity: false,
leftIcon: leftIcon, leftIcon: leftIcon,
finishStuat: finishStuat, finishStuat: finishStuat,
popupVisible: false, popupVisible: false,
ageShow: false, ageShow: false,
star: false, star: false,
share_show: false, share_show: false,
showObj: { showObj: {
video: [], video: [],
change: false change: false
}, },
videoShow: false, videoShow: false,
videoIndex: 0, videoIndex: 0,
imgURL: { imgURL: {
luolacoming: luolacoming, luolacoming: luolacoming,
luolalaila: luolalaila, luolalaila: luolalaila,
tapToAudio: tapToAudio tapToAudio: tapToAudio
}, },
orientationchange: false, orientationchange: false,
testCount: 5, testCount: 5,
videoStyle: "0", videoStyle: "0",
videoWidth: 100, videoWidth: 100,
audioPoint: audioGood, audioPoint: audioGood,
currentTime: "", currentTime: "",
QPlayerConfig :{ QPlayerConfig :{
url:'' url:''
}, },
videoObj:null, videoObj:null,
userDetail:{} userDetail:{}
}; };
},
props: ["contentData", "nowShow"],
created() {
this.videoWidth = Number(document.documentElement.clientWidth) / 3.8;
},
mounted() {
this.changeAge(this.contentData.age);
let that = this;
// console.log(document.documentElement.clientWidth)
if (
document.documentElement.clientWidth >
document.documentElement.clientHeight
) {
this.orientationchange = true;
} else {
this.orientationchange = false;
}
window.addEventListener(
"orientationchange",
() => {
let width = document.documentElement.clientWidth;
let height = document.documentElement.clientHeight;
let t = setTimeout(function() {
if (width < height) {
that.orientationchange = true;
clearTimeout(t);
// return
} else {
that.orientationchange = false;
clearTimeout(t);
// return
}
}, 100);
// debugger
},
false
);
// console.log(videojs)
},
methods: {
errorLog(e){
this.userDetail = JSON.parse(localStorage.getItem("userDesc"));
// console.log(e.target.error,229)
let str='code:'+e.target.error.code+',msg:'+e.target.error.message+',url:'+
this.showObj.video[this.videoIndex].url+',UserAgent:'+navigator.userAgent+',currentTime:'+this.$refs.videoDom.currentTime
postErrorLogApi({
'routes_url':'videoerror,'+'userid:'+this.userDetail.user_id,
'result_text':str
}).then((res)=>{
// console.log(res)
})
}, },
sliceUrl() { props: ["contentData", "nowShow"],
localStorage.setItem("clarityType", this.clarityType); created() {
this.showObj.video.forEach(el => { this.videoWidth = Number(document.documentElement.clientWidth) / 3.8;
el.url =
el.url.slice(0, el.url.indexOf("_")) +
"_" +
this.clarityType +
el.url.slice(-4);
});
}, },
changeClarity(a) { mounted() {
// Toast.loading({ if(this.$route.params.evaluate === 1)
// mask: true, this.finishStudy()
// message: '' this.changeAge(this.contentData.age);
// });
let that = this; let that = this;
this.currentTime = this.$refs.videoDom.currentTime; // console.log(document.documentElement.clientWidth)
if (a == "1280") { if (
this.clarityType = 1280; document.documentElement.clientWidth >
this.sliceUrl(); document.documentElement.clientHeight
} else if (a == "720") { ) {
this.clarityType = 720; this.orientationchange = true;
this.sliceUrl();
} else { } else {
this.clarityType = 540; this.orientationchange = false;
this.sliceUrl();
} }
this.secClarity = false; window.addEventListener(
}, "orientationchange",
scrollFn(index) { () => {
this.videoStyle = index; let width = document.documentElement.clientWidth;
this.videoIndex = index; let height = document.documentElement.clientHeight;
let parentwidth = Number( let t = setTimeout(function() {
getComputedStyle(document.querySelector(".scroll")).width.replace( if (width < height) {
"px", that.orientationchange = true;
"" clearTimeout(t);
) // return
); } else {
let itemBoxWidth = Number( that.orientationchange = false;
getComputedStyle(document.querySelector(".itemBox")).width.replace( clearTimeout(t);
"px", // return
"" }
) }, 100);
// debugger
},
false
); );
let difWidth = parentwidth / 2 - 45; // console.log(videojs)
if (this.showObj.video.length > 3) {
if (index * this.videoWidth > difWidth) {
let indexS = index - 1;
if (index * this.videoWidth - difWidth < itemBoxWidth - parentwidth) {
this.$refs.scrollDom.scrollTo(
-(index * this.videoWidth - difWidth),
0,
this.videoWidth
);
} else {
this.$refs.scrollDom.scrollTo(
-(itemBoxWidth - parentwidth),
0,
this.videoWidth
);
}
} else {
this.$refs.scrollDom.scrollTo(0, 0, this.videoWidth);
}
}
},
swiperback(index) {
this.videoIndex = index;
this.sendConsole("多视频选择视频");
},
test() {},
changeStar(data) {
this.star = data;
},
backList() {
this.$emit("backList");
},
closeShare() {
this.share_show = false;
}, },
finishStudy() { methods: {
if (this.$refs.videoDom) { errorLog(e){
this.$refs.videoDom.pause(); this.userDetail = JSON.parse(localStorage.getItem("userDesc"));
} // console.log(e.target.error,229)
let query = JSON.parse(sessionStorage.getItem("classQuery")); let str='code:'+e.target.error.code+',msg:'+e.target.error.message+',url:'+
this.sendConsole("完成今日学习"); this.showObj.video[this.videoIndex].url+',UserAgent:'+navigator.userAgent+',currentTime:'+this.$refs.videoDom.currentTime
let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")); postErrorLogApi({
let nowTime = Date.parse(new Date()); 'routes_url':'videoerror,'+'userid:'+this.userDetail.user_id,
let lookTime = (nowTime - lessonDetail.nowTime) / 1000; 'result_text':str
let json = { }).then((res)=>{
page_type: 0, // console.log(res)
page_id: 5, })
stay_time: lookTime },
}; sliceUrl() {
subUserLessonApi( localStorage.setItem("clarityType", this.clarityType);
query.elementId, this.showObj.video.forEach(el => {
query.category_id, el.url =
query.periods_id, el.url.slice(0, el.url.indexOf("_")) +
json "_" +
).then(res => { this.clarityType +
lessonDetail.total_watch_time = res.total_watch_time; el.url.slice(-4);
lessonDetail.nowTime = nowTime; });
lessonDetail.star_num = res.total_star_num; },
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); changeClarity(a) {
if ( // Toast.loading({
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 < // mask: true,
7 // message: ''
) { // });
this.popupVisible = true; let that = this;
this.currentTime = this.$refs.videoDom.currentTime;
if (a == "1280") {
this.clarityType = 1280;
this.sliceUrl();
} else if (a == "720") {
this.clarityType = 720;
this.sliceUrl();
} else { } else {
getUserWatchApi({ category_id: query.category_id }).then(res => { this.clarityType = 540;
this.$store.dispatch("setWatchDetail", res); this.sliceUrl();
this.share_show = true; }
// debugger this.secClarity = false;
}); },
setTimeout(() => { scrollFn(index) {
if (this.$store.state.lookStatus == 0) { this.videoStyle = index;
this.audioPoint = audioGood; this.videoIndex = index;
} else if (this.$store.state.lookStatus == 1) { let parentwidth = Number(
this.audioPoint = audioGreat; getComputedStyle(document.querySelector(".scroll")).width.replace(
"px",
""
)
);
let itemBoxWidth = Number(
getComputedStyle(document.querySelector(".itemBox")).width.replace(
"px",
""
)
);
let difWidth = parentwidth / 2 - 45;
if (this.showObj.video.length > 3) {
if (index * this.videoWidth > difWidth) {
let indexS = index - 1;
if (index * this.videoWidth - difWidth < itemBoxWidth - parentwidth) {
this.$refs.scrollDom.scrollTo(
-(index * this.videoWidth - difWidth),
0,
this.videoWidth
);
} else { } else {
this.audioPoint = audioPerfect; this.$refs.scrollDom.scrollTo(
-(itemBoxWidth - parentwidth),
0,
this.videoWidth
);
} }
this.$refs.audioDom.load(); } else {
setTimeout(() => { this.$refs.scrollDom.scrollTo(0, 0, this.videoWidth);
this.$refs.audioDom.play(); }
}, 100);
}, 300);
} }
}); },
}, swiperback(index) {
videoEnd(event) { this.videoIndex = index;
event.srcElement.play(); this.sendConsole("多视频选择视频");
}, },
sendConsole(data) { test() {},
this.$sa.track("watchClick", { changeStar(data) {
dayModule: JSON.parse( this.star = data;
localStorage.getItem("lessonDetail") },
).domTitle.slice(0, 9), backList() {
weekName: JSON.parse( this.$emit("backList");
localStorage.getItem("lessonDetail") },
).domTitle.slice( closeShare() {
10, // this.$route = {}
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length this.share_show = false;
), console.log(this.$route)
elementName: },
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( finishStudy() {
0, if (this.$refs.videoDom) {
9 this.$refs.videoDom.pause();
) + }
"-" + let query = JSON.parse(sessionStorage.getItem("classQuery"));
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( this.sendConsole("完成今日学习");
10, let lessonDetail = JSON.parse(localStorage.getItem("lessonDetail"));
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length let nowTime = Date.parse(new Date());
), let lookTime = (nowTime - lessonDetail.nowTime) / 1000;
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, let json = {
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName, page_type: 0,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, page_id: 5,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, stay_time: lookTime
buttonName: data, };
partName: this.contentData.partName, // 提交看课数据 记录看课时长
elementID: this.$route.query.elementId.toString() subUserLessonApi(
}); query.elementId,
}, query.category_id,
changeAudio(flag) { query.periods_id,
if (flag) { json
).then(res => {
lessonDetail.total_watch_time = res.total_watch_time;
lessonDetail.nowTime = nowTime;
lessonDetail.star_num = res.total_star_num;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
if (
(Number(lookTime) + Number(lessonDetail.total_watch_time)) / 60 <
7
) {
this.popupVisible = true;
} else {
// 用户看课统计
getUserWatchApi({ category_id: query.category_id }).then(res => {
this.$store.dispatch("setWatchDetail", res);
// 从评价页面返回过来
if(this.$route.params.evaluate === 1){
this.share_show = true;
this.$route.params.evaluate = 0
} else {
this.$router.push({path: '/evaluate'})
}
});
setTimeout(() => {
if (this.$store.state.lookStatus == 0) {
this.audioPoint = audioGood;
} else if (this.$store.state.lookStatus == 1) {
this.audioPoint = audioGreat;
} else {
this.audioPoint = audioPerfect;
}
this.$refs.audioDom.load();
setTimeout(() => {
this.$refs.audioDom.play();
}, 100);
}, 300);
}
});
},
videoEnd(event) {
event.srcElement.play();
},
sendConsole(data) {
this.$sa.track("watchClick", { this.$sa.track("watchClick", {
dayModule: JSON.parse( dayModule: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9), ).domTitle.slice(0, 9),
weekName: JSON.parse( weekName: JSON.parse(
localStorage.getItem("lessonDetail") localStorage.getItem("lessonDetail")
).domTitle.slice( ).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName: elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0, 0,
9 9
) + ) +
"-" + "-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: data,
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
},
changeAudio(flag) {
if (flag) {
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "切换音频教学",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
}
this.contentData.type = "audio";
},
videoPlay() {
// 神策埋点 点击操作
// this.$refs.videoDom.load()
console.log("canplay");
if (this.currentTime) {
setTimeout(() => {
this.$refs.videoDom.play();
this.$refs.videoDom.currentTime = this.currentTime;
this.currentTime = 0;
}, 300);
}
this.$sa.track("watchClick", {
dayModule: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(0, 9),
weekName: JSON.parse(
localStorage.getItem("lessonDetail")
).domTitle.slice(
10, 10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
), ),
elementName:
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
0,
9
) +
"-" +
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice(
10,
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length
),
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID,
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName, themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName,
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID,
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID, classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "切换音频教学", buttonName: "播放视频",
partName: this.contentData.partName, partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString() elementID: this.$route.query.elementId.toString()
}); });
} },
this.contentData.type = "audio"; changeAge(value) {
}, this.clarityType = localStorage.getItem("clarityType")
videoPlay() { ? localStorage.getItem("clarityType")
// 神策埋点 点击操作 : 1280;
// this.$refs.videoDom.load() if (this.contentData.content.age && value === 2) {
console.log("canplay"); let video = [];
if (this.currentTime) { video = this.$common.deepCopy(this.contentData.content.video2);
setTimeout(() => { video.forEach(el => {
this.$refs.videoDom.play(); let str = el.url;
this.$refs.videoDom.currentTime = this.currentTime; if (this.contentData.title == 2) {
this.currentTime = 0; el.url = str.slice(0, -4) + "_" + this.clarityType + str.slice(-4);
}, 300); }
} });
this.$sa.track("watchClick", { this.showObj = {
dayModule: JSON.parse( video: video,
localStorage.getItem("lessonDetail") change: this.contentData.content.change2
).domTitle.slice(0, 9), };
weekName: JSON.parse( } else {
localStorage.getItem("lessonDetail") let video = [];
).domTitle.slice( video = this.$common.deepCopy(this.contentData.content.video);
10, video.forEach(el => {
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length let str = el.url;
), if (this.contentData.title == 2) {
elementName: el.url = str.slice(0, -4) + "_" + this.clarityType + str.slice(-4);
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( }
0, });
9 this.showObj = {
) + video: video,
"-" + change: this.contentData.content.change
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.slice( };
10, }
JSON.parse(localStorage.getItem("lessonDetail")).domTitle.length if (this.$refs.itembox && this.showObj.video.length) {
), this.$refs.itembox.style.width =
themeID: JSON.parse(localStorage.getItem("lessonDetail")).themeID, this.showObj.video.length * this.videoWidth + "px";
themeName: JSON.parse(localStorage.getItem("lessonDetail")).themeName, }
goodsID: JSON.parse(localStorage.getItem("lessonDetail")).goodsID, },
classID: JSON.parse(localStorage.getItem("lessonDetail")).classID,
buttonName: "播放视频",
partName: this.contentData.partName,
elementID: this.$route.query.elementId.toString()
});
}, },
changeAge(value) { watch: {
this.clarityType = localStorage.getItem("clarityType") contentData: {
? localStorage.getItem("clarityType") handler: function() {
: 1280; this.videoIndex = 0;
if (this.contentData.content.age && value === 2) { this.changeAge(this.contentData.age);
let video = []; this.secClarity = false;
video = this.$common.deepCopy(this.contentData.content.video2); },
video.forEach(el => { deep: true
let str = el.url;
if (this.contentData.title == 2) {
el.url = str.slice(0, -4) + "_" + this.clarityType + str.slice(-4);
}
});
this.showObj = {
video: video,
change: this.contentData.content.change2
};
} else {
let video = [];
video = this.$common.deepCopy(this.contentData.content.video);
video.forEach(el => {
let str = el.url;
if (this.contentData.title == 2) {
el.url = str.slice(0, -4) + "_" + this.clarityType + str.slice(-4);
}
});
this.showObj = {
video: video,
change: this.contentData.content.change
};
} }
if (this.$refs.itembox && this.showObj.video.length) {
this.$refs.itembox.style.width =
this.showObj.video.length * this.videoWidth + "px";
}
},
},
watch: {
contentData: {
handler: function() {
this.videoIndex = 0;
this.changeAge(this.contentData.age);
this.secClarity = false;
},
deep: true
} }
} };
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import "../../util/public"; @import "../../util/public";
.close-share-show { .close-share-show {
position: fixed; position: fixed;
z-index: 99; z-index: 99;
top: 18 * @toVw; top: 18 * @toVw;
right: 12 * @toVw; right: 12 * @toVw;
width: 20 * @toVw; width: 20 * @toVw;
} }
.playImage { .playImage {
background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png") background: url("https://static-cdn.changchangenglish.com/new-sing/static/images/playImage.png")
no-repeat; no-repeat;
background-size: 40 * @toVw 189 * @toVw; background-size: 40 * @toVw 189 * @toVw;
display: inline-block; display: inline-block;
}
._154722344142123489 {
height: 5 * @toVw;
width: 9 * @toVw;
background-position: 0 0;
}
._282918034425091245 {
height: 8 * @toVw;
width: 9 * @toVw;
background-position: 0 -4 * @toVw;
vertical-align: bottom;
}
.orientationchangeBox {
p {
text-align: center;
margin-bottom: 10 * @toVw;
} }
} ._154722344142123489 {
.videoTitle { height: 5 * @toVw;
position: relative; width: 9 * @toVw;
font-size: 14 * @toVw; background-position: 0 0;
margin-bottom: 12 * @toVw;
text-indent: 6 * @toVw;
// top:70 * @toVw;
.fr {
// position:relative;
// top:-8 * @toVw;
line-height: 16 * @toVw;
img {
width: 8 * @toVw;
position: relative;
top: 1 * @toVw;
}
margin-right: 8 * @toVw;
.rotate {
transform: rotate(92deg);
}
} }
.secClarityBox { ._282918034425091245 {
position: absolute; height: 8 * @toVw;
right: 0; width: 9 * @toVw;
top: 25 * @toVw; background-position: 0 -4 * @toVw;
padding: 15 * @toVw 15 * @toVw 0; vertical-align: bottom;
z-index: 10001; }
background: white; .orientationchangeBox {
border-radius: 11 * @toVw; p {
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.2); text-align: center;
div { margin-bottom: 10 * @toVw;
margin-bottom: 15 * @toVw;
// text-align: center;
text-indent: 0;
}
.select {
color: #40a9ff;
} }
} }
} .videoTitle {
.scroll { position: relative;
width: 310 * @toVw; font-size: 14 * @toVw;
overflow: hidden; margin-bottom: 12 * @toVw;
// position: fixed; text-indent: 6 * @toVw;
display: none; // top:70 * @toVw;
.itemBox { .fr {
// width: 600*@toVw; // position:relative;
display: flex; // top:-8 * @toVw;
.item { line-height: 16 * @toVw;
// display: inline-block;
flex: 1;
width: 100 * @toVw;
height: 100 * @toVw;
// border: 1px solid black;
img { img {
width: 90 * @toVw; width: 8 * @toVw;
height: 60 * @toVw; position: relative;
border-radius: 18px; top: 1 * @toVw;
border: 3px solid #e2e2e2;
} }
.activity { margin-right: 8 * @toVw;
border: 3px solid #40a9ff; .rotate {
transform: rotate(92deg);
} }
} }
p { .secClarityBox {
font-size: 13 * @toVw; position: absolute;
color: #666666; right: 0;
} top: 25 * @toVw;
} padding: 15 * @toVw 15 * @toVw 0;
} z-index: 10001;
.disShow { background: white;
display: block; border-radius: 11 * @toVw;
} box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.2);
.video-page { div {
.content { margin-bottom: 15 * @toVw;
background: white; // text-align: center;
width: 315 * @toVw; text-indent: 0;
position: absolute;
top: 70 * @toVw;
left: 20 * @toVw;
right: 20 * @toVw;
bottom: 0;
overflow: auto;
margin: auto;
display: block;
border-radius: 8 * @toVw;
padding: 10 * @toVw;
.header {
// text-align: center;
padding-top: 8 * @toVw;
height: auto;
// display: flex;
.text {
width: 96%;
margin-bottom: 0;
display: block;
// border: none;
} }
} .select {
.video-block { color: #40a9ff;
margin-bottom: 16 * @toVw;
// border: 1*@toVw solid #666;
border-radius: 12 * @toVw;
// padding: 8*@toVw;
background: #69c0ff;
border: 6px solid #69c0ff;
overflow: hidden;
video {
width: 307 * @toVw;
// height: 171*@toVw;
margin: 0;
display: block;
padding: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 10 * @toVw;
} }
.video-bj { }
width: 307 * @toVw; }
background: rgba(0, 0, 0, 0.4); .scroll {
border-radius: 10 * @toVw; width: 310 * @toVw;
padding: 0; overflow: hidden;
margin: 0; // position: fixed;
display: block; display: none;
.itemBox {
// width: 600*@toVw;
display: flex;
.item {
// display: inline-block;
flex: 1;
width: 100 * @toVw;
height: 100 * @toVw;
// border: 1px solid black;
img { img {
width: 100%; width: 90 * @toVw;
height: 60 * @toVw;
border-radius: 18px;
border: 3px solid #e2e2e2;
}
.activity {
border: 3px solid #40a9ff;
} }
} }
} p {
.age-block { font-size: 13 * @toVw;
width: 66 * @toVw; color: #666666;
height: 28 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
padding: 0 13 * @toVw;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
&.video {
right: 0;
margin-right: 0;
text-align: center;
} }
} }
.age-change-block { }
&.video { .disShow {
right: 10 * @toVw; display: block;
left: auto; }
z-index: 1231; .video-page {
background: white; .content {
width: 80 * @toVw; background: white;
width: 96 * @toVw; width: 315 * @toVw;
border: 1 * @toVw solid #666; position: absolute;
border-radius: 10 * @toVw; top: 70 * @toVw;
& > div { left: 20 * @toVw;
margin: 0; right: 20 * @toVw;
width: 96 * @toVw; bottom: 0;
padding: 6 * @toVw 11 * @toVw; overflow: auto;
text-align: left; margin: auto;
display: inline-block; display: block;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
text-align: center; padding: 10 * @toVw;
border: none; .header {
box-sizing: border-box; // text-align: center;
&:first-child { padding-top: 8 * @toVw;
border-bottom: 1 * @toVw solid #eee; height: auto;
} // display: flex;
} .text {
} width: 96%;
display: inline-block; margin-bottom: 0;
// position: absolute; display: block;
// top: 282 * @toVw; // border: none;
// left: 20 * @toVw;
width: 196 * @toVw;
// border-radius: 8*@toVw;
// border: 1*@toVw solid #666666;
font-size: 12px;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
& > div {
margin: 10 * @toVw 0;
width: 86 * @toVw;
padding: 6 * @toVw 11 * @toVw;
text-align: left;
display: inline-block;
border-radius: 8 * @toVw;
text-align: center;
border: 1px solid rgba(200, 205, 220, 1);
box-sizing: border-box;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
} }
} }
.activity { .video-block {
border: 3px solid rgba(64, 169, 255, 1); margin-bottom: 16 * @toVw;
} // border: 1*@toVw solid #666;
} border-radius: 12 * @toVw;
.btn-block { // padding: 8*@toVw;
position: relative; background: #69c0ff;
text-align: center; border: 6px solid #69c0ff;
z-index: 100; overflow: hidden;
.change-block { video {
border-radius: 1000 * @toVw; width: 307 * @toVw;
width: 144 * @toVw; // height: 171*@toVw;
border: 1 * @toVw solid #40a9ff; margin: 0;
&:after {
content: "";
display: block; display: block;
clear: both; padding: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 10 * @toVw;
} }
div { .video-bj {
float: left; width: 307 * @toVw;
width: 50%; background: rgba(0, 0, 0, 0.4);
border-radius: 100 * @toVw; border-radius: 10 * @toVw;
font-size: 12 * @toVw; padding: 0;
height: 28 * @toVw; margin: 0;
line-height: 28 * @toVw; display: block;
font-family: PingFang-SC-Medium; img {
font-weight: 500; width: 100%;
color: rgba(204, 204, 204, 1);
&.active {
background: #40a9ff;
color: white;
} }
} }
} }
} .age-block {
.parent-finish { width: 66 * @toVw;
position: fixed; height: 28 * @toVw;
bottom: 2 * @toVw; line-height: 28 * @toVw;
width: 100%; border: 1 * @toVw solid #666;
left: 0; padding: 0 13 * @toVw;
// top: 500 * @toVw; border-radius: 100 * @toVw;
.finish-block { font-size: 12 * @toVw;
position: absolute; font-family: PingFang-SC-Medium;
width: 100%; font-weight: 500;
left: 0; color: rgba(102, 102, 102, 1);
padding: 0; &.video {
margin: 0; right: 0;
text-align: center; margin-right: 0;
bottom: 0; text-align: center;
img {
width: 202 * @toVw;
} }
} }
}
}
}
.change-block-HP {
display: none;
}
@media screen and (orientation: landscape) {
@toVw: 100/667vw;
.videoTitle {
.fr {
display: none;
}
}
.video-page {
position: absolute;
top: 5 * @toVw;
bottom: 5 * @toVw;
left: 5 * @toVw;
right: 5 * @toVw;
background: rgba(255, 255, 255, 1);
overflow: auto;
border-radius: 8 * @toVw;
.content {
position: static;
height: 100%;
width: 100%;
display: flex;
border-radius: 8px;
padding: 0;
.header {
display: none;
}
.age-change-block { .age-change-block {
&.video { &.video {
top: 33 * @toVw; right: 10 * @toVw;
right: 0;
left: auto; left: auto;
z-index: 1231; z-index: 1231;
background: white; background: white;
width: 80 * @toVw; width: 80 * @toVw;
position: absolute; width: 96 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 10 * @toVw;
& > div { & > div {
margin: 0; margin: 0;
width: 100%; width: 96 * @toVw;
padding: 6 * @toVw 11 * @toVw; padding: 6 * @toVw 11 * @toVw;
text-align: left; text-align: left;
display: inline-block; display: inline-block;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
text-align: center; text-align: center;
border: none; border: none;
box-sizing: border-box;
&:first-child { &:first-child {
border-bottom: 1 * @toVw solid #eee; border-bottom: 1 * @toVw solid #eee;
} }
...@@ -865,9 +744,8 @@ export default { ...@@ -865,9 +744,8 @@ export default {
} }
display: inline-block; display: inline-block;
// position: absolute; // position: absolute;
// top: 37*@toVw; // top: 282 * @toVw;
top: 367 * @toVw; // left: 20 * @toVw;
left: 0;
width: 196 * @toVw; width: 196 * @toVw;
// border-radius: 8*@toVw; // border-radius: 8*@toVw;
// border: 1*@toVw solid #666666; // border: 1*@toVw solid #666666;
...@@ -877,13 +755,14 @@ export default { ...@@ -877,13 +755,14 @@ export default {
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
& > div { & > div {
margin: 10 * @toVw 0; margin: 10 * @toVw 0;
width: 54 * @toVw; width: 86 * @toVw;
padding: 6 * @toVw 11 * @toVw; padding: 6 * @toVw 11 * @toVw;
text-align: left; text-align: left;
display: inline-block; display: inline-block;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
text-align: center; text-align: center;
border: 1px solid rgba(200, 205, 220, 1); border: 1px solid rgba(200, 205, 220, 1);
box-sizing: border-box;
&:first-child { &:first-child {
border-bottom: 1 * @toVw solid #eee; border-bottom: 1 * @toVw solid #eee;
} }
...@@ -892,154 +771,286 @@ export default { ...@@ -892,154 +771,286 @@ export default {
border: 3px solid rgba(64, 169, 255, 1); border: 3px solid rgba(64, 169, 255, 1);
} }
} }
.age-block { .btn-block {
&.video { position: relative;
display: block; text-align: center;
z-index: 100;
.change-block {
border-radius: 1000 * @toVw;
width: 144 * @toVw;
border: 1 * @toVw solid #40a9ff;
&:after {
content: "";
display: block;
clear: both;
}
div {
float: left;
width: 50%;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
height: 28 * @toVw;
line-height: 28 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(204, 204, 204, 1);
&.active {
background: #40a9ff;
color: white;
}
}
} }
} }
.ageclass { .parent-finish {
position: fixed; position: fixed;
top: 30 * @toVw; bottom: 2 * @toVw;
left: 100 * @toVw; width: 100%;
z-index: 100; left: 0;
& > div { // top: 500 * @toVw;
display: block; .finish-block {
position: absolute;
width: 100%;
left: 0;
padding: 0;
margin: 0;
text-align: center;
bottom: 0;
img {
width: 202 * @toVw;
}
} }
} }
.video-block { }
}
.change-block-HP {
display: none;
}
@media screen and (orientation: landscape) {
@toVw: 100/667vw;
.videoTitle {
.fr {
display: none; display: none;
&.hp-video {
display: inline-block;
margin: 0 10 * @toVw 0 0;
border: none;
height: 100%;
border-radius: 12 * @toVw;
padding: 0;
}
video {
height: 100%;
margin: auto;
width: auto;
display: block;
background: rgba(0, 0, 0, 0.4);
border-radius: 8 * @toVw;
}
} }
.btn-block { }
position: relative; .video-page {
width: 140 * @toVw; position: absolute;
// display: block; top: 5 * @toVw;
bottom: 5 * @toVw;
left: 5 * @toVw;
right: 5 * @toVw;
background: rgba(255, 255, 255, 1);
overflow: auto;
border-radius: 8 * @toVw;
.content {
position: static;
height: 100%; height: 100%;
.age-block { width: 100%;
display: block; display: flex;
position: static; border-radius: 8px;
padding: 0; padding: 0;
height: 28 * @toVw; .header {
width: 88 * @toVw; display: none;
line-height: 28 * @toVw; }
border: 1 * @toVw solid #666; .age-change-block {
border-radius: 100 * @toVw; &.video {
font-size: 12 * @toVw; top: 33 * @toVw;
right: 0;
left: auto;
z-index: 1231;
background: white;
width: 80 * @toVw;
position: absolute;
& > div {
margin: 0;
width: 100%;
padding: 6 * @toVw 11 * @toVw;
text-align: left;
display: inline-block;
border-radius: 8 * @toVw;
text-align: center;
border: none;
&:first-child {
border-bottom: 1 * @toVw solid #eee;
}
}
}
display: inline-block;
// position: absolute;
// top: 37*@toVw;
top: 367 * @toVw;
left: 0;
width: 196 * @toVw;
// border-radius: 8*@toVw;
// border: 1*@toVw solid #666666;
font-size: 12px;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
font-weight: 500; font-weight: 500;
color: rgba(102, 102, 102, 1); color: rgba(102, 102, 102, 1);
& > div {
margin: 10 * @toVw 0;
width: 54 * @toVw;
padding: 6 * @toVw 11 * @toVw;
text-align: left;
display: inline-block;
border-radius: 8 * @toVw;
text-align: center;
border: 1px solid rgba(200, 205, 220, 1);
&:first-child {
border-bottom: 1 * @toVw solid #eee;
}
}
.activity {
border: 3px solid rgba(64, 169, 255, 1);
}
}
.age-block {
&.video { &.video {
display: block; display: block;
} }
} }
.change-block-HP { .ageclass {
position: absolute; position: fixed;
top: ~"calc(100vh - 12.5vw)"; top: 30 * @toVw;
display: block; left: 100 * @toVw;
width: 78 * @toVw; z-index: 100;
img { & > div {
width: 100%; display: block;
} }
} }
.change-block { .video-block {
display: none; display: none;
&.hp-video {
display: inline-block;
margin: 0 10 * @toVw 0 0;
border: none;
height: 100%;
border-radius: 12 * @toVw;
padding: 0;
}
video {
height: 100%;
margin: auto;
width: auto;
display: block;
background: rgba(0, 0, 0, 0.4);
border-radius: 8 * @toVw;
}
}
.btn-block {
position: relative;
width: 140 * @toVw;
// display: block;
height: 100%;
.age-block {
display: block;
position: static;
padding: 0;
height: 28 * @toVw;
width: 88 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
&.video {
display: block;
}
}
.change-block-HP {
position: absolute;
top: ~"calc(100vh - 12.5vw)";
display: block;
width: 78 * @toVw;
img {
width: 100%;
}
}
.change-block {
display: none;
}
} }
} }
} }
} }
}
@media screen and (min-aspect-ratio: ~"20/8") { @media screen and (min-aspect-ratio: ~"20/8") {
@toVw: 100/900vw; @toVw: 100/900vw;
.video-page { .video-page {
position: absolute; position: absolute;
top: 5 * @toVw; top: 5 * @toVw;
bottom: 5 * @toVw; bottom: 5 * @toVw;
left: 5 * @toVw; left: 5 * @toVw;
right: 5 * @toVw; right: 5 * @toVw;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
overflow: auto; overflow: auto;
border-radius: 8 * @toVw; border-radius: 8 * @toVw;
.content { .content {
position: static; position: static;
height: 100%;
width: 100%;
display: flex;
border-radius: 8px;
padding: 0;
.header {
display: none;
}
.video-block {
display: none;
&.hp-video {
display: inline-block;
margin: 0 10 * @toVw 0 0;
border: none;
height: 100%;
border-radius: 12 * @toVw;
padding: 0;
}
video {
height: 100%;
margin: auto;
width: auto;
display: block;
background: rgba(0, 0, 0, 0.4);
border-radius: 8 * @toVw;
}
}
.btn-block {
position: relative;
min-width: 90 * @toVw;
display: block;
height: 100%; height: 100%;
.age-block { width: 100%;
display: block; display: flex;
position: static; border-radius: 8px;
padding: 0; padding: 0;
height: 28 * @toVw; .header {
width: 88 * @toVw; display: none;
line-height: 28 * @toVw; }
border: 1 * @toVw solid #666; .video-block {
border-radius: 100 * @toVw; display: none;
font-size: 12 * @toVw; &.hp-video {
font-family: PingFang-SC-Medium; display: inline-block;
font-weight: 500; margin: 0 10 * @toVw 0 0;
color: rgba(102, 102, 102, 1); border: none;
&.video { height: 100%;
border-radius: 12 * @toVw;
padding: 0;
}
video {
height: 100%;
margin: auto;
width: auto;
display: block; display: block;
background: rgba(0, 0, 0, 0.4);
border-radius: 8 * @toVw;
} }
} }
.change-block-HP { .btn-block {
position: absolute; position: relative;
top: ~"calc(100vh - 12.5vw)"; min-width: 90 * @toVw;
display: block; display: block;
width: 78 * @toVw; height: 100%;
img { .age-block {
width: 100%; display: block;
position: static;
padding: 0;
height: 28 * @toVw;
width: 88 * @toVw;
line-height: 28 * @toVw;
border: 1 * @toVw solid #666;
border-radius: 100 * @toVw;
font-size: 12 * @toVw;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(102, 102, 102, 1);
&.video {
display: block;
}
}
.change-block-HP {
position: absolute;
top: ~"calc(100vh - 12.5vw)";
display: block;
width: 78 * @toVw;
img {
width: 100%;
}
}
.change-block {
display: none;
} }
}
.change-block {
display: none;
} }
} }
} }
} }
}
</style> </style>
...@@ -40,9 +40,9 @@ Vue.prototype.$throw = (error)=> errorHandler(error,this); ...@@ -40,9 +40,9 @@ Vue.prototype.$throw = (error)=> errorHandler(error,this);
Vue.prototype.$common = common Vue.prototype.$common = common
//VConsole关闭屏蔽代码 //VConsole关闭屏蔽代码
if (process.env.NODE_ENV != 'production') { // if (process.env.NODE_ENV != 'production') {
new VConsole(); // new VConsole();
} // }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
next() next()
......
...@@ -39,7 +39,7 @@ const router = new Router({ ...@@ -39,7 +39,7 @@ const router = new Router({
deep: 0, deep: 0,
} }
}, },
{ {
path: '/extensionV1Shop', path: '/extensionV1Shop',
name: 'extensionV1Shop', name: 'extensionV1Shop',
...@@ -539,6 +539,24 @@ const router = new Router({ ...@@ -539,6 +539,24 @@ const router = new Router({
noNew: true, noNew: true,
} }
}, },
// 评价页面
{
path: '/evaluate',
name: 'evaluate',
component: e => require(['@/components/newLesson/evaluate'], e),
meta: {
noNew: true,
}
},
// 成长记录
{
path: '/growthRecord',
name: 'growthRecord',
component: e => require(['@/components/growthRecord'], e),
meta: {
noNew: true,
}
},
{ {
path: '*', path: '*',
component: () => import('@/components/error'), component: () => import('@/components/error'),
...@@ -640,7 +658,7 @@ router.beforeEach((to, from, next) => { ...@@ -640,7 +658,7 @@ router.beforeEach((to, from, next) => {
localStorage.setItem('retUrl', to.fullPath); localStorage.setItem('retUrl', to.fullPath);
// console.log(process.env.AUTHOR_UEL) // console.log(process.env.AUTHOR_UEL)
// console.log(window.location.href) // console.log(window.location.href)
if (to.meta.noNew) { if (to.meta.noNew) {
query.is_new_user_url = 1; query.is_new_user_url = 1;
window.location.href = `${process.env.AUTHOR_UEL}` window.location.href = `${process.env.AUTHOR_UEL}`
......
...@@ -370,3 +370,19 @@ export const postErrorLogApi = function (json) { ...@@ -370,3 +370,19 @@ export const postErrorLogApi = function (json) {
return Vue.prototype.$post(`api/client/report/errors/log`, json) return Vue.prototype.$post(`api/client/report/errors/log`, json)
}; };
// 用户成长记录添加
export const postUserGrowthAddApi = function (periods_id, category_id, element_id, json) {
return Vue.prototype.$post(`api/client/user/growth/record/${ periods_id }/${ category_id }/${ element_id }`, json)
};
// 用户成长记录列表
export const getUserGrowthListApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/client/user/growth/record/list`)
};
//
const getUserGrowthRecordUrl = `${_baseUrl}api/client/growth/record/`
export const getUserGrowthRecordApi = function (periods_id, category_id, element_id) {
return Vue.prototype.$fetch(`${getUserGrowthRecordUrl}${periods_id}/${category_id}/${element_id}`)
};
...@@ -27,6 +27,7 @@ import mine_star_inner from '../assets/star_inner.png' ...@@ -27,6 +27,7 @@ import mine_star_inner from '../assets/star_inner.png'
import mine_address from '../assets/icon_ad@2x.png' import mine_address from '../assets/icon_ad@2x.png'
import mine_son from '../assets/icon_son@3x.png' import mine_son from '../assets/icon_son@3x.png'
import mine_mom from '../assets/icon_mom@3x.png' import mine_mom from '../assets/icon_mom@3x.png'
import yizi from '../assets/yezi.png'
import shop_wechat from '../assets/shop/qr3.png' import shop_wechat from '../assets/shop/qr3.png'
import qr4 from '../assets/shop/qr4.png' import qr4 from '../assets/shop/qr4.png'
...@@ -83,6 +84,15 @@ import spcShop6 from '../assets/spcShop/img6@2x.png' ...@@ -83,6 +84,15 @@ import spcShop6 from '../assets/spcShop/img6@2x.png'
import spcShop7 from '../assets/spcShop/img_head@2x.png' import spcShop7 from '../assets/spcShop/img_head@2x.png'
import spcShop8 from '../assets/spcShop/btn@2x.png' import spcShop8 from '../assets/spcShop/btn@2x.png'
// 评价图片
import scoringCategory1 from '../assets/evaluate/scoring-category1.png'
import scoringCategory2 from '../assets/evaluate/scoring-category2.png'
import scoringCategory3 from '../assets/evaluate/scoring-category3.png'
import scoringCategory1Active from '../assets/evaluate/scoring-category1-active.png'
import scoringCategory2Active from '../assets/evaluate/scoring-category2-active.png'
import scoringCategory3Active from '../assets/evaluate/scoring-category3-active.png'
import xiajiantou from '../assets/evaluate/xiajiantou.png'
// 直购页 // 直购页
export const spcShopImg = { export const spcShopImg = {
spcShop1:spcShop1, spcShop1:spcShop1,
...@@ -171,7 +181,8 @@ export const mineImage = { ...@@ -171,7 +181,8 @@ export const mineImage = {
mine_star_inner:mine_star_inner, mine_star_inner:mine_star_inner,
mine_address:mine_address, mine_address:mine_address,
mine_son:mine_son, mine_son:mine_son,
mine_mom:mine_mom mine_mom:mine_mom,
yizi: yizi
}; };
// 商品成功 // 商品成功
export const shopSuccess = { export const shopSuccess = {
...@@ -197,4 +208,14 @@ export const previewImg = { ...@@ -197,4 +208,14 @@ export const previewImg = {
previewpic9:previewpic9, previewpic9:previewpic9,
previewpic10:previewpic10, previewpic10:previewpic10,
previewBtn:previewBtn previewBtn:previewBtn
}; };
\ No newline at end of file
export const scoringCategory = {
scoringCategory1: scoringCategory1,
scoringCategory2: scoringCategory2,
scoringCategory3: scoringCategory3,
scoringCategory1Active: scoringCategory1Active,
scoringCategory2Active: scoringCategory2Active,
scoringCategory3Active: scoringCategory3Active,
xiajiantou: xiajiantou
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment