feat: 订单详情字段对接

This commit is contained in:
duanshuwen 2025-08-01 17:05:02 +08:00
parent a67659d3db
commit afae470f85
2 changed files with 65 additions and 18 deletions

View File

@ -2,46 +2,93 @@
<view class="goods-info mb12"> <view class="goods-info mb12">
<view class="hotel-header"> <view class="hotel-header">
<image class="hotel-icon" src="./images/icon_house.png"></image> <image class="hotel-icon" src="./images/icon_house.png"></image>
<text class="hotel-name">{{ orderData.commodityName }}</text> <text class="hotel-name">{{ orderData.commodityAddress }}</text>
</view> </view>
<view class="goods-detail"> <view class="goods-detail">
<image class="goods-image" :src="orderData.commodityCoverPhoto"></image> <image
v-if="shouldShowImage"
class="goods-image"
:src="commodityCoverPhoto"
lazy-load
></image>
<view class="goods-description"> <view class="goods-description">
<text class="goods-title">{{ orderData.commodityName }}</text> <text class="goods-title">{{ commodityName }}</text>
<text class="goods-date">预定时间{{ orderData.checkInData }}</text> <text class="goods-date" v-if="checkInData"
>预定时间{{ checkInData }}</text
>
</view> </view>
</view> </view>
<view class="included-services"> <view class="included-services" v-if="hasServices">
<text class="services-title">包含服务</text> <text class="services-title">包含服务</text>
<view class="service-item"> <view
<text class="service-name">· 精致下午茶</text> v-for="item in formattedServiceList"
<text class="service-quantity">1</text> :key="item.key"
</view> class="service-item"
<view class="service-item"> >
<text class="service-name">· 接机或接站</text> <text class="service-name"> · {{ item.displayTitle }} </text>
<text class="service-quantity">1</text> <text class="service-quantity">
{{ item.displayAmount }}
</text>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { defineProps } from "vue"; import { defineProps, computed } from "vue";
defineProps({ const props = defineProps({
orderData: { orderData: {
type: Object, type: Object,
required: true, required: true,
default: () => ({ default: () => ({
id: "", id: "",
createTime: "", commodityServiceList: [],
contactName: "",
contactPhone: "",
orderStatus: "0", // 0- 1- 2-使 3- 4-退 5-退 6- orderStatus: "0", // 0- 1- 2-使 3- 4-退 5-退 6-
orderType: undefined, // 0-, 1-, 2- orderType: undefined, // 0-, 1-, 2-
}), }),
}, },
}); });
//
const commodityName = computed(() => {
return props.orderData.commodityName || "未知商品";
});
//
const commodityCoverPhoto = computed(() => {
return props.orderData.commodityCoverPhoto || "";
});
//
const checkInData = computed(() => props.orderData.checkInData || "");
//
const serviceList = computed(() => props.orderData.commodityServiceList || []);
//
const hasServices = computed(() => serviceList.value.length);
//
const formattedServiceList = computed(() => {
return serviceList.value.map((item, index) => ({
...item,
key: item.id || item.serviceTitle || `service-${index}`,
displayTitle: item.serviceTitle || "未知服务",
displayAmount: formatServiceAmount(item.serviceAmount),
}));
});
//
const shouldShowImage = computed(() => {
return !!commodityCoverPhoto.value;
});
//
const formatServiceAmount = (amount) => {
if (!amount) return "";
return typeof amount === "number" ? `×${amount}` : amount;
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -15,7 +15,7 @@
<!-- 在已退款状态显示 --> <!-- 在已退款状态显示 -->
<view class="order-item"> <view class="order-item">
<text class="label">退款单号</text> <text class="label">退款单号</text>
<text class="value">{{ payWayText }}</text> <text class="value">{{ orderData.refundOrderNo }}</text>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="order-item amount"> <view class="order-item amount">