detail.vue 5.1 KB

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