This commit is contained in:
1 parent
1009236495
commit
41e9863ab0
1 file changed
+12
-18
@@ -98,33 +98,28 @@
|
||||
|
||||
<tm-drawer
|
||||
title="切换超市"
|
||||
:showClose="false"
|
||||
:showClose="true"
|
||||
:showFooter="true"
|
||||
size="70%"
|
||||
size="50%"
|
||||
v-model:show="state.shopDrawerShow"
|
||||
:duration="100"
|
||||
zIndex="1200"
|
||||
>
|
||||
<tm-radio-group v-model="state.curMerchantRadioId" direction="column">
|
||||
<view
|
||||
<tm-radio
|
||||
v-for="(item, index) in state.merchantList"
|
||||
:key="index"
|
||||
class="w-full flex items-center p-2 rounded-3"
|
||||
:class="[state.curMerchantRadioId == item.id ? 'bg-#e8e8e8' : '']"
|
||||
:value="item.id"
|
||||
>
|
||||
<tm-radio :value="item.id">
|
||||
<template v-slot:label="checked">
|
||||
<view class="flex items-center">
|
||||
<image class="size-130rpx rounded-2" :src="filePath(item.logoPic)" mode="aspectFill" />
|
||||
<view class="ml-2 flex-1 flex-col">
|
||||
<tm-text font-size="30">{{ item.name }}</tm-text>
|
||||
<view class="second-text-26">地址 {{ item.addressDes }}</view>
|
||||
<view class="second-text-26">手机 {{ item.phone }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</tm-radio>
|
||||
</view>
|
||||
<template v-slot:label="checked">
|
||||
<view class="flex items-center">
|
||||
<image class="size-80rpx rounded-2 mr-2" :src="filePath(item.logoPic)" mode="aspectFill" />
|
||||
<tm-text font-size="30">{{ item.name }}</tm-text>
|
||||
</view>
|
||||
</template>
|
||||
</tm-radio>
|
||||
</tm-radio-group>
|
||||
|
||||
<template #footer>
|
||||
@@ -149,7 +144,6 @@ import { filePath } from "@@/utils/file"
|
||||
import { merchantApi, onlineShopApi } from "@@/api"
|
||||
import { hooks, router } from "@@/index"
|
||||
import { useCartStore } from "@/sheep/stores/cart"
|
||||
import { displayPrice } from "@/sheep/utils/formatMoney"
|
||||
import treeToList from "@/sheep/utils/tree-to-list"
|
||||
|
||||
const cartStore = useCartStore()
|
||||
@@ -186,7 +180,7 @@ const getAllMerchant = async () => {
|
||||
try {
|
||||
const { code, data }: any = await merchantApi.page({ current: 1, pagesize: 9999999, type: "3" })
|
||||
if (code != 0) return uni.showToast({ title: "商户获取失败", icon: "error" })
|
||||
state.merchantList = data.records ?? []
|
||||
state.merchantList = data.records.filter((item) => item.name.includes("超市")) ?? []
|
||||
state.curMerchant = state.merchantList[0] ?? {}
|
||||
state.params.merchantId = state.curMerchant.id
|
||||
cartStore.saveShopMerchantId(state.curMerchant.id)
|
||||
|
||||
Reference in new issue
Block a user