order-sharedetails.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="container details clearfix">
  3. <tui-skeleton
  4. v-if="!skeletonShow"
  5. backgroundColor="#fafafa"
  6. borderRadius="10rpx"
  7. :isLoading="true"
  8. :loadingType="5"
  9. />
  10. <template v-else>
  11. <!-- 地址选择 -->
  12. <cm-address-temp ref="orderAddress" v-if="skeletonShow" :addressData="addressData" />
  13. <!-- 商品 -->
  14. <cm-goods-temp ref="goods" v-if="skeletonShow" :list="orderInfo.orderProductList" :orderInfo="orderInfo" />
  15. <!-- 订单信息 -->
  16. <cm-order-temp ref="information" v-if="skeletonShow" :information="orderInfo" />
  17. <!-- 发票信息 -->
  18. <cm-invice-temp ref="invoice" v-if="skeletonShow" :orderInvoice="orderInvoice" />
  19. <!-- 支付记录 -->
  20. <cm-payment-temp
  21. ref="payment"
  22. v-if="skeletonShow"
  23. :discernReceiptList="discernReceiptList"
  24. :receiptAmount="receiptAmount"
  25. />
  26. <!-- 退款记录 -->
  27. <cm-refund-temp
  28. ref="refund"
  29. v-if="skeletonShow"
  30. :returnedPurchaseList="returnedPurchaseList"
  31. :returnedPurchaseFee="returnedPurchaseFee"
  32. />
  33. <!-- 支付凭证记录 -->
  34. <cm-voucher-temp
  35. ref="voucher"
  36. v-if="skeletonShow && voucherList && voucherList.length > 0"
  37. :list="voucherList"
  38. />
  39. <!-- 底部button -->
  40. <view class="button-content" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  41. <view class="btn btn-query" v-if="btnState.isQuery" @click.stop="queryLogistics">查看物流</view>
  42. <view class="btn btn-cancel" v-if="btnState.isPay" @click.stop="btnConfirmPay">立即支付</view>
  43. </view>
  44. </template>
  45. </view>
  46. </template>
  47. <script>
  48. import cmAddressTemp from './components/details/cm-address-temp' //地址信息
  49. import cmGoodsTemp from './components/details/cm-goods-temp' //商品列表
  50. import cmInviceTemp from './components/details/cm-invice-temp' //发票信息
  51. import cmOrderTemp from './components/details/cm-order-temp' //订单信息
  52. import cmPaymentTemp from './components/details/cm-payment-temp' //支付记录
  53. import cmRefundTemp from './components/details/cm-refund-temp' //退款记录
  54. import cmVoucherTemp from './components/details/cm-voucher-temp' //支付凭证记录
  55. export default {
  56. components: {
  57. cmAddressTemp,
  58. cmGoodsTemp,
  59. cmOrderTemp,
  60. cmInviceTemp,
  61. cmPaymentTemp,
  62. cmRefundTemp,
  63. cmVoucherTemp,
  64. },
  65. data() {
  66. return {
  67. status: '',
  68. userId: '',
  69. orderId: '',
  70. shopOrderId: '',
  71. skeletonShow: false,
  72. cellPhone: '', //客服电话
  73. btnStatus: 0, //按钮组件状态
  74. addressData: {}, //地址信息初始化
  75. orderInfo: {}, //订单信息初始化
  76. orderInvoice: {}, //发票信息初始化
  77. returnedPurchaseList: {}, //退款信息初始化
  78. discernReceiptList: {}, //支付信息初始化
  79. voucherList: [], //支付凭证
  80. receiptAmount: 0, //支付金额
  81. returnedPurchaseFee: 0, //退款金额
  82. isIphoneX: this.$store.state.isIphoneX,
  83. popupShow: false,
  84. handlerPros: {},
  85. btnState: {
  86. isQuery: false,
  87. isPay: false
  88. },
  89. mapStateArr: [
  90. { label: 'isQuery', val: [2, 3, 5, 6, 12, 13, 22, 23, 32, 33], status: true },
  91. { label: 'isPay', val: [11, 12, 13, 21, 22, 23], status: true }
  92. ]
  93. }
  94. },
  95. onLoad(option) {
  96. this.shopOrderId = option.shopOrderId
  97. this.userId = option.userId
  98. this.initOrderDetaileData()
  99. },
  100. methods: {
  101. async initOrderDetaileData() {
  102. try{
  103. const res = await this.OrderService.QueryOrderDetails({ shopOrderId: this.shopOrderId, userId: this.userId })
  104. const data = res.data
  105. this.skeletonShow = true
  106. this.status = data.shopOrder.status
  107. this.addressData = data.userInfo
  108. this.orderInfo = data.shopOrder
  109. this.orderInvoice = data.orderInvoice
  110. this.returnedPurchaseList = data.returnedPurchaseList
  111. this.discernReceiptList = data.discernReceiptList
  112. this.receiptAmount = data.order.receiptAmount
  113. this.returnedPurchaseFee = data.shopOrder.returnedPurchaseFee
  114. this.voucherList = data.voucher
  115. this.mapStateArr.forEach(el => {
  116. el.val.forEach(value => {
  117. if (this.status === value) {
  118. this.btnState[el.label] = el.status
  119. }
  120. })
  121. })
  122. }catch(error){
  123. this.$util.msg(error.msg, 2000)
  124. }
  125. },
  126. hanldePopupFn(data) {
  127. //监听活动内容
  128. this.popupShow = true
  129. this.handlerPros = data
  130. },
  131. queryLogistics() {
  132. //跳转查询物流页面
  133. this.$api.navigateTo('/pages/user/order/order-logistics?shopOrderId=' + this.shopOrderId)
  134. },
  135. btnConfirmPay() {
  136. // 立即支付点击事件
  137. this.getOrderPaymentValidation()
  138. },
  139. //监听根据付款状态做操作
  140. async getOrderPaymentValidation() {
  141. try{
  142. const res = await this.OrderService.OrderPaymentValidation({ shopOrderId: this.shopOrderId })
  143. this.$api.navigateTo(`/pages/user/order/order-pay-list?shopOrderId=${res.data.shopOrderId}`)
  144. }catch(error){
  145. this.$util.msg(error.msg, 2000)
  146. }
  147. },
  148. },
  149. onShow() {}
  150. }
  151. </script>
  152. <style lang="scss">
  153. page {
  154. height: auto;
  155. background: #f7f7f7;
  156. }
  157. .details {
  158. padding-bottom: 180rpx;
  159. }
  160. .btn-hover {
  161. background: #ffffff;
  162. }
  163. .animation {
  164. /* transition: transform 0.3s ease;*/
  165. transition-property: transform;
  166. transition-duration: 0.3s;
  167. transition-timing-function: ease;
  168. }
  169. .invoice-balance {
  170. width: 702rpx;
  171. height: auto;
  172. padding: 0 24rpx;
  173. background: #ffffff;
  174. float: left;
  175. margin-top: 24rpx;
  176. margin-bottom: 24rpx;
  177. .balabce-t {
  178. width: 100%;
  179. height: 86rpx;
  180. line-height: 86rpx;
  181. font-size: $font-size-28;
  182. color: $text-color;
  183. float: left;
  184. .balabce-t-le {
  185. float: left;
  186. font-weight: bold;
  187. }
  188. .balabce-t-ri {
  189. float: right;
  190. display: flex;
  191. align-items: center;
  192. .money {
  193. display: flex;
  194. float: left;
  195. }
  196. .checkbox-box {
  197. display: flex;
  198. width: 60rpx;
  199. float: left;
  200. height: 100%;
  201. font-size: $font-size-24;
  202. .checkbox {
  203. width: 40rpx;
  204. text-align: right;
  205. box-sizing: border-box;
  206. text-align: center;
  207. text-decoration: none;
  208. border-radius: 0;
  209. -webkit-tap-highlight-color: transparent;
  210. overflow: hidden;
  211. }
  212. }
  213. }
  214. }
  215. .balabce-b {
  216. width: 100%;
  217. float: left;
  218. overflow: hidden;
  219. .balabce-b-text {
  220. width: 100%;
  221. line-height: 58rpx;
  222. font-size: $font-size-24;
  223. color: #ff2a2a;
  224. text-align: right;
  225. float: right;
  226. }
  227. &.balabce-b--hide {
  228. padding: 0 0;
  229. height: 0px;
  230. line-height: 0px;
  231. }
  232. }
  233. }
  234. .button-content {
  235. width: 702rpx;
  236. padding: 0 24rpx;
  237. height: auto;
  238. background: #ffffff;
  239. position: fixed;
  240. bottom: 0;
  241. left: 0;
  242. .btn {
  243. width: 160rpx;
  244. height: 64rpx;
  245. margin: 22rpx;
  246. line-height: 64rpx;
  247. font-size: $font-size-26;
  248. color: #ffffff;
  249. text-align: center;
  250. float: right;
  251. border-radius: 32rpx;
  252. }
  253. .btn-query {
  254. background: linear-gradient(135deg, rgba(255, 212, 129, 1) 0%, rgba(198, 129, 0, 1) 100%);
  255. }
  256. .btn-cancel {
  257. background: #ffffff;
  258. color: #666666;
  259. float: left;
  260. // margin: 22rpx 0;
  261. margin-right: 15rpx;
  262. border: 2rpx solid #999999;
  263. }
  264. }
  265. </style>