feat: 订单接口字段对接
This commit is contained in:
59
pages/order/components/OrderCard/constants/order.js
Normal file
59
pages/order/components/OrderCard/constants/order.js
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
// 订单类型
|
||||||
|
export const ORDER_TYPE_MAP = {
|
||||||
|
0: [
|
||||||
|
{
|
||||||
|
label: '订单编号',
|
||||||
|
key: 'orderId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '入住时间',
|
||||||
|
key: 'checkInData'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '游客姓名',
|
||||||
|
key: 'visitorName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系电话',
|
||||||
|
key: 'contactPhone'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
1: [
|
||||||
|
{
|
||||||
|
label: '订单编号',
|
||||||
|
key: 'orderId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '份数',
|
||||||
|
key: 'commodityAmount'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
2: [
|
||||||
|
{
|
||||||
|
label: '订单编号',
|
||||||
|
key: 'orderId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '份数',
|
||||||
|
key: 'commodityAmount'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
// 工单类型
|
||||||
|
export const SERVICE_TYPE_MAP = {
|
||||||
|
0: [
|
||||||
|
{
|
||||||
|
label: '创建时间',
|
||||||
|
key: 'createTime'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系房客',
|
||||||
|
key: 'userName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系电话',
|
||||||
|
key: 'userPhone'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
BIN
pages/order/components/OrderCard/images/arrow.png
Normal file
BIN
pages/order/components/OrderCard/images/arrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 549 B |
BIN
pages/order/components/OrderCard/images/hotel.png
Normal file
BIN
pages/order/components/OrderCard/images/hotel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 816 B |
BIN
pages/order/components/OrderCard/images/ticket.png
Normal file
BIN
pages/order/components/OrderCard/images/ticket.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 713 B |
@@ -3,8 +3,9 @@
|
|||||||
<!-- 卡片头部 -->
|
<!-- 卡片头部 -->
|
||||||
<view class="card-header">
|
<view class="card-header">
|
||||||
<view class="status-info">
|
<view class="status-info">
|
||||||
<image class="status-icon" src="./images/service.png"></image>
|
<image class="status-icon" :src="ICON_MAP[orderData.orderType]"></image>
|
||||||
<view class="order-title">{{ orderData.visitorName }}</view>
|
<view class="order-title">{{ orderData.commodityName }}</view>
|
||||||
|
<image class="arrow-icon" src="./images/arrow.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="orderData.status !== 'pending'"
|
v-if="orderData.status !== 'pending'"
|
||||||
@@ -41,8 +42,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import Divider from "@/components/Divider/index.vue";
|
|
||||||
import { defineProps } from "vue";
|
import { defineProps } from "vue";
|
||||||
|
import Divider from "@/components/Divider/index.vue";
|
||||||
|
import serviceIcon from "./images/service.png";
|
||||||
|
import ticketIcon from "./images/ticket.png";
|
||||||
|
import hotelIcon from "./images/hotel.png";
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -63,6 +67,13 @@ const props = defineProps({
|
|||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(["click", "call", "complete"]);
|
const emit = defineEmits(["click", "call", "complete"]);
|
||||||
|
|
||||||
|
// 图标映射
|
||||||
|
const ICON_MAP = {
|
||||||
|
0: serviceIcon,
|
||||||
|
1: ticketIcon,
|
||||||
|
2: hotelIcon,
|
||||||
|
};
|
||||||
|
|
||||||
// 获取状态文本
|
// 获取状态文本
|
||||||
const getStatusText = (status) => {
|
const getStatusText = (status) => {
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
|
|||||||
@@ -40,7 +40,11 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
flex: 1;
|
}
|
||||||
|
|
||||||
|
.arrow-icon {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-tag {
|
.status-tag {
|
||||||
@@ -50,35 +54,39 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
|
&.tag-0 {
|
||||||
|
color: #00A6FF;
|
||||||
|
border: 1px solid #00A6FF;
|
||||||
|
}
|
||||||
|
|
||||||
&.tag-1 {
|
&.tag-1 {
|
||||||
color: #f00044;
|
color: #f00044;
|
||||||
border: 1px solid #f00044;
|
border: 1px solid #f00044;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.tag-2 {
|
&.tag-2 {
|
||||||
color: #ff8c00;
|
color: #40AE36;
|
||||||
border: 1px solid #ffd591;
|
border: 1px solid #40AE36;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.tag-3 {
|
&.tag-3 {
|
||||||
color: #818181;
|
color: #808389;
|
||||||
border: 1px solid #818181;
|
border: 1px solid #808389;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.tag-4 {
|
&.tag-4 {
|
||||||
color: #00a6ff;
|
color: #0256FF;
|
||||||
border: 1px solid #00a6ff;
|
border: 1px solid #0256FF;
|
||||||
}
|
|
||||||
|
|
||||||
&.tag-6 {
|
|
||||||
color: #52c41a;
|
|
||||||
border: 1px solid #b7eb8f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.tag-5 {
|
&.tag-5 {
|
||||||
background-color: #f5f5f5;
|
color: #808389;
|
||||||
color: #999999;
|
border: 1px solid #808389;
|
||||||
border: 1px solid #d9d9d9;
|
}
|
||||||
|
|
||||||
|
&.tag-6 {
|
||||||
|
color: #FD8702;
|
||||||
|
border: 1px solid #FD8702;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from "vue";
|
import { ref } from "vue";
|
||||||
import TopNavBar from "./components/TopNavBar/index.vue";
|
import TopNavBar from "./components/TopNavBar/index.vue";
|
||||||
import Tabs from "./components/Tabs/index.vue";
|
import Tabs from "./components/Tabs/index.vue";
|
||||||
import OrderCard from "./components/OrderCard/index.vue";
|
import OrderCard from "./components/OrderCard/index.vue";
|
||||||
|
|||||||
Reference in New Issue
Block a user