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

35
pages/agent/factory/index.js

@ -95,14 +95,9 @@ Page({
return return
} }
if (this.data.fixed) { if (this.data.fixed) {
this.setData({
tabIndex: parseInt(detail.index),
toView: 'sticky'
})
this.setData({ tabIndex: parseInt(detail.index), toView: 'sticky' })
} else { } else {
this.setData({
tabIndex: parseInt(detail.index)
})
this.setData({ tabIndex: parseInt(detail.index) })
} }
if (this.data.tabIndex == 1 && !this.data.momentList.length) { if (this.data.tabIndex == 1 && !this.data.momentList.length) {
this.fetchMomentList() this.fetchMomentList()
@ -118,15 +113,11 @@ Page({
if (this.data.cateIndex == e.currentTarget.dataset.index) { if (this.data.cateIndex == e.currentTarget.dataset.index) {
return return
} }
this.setData({
cateIndex: e.currentTarget.dataset.index
})
this.setData({ cateIndex: e.currentTarget.dataset.index })
}, },
saleGood: function (e) { saleGood: function (e) {
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
wx.navigateTo({
url: '/pages/login/index'
})
wx.navigateTo({ url: '/pages/login/index' })
return return
} }
if(!this.data.factoryDetail.isOperations){ if(!this.data.factoryDetail.isOperations){
@ -210,30 +201,24 @@ Page({
event.remove('EventMessage', this) event.remove('EventMessage', this)
}, },
onAttentionChange: function (e) { 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) { if (e.currentTarget.dataset.cid == false) {
//关注 //关注
this.setData({
hasFollowed: true,
})
this.setData({ hasFollowed: true, })
model.follow = true model.follow = true
this.userPushFollowMillFct(model) this.userPushFollowMillFct(model)
setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000)
} }
if (e.currentTarget.dataset.cid == true) { if (e.currentTarget.dataset.cid == true) {
//取消关注 //取消关注
this.setData({
hasFollowed: false,
})
this.setData({ hasFollowed: false })
model.follow = false model.follow = false
this.userPushFollowMillFct(model) this.userPushFollowMillFct(model)
setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000) setTimeout(() => event.emit('EventMessage', { what: 1101, desc: 'factoryDetails' }), 1000)
} }
}, },
userPushFollowMillFct: function (model) { userPushFollowMillFct: function (model) {

6
pages/index/index.js

@ -24,6 +24,7 @@ Page({
path: null, path: null,
landInfo: null, landInfo: null,
visible: false, visible: false,
inited: false,
show: false, show: false,
cityList: [], cityList: [],
historyList: [], historyList: [],
@ -81,6 +82,7 @@ Page({
}) })
}, },
defaultIndex: function () { defaultIndex: function () {
this.data.inited = true
this.locationing() this.locationing()
this.onResume() this.onResume()
if (this.data.path && '/pages/index/index' != this.data.path) { if (this.data.path && '/pages/index/index' != this.data.path) {
@ -206,7 +208,9 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.onResume()
if(this.data.inited){
this.onResume()
}
// 如果定位完成,但是还是没有获取城市信息,那么就要进行城市选择 // 如果定位完成,但是还是没有获取城市信息,那么就要进行城市选择
if(this.located && util.isEmpty(app.nowCity)){ if(this.located && util.isEmpty(app.nowCity)){
wx.navigateTo({url: `/pages/home/city-select/index?type=1` }) 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 }) this.setData({ focus: false })
}, },
onTabChange: function({detail}){ 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}){ onSearchList: function({detail}){
this.data.form.name = detail.value this.data.form.name = detail.value

Loading…
Cancel
Save