diff --git a/app.js b/app.js index 77caee0..1721d29 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ //app.js App({ - evn: 1, // 0: 开发版本;1:测试版本;2:生产版本 + evn: 0, // 0: 开发版本;1:测试版本;2:生产版本 tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], version: '2.3.1', xAppId: '503258978847953926', diff --git a/pages/home/index/index.wxml b/pages/home/index/index.wxml index 5871c00..a7312dd 100644 --- a/pages/home/index/index.wxml +++ b/pages/home/index/index.wxml @@ -25,10 +25,10 @@ - 授权截止日期:{{userInfo.expirationTime}} - - 去续费 - + 授权截止日期:{{userInfo.expirationTime}} + + 去续费 + diff --git a/pages/index/index.js b/pages/index/index.js index c83308d..1eafc56 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,6 +1,6 @@ // pages/administ/index.js import Scene from './scene' -import { getMessageList } from "../../api/saas" +import { getMessageList, getFactoryLicence } from "../../api/saas" import { headerFactoryId } from "../../api/user" const event = require('../../utils/event') const util = require('../../utils/util') @@ -75,6 +75,7 @@ Scene({ factory.index = nIndex children.push(factory) } + this.checkLincense() enterprise.children = children this.data.items.push(enterprise) } @@ -169,9 +170,22 @@ Scene({ if (pageView && this.data.tabIndex != 3) { pageView.fetchStatisticsInfo(true) } + this.checkLincense() event.emit('EventMessage', { what: 999, desc: 'changeFactory' }) 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(){ event.remove('EventMessage', this) if(this.data.setInter) { diff --git a/pages/index/index.json b/pages/index/index.json index 8467e7c..91e193f 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -11,6 +11,7 @@ "van-cell": "/components/cell/index", "van-tree-select": "/components/tree-select/index", "add-tips": "/components/add-tips/index", + "vip-dialog": "/pages/message/vip-dialog/index", "notification": "/pages/message/notification/index" } } \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index add39c7..b6c9656 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -38,4 +38,5 @@ + \ No newline at end of file diff --git a/pages/process/outside-add/index.js b/pages/process/outside-add/index.js index ad8d11c..baec736 100644 --- a/pages/process/outside-add/index.js +++ b/pages/process/outside-add/index.js @@ -196,8 +196,9 @@ Scene({ return } } - wx.showLoading({ title: '处理中', mask: true }) + if(this.data.form.scrapPaperReceiptId){ + wx.showLoading({ title: '处理中', mask: true }) editSideOrder(this.data.form).then(result => { wx.hideLoading() util.showToast('修改订单成功') @@ -208,13 +209,20 @@ Scene({ util.showToast(err) }) } 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) + }) + } }) }