Commit ac87ee1e authored by wangwei's avatar wangwei

星星修改

parent c198c9a6
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</template> </template>
<script> <script>
import {sendMobileCodeApi,bindMobileApi} from "../service/api"; import {sendMobileCodeApi,getUserDetailApi,bindMobileApi} from "../service/api";
import logoUrl from '../assets/logo.png' import logoUrl from '../assets/logo.png'
import { Toast } from 'mint-ui'; import { Toast } from 'mint-ui';
import common from '../util/common' import common from '../util/common'
...@@ -165,13 +165,16 @@ ...@@ -165,13 +165,16 @@
if(window.location.href.indexOf('teacher_id') > -1){ if(window.location.href.indexOf('teacher_id') > -1){
json.teacher_id = common.getUrlParam().teacher_id || this.$route.query.teacher_id json.teacher_id = common.getUrlParam().teacher_id || this.$route.query.teacher_id
} }
bindMobileApi(json).then(res=>{ bindMobileApi(json).then(data=>{
if(this.$route.query.retUrl){ getUserDetailApi().then(res=>{
this.$router.push(this.$route.query.retUrl) localStorage.setItem('userDesc',JSON.stringify(res));
}else{ if(this.$route.query.retUrl){
this.$router.push({name:'index'}); this.$router.push(this.$route.query.retUrl)
} }else{
this.flag = true this.$router.push({name:'index'});
}
this.flag = true
})
}).catch(res=>{ }).catch(res=>{
this.refImgCode(); this.refImgCode();
this.flag = true this.flag = true
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<span v-if="item.push_time === '0000-00-00'">课程还未开始哦</span> <span v-if="item.push_time === '0000-00-00'">课程还未开始哦</span>
</div> </div>
</div> </div>
<div class="star-block"> <div class="star-block" v-if="item.push_time !== '0000-00-00'">
<img class="star-img" :src="star_act" v-for="s in item.star_num"> <img class="star-img" :src="star_act" v-for="s in item.star_num">
<img class="star-img" :src="star_def" v-for="s in 3-item.star_num"> <img class="star-img" :src="star_def" v-for="s in 3-item.star_num">
</div> </div>
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
}, },
initPage(){ initPage(){
this.userDetail = JSON.parse(localStorage.getItem('userDesc')); this.userDetail = JSON.parse(localStorage.getItem('userDesc'));
this.toDataURLBase64(res.avatar.replace('http://','https://'), (avatar) =>{ this.toDataURLBase64(this.userDetail.avatar.replace('http://','https://'), (avatar) =>{
this.userDetail.avatar = avatar; this.userDetail.avatar = avatar;
getUserWatchApi().then(res=>{ getUserWatchApi().then(res=>{
this.watchDetail = res; this.watchDetail = res;
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
}); });
}, },
enableShare: function(option) { enableShare: function(option) {
let that = this;
getwechatParam({ getwechatParam({
api_list: 'onMenuShareAppMessage,onMenuShareTimeline', api_list: 'onMenuShareAppMessage,onMenuShareTimeline',
url:window.location.href.split('#')[0] url:window.location.href.split('#')[0]
...@@ -124,9 +125,11 @@ ...@@ -124,9 +125,11 @@
imgUrl: option.shareIcon || 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标 imgUrl: option.shareIcon || 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标
success: function() { success: function() {
console.log('分享成功'); console.log('分享成功');
that.$emit('closeShare')
}, },
cancel: function() { cancel: function() {
console.log('分享失败') console.log('分享失败')
that.$emit('closeShare')
} }
}); });
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
...@@ -135,9 +138,10 @@ ...@@ -135,9 +138,10 @@
link: option.shareUrl, // 分享链接 link: option.shareUrl, // 分享链接
imgUrl: option.shareIcon || 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标 imgUrl: option.shareIcon || 'https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png', // 分享图标
success: function() { success: function() {
that.$emit('closeShare')
}, },
cancel: function() { cancel: function() {
that.$emit('closeShare')
} }
}); });
}) })
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="good-content" v-if="goodsDetail"> <div class="good-content" v-if="goodsDetail">
<div class="content" v-html="goodsDetail.desc.detail"> <div class="content" v-html="goodsDetail.desc.detail">
</div> </div>
<div class="btn-block"> <div class="btn-block" ref="btn_block">
<div class="btn" @click="toBuy"> <div class="btn" @click="toBuy">
快去报名 快去报名
</div> </div>
...@@ -61,7 +61,16 @@ ...@@ -61,7 +61,16 @@
} }
}, },
mounted(){ mounted(){
this.initPage() this.initPage();
window.onscroll= ()=>{
//变量t是滚动条滚动时,距离顶部的距离
let t = document.documentElement.scrollTop||document.body.scrollTop;
if(t>500){
this.$refs.btn_block.style.opacity = 1
}else{
this.$refs.btn_block.style.opacity = 0
}
}
} }
} }
</script> </script>
...@@ -120,7 +129,7 @@ ...@@ -120,7 +129,7 @@
} }
.good-content{ .good-content{
background: #00E0AE; background: #00E0AE;
padding: 0 20*@toVw 0*@toVw 20*@toVw; padding: 0 20*@toVw 80*@toVw 20*@toVw;
.content{ .content{
background: white; background: white;
border-radius: 8*@toVw; border-radius: 8*@toVw;
...@@ -129,6 +138,13 @@ ...@@ -129,6 +138,13 @@
} }
.btn-block{ .btn-block{
padding:8*@toVw; padding:8*@toVw;
position: fixed;
left: 0;
width: 100%;
background: white;
opacity: 0;
transition: all 0.5s;
bottom: 0;
.btn{ .btn{
width: 287*@toVw; width: 287*@toVw;
height: 44*@toVw; height: 44*@toVw;
......
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