diff --git a/app.json b/app.json index aa3799d..87826df 100644 --- a/app.json +++ b/app.json @@ -86,7 +86,7 @@ ], "permission": { "scope.userLocation": { - "desc": "你的位置信息将用获取最近的打包厂" + "desc": "您的位置信息将用于获取您所在城市的最新纸厂报价、行情、咨询、排队扣点等信息,纸通宝为您提供更好的服务。" } }, "window": { diff --git a/pages/agent/factory/index.js b/pages/agent/factory/index.js index 260c7bc..eee7d92 100644 --- a/pages/agent/factory/index.js +++ b/pages/agent/factory/index.js @@ -95,14 +95,9 @@ Page({ return } if (this.data.fixed) { - this.setData({ - tabIndex: parseInt(detail.index), - toView: 'sticky' - }) + this.setData({ tabIndex: parseInt(detail.index), toView: 'sticky' }) } else { - this.setData({ - tabIndex: parseInt(detail.index) - }) + this.setData({ tabIndex: parseInt(detail.index) }) } if (this.data.tabIndex == 1 && !this.data.momentList.length) { this.fetchMomentList() @@ -118,15 +113,11 @@ Page({ if (this.data.cateIndex == e.currentTarget.dataset.index) { return } - this.setData({ - cateIndex: e.currentTarget.dataset.index - }) + this.setData({ cateIndex: e.currentTarget.dataset.index }) }, saleGood: function (e) { if (!app.globalData.userInfo) { - wx.navigateTo({ - url: '/pages/login/index' - }) + wx.navigateTo({ url: '/pages/login/index' }) return } if(!this.data.factoryDetail.isOperations){ @@ -210,30 +201,24 @@ Page({ event.remove('EventMessage', this) }, onAttentionChange: function (e) { - var model = { - follow: null, - paperMillId: this.data.id + if(!app.globalData.userInfo){ + wx.navigateTo({ url: '/pages/login/index' }) + return } + var model = { follow: null, paperMillId: this.data.id } if (e.currentTarget.dataset.cid == false) { //关注 - this.setData({ - hasFollowed: true, - }) + this.setData({ hasFollowed: true, }) model.follow = true this.userPushFollowMillFct(model) setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) - - } if (e.currentTarget.dataset.cid == true) { //取消关注 - this.setData({ - hasFollowed: false, - }) + this.setData({ hasFollowed: false }) model.follow = false this.userPushFollowMillFct(model) setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) - } }, userPushFollowMillFct: function (model) { diff --git a/pages/index/index.js b/pages/index/index.js index 0415f99..66f70ca 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -24,6 +24,7 @@ Page({ path: null, landInfo: null, visible: false, + inited: false, show: false, cityList: [], historyList: [], @@ -81,6 +82,7 @@ Page({ }) }, defaultIndex: function () { + this.data.inited = true this.locationing() this.onResume() if (this.data.path && '/pages/index/index' != this.data.path) { @@ -206,7 +208,9 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - this.onResume() + if(this.data.inited){ + this.onResume() + } // 如果定位完成,但是还是没有获取城市信息,那么就要进行城市选择 if(this.located && util.isEmpty(app.nowCity)){ wx.navigateTo({url: `/pages/home/city-select/index?type=1` }) diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index 5019356..f21122f 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -52,7 +52,15 @@ Page({ this.setData({ focus: false }) }, onTabChange: function({detail}){ - + if(this.data.tabIndex == Number(detail.index)){ + return + } + this.data.tabIndex = Number(detail.index) + if (!app.globalData.userInfo && this.data.tabIndex == 3) { + wx.navigateTo({ url: '/pages/login/index' }) + return + } + this.onSearchList({ detail:{value: this.data.form.name} }) }, onSearchList: function({detail}){ this.data.form.name = detail.value