|
@@ -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
|