From d41f1f707dc643b726a42b9d2a63b186dd9e4f28 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 06 八月 2024 16:12:38 +0800
Subject: [PATCH] ll

---
 wechat_jiaxuan/pages/index/index.js |   67 +++++++++++++++++++++++++--------
 1 files changed, 51 insertions(+), 16 deletions(-)

diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index d6602fa..69f06e2 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -73,7 +73,10 @@
         rect.bottom // 鑺傜偣鐨勪笅杈圭晫鍧愭爣
       }).exec(res => {
         console.log(windowInfo.windowHeight)
-        this.setData({ videoTop: res[0].top,windowHeight: windowInfo.windowHeight})
+        this.setData({
+          videoTop: res[0].top,
+          windowHeight: windowInfo.windowHeight
+        })
       })
     }, 2000)
   },
@@ -89,7 +92,6 @@
     })
   },
   onLoad(options) {
-    console.log(options)
     this.initDictData()
     // this.initData()
   },
@@ -110,6 +112,7 @@
             }
           })
         } else {
+          wx.setStorageSync('tempPath', '/pages/webView/index')
           wx.navigateTo({
             url: '/pages/auth/auth',
           })
@@ -156,8 +159,10 @@
   initData() {
     // 杞挱
     getHomeBanner().then(res => {
-      if(res.data){
-        this.setData({ bannerList: res.data })
+      if (res.data) {
+        this.setData({
+          bannerList: res.data
+        })
       }
     })
     // 浜у搧瑙嗛
@@ -200,9 +205,12 @@
       code: 'WX_MINI_CONFIG',
       label: 'ZBOM_STYLE_TEST_URL'
     }).then(res => {
-      this.setData({
-        testUrl: res.data.code
-      })
+      if (res.data) {
+        this.setData({
+          testUrl: res.data.code
+        })
+        wx.setStorageSync('testUrl', res.data.code)
+      }
     })
     getDictData({
       code: 'WEIXIN_DEFAULT_IMGS',
@@ -376,34 +384,61 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
   bindVideoPlay() {
-    const { id } = this.data.productVideo[0]
+    const {
+      id
+    } = this.data.productVideo[0]
     actionDo({
       actionType: 'view',
       id
     })
   },
   hdBtn() {
-    this.setData({ showWhiteHead: true, open: true,font_color: "#000000", sty: '',topHeadStyle: 1, desc: false })
+    this.setData({
+      showWhiteHead: true,
+      open: true,
+      font_color: "#000000",
+      sty: '',
+      topHeadStyle: 1,
+      desc: false
+    })
   },
-  touchStart: function (e) { 
+  touchStart: function (e) {
     touchDot = e.touches[0].pageY;
   },
   touchMove: function (e) {
     var touchMove = e.touches[0].pageY;
     if (touchMove - touchDot <= 0 && this.data.top <= 1 && this.data.desc) {
-      this.setData({ showWhiteHead: true, open: false, desc: false })
+      this.setData({
+        showWhiteHead: true,
+        open: false,
+        desc: false
+      })
       setTimeout(() => {
-        this.setData({ open: true, sty: '' })
+        this.setData({
+          open: true,
+          sty: ''
+        })
       }, 1000)
     }
     if (touchMove - touchDot >= 50 && this.data.top <= 1 && !this.data.desc) {
-      this.setData({ showWhiteHead: false, open: false, desc: true, sty: 'overflow: hidden;' })
+      this.setData({
+        showWhiteHead: false,
+        open: false,
+        desc: true,
+        sty: 'overflow: hidden;'
+      })
     }
   },
   onPageScroll(e) {
-    const { videoTop, windowHeight, videoPlay } = this.data
-    if(e.scrollTop + 100 > videoTop - (windowHeight / 2) && videoPlay ){
-      this.setData({ videoPlay: false })
+    const {
+      videoTop,
+      windowHeight,
+      videoPlay
+    } = this.data
+    if (e.scrollTop + 100 > videoTop - (windowHeight / 2) && videoPlay) {
+      this.setData({
+        videoPlay: false
+      })
       let videoplay = wx.createVideoContext('myvideo', this)
       videoplay.play();
     }

--
Gitblit v1.9.3