fix: not login
This commit is contained in:
@@ -52,7 +52,10 @@
|
||||
|
||||
<view class="action-buttons">
|
||||
<button class="btn-primary" @tap="navTo('profile')">编辑资料</button>
|
||||
<button class="btn-secondary" open-type="share">
|
||||
<button v-if="isLoggedIn" class="btn-secondary" open-type="share">
|
||||
<text class="share-icon-btn"></text> 分享主页
|
||||
</button>
|
||||
<button v-else class="btn-secondary" @tap="openLoginPopup('请先登录后再分享主页')">
|
||||
<text class="share-icon-btn"></text> 分享主页
|
||||
</button>
|
||||
</view>
|
||||
@@ -175,7 +178,7 @@ onShareTimeline(async () => {
|
||||
|
||||
const handleUserClick = () => {
|
||||
if (!isLoggedIn.value) {
|
||||
loginPopupRef.value.open();
|
||||
openLoginPopup("请先登录");
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/profile",
|
||||
@@ -187,10 +190,16 @@ const handleLogind = async () => {
|
||||
loadUserStats();
|
||||
};
|
||||
|
||||
const openLoginPopup = (message = "请先登录") => {
|
||||
loginPopupRef.value.open();
|
||||
if (message) {
|
||||
uni.showToast({ title: message, icon: "none" });
|
||||
}
|
||||
};
|
||||
|
||||
const navTo = (page) => {
|
||||
if (!isLoggedIn.value) {
|
||||
loginPopupRef.value.open();
|
||||
uni.showToast({ title: "请先登录", icon: "none" });
|
||||
openLoginPopup("请先登录");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user