選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

order-details-new.vue 26KB

1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <!-- 新办订单-订单详情 -->
  2. <template>
  3. <view class="wrapper">
  4. <!-- 只有审核中、审核不通过和待发货订单有地址信息显示 -->
  5. <template v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
  6. <view class="address-box as-gravity-center-start as-layout-horizontal"
  7. v-if="state.orderInfo.orderStep == OrderStatus.待审核 || state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待发货">
  8. <view class="avatar as-gravity-center">
  9. {{state.orderInfo.orderInfoExt.consignee != null ? state.orderInfo.orderInfoExt.consignee.charAt(0) : ''}}
  10. </view>
  11. <view class="center" style="flex:1">
  12. <view class="as-layout-horizontal">
  13. <view class="name">{{state.orderInfo.orderInfoExt.consignee ?state.orderInfo.orderInfoExt.consignee: ''}}</view>
  14. <view class="phone">{{state.orderInfo.orderInfoExt.consigneeTel ?state.orderInfo.orderInfoExt.consigneeTel: ''}}</view>
  15. </view>
  16. <view class="addr">{{state.orderInfo.orderInfoExt.region ?state.orderInfo.orderInfoExt.region: ''}}
  17. {{state.orderInfo.orderInfoExt.address ?state.orderInfo.orderInfoExt.address: ''}}</view>
  18. </view>
  19. <image :src="`${$imgUrl}applyCard/edit.png`" mode="" class="edit" @click="gotoEditAddress(state.orderInfo)"></image>
  20. </view>
  21. </template>
  22. <view class="detail-box">
  23. <view class="detail-header">
  24. <image class="d-img" :src="`${$imgUrl}order/icon-star-green.png`"></image>
  25. <text class="detail-name">{{state.orderInfo.productName ?state.orderInfo.productName: ''}}</text>
  26. </view>
  27. <view class="detail-content">
  28. <view class="base-info-box">
  29. <!-- 基础信息 -->
  30. <view class="base-info">
  31. <view class="d-row">
  32. <text class="d-label">新办单号:</text>
  33. <text class="d-value">{{state.orderInfo.orderId}}</text>
  34. </view>
  35. <view class="d-row">
  36. <text class="d-label">业务类型:</text>
  37. <text class="d-value">{{getOrderTypeName(state.orderInfo.orderType)}}</text>
  38. </view>
  39. <view class="d-row">
  40. <text class="d-label">订单车牌:</text>
  41. <text class="d-value">{{state.orderInfo.vehiclePlate}}</text>
  42. </view>
  43. <view class="d-row">
  44. <text class="d-label">所属类型:</text>
  45. <!-- PERSONAL USER:个人 UNIT_USER:单位 -->
  46. <text class="d-value">{{state.orderInfo.userType === 'UNIT_USER' ? '单位' : '个人'}}</text>
  47. </view>
  48. <view class="d-row">
  49. <text class="d-label">车辆类型:</text>
  50. <text class="d-value">{{getCarTypeName(state.orderInfo.type)}}</text>
  51. </view>
  52. <view class="d-row">
  53. <text class="d-label">订单金额:</text>
  54. <text class="d-value text-orange">¥ {{state.orderInfo.amount / 100 ?state.orderInfo.amount / 100: '0.00'}}</text>
  55. </view>
  56. <view class="d-row">
  57. <text class="d-label">订单状态:</text>
  58. <text
  59. class="d-value text-green">{{state.orderInfo.orderStatus == OrderStatus.已取消 ? '已取消' : $util.getOrderStatusName(state.orderInfo.orderStep)}}</text>
  60. </view>
  61. <view class="d-row">
  62. <text class="d-label">创建时间:</text>
  63. <text class="d-value">{{getOrderTime(state.orderInfo.insertTime)}}</text>
  64. </view>
  65. </view>
  66. <!-- 已取消订单信息 -->
  67. <view v-if="state.orderInfo.orderStatus == OrderStatus.已取消">
  68. <view class="d-row" v-if="state.orderInfo.orderStep > OrderStatus.已支付">
  69. <text class="d-label">付款时间:</text>
  70. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.payTime)}}</text>
  71. </view>
  72. <view class="d-row">
  73. <text class="d-label">取消时间:</text>
  74. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.cancelTime)}}</text>
  75. </view>
  76. <view class="d-row" v-if="state.orderInfo.staffName">
  77. <text class="d-label">业 务 员:</text>
  78. <text class="d-value">{{state.orderInfo.staffName}}</text>
  79. </view>
  80. <view class="d-row">
  81. <text class="d-label">取消原因:</text>
  82. <text class="d-value">{{state.orderInfo.orderInfoExt.cancelReason ?state.orderInfo.orderInfoExt.cancelReason: ''}}</text>
  83. </view>
  84. </view>
  85. <view v-else>
  86. <!-- 审核中/审核不通过订单信息 -->
  87. <view v-if="state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待审核">
  88. <view class="d-row">
  89. <text class="d-label">付款时间:</text>
  90. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.payTime)}}</text>
  91. </view>
  92. <view class="d-row" v-if="state.orderInfo.orderStep == OrderStatus.审核不通过">
  93. <text class="d-label">不通过原因:</text>
  94. <text class="d-value">{{state.orderInfo.XXX ?state.orderInfo.XXX: ''}}</text>
  95. </view>
  96. </view>
  97. <!-- 待发货 -->
  98. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货">
  99. <view class="d-row">
  100. <text class="d-label">付款时间:</text>
  101. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.payTime)}}</text>
  102. </view>
  103. <view class="d-row" v-if="state.orderInfo.staffName">
  104. <text class="d-label">业 务 员:</text>
  105. <text class="d-value">{{state.orderInfo.staffName}}</text>
  106. </view>
  107. </view>
  108. <!-- 待收货/待激活/已结束/换货/退货-->
  109. <view
  110. v-if="state.orderInfo.orderStep == OrderStatus.待收货 || state.orderInfo.orderStep == OrderStatus.待激活
  111. || state.orderInfo.orderStep == OrderStatus.已结束
  112. || state.orderInfo.orderStep == OrderStatus['已申请-换货']
  113. || state.orderInfo.orderStep == OrderStatus['已申请-退货']">
  114. <view class="d-row">
  115. <text class="d-label">付款时间:</text>
  116. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.payTime)}}</text>
  117. </view>
  118. <view class="d-row">
  119. <text class="d-label">发货时间:</text>
  120. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.deliveryTime)}}</text>
  121. </view>
  122. <view class="d-row" v-if="state.orderInfo.orderStep != OrderStatus.待收货">
  123. <text class="d-label">收货时间:</text>
  124. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.receivingTime)}}</text>
  125. </view>
  126. <view class="d-row">
  127. <text class="d-label">卡 号:</text>
  128. <text class="d-value">{{state.orderInfo.cardId ?state.orderInfo.cardId: ''}}</text>
  129. </view>
  130. <view class="d-row">
  131. <text class="d-label">卡 状 态:</text>
  132. <text class="d-value">{{getETCStatusName(state.orderInfo.cardStatus)}}</text>
  133. </view>
  134. <view class="d-row">
  135. <text class="d-label">OBU 号:</text>
  136. <text class="d-value">{{state.orderInfo.obuId ?state.orderInfo.obuId: ''}}</text>
  137. </view>
  138. <view class="d-row">
  139. <text class="d-label">OBU状态:</text>
  140. <text class="d-value">{{getOBUStatusName(state.orderInfo.obuStatus)}}</text>
  141. </view>
  142. <view class="d-row" v-if="state.orderInfo.staffName">
  143. <text class="d-label">业 务 员:</text>
  144. <text class="d-value">{{state.orderInfo.staffName}}</text>
  145. </view>
  146. <view class="d-row">
  147. <text class="d-label">快递单号:</text>
  148. <text class="d-value">{{state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: ''}}</text>
  149. </view>
  150. <view class="d-row">
  151. <text class="d-label">物流公司:</text>
  152. <text class="d-value">{{state.orderInfo.courierCompany ?state.orderInfo.courierCompany: ''}}</text>
  153. </view>
  154. </view>
  155. <!-- 订单已完成 -->
  156. <view v-if="state.orderInfo.orderStep == OrderStatus.已完成">
  157. <view class="d-row">
  158. <text class="d-label">付款时间:</text>
  159. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.payTime)}}</text>
  160. </view>
  161. <view class="d-row">
  162. <text class="d-label">发货时间:</text>
  163. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.deliveryTime)}}</text>
  164. </view>
  165. <view class="d-row">
  166. <text class="d-label">收货时间:</text>
  167. <text class="d-value">{{getOrderTime(state.orderInfo.orderInfoExt.receivingTime)}}</text>
  168. </view>
  169. <view class="d-row">
  170. <text class="d-label">激活时间:</text>
  171. <text class="d-value">{{getOrderTime(state.orderInfo.cardEnableTime)}}</text>
  172. </view>
  173. <view class="d-row">
  174. <text class="d-label">卡 号:</text>
  175. <text class="d-value">{{state.orderInfo.cardId ?state.orderInfo.cardId: ''}}</text>
  176. </view>
  177. <view class="d-row">
  178. <text class="d-label">卡 状 态:</text>
  179. <text class="d-value">{{getETCStatusName(state.orderInfo.cardStatus)}}</text>
  180. </view>
  181. <view class="d-row">
  182. <text class="d-label">OBU 号:</text>
  183. <text class="d-value">{{state.orderInfo.obuId ?state.orderInfo.obuId: ''}}</text>
  184. </view>
  185. <view class="d-row">
  186. <text class="d-label">OBU状态:</text>
  187. <text class="d-value">{{getOBUStatusName(state.orderInfo.obuStatus)}}</text>
  188. </view>
  189. <view class="d-row" v-if="state.orderInfo.staffName">
  190. <text class="d-label">业 务 员:</text>
  191. <text class="d-value">{{state.orderInfo.staffName}}</text>
  192. </view>
  193. <view class="d-row">
  194. <text class="d-label">快递单号:</text>
  195. <text class="d-value">{{state.orderInfo.trackingNumber ?state.orderInfo.trackingNumber: ''}}</text>
  196. </view>
  197. <view class="d-row">
  198. <text class="d-label">物流公司:</text>
  199. <text class="d-value">{{state.orderInfo.courierCompany ?state.orderInfo.courierCompany: ''}}</text>
  200. </view>
  201. </view>
  202. </view>
  203. <!-- 售后 -->
  204. <view class="post-sale" v-if="state.orderInfo.orderStep == OrderStatus['已申请-换货']
  205. || state.orderInfo.orderStep == OrderStatus['已申请-退货'] || isHaveAfterSaleInfo()" >
  206. <!-- 售后退货-->
  207. <view v-if="state.orderInfo.orderStep == OrderStatus['已申请-退货'] || !isBlank(state.orderInfo.orderInfoExt.returnMode)">
  208. <view class="d-row" v-if="state.orderInfo.XXX">
  209. <text class="d-label">售后单号:</text>
  210. <text class="d-value">{{state.orderInfo.XXX ?state.orderInfo.XXX: ''}}</text>
  211. </view>
  212. <view class="d-row">
  213. <text class="d-label">业务类型:</text>
  214. <text class="d-value">退货</text>
  215. </view>
  216. <view class="d-row">
  217. <text class="d-label">创建时间:</text>
  218. <text class="d-value">{{getOrderTime(state.orderInfo.XXXX)}}</text>
  219. </view>
  220. <view class="d-row">
  221. <text class="d-label">退货方式:</text>
  222. <text class="d-value">{{state.orderInfo.orderInfoExt.returnMode === 'ON_LINE' ? '线上' : '线下'}}</text>
  223. </view>
  224. <template v-if="state.orderInfo.orderInfoExt.returnMode === 'ON_LINE'">
  225. <view class="d-row">
  226. <text class="d-label">物流公司:</text>
  227. <text class="d-value">{{state.orderInfo.orderInfoExt.returnLogisticsCompany ?state.orderInfo.orderInfoExt.returnLogisticsCompany: ''}}</text>
  228. </view>
  229. <view class="d-row">
  230. <text class="d-label">快递单号:</text>
  231. <text class="d-value">{{state.orderInfo.orderInfoExt.returnLogisticsNumber ?state.orderInfo.orderInfoExt.returnLogisticsNumber: ''}}</text>
  232. </view>
  233. </template>
  234. <template v-if="state.orderInfo.orderInfoExt.returnMode === 'OFFLINE'">
  235. <view class="d-row">
  236. <text class="d-label">退货网点:</text>
  237. <text class="d-value">{{state.orderInfo.orderInfoExt.returnNetworkName ?state.orderInfo.orderInfoExt.returnNetworkName: ''}}</text>
  238. </view>
  239. </template>
  240. <view class="d-row">
  241. <text class="d-label">退货原因:</text>
  242. <text class="d-value">{{state.orderInfo.orderInfoExt.returnReason ?state.orderInfo.orderInfoExt.returnReason: ''}}</text>
  243. </view>
  244. <view class="d-row" v-if="state.orderInfo.staffName">
  245. <text class="d-label">业 务 员:</text>
  246. <text class="d-value">{{state.orderInfo.staffName}}</text>
  247. </view>
  248. </view>
  249. <!-- 售后换货 -->
  250. <view v-if="state.orderInfo.orderStep == OrderStatus['已申请-换货'] || !isBlank(state.orderInfo.orderInfoExt.exchangeMode)">
  251. <view class="d-row" v-if="state.orderInfo.XXX">
  252. <text class="d-label">售后单号:</text>
  253. <text class="d-value">{{state.orderInfo.XXX ?state.orderInfo.XXX: ''}}</text>
  254. </view>
  255. <view class="d-row">
  256. <text class="d-label">业务类型:</text>
  257. <text class="d-value">换货</text>
  258. </view>
  259. <view class="d-row">
  260. <text class="d-label">创建时间:</text>
  261. <text class="d-value">{{getOrderTime(state.orderInfo.XXXX)}}</text>
  262. </view>
  263. <view class="d-row">
  264. <text class="d-label">退货方式:</text>
  265. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeMode === 'ON_LINE' ? '线上' : '线下'}}</text>
  266. </view>
  267. <!-- 线上 -->
  268. <template v-if="state.orderInfo.orderInfoExt.exchangeMode === 'ON_LINE'">
  269. <view class="d-row">
  270. <text class="d-label">物流公司:</text>
  271. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeLogisticsCompany ?state.orderInfo.orderInfoExt.exchangeLogisticsCompany: ''}}</text>
  272. </view>
  273. <view class="d-row">
  274. <text class="d-label">快递单号:</text>
  275. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeLogisticsNumber ?state.orderInfo.orderInfoExt.exchangeLogisticsNumber: ''}}</text>
  276. </view>
  277. <view class="d-row">
  278. <text class="d-label">收货方式:</text>
  279. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeRgMode === 'SELF' ? '营业点自提' : '邮寄'}}</text>
  280. </view>
  281. <template v-if="state.orderInfo.orderInfoExt.exchangeRgMode === 'SELF'">
  282. <view class="d-row">
  283. <text class="d-label">自提网点:</text>
  284. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeRgNetworkName ?state.orderInfo.orderInfoExt.exchangeRgNetworkName: ''}}</text>
  285. </view>
  286. </template>
  287. <template v-if="state.orderInfo.orderInfoExt.exchangeRgMode === 'MAIL'">
  288. <view class="d-row">
  289. <text class="d-label">收件人姓名:</text>
  290. <text class="d-value">{{state.orderInfo.orderInfoExt.consignee ?state.orderInfo.orderInfoExt.consignee: ''}}</text>
  291. </view>
  292. <view class="d-row">
  293. <text class="d-label">收件人电话:</text>
  294. <text class="d-value">{{state.orderInfo.orderInfoExt.consigneeTel ?state.orderInfo.orderInfoExt.consigneeTel: ''}}</text>
  295. </view>
  296. <view class="d-row">
  297. <text class="d-label">收件人地址:</text>
  298. <text class="d-value">{{state.orderInfo.orderInfoExt.region + " " + state.orderInfo.orderInfoExt.address}}</text>
  299. </view>
  300. <view class="d-row">
  301. <text class="d-label">邮政编码:</text>
  302. <text class="d-value">{{state.orderInfo.orderInfoExt.postalCode ?state.orderInfo.orderInfoExt.postalCode: ''}}</text>
  303. </view>
  304. </template>
  305. </template>
  306. <!-- 线下 -->
  307. <template v-if="state.orderInfo.orderInfoExt.exchangeMode === 'OFFLINE'">
  308. <view class="d-row">
  309. <text class="d-label">退货网点:</text>
  310. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeNetworkName ?state.orderInfo.orderInfoExt.exchangeNetworkName: ''}}</text>
  311. </view>
  312. </template>
  313. <view class="d-row">
  314. <text class="d-label">换货原因:</text>
  315. <text class="d-value">{{state.orderInfo.orderInfoExt.exchangeReason}}</text>
  316. </view>
  317. <view class="d-row" v-if="state.orderInfo.staffName">
  318. <text class="d-label">业 务 员:</text>
  319. <text class="d-value">{{state.orderInfo.staffName}}</text>
  320. </view>
  321. </view>
  322. <!-- 已完成订单的售后怎么判断 -->
  323. <!-- TODO 已完成订单存在售后信息的要显示售后信息,但是不知道用什么字段来来判断已完成订单有没有售后信息及哪一种售后信息,需走完订单所有流程在进行测试修改 -->
  324. </view>
  325. </view>
  326. <!-- 按钮区 -->
  327. <view class="btn-view" v-if="state.orderInfo.orderStatus != OrderStatus.已取消">
  328. <!-- 信息填写未完成 -->
  329. <view class="btn-status" v-if="state.orderInfo.orderStep == OrderStatus['完成个人/单位信息上传'] || state.orderInfo.orderStep == OrderStatus.完成填写基本信息 || state.orderInfo.orderStep == OrderStatus.完成车辆信息上传">
  330. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  331. <view class="btn-green" @click="gotoEditUserOrUnitInfo(state.orderInfo)">继续申请</view>
  332. </view>
  333. <!-- 审核中/审核不通过 -->
  334. <view v-if="state.orderInfo.orderStep == OrderStatus.审核不通过 || state.orderInfo.orderStep == OrderStatus.待审核" class="btn-status">
  335. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  336. <view class="btn space" v-if="state.orderInfo.orderStep == OrderStatus.审核不通过" @click="gotoEditUserOrUnitInfo(state.orderInfo)">修改资料</view>
  337. <view class="btn-green" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  338. </view>
  339. <!-- 待支付 -->
  340. <view v-if="state.orderInfo.orderStep == OrderStatus.待支付1 || state.orderInfo.orderStep == OrderStatus.待支付2 || state.orderInfo.orderStep == OrderStatus.待支付3" class="btn-status">
  341. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  342. <view class="btn-green width-num-1" @click="gotoPay(state.orderInfo)">支付</view>
  343. </view>
  344. <!-- 待发货 -->
  345. <view v-if="state.orderInfo.orderStep == OrderStatus.待发货" class="btn-status">
  346. <view class="btn space" @click="gotoCancelOrder(state.orderInfo)">取消订单</view>
  347. <view class="btn-green" @click="gotoEditAddress(state.orderInfo)">修改地址</view>
  348. </view>
  349. <!-- 待收货 -->
  350. <view v-if="state.orderInfo.orderStep == OrderStatus.待收货" class="btn-status">
  351. <view class="btn space" @click="gotoCheckLogistics(state.orderInfo)">查看物流</view>
  352. <view class="btn space" @click="gotoReturnOrder(state.orderInfo)">申请退货</view>
  353. <view class="btn-green" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
  354. </view>
  355. <!-- 待激活 -->
  356. <view v-if="state.orderInfo.orderStep == OrderStatus.待激活" class="btn-status">
  357. <view class="btn space" @click="gotoReturnOrder(state.orderInfo)">申请退货</view>
  358. <view class="btn space" @click="gotoExchangeOrder(state.orderInfo)">申请换货</view>
  359. <view class="btn-green" @click="gotoActiveOrder(state.orderInfo)">去激活</view>
  360. </view>
  361. <!-- 订单已结束 -->
  362. <view v-if="state.orderInfo.orderStep == OrderStatus.已结束" class="btn-status">
  363. <view class="btn-green width-num-3" @click="state.showActiveOrder = true">重新激活订单</view>
  364. </view>
  365. <!-- 订单完成 -->
  366. <view v-if="state.orderInfo.orderStep == OrderStatus.已完成" class="btn-status">
  367. <view class="btn space" @click="gotoEvaluateOrder(state.orderInfo)" v-if="!state.orderInfo.appraise">去评价</view>
  368. <view class="btn space" v-else>已评价</view>
  369. </view>
  370. <!-- 换货中 -->
  371. <view v-if="state.orderInfo.orderStep == OrderStatus['已申请-换货']" class="btn-status">
  372. <view class="btn space" @click="gotoCheckLogistics(state.orderInfo)">查看物流</view>
  373. <view class="btn-green" @click="gotoConfirmReceipt(state.orderInfo)">确认收货</view>
  374. </view>
  375. </view>
  376. </view>
  377. </view>
  378. </view>
  379. <!-- 弹窗 -->
  380. <u-popup v-model="state.showActiveOrder" mode="center" >
  381. <popup-active-order content="确认是否重新激活订单" @cancel="state.showActiveOrder = false" @confirm="toActiveOrder"></popup-active-order>
  382. </u-popup>
  383. </template>
  384. <script setup lang="ts">
  385. import popupActiveOrder from "@/pages/order/components/popup-active-order.vue";
  386. import {reactive} from "vue";
  387. import {onLoad,onUnload} from "@dcloudio/uni-app";
  388. import {request} from "@/utils/network/request";
  389. import {editOrderAddr, orderDetail} from "@/utils/network/api";
  390. import {stringToJson} from "@/utils/network/encryption";
  391. import useOrderSkip from "@/composables/order/useOrderSkip";
  392. import { getETCStatusName,getOBUStatusName,msg,getOrderTypeName,getCarTypeName,getOrderTime,isBlank } from "@/utils/utils";
  393. import {OrderStatus} from "@/datas/enum";
  394. const state = reactive({
  395. orderInfo: {} as any, //订单信息
  396. showActiveOrder: false, //激活弹窗
  397. });
  398. //按钮跳转业务逻辑
  399. const {gotoEditAddress,gotoCancelOrder,gotoEditUserOrUnitInfo,
  400. gotoConfirmReceipt,gotoCheckLogistics,gotoEvaluateOrder,
  401. gotoActiveOrder,gotoReturnOrder,gotoExchangeOrder,gotoPay} = useOrderSkip();
  402. //获取订单详情
  403. const getOrderDetails = (id,appraise) => {
  404. const options = {
  405. type: 2,
  406. data: {"id": id},
  407. method: 'POST',
  408. showLoading: true,
  409. }
  410. request(orderDetail, options).then((res) => {
  411. state.orderInfo = stringToJson(res.bizContent);
  412. state.orderInfo.appraise = appraise;
  413. //测试
  414. // state.orderInfo.orderStep = OrderStatus.待激活;
  415. })
  416. }
  417. //修改订单收货地址
  418. const requestEditOrderAddr = (addr) =>{
  419. const options = {
  420. type: 2,data: {
  421. "id": state.orderInfo.id,
  422. 'consignee': addr.consignee,
  423. 'consigneeTel': addr.consigneeTel,
  424. 'region' : addr.region,
  425. 'address': addr.address,
  426. 'postalCode': addr.postalCode},
  427. method: 'POST',
  428. showLoading: true,
  429. }
  430. request(editOrderAddr,options).then((res)=>{
  431. state.orderInfo.orderInfoExt.id = addr.id,
  432. state.orderInfo.orderInfoExt.consignee = addr.consignee;
  433. state.orderInfo.orderInfoExt.consigneeTel = addr.consigneeTel;
  434. state.orderInfo.orderInfoExt.region = addr.region;
  435. state.orderInfo.orderInfoExt.address = addr.address;
  436. state.orderInfo.orderInfoExt.postalCode = addr.postalCode;
  437. msg('收货地址修改成功');
  438. })
  439. }
  440. //激活订单
  441. const toActiveOrder = () => {
  442. gotoActiveOrder(state.orderInfo);
  443. state.showActiveOrder = false;
  444. }
  445. //是否有售后信息
  446. const isHaveAfterSaleInfo = () =>{
  447. if(isBlank(state.orderInfo.orderInfoExt.returnMode ?state.orderInfo.orderInfoExt.returnMode: null) && isBlank(state.orderInfo.orderInfoExt.exchangeMode ?state.orderInfo.orderInfoExt.exchangeMode: null)){
  448. return false;
  449. }
  450. return true;
  451. }
  452. onLoad((options) => {
  453. //刷新订单信息
  454. uni.$on('refreshOrder', (data) => {
  455. getOrderDetails(options.id,state.orderInfo.appraise);
  456. });
  457. //修改收货地址
  458. uni.$on('selectAddressSuccess',(addr) => {
  459. requestEditOrderAddr(addr);
  460. });
  461. getOrderDetails(options.id,options.appraise);
  462. })
  463. onUnload(()=>{
  464. uni.$off('refreshOrder');
  465. uni.$off('selectAddressSuccess');
  466. })
  467. </script>
  468. <style>
  469. page {
  470. background: #EEF7F7;
  471. padding-bottom: 30rpx;
  472. }
  473. :deep(.u-mode-center-box){
  474. border-radius: 20rpx;
  475. }
  476. </style>
  477. <style lang="scss" scoped>
  478. .address-box {
  479. background: #FFFFFF;
  480. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  481. border-radius: 20rpx;
  482. margin: 30rpx 30rpx 0rpx;
  483. padding: 30rpx;
  484. .avatar {
  485. background: rgba(0, 179, 139, 0.2);
  486. border-radius: 50%;
  487. color: #00B38B;
  488. font-size: 26rpx;
  489. width: 80rpx;
  490. height: 80rpx;
  491. }
  492. .center {
  493. margin-left: 20rpx;
  494. margin-right: 20rpx;
  495. display: flex;
  496. flex-direction: column;
  497. justify-content: center;
  498. .name {
  499. font-size: 30rpx;
  500. font-family: Microsoft YaHei;
  501. font-weight: 400;
  502. color: #333333;
  503. }
  504. .phone {
  505. font-size: 24rpx;
  506. font-family: Microsoft YaHei;
  507. font-weight: 400;
  508. color: #999999;
  509. margin-left: 20rpx;
  510. }
  511. .addr {
  512. margin-top: 18rpx;
  513. font-size: 26rpx;
  514. font-family: Microsoft YaHei;
  515. font-weight: 400;
  516. color: #333333;
  517. line-height: 36rpx;
  518. }
  519. }
  520. .edit {
  521. width: 60rpx;
  522. height: 55rpx;
  523. }
  524. }
  525. .detail-box {
  526. background: #FFFFFF;
  527. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  528. border-radius: 20rpx;
  529. margin: 30rpx;
  530. .detail-header {
  531. display: flex;
  532. border-bottom: 1rpx solid #DCDCDC;
  533. padding: 30rpx;
  534. align-items: center;
  535. .d-img {
  536. width: 48rpx;
  537. height: 48rpx;
  538. }
  539. .detail-name {
  540. font-size: 30rpx;
  541. font-weight: 400;
  542. color: #333333;
  543. margin-left: 12rpx;
  544. }
  545. }
  546. .detail-content {
  547. padding: 28rpx 29rpx 10rpx 29rpx;
  548. .post-sale {
  549. border-top: 1rpx solid #DCDCDC;
  550. padding-top: 38rpx
  551. }
  552. .d-row {
  553. display: flex;
  554. margin-bottom: 32rpx;
  555. .d-label {
  556. font-size: 26rpx;
  557. //width: 135rpx;
  558. color: #999999;
  559. text-align: right;
  560. }
  561. .d-value {
  562. font-size: 26rpx;
  563. color: #333333;
  564. flex: 1;
  565. overflow: hidden;
  566. }
  567. }
  568. .btn-view {
  569. .btn-status {
  570. display: flex;
  571. justify-content: flex-end;
  572. padding: 20rpx 0;
  573. border-top: 1rpx solid #DCDCDC;
  574. }
  575. .space {
  576. margin-right: 19rpx
  577. }
  578. .btn {
  579. border: 1px solid #DCDCDC;
  580. border-radius: 30rpx;
  581. color: #333333;
  582. font-size: 26rpx;
  583. height: 61rpx;
  584. width: 141rpx;
  585. display: flex;
  586. justify-content: center;
  587. align-items: center;
  588. font-size: 26rpx;
  589. }
  590. .btn-green {
  591. border: 1px solid #00B38B;
  592. border-radius: 30rpx;
  593. color: #00B38B;
  594. height: 61rpx;
  595. width: 141rpx;
  596. display: flex;
  597. justify-content: center;
  598. align-items: center;
  599. font-size: 26rpx;
  600. }
  601. .width-num-1 {
  602. width: 115rpx;
  603. }
  604. .width-num-2 {
  605. width: 221rpx;
  606. }
  607. .width-num-3 {
  608. width: 201rpx;
  609. }
  610. }
  611. }
  612. }
  613. .text-orange {
  614. color: #FF8000 !important;
  615. }
  616. .text-green {
  617. color: #00B38B !important;
  618. }
  619. </style>