Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
d8b1117acf
2 changed files with 13 additions and 9 deletions
  1. 16
      pages/moment/moment-item/index.js
  2. 6
      pages/moment/moment-item/index.wxml

16
pages/moment/moment-item/index.js

@ -3,7 +3,6 @@ const util = require('../../../utils/util')
import { userPushFollowMill } from "../../../api/ztb"
import { getMillPaperList } from "../../../api/moment"
const app = getApp()
var requesting = false
Component({
options: {
@ -17,7 +16,8 @@ Component({
data: {
unflod: false,
loading: false,
itemList: [2]
requesting: false,
itemList: []
},
methods: {
onFlodTap: function(){
@ -45,18 +45,18 @@ Component({
util.navigateTo('/pages/article/detail/index?id=' + this.data.item.id)
},
fetchItemList: function(){
if (requesting) {
if (this.data.requesting) {
return
}
requesting = true
getMillPaperList({ paperMillId: 1, date: '' }).then(result => {
this.setData({ requesting: true })
getMillPaperList({ paperMillId: this.data.item.paperMillId, date: this.data.item.latestQuoteTime }).then(result => {
if (result.data.records.length) {
this.setData({ orderList: result.data.records })
this.setData({ requesting: false, orderList: result.data.records })
} else {
requesting = false
this.setData({ requesting: false })
}
}).catch(err => {
requesting = false
this.setData({ requesting: false })
})
},
agentOrder: function(e){

6
pages/moment/moment-item/index.wxml

@ -20,9 +20,13 @@
<text class="cuIcon-triangle{{unflod ? 'upfill': 'downfill'}}" style="font-size:48rpx;padding-top: 4rpx;color: #ccc;" bindtap="onFlodTap"></text>
</view>
<view style="display: {{ unflod ? 'block' : 'none'}};padding:16rpx 24rpx;">
<view class="list-empty" style="height:240rpx" wx:if="{{!itemList.length}}">
<view class="list-empty" style="height:240rpx" wx:if="{{requesting}}">
<view class="load-spinner text-gray" />
</view>
<view class="list-empty" style="height:240rpx" catchtap="fetchItemList" wx:elif="{{!requesting && !itemList.length}}">
<!-- <image class="img-empty" src="/assets/image/list_empty.png"></image> -->
<view class="text-empty">暂无数据,点击刷新</view>
</view>
<view wx:else>
<view class="flex" style="padding-bottom: 16rpx;">
<view style="width: 30%;padding-left: 32rpx;">品类</view>

Loading…
Cancel
Save