Эх сурвалжийг харах

token管理修改及网点详情调整

zuypeng 1 жил өмнө
parent
commit
e3b4102ef6

+ 2 - 2
src/App.vue

@@ -51,7 +51,7 @@ export default <any>{
     let device = uni.getWindowInfo();
     let backup = uni.getStorageSync('backup')
     console.log("backup", backup)
-    getApp<any>().globalData = Object.assign({}, getApp<any>().globalData, {
+    this.globalData = Object.assign({}, this.globalData, {
       device: {
         windowWidth: device.windowWidth,
         windowHeight: device.windowHeight,
@@ -59,7 +59,7 @@ export default <any>{
         windowTop: device.windowTop,
       }
     }, backup)
-    console.log("backup", backup,getApp<any>().globalData)
+    console.log("backup", backup,this.globalData)
   },
   onHide() {
     console.log("app onHide", getApp<any>().globalData)

+ 1 - 1
src/pages-wash/scan/index.vue

@@ -106,7 +106,7 @@ onReady(() => {
   query.exec(function (res: any) {
     if (res && res.length) {
       cameraHeight.value =
-        getApp<any>().globalData.device.windowHeight - res[0].height;
+          uni.getWindowInfo().windowHeight - res[0].height;
       uni.hideLoading();
     }
   });

+ 2 - 3
src/pages-wash/station/index.vue

@@ -93,9 +93,8 @@ const handleLeftClick = () => {
 
 onShow(() => {
   //设置图片的宽高
-  let {windowWidth, windowHeight} = getApp<any>().globalData.device
-  let width = windowWidth - rpxToPx(20)
-  let height = windowHeight * 3 / 4
+  let width = uni.getWindowInfo().windowWidth - rpxToPx(20)
+  let height = uni.getWindowInfo().windowHeight * 3 / 4
   state.imageStyle = {
     width: `${width}px`,
     height: `${height}px`,