| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- import _easycom_u_icon from '@/components/u-icon/u-icon.vue';
- import { ref } from 'vue';
- // --- 数据 ---
- type OrderTag = {
- __$originalPosition?: UTSSourceMapPosition<"OrderTag", "pages/index/order.uvue", 120, 7>;
- text: string;
- type: 'orange' | 'green' | 'red';
- };
- type OrderItem = {
- __$originalPosition?: UTSSourceMapPosition<"OrderItem", "pages/index/order.uvue", 125, 7>;
- id: number;
- time: string;
- serviceName: string;
- tags: OrderTag[];
- contact: string;
- price: string;
- address: string;
- distance: string;
- income: string;
- image: string;
- };
- // orders data – no need for reactivity, use a plain typed array
- const __sfc__ = defineComponent({
- __name: 'order',
- setup(__props) {
- const __ins = getCurrentInstance()!;
- const _ctx = __ins.proxy as InstanceType<typeof __sfc__>;
- const _cache = __ins.renderCache;
- const tabs = ['新订单',
- '进行中',
- '取消/售后',
- '已完成',
- '全部'];
- const currentTab = ref(0);
- const orders: OrderItem[] = [
- {
- id: 1,
- time: '2025-06-18 4:00',
- serviceName: '润养SPA',
- tags: [
- { text: '上门', type: 'orange' } as OrderTag,
- { text: '首单', type: 'orange' } as OrderTag,
- ],
- contact: '刘',
- price: '286.6',
- address: '烟台 芝罘区楚风一街楚凤花园(烟台吾悦)广场附近',
- distance: '2.24',
- income: '186.6',
- image: '/static/testInfo/demo.png'
- } as OrderItem,
- {
- id: 2,
- time: '2025-06-18 8:00',
- serviceName: '润养SPA',
- tags: [
- { text: '加钟', type: 'red' } as OrderTag
- ],
- contact: '刘',
- price: '286.6',
- address: '烟台 芝罘区楚风一街楚凤花园(烟台吾悦)广场附近',
- distance: '2.24',
- income: '186.6',
- image: '/static/testInfo/demo.png'
- } as OrderItem
- ] as OrderItem[];
- // --- 方法 ---
- const onNavigate = (addr: string) => {
- uni.showToast({ title: '启动导航', icon: 'none' });
- };
- // helper used in template to give v-for a typed array source
- function tagList(order: OrderItem): OrderTag[] {
- return order.tags;
- }
- const onTransfer = (id: number) => {
- uni.showModal({
- title: '转单确认',
- content: '确定将此订单转给其他技师吗?',
- success: (res) => {
- if (res.confirm)
- uni.showToast({ title: '转单成功', icon: 'success' });
- }
- });
- };
- const onConfirm = (id: number) => {
- uni.showLoading({ title: '处理中...' });
- setTimeout(() => {
- uni.hideLoading();
- uni.showToast({ title: '接单成功', icon: 'success' });
- }, 600);
- };
- return (): any | null => {
- const _component_u_icon = resolveEasyComponent("u-icon", _easycom_u_icon);
- return _cE("view", _uM({ class: "page-container" }), [
- _cE("scroll-view", _uM({
- "scroll-x": "",
- class: "tab-scroll",
- "show-scrollbar": "false",
- "enable-flex": true
- }), [
- _cE("view", _uM({ class: "tab-wrapper" }), [
- _cE(Fragment, null, RenderHelpers.renderList(tabs, (tab, index, __index, _cached): any => {
- return _cE("view", _uM({
- key: index,
- class: _nC(['tab-item', currentTab.value === index ? 'active' : '']),
- onClick: () => { currentTab.value = index; }
- }), [
- _cE("text", null, _tD(tab), 1 /* TEXT */),
- currentTab.value === index
- ? _cE("view", _uM({
- key: 0,
- class: "tab-indicator"
- }))
- : _cC("v-if", true)
- ], 10 /* CLASS, PROPS */, ["onClick"]);
- }), 64 /* STABLE_FRAGMENT */)
- ])
- ]),
- _cE("view", _uM({ class: "order-list" }), [
- _cE(Fragment, null, RenderHelpers.renderList(orders, (order, idx, __index, _cached): any => {
- return _cE("view", _uM({
- key: order['id'],
- class: "order-card"
- }), [
- _cE("view", _uM({ class: "card-header" }), [
- _cE("text", _uM({ class: "time-text" }), " 预约时间:" + _tD(order['time']), 1 /* TEXT */),
- _cE("text", _uM({ class: "status-badge paid" }), " 已支付 ")
- ]),
- _cE("view", _uM({ class: "service-section" }), [
- _cE("image", _uM({
- src: order['image'],
- class: "service-image",
- mode: "aspectFill"
- }), null, 8 /* PROPS */, ["src"]),
- _cE("view", _uM({ class: "service-details" }), [
- _cE("view", _uM({ class: "service-title-row" }), [
- _cE("text", _uM({ class: "service-name" }), _tD(order['serviceName']), 1 /* TEXT */),
- _cE(Fragment, null, RenderHelpers.renderList(tagList(order), (tag, tIdx, __index, _cached): any => {
- return _cE("text", _uM({
- key: tIdx,
- class: _nC(['tag-pill', tag.type])
- }), _tD(tag.text), 3 /* TEXT, CLASS */);
- }), 128 /* KEYED_FRAGMENT */)
- ]),
- _cE("view", _uM({ class: "contact-info-row" }), [
- _cE("text", _uM({ class: "contact-info" }), " 联系人:" + _tD(order['contact']), 1 /* TEXT */),
- _cE("text", _uM({ class: "tag-pill green" }), " 新客 ")
- ])
- ]),
- _cE("text", _uM({ class: "service-price" }), " ¥" + _tD(order.price), 1 /* TEXT */)
- ]),
- _cE("view", _uM({ class: "address-section" }), [
- _cV(_component_u_icon, _uM({
- type: "location",
- size: "16",
- color: "#999999"
- })),
- _cE("text", _uM({ class: "address-content" }), _tD(order.address), 1 /* TEXT */),
- _cE("text", _uM({ class: "distance-text" }), _tD(order.distance) + "km ", 1 /* TEXT */)
- ]),
- _cE("view", _uM({ class: "income-section" }), [
- _cE("text", _uM({ class: "income-label" }), " 预估收入 "),
- _cE("view", _uM({ class: "income-value-group" }), [
- _cE("text", _uM({ class: "income-main" }), " ¥" + _tD(order.income), 1 /* TEXT */),
- _cE("text", _uM({ class: "income-sub" }), " (含路费) ")
- ])
- ]),
- _cE("view", _uM({ class: "action-section" }), [
- _cE("view", _uM({
- class: "btn btn-nav",
- onClick: () => { onNavigate(order.address); }
- }), [
- _cV(_component_u_icon, _uM({
- type: "navigation",
- size: "14",
- color: "#333333"
- })),
- _cE("text", null, " 地址导航 ")
- ], 8 /* PROPS */, ["onClick"]),
- _cE("text", _uM({
- class: "btn btn-transfer",
- onClick: () => { onTransfer(order.id); }
- }), " 我要转单 ", 8 /* PROPS */, ["onClick"]),
- _cE("text", _uM({
- class: "btn btn-confirm",
- onClick: () => { onConfirm(order.id); }
- }), " 确认接单 ", 8 /* PROPS */, ["onClick"])
- ])
- ]);
- }), 64 /* STABLE_FRAGMENT */)
- ])
- ]);
- };
- }
- });
- export default __sfc__;
- const GenPagesIndexOrderStyles = [_uM([["page-container", _pS(_uM([["backgroundColor", "#f5f6f8"], ["minHeight", "1000rpx"], ["boxSizing", "border-box"]]))], ["tab-scroll", _pS(_uM([["backgroundColor", "#ffffff"], ["height", "88rpx"]]))], ["tab-wrapper", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"], ["height", "88rpx"], ["paddingTop", 0], ["paddingRight", "20rpx"], ["paddingBottom", 0], ["paddingLeft", "20rpx"], ["whiteSpace", "nowrap"]]))], ["tab-item", _uM([["", _uM([["position", "relative"], ["paddingTop", 0], ["paddingRight", "30rpx"], ["paddingBottom", 0], ["paddingLeft", "30rpx"], ["height", "88rpx"], ["display", "flex"], ["alignItems", "center"], ["justifyContent", "center"], ["fontSize", "30rpx"], ["color", "#666666"]])], [".active", _uM([["color", "#333333"], ["fontWeight", "bold"]])]])], ["tab-indicator", _pS(_uM([["position", "absolute"], ["bottom", "16rpx"], ["left", 0], ["right", 0], ["marginTop", 0], ["marginRight", "auto"], ["marginBottom", 0], ["marginLeft", "auto"], ["width", "40rpx"], ["height", "6rpx"], ["backgroundColor", "#ffc107"], ["borderTopLeftRadius", "3rpx"], ["borderTopRightRadius", "3rpx"], ["borderBottomRightRadius", "3rpx"], ["borderBottomLeftRadius", "3rpx"]]))], ["order-list", _pS(_uM([["paddingTop", "20rpx"], ["paddingRight", "20rpx"], ["paddingBottom", "20rpx"], ["paddingLeft", "20rpx"], ["display", "flex"], ["flexDirection", "column"]]))], ["order-card", _pS(_uM([["backgroundColor", "#ffffff"], ["borderTopLeftRadius", "16rpx"], ["borderTopRightRadius", "16rpx"], ["borderBottomRightRadius", "16rpx"], ["borderBottomLeftRadius", "16rpx"], ["paddingTop", "30rpx"], ["paddingRight", "30rpx"], ["paddingBottom", "30rpx"], ["paddingLeft", "30rpx"], ["display", "flex"], ["flexDirection", "column"]]))], ["card-header", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"], ["alignItems", "center"]]))], ["time-text", _pS(_uM([["fontSize", "28rpx"], ["color", "#333333"], ["fontWeight", "400"]]))], ["status-badge", _uM([["", _uM([["fontSize", "24rpx"], ["paddingTop", "6rpx"], ["paddingRight", "16rpx"], ["paddingBottom", "6rpx"], ["paddingLeft", "16rpx"], ["borderTopLeftRadius", "20rpx"], ["borderTopRightRadius", "20rpx"], ["borderBottomRightRadius", "20rpx"], ["borderBottomLeftRadius", "20rpx"]])], [".paid", _uM([["backgroundColor", "#fff7e6"], ["color", "#ff9900"]])]])], ["service-section", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "flex-start"]]))], ["service-image", _pS(_uM([["width", "110rpx"], ["height", "110rpx"], ["borderTopLeftRadius", "12rpx"], ["borderTopRightRadius", "12rpx"], ["borderBottomRightRadius", "12rpx"], ["borderBottomLeftRadius", "12rpx"], ["backgroundColor", "#f0f0f0"], ["flexShrink", 0]]))], ["service-details", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"], ["display", "flex"], ["justifyContent", "space-between"]]))], ["service-title-row", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"]]))], ["service-name", _pS(_uM([["fontSize", "32rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["service-price", _pS(_uM([["fontSize", "34rpx"], ["fontWeight", "bold"], ["color", "#333333"]]))], ["tags-container", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["flexWrap", "wrap"]]))], ["tag-pill", _uM([["", _uM([["fontSize", "22rpx"], ["paddingTop", "4rpx"], ["paddingRight", "12rpx"], ["paddingBottom", "4rpx"], ["paddingLeft", "12rpx"], ["borderTopLeftRadius", "20rpx"], ["borderTopRightRadius", "20rpx"], ["borderBottomRightRadius", "20rpx"], ["borderBottomLeftRadius", "20rpx"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"], ["lineHeight", 1.2]])], [".orange", _uM([["color", "#ff9900"], ["borderTopColor", "#ff9900"], ["borderRightColor", "#ff9900"], ["borderBottomColor", "#ff9900"], ["borderLeftColor", "#ff9900"], ["backgroundColor", "#fffaf0"]])], [".green", _uM([["color", "#52c41a"], ["borderTopColor", "#52c41a"], ["borderRightColor", "#52c41a"], ["borderBottomColor", "#52c41a"], ["borderLeftColor", "#52c41a"], ["backgroundColor", "#f6ffed"]])], [".red", _uM([["color", "#ff4d4f"], ["borderTopColor", "#ff4d4f"], ["borderRightColor", "#ff4d4f"], ["borderBottomColor", "#ff4d4f"], ["borderLeftColor", "#ff4d4f"], ["backgroundColor", "#fff1f0"]])]])], ["contact-info-row", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"]]))], ["contact-info", _pS(_uM([["fontSize", "26rpx"], ["color", "#999999"]]))], ["address-section", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "flex-start"], ["paddingBottom", "20rpx"], ["borderBottomWidth", "1rpx"], ["borderBottomColor", "#f5f5f5"], ["borderBottomStyle", "solid"]]))], ["address-content", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"], ["fontSize", "26rpx"], ["color", "#666666"], ["lineHeight", 1.4]]))], ["distance-text", _pS(_uM([["fontSize", "24rpx"], ["color", "#999999"], ["whiteSpace", "nowrap"], ["marginLeft", "10rpx"]]))], ["income-section", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"], ["alignItems", "center"]]))], ["income-label", _pS(_uM([["fontSize", "28rpx"], ["color", "#666666"]]))], ["income-value-group", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["alignItems", "center"]]))], ["income-main", _pS(_uM([["fontSize", "36rpx"], ["fontWeight", "bold"], ["color", "#ff4d4f"]]))], ["income-sub", _pS(_uM([["fontSize", "24rpx"], ["color", "#999999"]]))], ["action-section", _pS(_uM([["display", "flex"], ["flexDirection", "row"], ["justifyContent", "space-between"]]))], ["btn", _pS(_uM([["flexGrow", 1], ["flexShrink", 1], ["flexBasis", "0%"], ["height", "72rpx"], ["borderTopLeftRadius", "36rpx"], ["borderTopRightRadius", "36rpx"], ["borderBottomRightRadius", "36rpx"], ["borderBottomLeftRadius", "36rpx"], ["fontSize", "28rpx"], ["fontWeight", "400"], ["display", "flex"], ["flexDirection", "row"], ["justifyContent", "center"], ["alignItems", "center"]]))], ["btn-nav", _pS(_uM([["backgroundColor", "#f5f5f5"], ["color", "#333333"]]))], ["btn-transfer", _pS(_uM([["backgroundColor", "#ffffff"], ["color", "#ff9900"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopColor", "#ff9900"], ["borderRightColor", "#ff9900"], ["borderBottomColor", "#ff9900"], ["borderLeftColor", "#ff9900"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"]]))], ["btn-confirm", _pS(_uM([["backgroundColor", "#ffc107"], ["color", "#333333"], ["borderTopWidth", "1rpx"], ["borderRightWidth", "1rpx"], ["borderBottomWidth", "1rpx"], ["borderLeftWidth", "1rpx"], ["borderTopColor", "#ffc107"], ["borderRightColor", "#ffc107"], ["borderBottomColor", "#ffc107"], ["borderLeftColor", "#ffc107"], ["borderTopStyle", "solid"], ["borderRightStyle", "solid"], ["borderBottomStyle", "solid"], ["borderLeftStyle", "solid"]]))]])];
- //# sourceMappingURL=order.uvue.map
|