Commit 00e7e015 authored by leiqingsong's avatar leiqingsong

Merge branch 'dev_lqs' into 'master'

Dev lqs

See merge request !166
parents 784e02ab 1c1ba10f
...@@ -22,7 +22,8 @@ import { ...@@ -22,7 +22,8 @@ import {
Toast, Toast,
Uploader, Uploader,
Progress, Progress,
Loading Loading,
Lazyload
} from "vant"; } from "vant";
Vue.use(ActionSheet) Vue.use(ActionSheet)
...@@ -47,4 +48,5 @@ Vue.use(ActionSheet) ...@@ -47,4 +48,5 @@ Vue.use(ActionSheet)
.use(Uploader) .use(Uploader)
.use(Progress) .use(Progress)
.use(Toast) .use(Toast)
.use(Loading); .use(Loading)
.use(Lazyload);
<template> <template>
<!-- background-image: url(${imgSrc}) -->
<div <div
class="invite-code" class="invite-code"
:style=" v-lazy:background-image="imgSrc"
`background-image: url(${imgSrc});background-size: 100% 100%;background-repeat: no-repeat;` :style="`;background-size: 100% 100%;background-repeat: no-repeat;`"
"
> >
<div class="nav"> <div class="nav">
<van-icon <van-icon
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
/> />
<!-- <img :src="imgSrc" alt="" class="imgCode" /> --> <!-- <img :src="imgSrc" alt="" class="imgCode" /> -->
</div> </div>
<van-button type @click="onSave">保存</van-button> <van-button v-if="showBtn" type @click="onSave">保存</van-button>
</div> </div>
</template> </template>
<script> <script>
...@@ -24,11 +24,14 @@ export default { ...@@ -24,11 +24,14 @@ export default {
name: "Invite", name: "Invite",
data() { data() {
return { return {
imgSrc: "" imgSrc: "",
showBtn: false,
btnTimer: null,
timer: null
}; };
}, },
mounted() { mounted() {
setTimeout(() => { this.timer = setTimeout(() => {
this.inviteCode(); this.inviteCode();
}, 200); }, 200);
}, },
...@@ -57,6 +60,9 @@ export default { ...@@ -57,6 +60,9 @@ export default {
// _this.imgSrc = _this.getUserPhoto(res); // _this.imgSrc = _this.getUserPhoto(res);
// }); // });
this.imgSrc = `${process.env.VUE_APP_BASE_URL}/shop-mall/api/user/registerByQrCode?height=150&userId=${userId}&width=150`; this.imgSrc = `${process.env.VUE_APP_BASE_URL}/shop-mall/api/user/registerByQrCode?height=150&userId=${userId}&width=150`;
this.btnTimer = setTimeout(() => {
this.showBtn = true;
}, 800);
}, },
getUserPhoto(res) { getUserPhoto(res) {
let uInt8Array = new Uint8Array(res); let uInt8Array = new Uint8Array(res);
...@@ -70,6 +76,10 @@ export default { ...@@ -70,6 +76,10 @@ export default {
let imageUrl = "data:" + imageType + ";base64," + data; let imageUrl = "data:" + imageType + ";base64," + data;
return imageUrl; return imageUrl;
} }
},
destoryed() {
clearTimeout(this.timer);
clearTimeout(this.btnTimer);
} }
}; };
</script> </script>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<van-cell-group class="group-1"> <van-cell-group class="group-1">
<van-cell title="用户名" :value="userName" /> <van-cell title="用户名" :value="userName" />
<!--is-link @click="onModefy" --> <!--is-link @click="onModefy" -->
<van-cell center title="头像"> <van-cell center title="头像" is-link @click="onModefy">
<img class="avatar-img" :src="imageBaseUrl + avatar" alt="头像" /> <img class="avatar-img" :src="imageBaseUrl + avatar" alt="头像" />
</van-cell> </van-cell>
<van-cell title="我的邀请码" :value="myInviteCode" /> <van-cell title="我的邀请码" :value="myInviteCode" />
......
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