update 修复发现需要登录没有关闭的问题

This commit is contained in:
qijq 2025-08-19 10:46:22 +08:00
parent 0344e669b4
commit e52a5fd2f3
2 changed files with 46 additions and 12 deletions

View File

@ -973,6 +973,12 @@ export default {
return "diy";
},
},
isLogin:{
type:Boolean,
default(){
return false
}
}
},
data() {
return {
@ -1110,7 +1116,16 @@ export default {
});
},
tplGoToPage: function (e) {
let that = this;
if(this.isLogin){
if(!this.hasLogin){
that.$emit("showLogin",true)
return
}
}
debugger;
var t = e.currentTarget.dataset;
//console.info(t);
switch (parseInt(t.type)) {

View File

@ -19,6 +19,7 @@
:style="{ background: PageNav.window.navigationBarBackgroundColor }"
>
<view class="xx-box" style="position: relative">
<navigator hover-class="none" class="xx" url="/member/member/message">
<view style="position: absolute; right: 44rpx; top: 10rpx">
<uni-badge :text="newMsgNum" type="red" class="badge"></uni-badge>
@ -43,10 +44,10 @@
@confirm="searchinput"
/></view>
<view class="sq_0-box">
<navigator
<view
hover-class="none"
:url="'/community/community/userspace?uid=' + userInfo.user_id"
:class="'sq_0 ' + (istop == true ? 'border22' : '')"
@click="checkLoginBeforeNavigate(`/community/community/userspace?uid=${userInfo.user_id}`)"
>
<image
lazy-load
@ -54,7 +55,7 @@
:src="userInfo.user_avatar"
mode="scaleToFill"
/>
</navigator>
</view>
</view>
<view class="zhanwei"> </view>
</view>
@ -67,6 +68,8 @@
:pageId="pageId"
:PageNav="PageNav"
:loadPageFlag="loadPageFlag"
:isLogin="true"
@showLogin="handerShowLogin"
></diy>
<WaterfallsFlow :wfList="MemberPostsList" @itemTap="choose" />
@ -88,7 +91,7 @@
</block>
</view>
<view class="u-top" v-if="plantformInfo.config.sns_enable">
<view class="u-top" v-if="plantformInfo && plantformInfo.config && plantformInfo.config.sns_enable">
<movable-area class="movableArea">
<movable-view
class="movableView"
@ -110,7 +113,7 @@
</movable-view>
</movable-area>
</view>
<loginPopup :show="showLoginPopup" @close="closeLoginPopup" :showCloseIcon="false"></loginPopup>
<loginPopup :show="showLoginPopup" @close="closeLoginPopup" ></loginPopup>
</view>
</template>
@ -199,12 +202,6 @@ export default {
},
mounted() {
if(!this.hasLogin){
this.showLoginPopup = true
}
let view = uni.createSelectorQuery().in(this).select(".movableArea");
let that = this;
@ -360,6 +357,11 @@ export default {
// item JSON
//console.log(item)
if(!this.hasLogin){
this.showLoginPopup = true
return
}
let url = "/community/community/detail?id=" + item.story_id;
if (item.story_type == 4) {
@ -378,7 +380,21 @@ export default {
this.$.gopage(url);
},
handerShowLogin(){
this.showLoginPopup = true
},
checkLoginBeforeNavigate(url){
if(!this.hasLogin) {
this.showLoginPopup = true
return false
}else{
uni.navigateTo({
url:url
})
}
},
getPostsList: function (force_refresh) {
let that = this;
var params = { page: this.page, rand: 1 };
@ -619,6 +635,9 @@ export default {
duration: 300,
});
},
closeLoginPopup(){
this.showLoginPopup = false
}
},
};
</script>