线上超市修改

This commit is contained in:
weiwei committed 2025-07-17 14:54:18 +08:00
1 parent 4540d547bb
commit f7cce3e5bc
4 files changed
+53 -45

No files matched your search

+11 -9
View File
@@ -27,7 +27,7 @@
<view class="w-full flex items-center">
<tm-input
class="flex-1"
v-model="state.params.productName"
v-model="state.params.keyword"
type="text"
:height="66"
:minHeight="66"
@@ -85,14 +85,12 @@
<view class="sub-text-32 show-line">{{ item.productName }}</view>
<view class="flex-row justify-between items-center">
<view class="flex items-center">
<view class="second-text-32 c-red!">
¥{{ parseFloat(item.promotionPrice) != 0 ? hooks.useMoney(item.promotionPrice) : hooks.useMoney(item.retailPrice) }}
</view>
<view v-if="parseFloat(item.promotionPrice) != 0" class="ml-10rpx second-text-30 line-through">
<view class="second-text-32 c-red!">¥ {{ storePrice(item.minPrice).toFixed(2) }}</view>
<!-- <view v-if="parseFloat(item.promotionPrice) != 0" class="ml-10rpx second-text-30 line-through">
¥{{ hooks.useMoney(item.retailPrice) || 0 }}
</view>
</view> -->
</view>
<view class="second-text-26">已售:{{ item.salesCount || 0 }}</view>
<view class="second-text-26">已售:{{ item.salesCount || 0 }}</view>
</view>
</view>
</view>
@@ -153,6 +151,7 @@ import { filePath } from "@@/utils/file"
import { merchantApi, onlineShopApi } from "@@/api"
import { hooks, router } from "@@/index"
import { useCartStore } from "@/sheep/stores/cart"
import { storePrice } from "@/sheep/utils/formatMoney"
const cartStore = useCartStore()
@@ -161,7 +160,7 @@ const state = reactive<any>({
merchantId: "",
categoryId: "",
size: 10,
productName: "",
keyword: "",
},
merchantList: [],
@@ -179,7 +178,6 @@ onLoad(async () => {
await getAllMerchant()
await getClassify()
cartStore.saveShopMerchantId(state.curMerchant.id)
await cartStore.getShopCart()
})
@@ -196,6 +194,8 @@ const getAllMerchant = async () => {
state.merchantList = data.records
if (!isEmpty(state.merchantList)) {
state.curMerchant = state.merchantList[0]
state.params.merchantId = state.curMerchant.id
cartStore.saveShopMerchantId(state.curMerchant.id)
return
}
state.curMerchant = {}
@@ -240,8 +240,10 @@ const changeShop = () => {
const confirmRadioMerchant = async () => {
state.curMerchant = state.merchantList.find((item: any) => item.id == state.curMerchantRadioId)
state.showDrawer = false
state.params.merchantId = state.curMerchant.id
cartStore.saveShopMerchantId(state.curMerchant.id)
await cartStore.getShopCart()
pageRef.value && pageRef.value.reload(true)
}
// 点击搜索