wangfukang 14 hours ago
parent
commit
bd6f3806bb
  1. 29
      package2/group/groupBuyList.vue
  2. 29
      package2/group/studentStoreList.vue

29
package2/group/groupBuyList.vue

@ -106,11 +106,11 @@
</view>
</view>
<view class="shop-list">
<view class="shop-member" :class="{'shop-member-disabled': item.status != 1}" v-for="(item,index) in shopList" :key="item._renderKey" @tap="goDetail('shop',item)">
<view class="shop-disabled-mask" @tap.stop="buyingye" v-if="item.status != 1">
<view class="shop-member" :class="{'shop-member-disabled': isShopUnavailable(item)}" v-for="(item,index) in shopList" :key="item._renderKey" @tap="goDetail('shop',item)">
<view class="shop-disabled-mask" @tap.stop="buyingye(item)" v-if="isShopUnavailable(item)">
<view class="closed-badge">
<text class="closed-title">休息中</text>
<text class="closed-hours" v-if="getBusinessHoursText(item)">营业时间 {{getBusinessHoursText(item)}}</text>
<text class="closed-title">{{getShopClosedTitle(item)}}</text>
<text class="closed-hours" v-if="shouldShowBusinessHours(item)">营业时间 {{getBusinessHoursText(item)}}</text>
</view>
</view>
<view class="shop-card-bg"></view>
@ -555,9 +555,9 @@
this.searchForm.pageNumber = 1
this.getShopList()
},
buyingye() {
buyingye(item) {
uni.showToast({
title: '店铺不在营业时间!',
title: this.getShopStatus(item) == 2 ? '店铺暂停营业' : '店铺不在营业时间!',
icon: 'none'
});
},
@ -815,6 +815,19 @@
getDineInText(item) {
return item && item.supportDineIn == 1 ? '可堂食' : '无堂食'
},
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)
},
openKitchen(item) {
if (!this.hasOpenKitchenVideo(item)) {
this.tui.toast('暂无明厨亮灶')
@ -903,8 +916,8 @@
goDetail(type, item) {
console.log('数据',item)
if (type == 'shop') {
if (item && item.status != 1) {
this.buyingye()
if (item && this.isShopUnavailable(item)) {
this.buyingye(item)
return
}
if (!requireLoginToCurrentPage()) return

29
package2/group/studentStoreList.vue

@ -80,12 +80,12 @@
<view class="empty-sub">{{emptySubText}}</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)">
<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">
<text class="closed-title">休息中</text>
<text class="closed-hours" v-if="getBusinessHoursText(item)">营业时间 {{getBusinessHoursText(item)}}</text>
<text class="closed-title">{{getShopClosedTitle(item)}}</text>
<text class="closed-hours" v-if="shouldShowBusinessHours(item)">营业时间 {{getBusinessHoursText(item)}}</text>
</view>
</view>
<view class="shop-card-bg"></view>
@ -598,15 +598,15 @@
checkArea() {
this.isArea = !this.isArea
},
buyingye() {
buyingye(item) {
uni.showToast({
title: '店铺暂不营业,晚点再来逛',
title: this.getShopStatus(item) == 2 ? '店铺暂停营业' : '店铺暂不营业,晚点再来逛',
icon: 'none'
})
},
goShop(item) {
if (item && item.status != 1) {
this.buyingye()
if (item && this.isShopUnavailable(item)) {
this.buyingye(item)
return
}
if (!requireLoginToCurrentPage()) return
@ -625,6 +625,19 @@
if (item.shopTakeaway && item.shopTakeaway.type) return item.shopTakeaway.type
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) {
const heatPercent = this.getHeatPercent(item, index)
return {

Loading…
Cancel
Save