zhaoxiaohai %!s(int64=3) %!d(string=hai) anos
pai
achega
c6f226fc2d
Modificáronse 2 ficheiros con 17 adicións e 2 borrados
  1. 15 1
      components/My_accessory/index.js
  2. 2 1
      components/My_accessory/index.wxml

+ 15 - 1
components/My_accessory/index.js

@@ -14,6 +14,9 @@ Component({
         },
         callBack: {
             type: Function
+        },
+        deleteFile: {
+            type: Function
         }
     },
     options: {
@@ -35,7 +38,18 @@ Component({
             const {
                 item
             } = e.currentTarget.dataset;
-            if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
+            const that = this;
+            if (this.data.butType == '播放') {
+                this.triggerEvent("callBack", item);
+            } else if (this.data.butType == '删除') {
+                wx.showModal({
+                    title: "通知",
+                    content: "是否确认删除该附件?",
+                    success: res => {
+                        if (res.confirm) that.triggerEvent("deleteFile", item);
+                    }
+                })
+            }
         },
         checkFile(e) {
             const {

+ 2 - 1
components/My_accessory/index.wxml

@@ -1,6 +1,7 @@
 <navigator url="#" class="accessory my-card" wx:for="{{list}}" data-item="{{item}}" bindtap="checkFile">
     <view class="icon">
-        <text class="iconfont icon-word" />
+        <!-- <text class="iconfont icon-word" /> -->
+        <image style="width: 58rpx; height: 58rpx;" mode="aspectFill" src="{{item.cover}}" />
     </view>
     <view class="explian">
         <view class="title line-1">{{item.document}}</view>