|
@@ -10,7 +10,8 @@
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<view class="list-scroll-view">
|
|
<view class="list-scroll-view">
|
|
<view class="list" v-for="(item,index) in shoplist" :key="index">
|
|
<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">
|
|
<view class="name">
|
|
{{item.name}}
|
|
{{item.name}}
|
|
</view>
|
|
</view>
|
|
@@ -36,17 +37,20 @@
|
|
<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="second_1">
|
|
<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">
|
|
<view class="name">
|
|
{{item.name}}
|
|
{{item.name}}
|
|
</view>
|
|
</view>
|
|
<view class="icon">
|
|
<view class="icon">
|
|
<view class="icon_1">
|
|
<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>
|
|
<text :class="['iconfont',item.shang]" v-else></text>
|
|
</view>
|
|
</view>
|
|
<view class="icon_1">
|
|
<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>
|
|
<text :class="['iconfont', item.xia]" v-else></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -54,7 +58,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="second_2">
|
|
<view class="second_2">
|
|
<view class="list" v-for="(item,index) in list" :key="index">
|
|
<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">
|
|
<view class="sale" v-if="item.is_sale==true">
|
|
<text>已售尽</text>
|
|
<text>已售尽</text>
|
|
</view>
|
|
</view>
|
|
@@ -98,7 +103,8 @@
|
|
</view>
|
|
</view>
|
|
<view class="second_2">
|
|
<view class="second_2">
|
|
<view class="second_2_bor">
|
|
<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>
|
|
<view class="txt">
|
|
<view class="txt">
|
|
店铺二维码
|
|
店铺二维码
|
|
@@ -129,7 +135,9 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ user: {},
|
|
id: '',
|
|
id: '',
|
|
|
|
+
|
|
barActive: '0',
|
|
barActive: '0',
|
|
barList: [ //底部菜单
|
|
barList: [ //底部菜单
|
|
{
|
|
{
|
|
@@ -195,10 +203,23 @@
|
|
onLoad: function(e) {
|
|
onLoad: function(e) {
|
|
const that = this;
|
|
const that = this;
|
|
that.$set(that, `id`, e.id || '');
|
|
that.$set(that, `id`, e.id || '');
|
|
|
|
+ that.watchLogin()
|
|
that.search()
|
|
that.search()
|
|
},
|
|
},
|
|
onShow: function() {},
|
|
onShow: function() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 监听用户是否登录
|
|
|
|
+ watchLogin() {
|
|
|
|
+ const that = this;
|
|
|
|
+ uni.getStorage({
|
|
|
|
+ key: 'token',
|
|
|
|
+ success: function(res) {
|
|
|
|
+ let user = that.$jwt(res.data);
|
|
|
|
+ that.$set(that, `user`, user);
|
|
|
|
+ },
|
|
|
|
+ fail: function(err) {}
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 查询信息
|
|
// 查询信息
|
|
async search() {
|
|
async search() {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -206,6 +227,7 @@
|
|
// 查询店铺信息
|
|
// 查询店铺信息
|
|
const res = await that.$api(`/shop/${that.id}`, 'GET');
|
|
const res = await that.$api(`/shop/${that.id}`, 'GET');
|
|
if (res.errcode == '0') that.$set(that, `info`, res.data);
|
|
if (res.errcode == '0') that.$set(that, `info`, res.data);
|
|
|
|
+
|
|
// 查询店铺商品
|
|
// 查询店铺商品
|
|
that.searchShopMarket();
|
|
that.searchShopMarket();
|
|
// 查询全部商品
|
|
// 查询全部商品
|
|
@@ -315,14 +337,30 @@
|
|
that.searchAll();
|
|
that.searchAll();
|
|
},
|
|
},
|
|
// 收藏
|
|
// 收藏
|
|
- toCollect() {
|
|
|
|
|
|
+ async toCollect() {
|
|
const that = this;
|
|
const that = this;
|
|
that.collection = !that.collection;
|
|
that.collection = !that.collection;
|
|
if (that.collection == true) {
|
|
if (that.collection == true) {
|
|
- uni.showToast({
|
|
|
|
- title: `收藏成功`,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
|
|
+ var params = {};
|
|
|
|
+ params = {
|
|
|
|
+ shop: that.info.id,
|
|
|
|
+ customer: that.user.id
|
|
|
|
+ }
|
|
|
|
+ const arr = await that.$api(`/storeShop`, 'POST', params)
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ const aee = await that.$api(`/storeShop/check`, 'POST', params)
|
|
|
|
+ if (aee.errcode == '0') {
|
|
|
|
+ console.log(aee.data);
|
|
|
|
+ }
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: `收藏成功`,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: arr.errmsg,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: `取消成功`,
|
|
title: `取消成功`,
|