content.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <s-layout title="发货内容">
  3. <view class="order-card ss-m-x-20 ss-r-20">
  4. <s-goods-item
  5. :img="state.data.goods_image"
  6. :title="state.data.goods_title"
  7. :skuText="state.data.goods_sku_text"
  8. :price="state.data.goods_price"
  9. :num="state.data.goods_num"
  10. radius="20"
  11. >
  12. <template #priceSuffix>
  13. <button class="ss-reset-button tag-btn" v-if="state.data.status_text">
  14. {{ state.data.status_text }}
  15. </button>
  16. </template>
  17. </s-goods-item>
  18. </view>
  19. <view class="bg-white ss-p-20 ss-m-x-20 ss-r-20">
  20. <view class="title ss-m-b-26">发货信息</view>
  21. <view v-if="state.data.ext?.dispatch_content_type === 'params'">
  22. <view class="desc ss-m-b-20" v-for="item in state.data.ext.dispatch_content" :key="item">
  23. {{ item.title }}: {{ item.content }}
  24. </view>
  25. </view>
  26. <view class="desc" v-else>{{ state.data.ext?.dispatch_content }}</view>
  27. </view>
  28. </s-layout>
  29. </template>
  30. <script setup>
  31. import { onLoad } from '@dcloudio/uni-app';
  32. import { reactive } from 'vue';
  33. import sheep from '@/sheep';
  34. const state = reactive({
  35. data: [],
  36. });
  37. async function getDetail(id, item_id) {
  38. const { error, data } = await sheep.$api.order.itemDetail({
  39. id: id,
  40. item_id: item_id,
  41. });
  42. if (error === 0) {
  43. state.data = data;
  44. }
  45. }
  46. onLoad(async (options) => {
  47. getDetail(options.id, options.item_id);
  48. });
  49. </script>
  50. <style lang="scss" scoped>
  51. .order-card {
  52. padding: 20rpx 0;
  53. .order-sku {
  54. font-size: 24rpx;
  55. font-weight: 400;
  56. color: rgba(153, 153, 153, 1);
  57. width: 450rpx;
  58. margin-bottom: 20rpx;
  59. .order-num {
  60. margin-right: 10rpx;
  61. }
  62. }
  63. .tag-btn {
  64. margin-left: 16rpx;
  65. font-size: 24rpx;
  66. height: 36rpx;
  67. color: var(--ui-BG-Main);
  68. border: 2rpx solid var(--ui-BG-Main);
  69. border-radius: 14rpx;
  70. padding: 0 4rpx;
  71. }
  72. }
  73. .title {
  74. font-size: 28rpx;
  75. font-weight: bold;
  76. color: #333333;
  77. }
  78. .desc {
  79. font-size: 26rpx;
  80. font-weight: 400;
  81. color: #333333;
  82. }
  83. </style>