store 8.5
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
|
||||
<u-swipe-action
|
||||
v-for="(item, index) in list" :key="index"
|
||||
:index='item.favlog_id'
|
||||
:index='item.store_id'
|
||||
:show="item.show"
|
||||
:options="options"
|
||||
@click="removeFavorite"
|
||||
@open="open"
|
||||
>
|
||||
<view class="item u-border-bottom">
|
||||
<view class="item u-border-bottom" @click="toDetailsPage(item.store_id)">
|
||||
<image :src="item.store_avatar"></image>
|
||||
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
||||
<view class="title-wrap">
|
||||
@@ -46,12 +46,15 @@ export default {
|
||||
getStoreFavoritesList() {
|
||||
this.$u.api.getFavoritesList({
|
||||
type: 2 // 店铺 type: 2
|
||||
}).then(res => {
|
||||
this.list = res.data;
|
||||
})
|
||||
},
|
||||
removeFavorite(id) {
|
||||
console.log(id);
|
||||
this.$u.api.removeFavorite({
|
||||
id: id
|
||||
id: id,
|
||||
type: 'store'
|
||||
}).then(res => {
|
||||
this.$u.toast(res.message);
|
||||
if(res.errCode == 0) {
|
||||
@@ -59,6 +62,11 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
this.$u.route('pageC/merchant/index', {
|
||||
id: id
|
||||
});
|
||||
},
|
||||
open(index) {
|
||||
// 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
|
||||
// 原本为'false',再次设置为'false'会无效
|
||||
|
||||
Reference in New Issue
Block a user