Commit 3865b055 authored by IvyXia123's avatar IvyXia123

三颗星不显示问题

parent 1d1f6e63
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
item.month[k][0].ataer = 1; item.month[k][0].ataer = 1;
// 数据重新整合 // 数据重新整合
for(let i = 0; i < item.month[k].length; i++) { for(let i = 0; i < item.month[k].length; i++) {
// console.log(new Date(item.month[k][i].created_at).getDate());
// new Date(returns.openData).getDate()
item.monthArr.push(item.month[k][i]) item.monthArr.push(item.month[k][i])
} }
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="skip-text" @click="skipTextClick">跳过</div> <div class="skip-text" @click="skipTextClick">跳过</div>
</div> </div>
<div v-if="shareShow"> <div v-if="shareShow">
<share-page @closeShare="closeShare()" :route="query" /> <share-page @closeShare="closeShare()" :route="query" :totalStarNum="totalStarNum"/>
</div> </div>
</div> </div>
</template> </template>
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
growthRecord: growthRecord, growthRecord: growthRecord,
scoringCategoryImage: scoringCategory, scoringCategoryImage: scoringCategory,
shareShow: false, shareShow: false,
query: {} query: {},
totalStarNum: 0
} }
}, },
components: { components: {
...@@ -99,19 +100,20 @@ ...@@ -99,19 +100,20 @@
*/ */
async userCategoryClick() { async userCategoryClick() {
let checkboxPutContenteditable = document.querySelector('.checkbox-put-contenteditable'); let checkboxPutContenteditable = document.querySelector('.checkbox-put-contenteditable');
let classQuery = JSON.parse(sessionStorage.getItem("classQuery")), // 获取elementId,category_id,periods_id let nowTime = Date.parse(new Date()), // 时间
nowTime = Date.parse(new Date()), // 时间 classQuery = JSON.parse(sessionStorage.getItem("classQuery")), // 获取elementId,category_id,periods_id
lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")),// 获取延长时间 lessonDetail = JSON.parse(localStorage.getItem("lessonDetail")),// 获取延长时间
lookTime = (nowTime - lessonDetail.nowTime) / 1000, lookTime = (nowTime - lessonDetail.nowTime) / 1000,
watchLog = { page_type: 0, page_id: 7, stay_time: lookTime }; 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 } let data = { interest: this.imageNum, concert: this.imageNum2, parent_child: this.imageNum3, growth_record: checkboxPutContenteditable.innerHTML }
// 字数限制 // 字数限制
if(checkboxPutContenteditable.innerHTML.length > 15 && checkboxPutContenteditable.innerHTML.length < 100) { if(this.imageNum !== 0 && this.imageNum2 !== 0 && this.imageNum3 !== 0) {
if(this.imageNum !== 0 || this.imageNum !== 0 || this.imageNum !== 0) { if(checkboxPutContenteditable.innerHTML.length > 15 && checkboxPutContenteditable.innerHTML.length < 100) {
// 提交评价页面 // 提交评价页面
const postUserGrowthAddData = await postUserGrowthAddApi(classQuery.elementId, classQuery.category_id, classQuery.periods_id, data) 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) const subUserLessonDatac = await subUserLessonApi(classQuery.elementId, classQuery.category_id, classQuery.periods_id, watchLog)
this.totalStarNum = subUserLessonDatac.total_star_num
// 删除缓存 // 删除缓存
localStorage.removeItem("cache"); localStorage.removeItem("cache");
// 展示网页生成图片 // 展示网页生成图片
...@@ -123,15 +125,14 @@ ...@@ -123,15 +125,14 @@
buttonName:'提交成长记录加一颗星' buttonName:'提交成长记录加一颗星'
}); });
}else { }else {
Toast("请填写相关信息"); if(checkboxPutContenteditable.innerHTML.length > 100) {
Toast(`您多输入了${ checkboxPutContenteditable.innerHTML.length - 100 }个字`);
}else if(checkboxPutContenteditable.innerHTML.length < 15){
Toast("输入字数不满15个");
}
} }
}else { }else {
if(checkboxPutContenteditable.innerHTML.length > 100) { Toast("请填写相关信息");
console.log(checkboxPutContenteditable.innerHTML.length)
Toast(`您多输入了${ checkboxPutContenteditable.innerHTML.length - 100 }个字`);
}else if(checkboxPutContenteditable.innerHTML.length < 15){
Toast("输入字数不满15个");
}
} }
}, },
skipTextClick() { skipTextClick() {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<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 v-if="totalStarNum == 3">
<div class="diyikexing animated"> <div class="diyikexing animated">
<img :src="diyikexing" alt=""> <img :src="diyikexing" alt="">
</div> </div>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</div>--> </div>-->
</div> </div>
</div> </div>
<img class="canvasImg" @touchstart="touchStart" @touchend="touchEnd" :src="canvasData" alt /> <img class="canvasImg" @touchstart="touchStart" @touchend="touchEnd" :src="canvasData" alt /> <!-- @touchstart="touchStart" -->
<div class="test"></div> <div class="test"></div>
<div class="white-pannel"> <div class="white-pannel">
<div class="trs"></div> <div class="trs"></div>
...@@ -191,10 +191,11 @@ ...@@ -191,10 +191,11 @@
starNum: 0, starNum: 0,
}; };
}, },
props: ["route"], props: ["route", "totalStarNum"],
mounted() { mounted() {
// 判断星星 // 判断星星
this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num
console.log(this.starNum)
Toast.loading({ Toast.loading({
mask: true, mask: true,
message: "", message: "",
...@@ -244,21 +245,21 @@ ...@@ -244,21 +245,21 @@
}); });
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 json = { // let json = {
page_type: 0, // page_type: 0,
page_id: 4, // page_id: 4,
stay_time: 0 // stay_time: 0
}; // };
subUserLessonApi( // subUserLessonApi(
query.elementId, // query.elementId,
query.category_id, // query.category_id,
query.periods_id, // query.periods_id,
json // json
).then(res => { // ).then(res => {
lessonDetail.total_watch_time = res; // lessonDetail.total_watch_time = res;
lessonDetail.nowTime = nowTime; // lessonDetail.nowTime = nowTime;
localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail)); // localStorage.setItem("lessonDetail", JSON.stringify(lessonDetail));
}); // });
}, 800); }, 800);
}, },
touchEnd() { touchEnd() {
......
...@@ -62,8 +62,8 @@ export default { ...@@ -62,8 +62,8 @@ export default {
this.page++; this.page++;
let json = { let json = {
page: this.page, page: this.page,
limit: "50", limit: "100",
source:0, source:'0,5',
periods_id:this.$route.query.starInfo.periods_id periods_id:this.$route.query.starInfo.periods_id
}; };
getUserIntegralListApi(json).then(res => { getUserIntegralListApi(json).then(res => {
......
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