Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
db9248f42a
5 changed files with 15 additions and 6 deletions
  1. 7
      pages/moment/attention/index.js
  2. 4
      pages/moment/attention/index.wxml
  3. 4
      pages/moment/moment-item/index.js
  4. 4
      pages/moment/recommend/index.js
  5. 2
      pages/moment/recommend/index.wxml

7
pages/moment/attention/index.js

@ -60,10 +60,15 @@ Component({
this.data.token = true this.data.token = true
this.onRefreshList() this.onRefreshList()
} }
} else if(message.what == 444 && this.firstShow && app.globalData.userInfo){
} else if(message.what == 444 && app.globalData.userInfo){
// this.onRefreshList() // this.onRefreshList()
} else if(message.what == 225 && app.globalData.userInfo){
this.onRefreshList()
} }
}, },
onAttention: function({detail}){
this.onRefreshList()
},
onRefreshList: function(){ onRefreshList: function(){
if(!app.globalData.userInfo || this.data.requesting){ if(!app.globalData.userInfo || this.data.requesting){
return return

4
pages/moment/attention/index.wxml

@ -6,7 +6,7 @@
</wux-skeleton> </wux-skeleton>
<view class="bg-white list-empty" style="height:{{height}}rpx" bindtap="onRefreshList" wx:elif="{{!orderList.length && !loading}}"> <view class="bg-white list-empty" style="height:{{height}}rpx" bindtap="onRefreshList" wx:elif="{{!orderList.length && !loading}}">
<image class="img-empty" src="/assets/image/list_empty.png"></image> <image class="img-empty" src="/assets/image/list_empty.png"></image>
<view class="text-empty">{{ token ? '暂无数据,点击重新加载' : '请登录后加载'}}</view>
<view class="text-empty">{{ token ? '暂无数据,点击重新加载' : '请登录后查看'}}</view>
</view> </view>
<view wx:else> <view wx:else>
<view class="bg-white flex flex-center" style="height: 80rpx;padding: 0rpx 32rpx;"> <view class="bg-white flex flex-center" style="height: 80rpx;padding: 0rpx 32rpx;">
@ -20,7 +20,7 @@
<view class="bg-white" style="padding: 0rpx 32rpx" wx:if="{{pageIndex != 0 || index != 0 }}"> <view class="bg-white" style="padding: 0rpx 32rpx" wx:if="{{pageIndex != 0 || index != 0 }}">
<wux-divider show-text="{{ false }}"></wux-divider> <wux-divider show-text="{{ false }}"></wux-divider>
</view> </view>
<moment-item item="{{item}}"></moment-item>
<moment-item item="{{item}}" bind:attention="onAttention"></moment-item>
</view> </view>
</view> </view>
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> <view wx:if="{{form.pageNum > 1}}" style="padding:20rpx">

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

@ -42,7 +42,9 @@ Component({
} }
this.setData({ loading: true }) this.setData({ loading: true })
userPushFollowMill({ paperMillId: this.data.item.paperMillId, follow: !this.data.item.hasFollowed }).then(result => { userPushFollowMill({ paperMillId: this.data.item.paperMillId, follow: !this.data.item.hasFollowed }).then(result => {
this.setData({ loading: false, ['item.hasFollowed']: !this.data.item.hasFollowed })
this.data.item.hasFollowed = !this.data.item.hasFollowed
this.setData({ loading: false, ['item.hasFollowed']: this.data.item.hasFollowed })
this.triggerEvent("attention", this.data.item)
}).catch(err => { }).catch(err => {
this.setData({ loading: false }) this.setData({ loading: false })
}) })

4
pages/moment/recommend/index.js

@ -1,4 +1,3 @@
// pages/message/index.js
import { getInformationList } from "../../../api/moment" import { getInformationList } from "../../../api/moment"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event') const event = require('../../../utils/event')
@ -59,6 +58,9 @@ Component({
this.data.form.date = date this.data.form.date = date
this.onRefreshList() this.onRefreshList()
}, },
onAttention: function({detail}){
event.emit('EventMessage', { what: 225})
},
onRefreshList: function(){ onRefreshList: function(){
if (this.data.requesting) { if (this.data.requesting) {
return return

2
pages/moment/recommend/index.wxml

@ -20,7 +20,7 @@
<view class="bg-white" style="padding: 0rpx 32rpx" wx:if="{{pageIndex != 0 || index != 0 }}"> <view class="bg-white" style="padding: 0rpx 32rpx" wx:if="{{pageIndex != 0 || index != 0 }}">
<wux-divider show-text="{{ false }}"></wux-divider> <wux-divider show-text="{{ false }}"></wux-divider>
</view> </view>
<moment-item item="{{item}}"></moment-item>
<moment-item item="{{item}}" bind:attention="onAttention"></moment-item>
</view> </view>
</view> </view>
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> <view wx:if="{{form.pageNum > 1}}" style="padding:20rpx">

Loading…
Cancel
Save