api
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
:index='index'
|
||||
:show="item.show"
|
||||
:options="options"
|
||||
@click="click"
|
||||
@click="removeFavorite"
|
||||
@open="open"
|
||||
>
|
||||
<view class="item u-border-bottom">
|
||||
@@ -44,17 +44,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getStoreFavoritesList() {
|
||||
this.$u.api.getStoreFavoritesList({
|
||||
type: 2 // 固定值
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
|
||||
}
|
||||
this.$u.api.getFavoritesList({
|
||||
type: 2 // 店铺 type: 2
|
||||
})
|
||||
},
|
||||
click(index) {
|
||||
this.list.splice(index, 1);
|
||||
this.$u.toast(`删除了第${index+1}个cell`);
|
||||
removeFavorite(id = 18) {
|
||||
this.$u.api.removeFavorite({
|
||||
id: id
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.getStoreFavoritesList();
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
open(index) {
|
||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||
|
||||
Reference in New Issue
Block a user