Procházet zdrojové kódy

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

zuypeng před 1 rokem
rodič
revize
e3b4102ef6
3 změnil soubory, kde provedl 5 přidání a 6 odebrání
  1. 2 2
      src/App.vue
  2. 1 1
      src/pages-wash/scan/index.vue
  3. 2 3
      src/pages-wash/station/index.vue

+ 2 - 2
src/App.vue

@@ -51,7 +51,7 @@ export default <any>{
     let device = uni.getWindowInfo();
     let device = uni.getWindowInfo();
     let backup = uni.getStorageSync('backup')
     let backup = uni.getStorageSync('backup')
     console.log("backup", backup)
     console.log("backup", backup)
-    getApp<any>().globalData = Object.assign({}, getApp<any>().globalData, {
+    this.globalData = Object.assign({}, this.globalData, {
       device: {
       device: {
         windowWidth: device.windowWidth,
         windowWidth: device.windowWidth,
         windowHeight: device.windowHeight,
         windowHeight: device.windowHeight,
@@ -59,7 +59,7 @@ export default <any>{
         windowTop: device.windowTop,
         windowTop: device.windowTop,
       }
       }
     }, backup)
     }, backup)
-    console.log("backup", backup,getApp<any>().globalData)
+    console.log("backup", backup,this.globalData)
   },
   },
   onHide() {
   onHide() {
     console.log("app onHide", getApp<any>().globalData)
     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) {
   query.exec(function (res: any) {
     if (res && res.length) {
     if (res && res.length) {
       cameraHeight.value =
       cameraHeight.value =
-        getApp<any>().globalData.device.windowHeight - res[0].height;
+          uni.getWindowInfo().windowHeight - res[0].height;
       uni.hideLoading();
       uni.hideLoading();
     }
     }
   });
   });

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

@@ -93,9 +93,8 @@ const handleLeftClick = () => {
 
 
 onShow(() => {
 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 = {
   state.imageStyle = {
     width: `${width}px`,
     width: `${width}px`,
     height: `${height}px`,
     height: `${height}px`,