order-sharedetails.vue 6.4 KB

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