zhaoxiaohai hace 3 años
padre
commit
32c518c0e2

+ 10 - 2
components/My_accessory/index.js

@@ -4,7 +4,10 @@ Component({
      * 组件的属性列表
      */
     properties: {
-
+        butType: {
+            type: String,
+            value: "下载"
+        }
     },
     options: {
         addGlobalClass: true
@@ -21,6 +24,11 @@ Component({
      * 组件的方法列表
      */
     methods: {
-
+        butClick(){
+            console.log(this.data.butType)
+        },
+        checkFile(){
+            console.log("查看文件")
+        }
     }
 })

+ 0 - 1
components/My_accessory/index.scss

@@ -44,7 +44,6 @@
     .v-but {
         width: 140rpx;
         height: 60rpx;
-        background: #3874F6;
         border-radius: 30rpx;
         margin-left: 30rpx;
     }

+ 2 - 2
components/My_accessory/index.wxml

@@ -1,4 +1,4 @@
-<navigator url="#" class="accessory my-card" wx:for="{{2}}">
+<navigator url="#" class="accessory my-card" wx:for="{{2}}" bindtap="checkFile">
     <view class="icon">
         <text class="iconfont icon-word" />
     </view>
@@ -6,5 +6,5 @@
         <view class="title line-1">销售策略销售策略销售策略销售策略</view>
         <view class="time">2022-01-12 15:30</view>
     </view>
-    <van-button type="primary" custom-class='v-but'>下载</van-button>
+    <van-button type="{{butType==='下载'?'info':'danger'}}" custom-class='v-but' catchtap="butClick">{{butType}}</van-button>
 </navigator>