ソースを参照

处理发布、消息页面登录拦截。小程序tabbar光标不变,并且点击返回也会回到上一个光标。

release/210823_需求对对碰
王饶冀 3年前
コミット
fa40c40f8f
3個のファイルの変更10行の追加10行の削除
  1. 9
    0
      components/tabbar/tabbar.js
  2. 1
    4
      pages/msgModule/index.js
  3. 0
    6
      pages/releaseModule/index.js

+ 9
- 0
components/tabbar/tabbar.js ファイルの表示

@@ -48,6 +48,15 @@ Component({
*/
methods: {
tabChange(e) {
if (e.detail.item.text == "发布需求" || e.detail.item.text == "消息") {
if (!app.globalData.customerId) {
app.goLogin();
this.setData({
currentIndex: this.data.currentIndex
})
return
}
}
const url = e.detail.item.pagePath;
wx.redirectTo({ url });
}

+ 1
- 4
pages/msgModule/index.js ファイルの表示

@@ -24,10 +24,7 @@ Page({
},
onShow() {
if (!app.globalData.customerId) {
app.goLogin();
return
}
const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer') || null;
if (businessCommunicationCustomer) {
this.setData({

+ 0
- 6
pages/releaseModule/index.js ファイルの表示

@@ -44,12 +44,6 @@ Page({
}
this.getTags();
},
onShow(){
if (!app.globalData.customerId) {
app.goLogin();
return
}
},
// 输入框输入
textareaInput(e) {
let value = e.detail.value;

読み込み中…
キャンセル
保存