detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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="true"
  12. :isScroll="true"
  13. :refresherTriggered="refresherTriggered"
  14. @refresherrefresh="refresherrefresh">
  15. <view class="address-container">
  16. <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
  17. <view class="hasdata">
  18. <view class="name">{{detail.userName}}<text>{{detail.phone}}</text></view>
  19. <view class="address ellipsis-2">{{detail.address}}</view>
  20. </view>
  21. </view>
  22. <view class="goods-container">
  23. <view class="title">商品信息</view>
  24. <view class="goods">
  25. <image :src="imageUrl + detail.goodsPicUrl"></image>
  26. <view class="main">
  27. <view class="name">{{detail.goodsTitle}}</view>
  28. <view class="des">{{detail.content}}</view>
  29. <view class="price"><text>{{detail.goodsAmount | priceFilter2}}</text>数量:{{detail.num}}</view>
  30. </view>
  31. </view>
  32. <view class="total">订单总金额<text>{{detail.price | priceFilter2}}</text></view>
  33. </view>
  34. <view class="order-container">
  35. <view class="title">订单信息</view>
  36. <view class="row">订单编号:{{detail.orderId}}</view>
  37. <view class="row">创建时间:{{detail.createTime}}</view>
  38. <view class="row">付款时间:{{detail.payTime}}</view>
  39. <view class="row">支付方式:{{detail.payType | payTypeFilter}}</view>
  40. <view class="row">支付单号:{{detail.transactionId}}</view>
  41. <view class="row">发货时间:{{detail.logisticsTime}}</view>
  42. <view class="row">收货时间:{{detail.completeTime}}</view>
  43. </view>
  44. <template slot="footer">
  45. <view class="bottom-container">
  46. <u-button text="取消订单" shape="circle"></u-button>
  47. </view>
  48. </template>
  49. </zj-page-layout>
  50. </view>
  51. <!-- #endif -->
  52. <!-- #ifndef H5 -->
  53. <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)"></web-view>
  54. <!-- #endif -->
  55. </template>
  56. <script>
  57. // #ifdef H5
  58. export default {
  59. filters: {
  60. payTypeFilter(val) {
  61. const MAP = {
  62. WECHAT: '微信支付'
  63. }
  64. return MAP[val];
  65. }
  66. },
  67. data() {
  68. return {
  69. id: null,
  70. detail: null,
  71. imageUrl: this.$imageUrl,
  72. loadStatus: 0,
  73. errorText: '',
  74. refresherTriggered: false,
  75. }
  76. },
  77. onLoad({id}) {
  78. this.id = id;
  79. this.getDetail();
  80. },
  81. methods: {
  82. getDetail() {
  83. this.$api.post('/orderPay/detail', {
  84. orderId: this.id
  85. }).then(res => {
  86. this.detail = res.data;
  87. this.loadStatus = 0;
  88. this.getLogisticsData();
  89. }).catch(res => {
  90. this.errorText = res.message;
  91. this.loadStatus = 2;
  92. }).finally(res => {
  93. this.refresherTriggered = false;
  94. })
  95. }
  96. }
  97. }
  98. // #endif
  99. // #ifndef H5
  100. export default {
  101. data() {
  102. return {
  103. pam: {},
  104. }
  105. },
  106. onLoad(pam) {
  107. this.pam = pam;
  108. },
  109. }
  110. // #endif
  111. </script>
  112. <style lang="scss" scoped>
  113. .address-container {
  114. background: #FFFFFF;
  115. display: flex;
  116. align-items: center;
  117. height: 150rpx;
  118. padding: 0 20rpx;
  119. margin-top: 30rpx;
  120. .icon {
  121. width: 52rpx;
  122. height: 52rpx;
  123. border-radius: 50%;
  124. background: $theme-color;
  125. display: flex;
  126. flex-shrink: 0;
  127. justify-content: center;
  128. align-items: center;
  129. margin-right: 20rpx;
  130. .iconfont {
  131. font-size: 36rpx;
  132. color: #ffffff;
  133. }
  134. }
  135. .hasdata {
  136. .name {
  137. font-size: 32rpx;
  138. color: #333333;
  139. text {
  140. color: #999999;
  141. font-size: 28rpx;
  142. margin-left: 16rpx;
  143. }
  144. }
  145. .address {
  146. font-size: 28rpx;
  147. color: #666666;
  148. line-height: 34rpx;
  149. margin-top: 10rpx;
  150. }
  151. }
  152. }
  153. .goods-container {
  154. background: #ffffff;
  155. margin-top: 30rpx;
  156. padding: 30rpx 30rpx 0;
  157. .title {
  158. font-weight: 500;
  159. }
  160. .goods {
  161. display: flex;
  162. padding: 30rpx 0;
  163. image {
  164. width: 120rpx;
  165. height: 120rpx;
  166. }
  167. .main {
  168. flex: 1;
  169. margin-left: 20rpx;
  170. .name {
  171. font-size: 32rpx;
  172. }
  173. .des {
  174. margin-top: 12rpx;
  175. font-size: 28rpx;
  176. color: $reg-font;
  177. }
  178. .price {
  179. margin-top: 12rpx;
  180. text {
  181. color: $assist-color;
  182. font-weight: 500;
  183. font-size: 32rpx;
  184. margin-right: 12rpx;
  185. }
  186. }
  187. }
  188. }
  189. .total {
  190. border-top: 1px solid #eaeaea;
  191. height: 80rpx;
  192. display: flex;
  193. align-items: center;
  194. justify-content: end;
  195. font-size: 28rpx;
  196. text {
  197. margin-left: 12rpx;
  198. color: $assist-color;
  199. }
  200. }
  201. }
  202. .order-container {
  203. background: #ffffff;
  204. margin-top: 30rpx;
  205. padding: 30rpx;
  206. .title {
  207. font-weight: 500;
  208. margin-bottom: 20rpx;
  209. }
  210. .row {
  211. margin-top: 12rpx;
  212. font-size: 28rpx;
  213. text {
  214. color: $assist-color;
  215. }
  216. }
  217. }
  218. .bottom-container {
  219. padding: 20rpx 30rpx;
  220. display: flex;
  221. align-items: center;
  222. justify-content: flex-end;
  223. .u-button {
  224. width: auto;
  225. height: 60rpx;
  226. margin: 0;
  227. margin-left: 20rpx;
  228. }
  229. }
  230. </style>