lex-xin 6 months ago
parent
commit
330b8d6872
3 changed files with 30 additions and 22 deletions
  1. 1 1
      miniprogram/config.ts
  2. 28 18
      miniprogram/pages/index/index.ts
  3. 1 3
      miniprogram/pages/login/login.less

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "online";
+const environmentVariable = "test";
 const apiUrlInfo = {
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

+ 28 - 18
miniprogram/pages/index/index.ts

@@ -2,18 +2,6 @@
 
 
 import { api_shopProduct } from "../../api/login";
 import { api_shopProduct } from "../../api/login";
 import { debounce } from '../../utils/util'
 import { debounce } from '../../utils/util'
-// 定义节流函数
-// function throttle(func: any, delay: any) {
-//   let timer: any = null;
-//   return function () {
-//     if (!timer) {
-//       func.apply(this, arguments);
-//       timer = setTimeout(() => {
-//         timer = null;
-//       }, delay);
-//     }
-//   }
-// }
 // 获取应用实例
 // 获取应用实例
 const app = getApp<IAppOption>()
 const app = getApp<IAppOption>()
 // pages/orders/orders.ts
 // pages/orders/orders.ts
@@ -36,8 +24,8 @@ Page({
       'https://oss.dayaedu.com/ktyq/1732175006625.png',
       'https://oss.dayaedu.com/ktyq/1732175006625.png',
       'https://oss.dayaedu.com/ktyq/1732175021350.png',
       'https://oss.dayaedu.com/ktyq/1732175021350.png',
       'https://oss.dayaedu.com/ktyq/1732175031878.png',
       'https://oss.dayaedu.com/ktyq/1732175031878.png',
-      'https://oss.dayaedu.com/ktyq/1732175041724.png',
-      'https://oss.dayaedu.com/ktyq/1732507279822.png'
+      'https://oss.dayaedu.com/ktyq/1732617269723.png',
+      'https://oss.dayaedu.com/ktyq/1732617388991.png'
     ],
     ],
     serviceShow: true,
     serviceShow: true,
     scrollTop: 0,
     scrollTop: 0,
@@ -57,6 +45,7 @@ Page({
     scrollIntoViewType: false,
     scrollIntoViewType: false,
     headerHeight: 0, // 头部的高度
     headerHeight: 0, // 头部的高度
     initialScrollHeight: 0, // 滚动高度
     initialScrollHeight: 0, // 滚动高度
+    isFromPreviewImage: false,
   },
   },
 
 
   /**
   /**
@@ -219,26 +208,47 @@ Page({
   onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
   onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({
     wx.previewImage({
       current: e.currentTarget.dataset.src,
       current: e.currentTarget.dataset.src,
-      urls: this.data.imgList
+      urls: this.data.imgList,
+      success: () => {
+        this.setData({
+          isFromPreviewImage: true
+        })
+      }
     })
     })
   },
   },
   onPreivewGoodsImg(e: { currentTarget: { dataset: any } }) {
   onPreivewGoodsImg(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({
     wx.previewImage({
       current: e.currentTarget.dataset.src,
       current: e.currentTarget.dataset.src,
-      urls: this.data.goodsImgList
+      urls: this.data.goodsImgList,
+      success: () => {
+        this.setData({
+          isFromPreviewImage: true
+        })
+      }
     })
     })
   },
   },
   onPreivewGoods(e: { currentTarget: { dataset: any } }) {
   onPreivewGoods(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({
     wx.previewImage({
       current: e.currentTarget.dataset.src,
       current: e.currentTarget.dataset.src,
-      urls: [e.currentTarget.dataset.src]
+      urls: [e.currentTarget.dataset.src],
+      success: () => {
+        this.setData({
+          isFromPreviewImage: true
+        })
+      }
     })
     })
   },
   },
   /**
   /**
    * 生命周期函数--监听页面显示
    * 生命周期函数--监听页面显示
    */
    */
   onShow() {
   onShow() {
-    this.onInit()
+    if(!this.data.isFromPreviewImage) {
+      this.onInit()
+    } else {
+      this.setData({
+        isFromPreviewImage: false
+      })
+    }
     this.setData({
     this.setData({
       serviceShow: true
       serviceShow: true
     })
     })

+ 1 - 3
miniprogram/pages/login/login.less

@@ -43,9 +43,7 @@
   }
   }
 
 
   .protocol-section {
   .protocol-section {
-    position: absolute;
-    bottom: 100rpx;
-    left: 0;
+    padding-top: 44rpx;
     width: 100%;
     width: 100%;
     text-align: center;
     text-align: center;
     font-size: 26rpx;
     font-size: 26rpx;