|
@@ -10,8 +10,7 @@
|
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
|
<view class="list-scroll-view">
|
|
|
<view class="list" v-for="(item,index) in shoplist" :key="index">
|
|
|
- <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''"
|
|
|
- mode=""></image>
|
|
|
+ <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode=""></image>
|
|
|
<view class="name">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
@@ -37,20 +36,17 @@
|
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
|
<view class="list-scroll-view">
|
|
|
<view class="second_1">
|
|
|
- <view :class="['list',condActive==index?'activeList':'']"
|
|
|
- v-for="(item,index) in condList" :key="index" @tap="toCond(index,item)">
|
|
|
+ <view :class="['list',condActive==index?'activeList':'']" v-for="(item,index) in condList" :key="index" @tap="toCond(index,item)">
|
|
|
<view class="name">
|
|
|
{{item.name}}
|
|
|
</view>
|
|
|
<view class="icon">
|
|
|
<view class="icon_1">
|
|
|
- <text :class="['iconfont',item.shangActive]"
|
|
|
- v-if="condActive==index&&shang=='1'"></text>
|
|
|
+ <text :class="['iconfont',item.shangActive]" v-if="condActive==index&&shang=='1'"></text>
|
|
|
<text :class="['iconfont',item.shang]" v-else></text>
|
|
|
</view>
|
|
|
<view class="icon_1">
|
|
|
- <text :class="['iconfont', item.xiaActive]"
|
|
|
- v-if="condActive==index&&xia=='-1'"></text>
|
|
|
+ <text :class="['iconfont', item.xiaActive]" v-if="condActive==index&&xia=='-1'"></text>
|
|
|
<text :class="['iconfont', item.xia]" v-else></text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -58,8 +54,7 @@
|
|
|
</view>
|
|
|
<view class="second_2">
|
|
|
<view class="list" v-for="(item,index) in list" :key="index">
|
|
|
- <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''"
|
|
|
- mode=""></image>
|
|
|
+ <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''" mode=""></image>
|
|
|
<view class="sale" v-if="item.is_sale==true">
|
|
|
<text>已售尽</text>
|
|
|
</view>
|
|
@@ -103,8 +98,7 @@
|
|
|
</view>
|
|
|
<view class="second_2">
|
|
|
<view class="second_2_bor">
|
|
|
- <image class="image" :src="info.qrcode&&info.qrcode.length>0?info.qrcode[0].url:''"
|
|
|
- mode=""></image>
|
|
|
+ <image class="image" :src="info.qrcode&&info.qrcode.length>0?info.qrcode[0].url:''" mode=""></image>
|
|
|
</view>
|
|
|
<view class="txt">
|
|
|
店铺二维码
|
|
@@ -200,11 +194,12 @@
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
- onLoad: function(e) {
|
|
|
+ onLoad: async function(e) {
|
|
|
const that = this;
|
|
|
that.$set(that, `id`, e.id || '');
|
|
|
- that.watchLogin()
|
|
|
- that.search()
|
|
|
+ await that.watchLogin();
|
|
|
+ await that.search();
|
|
|
+ await that.searchOther();
|
|
|
},
|
|
|
onShow: function() {},
|
|
|
methods: {
|
|
@@ -342,18 +337,33 @@
|
|
|
that.clearPage();
|
|
|
that.searchAll();
|
|
|
},
|
|
|
+ // 查询其他信息
|
|
|
+ async searchOther() {
|
|
|
+ const that = this;
|
|
|
+ let user = that.user;
|
|
|
+ let shop = that.info;
|
|
|
+ if (user && user._id && shop && shop._id) {
|
|
|
+ // 商铺是否收藏
|
|
|
+ let arr = await that.$api(`/storeShop/check`, `GET`, {
|
|
|
+ customer: user._id,
|
|
|
+ shop: shop._id
|
|
|
+ });
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ that.$set(that, `collection`, arr.data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 收藏
|
|
|
async toCollect() {
|
|
|
const that = this;
|
|
|
- var params = {};
|
|
|
- params = {
|
|
|
- shop: that.id,
|
|
|
- customer: that.user.id
|
|
|
- }
|
|
|
- if (that.user) {
|
|
|
- let res = await that.$api(`/storeShop`, `POST`, params);
|
|
|
+ let user = that.user;
|
|
|
+ let shop = that.info;
|
|
|
+ if (user && user._id && shop && shop._id) {
|
|
|
+ let res = await that.$api(`/storeShop`, `POST`, {
|
|
|
+ customer: user._id,
|
|
|
+ shop: shop._id
|
|
|
+ });
|
|
|
if (res.errcode == '0') {
|
|
|
- console.log(res);
|
|
|
uni.showToast({
|
|
|
title: res.data.msg,
|
|
|
icon: 'none'
|
|
@@ -362,7 +372,7 @@
|
|
|
}
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
- title: '无用户登录无法收藏店铺',
|
|
|
+ title: '缺少必要信息,无法收藏',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|