aXin-0810 vor 9 Monaten
Ursprung
Commit
42b01ee564
1 geänderte Dateien mit 18 neuen und 21 gelöschten Zeilen
  1. 18 21
      src/packageMine/pages/collection.vue

+ 18 - 21
src/packageMine/pages/collection.vue

@@ -13,8 +13,7 @@
           class="goods-item"
           v-for="(item, index) in dataList"
           :key="index"
-          @tap="toGoodsDetail(item.goodsId)"
-          @longpress="handleDelete(item.goodsFavoriteId)"
+          @tap="toGoodsDetail(item.goodsId, item.goodsFavoriteId)"
         >
           <image :src="item.imgUrl" mode="aspectFill"></image>
           <view class="main">
@@ -96,25 +95,23 @@ export default {
 			this.getList();
 		},
 
-		// 删除
-		handleDelete(id) {
-			this.$modal({
-				content: '确定要取消收藏吗?',
-			}).then(() => {
-				this.$api.post('/goods/favorite/del', {
-					goodFavoriteId: id
-				}).then(res => {
-					this.$successToast('取消收藏成功');
-					this.refreshList();
-				})
-			}).catch(() => {})
-		},
-
-     toGoodsDetail(id) {
-       this.$navToPage({
-         url: `/packageGoods/pages/detail?id=${id}`
-       })
-     },
+    toGoodsDetail(id,id2) {
+      setTimeout(() => {
+        this.$modal({
+          content: '确定要取消收藏吗?',
+        }).then(() => {
+          this.$api.post('/goods/favorite/del', {
+            goodFavoriteId: id2
+          }).then(res => {
+            this.$successToast('取消收藏成功');
+            this.refreshList();
+          })
+        }).catch(() => {})
+      },1000)
+      this.$navToPage({
+        url: `/packageGoods/pages/detail?id=${id}`
+      })
+    },
 	}
 }
  // #endif