order_detail.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar title="订单详情" fixed border>
  5. <template #right>
  6. <navMenu :options="{ icon: 'icon-home', text: '主页' }" />
  7. </template>
  8. </Navbar>
  9. <view class="content">
  10. <view class="tip">
  11. <trans _t="订单流程" />:&nbsp;
  12. <trans _t="处理中" />
  13. <!-- <i class="icon-font icon-question2"></i> -->
  14. </view>
  15. <orderList :item="detail" />
  16. <view class="order_info">
  17. <view class="order_no">
  18. <trans _t="订单号" />:
  19. <view class="_no">{{ detail.orderNo }}</view>
  20. </view>
  21. <view class="copy_btn">
  22. <up-copy :content="detail.orderNo" :notice="t('复制成功')">
  23. <trans _t="复制" />
  24. </up-copy>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </Theme>
  30. </template>
  31. <script setup>
  32. import Navbar from "@/components/navbar"
  33. import navMenu from "@/components/nav_menu";
  34. import { SHOP_ORDER_DETAIL } from "@/api"
  35. import { ref, nextTick } from "vue";
  36. import { onLoad } from "@dcloudio/uni-app"
  37. import orderList from "./components/order_list"
  38. import { t } from "@/locale"
  39. const orderid = ref('');
  40. const detail = ref({})
  41. onLoad((options) => {
  42. orderid.value = options.orderid;
  43. nextTick(() => {
  44. getDetail()
  45. })
  46. })
  47. const getDetail = async () => {
  48. try {
  49. const res = await SHOP_ORDER_DETAIL(orderid.value);
  50. detail.value = res.data
  51. } catch (error) { }
  52. }
  53. </script>
  54. <style lang="less" scoped>
  55. @import url('@/style.less');
  56. .wrap {
  57. min-height: 100vh;
  58. background-color: var(--bg);
  59. .content {
  60. padding: 24rpx;
  61. .tip {
  62. .flex_position(flex-end);
  63. color: var(--primary);
  64. .size(28rpx);
  65. .icon-font {
  66. .size(48rpx);
  67. }
  68. }
  69. .order_info {
  70. background-color: var(--light);
  71. margin-top: 24rpx;
  72. border-radius: 16rpx;
  73. padding: 24rpx;
  74. .ver();
  75. .order_no {
  76. flex: 1;
  77. .flex();
  78. color: var(--text);
  79. .size(24rpx);
  80. line-height: 40rpx;
  81. ._no {
  82. font-weight: 600;
  83. flex: 1;
  84. }
  85. }
  86. .copy_btn {
  87. border: 1px solid var(--primary);
  88. border-radius: 40rpx;
  89. color: var(--primary);
  90. padding: 0 16rpx;
  91. .size(24rpx);
  92. line-height: 40rpx;
  93. }
  94. }
  95. }
  96. }
  97. </style>