|
|
|
@ -1,17 +1,26 @@ |
|
|
|
<template> |
|
|
|
<div :class="{ 'group-item': true, isRow, isFood }" @click="handleShop"> |
|
|
|
<div :class="{ 'logo-wrapper': true, hasFood: isFood && shop.foodMaterialList.length }"> |
|
|
|
<div :id="shop.houseNumber" class="group-item" :class="{ isRow, isFood, isActive }" @click="handleShop"> |
|
|
|
<div class="logo-wrapper" :class="{ hasFood: isFood && shop.foodMaterialList.length }"> |
|
|
|
<img loading="lazy" :src="config.sourceUrl + shop.logoUrl" alt="" class="shop-logo" /> |
|
|
|
</div> |
|
|
|
<p class="name"> |
|
|
|
<span class="shop-name">{{ switchLanguage(shop, 'shopName') }}</span> |
|
|
|
<span class="name-right" v-if="$route.path === '/guide'"> {{ shop.distance ? shop.distance + '米' : '' }}<img v-if="shop.dir" :src="shop.dir" /> </span> |
|
|
|
<span class="name-right" v-if="$route.path === '/guide'"> {{ shop.distance ? shop.distance + '米' : '' }}<img v-if="shop.dir" class="dir" :src="shop.dir" /> </span> |
|
|
|
<span class="name-right" v-else>{{ shop.floor }}</span> |
|
|
|
</p> |
|
|
|
<Transition appear enter-active-class="animate__animated animate__fadeIn" leave-active-class="animate__animated animate__fadeOut"> |
|
|
|
<div v-if="isActive" class="qrcode-wrapper"> |
|
|
|
<div class="qrcode"></div> |
|
|
|
扫码导航 |
|
|
|
</div> |
|
|
|
</Transition> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup> |
|
|
|
import { computed } from 'vue' |
|
|
|
import { storeToRefs } from 'pinia' |
|
|
|
import { useStore } from '@/store/root' |
|
|
|
const props = defineProps({ |
|
|
|
shop: Object, |
|
|
|
config: Object, |
|
|
|
@ -19,6 +28,10 @@ const props = defineProps({ |
|
|
|
isFood: Boolean |
|
|
|
}) |
|
|
|
|
|
|
|
const store = useStore() |
|
|
|
const { shop: activeShop } = storeToRefs(store) |
|
|
|
const isActive = computed(() => activeShop.value && activeShop.value.shopId === props.shop.shopId) |
|
|
|
|
|
|
|
const emits = defineEmits(['click']) |
|
|
|
function handleShop() { |
|
|
|
emits('click', props.shop) |
|
|
|
@ -32,55 +45,48 @@ function handleShop() { |
|
|
|
background: rgba(255, 255, 255, 0.6); |
|
|
|
border-radius: 8px; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
.logo-wrapper { |
|
|
|
width: 230px; |
|
|
|
height: 160px; |
|
|
|
padding: 20px 55px; |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
.shop-logo { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
object-fit: contain; |
|
|
|
} |
|
|
|
.name { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
height: 40px; |
|
|
|
padding: 0 12px; |
|
|
|
} |
|
|
|
.shop-name { |
|
|
|
font-weight: 700; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 16px; |
|
|
|
color: rgba(0, 0, 0, 0.8); |
|
|
|
flex: 1; |
|
|
|
white-space: nowrap; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
font-weight: 700; |
|
|
|
font-size: 12px; |
|
|
|
line-height: 14px; |
|
|
|
font-family: 'font_bold'; |
|
|
|
color: rgba(0, 0, 0, 0.4); |
|
|
|
img { |
|
|
|
.logo-wrapper { |
|
|
|
width: 230px; |
|
|
|
height: 160px; |
|
|
|
padding: 20px 55px; |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
.shop-logo { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
object-fit: contain; |
|
|
|
} |
|
|
|
.name { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
height: 40px; |
|
|
|
padding: 0 12px; |
|
|
|
} |
|
|
|
.shop-name { |
|
|
|
font-weight: 700; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 16px; |
|
|
|
color: rgba(0, 0, 0, 0.8); |
|
|
|
flex: 1; |
|
|
|
white-space: nowrap; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
font-weight: 700; |
|
|
|
font-size: 12px; |
|
|
|
line-height: 14px; |
|
|
|
font-family: 'font_bold'; |
|
|
|
color: rgba(0, 0, 0, 0.4); |
|
|
|
} |
|
|
|
.dir { |
|
|
|
width: 20px; |
|
|
|
height: 20px; |
|
|
|
margin-left: 7px; |
|
|
|
} |
|
|
|
} |
|
|
|
.format-icon { |
|
|
|
width: 14px; |
|
|
|
margin-right: 8px; |
|
|
|
height: 14px; |
|
|
|
} |
|
|
|
.group-item { |
|
|
|
&.isRow { |
|
|
|
display: flex; |
|
|
|
width: 460px; |
|
|
|
@ -96,21 +102,21 @@ function handleShop() { |
|
|
|
.name { |
|
|
|
flex: 1; |
|
|
|
padding: 0 24px; |
|
|
|
.shop-name { |
|
|
|
font-weight: 700; |
|
|
|
font-size: 18px; |
|
|
|
line-height: 21px; |
|
|
|
color: rgba(0, 0, 0, 0.8); |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
font-weight: 500; |
|
|
|
font-size: 18px; |
|
|
|
line-height: 21px; |
|
|
|
img { |
|
|
|
width: 32px; |
|
|
|
height: 32px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.shop-name { |
|
|
|
font-weight: 700; |
|
|
|
font-size: 18px; |
|
|
|
line-height: 21px; |
|
|
|
color: rgba(0, 0, 0, 0.8); |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
font-weight: 500; |
|
|
|
font-size: 18px; |
|
|
|
line-height: 21px; |
|
|
|
} |
|
|
|
.dir { |
|
|
|
width: 32px; |
|
|
|
height: 32px; |
|
|
|
} |
|
|
|
} |
|
|
|
&.isFood { |
|
|
|
@ -137,22 +143,44 @@ function handleShop() { |
|
|
|
.name { |
|
|
|
display: block; |
|
|
|
width: 100%; |
|
|
|
.shop-name { |
|
|
|
display: block; |
|
|
|
margin-top: 12px; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
display: block; |
|
|
|
text-align: center; |
|
|
|
font-family: 'Montserrat'; |
|
|
|
font-style: normal; |
|
|
|
font-weight: 700; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 17px; |
|
|
|
color: rgba(0, 0, 0, 0.6); |
|
|
|
margin-top: 6px; |
|
|
|
} |
|
|
|
} |
|
|
|
.shop-name { |
|
|
|
display: block; |
|
|
|
margin-top: 12px; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
.name-right { |
|
|
|
display: block; |
|
|
|
text-align: center; |
|
|
|
font-family: 'Montserrat'; |
|
|
|
font-style: normal; |
|
|
|
font-weight: 700; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 17px; |
|
|
|
color: rgba(0, 0, 0, 0.6); |
|
|
|
margin-top: 6px; |
|
|
|
} |
|
|
|
} |
|
|
|
&.isActive { |
|
|
|
position: relative; |
|
|
|
|
|
|
|
.qrcode-wrapper { |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
right: 0; |
|
|
|
bottom: 0; |
|
|
|
background: linear-gradient(99.5deg, #f0b92b 0%, #f9d556 100%); |
|
|
|
font-weight: 700; |
|
|
|
font-size: 14px; |
|
|
|
color: rgba(0, 0, 0, 0.8); |
|
|
|
text-align: center; |
|
|
|
line-height: 40px; |
|
|
|
} |
|
|
|
.qrcode { |
|
|
|
height: 160px; |
|
|
|
background: #ffffff; |
|
|
|
border-radius: 8px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|