lex 2 years ago
parent
commit
8669f57324
2 changed files with 11 additions and 15 deletions
  1. 7 4
      src/views/coupons/item.tsx
  2. 4 11
      src/views/coupons/list.tsx

+ 7 - 4
src/views/coupons/item.tsx

@@ -36,10 +36,13 @@ export default defineComponent({
           this.onClick(item)
         }}
       >
-        <img
-          class={styles['img-icon']}
-          src={item.checked ? activeIcon : inactiveIcon}
-        />
+        {/* 可使用的优惠券 & 有选择按钮的 */}
+        {item.useState === 'USED' && this.isSelect && (
+          <img
+            class={styles['img-icon']}
+            src={item.checked ? activeIcon : inactiveIcon}
+          />
+        )}
         <div class={styles.top}>
           <div class={styles.price}>
             <span class={styles.suffix}>¥</span>

+ 4 - 11
src/views/coupons/list.tsx

@@ -109,31 +109,24 @@ export default defineComponent({
   },
   render() {
     return (
-      <div class={styles.list}>
+      <>
         {this.dataShow ? (
           <List
             v-model:loading={this.loading}
             finished={this.finished}
             finishedText=" "
-            class={[styles.liveList]}
+            class={[styles.list]}
             onLoad={this.getList}
             immediateCheck={false}
           >
             {this.list.map((item: any) => (
-              <Item
-                isSelect
-                item={item}
-                onClick={(obj: any) => {
-                  obj.checked = !obj.checked
-                  obj.disabled = true
-                }}
-              />
+              <Item item={item} />
             ))}
           </List>
         ) : (
           <ColResult btnStatus={false} classImgSize="SMALL" tips="暂无优惠券" />
         )}
-      </div>
+      </>
     )
   }
 })