From 109249efbe30d72abcdfd167212bedda56a801ea Mon Sep 17 00:00:00 2001
From: xpz2018 <107107461@qq.com>
Date: Wed, 4 Aug 2021 10:12:11 +0800
Subject: [PATCH] app.js
---
app.js | 40 ++++++++++++++++++++++-
pages/home/customer-list/index.wxml | 2 +-
pages/login/index.js | 48 ++++------------------------
pages/process/outside-price/index.js | 22 ++++++++-----
4 files changed, 60 insertions(+), 52 deletions(-)
diff --git a/app.js b/app.js
index 09d9347..77caee0 100644
--- a/app.js
+++ b/app.js
@@ -12,7 +12,7 @@ App({
keyboardHeight: 0,
isIos: false
},
- onShow: function(){
+ onShow: function() {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
@@ -22,5 +22,43 @@ App({
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
+ if(this.globalData.Custom){
+ return
+ }
+ wx.getSystemInfo({
+ success: e => {
+ this.globalData.isIos = this.checkIos(e)
+ this.globalData.dev = e.platform == 'devtools'
+
+ let custom = wx.getMenuButtonBoundingClientRect()
+ this.globalData.Custom = custom
+ // 顶部操作栏高度
+ this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (this.globalData.isIos ? 4 : 0)
+ let windowHeight = e.windowHeight * (750 / e.windowWidth)
+
+ let safeBottom = e.windowHeight - e.safeArea.bottom
+ if(safeBottom > e.windowHeight){
+ safeBottom = 34
+ }
+ this.globalData.safeBottom = safeBottom * (750 / e.windowWidth)
+ // 状态栏高度
+ this.globalData.StatusBar = e.statusBarHeight * (750 / e.windowWidth)
+ let statusBarHeight = this.globalData.CustomBar * (750 / e.windowWidth)
+ this.globalData.statusBarHeight = statusBarHeight
+ // fragmentHeight:指的是整个页面statusBarHeight以下的高度
+ this.globalData.fragmentHeight = windowHeight - statusBarHeight
+ this.globalData.safeFragmentHeight = windowHeight - statusBarHeight - this.globalData.safeBottom
+ this.globalData.windowWidth = e.windowWidth
+ }
+ })
+ },
+ checkIos: function (e) {
+ if ('ios' === e.platform) {
+ return true
+ }
+ if (e.system.startsWith('iOS')) {
+ return true
+ }
+ return false
}
})
\ No newline at end of file
diff --git a/pages/home/customer-list/index.wxml b/pages/home/customer-list/index.wxml
index 1b6dbfb..4a26c87 100644
--- a/pages/home/customer-list/index.wxml
+++ b/pages/home/customer-list/index.wxml
@@ -40,7 +40,7 @@
取消
-
+
diff --git a/pages/login/index.js b/pages/login/index.js
index 3008b02..d7905a2 100644
--- a/pages/login/index.js
+++ b/pages/login/index.js
@@ -48,49 +48,13 @@ Page({
this.wxLogin()
},
onReady: function () {
- wx.getSystemInfo({
- success: e => {
- app.globalData.isIos = this.checkIos(e)
- app.globalData.dev = e.platform == 'devtools'
-
- let custom = wx.getMenuButtonBoundingClientRect()
- app.globalData.Custom = custom
- // 顶部操作栏高度
- app.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (app.globalData.isIos ? 4 : 0)
- let windowHeight = e.windowHeight * (750 / e.windowWidth)
-
- let safeBottom = e.windowHeight - e.safeArea.bottom
- if(safeBottom > e.windowHeight){
- safeBottom = 34
- }
- app.globalData.safeBottom = safeBottom * (750 / e.windowWidth)
- // 状态栏高度
- app.globalData.StatusBar = e.statusBarHeight * (750 / e.windowWidth)
- let statusBarHeight = app.globalData.CustomBar * (750 / e.windowWidth)
- app.globalData.statusBarHeight = statusBarHeight
- // fragmentHeight:指的是整个页面statusBarHeight以下的高度
- app.globalData.fragmentHeight = windowHeight - statusBarHeight
- app.globalData.safeFragmentHeight = windowHeight - statusBarHeight - app.globalData.safeBottom
- app.globalData.windowWidth = e.windowWidth
-
- app.globalData.token = app.globalData.token || storage.get('Authorization')
- if(this.data.code){
- this.fetchQrCode(this.data.code)
- } else if(!util.isEmpty(app.globalData.token)){
- this.setData({ loging: true})
- this.fetchUserInfo(app.globalData.token)
- }
- }
- })
- },
- checkIos: function (e) {
- if ('ios' === e.platform) {
- return true
+ app.globalData.token = app.globalData.token || storage.get('Authorization')
+ if(this.data.code){
+ this.fetchQrCode(this.data.code)
+ } else if(!util.isEmpty(app.globalData.token)){
+ this.setData({ loging: true})
+ this.fetchUserInfo(app.globalData.token)
}
- if (e.system.startsWith('iOS')) {
- return true
- }
- return false
},
/************************************** 获取用户信息,进行登录 ********************************************/
checkFactoryId: function(storageFactoryId){
diff --git a/pages/process/outside-price/index.js b/pages/process/outside-price/index.js
index d71de20..df07977 100644
--- a/pages/process/outside-price/index.js
+++ b/pages/process/outside-price/index.js
@@ -175,14 +175,20 @@ Scene({
this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId
this.data.param.weightNoteList = weightNoteList
this.data.param.orderImageList = this.data.form.orderImageList
- wx.showLoading({ title: '处理中', mask: true })
- poundSideOrder(this.data.param).then(result => {
- wx.hideLoading()
- util.showBackToast('提交成功')
- event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
- }).catch(err => {
- wx.hideLoading()
- util.showToast(err)
+ var that = this
+ wx.requestSubscribeMessage({
+ tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
+ complete(res) {
+ wx.showLoading({ title: '处理中', mask: true })
+ poundSideOrder(that.data.param).then(result => {
+ wx.hideLoading()
+ util.showBackToast('提交成功')
+ event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
+ }).catch(err => {
+ wx.hideLoading()
+ util.showToast(err)
+ })
+ }
})
},
repeatForm: function(){