修改商家订单流水显示

This commit is contained in:
weiwei committed 2025-04-09 12:35:38 +08:00
1 parent 1bbb74969b
commit 4ba2ed6e54
4 files changed
+24 -52

No files matched your search

+18 -23
View File
@@ -2,10 +2,8 @@
import { reactive, nextTick } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { hooks, router } from "@@/index"
import { merchantApi, foodApi, payApi } from "@@/api"
import { filePath } from "@@/utils/file"
import ProductRow from "./components/product-row.vue"
@@ -14,12 +12,13 @@ import ProductTotal from "./components/product-total.vue"
const state = reactive<any>({
detailId: null,
canteenDetail: {},
totPrice: 0,
totCount: 0,
currentClassifyIndex: 0,
showCarDialog: false,
detail: {},
carList: [],
classifyList: [],
shopList: [],
@@ -36,20 +35,16 @@ onShow(() => {
getClassify()
})
// 获取食堂详情信息
const getDetail = async () => {
uni.showLoading({
title: "加载中...",
mask: true,
})
const _pa = { id: state.detailId }
const { data } = await merchantApi.detail(_pa)
state.detail = data
uni.showLoading({ title: "加载中...", mask: true })
const { code, data } = await merchantApi.detail({ id: state.detailId })
if (code == 0) state.canteenDetail = data
uni.hideLoading()
}
const getShopCar = async () => {
const _pa = { merchantId: state.detailId, hardType: "CANTEEN" }
const { data } = await foodApi.getShopCar(_pa)
const { data } = await foodApi.getShopCar({ merchantId: state.detailId, hardType: "CANTEEN" })
state.carList = data ?? []
if (isEmpty(state.carList)) {
state.shopList.forEach((v: any) => {
@@ -201,11 +196,11 @@ const getHeight = () => {
}
const doPhone = () => {
if (isEmpty(state.detail.phone)) {
if (isEmpty(state.canteenDetail.phone)) {
uni.showToast({ title: "该商户没有预留电话", icon: "none" })
return
}
hooks.useMakePhoneCall(state.detail.phone)
hooks.useMakePhoneCall(state.canteenDetail.phone)
}
const doFood = () => {
router.jump("/pages/merchant/food", { merchantId: state.detailId })
@@ -223,7 +218,7 @@ const doFood = () => {
indicator-color="#ffffff"
:autoplay="true"
>
<swiper-item v-for="(v, i) in state.detail?.swiperPic?.split(',')" :key="i">
<swiper-item v-for="(v, i) in state.canteenDetail?.swiperPic?.split(',')" :key="i">
<image class="w-full h-full" :src="filePath(v)" mode="aspectFill" />
</swiper-item>
</swiper>
@@ -233,31 +228,31 @@ const doFood = () => {
<!-- start 简介 start -->
<view class="h-15rpx" />
<view flex-row card p-20rpx>
<image class="w-180rpx h-180rpx rounded-12rpx" :src="filePath(state.detail.logoPic)" mode="aspectFill" />
<image class="w-180rpx h-180rpx rounded-12rpx" :src="filePath(state.canteenDetail.logoPic)" mode="aspectFill" />
<view class="flex-1 flex-col m-l-20rpx">
<view class="flex-row items-center justify-between">
<view class="flex-row-center sub-text-34">
<text>{{ state.detail.name }}</text>
<text>{{ state.canteenDetail.name }}</text>
</view>
<view>
<tm-tag size="s">{{ state.detail.deptName }}</tm-tag>
<tm-tag size="s">{{ state.canteenDetail.deptName }}</tm-tag>
</view>
</view>
<view class="second-text-24">
<view class="second-text-28">营业时间:</view>
<view>
{{ state.detail.jobTime?.split(",")[0] ? "早:" + state.detail.jobTime?.split(",")[0] : "" }}
{{ state.canteenDetail.jobTime?.split(",")[0] ? "早:" + state.canteenDetail.jobTime?.split(",")[0] : "" }}
</view>
<view>
{{ state.detail.jobTime?.split(",")[1] ? "中:" + state.detail.jobTime?.split(",")[1] : "" }}
{{ state.canteenDetail.jobTime?.split(",")[1] ? "中:" + state.canteenDetail.jobTime?.split(",")[1] : "" }}
</view>
<view>
{{ state.detail.jobTime?.split(",")[2] ? "晚:" + state.detail.jobTime?.split(",")[2] : "" }}
{{ state.canteenDetail.jobTime?.split(",")[2] ? "晚:" + state.canteenDetail.jobTime?.split(",")[2] : "" }}
</view>
</view>
<view v-if="state.detail.addressDes" class="m-t-10rpx second-text-28">
<view v-if="state.canteenDetail.addressDes" class="m-t-10rpx second-text-28">
<text>食堂地址:</text>
<text class="m-l-10rpx">{{ state.detail.addressDes }}</text>
<text class="m-l-10rpx">{{ state.canteenDetail.addressDes }}</text>
</view>
</view>
</view>
-23
View File
@@ -1,23 +0,0 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { hooks } from "@@/index"
import { foodApi } from "@@/api"
const data = {}
const state = reactive<any>({
pa: {
status: 1,
},
})
onLoad(() => {})
onShow(() => {})
</script>
<template>
<crud-layout title="订单详情" bg="/static/page/blue-bg.png"> </crud-layout>
</template>
<style lang="scss" scoped></style>
+5 -5
View File
@@ -3,7 +3,7 @@
<z-paging
ref="pageRef"
:fixed="false"
v-model="list"
v-model="pageHook.list"
:default-page-size="10"
safe-area-inset-bottom
:loading-more-enabled="true"
@@ -11,7 +11,7 @@
@query="query"
:auto-clean-list-when-reload="false"
:auto-scroll-to-top-when-reload="false"
@scroll="scroll"
@scroll="pageHook.scroll"
>
<template #top>
<view class="h-30rpx" />
@@ -50,7 +50,7 @@
<view class="h-20rpx" />
<view class="bg-white rounded-16rpx p-2 mb-1 shadow-md" v-for="(v, i) in list" :key="i">
<view class="bg-white rounded-16rpx p-2 mb-1 shadow-md" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex justify-between items-center text-sm text-gray-800 mb-1">
<view class="flex items-center">
<image class="w-50rpx h-50rpx rounded-8rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
@@ -111,7 +111,7 @@ const state = reactive<any>({
date: "",
})
const formatVal = computed(() => (state.date.length === 2 ? state.formatVal : ""))
const { list, startPage, scroll } = hooks.usePage(pageRef, flowStatisticsApi.page, null, "data")
const pageHook = hooks.usePage(pageRef, flowStatisticsApi.page, null, "data")
onLoad(() => {
const app = getApp()
@@ -128,7 +128,7 @@ onShow(() => {
const query = (page: number, pagesize: number) => {
const isLogin = hooks.useStaticCheckLogin()
if (!isLogin) return
startPage(page, pagesize, false, state.pa)
pageHook.startPage(page, pagesize, false, state.pa)
}
// 时间范围选择器确认
+1 -1
View File
@@ -19,7 +19,7 @@ export default {
showLoading: false,
},
}),
detail: (params: any) =>
detail: (params: any): Promise<any> =>
request({
url: "/wallet/mch-manage/app/detail",
method: "GET",