Browse Source

no message

feature/v2.2
xpz2018 4 years ago
parent
commit
b162e2f650
6 changed files with 38 additions and 14 deletions
  1. 2
      app.js
  2. 8
      pages/home/index/index.wxml
  3. 16
      pages/index/index.js
  4. 1
      pages/index/index.json
  5. 1
      pages/index/index.wxml
  6. 24
      pages/process/outside-add/index.js

2
app.js

@ -1,6 +1,6 @@
//app.js //app.js
App({ App({
evn: 1, // 0: 开发版本;1:测试版本;2:生产版本
evn: 0, // 0: 开发版本;1:测试版本;2:生产版本
tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'],
version: '2.3.1', version: '2.3.1',
xAppId: '503258978847953926', xAppId: '503258978847953926',

8
pages/home/index/index.wxml

@ -25,10 +25,10 @@
<view style="padding: 0rpx 28rpx;margin-top:4rpx"> <view style="padding: 0rpx 28rpx;margin-top:4rpx">
<view class="bg-white" style="border-radius: 20rpx;padding-bottom: 12rpx"> <view class="bg-white" style="border-radius: 20rpx;padding-bottom: 12rpx">
<view class="flex flex-justify cell-vip" bindtap="toVip"> <view class="flex flex-justify cell-vip" bindtap="toVip">
<view class="text-black text-sg text-bold">授权截止日期:{{userInfo.expirationTime}}</view>
<view class="flex flex-center">
<text class="text-sg" style="white-space: nowrap">去续费</text>
<van-icon slot="right-icon" name="arrow"/>
<view class="text-sg text-bold {{userInfo.isExpiration ? 'text-red' : 'text-black'}}">授权截止日期:{{userInfo.expirationTime}}</view>
<view class="flex flex-center" wx:if="{{userInfo.isExpiration}}">
<text class="text-sg text-orange" style="white-space: nowrap">去续费</text>
<van-icon slot="right-icon" custom-style="padding-top:4rpx" name="arrow" size="16px"/>
</view> </view>
</view> </view>
<van-grid column-num="4" border="{{fasle}}"> <van-grid column-num="4" border="{{fasle}}">

16
pages/index/index.js

@ -1,6 +1,6 @@
// pages/administ/index.js // pages/administ/index.js
import Scene from './scene' import Scene from './scene'
import { getMessageList } from "../../api/saas"
import { getMessageList, getFactoryLicence } from "../../api/saas"
import { headerFactoryId } from "../../api/user" import { headerFactoryId } from "../../api/user"
const event = require('../../utils/event') const event = require('../../utils/event')
const util = require('../../utils/util') const util = require('../../utils/util')
@ -75,6 +75,7 @@ Scene({
factory.index = nIndex factory.index = nIndex
children.push(factory) children.push(factory)
} }
this.checkLincense()
enterprise.children = children enterprise.children = children
this.data.items.push(enterprise) this.data.items.push(enterprise)
} }
@ -169,9 +170,22 @@ Scene({
if (pageView && this.data.tabIndex != 3) { if (pageView && this.data.tabIndex != 3) {
pageView.fetchStatisticsInfo(true) pageView.fetchStatisticsInfo(true)
} }
this.checkLincense()
event.emit('EventMessage', { what: 999, desc: 'changeFactory' }) event.emit('EventMessage', { what: 999, desc: 'changeFactory' })
this.setData({ visible: false, factoryId: detail.id, factoryName: detail.text }) this.setData({ visible: false, factoryId: detail.id, factoryName: detail.text })
}, },
checkLincense: function(){
getFactoryLicence().then(result => {
if(!result.data.expirationTime){
return
}
app.userInfo.expirationTime = result.data.expirationTime.substring(0, 10)
app.userInfo.isExpiration = result.data.isExpiration
if(app.userInfo.isExpiration && this.onAttention){
this.onAttention('您打包站的授权已过期,部分功能将无法使用,为了顺利使用,请您去续费。')
}
})
},
onUnload: function(){ onUnload: function(){
event.remove('EventMessage', this) event.remove('EventMessage', this)
if(this.data.setInter) { if(this.data.setInter) {

1
pages/index/index.json

@ -11,6 +11,7 @@
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"van-tree-select": "/components/tree-select/index", "van-tree-select": "/components/tree-select/index",
"add-tips": "/components/add-tips/index", "add-tips": "/components/add-tips/index",
"vip-dialog": "/pages/message/vip-dialog/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

1
pages/index/index.wxml

@ -38,4 +38,5 @@
</view> </view>
</van-popup> </van-popup>
<vip-dialog id="vip-dialog"/>
<notification id="qn-notification" /> <notification id="qn-notification" />

24
pages/process/outside-add/index.js

@ -196,8 +196,9 @@ Scene({
return return
} }
} }
wx.showLoading({ title: '处理中', mask: true })
if(this.data.form.scrapPaperReceiptId){ if(this.data.form.scrapPaperReceiptId){
wx.showLoading({ title: '处理中', mask: true })
editSideOrder(this.data.form).then(result => { editSideOrder(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
util.showToast('修改订单成功') util.showToast('修改订单成功')
@ -208,13 +209,20 @@ Scene({
util.showToast(err) util.showToast(err)
}) })
} else { } else {
createSideOrder(this.data.form).then(result => {
wx.hideLoading()
util.showBackToast('创建订单成功')
event.emit('OrderMessage', { what: 12, desc: 'createSideOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
complete(res) {
wx.showLoading({ title: '处理中', mask: true })
createSideOrder(that.data.form).then(result => {
wx.hideLoading()
util.showBackToast('创建订单成功')
event.emit('OrderMessage', { what: 12, desc: 'createSideOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}) })
} }

Loading…
Cancel
Save