update:优化未登录进入砍价弹窗,以及点击头像登录弹窗

This commit is contained in:
lihaoyuan 2025-11-19 18:12:59 +08:00
parent d069df8461
commit 851b48f822
2 changed files with 76 additions and 25 deletions

View File

@ -3,7 +3,7 @@
<view style="background: rgb(41, 36, 56)">
<view class="bargin" v-if="show == false">
<view class="top-sty">
<view class="user-info">
<view class="user-info" @tap="handleAvatarClick">
<image class="user-img" lazy-load :src="imgPath"></image>
<view class="username">{{ user_nickname }}</view>
</view>
@ -338,7 +338,7 @@
:shareDataDefault="shareData"
ref="shareBoxApp"
></share-box-app>
<loginPopup :show="showLoginPopup" @close="closeLoginPopup"></loginPopup>
<loginPopup :show="showLoginPopup" @close="closeLoginPopup" @loginSuccess="handleLoginSuccess"></loginPopup>
</view>
</template>
@ -441,30 +441,37 @@ export default {
options.uid = paramsArray[3];
}
options.sid
? t.setData({
imgPath: this.userInfo.user_avatar,
user_nickname: this.userInfo.user_nickname,
mid: options.mid,
uid: options.sid,
participantId: this.userInfo.user_id,
pid: options.pid,
})
: t.setData({
imgPath: this.userInfo.user_avatar,
user_nickname: this.userInfo.user_nickname,
mid: options.mid,
uid: options.uid || this.userInfo.user_id,
participantId: this.userInfo.user_id,
pid: options.pid,
});
options.sid
? t.setData({
imgPath: t.userInfo.user_avatar,
user_nickname: t.userInfo.user_nickname,
mid: options.mid,
uid: options.sid,
participantId: t.userInfo.user_id,
pid: options.pid,
})
: t.setData({
imgPath: t.userInfo.user_avatar,
user_nickname: t.userInfo.user_nickname,
mid: options.mid,
uid: options.uid || t.userInfo.user_id,
participantId: t.userInfo.user_id,
pid: options.pid,
});
this.forceUserInfo(function (user) {
t.GetOtherCutPriceActivityList();
});
//t.getTime()
},
//
if (t.hasLogin) {
t.forceUserInfo(function (user) {
t.GetOtherCutPriceActivityList();
});
}
},
onShow: function () {
//
if (!this.hasLogin) {
this.showLoginPopup = true; //
return;
}
this.GetVendorCutPriceEventDetail();
},
onBackPress() {
@ -549,6 +556,43 @@ export default {
}
},
});
},
//
handleAvatarClick() {
const that = this;
if (!that.hasLogin) {
that.showLoginPopup = true; //
return;
}
},
handleLoginSuccess() {
const that = this;
that.showLoginPopup = false; //
// Vuex userInfo
that.getUserInfo();
// 500ms userInfo
setTimeout(() => {
const user_info = that.userInfo || {};
//
that.setData({
imgPath: user_info.user_avatar || "https://media-mall-prod-1259811287.cos.ap-guangzhou.myqcloud.com/static/xcxfile/appicon/default-avatar.png",
user_nickname: user_info.user_nickname || "亲爱的用户",
participantId: user_info.user_id || "",
uid: user_info.user_id || that.uid,
});
//
if (that.mid) {
that.GetVendorCutPriceEventDetail(); //
that.GetOtherCutPriceActivityList(); //
}
// 5. DOM
that.$forceUpdate();
}, 500); // 500ms
},
closeLoginPopup() {
this.showLoginPopup = false;

View File

@ -259,9 +259,16 @@ export default {
UserInfo: user_info,
});
});
//
that.$emit("loginSuccess"); //
that.close();
},
fail: function () {
// 使
that.$emit("loginSuccess");
that.close();
that.$.confirm("登录成功,但获取用户信息失败,请重试");
},
});
},
},