Browse Source

feat: 找店、搜索、推荐中的品牌列表,都要加上角标

ShangHai_LongXiang
jiannibang 2 years ago
parent
commit
287759e949
  1. 17
      src/components/SearchResultItem/SearchResultItem.vue
  2. BIN
      src/components/SearchResultItem/pictag.png

17
src/components/SearchResultItem/SearchResultItem.vue

@ -1,5 +1,6 @@
<template>
<div class="item" @click="handleShop">
<img v-if="pics" src="./pictag.png" class="pictag" alt="" />
<div class="icon-wrapper">
<img :src="'./static/offline' + shop.logoUrl" class="icon" alt="" />
</div>
@ -12,6 +13,12 @@
</template>
<script setup>
import { useStore } from '@/store/root'
import { storeToRefs } from 'pinia'
import { computed } from 'vue'
const store = useStore()
const { shopPicsMap } = storeToRefs(store)
const props = defineProps({
shop: {
type: Object,
@ -22,7 +29,7 @@ const props = defineProps({
default: () => ({})
}
})
const pics = computed(() => shopPicsMap.value[props.shop.shopCode])
const emits = defineEmits(['click'])
function handleShop() {
emits('click', props.shop)
@ -31,6 +38,7 @@ function handleShop() {
<style lang="scss" scoped>
.item {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
@ -40,6 +48,13 @@ function handleShop() {
border-radius: var(--global-radius, 8px);
margin-right: 8px;
margin-top: 24px;
.pictag {
position: absolute;
left: 4px;
top: 4px;
width: 24px;
height: 24px;
}
.icon-wrapper {
display: flex;
width: 210px;

BIN
src/components/SearchResultItem/pictag.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Loading…
Cancel
Save