70 lines
1.6 KiB
Vue
70 lines
1.6 KiB
Vue
<template>
|
|
<div class="content bind-content">
|
|
<!-- 头部 -->
|
|
<div :class="{'header':true,'scroll white':isScrollTop,'white':true}">
|
|
<div class="back" @click="$router.go(-1)"><img src="../../../assets/images/home/expert/back.png" alt=""></div>
|
|
<div class="header-title">手机绑定</div>
|
|
</div>
|
|
<div class="feedback-bg pull-content">
|
|
<ul class="phone-bind">
|
|
<li><span>手机号</span>18683958573</li>
|
|
<li><span>验证码</span><input type="text" value="" placeholder="请输入验证码"/><em>获取验证码</em></li>
|
|
</ul>
|
|
</div>
|
|
<div class="bind-btn">确定</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "bind",
|
|
data() {
|
|
return {
|
|
isScrollTop: false,
|
|
}
|
|
},
|
|
created() {
|
|
this.isScroll = true;
|
|
window.addEventListener("scroll", this.eventScrollTop);
|
|
},
|
|
mounted() {
|
|
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
methods: {
|
|
// 滚动改变样式
|
|
eventScrollTop() {
|
|
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
if (scrollTop >= 5) {
|
|
if (this.isScroll) {
|
|
this.isScroll = false;
|
|
this.isScrollTop = true;
|
|
}
|
|
} else {
|
|
if (!this.isScroll) {
|
|
this.isScroll = true;
|
|
this.isScrollTop = false;
|
|
}
|
|
}
|
|
}
|
|
},
|
|
destroyed() {
|
|
window.removeEventListener("scroll", this.eventScrollTop);
|
|
},
|
|
//keep-alive进入时触发
|
|
activated() {
|
|
this.isScroll = true;
|
|
window.addEventListener("scroll", this.eventScrollTop)
|
|
},
|
|
//keep-alive离开时触发
|
|
deactivated() {
|
|
window.removeEventListener("scroll", this.eventScrollTop);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style> |