|
|
@ -80,12 +80,12 @@ |
|
|
<view class="empty-sub">{{emptySubText}}</view> |
|
|
<view class="empty-sub">{{emptySubText}}</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="shop-card community-shop-card" :class="{'shop-card-disabled': item.status != 1}" |
|
|
<view class="shop-card community-shop-card" :class="{'shop-card-disabled': isShopUnavailable(item)}" |
|
|
v-for="(item,index) in shopList" :key="index" @tap="goShop(item)"> |
|
|
v-for="(item,index) in shopList" :key="index" @tap="goShop(item)"> |
|
|
<view @tap.stop="buyingye" v-if="item.status != 1" class="closed-mask"> |
|
|
<view @tap.stop="buyingye(item)" v-if="isShopUnavailable(item)" class="closed-mask"> |
|
|
<view class="closed-badge"> |
|
|
<view class="closed-badge"> |
|
|
<text class="closed-title">休息中</text> |
|
|
<text class="closed-title">{{getShopClosedTitle(item)}}</text> |
|
|
<text class="closed-hours" v-if="getBusinessHoursText(item)">营业时间 {{getBusinessHoursText(item)}}</text> |
|
|
<text class="closed-hours" v-if="shouldShowBusinessHours(item)">营业时间 {{getBusinessHoursText(item)}}</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-card-bg"></view> |
|
|
<view class="shop-card-bg"></view> |
|
|
@ -598,15 +598,15 @@ |
|
|
checkArea() { |
|
|
checkArea() { |
|
|
this.isArea = !this.isArea |
|
|
this.isArea = !this.isArea |
|
|
}, |
|
|
}, |
|
|
buyingye() { |
|
|
buyingye(item) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '店铺暂不营业,晚点再来逛', |
|
|
title: this.getShopStatus(item) == 2 ? '店铺暂停营业' : '店铺暂不营业,晚点再来逛', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
goShop(item) { |
|
|
goShop(item) { |
|
|
if (item && item.status != 1) { |
|
|
if (item && this.isShopUnavailable(item)) { |
|
|
this.buyingye() |
|
|
this.buyingye(item) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (!requireLoginToCurrentPage()) return |
|
|
if (!requireLoginToCurrentPage()) return |
|
|
@ -625,6 +625,19 @@ |
|
|
if (item.shopTakeaway && item.shopTakeaway.type) return item.shopTakeaway.type |
|
|
if (item.shopTakeaway && item.shopTakeaway.type) return item.shopTakeaway.type |
|
|
return this.isSocialArea ? '同城生活' : '校园生活' |
|
|
return this.isSocialArea ? '同城生活' : '校园生活' |
|
|
}, |
|
|
}, |
|
|
|
|
|
getShopStatus(item) { |
|
|
|
|
|
const status = Number(item && item.status) |
|
|
|
|
|
return isNaN(status) ? 1 : status |
|
|
|
|
|
}, |
|
|
|
|
|
isShopUnavailable(item) { |
|
|
|
|
|
return this.getShopStatus(item) != 1 |
|
|
|
|
|
}, |
|
|
|
|
|
getShopClosedTitle(item) { |
|
|
|
|
|
return this.getShopStatus(item) == 2 ? '暂停营业' : '休息中' |
|
|
|
|
|
}, |
|
|
|
|
|
shouldShowBusinessHours(item) { |
|
|
|
|
|
return this.getShopStatus(item) != 2 && !!this.getBusinessHoursText(item) |
|
|
|
|
|
}, |
|
|
formatShopItem(item, index) { |
|
|
formatShopItem(item, index) { |
|
|
const heatPercent = this.getHeatPercent(item, index) |
|
|
const heatPercent = this.getHeatPercent(item, index) |
|
|
return { |
|
|
return { |
|
|
|