|
@@ -4,19 +4,19 @@
|
|
<view class="one">
|
|
<view class="one">
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
- <view class="list" v-for="(item, index) in list" :key="index" @click="toView(item)">
|
|
|
|
- <image class="image" :src="item.file" mode=""></image>
|
|
|
|
|
|
+ <view class="list" v-for="(item, index) in list" :key="index" @tap="toView(item)">
|
|
|
|
+ <image class="image" :src="item.shop.file&&item.shop.file.length>0?item.shop.file[0].url:''" mode=""></image>
|
|
<view class="other">
|
|
<view class="other">
|
|
- <view class="name">{{item.name}}</view>
|
|
|
|
|
|
+ <view class="name">{{item.shop.name}}</view>
|
|
<view class="other_1">
|
|
<view class="other_1">
|
|
- 关注人数 <text>{{item.num}}</text>
|
|
|
|
|
|
+ 店铺地址 <text>{{item.shop.address}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="other_1">
|
|
<view class="other_1">
|
|
关注时间 <text>{{item.time}}</text>
|
|
关注时间 <text>{{item.time}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="btn">
|
|
<view class="btn">
|
|
- <text @click="toDel(item)" class="iconfont icon-del"></text>
|
|
|
|
|
|
+ <text @tap.stop="toDel(item)" class="iconfont icon-del"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -36,25 +36,6 @@
|
|
skip: 0,
|
|
skip: 0,
|
|
limit: 5,
|
|
limit: 5,
|
|
page: 0
|
|
page: 0
|
|
- // list: [{
|
|
|
|
- // file: require('@/static/test.png'),
|
|
|
|
- // name: '官方自营店',
|
|
|
|
- // num: 2,
|
|
|
|
- // time: '2022-09-27'
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // file: require('@/static/test.png'),
|
|
|
|
- // name: '官方自营店',
|
|
|
|
- // num: 2,
|
|
|
|
- // time: '2022-09-27'
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // file: require('@/static/test.png'),
|
|
|
|
- // name: '官方自营店',
|
|
|
|
- // num: 2,
|
|
|
|
- // time: '2022-09-27'
|
|
|
|
- // }
|
|
|
|
- // ]
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onShow: function() {
|
|
onShow: function() {
|
|
@@ -97,20 +78,66 @@
|
|
that.$set(that, `total`, res.total)
|
|
that.$set(that, `total`, res.total)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 分页
|
|
|
|
+ toPage() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let list = that.list;
|
|
|
|
+ let limit = that.limit;
|
|
|
|
+ if (that.total > list.length) {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
|
|
+ let page = that.page + 1;
|
|
|
|
+ that.$set(that, `page`, page)
|
|
|
|
+ let skip = page * limit;
|
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
|
+ that.search();
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ } else uni.showToast({
|
|
|
|
+ title: '没有更多数据了'
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 详细信息
|
|
// 详细信息
|
|
toView(e) {
|
|
toView(e) {
|
|
const that = this;
|
|
const that = this;
|
|
- console.log(e);
|
|
|
|
|
|
+ that.clearPage();
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesHome/shop/index?id=${e.shop._id}`
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
- toDel(e) {
|
|
|
|
|
|
+ async toDel(e) {
|
|
const that = this;
|
|
const that = this;
|
|
- console.log(e);
|
|
|
|
- },
|
|
|
|
- // 分页
|
|
|
|
- toPage(e) {
|
|
|
|
-
|
|
|
|
|
|
+ let user = that.user;
|
|
|
|
+ if (user && user._id && e && e.shop._id) {
|
|
|
|
+ let res = await that.$api(`/storeShop`, `POST`, {
|
|
|
|
+ customer: user._id,
|
|
|
|
+ shop: e.shop._id
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.data.msg,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.search()
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '缺少必要信息,无法收藏',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
+ // 清空列表
|
|
|
|
+ clearPage() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$set(that, `list`, [])
|
|
|
|
+ that.$set(that, `skip`, 0)
|
|
|
|
+ that.$set(that, `limit`, 5)
|
|
|
|
+ that.$set(that, `page`, 0)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|