This commit is contained in:
2026-06-18 00:14:47 +08:00
parent f87f1cda0d
commit 2da4f39d73
23 changed files with 568 additions and 189 deletions
@@ -1,16 +1,15 @@
<script lang="ts" setup>
import {useConfigStore} from "@/store";
import {formatOrderAmount, getPlatformServiceFee} from "@/utils/merchantOrder";
const {t} = useI18n();
const configStore = useConfigStore();
// 用户会员状态是否已开通
const show = ref(false);
const priceData = ref({})
const priceData = ref<Record<string, any>>({})
function onOpen(data: any, num: number) {
function onOpen(data: Record<string, any>) {
priceData.value = data
show.value = true;
}
@@ -19,6 +18,8 @@ function handleClose() {
show.value = false;
}
const platformFee = computed(() => getPlatformServiceFee(priceData.value))
defineExpose({
onOpen,
});
@@ -32,24 +33,31 @@ defineExpose({
>
<view>
<view class="center h-102rpx bg-#F7F7F7 text-40rpx lh-40rpx font-bold text-#333">
{{ t('pages-user.order.checkout.priceDetail.title') }}?
{{ t('pages-user.order.checkout.priceDetail.title') }}
</view>
<view class="border-bottom text-32rpx lh-32rpx font-500 text-#333 py-36rpx px-30rpx">
<view class="flex-center-sb mb-20rpx">
<view>{{ t('pages-user.order.checkout.priceDetail.serviceFees') }}</view>
<view>${{
(Number(priceData?.tip) + Number(priceData?.deliveryFee)).toFixed(2)
}}
</view>
<view>{{ t('pages-user.order.checkout.priceDetail.taxation') }}</view>
<view>${{ formatOrderAmount(priceData?.tax) }}</view>
</view>
<view v-if="priceData?.deliveryFeeCharged !== false && Number(priceData?.deliveryFee) > 0"
class="flex-center-sb mb-20rpx">
<view>{{ t('pages-user.order.checkout.priceDetail.deliveryFee') }}</view>
<view>${{ formatOrderAmount(priceData?.deliveryFee) }}</view>
</view>
<view v-if="priceData?.tipCharged !== false && Number(priceData?.tip) > 0"
class="flex-center-sb mb-20rpx">
<view>{{ t('pages-user.order.checkout.priceDetail.tip') }}</view>
<view>${{ formatOrderAmount(priceData?.tip) }}</view>
</view>
<view v-if="Number(platformFee) > 0" class="flex-center-sb mb-20rpx text-26rpx text-#999">
<view>{{ t('pages-user.order.platformServiceFee') }}</view>
<view>${{ platformFee }}</view>
</view>
<view class="text-24rpx lh-28rpx text-#9E9E9E">
{{ t('pages-user.order.checkout.priceDetail.desc') }}
{{ t('pages-user.order.checkout.priceDetail.platformFeeNote') }}
</view>
</view>
<view class="flex-center-sb border-bottom h-104rpx text-32rpx lh-32rpx font-500 text-#333 px-30rpx">
<view>{{ t('pages-user.order.checkout.priceDetail.taxation') }}</view>
<view>${{ Number(priceData?.tax) }}</view>
</view>
<view class="px-30rpx pt-40rpx">
<wd-button
block
@@ -66,4 +74,4 @@ defineExpose({
<style lang="scss" scoped>
</style>
</style>
@@ -0,0 +1,90 @@
<script lang="ts" setup>
import {appMerchantOrderRejectOrderPost} from '@/service'
import {useConfigStore} from '@/store'
const {t} = useI18n()
const emit = defineEmits(['close'])
const configStore = useConfigStore()
const show = ref(false)
const formData = reactive({
reason: '',
orderId: '',
})
function onOpen(orderId: string) {
formData.orderId = orderId
formData.reason = ''
show.value = true
}
function handleClose() {
show.value = false
}
function handleSubmit() {
if (!formData.reason.trim()) {
uni.showToast({
title: t('pages-user.order.toast.rejectOrderReasonRequired'),
icon: 'none',
})
return
}
appMerchantOrderRejectOrderPost({
body: {
orderId: formData.orderId,
reason: formData.reason.trim(),
},
}).then(() => {
uni.showToast({
title: t('toast.rejectSuccess'),
icon: 'none',
})
emit('close')
handleClose()
})
}
defineExpose({
onOpen,
})
</script>
<template>
<wd-popup v-model="show" custom-style="border-radius:32rpx 32rpx 0 0;" position="bottom" @close="handleClose">
<view class="px-30rpx pt-40rpx relative">
<view class="text-34rpx text-#333 font-bold text-center mb-37rpx">
{{ t('pages-user.order.rejectOrderReason') }}
</view>
<image
class="w-28rpx h-28rpx absolute top-40rpx right-30rpx"
src="@img/chef/100404.png"
@click="handleClose"
/>
<view class="min-h-234rpx box-border bg-#F7F7F7 rounded-14rpx overflow-hidden px-18rpx py-10rpx mb-36rpx">
<wd-textarea
v-model="formData.reason"
:maxlength="100"
:placeholder="t('pages-user.order.toast.rejectOrderReasonRequired')"
auto-height
custom-class="!bg-#F7F7F7"
custom-textarea-container-class="!bg-#F7F7F7"
no-border
/>
</view>
<wd-button
block
custom-class="!h-98rpx !text-30rpx !font-bold !rounded-16rpx !bg-#14181B"
@click="handleSubmit"
>
{{ t('common.submit') }}
</wd-button>
<view :style="[configStore.iosSafeBottomPlaceholder]"/>
</view>
</wd-popup>
</template>