From e61a6b57161e75185ba0691a3bfa3961f7a7a13e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 25 七月 2024 10:19:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 wechat_staff/pages/download/index.js |   79 +++++++++++++++++++++++++++++++--------
 1 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/wechat_staff/pages/download/index.js b/wechat_staff/pages/download/index.js
index 0f6771e..c6066ce 100644
--- a/wechat_staff/pages/download/index.js
+++ b/wechat_staff/pages/download/index.js
@@ -1,11 +1,17 @@
 // pages/download/index.js
+const { HYEventBus } = require('hy-event-store')
+const eventBus = new HYEventBus()
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    bottomLift: ''
+    bottomLift: '',
+    downloadList: [],
+    checkedAll: false,
+    showParam: false,
+    takeQrcode: true
   },
 
   /**
@@ -17,24 +23,65 @@
       bottomLift: app.bottomLift
     })
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
   onShow() {
-
+    const downloadList = wx.getStorageSync('downloadList') || []
+    let temp = downloadList.map(i => {
+      // paddingStatus锛� 0鏈笅杞�1姝e湪涓嬭浇2绛夊緟涓嬭浇3涓嬭浇瀹屾垚
+      return {
+        url: i,
+        paddingStatus: 0,
+        checked: false
+      }
+    })
+    this.setData({ downloadList: temp })
+    setTimeout(() => {
+      wx.setStorageSync('downloadList', [])
+    },500)
   },
+  openParam() {
+    const downloadList = this.data.downloadList.filter(i => i.checked)
+    if(downloadList.length === 0) return wx.showToast({title: '璇峰厛閫夋嫨瑕佷笅杞界殑娴锋姤', icon: 'none'})
+    this.setData({ showParam: true })
+  },
+  onClose() {
+    this.setData({ showParam: false })
+  },
+  downCheck(e) {
+    const takeQrcode = e.currentTarget.dataset.flag
+    console.log('takeQrcode', takeQrcode);
+    this.setData({ takeQrcode })
+  },
+  subDownload() {
+    const downloadList = this.data.downloadList
+    downloadList.forEach(item => {
+      if(item.checked){
+        
+      }
+    })
 
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
-   */
+    this.setData({ showParam: false })
+  },
+  itemCheck(e) {
+    const i = e.currentTarget.dataset.i
+    const { downloadList, checkedAll } = this.data
+    let count = 0
+    downloadList.forEach((item, index) => {
+      if(index === i){
+        item.checked = !item.checked
+      }
+      if(item.checked) {
+        count ++
+      }
+    })
+    this.setData({ checkedAll: count == downloadList.length,  downloadList})
+  },
+  allCheck() {
+    const { downloadList, checkedAll } = this.data
+    downloadList.forEach(item => {
+      item.checked = !checkedAll
+    })
+    this.setData({ checkedAll: !checkedAll, downloadList })
+  },
   onHide() {
 
   },

--
Gitblit v1.9.3