zhaoxiaohai 3 lat temu
rodzic
commit
96d0b34909

+ 7 - 1
components/My_accessory/index.js

@@ -51,11 +51,17 @@ Component({
                 })
             }
         },
+        callback(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            this.triggerEvent("callBack", item);
+        },
         checkFile(e) {
             const {
                 item
             } = e.currentTarget.dataset;
-            if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
+            if (item.fileType == 'video' && this.data.butType == '商学院' || this.data.butType == '播放') return this.triggerEvent("callBack", item);
             cf.checkFile(item);
         }
     }

+ 2 - 1
components/My_accessory/index.wxml

@@ -7,5 +7,6 @@
         <view class="title line-1">{{item.document}}</view>
         <view class="time">{{item.createdate}}</view>
     </view>
-    <van-button type="{{butType==='下载'||butType==='播放'?'info':'danger'}}" data-item="{{item}}" custom-class='v-but' catchtap="butClick">{{butType}}</van-button>
+    <van-button wx:if="{{butType=='商学院'}}" type="info" data-item="{{item}}" custom-class='v-but' catchtap="{{item.fileType=='video'?'callback':'butClick'}}">{{item.fileType=='video'?'播放':'下载'}}</van-button>
+    <van-button wx:else type="{{butType==='下载'||butType==='播放'?'info':'danger'}}" data-item="{{item}}" custom-class='v-but' catchtap="butClick">{{butType}}</van-button>
 </navigator>