Browse Source

needvip

featrue/v4.5
xpz2018 4 years ago
parent
commit
d036cee3d6
9 changed files with 20 additions and 12 deletions
  1. 13
      pages/mall/search-list/index.js
  2. 2
      pages/mall/search-list/index.wxml
  3. 3
      pages/moment/attention/index.js
  4. 2
      pages/moment/attention/index.wxml
  5. 2
      pages/moment/moment-item/index.js
  6. 3
      pages/moment/recommend/index.js
  7. 2
      pages/moment/recommend/index.wxml
  8. 3
      pages/moment/theall/index.js
  9. 2
      pages/moment/theall/index.wxml

13
pages/mall/search-list/index.js

@ -2,7 +2,6 @@ import { getFactoryPrice, getProxyOrderList } from "../../../api/ztb"
import { getPreferList, getInformationList } from "../../../api/moment" import { getPreferList, getInformationList } from "../../../api/moment"
const storage = require('../../../utils/storage') const storage = require('../../../utils/storage')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event')
const tdsdk = require('../../../libs/tdweapp.js') const tdsdk = require('../../../libs/tdweapp.js')
const app = getApp() const app = getApp()
const limit = 8 const limit = 8
@ -51,12 +50,13 @@ Page({
this.setData({searchList: rearchStringList, keyIndex: 0 }) this.setData({searchList: rearchStringList, keyIndex: 0 })
} }
} }
event.on('EventMessage', this, this.onEvent)
}, },
onEvent: function (message) {
if(message.what == 223){
this.setData({ visible: true })
}
needVip: function () {
this.setData({ visible: true })
},
onImageClick: function(){
this.setData({ visible: false })
util.navigateTo('/pages/ztbvip/index')
}, },
onClose: function(){ onClose: function(){
this.setData({ visible: false }) this.setData({ visible: false })
@ -243,7 +243,6 @@ Page({
}, },
onUnload: function() { onUnload: function() {
tdsdk.Page.onUnload() tdsdk.Page.onUnload()
event.remove('EventMessage', this)
if(rearchStringList.length){ if(rearchStringList.length){
storage.put('mall-search', rearchStringList.toString()) storage.put('mall-search', rearchStringList.toString())
} }

2
pages/mall/search-list/index.wxml

@ -48,7 +48,7 @@
<wux-divider show-text="{{ false }}"></wux-divider> <wux-divider show-text="{{ false }}"></wux-divider>
</view> </view>
<agent-item item="{{item}}" keyword="{{form.searchKey}}" wx:if="{{tabIndex == 0}}"></agent-item> <agent-item item="{{item}}" keyword="{{form.searchKey}}" wx:if="{{tabIndex == 0}}"></agent-item>
<moment-item item="{{item}}" keyword="{{form.searchKey}}" wx:elif="{{tabIndex == 1}}"></moment-item>
<moment-item item="{{item}}" keyword="{{form.searchKey}}" wx:elif="{{tabIndex == 1}}" bind:vip="needVip"></moment-item>
<order-item item="{{item}}" keyword="{{form.searchKey}}" wx:elif="{{tabIndex == 2}}"></order-item> <order-item item="{{item}}" keyword="{{form.searchKey}}" wx:elif="{{tabIndex == 2}}"></order-item>
<info-item item="{{item}}" keyword="{{form.searchKey}}" wx:else></info-item> <info-item item="{{item}}" keyword="{{form.searchKey}}" wx:else></info-item>
</view> </view>

3
pages/moment/attention/index.js

@ -69,6 +69,9 @@ Component({
onAttention: function({detail}){ onAttention: function({detail}){
this.onRefreshList() this.onRefreshList()
}, },
needVip: function () {
event.emit('EventMessage', {what: 223, desc: 'needvip'})
},
onRefreshList: function(e){ onRefreshList: function(e){
if(!app.globalData.userInfo && e){ if(!app.globalData.userInfo && e){
wx.navigateTo({ url: '/pages/login/index' }) wx.navigateTo({ url: '/pages/login/index' })

2
pages/moment/attention/index.wxml

@ -21,7 +21,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}}" bind:attention="onAttention"></moment-item>
<moment-item item="{{item}}" bind:attention="onAttention" bind:vip="needVip"></moment-item>
</view> </view>
</view> </view>
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> <view wx:if="{{form.pageNum > 1}}" style="padding:20rpx">

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

@ -27,7 +27,7 @@ Component({
return return
} }
if(this.data.item.isCooperate === 1 && !app.globalData.userInfo.isVIP) { if(this.data.item.isCooperate === 1 && !app.globalData.userInfo.isVIP) {
event.emit('EventMessage', {what: 223, desc: 'needvip'})
this.triggerEvent('vip', null)
return return
} }
this.setData({ unflod: !this.data.unflod }) this.setData({ unflod: !this.data.unflod })

3
pages/moment/recommend/index.js

@ -59,6 +59,9 @@ Component({
this.data.form.date = date this.data.form.date = date
this.onRefreshList() this.onRefreshList()
}, },
needVip: function () {
event.emit('EventMessage', {what: 223, desc: 'needvip'})
},
onAttention: function({detail}){ onAttention: function({detail}){
event.emit('EventMessage', { what: 225}) event.emit('EventMessage', { what: 225})
}, },

2
pages/moment/recommend/index.wxml

@ -21,7 +21,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}}" bind:attention="onAttention"></moment-item>
<moment-item item="{{item}}" bind:attention="onAttention" bind:vip="needVip"></moment-item>
</view> </view>
</view> </view>
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx"> <view wx:if="{{form.pageNum > 1}}" style="padding:20rpx">

3
pages/moment/theall/index.js

@ -65,6 +65,9 @@ Component({
} }
return proviceList return proviceList
}, },
needVip: function () {
event.emit('EventMessage', {what: 223, desc: 'needvip'})
},
onTabChange: function({ detail }){ onTabChange: function({ detail }){
if (this.data.tabIndex == Number(detail.index)) { if (this.data.tabIndex == Number(detail.index)) {
return return

2
pages/moment/theall/index.wxml

@ -27,7 +27,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:vip="needVip"></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