feat:共富商城

This commit is contained in:
weiwei committed 2025-09-08 19:10:35 +08:00
1 parent cb050459a7
commit 34cb50cdfc
3 files changed
+60 -40

No files matched your search

+18 -18
View File
@@ -29,39 +29,39 @@
class="flex-1"
v-model="state.params.keyword"
type="text"
height="66"
minHeight="66"
height="72"
minHeight="72"
fontSize="28"
:showClear="true"
:focus="false"
placeholder="请输入商品名称"
style="border: 2rpx solid #0779fd; border-radius: 14rpx"
style="border: 4rpx solid #0779fd; border-radius: 14rpx"
:focus-highlight="false"
color="#ECF4F9"
>
<template v-slot:rightIcon>
<tm-button class="mr-1 py-3" size="xs" @click="searchProduct">搜索</tm-button>
<tm-button class="mr-1 px-3 py-26rpx text-30rpx!" size="xs" @click="searchProduct">搜 索</tm-button>
</template>
</tm-input>
<tm-badge bg-color="red" :offset="[8, 4]" :label="cartStore.totCount">
<view class="flex-col-center size-80rpx" @tap="doCart">
<view class="color-#0094ff! iconfont icon-biaoqianlanicon_gouwuche-xuanzhong" />
<view class="c-#0094ff text-20rpx">购物车</view>
<view class="c-#0094ff text-22rpx">购物车</view>
</view>
</tm-badge>
</view>
<scroll-view scroll-x class="whitespace-nowrap my-2">
<tm-tag
class="mr-2"
size="s"
:skin="state.params.categoryId == v.id ? 'normal' : 'outlined'"
v-for="(v, i) in state.classifyList"
:key="i"
@tap="doClassify(v.id)"
>
{{ v.name }}
</tm-tag>
<scroll-view scroll-x>
<view class="w-full flex my-2">
<view
class="mr-2 sub-text-28 py-1 px-2 rounded-1 bg-#fff border border-solid border-transparent"
:class="{ 'bg-#0779FD22! c-#0779FD! border-#0779FD33!': state.params.categoryId === v.id }"
v-for="(v, i) in state.classifyList"
:key="i"
@tap="doClassify(v.id)"
>
{{ v.name }}
</view>
</view>
</scroll-view>
</template>
@@ -76,7 +76,7 @@
:hasAroundGutter="false"
backgroundColor="#ffffff00"
:crossOrigin="false"
:animationCancel="true"
:animationCancel="false"
>
<template #default="{ item, url, index }">
<view class="card" @click="toDetail(item)">
+41 -21
View File
@@ -56,43 +56,45 @@
</template>
<view class="card p-20rpx mb-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
<view class="flex items-center">
<image class="w-150rpx h-150rpx rounded-12rpx bg-#c4c4c4" :src="filePath(v.images)" mode="aspectFill" />
<view class="flex">
<image class="w-150rpx h-150rpx rounded-12rpx" :src="filePath(v.images)" mode="aspectFill" />
<view class="ml-20rpx flex-1 overflow-hidden">
<view class="sub-text-30 truncate">{{ v.name }}</view>
<view class="second-text-26 truncate">
<text class="mr-20rpx">{{ v.contactName }}</text>
<text class="mr-20rpx">{{ v.contactPhone }}</text>
<text class="mr-20rpx">
<image class="w-24rpx h-24rpx mr-1" src="@/static/page/phone.svg" />
<text @tap="doPhone(v.contactPhone)">{{ v.contactPhone }}</text>
</text>
<text>{{ v.email }}</text>
</view>
<view class="sub-text-26 truncate">
<text class="bg-#0779FD11 py-1 rounded-2 c-#0094ff">{{ v.businessHours }}</text>
<text class="bg-#0779FD11 py-1 rounded-2 c-#0094ff">营业:{{ v.businessHours }}</text>
</view>
<view class="second-text-26">
<image class="w-24rpx h-24rpx mr-1" src="@/static/page/address.svg" />
<text>{{ v.address }}</text>
</view>
<view class="second-text-26">{{ v.address }}1111</view>
</view>
</view>
<scroll-view scroll-x>
<view class="flex justify-start pt-2">
<view
class="w-150rpx overflow-hidden flex-col justify-start items-center mr-20rpx"
v-for="(pV, pI) in v.featuredProducts"
:key="pI"
>
<image class="w-150rpx h-150rpx rounded-12rpx bg-#c4c4c4" :src="filePath(pV.coverImage)" mode="aspectFill" />
<view class="mt-4rpx sub-text-24 truncate">{{ pV.title }}</view>
<view class="w-full flex justify-around">
<text class="main-text-26 truncate color-red!">
<view class="flex mt-2">
<view class="w-160rpx flex-col items-center mr-20rpx" v-for="(pV, pI) in v.featuredProducts" :key="pI">
<image class="w-160rpx h-160rpx rounded-12rpx" :src="filePath(pV.coverImage)" mode="aspectFill" />
<view class="w-full mt-4rpx sub-text-24 truncate">{{ pV.title }}</view>
<view class="w-full flex justify-between pr-1">
<text class="main-text-26 color-red!">
<text class="text-22rpx">¥</text>
<text>{{ hooks.useMoney(pV.minPrice) }}</text>
<text>{{ pV.spuPrice.toFixed(2) }}</text>
</text>
<text class="sub-text-26 truncate">{{ pV.unit || "" }}</text>
<text class="sub-text-24">{{ pV.unit || "" }}</text>
</view>
<view class="w-full flex justify-around">
<text class="second-text-24 truncate">
<view class="w-full flex justify-between pr-1">
<text class="second-text-24 line-through">
<text class="text-22rpx">¥</text>
<text>{{ hooks.useMoney(pV.spuPrice) }}</text>
<text>{{ pV.originalPrice.toFixed(2) }}</text>
</text>
<text class="second-text-26 truncate">库存{{ pV.totalStock }}</text>
<text class="second-text-24">库存{{ pV.totalStock }}</text>
</view>
</view>
</view>
@@ -109,6 +111,8 @@ import { onLoad } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { reactive, ref } from "vue"
import { filePath } from "@@/utils/file"
import { getAppInfo } from "@/sheep/utils/app"
import { APPENV } from "@/sheep/constant"
const state = reactive<any>({
params: {
@@ -164,6 +168,22 @@ const search = () => {
pageRef.value && pageRef.value.reload(true)
}
// 联系商家
const doPhone = async (item: string) => {
if (isEmpty(item)) return uni.showToast({ title: "该商户没有预留电话", icon: "none" })
if ((await getAppInfo()) == APPENV.ZZD) {
;(window as any).dd
.callPhone({ phoneNum: item.trim() })
.then((res) => {})
.catch((err) => {})
return
}
if ((await getAppInfo()) == APPENV.SH) {
hooks.useMakePhoneCall(item.trim())
return
}
}
// 超市详情
const toDetail = async (v: any) => {
const isLogin = await hooks.useCheckLogin()
+1 -1
View File
@@ -6,7 +6,7 @@ export default {
return request({
url: "/supermarket/app/mall/merchant/list",
method: "GET",
params,
params: { productLimit: 5 },
})
},
}