From aff8d054df4a638f399dc8f15d98c19b9c9aa785 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 29 四月 2025 10:11:25 +0800
Subject: [PATCH] 扫码视频播放

---
 packageDomain/pages/resourceDetails/myVideo/index.js |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js
index fc8426c..15c01ed 100644
--- a/packageDomain/pages/resourceDetails/myVideo/index.js
+++ b/packageDomain/pages/resourceDetails/myVideo/index.js
@@ -436,22 +436,18 @@
               }
               this.setData({
                 showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
-                titleName: items.name
+                titleName: items.name,
+                selectedId: index
               })
-              debugger
               this.aliVod(file, this.data.showData)
             } else {
               this.setData({
                 showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
-                titleName: items.name
+                titleName: items.name,
+                selectedId: index
               })
               this.aliVod(items.file, this.data.showData)
             }
-            let selectedIndex = index; // 瀛樺偍閫変腑椤圭殑绱㈠紩
-            console.log(selectedIndex, "selectedIndex")
-            this.setData({
-              selectedId: selectedIndex // 璁剧疆閫変腑椤圭殑绱㈠紩
-            });
           }
         });
       } else {
@@ -865,17 +861,21 @@
   },
   // 鍒ゆ柇褰撳墠鐐瑰嚮鐨勬暟鎹槸鍚﹁喘涔�
   cmsItemIsBuy(item) {
-    // 1.this.data.buyIdList 涓婃槸鍚︽湁 cmsItem鐨刲inkpath閲岀殑id
-    const linkData = item.productLinkInfo.find(citem => citem.LinkType == 'Link' && citem.CmsItemId == item.id)
-    let linkids = []
-    try {
-      linkids = linkData.LinkPath.split('\\')
-    } catch (error) {}
-    if (!this.data.buyIdList.length) return false
-    const flag = linkids.some(citem => {
-      return this.data.buyIdList.includes(Number(citem))
-    })
-    console.log(linkids, flag);
+    let flag = false
+    // 涔颁簡
+    if (this.data.buyList.length) {
+      if (this.data.buyList.some(citem => item.productLinkPath.includes(citem.productLinkPath)))
+        flag = true
+    } else {
+      // 娌′拱涓旀棤閿�鍞柟寮�
+      if (!item.saleMethod.length) {
+        flag = true
+      } else {
+        // 娌′拱涓旈攢鍞柟寮忚繃鏈�//娌′拱锛岄攢鍞柟寮忎环鏍间负0
+        const itemSaleMethod = item.saleMethod.find(citem => citem.SaleType == 'Normal')
+        if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime() || itemSaleMethod.Price == 0) flag = true
+      }
+    }
     return flag
   }
 })
\ No newline at end of file

--
Gitblit v1.9.1