order-sharedetails.vue 7.0 KB

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