This commit is contained in:
2020-07-01 17:32:36 +08:00
parent dc69746320
commit dc72f79ee8
24 changed files with 268 additions and 127 deletions

View File

@@ -6,7 +6,7 @@
:index='index'
:show="item.show"
:options="options"
@click="click"
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
@@ -60,16 +60,20 @@ export default {
},
methods: {
getGoodsFavoritesList() {
this.$u.api.getGoodsFavoritesList().then(res => {
if(res.errCode == 0) {
}
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {}
})
},
click(index) {
this.list.splice(index, 1);
this.$u.toast(`删除了第${index+1}个cell`);
removeFavorite(id) {
this.$u.api.removeFavorite({
id: id
}).then(res => {
if(res.errCode == 0) {
this.getGoodsFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},
open(index) {
// 先将正在被操作的swipeAction标记为打开状态否则由于props的特性限制