order.uvue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. import _easycom_u_icon from '@/components/u-icon/u-icon.vue';
  2. import { ref } from 'vue';
  3. // --- 数据 ---
  4. type OrderTag = {
  5. __$originalPosition?: UTSSourceMapPosition<"OrderTag", "pages/index/order.uvue", 120, 7>;
  6. text: string;
  7. type: 'orange' | 'green' | 'red';
  8. };
  9. type OrderItem = {
  10. __$originalPosition?: UTSSourceMapPosition<"OrderItem", "pages/index/order.uvue", 125, 7>;
  11. id: number;
  12. time: string;
  13. serviceName: string;
  14. tags: OrderTag[];
  15. contact: string;
  16. price: string;
  17. address: string;
  18. distance: string;
  19. income: string;
  20. image: string;
  21. };
  22. // orders data – no need for reactivity, use a plain typed array
  23. const __sfc__ = defineComponent({
  24. __name: 'order',
  25. setup(__props) {
  26. const __ins = getCurrentInstance()!;
  27. const _ctx = __ins.proxy as InstanceType<typeof __sfc__>;
  28. const _cache = __ins.renderCache;
  29. const tabs = ['新订单',
  30. '进行中',
  31. '取消/售后',
  32. '已完成',
  33. '全部'];
  34. const currentTab = ref(0);
  35. const orders: OrderItem[] = [
  36. {
  37. id: 1,
  38. time: '2025-06-18 4:00',
  39. serviceName: '润养SPA',
  40. tags: [
  41. { text: '上门', type: 'orange' } as OrderTag,
  42. { text: '首单', type: 'orange' } as OrderTag,
  43. ],
  44. contact: '刘',
  45. price: '286.6',
  46. address: '烟台 芝罘区楚风一街楚凤花园(烟台吾悦)广场附近',
  47. distance: '2.24',
  48. income: '186.6',
  49. image: '/static/testInfo/demo.png'
  50. } as OrderItem,
  51. {
  52. id: 2,
  53. time: '2025-06-18 8:00',
  54. serviceName: '润养SPA',
  55. tags: [
  56. { text: '加钟', type: 'red' } as OrderTag
  57. ],
  58. contact: '刘',
  59. price: '286.6',
  60. address: '烟台 芝罘区楚风一街楚凤花园(烟台吾悦)广场附近',
  61. distance: '2.24',
  62. income: '186.6',
  63. image: '/static/testInfo/demo.png'
  64. } as OrderItem
  65. ] as OrderItem[];
  66. // --- 方法 ---
  67. const onNavigate = (addr: string) => {
  68. uni.showToast({ title: '启动导航', icon: 'none' });
  69. };
  70. // helper used in template to give v-for a typed array source
  71. function tagList(order: OrderItem): OrderTag[] {
  72. return order.tags;
  73. }
  74. const onTransfer = (id: number) => {
  75. uni.showModal({
  76. title: '转单确认',
  77. content: '确定将此订单转给其他技师吗?',
  78. success: (res) => {
  79. if (res.confirm)
  80. uni.showToast({ title: '转单成功', icon: 'success' });
  81. }
  82. });
  83. };
  84. const onConfirm = (id: number) => {
  85. uni.showLoading({ title: '处理中...' });
  86. setTimeout(() => {
  87. uni.hideLoading();
  88. uni.showToast({ title: '接单成功', icon: 'success' });
  89. }, 600);
  90. };
  91. return (): any | null => {
  92. const _component_u_icon = resolveEasyComponent("u-icon", _easycom_u_icon);
  93. return _cE("view", _uM({ class: "page-container" }), [
  94. _cE("scroll-view", _uM({
  95. "scroll-x": "",
  96. class: "tab-scroll",
  97. "show-scrollbar": "false",
  98. "enable-flex": true
  99. }), [
  100. _cE("view", _uM({ class: "tab-wrapper" }), [
  101. _cE(Fragment, null, RenderHelpers.renderList(tabs, (tab, index, __index, _cached): any => {
  102. return _cE("view", _uM({
  103. key: index,
  104. class: _nC(['tab-item', currentTab.value === index ? 'active' : '']),
  105. onClick: () => { currentTab.value = index; }
  106. }), [
  107. _cE("text", null, _tD(tab), 1 /* TEXT */),
  108. currentTab.value === index
  109. ? _cE("view", _uM({
  110. key: 0,
  111. class: "tab-indicator"
  112. }))
  113. : _cC("v-if", true)
  114. ], 10 /* CLASS, PROPS */, ["onClick"]);
  115. }), 64 /* STABLE_FRAGMENT */)
  116. ])
  117. ]),
  118. _cE("view", _uM({ class: "order-list" }), [
  119. _cE(Fragment, null, RenderHelpers.renderList(orders, (order, idx, __index, _cached): any => {
  120. return _cE("view", _uM({
  121. key: order['id'],
  122. class: "order-card"
  123. }), [
  124. _cE("view", _uM({ class: "card-header" }), [
  125. _cE("text", _uM({ class: "time-text" }), " 预约时间:" + _tD(order['time']), 1 /* TEXT */),
  126. _cE("text", _uM({ class: "status-badge paid" }), " 已支付 ")
  127. ]),
  128. _cE("view", _uM({ class: "service-section" }), [
  129. _cE("image", _uM({
  130. src: order['image'],
  131. class: "service-image",
  132. mode: "aspectFill"
  133. }), null, 8 /* PROPS */, ["src"]),
  134. _cE("view", _uM({ class: "service-details" }), [
  135. _cE("view", _uM({ class: "service-title-row" }), [
  136. _cE("text", _uM({ class: "service-name" }), _tD(order['serviceName']), 1 /* TEXT */),
  137. _cE(Fragment, null, RenderHelpers.renderList(tagList(order), (tag, tIdx, __index, _cached): any => {
  138. return _cE("text", _uM({
  139. key: tIdx,
  140. class: _nC(['tag-pill', tag.type])
  141. }), _tD(tag.text), 3 /* TEXT, CLASS */);
  142. }), 128 /* KEYED_FRAGMENT */)
  143. ]),
  144. _cE("view", _uM({ class: "contact-info-row" }), [
  145. _cE("text", _uM({ class: "contact-info" }), " 联系人:" + _tD(order['contact']), 1 /* TEXT */),
  146. _cE("text", _uM({ class: "tag-pill green" }), " 新客 ")
  147. ])
  148. ]),
  149. _cE("text", _uM({ class: "service-price" }), " ¥" + _tD(order.price), 1 /* TEXT */)
  150. ]),
  151. _cE("view", _uM({ class: "address-section" }), [
  152. _cV(_component_u_icon, _uM({
  153. type: "location",
  154. size: "16",
  155. color: "#999999"
  156. })),
  157. _cE("text", _uM({ class: "address-content" }), _tD(order.address), 1 /* TEXT */),
  158. _cE("text", _uM({ class: "distance-text" }), _tD(order.distance) + "km ", 1 /* TEXT */)
  159. ]),
  160. _cE("view", _uM({ class: "income-section" }), [
  161. _cE("text", _uM({ class: "income-label" }), " 预估收入 "),
  162. _cE("view", _uM({ class: "income-value-group" }), [
  163. _cE("text", _uM({ class: "income-main" }), " ¥" + _tD(order.income), 1 /* TEXT */),
  164. _cE("text", _uM({ class: "income-sub" }), " (含路费) ")
  165. ])
  166. ]),
  167. _cE("view", _uM({ class: "action-section" }), [
  168. _cE("view", _uM({
  169. class: "btn btn-nav",
  170. onClick: () => { onNavigate(order.address); }
  171. }), [
  172. _cV(_component_u_icon, _uM({
  173. type: "navigation",
  174. size: "14",
  175. color: "#333333"
  176. })),
  177. _cE("text", null, " 地址导航 ")
  178. ], 8 /* PROPS */, ["onClick"]),
  179. _cE("text", _uM({
  180. class: "btn btn-transfer",
  181. onClick: () => { onTransfer(order.id); }
  182. }), " 我要转单 ", 8 /* PROPS */, ["onClick"]),
  183. _cE("text", _uM({
  184. class: "btn btn-confirm",
  185. onClick: () => { onConfirm(order.id); }
  186. }), " 确认接单 ", 8 /* PROPS */, ["onClick"])
  187. ])
  188. ]);
  189. }), 64 /* STABLE_FRAGMENT */)
  190. ])
  191. ]);
  192. };
  193. }
  194. });
  195. export default __sfc__;
  196. 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"]]))]])];
  197. //# sourceMappingURL=order.uvue.map