detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <!-- #ifdef H5 -->
  3. <view>
  4. <Loading
  5. :type="3"
  6. :loadStatus="loadStatus"
  7. :showText="errorText"
  8. />
  9. <zj-page-layout
  10. v-if="detail"
  11. :hasFooter="false"
  12. :isScroll="true"
  13. :refresherTriggered="refresherTriggered"
  14. @refresherrefresh="refresherrefresh">
  15. <view class="goods-container">
  16. <view class="title">商品信息</view>
  17. <view class="goods">
  18. <image :src="imageUrl + detail.goodsPicUrl"></image>
  19. <view class="main">
  20. <view class="name">{{detail.goodsTitle}}</view>
  21. <view class="des">{{detail.content}}</view>
  22. <view class="price"><text>{{detail.goodsAmount | priceFilter2}}</text>数量:{{detail.num}}</view>
  23. </view>
  24. </view>
  25. <view class="total">订单总金额<text>{{detail.price | priceFilter2}}</text></view>
  26. </view>
  27. <view class="order-container">
  28. <view class="title">订单信息</view>
  29. <view class="row">订单编号:{{detail.orderId}}</view>
  30. <view class="row">创建时间:{{detail.createTime}}</view>
  31. <view class="row">付款时间:{{detail.payTime}}</view>
  32. <view class="row">支付方式:{{detail.payType | payTypeFilter}}</view>
  33. <view class="row">支付单号:{{detail.transactionId}}</view>
  34. <view class="row">发货时间:{{detail.logisticsTime}}</view>
  35. <view class="row">收货时间:{{detail.completeTime}}</view>
  36. <view class="row">结算金额:<text>¥{{detail.sharePrice | priceFilter}}</text></view>
  37. </view>
  38. </zj-page-layout>
  39. </view>
  40. <!-- #endif -->
  41. <!-- #ifndef H5 -->
  42. <web-view :src="webViewHref('/pages/mine/myEarnings/detail', pam)" @message="crossPage.$listener"></web-view>
  43. <!-- #endif -->
  44. </template>
  45. <script>
  46. // #ifdef H5
  47. export default {
  48. filters: {
  49. payTypeFilter(val) {
  50. const MAP = {
  51. WECHAT: '微信支付'
  52. }
  53. return MAP[val];
  54. }
  55. },
  56. data() {
  57. return {
  58. id: null,
  59. detail: null,
  60. imageUrl: this.$imageUrl,
  61. loadStatus: 0,
  62. errorText: '',
  63. refresherTriggered: false,
  64. }
  65. },
  66. onLoad({id}) {
  67. this.id = id;
  68. this.getDetail();
  69. },
  70. methods: {
  71. getDetail() {
  72. this.$api.postJson('/orderPay/detail', {
  73. orderId: this.id
  74. }).then(res => {
  75. this.detail = res.data;
  76. this.loadStatus = 0;
  77. }).catch(res => {
  78. this.errorText = res.message;
  79. this.loadStatus = 2;
  80. }).finally(res => {
  81. this.refresherTriggered = false;
  82. })
  83. },
  84. refresherrefresh() {
  85. this.refresherTriggered = true;
  86. this.getDetail();
  87. },
  88. }
  89. }
  90. // #endif
  91. // #ifndef H5
  92. export default {
  93. data() {
  94. return {
  95. pam: {},
  96. }
  97. },
  98. onLoad(pam) {
  99. this.pam = pam;
  100. },
  101. }
  102. // #endif
  103. </script>
  104. <style lang="scss" scoped>
  105. .goods-container {
  106. background: #ffffff;
  107. margin-top: 30rpx;
  108. padding: 30rpx 30rpx 0;
  109. .title {
  110. font-weight: 500;
  111. }
  112. .goods {
  113. display: flex;
  114. padding: 30rpx 0;
  115. image {
  116. width: 120rpx;
  117. height: 120rpx;
  118. }
  119. .main {
  120. flex: 1;
  121. margin-left: 20rpx;
  122. .name {
  123. font-size: 32rpx;
  124. }
  125. .des {
  126. margin-top: 12rpx;
  127. font-size: 28rpx;
  128. color: $reg-font;
  129. }
  130. .price {
  131. margin-top: 12rpx;
  132. text {
  133. color: $assist-color;
  134. font-weight: 500;
  135. font-size: 32rpx;
  136. margin-right: 12rpx;
  137. }
  138. }
  139. }
  140. }
  141. .total {
  142. border-top: 1px solid #eaeaea;
  143. height: 80rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: end;
  147. font-size: 28rpx;
  148. text {
  149. margin-left: 12rpx;
  150. color: $assist-color;
  151. }
  152. }
  153. }
  154. .order-container {
  155. background: #ffffff;
  156. margin-top: 30rpx;
  157. padding: 30rpx;
  158. .title {
  159. font-weight: 500;
  160. margin-bottom: 20rpx;
  161. }
  162. .row {
  163. margin-top: 12rpx;
  164. font-size: 28rpx;
  165. text {
  166. color: $assist-color;
  167. }
  168. }
  169. }
  170. </style>