orderDetails.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. <template>
  2. <view class="container">
  3. <view class="top-state u-font24 u-00321E">
  4. <!--待付款-->
  5. <view
  6. class="obligation"
  7. v-if="
  8. orderInfo.transactionStatus == 0 || orderInfo.transactionStatus == 100
  9. "
  10. >
  11. <view class="u-flex-center u-flex1">
  12. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  13. <view class="u-flex1">
  14. <view class="u-font32 u-bold" style="margin-bottom: 10rpx">
  15. {{ orderInfo.transactionStatus == 0 ? "待付款" : "订单已关闭" }}
  16. </view>
  17. <view
  18. class="u-flex u-font26"
  19. v-if="orderInfo.transactionStatus == 0"
  20. >
  21. 请在
  22. <uv-count-down
  23. v-if="timeDataNum"
  24. :time="timeDataNum"
  25. format="DD:HH:mm:ss"
  26. autoStart
  27. millisecond
  28. @change="onTimeChange"
  29. >
  30. <view>
  31. <text class="time__item" v-if="timeData.days"
  32. >{{ timeData.days }}&nbsp;天</text
  33. >
  34. <text class="time__item" v-if="timeData.hours"
  35. >{{
  36. timeData.hours > 10
  37. ? timeData.hours
  38. : "0" + timeData.hours
  39. }}&nbsp;时</text
  40. >
  41. <text class="time__item"
  42. >{{ timeData.minutes || "00" }}&nbsp;分</text
  43. >
  44. <text class="time__item"
  45. >{{ timeData.seconds || "00" }}&nbsp;秒</text
  46. >
  47. </view>
  48. </uv-count-down>
  49. 内完成支付,超时订单将自动关闭
  50. </view>
  51. <view
  52. class="u-flex u-font26"
  53. v-if="orderInfo.cancellationMethod == 10"
  54. >原因:主动取消</view
  55. >
  56. <view
  57. class="u-flex u-font26"
  58. v-if="orderInfo.cancellationMethod == 20"
  59. >原因:商家撤销关闭</view
  60. >
  61. <view
  62. class="u-flex u-font26"
  63. v-if="orderInfo.cancellationMethod == 30"
  64. >原因:支付过期关闭</view
  65. >
  66. <view
  67. class="u-flex u-font26"
  68. v-if="orderInfo.cancellationMethod == 50"
  69. >原因:支付异常</view
  70. >
  71. <view
  72. class="u-flex u-font26"
  73. v-if="orderInfo.cancellationMethod == 60"
  74. >原因:自提过期</view
  75. >
  76. </view>
  77. </view>
  78. </view>
  79. <template v-if="orderInfo.rightsStatus == 0">
  80. <!--等待商家发货-->
  81. <view
  82. class="refund-underway obligation"
  83. v-if="orderInfo.transactionStatus == 10"
  84. >
  85. <view class="u-flex-center u-flex1">
  86. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  87. <view class="u-flex1">
  88. <view class="u-font32 u-bold">待发货</view>
  89. <view class="u-flex u-font26"
  90. >您的订单已经支付完成,正在等待发货</view
  91. >
  92. </view>
  93. </view>
  94. </view>
  95. <!--商家已发货-->
  96. <view
  97. class="refund-underway obligation"
  98. v-if="
  99. orderInfo.transactionStatus == 20 &&
  100. orderInfo.rightsStatus == 0 &&
  101. orderInfo.shippingMethod == 0
  102. "
  103. >
  104. <view class="u-flex-center u-flex1">
  105. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  106. <view class="u-flex1">
  107. <view class="u-font32 u-bold">待收货</view>
  108. <view class="u-flex u-font26">
  109. 您的快递待收货
  110. <text v-if="orderInfo.receiptExpireTime"
  111. >,还剩{{
  112. $mUtil.patTime(orderInfo.receiptExpireTime)
  113. }}自动确认</text
  114. >
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <!--等待确认提货-->
  120. <view
  121. class="refund-underway obligation"
  122. v-if="
  123. orderInfo.transactionStatus == 20 && orderInfo.shippingMethod == 10
  124. "
  125. >
  126. <view class="u-flex-center u-flex1">
  127. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  128. <view class="u-flex1">
  129. <view class="u-font32 u-bold">待提货</view>
  130. <view class="u-flex u-font26">
  131. 您的商品可自提
  132. <text v-if="orderInfo.receiptExpireTime > 0"
  133. >,还剩{{
  134. $mUtil.patTime(orderInfo.receiptExpireTime)
  135. }}过期</text
  136. >
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <!--交易成功-->
  142. <view class="refund-underway" v-if="orderInfo.transactionStatus == 30">
  143. <view class="u-font28">交易成功</view>
  144. </view>
  145. <view
  146. class="obligation"
  147. v-if="orderInfo.transactionStatus == 30 && !orderInfo.end"
  148. >
  149. <view class="u-flex-center u-flex1">
  150. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  151. <view class="u-flex1">
  152. <view class="u-font32 u-bold">待评价</view>
  153. <view class="u-flex u-font26"
  154. >您的订单已签收,请评价一下商品
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <!--待评价-->
  160. <view
  161. class="refund-underway obligation"
  162. v-if="orderInfo.transactionStatus == 30 && orderInfo.end"
  163. >
  164. <view class="u-flex-center u-flex1">
  165. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  166. <view class="u-flex1">
  167. <view class="u-font32 u-bold">已完成</view>
  168. <view class="u-flex u-font26">您的订单已完成,祝你购物愉快</view>
  169. </view>
  170. </view>
  171. </view>
  172. </template>
  173. <view
  174. class="refund-underway obligation"
  175. v-if="orderInfo.rightsStatus == 5 && orderInfo.rightsMethod == 5"
  176. >
  177. <view class="u-flex-center u-flex1">
  178. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  179. <view class="u-flex1">
  180. <view class="u-font32 u-bold">退款中</view>
  181. <view class="u-flex u-font26">您的订单在退款中</view>
  182. </view>
  183. </view>
  184. </view>
  185. <view
  186. class="refund-underway obligation"
  187. v-if="orderInfo.rightsStatus == 10 && orderInfo.rightsMethod == 10"
  188. >
  189. <view class="u-flex-center u-flex1">
  190. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  191. <view class="u-flex1">
  192. <view class="u-font32 u-bold">退款完成</view>
  193. <view class="u-flex u-font22"
  194. >您的订单已完成退款,祝您生活愉快</view
  195. >
  196. </view>
  197. </view>
  198. </view>
  199. <view
  200. class="refund-underway obligation"
  201. v-if="orderInfo.rightsStatus == 5 && orderInfo.rightsMethod == 5"
  202. >
  203. <view class="u-flex-center u-flex1">
  204. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  205. <view class="u-flex1">
  206. <view class="u-font32 u-bold">退款退货维权中</view>
  207. <view class="u-flex u-font26">您的订单在退款退货维权中</view>
  208. </view>
  209. </view>
  210. </view>
  211. <view
  212. class="refund-underway obligation"
  213. v-if="orderInfo.rightsStatus == 10 && orderInfo.rightsMethod == 10"
  214. >
  215. <view class="u-flex-center u-flex1">
  216. <image class="timeImg" :src="$handleImageUrl('/time.png')"></image>
  217. <view class="u-flex1">
  218. <view class="u-font32 u-bold">退款退货完成</view>
  219. <view class="u-flex u-font26"
  220. >您的订单已完成退款退货完成,祝您生活愉快</view
  221. >
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. <!-- 自提信息 -->
  227. <template v-if="orderInfo.shippingMethod == 10">
  228. <view v-if="orderInfo.orderSelfPickup.orderSelfPickupAddressId">
  229. <ldAddresszt
  230. :value="orderInfo.orderSelfPickup"
  231. :link="false"
  232. ></ldAddresszt>
  233. </view>
  234. <view v-if="orderInfo.orderPackages">
  235. <OrderPickUp
  236. v-for="v in orderInfo.orderPackages || []"
  237. :key="v.packageId"
  238. :item="v"
  239. />
  240. <!-- <view
  241. class="u-flex-column-center u-bg-fff"
  242. v-for="v in orderInfo.orderPackages || []"
  243. :key="v.packageId"
  244. >
  245. <text class="u-font22 u-999 u-mt15">出示数字码向店长核销</text>
  246. <view class="u-flex-center u-mt15">
  247. <text class="u-font40 u-333 u-bold">{{
  248. v.packagePickupVo.verificationCode || ""
  249. }}</text>
  250. <text
  251. class="u-font28 u-666 u-ml20"
  252. @click="copy(v.packagePickupVo.verificationCode || '')"
  253. >复制</text
  254. >
  255. </view>
  256. </view> -->
  257. </view>
  258. </template>
  259. <!-- 包裹选项卡 -->
  260. <view
  261. class="packAge"
  262. v-if="packAgeList.length > 0 && orderInfo.shippingMethod == 0"
  263. >
  264. <scroll-view scroll-X="true" class="packAge-scoll">
  265. <view
  266. class="every"
  267. v-for="(item, index) in packAgeList"
  268. :key="index"
  269. @click="toPackAgeDetail(item, index)"
  270. >
  271. 包裹{{ index + 1 }}
  272. </view>
  273. </scroll-view>
  274. </view>
  275. <view class="pabox" v-if="orderGoodsList.length > 0">
  276. <view class="u-font28 u-flex-center-sb shop-info">
  277. <view class="name u-flex-center">
  278. <view>
  279. {{ orderInfo.businessName }}
  280. </view>
  281. <text class="iconfont">&#xe671;</text>
  282. </view>
  283. <view
  284. class="service"
  285. @click.stop="MakePhoneCall(orderInfo.customerServicePhone)"
  286. >
  287. <text class="iconfont">&#xe605;</text>
  288. <text>联系客服</text>
  289. </view>
  290. </view>
  291. <view v-for="(item, index) in orderGoodsList" :key="item.id">
  292. <ld-goods
  293. :value="item"
  294. :keys="index"
  295. :exchange="orderInfo.exchange"
  296. :item="orderInfo"
  297. @parentevaluation="parentevaluation"
  298. >
  299. </ld-goods>
  300. </view>
  301. <view class="u-font28 u-1A1A1A u-mt30 bg-fff">
  302. <view class="u-flex-center-sb u-border-one pt-pb25">
  303. <view>运费</view>
  304. <view class="u-999 u-font30" v-if="orderInfo.shippingFee != 0"
  305. >+{{ orderInfo.shippingFee }}元</view
  306. >
  307. <view class="u-999 u-font30" v-else>免运费</view>
  308. </view>
  309. <!-- 使用优惠卷情况 -->
  310. <template
  311. v-if="
  312. orderInfo.orderUseCoupons && orderInfo.orderUseCoupons.length > 0
  313. "
  314. >
  315. <view
  316. class="u-flex-center-sb u-border-one pt-pb25"
  317. v-for="(v, i) in orderInfo.orderUseCoupons"
  318. :key="i"
  319. >
  320. <view>
  321. 优惠卷:{{ v.businessCouponName }}
  322. <text class="u-999 u-font24"></text>
  323. </view>
  324. <view class="u-999 u-font30"
  325. >-¥ {{ v.businessCouponFaceValue }}</view
  326. >
  327. </view>
  328. </template>
  329. <view class="u-flex-center pt-pb25" style="justify-content: flex-end">
  330. <view class="">共{{ orderInfo.productNumber }}件商品</view>
  331. <view style="display: flex; align-items: center">
  332. <view class="u-bold u-FF0000" v-if="orderInfo.exchange"
  333. >{{ orderInfo.paymentPoints }}积分</view
  334. >
  335. <view class="u-bold u-FF0000" v-else
  336. >¥ {{ orderInfo.totalRealPrice }}</view
  337. >
  338. </view>
  339. </view>
  340. <view class="u-flex-column-start pt-pb25">
  341. <view>购买备注</view>
  342. <view class="boxTextarea">{{
  343. orderInfo.buyerRemark ? orderInfo.buyerRemark : "无"
  344. }}</view>
  345. </view>
  346. </view>
  347. </view>
  348. <view class="upb120">
  349. <view class="u-font28 u-1A1A1A u-mt10 bg-fff">
  350. <view class="u-flex-center-sb u-border-one u-plr30 pt-pb25">
  351. <view>积分抵扣</view>
  352. <view class="u-999">-¥{{ orderInfo.pointReduced || 0 }}</view>
  353. </view>
  354. <view class="u-flex-center-sb u-border-one u-plr30 pt-pb25">
  355. <view>总优惠</view>
  356. <view v-if="orderInfo.totalReduced" class="u-999"
  357. >-¥{{ orderInfo.totalReduced }}</view
  358. >
  359. <view v-else class="u-999">无优惠</view>
  360. </view>
  361. <view class="u-flex-center-sb u-plr30 pt-pb25">
  362. <view>支付金额</view>
  363. <view class="u-FF0000 u-font32 u-bold">
  364. <text v-if="orderInfo.exchange"
  365. >{{ orderInfo.paymentPoints }}积分</text
  366. >
  367. <rich-text
  368. v-else
  369. :nodes="$mUtil.priceBigSmall(orderInfo.actualPayment || 0)"
  370. ></rich-text>
  371. </view>
  372. </view>
  373. </view>
  374. <view class="u-font28 u-1A1A1A u-mt10 bg-fff">
  375. <view class="u-flex-center-sb u-plr30 pt-pb25">
  376. <view>订单编号</view>
  377. <view class="u-999 u-font3">{{ orderInfo.orderNo }}</view>
  378. </view>
  379. <view class="u-flex-center-sb u-plr30 pt-pb25">
  380. <view>下单时间</view>
  381. <view class="u-999">{{ orderInfo.orderTime }}</view>
  382. </view>
  383. <view
  384. class="u-flex-center-sb u-plr30 pt-pb25"
  385. v-if="orderInfo.transactionStatus != 0 && orderInfo.paymentTime"
  386. >
  387. <view>支付时间</view>
  388. <view class="u-999">{{ orderInfo.paymentTime }}</view>
  389. </view>
  390. <view
  391. class="u-flex-center-sb u-plr30 pt-pb25"
  392. v-if="orderInfo.transactionStatus != 0"
  393. >
  394. <view>支付方式</view>
  395. <view class="u-999" v-if="orderInfo.paymentMethod == 0">余额</view>
  396. <view class="u-999" v-if="orderInfo.paymentMethod == 1">微信</view>
  397. <view class="u-999" v-if="orderInfo.paymentMethod == 2">支付宝</view>
  398. <view class="u-999" v-if="orderInfo.paymentMethod == 3"
  399. >积分兑换</view
  400. >
  401. </view>
  402. <view
  403. class="u-flex-center-sb u-plr30 pt-pb25"
  404. v-if="orderInfo.transactionStatus >= 20"
  405. >
  406. <view>配送方式</view>
  407. <view class="u-999">{{
  408. shipmentModeList[orderInfo.shippingMethod]
  409. }}</view>
  410. </view>
  411. <view
  412. class="u-flex-center-sb u-plr30 pt-pb25"
  413. v-if="orderInfo.transactionStatus >= 20"
  414. >
  415. <view>发货时间</view>
  416. <view class="u-999">{{ orderInfo.shippingTime || "--" }}</view>
  417. </view>
  418. <view
  419. class="u-flex-center-sb u-plr30 pt-pb25"
  420. v-if="orderInfo.transactionStatus >= 30"
  421. >
  422. <view>收货时间</view>
  423. <view class="u-999">{{ orderInfo.actualReceivingTime || "--" }}</view>
  424. </view>
  425. </view>
  426. </view>
  427. <!--待付款-->
  428. <view
  429. class="bg-fff u-mt30 btn u-flex"
  430. v-if="
  431. orderInfo.transactionStatus == 0 &&
  432. orderInfo.paymentStatus == 0 &&
  433. !orderInfo.end &&
  434. orderInfo.effective
  435. "
  436. >
  437. <view class="cancel-btn" @click="cancelOrder">取消订单</view>
  438. <button class="pay-btn" @click="goPay()">去付款</button>
  439. </view>
  440. <template v-else>
  441. <view class="bg-fff u-mt30 u-plr30 ptb22 btn u-flex-column-end">
  442. <view class="u-flex-center u-mr25">
  443. <button
  444. class="u-order-btn u-br-999 u-999"
  445. @click="goRefundType(2)"
  446. v-if="
  447. orderInfo.rightsStatus != 10 &&
  448. orderInfo.effective &&
  449. orderInfo.transactionStatus != 100 &&
  450. orderInfo.transactionStatus != 10 &&
  451. orderInfo.rightsMethod == 0
  452. "
  453. >
  454. 申请售后
  455. </button>
  456. <!--等待商家发货-->
  457. <template
  458. v-if="
  459. orderInfo.transactionStatus == 10 &&
  460. !orderInfo.end &&
  461. orderInfo.rightsStatus != 10 &&
  462. orderInfo.rightsMethod == 0
  463. "
  464. >
  465. <button
  466. class="u-order-btn u-br-999 u-999"
  467. v-if="orderInfo.effective"
  468. @click="goRefundType(1)"
  469. >
  470. 申请售后
  471. </button>
  472. <!-- <button
  473. class="u-order-btn u-br-f00 u-FF0000"
  474. v-if="orderInfo.shippingMethod == 0"
  475. @click="changeAddress"
  476. >
  477. 修改地址
  478. </button> -->
  479. </template>
  480. <!--商家已发货-->
  481. <template v-if="orderInfo.transactionStatus == 20 && !orderInfo.end && orderInfo.shippingMethod != 10">
  482. <button class="u-order-btn u-br-999 u-999" @click="goLogistics">
  483. 查看物流
  484. </button>
  485. <button
  486. v-if="
  487. orderInfo.receivingStatus != 20 &&
  488. orderInfo.rightsMethod == 0 &&
  489. orderInfo.shippingStatus == 20 &&
  490. orderInfo.rightsMethod == 0
  491. "
  492. class="u-order-btn u-br-f00 u-FF0000 u-mr25"
  493. @click="sureGetOrder"
  494. >
  495. 确认收货
  496. </button>
  497. </template>
  498. </view>
  499. </view>
  500. </template>
  501. <!--弹窗评价-->
  502. <uv-popup mode="bottom" ref="uniPopupRef" round="20rpx" z-index="9999">
  503. <view class="popup">
  504. <view class="u-flex-sb u-plr30">
  505. <view class="u-flex">
  506. <image class="pic" :src="choseGoods.productCover"></image>
  507. <view class="u-ml30 wt378">
  508. <view class="u-1A1A1A u-font28">{{
  509. choseGoods.productTitle
  510. }}</view>
  511. <view class="u-999 u-font22 u-mt10" v-if="choseGoods.skuSetName">
  512. 规格:{{ choseGoods.skuSetName }}</view
  513. >
  514. <view class="u-mt10 u-flex-center">
  515. <view class="u-FF0000 u-font32">
  516. <rich-text
  517. :nodes="
  518. $mUtil.priceBigSmall(choseGoods.singlePaymentAmount)
  519. "
  520. ></rich-text>
  521. </view>
  522. <text class="u-ml10 u-999 u-font24"
  523. >x {{ choseGoods.productNum }}</text
  524. >
  525. </view>
  526. </view>
  527. </view>
  528. <view @click.stop="handleClose">
  529. <uv-icon name="close-circle" color="#999999" size="40rpx"></uv-icon>
  530. </view>
  531. </view>
  532. <view class="u-bg-fff u-plr30 u-mt5">
  533. <view class="pt-pb25 u-font28 u-flex-center">
  534. <text>总体评价:</text>
  535. <view>
  536. <text
  537. v-for="(item, index) in 5"
  538. :key="index"
  539. @click="startNum(index)"
  540. class="iconfont u-font34 u-mr5"
  541. :class="gradeNum >= item ? 'grade-active' : 'u-B3B3B3'"
  542. >
  543. &#xe732;
  544. </text>
  545. </view>
  546. </view>
  547. <view class="u-font26">
  548. <textarea
  549. class="u-font26"
  550. v-model="textareaVal"
  551. placeholder="请输入文字评价"
  552. placeholder-class="cccfont"
  553. ></textarea>
  554. </view>
  555. <view class="u-mt25 u-font30">添加图片</view>
  556. <view class="u-mt25">
  557. <uploadImg :imgCount="6" :imgArr="imgArray" @result="resultUrl">
  558. </uploadImg>
  559. </view>
  560. <view class="evaluate-submit"
  561. ><button class="u-btn-two" @click="submitCom()">
  562. 确认提交
  563. </button></view
  564. >
  565. </view>
  566. </view>
  567. </uv-popup>
  568. </view>
  569. </template>
  570. <script setup>
  571. import { ref, onMounted, getCurrentInstance } from "vue";
  572. import { onLoad } from "@dcloudio/uni-app";
  573. import $mUtil from "@/util/index.js";
  574. import {
  575. shoporderInfo_Api,
  576. shopOrderList_Api,
  577. receiptOrder_Api,
  578. shoporderCancel_Api,
  579. } from "@/api/order.js";
  580. import { shopOrderCommentAdd_Api } from "@/api/shop.js";
  581. import ldAddresszt from "@/components/ldAddress/ldAddresszt.vue";
  582. import OrderPickUp from "./components/OrderPickUp.vue";
  583. import { MakePhoneCall } from "@/util/tools.ts";
  584. //配送方式
  585. const shipmentModeList = ref({
  586. 0: "物流",
  587. 10: "自提",
  588. });
  589. // 包裹列表
  590. const packAgeList = ref([]);
  591. const orderInfo = ref({}); // 订单详情
  592. const orderGoodsList = ref([]); // 订单列表
  593. const choseGoods = ref({}); // 选择的商品
  594. const gradeNum = ref(0); // 评价星级
  595. const textareaVal = ref(""); // 评价内容
  596. const imgArray = ref([]); // 评价图片数组
  597. // 组件引用
  598. const uniPopupRef = ref(null);
  599. const timeData = ref({}); // 倒计时
  600. const timeDataNum = ref(0);
  601. const eventChannel = ref(null);
  602. onMounted(() => {
  603. const instance = getCurrentInstance().proxy;
  604. eventChannel.value = instance.getOpenerEventChannel();
  605. });
  606. // 页面加载
  607. onLoad((options) => {
  608. // console.log(options);
  609. if (options.orderId) {
  610. orderDetail(options.orderId);
  611. }
  612. });
  613. const onTimeChange = (e) => {
  614. timeData.value = e;
  615. };
  616. // 复制
  617. const copy = (code) => {
  618. uni.setClipboardData({
  619. data: code,
  620. success: () => {
  621. uni.showToast({
  622. title: "复制成功",
  623. });
  624. },
  625. });
  626. };
  627. // 更新订单
  628. const updateOrder = () => {
  629. try {
  630. eventChannel.value.emit("handleReset");
  631. } catch (error) {}
  632. orderDetail(orderInfo.value.orderId);
  633. };
  634. // 确认收货
  635. const sureGetOrder = () => {
  636. uni.showModal({
  637. title: "是否确认收货?",
  638. content: "确认收货后,将无法撤销",
  639. success: (res) => {
  640. if (res.confirm) {
  641. console.log("用户点击确定");
  642. uni.showLoading({
  643. title: "加载中",
  644. mask: true,
  645. });
  646. receiptOrder_Api({ orderId: orderInfo.value.orderId })
  647. .then((res) => {
  648. uni.hideLoading();
  649. if (res && res.code == 200) {
  650. uni.showToast({
  651. title: "确认收货成功",
  652. icon: "success",
  653. });
  654. setTimeout(() => {
  655. updateOrder();
  656. }, 500);
  657. }
  658. })
  659. .catch((err) => {
  660. // uni.hideLoading();
  661. });
  662. } else if (res.cancel) {
  663. console.log("用户点击取消");
  664. }
  665. },
  666. });
  667. };
  668. // 评价
  669. const parentevaluation = (data) => {
  670. // console.log(data);
  671. choseGoods.value = orderGoodsList.value[data.keys];
  672. uniPopupRef.value.open();
  673. };
  674. const startNum = (index) => {
  675. gradeNum.value = index * 1 + 1;
  676. };
  677. const resultUrl = (e) => {
  678. if (e) {
  679. imgArray.value = e;
  680. }
  681. };
  682. // 关闭弹窗
  683. const handleClose = () => {
  684. uniPopupRef.value.close();
  685. gradeNum.value = 0;
  686. textareaVal.value = "";
  687. imgArray.value = [];
  688. choseGoods.value = [];
  689. };
  690. // 确认评价
  691. const submitCom = () => {
  692. if (gradeNum.value == 0) {
  693. return uni.$uv.toast("请评价星星");
  694. }
  695. if (textareaVal.value == "") {
  696. return uni.$uv.toast("请输入文字评价");
  697. }
  698. let objs = {
  699. orderId: orderInfo.value.orderId,
  700. productId: choseGoods.value.productId,
  701. commentScore: gradeNum.value,
  702. comment: textareaVal.value,
  703. commentImages: imgArray.value,
  704. shopOrderDetailId: choseGoods.value.orderDetailId,
  705. };
  706. uni.showLoading({
  707. title: "提交中",
  708. mask: true,
  709. });
  710. shopOrderCommentAdd_Api(objs)
  711. .then((res) => {
  712. uni.hideLoading();
  713. if (res && res.code == 200) {
  714. uni.$uv.toast("评论成功");
  715. handleClose();
  716. setTimeout(() => {
  717. updateOrder();
  718. }, 500);
  719. }
  720. })
  721. .catch((err) => {
  722. // uni.hideLoading();
  723. });
  724. };
  725. // 修改地址
  726. const changeAddress = () => {
  727. uni.navigateTo({
  728. url: "/pages/user/address/addressList",
  729. });
  730. };
  731. // 取消订单
  732. const cancelOrder = () => {
  733. uni.showModal({
  734. title: "提示",
  735. content: "确定取消该订单吗?",
  736. success: (res) => {
  737. if (res.confirm) {
  738. shoporderCancel_Api({
  739. orderId: orderInfo.value.orderId,
  740. cancellationMethod: 10,
  741. }).then((res) => {
  742. if (res && res.code == 200) {
  743. uni.$uv.toast("取消成功");
  744. setTimeout(() => {
  745. try {
  746. eventChannel.value.emit("handleReset");
  747. } catch (error) {}
  748. uni.navigateBack();
  749. }, 1000);
  750. }
  751. });
  752. } else if (res.cancel) {
  753. }
  754. },
  755. });
  756. };
  757. // 订单详情
  758. const orderDetail = (orderId) => {
  759. if (!orderId) return;
  760. uni.showLoading({
  761. title: "加载中...",
  762. mask: true,
  763. });
  764. shoporderInfo_Api(orderId)
  765. .then((res) => {
  766. uni.hideLoading();
  767. if (res && res.code == 200) {
  768. let target = res.data || {};
  769. orderInfo.value = target;
  770. orderGoodsList.value = target.orderDetails || [];
  771. if (target.transactionStatus == 0 && target.cancellationMethod == 0) {
  772. let expiredTime = new Date(res.data.expiredTime).getTime();
  773. timeDataNum.value = expiredTime - new Date().getTime();
  774. }
  775. getPackAge(target.orderId);
  776. }
  777. })
  778. .catch((err) => {
  779. // uni.hideLoading();
  780. setTimeout(() => {
  781. uni.navigateBack();
  782. }, 500);
  783. });
  784. };
  785. // 包裹信息
  786. const getPackAge = (orderId) => {
  787. shopOrderList_Api(orderId).then((res) => {
  788. if (res.code === 200) {
  789. packAgeList.value = res.data;
  790. }
  791. });
  792. };
  793. // 跳转到包裹详情
  794. const toPackAgeDetail = (item, index) => {
  795. uni.navigateTo({
  796. url: `/pages/order/logisticsNew?id=${item.orderId}&index=${index}`,
  797. });
  798. };
  799. // 支付页
  800. const goPay = () => {
  801. let expiredTime = new Date(orderInfo.value.expiredTime).getTime();
  802. let expiredNum = expiredTime - new Date().getTime();
  803. // console.log(expiredNum);
  804. // console.log(expiredTime);
  805. if (expiredNum <= 0) {
  806. uni.$uv.toast("订单已过期,请重新下单");
  807. setTimeout(() => {
  808. updateOrder();
  809. }, 500);
  810. return;
  811. }
  812. let url = `/pages/order/pay?orderNo=${orderInfo.value.orderNo}&total_amount=${
  813. orderInfo.value.actualPayment || ""
  814. }&expired_pay_time=${expiredTime}&orderId=${
  815. orderInfo.value.orderId
  816. }&pagesType=1`;
  817. uni.navigateTo({
  818. url,
  819. events: {
  820. callback: function (data) {
  821. console.log(data);
  822. updateOrder();
  823. },
  824. },
  825. });
  826. };
  827. // 申请售后
  828. const goRefundType = (i) => {
  829. //i:1未发货,退款,2收到货退款/退货
  830. uni.setStorageSync("blackgoodsList", orderGoodsList.value);
  831. if (orderInfo.value.shippingStatus == 0 || orderInfo.value.shippingMethod == 10) {
  832. uni.navigateTo({
  833. url: `/pages/order/applicationDrawback?orderId=${orderInfo.value.orderId}&keystatus=1`,
  834. });
  835. } else {
  836. uni.navigateTo({
  837. url: "/pages/order/refundType?orderId=" + orderInfo.value.orderId,
  838. });
  839. }
  840. };
  841. // 查看物流
  842. const goLogistics = () => {
  843. uni.navigateTo({
  844. url: "/pages/order/logisticsNew?id=" + orderInfo.value.orderId + "&index=0",
  845. });
  846. };
  847. </script>
  848. <style lang="scss">
  849. page {
  850. background-color: #f5f5f5;
  851. }
  852. .uni-countdown-class {
  853. height: 32rpx;
  854. ::v-deep .uni-countdown__splitor {
  855. padding: 0 4rpx;
  856. margin-top: -6rpx;
  857. }
  858. }
  859. .border {
  860. border-bottom: 3rpx solid #e7e7e7;
  861. }
  862. .cccfont {
  863. font-size: 26rpx;
  864. color: #eee;
  865. }
  866. .grade-active {
  867. color: #ffc336;
  868. }
  869. .u-B3B3B3 {
  870. color: #b3b3b3;
  871. }
  872. .user_remark {
  873. background-color: #fff;
  874. padding: 30rpx;
  875. border-top: 1px solid #eee;
  876. }
  877. .boxTextarea {
  878. width: 686rpx;
  879. border: 1px solid #ededed;
  880. border-radius: 20rpx;
  881. background-color: #fafafa;
  882. padding: 20rpx;
  883. box-sizing: border-box;
  884. margin-top: 20rpx;
  885. }
  886. .pabox {
  887. background-color: #fff;
  888. padding: 30rpx 30rpx 0;
  889. margin-top: 10rpx;
  890. .consumption_value {
  891. color: #ffffff;
  892. margin-right: 10rpx;
  893. }
  894. .consumption_value-icon {
  895. font-size: 60rpx;
  896. color: #ff9651;
  897. }
  898. .shop-info {
  899. .name {
  900. font-size: 36rpx;
  901. font-family: PingFang SC, PingFang SC-Bold;
  902. font-weight: 700;
  903. text-align: left;
  904. color: #1a1a1a;
  905. .iconfont {
  906. margin-left: 5rpx;
  907. flex-shrink: 0;
  908. }
  909. }
  910. .service {
  911. flex-shrink: 0;
  912. margin-left: 10rpx;
  913. .iconfont {
  914. margin-right: 10rpx;
  915. }
  916. }
  917. }
  918. }
  919. .upb120 {
  920. padding-bottom: 140rpx;
  921. }
  922. .bg-fff {
  923. background-color: #ffffff;
  924. }
  925. .ptb22 {
  926. padding-top: 22rpx;
  927. padding-bottom: 22rpx;
  928. }
  929. .pt-pb25 {
  930. padding-top: 25rpx;
  931. padding-bottom: 25rpx;
  932. }
  933. .pt28-pb24 {
  934. padding-top: 28rpx;
  935. padding-bottom: 24rpx;
  936. }
  937. .iconfont58 {
  938. font-size: 58rpx;
  939. }
  940. .mt44 {
  941. margin-top: 44rpx;
  942. }
  943. .ml38 {
  944. margin-left: 38rpx;
  945. }
  946. .ml82 {
  947. margin-left: 82rpx;
  948. }
  949. .wt378 {
  950. width: 378rpx;
  951. }
  952. .wt504 {
  953. width: 504rpx;
  954. }
  955. .u-br-999 {
  956. border: 1px solid #999999;
  957. }
  958. .u-br-f00 {
  959. border: 1px solid #ff0000;
  960. }
  961. .bg-00321e {
  962. background: #0b844a;
  963. }
  964. .account-paid {
  965. padding: 44rpx 0rpx;
  966. }
  967. .account-paid image {
  968. width: 202rpx;
  969. height: 124rpx;
  970. }
  971. .btn {
  972. width: 100%;
  973. position: fixed;
  974. bottom: 0rpx;
  975. padding: 22rpx 0rpx;
  976. }
  977. .cancel-btn {
  978. margin-left: auto;
  979. // background-color: #E7EEFC;
  980. // color: #ffffff;
  981. background: #ffffff;
  982. border: 1rpx solid #cccccc;
  983. }
  984. .cancel-btn,
  985. .pay-btn {
  986. box-sizing: border-box;
  987. width: 202rpx;
  988. height: 70rpx;
  989. line-height: 70rpx;
  990. border-radius: 35px;
  991. font-size: 28rpx;
  992. // margin-right: 30rpx;
  993. display: inline-block;
  994. text-align: center;
  995. }
  996. .pay-btn {
  997. background-color: #eb5153;
  998. color: #ffffff;
  999. }
  1000. .top-state {
  1001. background-color: #ffffff;
  1002. // color: #fff;
  1003. padding: 35rpx 30rpx;
  1004. // 待支付
  1005. .obligation {
  1006. display: flex;
  1007. justify-content: space-between;
  1008. .timeImg {
  1009. display: none;
  1010. width: 70rpx;
  1011. height: 54rpx;
  1012. margin-right: 40rpx;
  1013. }
  1014. }
  1015. }
  1016. .address {
  1017. background-color: #ffffff;
  1018. padding-top: 72rpx;
  1019. .linkman {
  1020. padding-bottom: 34rpx;
  1021. }
  1022. .remark {
  1023. padding: 35rpx 0rpx 35rpx 50rpx;
  1024. }
  1025. }
  1026. //弹窗填写物流信息
  1027. .logisticsPopup {
  1028. background-color: #ffffff;
  1029. width: 100%;
  1030. border-radius: 20rpx;
  1031. .pd {
  1032. padding: 15rpx 98rpx 68rpx;
  1033. }
  1034. input {
  1035. height: 70rpx;
  1036. line-height: 70rpx;
  1037. border: 1rpx solid #cccccc;
  1038. border-radius: 15rpx;
  1039. padding-left: 8rpx;
  1040. color: #999999;
  1041. }
  1042. .icon {
  1043. margin-top: -65rpx;
  1044. }
  1045. .pl-pr {
  1046. padding-left: 74rpx;
  1047. }
  1048. button {
  1049. margin-top: 66rpx;
  1050. background-color: #01331f;
  1051. width: 345rpx;
  1052. }
  1053. }
  1054. // 弹窗评价
  1055. .popup {
  1056. background-color: #f5f5f5;
  1057. width: 100%;
  1058. border-radius: 18rpx 18rpx 0px 0px;
  1059. }
  1060. .u-flex-sb {
  1061. display: flex;
  1062. justify-content: space-between;
  1063. padding-top: 30rpx;
  1064. padding-bottom: 30rpx;
  1065. background-color: #ffffff;
  1066. border-radius: 18rpx 18rpx 0px 0px;
  1067. .pic {
  1068. width: 155rpx;
  1069. height: 155rpx;
  1070. }
  1071. }
  1072. textarea {
  1073. width: 100%;
  1074. height: 210rpx;
  1075. opacity: 0.66;
  1076. border: 1rpx solid #e6e6e6;
  1077. border-radius: 8rpx;
  1078. padding-left: 22rpx;
  1079. padding-top: 14rpx;
  1080. box-sizing: border-box;
  1081. }
  1082. .evaluate-submit {
  1083. margin-top: 58rpx;
  1084. padding-bottom: 25rpx;
  1085. }
  1086. .evaluate-submit button {
  1087. height: 80rpx;
  1088. line-height: 80rpx;
  1089. // background-color: #ffffff;
  1090. // color: #ffffff;
  1091. }
  1092. // 包裹选项卡
  1093. .packAge {
  1094. width: 100%;
  1095. height: 100rpx;
  1096. margin-bottom: 10rpx;
  1097. padding-left: 30rpx;
  1098. line-height: 100rpx;
  1099. background-color: #fff;
  1100. .packAge-scoll {
  1101. width: 100%;
  1102. height: 100%;
  1103. white-space: nowrap;
  1104. }
  1105. .every {
  1106. display: inline-block;
  1107. width: 140rpx;
  1108. height: 80rpx;
  1109. margin-right: 20rpx;
  1110. line-height: 80rpx;
  1111. // padding-left: 20rpx;
  1112. border-radius: 10rpx;
  1113. border: 1rpx solid #3775f6;
  1114. text-align: center;
  1115. box-sizing: border-box;
  1116. image {
  1117. width: 30rpx;
  1118. height: 30rpx;
  1119. margin-right: 20rpx;
  1120. vertical-align: middle;
  1121. }
  1122. }
  1123. }
  1124. </style>