order-sharedetails.vue 7.1 KB

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