您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

order-details-new.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  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?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?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?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?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?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?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?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?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?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 && 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 || state.orderInfo.appraise=='false'">去评价</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: {
  396. orderInfoExt: {}
  397. } as any, //订单信息
  398. showActiveOrder: false, //激活弹窗
  399. });
  400. //按钮跳转业务逻辑
  401. const {gotoEditAddress,gotoCancelOrder,gotoEditUserOrUnitInfo,
  402. gotoConfirmReceipt,gotoCheckLogistics,gotoEvaluateOrder,
  403. gotoActiveOrder,gotoReturnOrder,gotoExchangeOrder,gotoPay} = useOrderSkip();
  404. //获取订单详情
  405. const getOrderDetails = (id,appraise) => {
  406. const options = {
  407. type: 2,
  408. data: {"id": id},
  409. method: 'POST',
  410. showLoading: true,
  411. }
  412. request(orderDetail, options).then((res) => {
  413. state.orderInfo = stringToJson(res.bizContent);
  414. state.orderInfo.appraise = appraise;
  415. console.log("state.orderInfo",state.orderInfo)
  416. //测试
  417. // state.orderInfo.orderStep = OrderStatus.待激活;
  418. })
  419. }
  420. //修改订单收货地址
  421. const requestEditOrderAddr = (addr) =>{
  422. const options = {
  423. type: 2,data: {
  424. "id": state.orderInfo.id,
  425. 'consignee': addr.consignee,
  426. 'consigneeTel': addr.consigneeTel,
  427. 'region' : addr.region,
  428. 'address': addr.address,
  429. 'postalCode': addr.postalCode},
  430. method: 'POST',
  431. showLoading: true,
  432. }
  433. request(editOrderAddr,options).then((res)=>{
  434. state.orderInfo.orderInfoExt.id = addr.id,
  435. state.orderInfo.orderInfoExt.consignee = addr.consignee;
  436. state.orderInfo.orderInfoExt.consigneeTel = addr.consigneeTel;
  437. state.orderInfo.orderInfoExt.region = addr.region;
  438. state.orderInfo.orderInfoExt.address = addr.address;
  439. state.orderInfo.orderInfoExt.postalCode = addr.postalCode;
  440. msg('收货地址修改成功');
  441. })
  442. }
  443. //激活订单
  444. const toActiveOrder = () => {
  445. gotoActiveOrder(state.orderInfo);
  446. state.showActiveOrder = false;
  447. }
  448. //是否有售后信息
  449. const isHaveAfterSaleInfo = () =>{
  450. if(isBlank(state.orderInfo.orderInfoExt ?state.orderInfo.orderInfoExt.returnMode: null) && isBlank(state.orderInfo.orderInfoExt ?state.orderInfo.orderInfoExt.exchangeMode: null)){
  451. return false;
  452. }
  453. return true;
  454. }
  455. onLoad((options) => {
  456. //刷新订单信息
  457. uni.$on('refreshOrder', (data) => {
  458. getOrderDetails(options.id,state.orderInfo.appraise);
  459. });
  460. //修改收货地址
  461. uni.$on('selectAddressSuccess',(addr) => {
  462. requestEditOrderAddr(addr);
  463. });
  464. getOrderDetails(options.id,options.appraise);
  465. })
  466. onUnload(()=>{
  467. uni.$off('refreshOrder');
  468. uni.$off('selectAddressSuccess');
  469. console.log("已评价")
  470. })
  471. </script>
  472. <style>
  473. page {
  474. background: #EEF7F7;
  475. padding-bottom: 30rpx;
  476. }
  477. :deep(.u-mode-center-box){
  478. border-radius: 20rpx;
  479. }
  480. </style>
  481. <style lang="scss" scoped>
  482. .address-box {
  483. background: #FFFFFF;
  484. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  485. border-radius: 20rpx;
  486. margin: 30rpx 30rpx 0rpx;
  487. padding: 30rpx;
  488. .avatar {
  489. background: rgba(0, 179, 139, 0.2);
  490. border-radius: 50%;
  491. color: #00B38B;
  492. font-size: 26rpx;
  493. width: 80rpx;
  494. height: 80rpx;
  495. }
  496. .center {
  497. margin-left: 20rpx;
  498. margin-right: 20rpx;
  499. display: flex;
  500. flex-direction: column;
  501. justify-content: center;
  502. .name {
  503. font-size: 30rpx;
  504. font-family: Microsoft YaHei;
  505. font-weight: 400;
  506. color: #333333;
  507. }
  508. .phone {
  509. font-size: 24rpx;
  510. font-family: Microsoft YaHei;
  511. font-weight: 400;
  512. color: #999999;
  513. margin-left: 20rpx;
  514. }
  515. .addr {
  516. margin-top: 18rpx;
  517. font-size: 26rpx;
  518. font-family: Microsoft YaHei;
  519. font-weight: 400;
  520. color: #333333;
  521. line-height: 36rpx;
  522. }
  523. }
  524. .edit {
  525. width: 60rpx;
  526. height: 55rpx;
  527. }
  528. }
  529. .detail-box {
  530. background: #FFFFFF;
  531. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  532. border-radius: 20rpx;
  533. margin: 30rpx;
  534. .detail-header {
  535. display: flex;
  536. border-bottom: 1rpx solid #DCDCDC;
  537. padding: 30rpx;
  538. align-items: center;
  539. .d-img {
  540. width: 48rpx;
  541. height: 48rpx;
  542. }
  543. .detail-name {
  544. font-size: 30rpx;
  545. font-weight: 400;
  546. color: #333333;
  547. margin-left: 12rpx;
  548. }
  549. }
  550. .detail-content {
  551. padding: 28rpx 29rpx 10rpx 29rpx;
  552. .post-sale {
  553. border-top: 1rpx solid #DCDCDC;
  554. padding-top: 38rpx
  555. }
  556. .d-row {
  557. display: flex;
  558. margin-bottom: 32rpx;
  559. .d-label {
  560. font-size: 26rpx;
  561. //width: 135rpx;
  562. color: #999999;
  563. text-align: right;
  564. }
  565. .d-value {
  566. font-size: 26rpx;
  567. color: #333333;
  568. flex: 1;
  569. overflow: hidden;
  570. }
  571. }
  572. .btn-view {
  573. .btn-status {
  574. display: flex;
  575. justify-content: flex-end;
  576. padding: 20rpx 0;
  577. border-top: 1rpx solid #DCDCDC;
  578. }
  579. .space {
  580. margin-right: 19rpx
  581. }
  582. .btn {
  583. border: 1px solid #DCDCDC;
  584. border-radius: 30rpx;
  585. color: #333333;
  586. font-size: 26rpx;
  587. height: 61rpx;
  588. width: 141rpx;
  589. display: flex;
  590. justify-content: center;
  591. align-items: center;
  592. font-size: 26rpx;
  593. }
  594. .btn-green {
  595. border: 1px solid #00B38B;
  596. border-radius: 30rpx;
  597. color: #00B38B;
  598. height: 61rpx;
  599. width: 141rpx;
  600. display: flex;
  601. justify-content: center;
  602. align-items: center;
  603. font-size: 26rpx;
  604. }
  605. .width-num-1 {
  606. width: 115rpx;
  607. }
  608. .width-num-2 {
  609. width: 221rpx;
  610. }
  611. .width-num-3 {
  612. width: 201rpx;
  613. }
  614. }
  615. }
  616. }
  617. .text-orange {
  618. color: #FF8000 !important;
  619. }
  620. .text-green {
  621. color: #00B38B !important;
  622. }
  623. </style>