order-sharedetails.vue 7.2 KB

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