|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<view class="wishlist_body"> |
|
|
|
<view class="status_bar"></view> |
|
|
|
<uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Wishlist" color="#000000" @clickLeft="back" @clickRight="isDelete=!isDelete"/> |
|
|
|
<uni-nav-bar left-icon="left" :rightText="isDelete?'Done':'Delete'" title="Wishlist" color="#000000" @clickLeft="back" @clickRight="$refs.alertDialog.open()"/> |
|
|
|
<view class="wishlist"> |
|
|
|
<view class="wishlist_item" v-for="(item,index) in goodsList" :key="index" @click="changeImage(item.id)"> |
|
|
|
<view class="wishlist_item_img"> |
|
|
|
@ -24,6 +24,10 @@ |
|
|
|
<button @click="removeLike">DELETE</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-popup ref="alertDialog" type="dialog"> |
|
|
|
<uni-popup-dialog type="error" cancelText="Close" confirmText="Delete" title="Tips" content="Whether to delete all favorites?" |
|
|
|
@confirm="removeLike(0)" ></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -62,7 +66,7 @@ |
|
|
|
}, |
|
|
|
// 取消收藏 |
|
|
|
removeLike(id){ |
|
|
|
let data={_action:'unsetfaviouritegoods',goods_id:'659,664'} |
|
|
|
let data={_action:'unsetfaviouritegoods',goods_id:id} |
|
|
|
defaultRequest2(data).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
if(res.error==0){ |
|
|
|
@ -74,18 +78,6 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 切换图片 |
|
|
|
changeImage(id){ |
|
|
|
this.goodsList.map(item=>{ |
|
|
|
if(item.id==id){ |
|
|
|
if(item.is_select==0){ |
|
|
|
item.is_select=1 |
|
|
|
}else{ |
|
|
|
item.is_select=0 |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
back(){ |
|
|
|
uni.navigateBack() |
|
|
|
} |
|
|
|
|