From ea21316c09f596a0a0abe410dfcf6b9f45fa81e3 Mon Sep 17 00:00:00 2001 From: "Mr.jiang" <714156421@qq.com> Date: Mon, 26 Aug 2024 17:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E9=99=86=20?= =?UTF-8?q?=E4=B8=8D=E7=99=BB=E9=99=86=E8=83=BD=E7=9C=8B=20=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E8=AF=A6=E6=83=85=E5=BE=97=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 211 +++++++++++++++++++++++++++--------- pages/videoCircle/index.vue | 9 ++ 2 files changed, 170 insertions(+), 50 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 4744ca4..e91704f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -526,9 +526,9 @@ that.getHomeArtificerList(); that.getHomeNearbyList(); }else{ - uni.navigateTo({ - url: '/pages/public/login' - }) + // uni.navigateTo({ + // url: '/pages/public/login' + // }) } that.token = uni.getStorageSync('token'); }, @@ -669,16 +669,32 @@ }); }, goCity(){ - var that = this - uni.navigateTo({ - url:'/pages/index/searchAddress?text='+'index' - }) + let userId = uni.getStorageSync('userId') + if (userId) { + var that = this + uni.navigateTo({ + url:'/pages/index/searchAddress?text='+'index' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, searchBtn(){//搜索按钮 + let userId = uni.getStorageSync('userId') + if (userId) { uni.navigateTo({ url:'/pages/my/fuwuGengduo?searchValue='+this.searchValue }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, input(res) {//搜索 输入框 this.searchValue=res; @@ -687,14 +703,30 @@ this.changeSelectData=e }, shangcheng(){ - uni.navigateTo({ - url:'/package/pages/zysc/index/index' - }) + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url:'/package/pages/zysc/index/index' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, yuedao(text){ - uni.navigateTo({ - url:'/pages/shop/index?text='+text - }) + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url:'/pages/shop/index?text='+text + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, closePopup(type){//提前结束 关闭弹出框 this.type = type @@ -728,9 +760,17 @@ phoneNumber: kefuPhone //仅为示例 }); }else if(kefu == 3){ - uni.navigateTo({ - url: '/my/setting/customer' - }); + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url: '/my/setting/customer' + }); + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + } else{ // #ifdef MP-WEIXIN let that = this @@ -860,31 +900,62 @@ }, chaoji(){//超级满减 - uni.navigateTo({ - url:'/my/wallet/index' - }) + + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url:'/my/wallet/index' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } }, xinren(){//新人专享 - uni.navigateTo({ - url:'/my/hongbao/xinrenhongbao' - }) + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url:'/my/hongbao/xinrenhongbao' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } }, goNavs(e){ - uni.switchTab({ - url:e - }) - }, - goNav(e){ - if(e!=undefined){ - uni.navigateTo({ + let userId = uni.getStorageSync('userId') + if (userId) { + uni.switchTab({ url:e }) }else{ - uni.showToast({ - title:'敬请期待!' + uni.navigateTo({ + url: '/pages/public/login' }) } + + }, + goNav(e){ + let userId = uni.getStorageSync('userId') + if (userId) { + if(e!=undefined){ + uni.navigateTo({ + url:e + }) + }else{ + uni.showToast({ + title:'敬请期待!' + }) + } + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, // chooseItem(item){ @@ -950,9 +1021,17 @@ }, gengduo(){ - uni.reLaunch({ - url:'/pages/therapist/therapist' - }) + let userId = uni.getStorageSync('userId') + if (userId) { + uni.reLaunch({ + url:'/pages/therapist/therapist' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }, getCity(e) { @@ -1112,45 +1191,77 @@ }, goDatail(item){//热门精选,推荐套餐 跳详情 console.log("asdasdasddasd",item) - if(item.type=='114'){ + let userId = uni.getStorageSync('userId') + if (userId) { + if(item.type=='114'){ + uni.navigateTo({ + url:'/pages/shop/qiyeDatail?id='+item.id+'&name='+'index' + }) + }else if(item.type=='104'){ + uni.navigateTo({ + url:'/pages/my/serviceOderDrtail?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon + }) + }else if(this.typeData=='105'){ uni.navigateTo({ - url:'/pages/shop/qiyeDatail?id='+item.id+'&name='+'index' + url:'/pages/my/cikarDrtail?id='+item.id+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon }) - }else if(item.type=='104'){ + }else if(this.typeData=='106'){ uni.navigateTo({ - url:'/pages/my/serviceOderDrtail?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon + url:'/pages/my/fuwuliaochengDetail?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon }) - }else if(this.typeData=='105'){ - uni.navigateTo({ - url:'/pages/my/cikarDrtail?id='+item.id+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon - }) - }else if(this.typeData=='106'){ - uni.navigateTo({ - url:'/pages/my/fuwuliaochengDetail?id='+item.id+'&limit='+this.limit+'&page='+this.page+'&name='+'index'+'&isCanCoupon='+item.isCanCoupon - }) + }else{ + uni.navigateTo({ + url:'/pages/my/fuwuDateil?id='+item.id+'&limit='+this.limit+'&page='+this.page + }) + } }else{ uni.navigateTo({ - url:'/pages/my/fuwuDateil?id='+item.id+'&limit='+this.limit+'&page='+this.page + url: '/pages/public/login' }) } + }, chengFel(item){//大家常买。。。 导航切换 this.currentTabFl=item.id; if(this.currentTabFl=='1'){//大家常买 this.remen() }else if(this.currentTabFl=='2'){// 全部项目 + let userId = uni.getStorageSync('userId') + if (userId) { uni.navigateTo({ url:'/pages/my/fuwuGengduo?text='+'index' }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }else if(this.currentTabFl=='3'){//行业大拿 + let userId = uni.getStorageSync('userId') + if (userId) { uni.navigateTo({ url:'/pages/my/hangyedana' }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + }else{// 女性专区 - uni.navigateTo({ - url:'/pages/my/fuwuxiangm' - }) + let userId = uni.getStorageSync('userId') + if (userId) { + uni.navigateTo({ + url:'/pages/my/fuwuxiangm' + }) + }else{ + uni.navigateTo({ + url: '/pages/public/login' + }) + } + } }, diff --git a/pages/videoCircle/index.vue b/pages/videoCircle/index.vue index 5c3abc4..d66cecd 100644 --- a/pages/videoCircle/index.vue +++ b/pages/videoCircle/index.vue @@ -268,6 +268,15 @@ }, onShow(){ console.log('回到前台'); + let userId = uni.getStorageSync('userId') + if (userId) { + var add=uni.getStorageSync('cityAdderss'); + }else{ + var add=uni.getStorageSync('cityAdderss'); + uni.navigateTo({ + url: '/pages/public/login' + }) + } if(this.isClick){ this.dataList[this.k].state = 'pause'; uni.createVideoContext(this.dataList[this.k].id+''+this.k,this).pause()