From f77499fc9efabb27c8c9de31397b8084549db1ef Mon Sep 17 00:00:00 2001 From: IvyXia123 <ivyHsia@126.com> Date: Wed, 4 Sep 2019 22:38:06 +0800 Subject: [PATCH] chess --- src/components/mine/index.vue | 19 +++++++++-- src/components/newLesson/evaluate.vue | 43 +++++++++++++++---------- src/components/newLesson/share.vue | 46 ++++++++++++++++++--------- src/main.js | 6 ++-- 4 files changed, 76 insertions(+), 38 deletions(-) diff --git a/src/components/mine/index.vue b/src/components/mine/index.vue index 569eeccf..68d7e626 100644 --- a/src/components/mine/index.vue +++ b/src/components/mine/index.vue @@ -8,8 +8,8 @@ </div>--> <div class="contentBox"> <div class="left"> - <img class="header-icon" :src="userDetail.avatar" /> - <p class="name">{{userDetail.nickname}}</p> + <img class="header-icon" :src="avatarActive" /> + <p class="name">{{ nicknameActive }}</p> </div> <div class="right"> <p class="id">å¦å‘˜å·ï¼š{{userDetail.user_id}}</p> @@ -102,7 +102,9 @@ export default { phoneNumber: "", starNum: "", addressInfo: {}, - acitivityType:1 + acitivityType:1, + avatarActive: '', + nicknameActive: '' }; }, mounted() { @@ -119,6 +121,17 @@ export default { // getUserAdressApi().then(res => { // this.addressInfo = res; // }); + getUserDetailApi() + .then(res => { + console.log(res) + this.avatarActive = res.avatar + this.nicknameActive = res.nickname + localStorage.setItem("userDesc", JSON.stringify(res)); + }) + .catch(res => { + if (localStorage.getItem("userDesc")) { + } + }); getStarInfoApi().then(res =>{ if(res.code==500){ this.acitivityType = 2 diff --git a/src/components/newLesson/evaluate.vue b/src/components/newLesson/evaluate.vue index b45bced3..9e38d5b4 100644 --- a/src/components/newLesson/evaluate.vue +++ b/src/components/newLesson/evaluate.vue @@ -28,7 +28,8 @@ </ul> <!-- 输入框 --> <div class="checkbox-put"> - <div contenteditable="true" class="checkbox-put-contenteditable" v-text="myHtmlCode" @input="handleInput" placeholder="点击输入å®è´ä»Šå¤©çš„å¦ä¹ è¡¨çŽ°ã€æ”¶èŽ·â€¦"></div> +<!-- <div contenteditable="true" class="checkbox-put-contenteditable" v-text="myHtmlCode" @input="handleInput" placeholder="点击输入å®è´ä»Šå¤©çš„å¦ä¹ è¡¨çŽ°ã€æ”¶èŽ·â€¦"></div>--> + <textarea class="checkbox-put-contenteditable" v-model="myHtmlCode" @change="handleInput"></textarea> <div class="checkbox-text">*å¯è¾“å…¥15-100å—</div> </div> <!-- btn --> @@ -44,6 +45,7 @@ <div v-if="shareShow"> <share-page @closeShare="closeShare()" @backList="backList()" :route="query" :totalStarNum="totalStarNum"/> </div> + <audio ref="audioDom" id="audioDom" class="audio" :src="audioPoint"></audio> </div> </template> @@ -53,6 +55,9 @@ import growthRecord from "../../assets/growth_record.png"; import { Toast } from "vant"; import sharePage from "./share"; + import audioGood from "../../assets/good.mp3"; + import audioGreat from "../../assets/great.mp3"; + import audioPerfect from "../../assets/perfect.mp3"; export default { name: 'evaluate', @@ -68,6 +73,7 @@ shareShow: false, query: {}, totalStarNum: 0, + audioPoint: "", } }, components: { @@ -91,7 +97,7 @@ handleInput(e){ let classQuery = JSON.parse(sessionStorage.getItem("classQuery")) let checkboxPutContenteditable = document.querySelector('.checkbox-put-contenteditable'); - this.cache = Object.assign({}, this.cache, { inner: checkboxPutContenteditable.innerHTML, id: classQuery.elementId }) + this.cache = Object.assign({}, { imageNum: this.imageNum, imageNum2: this.imageNum2, imageNum3: this.imageNum3, inner: this.myHtmlCode, id: classQuery.elementId }) localStorage.setItem('cache', JSON.stringify(this.cache)) }, /** @@ -118,20 +124,7 @@ localStorage.removeItem("cache"); // 展示网页生æˆå›¾ç‰‡ this.shareShow = true - - /*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.audioFn() this.$sa.track('buttonClick',{ tabTitle:'评价', @@ -159,6 +152,22 @@ buttonName:'æäº¤æˆé•¿è®°å½•ä¸æäº¤è·³è¿‡' }); this.shareShow = true + this.audioFn() + }, + audioFn(){ + 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); }, /** * åˆå§‹åŒ– @@ -172,7 +181,7 @@ this.imageNum = cacheObj.imageNum || 0; this.imageNum2 = cacheObj.imageNum2 || 0; this.imageNum3 = cacheObj.imageNum3 || 0; - this.myHtmlCode = cacheObj.inner || ''; + this.myHtmlCode = cacheObj.inner || 0; }else { localStorage.removeItem("cache"); } diff --git a/src/components/newLesson/share.vue b/src/components/newLesson/share.vue index f7b34064..4fcd2377 100644 --- a/src/components/newLesson/share.vue +++ b/src/components/newLesson/share.vue @@ -19,10 +19,10 @@ </div> <img class="shareTitle" :src="shareTitle" /> <div class="head-block"> - <img :src="userDetail.avatar" /> + <img :src="avatarActive" /> </div> <div class="content-title"> - <span class>{{nickname}}</span> + <span class>{{nicknameActive}}</span> <span>å®¶å®å®</span> </div> </div> @@ -89,16 +89,16 @@ <img src="../../assets/icon_copy.png" alt /> <p>以下å¦ä¹ 心得,å¯å¤åˆ¶ç²˜è´´åˆ°æœ‹å‹åœˆå•¦ï¼</p> </div> - <div class="pannel-main" v-html="htmlContent"></div> - <div class="pannel-footer"> + <div class="pannel-main" v-html="htmlContent"></div> + <div class="pannel-footer"> <span @click="changeText"> <img :src="icon_change" alt=""> æ¢ä¸€æ¢</span> + </div> </div> - </div> - <div @click="copyText" class='transparentBtn'> - å¤åˆ¶å¿ƒå¾— - </div> - </div>--> + <div @click="copyText" class='transparentBtn'> + å¤åˆ¶å¿ƒå¾— + </div> + </div>--> </div> </div> <img class="canvasImg" @touchstart="touchStart" @touchend="touchEnd" :src="canvasData" alt /> <!-- @touchstart="touchStart" --> @@ -142,7 +142,8 @@ getUserWatchApi, getShortApi, subUserLessonApi, - postErrorLogApi + postErrorLogApi, + getUserDetailApi } from "../../service/api"; import share_code_bg from "../../assets/newLesson/share-code-bg.png"; import img_logo from "../../assets/newLesson/logo@2x.png"; @@ -189,13 +190,28 @@ dierkexing: dierkexing, // 三颗星第一第三颗 diyikexing: diyikexing, // 第二课星 starNum: 0, + avatarActive: '', + nicknameActive: '' }; }, props: ["route", "totalStarNum"], mounted() { // åˆ¤æ–æ˜Ÿæ˜Ÿ - // this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num - // console.log(this.starNum) + + getUserDetailApi() + .then(res => { + console.log(res) + this.avatarActive = res.avatar + this.nicknameActive = res.nickname + localStorage.setItem("userDesc", JSON.stringify(res)); + }) + .catch(res => { + if (localStorage.getItem("userDesc")) { + } + }); + + this.starNum = JSON.parse(localStorage.getItem('lessonDetail')).star_num + console.log(this.starNum) Toast.loading({ mask: true, message: "", @@ -1295,17 +1311,17 @@ } .animated { - animation: mymove 1s .5s ease; + animation: mymove 1s .5s; animation-fill-mode: forwards; } .animated1 { - animation: mymove 1s 1s ease; + animation: mymove 1s 1s; animation-fill-mode: forwards; } .animated2 { - animation: mymove 1s 1.5s ease; + animation: mymove 1s 1.5s; animation-fill-mode: forwards; } diff --git a/src/main.js b/src/main.js index 93f143e5..82fb1d82 100644 --- a/src/main.js +++ b/src/main.js @@ -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() -- 2.21.0