order-sharedetails.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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/details/orderAddress' //地址信息
  41. import goodsList from './components/details/goodsList' //商品列表
  42. import invoiceTent from './components/details/invoiceTent' //发票信息
  43. import orderInformation from './components/details/orderInformation' //订单信息
  44. import paymentRecord from './components/details/paymentRecord' //支付记录
  45. import refundRecord from './components/details/refundRecord' //退款记录
  46. import activiPopup from './components/details/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. isPay:false
  79. },
  80. mapStateArr: [
  81. { label: 'isQuery', val: [4, 5, 12, 13, 33, 22, 23, 32, 77], status: true },
  82. { label: 'isPay', val: [11, 12, 13, 21, 22, 23, 111], status: true }
  83. ]
  84. }
  85. },
  86. onLoad(option) {
  87. this.orderId = option.orderId
  88. this.userId = option.userId
  89. this.initOrderDetaileData()
  90. },
  91. methods: {
  92. initOrderDetaileData() {
  93. //初始化页面数据@参数:订单ID
  94. this.OrderService.QueryOrderDetails({ orderId: this.orderId, userId: this.userId })
  95. .then(response => {
  96. let data = response.data
  97. this.status = data.order.status
  98. this.addressData = data.userInfo
  99. this.information = data.order
  100. this.shopOrderData = data.shopOrderList
  101. this.orderInvoice = data.orderInvoice
  102. this.returnedPurchaseList = data.returnedPurchaseList
  103. this.discernReceiptList = data.discernReceiptList
  104. this.receiptAmount = data.order.receiptAmount
  105. this.returnedPurchaseFee = data.order.returnedPurchaseFee
  106. this.isRequest = true
  107. this.mapStateArr.forEach(el => {
  108. el.val.forEach(value => {
  109. if (this.status === value) {
  110. this.btnState[el.label] = el.status
  111. }
  112. })
  113. })
  114. })
  115. .catch(error => {
  116. this.$util.msg(error.msg, 2000)
  117. })
  118. },
  119. hanldePopupFn(data) {
  120. //监听活动内容
  121. this.popupShow = true
  122. this.handlerPros = data
  123. },
  124. queryLogistics() {
  125. //跳转查询物流页面
  126. this.$api.navigateTo('/pages/user/order/order-logistics?orderId=' + this.orderId)
  127. },
  128. btnConfirmPay() {
  129. // 立即支付点击事件
  130. this.getOrderPaymentValidation(this.orderId)
  131. },
  132. getOrderPaymentValidation(orderId) {
  133. //监听根据付款状态做操作
  134. this.OrderService.OrderPaymentValidation({ orderId: orderId })
  135. .then(response => {
  136. if (response.data.code == -1) {
  137. this.$util.modal('', '订单已申请全部退款,无需再付款!', '确定', '', false, () => {})
  138. } else {
  139. if (response.data.onlinePayFlag === 1) {
  140. this.$api.navigateTo(`/pages/user/pay/card-under?orderId=${orderId}`)
  141. } else {
  142. this.$api.navigateTo(`/pages/user/order/order-pay-list?orderId=${orderId}`,)
  143. }
  144. }
  145. })
  146. .catch(error => {
  147. this.$util.msg(error.msg, 2000)
  148. })
  149. }
  150. },
  151. onShow() {}
  152. }
  153. </script>
  154. <style lang="scss">
  155. page {
  156. height: auto;
  157. background: #f7f7f7;
  158. }
  159. .details {
  160. padding-bottom: 180rpx;
  161. }
  162. .btn-hover {
  163. background: #ffffff;
  164. }
  165. .animation {
  166. /* transition: transform 0.3s ease;*/
  167. transition-property: transform;
  168. transition-duration: 0.3s;
  169. transition-timing-function: ease;
  170. }
  171. .invoice-balance {
  172. width: 702rpx;
  173. height: auto;
  174. padding: 0 24rpx;
  175. background: #ffffff;
  176. float: left;
  177. margin-top: 24rpx;
  178. margin-bottom: 24rpx;
  179. .balabce-t {
  180. width: 100%;
  181. height: 86rpx;
  182. line-height: 86rpx;
  183. font-size: $font-size-28;
  184. color: $text-color;
  185. float: left;
  186. .balabce-t-le {
  187. float: left;
  188. font-weight: bold;
  189. }
  190. .balabce-t-ri {
  191. float: right;
  192. display: flex;
  193. align-items: center;
  194. .money {
  195. display: flex;
  196. float: left;
  197. }
  198. .checkbox-box {
  199. display: flex;
  200. width: 60rpx;
  201. float: left;
  202. height: 100%;
  203. font-size: $font-size-24;
  204. .checkbox {
  205. width: 40rpx;
  206. text-align: right;
  207. box-sizing: border-box;
  208. text-align: center;
  209. text-decoration: none;
  210. border-radius: 0;
  211. -webkit-tap-highlight-color: transparent;
  212. overflow: hidden;
  213. }
  214. }
  215. }
  216. }
  217. .balabce-b {
  218. width: 100%;
  219. float: left;
  220. overflow: hidden;
  221. .balabce-b-text {
  222. width: 100%;
  223. line-height: 58rpx;
  224. font-size: $font-size-24;
  225. color: #ff2a2a;
  226. text-align: right;
  227. float: right;
  228. }
  229. &.balabce-b--hide {
  230. padding: 0 0;
  231. height: 0px;
  232. line-height: 0px;
  233. }
  234. }
  235. }
  236. .button-content {
  237. width: 702rpx;
  238. padding: 0 24rpx;
  239. height: auto;
  240. background: #ffffff;
  241. position: fixed;
  242. bottom: 0;
  243. left: 0;
  244. .btn {
  245. width: 160rpx;
  246. height: 64rpx;
  247. margin: 22rpx;
  248. line-height: 64rpx;
  249. font-size: $font-size-26;
  250. color: #ffffff;
  251. text-align: center;
  252. float: right;
  253. border-radius: 32rpx;
  254. }
  255. .btn-query {
  256. background: linear-gradient(135deg, rgba(255, 212, 129, 1) 0%, rgba(198, 129, 0, 1) 100%);
  257. }
  258. .btn-cancel {
  259. background: #ffffff;
  260. color: #666666;
  261. float: left;
  262. // margin: 22rpx 0;
  263. margin-right: 15rpx;
  264. border: 2rpx solid #999999;
  265. }
  266. }
  267. </style>