diff --git a/components/button/index.wxss b/components/button/index.wxss index 66eb9d9..c9b7167 100644 --- a/components/button/index.wxss +++ b/components/button/index.wxss @@ -119,6 +119,20 @@ width: 150rpx; } +.wux-button--attention { + min-height: 40rpx!important; + height: 40rpx!important; + font-size: 20rpx; + line-height: 40rpx; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + max-width: 120rpx; + width: 120rpx; + min-width: 120rpx; + padding: 0rpx; +} + .wux-button--sale { padding: 4rpx 24rpx 2rpx 24rpx; min-width: 180rpx; diff --git a/pages/moment/attention/index.js b/pages/moment/attention/index.js index a3b9a4d..79156cd 100644 --- a/pages/moment/attention/index.js +++ b/pages/moment/attention/index.js @@ -10,8 +10,7 @@ Component({ multipleSlots: true }, properties: { - height: { type: Number, value: 0 }, - item: { type: Object, value: null } + height: { type: Number, value: 0 } }, data: { form: { @@ -57,7 +56,7 @@ Component({ this.onRefreshList() } } else if(message.what == 444 && this.firstShow && app.globalData.userInfo){ - this.onRefreshList() + // this.onRefreshList() } }, onRefreshList: function(){ diff --git a/pages/moment/attention/index.wxml b/pages/moment/attention/index.wxml index 4063bec..a3fc7a8 100644 --- a/pages/moment/attention/index.wxml +++ b/pages/moment/attention/index.wxml @@ -1,7 +1,6 @@ - - + @@ -10,6 +9,12 @@ {{ token ? '暂无数据,点击重新加载' : '请登录后加载'}} + + 纸厂名称 + 涨跌幅 + 车辆排队 + 起扣点 + @@ -18,7 +23,6 @@ - diff --git a/pages/moment/information/index.js b/pages/moment/information/index.js index 7f84743..22e0e80 100644 --- a/pages/moment/information/index.js +++ b/pages/moment/information/index.js @@ -8,17 +8,15 @@ Component({ multipleSlots: true }, properties: { - height: { type: Number, value: 0 }, - item: { type: Object, value: null } + height: { type: Number, value: 0 } }, data: { orderList: [12, 14] }, methods: { onRestart: function () { - console.log('information....start') if(!this.firstShow){ - + this.fetchList() } this.firstShow = true }, diff --git a/pages/moment/moment-item/index.js b/pages/moment/moment-item/index.js index d68acdd..b49334a 100644 --- a/pages/moment/moment-item/index.js +++ b/pages/moment/moment-item/index.js @@ -26,7 +26,7 @@ Component({ this.fetchItemList() } }, - onAttentionChange: function(){ + attention: function(){ if (this.data.loading) { return } diff --git a/pages/moment/moment-item/index.wxml b/pages/moment/moment-item/index.wxml index 0113393..133db66 100644 --- a/pages/moment/moment-item/index.wxml +++ b/pages/moment/moment-item/index.wxml @@ -3,9 +3,10 @@ 东莞金洲 - + + {{loading ? '' : item.hasFollowed ? '已关注' : '点击关注'}} diff --git a/pages/moment/recommend/index.js b/pages/moment/recommend/index.js index 9ddf41c..3052a8f 100644 --- a/pages/moment/recommend/index.js +++ b/pages/moment/recommend/index.js @@ -10,8 +10,7 @@ Component({ multipleSlots: true }, properties: { - height: { type: Number, value: 0 }, - item: { type: Object, value: null } + height: { type: Number, value: 0 } }, data: { form: { @@ -19,7 +18,10 @@ Component({ pageNum: 1, pageSize: 10 }, + loading: false, requesting: false, + token: true, + finished: false, orderList: [] }, lifetimes: { @@ -35,6 +37,7 @@ Component({ if(!this.firstShow){ var min = new Date() min.setHours(0, 0, 0) + this.data.token = app.globalData.userInfo ? true : false this.data.form.date = util.formatDate(min, 'Y-M-D') this.data.form.cityId = app.nowCity.cityCode this.fetchList() @@ -43,11 +46,7 @@ Component({ }, onEvent: function (message) { if(message.what == 888){ - if(!app.globalData.userInfo){ - this.setData({ orderList: [], ['form.pageNum']: 1, finished: false }) - } else { - this.onRefreshList() - } + this.setData({ token: app.globalData.userInfo ? true : false }) } else if(message.what == 444 && this.firstShow){ this.data.form.cityId = app.nowCity.cityCode this.onRefreshList() @@ -61,7 +60,7 @@ Component({ if (this.data.requesting) { return } - this.setData({ orderList: [], ['form.pageNum']: 1, finished: false }) + this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, loading: true }) this.fetchList() }, fetchList: function(){ @@ -70,17 +69,18 @@ Component({ } this.data.requesting = true getInformationList(this.data.form).then(result => { - if (result.data.records.length) { + if (result.data && result.data.records.length) { var respList = result.data.records - let nowList = `orderList[${this.data.orderList2.length}]` + let nowList = `orderList[${this.data.orderList.length}]` var num = this.data.form.pageNum var finished = this.data.form.pageNum >= result.data.pages - this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false }) + this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false, token: this.data.token }) } else { - this.setData({ finished: true, requesting: false }) + + this.setData({ finished: true, requesting: false, loading: false, token: this.data.token }) } }).catch(err => { - this.setData({ requesting: false }) + this.setData({ requesting: false, loading: false, token: this.data.token }) util.showToast(err) }) } diff --git a/pages/moment/recommend/index.wxml b/pages/moment/recommend/index.wxml index 7274b8a..1bfc1ee 100644 --- a/pages/moment/recommend/index.wxml +++ b/pages/moment/recommend/index.wxml @@ -1,32 +1,35 @@ - - - - - + + + - - 纸厂名称 - 涨跌幅 - 车辆排队 - 起扣点 + + + 暂无数据,点击重新加载 - - - - - - + + + 纸厂名称 + 涨跌幅 + 车辆排队 + 起扣点 - - - - - - - {{finished?'到底啦~':'加载中...'}} + + + + + + - + + + + + + {{finished?'到底啦~':'加载中...'}} + + + \ No newline at end of file diff --git a/pages/moment/theall/index.js b/pages/moment/theall/index.js index 02c3bf1..ad9edc1 100644 --- a/pages/moment/theall/index.js +++ b/pages/moment/theall/index.js @@ -23,6 +23,9 @@ Component({ pageNum: 1, pageSize: 10 }, + loading: true, + requesting: false, + finished: false, orderList: [] }, methods: { @@ -65,8 +68,8 @@ Component({ if (this.data.requesting) { return } - this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, requesting: true }) - this.fetchOrderList() + this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, requesting: true, loading: true }) + this.fetchList() }, fetchList: function(){ if (this.data.requesting) { @@ -79,12 +82,12 @@ Component({ let nowList = `orderList[${this.data.orderList2.length}]` var num = this.data.form.pageNum var finished = this.data.form.pageNum >= result.data.pages - this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false }) + this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false }) } else { - this.setData({ finished: true, requesting: false }) + this.setData({ finished: true, requesting: false, loading: false }) } }).catch(err => { - this.setData({ requesting: false }) + this.setData({ requesting: false, loading: false }) util.showToast(err) }) } diff --git a/pages/moment/theall/index.wxml b/pages/moment/theall/index.wxml index 24ae2e9..0fc3bb9 100644 --- a/pages/moment/theall/index.wxml +++ b/pages/moment/theall/index.wxml @@ -1,4 +1,3 @@ - @@ -6,27 +5,38 @@ - - - + + + - - - - - - - + + + 暂无数据,点击重新加载 - - - - - - {{finished?'到底啦~':'加载中...'}} + + + 纸厂名称 + 涨跌幅 + 车辆排队 + 起扣点 + + + + + + + - + + + + + + {{finished?'到底啦~':'加载中...'}} + + + \ No newline at end of file