Commit 8060b785 authored by leiqingsong's avatar leiqingsong

修改设置界面的bug

parent 5f351d9e
...@@ -62,17 +62,18 @@ class bridgeToAppFun { ...@@ -62,17 +62,18 @@ class bridgeToAppFun {
} }
navigateBack() { navigateBack() {
console.log("返回"); console.log("返回");
// if (this.userAgent === "android") { if (this.userAgent === "android") {
// console.log("an"); console.log("an");
try { try {
const home_url = "https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7"; const home_url =
"https://shop92680967.youzan.com/v2/showcase/homepage?alias=6aFsQ4vCp7";
location.href = home_url; location.href = home_url;
} catch { } catch {
console.log("返回调用失败,都不行"); console.log("返回调用失败,都不行");
} }
// } else { } else {
// jsBridge.callhandler("navigateBack"); jsBridge.callhandler("navigateBack");
// } }
} }
showBottomBar(params) { showBottomBar(params) {
console.log("隐藏底部"); console.log("隐藏底部");
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
}); });
}, },
onRead(file) { onRead(file) {
console.log('读取到图片了', file); console.log("读取到图片了", file);
const inviteCode = JSON.parse(localStorage.getItem("user")).inviteCode; const inviteCode = JSON.parse(localStorage.getItem("user")).inviteCode;
if (!inviteCode) { if (!inviteCode) {
this.$toast.fail("当前用户没有邀请码"); this.$toast.fail("当前用户没有邀请码");
......
...@@ -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" />
<van-cell is-link center title="头像" @click="onModefy"> <van-cell is-link center title="头像" @click="onModefy">
<img class="avatar-img" :src="avatar" alt="头像" /> <img class="avatar-img" :src="imageBaseUrl + avatar" alt="头像" />
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
data() { data() {
return { return {
userName: "", userName: "",
imageBaseUrl: "",
headImage: "", headImage: "",
avatar: "", avatar: "",
fileList: [], fileList: [],
...@@ -65,6 +66,7 @@ export default { ...@@ -65,6 +66,7 @@ export default {
}; };
}, },
created() { created() {
this.imageBaseUrl = process.env.VUE_APP_BASE_URL;
this.getUser(); this.getUser();
}, },
methods: { methods: {
...@@ -73,21 +75,25 @@ export default { ...@@ -73,21 +75,25 @@ export default {
userId: JSON.parse(localStorage.getItem("user")).userId userId: JSON.parse(localStorage.getItem("user")).userId
}; };
console.log("setting-userId", params); console.log("setting-userId", params);
getUserInfo2(params).then(res => { getUserInfo2(params)
.then(res => {
if (res.userId) { if (res.userId) {
localStorage.setItem("user", JSON.stringify(res)); localStorage.setItem("user", JSON.stringify(res));
this.$nextTick(() => { this.$nextTick(() => {
this.userName = res.userId; this.userName = res.userId;
this.inviteeCode = this.inviteeCode =
res.beInvitedCode == 1 ? "请填写推荐人邀请码" : res.beInvitedCode; res.beInvitedCode == 1
// this.avatar = process.env.VUE_APP_BASE_URL + res.headImage; ? "请填写推荐人邀请码"
this.avatar = "http://8.131.244.76:81" + res.headImage; : res.beInvitedCode;
this.avatar = res.headImage;
// this.avatar = "http://8.131.244.76:81" + res.headImage;
this.headImage = res.headImage; this.headImage = res.headImage;
}); });
} }
}).catch(err => { })
.catch(err => {
if (err.response.status === 502) { if (err.response.status === 502) {
this.$toast('服务在升级,请稍后重试') this.$toast("服务在升级,请稍后重试");
} }
}); });
}, },
...@@ -131,16 +137,18 @@ export default { ...@@ -131,16 +137,18 @@ export default {
inviteCode: this.fillCode, inviteCode: this.fillCode,
userId: JSON.parse(localStorage.getItem("user")).userId userId: JSON.parse(localStorage.getItem("user")).userId
}; };
fillInviteCode(params).then(res => { fillInviteCode(params)
.then(res => {
if (res.code == 0) { if (res.code == 0) {
// console.log('成功'); // console.log('成功');
this.inviteeCode = this.fillCode; this.inviteeCode = this.fillCode;
} else { } else {
this.$toast.fail(res.message); this.$toast.fail(res.message);
} }
}).catch(err => { })
.catch(err => {
console.log(err); console.log(err);
this.$toast.fail(err) this.$toast.fail(err);
}); });
}, },
fillInviterCode() { fillInviterCode() {
......
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