feat:增加共富商城上架列表模式

This commit is contained in:
dzc committed 2026-02-04 13:22:25 +08:00
1 parent 4b1ffcdbd2
commit 861b81aefe
6 files changed
+186 -69

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ const tabbar: TabbarItem[] = [
},
{
pagePath: "pages/tabbar/onlineShop",
text: "在线商城",
text: "在线商城(商品展示)",
iconPath: "/static/tabbar/online-shop.png",
selectedIconPath: "/static/tabbar/online-shop-select.png",
launchParam: ["onlineShop"],
+13
View File
@@ -51,6 +51,13 @@
"disableScroll": true
}
},
{
"path": "pages/tabbar/prosperityShopMchList",
"style": {
"navigationBarTitleText": "共富商城",
"disableScroll": true
}
},
{
"path": "pages/tabbar/coopMerchant",
"style": {
@@ -688,6 +695,12 @@
"iconPath": "",
"selectedIconPath": ""
},
{
"pagePath": "pages/tabbar/prosperityShopMchList",
"text": "",
"iconPath": "",
"selectedIconPath": ""
},
{
"pagePath": "pages/tabbar/cabinet",
"text": "",
+10 -29
View File
@@ -63,37 +63,16 @@ const toDetail = async (v: any) => {
<template>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="10"
safe-area-inset-bottom
:loading-more-enabled="true"
:show-scrollbar="false"
@query="query"
:auto-clean-list-when-reload="false"
:auto-scroll-to-top-when-reload="false"
@scroll="pageHook.scroll"
>
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="h-30rpx" />
<view class="flex w-full">
<tm-input
class="flex-1"
v-model="state.pa.name"
type="text"
height="72"
minHeight="72"
fontSize="28"
:showClear="true"
:focus="false"
placeholder="请输入商家名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx"
:focus-highlight="false"
color="#ECF4F9"
>
<tm-input class="flex-1" v-model="state.pa.name" type="text" height="72" minHeight="72"
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
color="#ECF4F9">
<template v-slot:rightIcon>
<tm-button class="mr-1 px-3 py-26rpx text-30rpx!" size="xs" @click="search">搜 索</tm-button>
</template>
@@ -119,7 +98,9 @@ const toDetail = async (v: any) => {
<view class="second-text-28 ml-1">{{ v.phone }}</view>
</view>
</view>
<tm-tag class="max-w-160rpx" size="xs">{{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }}</tm-tag>
<tm-tag class="max-w-160rpx" size="xs">{{ v.deptName.length > 5 ? v.deptName.substring(0, 5)
+ "..." :
v.deptName }}</tm-tag>
</view>
<view class="second-text-24">
<view v-if="v.jobTime != ',,'" class="second-text-28">营业时间:</view>
+16 -4
View File
@@ -24,13 +24,19 @@ const moduleList = [
},
{
pagePath: "/pages/tabbar/onlineShop",
text: "在线商城",
text: "在线商城(商品展示)",
iconPath: "/static/tabbar/online-shop-select.png",
launchParam: "onlineShop",
},
{
pagePath: "/pages/tabbar/prosperityShop",
text: "共富商城",
text: "共富商城(店铺商品模式)",
iconPath: "/static/tabbar/prosperity-shop-select.png",
launchParam: "prosperityShop",
},
{
pagePath: "/pages/tabbar/prosperityShopMchList",
text: "共富商城(商家模式)",
iconPath: "/static/tabbar/prosperity-shop-select.png",
launchParam: "prosperityShop",
},
@@ -90,6 +96,10 @@ const jumpByParam = async () => {
uni.setStorageSync("launchParam", launchParam)
uni.switchTab({ url: "/pages/tabbar/prosperityShop" })
break
case "prosperityShopMchList": // 共富商城(商家模式)
uni.setStorageSync("launchParam", launchParam)
uni.switchTab({ url: "/pages/tabbar/prosperityShopMchList" })
break
default:
uni.hideTabBar()
break
@@ -147,8 +157,10 @@ const doModuleJump = (item: any) => {
<view class="w-full h-full flex-col-center">
<tm-sheet v-if="isDevEnv()" :margin="[0]">
<view class="flex-row items-center justify-center flex-wrap">
<view class="w-half flex justify-center py-2 rounded-1" v-for="(item, index) in moduleList" :key="index">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200" @tap="doModuleJump(item)">
<view class="w-half flex justify-center py-2 rounded-1" v-for="(item, index) in moduleList"
:key="index">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200"
@tap="doModuleJump(item)">
<image class="w-80 h-80 px-2 pt-2" :src="item.iconPath" />
<tm-text font-size="32">{{ item.text }}</tm-text>
</view>
+19 -35
View File
@@ -1,39 +1,18 @@
<template>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="10"
safe-area-inset-bottom
:loading-more-enabled="true"
:show-scrollbar="false"
@query="query"
:auto-clean-list-when-reload="false"
:auto-scroll-to-top-when-reload="false"
@scroll="pageHook.scroll"
>
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="flex justify-between items-center my-1">
<tm-text font-size="40" color="#0779FD" class="font-bold">共富商城</tm-text>
<tm-text font-size="30" color="#0779FD">优质商户,品质商品,欢迎联系购买</tm-text>
</view>
<view class="w-full flex items-center mb-2">
<tm-input
class="flex-1"
v-model="state.params.keyword"
type="text"
height="72"
minHeight="72"
fontSize="28"
:showClear="true"
:focus="false"
placeholder="请输入超市名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx"
:focus-highlight="false"
color="#ECF4F9"
>
<tm-input class="flex-1" v-model="state.params.keyword" type="text" height="72" minHeight="72"
fontSize="28" :showClear="true" :focus="false" placeholder="请输入超市名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
color="#ECF4F9">
<template v-slot:rightIcon>
<tm-button class="mr-1 px-3 py-26rpx text-30rpx!" size="xs" @click="search">搜 索</tm-button>
</template>
@@ -57,7 +36,8 @@
<view class="card p-20rpx mb-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
<view class="flex">
<image class="w-160rpx h-160rpx bg-#eeeeee rounded-12rpx" :src="filePath(v.images)" mode="aspectFill" />
<image class="w-160rpx h-160rpx bg-#eeeeee rounded-12rpx" :src="filePath(v.images)"
mode="aspectFill" />
<view class="ml-20rpx flex-1 overflow-hidden">
<view class="sub-text-32 truncate">{{ v.name }}</view>
<view class="second-text-26 flex justify-between my-6rpx">
@@ -75,13 +55,17 @@
</view>
<scroll-view scroll-x>
<view class="flex mt-2">
<view class="w-180rpx flex-col items-center mr-20rpx" v-for="(pV, pI) in v.featuredProducts" :key="pI">
<image class="size-180rpx rounded-12rpx bg-#eeeeee" :src="filePath(pV.coverImage)" mode="aspectFill" />
<view class="w-180rpx flex-col items-center mr-20rpx" v-for="(pV, pI) in v.featuredProducts"
:key="pI">
<image class="size-180rpx rounded-12rpx bg-#eeeeee" :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">
<text class="text-26 color-red!">
<text class="text-22rpx">¥</text>
<text>{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "") : displayPrice(pV.spuPrice, "") }}</text>
<text>{{ pV.priceType == "1" ? displayPrice(pV.minPrice, "") :
displayPrice(pV.spuPrice, "")
}}</text>
</text>
<!-- <text class="second-text-24 line-through">
<template v-if="pV.priceType == '2'">
@@ -148,10 +132,10 @@ const search = () => {
const doPhone = async (item: string) => {
if (isEmpty(item)) return uni.showToast({ title: "该商户没有预留电话", icon: "none" })
if ((await getAppInfo()) == APPENV.ZZD) {
;(window as any).dd
; (window as any).dd
.callPhone({ phoneNum: item.trim() })
.then((res) => {})
.catch((err) => {})
.then((res) => { })
.catch((err) => { })
return
}
if ((await getAppInfo()) == APPENV.SH) {
+127
View File
@@ -0,0 +1,127 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { merchantApi } from "@@/api"
import { hooks, router } from "@@/index"
import { filePath } from "@@/utils/file"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const pageRef = ref<any>(null)
const state = reactive<any>({
pa: {
pagesize: 10,
// 0-其他食堂
// 1-自营食堂
// 2-合作商家
// 3-自营商家
// 4-第三方应用
// 5-共富商城(助农)
type: "5",
name: "",
catgoryId: null,
},
tabs: [{ id: null, name: "全部", disabled: false }],
})
const pageHook = hooks.usePage(pageRef, merchantApi.page, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa)
}
onLoad(async () => {
const app = getApp()
app._initTabbar()
try {
const res: any = await merchantApi.selectCatgory({ current: 1, size: 99999 })
if (res.code == 0) {
state.tabs = state.tabs.concat(res.data)
} else {
state.tabs = [{ id: null, name: "全部", disabled: false }]
}
} catch (error: any) {
uni.showToast({ title: error, icon: "none" })
}
})
onShow(() => {
pageRef.value && pageRef.value.reload(false)
})
const search = () => {
pageRef.value && pageRef.value.reload(true)
}
const doTab = (e: any) => {
const target = state.tabs[e]
state.pa.catgoryId = target.id
pageRef.value.reload(true)
}
const toDetail = async (v: any) => {
const isLogin = await hooks.useCheckLogin()
if (isLogin) {
if (v.supType && v.supType == "10") return router.jump("/pages/merchant/brandDetail", { parentId: v.id })
if (v.supType && v.supType == "20") return router.jump("/pages/merchant/detail", { id: v.id })
uni.showToast({ title: "合作商家类型未知", icon: "none" })
}
}
</script>
<template>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="h-30rpx" />
<view class="flex w-full">
<tm-input class="flex-1" v-model="state.pa.name" type="text" height="72" minHeight="72"
fontSize="28" :showClear="true" :focus="false" placeholder="请输入商家名称"
style="border: 4rpx solid #0779fd; border-radius: 14rpx" :focus-highlight="false"
color="#ECF4F9">
<template v-slot:rightIcon>
<tm-button class="mr-1 px-3 py-26rpx text-30rpx!" size="xs" @click="search">搜 索</tm-button>
</template>
</tm-input>
</view>
<view class="bg-white rounded-16rpx px-20rpx my-20rpx">
<z-tabs :list="state.tabs" @change="doTab" />
</view>
</template>
<view class="flex-row card p-20rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
<image class="w-180rpx h-180rpx rounded-12rpx my-auto" :src="filePath(v.logoPic)" mode="aspectFill" />
<view class="flex-1 flex-col m-l-20rpx">
<view class="sub-text-34">
<text class="mr-2">{{ v.name }}</text>
<!-- <tm-tag v-if="v.supType == '10' && Number(v.mchCount) > 0" size="xs" skin="thin">共{{ v.mchCount }}家</tm-tag> -->
</view>
<view class="m-t-10rpx">
<view class="flex justify-between items-center">
<view class="flex-1">
<view v-if="v.phone" class="flex items-center">
<image class="w-24rpx h-24rpx" src="@/static/page/phone.svg" />
<view class="second-text-28 ml-1">{{ v.phone }}</view>
</view>
</view>
<tm-tag class="max-w-160rpx" size="xs">{{ v.deptName.length > 5 ? v.deptName.substring(0, 5)
+ "..." :
v.deptName }}</tm-tag>
</view>
<view class="second-text-24">
<view v-if="v.jobTime != ',,'" class="second-text-28">营业时间:</view>
<view>{{ v.jobTime?.split(",")[0] ? "早:" + v.jobTime?.split(",")[0] : "" }}</view>
<view>{{ v.jobTime?.split(",")[1] ? "中:" + v.jobTime?.split(",")[1] : "" }}</view>
<view>{{ v.jobTime?.split(",")[2] ? "晚:" + v.jobTime?.split(",")[2] : "" }}</view>
</view>
<view v-if="v.addressDes" class="second-text-28">
<image class="w-24rpx h-24rpx" src="@/static/page/address.svg" />
<text class="ml-1">地址:</text>
<text class="m-l-10rpx">{{ v.addressDes }}</text>
</view>
</view>
</view>
</view>
</z-paging>
</crud-layout>
</template>