Commit 6bb39b51 authored by leiqingsong's avatar leiqingsong

图片显示问题

parent 09fbefc3
...@@ -6,7 +6,7 @@ import request from "@/utils/request"; ...@@ -6,7 +6,7 @@ import request from "@/utils/request";
*/ */
export function inviteCode(userId) { export function inviteCode(userId) {
return request({ return request({
url: `/api/user/registerByQrCode?userId=${userId}`, url: `/api/user/registerByQrCode?height=150&userId=${userId}&width=150`,
responseType: "arraybuffer", responseType: "arraybuffer",
method: "get" method: "get"
}); });
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div <div
class="invite-code" class="invite-code"
v-lazy:background-image="imgSrc" v-lazy:background-image="imgSrc"
:style="`;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
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</template> </template>
<script> <script>
// import { inviteCode } from "@/api/invite"; import { inviteCode } from "@/api/invite";
export default { export default {
name: "Invite", name: "Invite",
data() { data() {
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
timer: null timer: null
}; };
}, },
mounted() { created() {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.inviteCode(); this.inviteCode();
}, 200); }, 200);
...@@ -49,20 +49,20 @@ export default { ...@@ -49,20 +49,20 @@ export default {
} }
}, },
inviteCode() { inviteCode() {
// const _this = this; const _this = this;
// let loading = _this.$toast.loading({ let loading = _this.$toast.loading({
// forbidClick: true, forbidClick: true,
// message: "加载中..." message: "加载中..."
// }); });
const userId = JSON.parse(localStorage.getItem("user")).userId; const userId = JSON.parse(localStorage.getItem("user")).userId;
// inviteCode(userId).then(res => { inviteCode(userId).then(res => {
// if (loading) _this.$toast.clear(); if (loading) _this.$toast.clear();
// _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.btnTimer = setTimeout(() => { this.btnTimer = setTimeout(() => {
this.showBtn = true; this.showBtn = true;
}, 1500); }, 200);
});
// this.imgSrc = `${process.env.VUE_APP_BASE_URL}/shop-mall/api/user/registerByQrCode?height=150&userId=${userId}&width=150`;
}, },
getUserPhoto(res) { getUserPhoto(res) {
let uInt8Array = new Uint8Array(res); let uInt8Array = new Uint8Array(res);
......
<template> <template>
<div class="invitee"> <div class="invitee">
<div class="baseInfo"> <div class="baseInfo">
<img class="avatar" :src="imageUrl + inviteeItem.headImage" alt="用户头像" /> <img
class="avatar"
:src="imageUrl + inviteeItem.headImage"
alt="用户头像"
/>
<span class="userName">{{ inviteeItem.userId }}</span> <span class="userName">{{ inviteeItem.userId }}</span>
</div> </div>
<div class="detail"> <div class="detail">
...@@ -33,7 +37,7 @@ export default { ...@@ -33,7 +37,7 @@ export default {
data() { data() {
return { return {
imageUrl: process.env.VUE_APP_BASE_URL imageUrl: process.env.VUE_APP_BASE_URL
} };
} }
}; };
</script> </script>
......
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