Commit c4a47598 authored by IvyXia123's avatar IvyXia123

星星

parent be3fee4f
......@@ -8,7 +8,7 @@
<div class="growthRecord-content-year">{{ item.year }}</div>
<div class="growthRecord-content-children" :data-timer="itemChild.cur_date" v-for="(itemChild, itemIndex) in item.monthArr">
<!-- 月,日 -->
<div class="growthRecord-content-left">
<div class="growthRecord-content-left" :style="{ opacity: itemChild.ataer == 1 ? '1' : '0' }"> <!-- style="opacity: 0;" -->
<span class="day">{{ itemChild.month.split('-')[1] }}</span><span class="mouth">{{ itemChild.month.split('-')[0] }}</span>
</div>
<!-- 月日对应的content -->
......@@ -23,11 +23,11 @@
<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 @click="xiajiantou(itemChild.id)" class="xiajiantou" :src="scoringCategoryImage.xiajiantou" alt=""></span>
<div class="rowthRecord-content-sub" @click="xiajiantou(itemChild.id)">
<span class="text" v-html="itemChild.growth_record"></span>
<span class=""><img class="xiajiantou" :src="scoringCategoryImage.xiajiantou" alt=""></span>
</div>
<div class="timer">{{ itemChild.created_at.split(' ')[1] }} {{ itemChild.state }}</div>
<div class="timer">{{ itemChild.created_at.split(' ')[1] }}</div>
</div>
</div>
</div>
......@@ -61,9 +61,15 @@
async userGrowthRecordList() {
const userGrowthRecordData = await getUserGrowthListApi();
userGrowthRecordData.map(item => {
// 重新转化数据
item.monthArr = [];
Object.values(item.month).map(itemchild => item.monthArr.push(itemchild[0]))
for(let k in item.month) {
// 相同日期显示一个
item.month[k][0].ataer = 1;
// 数据重新整合
for(let i = 0; i < item.month[k].length; i++) {
item.monthArr.push(item.month[k][i])
}
}
})
this.scoringCategoryData = userGrowthRecordData;
// 初始化滚动值
......
......@@ -173,7 +173,9 @@
<div style="color: #cccccc;padding: 21.3333vw 0;font-size: 5.3333vw;">快去开始课程吧!</div>
</div>
<div>
<i class="map goLesson" @click="goDetail()"></i>
<i class="goLesson" @click="goDetail()">
<img style="width: 100%; height: 100%;" :src="btn_kechegn" alt="">
</i>
</div>
</div>
</van-popup>
......@@ -193,6 +195,7 @@
import bottomTab from '../public/bottomTab';
import errorURL from '../../assets/error.png'
import nextUnitUrl from '../../assets/newLesson/nextUnit.png'
import btn_kechegn from '../../assets/btn_kechegn.png'
export default {
name: "mapDefault",
components:{
......@@ -232,6 +235,7 @@
noLesson:false,
hpLessonList:[],
thisLesson:null,
btn_kechegn: btn_kechegn,
swiperOption: {
width: window.innerWidth * 0.25,
on: {
......@@ -755,7 +759,7 @@
.actStar{height:20*@toVw;width:20*@toVw;background-position:0 -60*@toVw;display: inline-block}
.clock{height:28*@toVw;width:28*@toVw;background-position:0 -80*@toVw;display: inline-block}
.money{height:40*@toVw;width:40*@toVw;background-position:0 -108*@toVw;display: inline-block;animation: dodge 1s infinite;}
.goLesson{height:59*@toVw;width:136*@toVw;background-position:0 -148*@toVw;display: inline-block;margin-top:15*@toVw;margin-bottom: 10*@toVw }
.goLesson{height:57*@toVw;width:169*@toVw;background-position:0 -148*@toVw;display: inline-block;margin-top:15*@toVw;margin-bottom: 10*@toVw }
.van-actionsheet{
.activit{color: yellowgreen;}
}
......
......@@ -146,14 +146,14 @@
<img ref="imgItem" :src="showObj.audio[index].image" />
</div>
</div>
<div v-if="share_show">
<!--<div v-if="share_show">
<share-page
@backList="backList()"
ref="sharePage"
@closeShare="closeShare()"
:contentData="contentData"
/>
</div>
</div>-->
<audio ref="audioDom" id="audioDom" class="audio" :src="audioPoint"></audio>
</div>
</template>
......@@ -792,7 +792,7 @@
this.share_show = true;
this.$route.params.evaluate = 0
} else {
this.$router.push({path: '/evaluate'})
this.$router.push({name: 'evaluate', query: res})
}
// debugger
});
......
......@@ -41,6 +41,9 @@
</div>
<div class="skip-text" @click="skipTextClick">跳过</div>
</div>
<div v-if="shareShow">
<share-page @closeShare="closeShare()" :route="query" />
</div>
</div>
</template>
......@@ -49,6 +52,7 @@
import { scoringCategory } from "../../util/imgUrl";
import growthRecord from "../../assets/growth_record.png";
import { Toast } from "vant";
import sharePage from "./share";
export default {
name: 'evaluate',
......@@ -61,25 +65,31 @@
myHtmlCode: '',
growthRecord: growthRecord,
scoringCategoryImage: scoringCategory,
shareShow: false,
query: {}
}
},
components: {
sharePage
},
methods: {
/**
* 点击
*/
scoringCategoryClick(num, state) {
let classQuery = JSON.parse(sessionStorage.getItem("classQuery"))
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 }
this.cache = { imageNum: this.imageNum, imageNum2: this.imageNum2, imageNum3: this.imageNum3, id: classQuery.elementId }
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 })
this.cache = Object.assign({}, this.cache, { inner: checkboxPutContenteditable.innerHTML, id: classQuery.elementId })
localStorage.setItem('cache', JSON.stringify(this.cache))
},
/**
......@@ -101,14 +111,17 @@
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.shareShow = true
this.$sa.track('buttonClick',{
tabTitle:'评价',
moduleTitle:'评价',
buttonType:'点击',
buttonName:'提交成长记录加一颗星'
});
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 }})
}
}else {
Toast("可输入15-100字");
......@@ -122,32 +135,39 @@
buttonType:'点击',
buttonName:'提交成长记录不提交跳过'
});
this.$router.push({name: 'newLesson', params: { evaluate: 1, type: 3 }, query: { periods_id: classQuery.periods_id, category_id: classQuery.category_id, elementId: classQuery.elementId }})
this.shareShow = true
},
/**
* 初始化
*/
async userCategoryInit() {
let cacheObj = JSON.parse(localStorage.getItem('cache'))
console.log(cacheObj)
let classQuery = JSON.parse(sessionStorage.getItem("classQuery"))
if( cacheObj ) {
if(cacheObj.id == classQuery.elementId) {
// 从缓存里获取
this.imageNum = cacheObj.imageNum || 0;
this.imageNum2 = cacheObj.imageNum2 || 0;
this.imageNum3 = cacheObj.imageNum3 || 0;
this.myHtmlCode = cacheObj.inner || '';
}else {
localStorage.removeItem("cache");
}
}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;
}
},
closeShare() {
this.shareShow = false
}
},
mounted() {
this.query = this.$route.query
this.userCategoryInit()
}
}
......
......@@ -26,14 +26,14 @@
<span>家宝宝</span>
</div>
</div>
<div v-if="watchDetail" class="main-text">
<div v-if="route" class="main-text">
<div class="item">
<div class>
<img :src="icon_day" alt />
</div>
<div class="text1">已在唱唱学习</div>
<div class="text2">
<span>{{watchDetail.total_day}}</span>
<span>{{route.total_day}}</span>
</div>
</div>
<div class="item">
......@@ -188,11 +188,12 @@
animationBg:false,
dierkexing: dierkexing, // 三颗星第一第三颗
diyikexing: diyikexing, // 第二课星
starNum: 0
starNum: 0,
};
},
props: ["contentData"],
props: ["route"],
mounted() {
// 判断星星
this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num
Toast.loading({
mask: true,
......@@ -202,10 +203,8 @@
this.initPage();
},
beforeDestroy() {
console.log(Date.parse(new Date()) - this.lastTime);
this.lesson.nowTime += Date.parse(new Date()) - this.lastTime;
localStorage.setItem("lessonDetail", JSON.stringify(this.lesson));
console.log(this.lesson.nowTime);
},
methods: {
touchStart() {
......@@ -323,6 +322,7 @@
},
initPage() {
this.watchDetail = this.$store.state.watchDetail;
console.log(this.$store.state, 324423)
// debugger
this.lesson = JSON.parse(localStorage.getItem("lessonDetail"));
this.lesson.domTitle = this.lesson.domTitle.substring(0, 9);
......@@ -335,7 +335,8 @@
if (this.nickname.length >= 6) {
this.nickname = this.nickname.slice(0, 4) + "...";
}
this.minute = (this.watchDetail.stay_time / 60).toFixed();
this.minute = (this.route.stay_time / 60).toFixed();
console.log(this.minute, 2323)
// this.minute = (600/60).toFixed()
if (this.minute < 1) {
this.minute = 1;
......
......@@ -127,9 +127,9 @@
<no-finish-dia />
</div>
</mt-popup>
<div v-if="share_show">
<!--<div v-if="share_show">
<share-page @backList="backList()" @closeShare="closeShare()" :contentData="contentData" />
</div>
</div>-->
<audio ref="audioDom" id="audioDom" class="audio" :src="audioPoint"></audio>
</div>
</template>
......@@ -366,7 +366,7 @@
this.share_show = true;
this.$route.params.evaluate = 0
} else {
this.$router.push({path: '/evaluate'})
this.$router.push({name: 'evaluate', query: res})
}
});
setTimeout(() => {
......
......@@ -39,9 +39,9 @@ Vue.config.errorHandler = errorHandler;
Vue.prototype.$throw = (error)=> errorHandler(error,this);
Vue.prototype.$common = common
//VConsole关闭屏蔽代码
if (process.env.NODE_ENV != 'production') {
new VConsole();
}
// if (process.env.NODE_ENV != 'production') {
// new VConsole();
// }
router.beforeEach((to, from, next) => {
next()
......
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