diff --git a/components/themes/diy.vue b/components/themes/diy.vue index 10aae37..3756e4e 100644 --- a/components/themes/diy.vue +++ b/components/themes/diy.vue @@ -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)) { diff --git a/pages/index/image.vue b/pages/index/image.vue index a64db00..ec1511b 100644 --- a/pages/index/image.vue +++ b/pages/index/image.vue @@ -19,6 +19,7 @@ :style="{ background: PageNav.window.navigationBarBackgroundColor }" > + @@ -43,10 +44,10 @@ @confirm="searchinput" /> - - + @@ -67,6 +68,8 @@ :pageId="pageId" :PageNav="PageNav" :loadPageFlag="loadPageFlag" + :isLogin="true" + @showLogin="handerShowLogin" > @@ -88,7 +91,7 @@ - + - + @@ -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 + } }, };