Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
0ff60aa7c5
4 changed files with 25 additions and 28 deletions
  1. 2
      app.json
  2. 35
      pages/agent/factory/index.js
  3. 6
      pages/index/index.js
  4. 10
      pages/mall/search-list/index.js

2
app.json

@ -86,7 +86,7 @@
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用获取最近的打包厂"
"desc": "您的位置信息将用于获取您所在城市的最新纸厂报价、行情、咨询、排队扣点等信息,纸通宝为您提供更好的服务。"
}
},
"window": {

35
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) {

6
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` })

10
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

Loading…
Cancel
Save