index.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. <template>
  2. <view class="order-details-container">
  3. <JHeader title="订单详情" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view>
  5. <view class="content" style="padding-bottom:200upx;">
  6. <view class="order-details-status">
  7. <!-- 待付款 -->
  8. <view v-if="dataList.state == 1" class="status-title-box">
  9. <view class="l">
  10. <text class="status">等待买家付款</text>
  11. <view style="display: flex;justify-content: center;align-items: center;color: #FFFFFF; margin-top: 20rpx;">
  12. <text>剩</text>
  13. <tui-countdown :size="24" :colon-size="24" colon-color="#ffffff" :time="remainingTime"></tui-countdown>
  14. <text>自动关闭</text>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 待发货 -->
  19. <view v-else-if="dataList.state == 2" class="status-title-box">
  20. <view class="l">
  21. <text class="status">等待卖家发货</text>
  22. <text class="label">付款后2-5个工作日发货</text>
  23. </view>
  24. </view>
  25. <!-- 待核销 -->
  26. <view v-else-if="dataList.state == 8" class="status-title-box">
  27. <view class="l">
  28. <text class="status">等待核销</text>
  29. <text class="label">向商家出示核销码进行核销</text>
  30. </view>
  31. </view>
  32. <!-- 待收货 -->
  33. <view v-else-if="dataList.state == 3" class="status-title-box">
  34. <view class="l">
  35. <text class="status">卖家已发货</text>
  36. </view>
  37. </view>
  38. <!-- 已完成 -->
  39. <view v-else-if="dataList.state == 4" class="status-title-box">
  40. <view class="l">
  41. <text class="status">交易成功</text>
  42. <text class="label">感谢您的使用</text>
  43. </view>
  44. </view>
  45. <!-- 拼团失败 -->
  46. <view v-else-if="(dataList.state == 5) && (dataList.collageId != 0)" class="status-title-box">
  47. <view class="l">
  48. <text class="status">拼团失败</text>
  49. <text class="label">剩余时间 00:00:00</text>
  50. </view>
  51. <view class="clusterback">
  52. </view>
  53. </view>
  54. <!-- 交易关闭 -->
  55. <view v-else-if="dataList.state == 5" class="status-title-box2">
  56. <text class="status">交易关闭</text>
  57. <text class="label">您已关闭了这笔交易</text>
  58. </view>
  59. <!-- 退款成功 -->
  60. <view
  61. v-else-if="((dataList.returnType == 1) && (dataList.moneyReturnList.status == 4)) || ((dataList.returnType == 2) && (dataList.moneyReturnList.status == 6))"
  62. class="status-title-box2"
  63. >
  64. <text class="status">退款成功</text>
  65. <text class="label">该笔订单 ¥{{ dataList.paySum }} 退款,已原路退回</text>
  66. </view>
  67. <!-- 待成团 -->
  68. <view v-else-if="dataList.state == 6" class="status-title-box">
  69. <view class="l">
  70. <text class="status">待成团</text>
  71. <view style="display: flex;justify-content: center;align-items: center;color: #FFFFFF; margin-top: 20rpx;">
  72. <text>剩余时间</text>
  73. <tui-countdown :size="24" :colon-size="24" colon-color="#ffffff" :time="remainingTime"></tui-countdown>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="order-details-info-box">
  79. <view class="address-box">
  80. <tui-icon name="position" :size="70" unit="upx" color="#333333" margin="0 20upx 0 0"></tui-icon>
  81. <view class="address-r">
  82. <view class="address-name-box">
  83. <text>{{ dataList.receiveName }}</text>
  84. <text class="phone">{{ dataList.receivePhone }}</text>
  85. </view>
  86. <view class="address-info">
  87. <text>{{ dataList.receiveAdress }} {{ dataList.address }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 核销相关 -->
  92. <view v-if="verificationCodeUrl" style="padding: 20upx 40upx 0;font-weight: bold;">
  93. <view>使用凭证</view>
  94. <view style="text-align: center;">
  95. <image style="width: 420upx;" mode="widthFix" :src="verificationCodeUrl" />
  96. </view>
  97. <view style="display: flex;justify-content: center;font-size: 30upx;">
  98. <view style="color: #3D3D3D;">核销码:{{ verificationCode || '--' }}</view>
  99. <view style="margin-left: 22upx;color: #0061C8;" @click="$copy(verificationCode)">复制</view>
  100. </view>
  101. <view style="text-align: center;">
  102. 状态:
  103. <text v-if="verificationStatus == '0'">待核销-待付款</text>
  104. <text v-else-if="verificationStatus == '1'">待核销-已付款</text>
  105. <text v-else-if="verificationStatus == '2'">已核销</text>
  106. <text v-else-if="verificationStatus == '3'">已过期</text>
  107. <text v-else-if="verificationStatus == '4'">已取消</text>
  108. <text v-else>--</text>
  109. </view>
  110. </view>
  111. <view class="order-list-box">
  112. <view class="item">
  113. <view class="order-list-top">
  114. <view class="top-l" @click="go(`/another-tf/another-user/shop/shop-detail?shopId=${dataList.shopId}`)">
  115. <tui-icon name="shop" :size="34" unit="upx" color="#2b2b2b" margin="0 10upx 0 0"></tui-icon>
  116. <text class="shop-name">{{ dataList.shopName }}</text>
  117. <tui-icon :size="24" color="#999999" name="arrowright" margin="0 0 0 15upx"></tui-icon>
  118. </view>
  119. <view class="toService" @click="handleOpenCustomerService">
  120. <tui-icon name="people-fill" :size="60" unit="upx" color="#9aedbe" margin="0 15upx 0 0"></tui-icon>
  121. <text>联系客服</text>
  122. </view>
  123. </view>
  124. <view class="order-info-box">
  125. <view class="order-info">
  126. <view
  127. v-for="proItem in dataList.skus" :key="proItem.productId" class="order-info-item"
  128. @click="goodsItemTap(proItem.productId, proItem.skuId)"
  129. >
  130. <image :src="common.seamingImgUrl(proItem.image)" class="product-img default-img"></image>
  131. <view class="info-box">
  132. <text class="product-name">{{ proItem.productName }}</text>
  133. <view class="price-sku-box">
  134. <view class="product-sku">
  135. <view v-for="(vItem, vIndex) in proItem.values" :key="vIndex" class="mar-left-20">
  136. <text>{{ vItem }}</text>
  137. </view>
  138. </view>
  139. <view class="product-num">x {{ proItem.number }}</view>
  140. </view>
  141. <view class="price-sku-box">
  142. <view
  143. v-if="((dataList.state === 3) || (dataList.state === 4)) && (proItem.afterState == 0) && !proItem.returnType"
  144. >
  145. <view
  146. v-if="(!proItem.returnStatus || (!proItem.canApplyIntervention && (proItem.returnStatus == 2))) && (proItem.classifyId != 1439)"
  147. class="item-applay-btn" @click.stop="applayItemTap(proItem)"
  148. >
  149. 退款
  150. </view>
  151. </view>
  152. <view v-if="proItem.returnType == 1">
  153. <view
  154. v-if="!proItem.returnStatus || (proItem.returnStatus == 1) || (proItem.returnStatus == 3) || (proItem.returnStatus == 4)"
  155. class="item-applay-btn" @click="goApplyTap(proItem.returnType)"
  156. >
  157. 退款中
  158. </view>
  159. <view
  160. v-if="proItem.returnStatus == 4" class="item-applay-btn"
  161. @click="goApplyTap(proItem.returnType)"
  162. >
  163. 已退款
  164. </view>
  165. <view
  166. v-if="proItem.returnStatus == 5" class="item-applay-btn"
  167. @click="goApplyTap(proItem.returnType)"
  168. >
  169. 退款失败
  170. </view>
  171. <view
  172. v-if="proItem.canApplyIntervention" class="item-applay-btn"
  173. @click="goApplyTap(proItem.returnType)"
  174. >
  175. 客服介入
  176. </view>
  177. </view>
  178. <view v-if="proItem.returnType == 2">
  179. <view
  180. v-if="!proItem.returnStatus || (proItem.returnStatus == 1) || (proItem.returnStatus == 3) || (proItem.returnStatus == 4)"
  181. class="item-applay-btn" @click="goApplyTap(proItem.returnType)"
  182. >
  183. 退货中
  184. </view>
  185. <view
  186. v-if="proItem.returnStatus == 6" class="item-applay-btn"
  187. @click="goApplyTap(proItem.returnType)"
  188. >
  189. 已退款
  190. </view>
  191. <view
  192. v-if="proItem.returnStatus == 7" class="item-applay-btn"
  193. @click="goApplyTap(proItem.returnType)"
  194. >
  195. 退款中
  196. </view>
  197. <view
  198. v-if="(proItem.returnStatus == 5) || (proItem.returnStatus == 8)" class="item-applay-btn"
  199. @click="goApplyTap(proItem.returnType)"
  200. >
  201. 退款失败
  202. </view>
  203. <view
  204. v-if="proItem.canApplyIntervention" class="item-applay-btn"
  205. @click="goApplyTap(proItem.returnType)"
  206. >
  207. 客服介入
  208. </view>
  209. </view>
  210. </view>
  211. <view style="display: flex;justify-content: flex-end;flex-wrap: wrap;margin-top: 20upx;">
  212. <tui-button
  213. v-if="[3, 4].includes(dataList.state) && (proItem.commentId === 0) && proItem.additionalComment"
  214. type="blue" plain width="180upx" height="60rpx"
  215. margin="0 12upx 0 0"
  216. @click="go(`/another-tf/another-user/product-logistics/index?orderId=${dataList.orderId}&skuId=${proItem.skuId}`)"
  217. >
  218. 查看物流
  219. </tui-button>
  220. <tui-button
  221. v-if="[4, 10].includes(dataList.state) && (proItem.commentId === 0)" type="blue" plain
  222. width="180upx" height="60rpx" margin="0 12upx 0 0"
  223. @click="go(`/another-tf/another-serve/evaluate/index?orderId=${dataList.orderId}&skuId=${proItem.skuId}`)"
  224. >
  225. 立即评价
  226. </tui-button>
  227. <tui-button
  228. v-if="[4, 10].includes(dataList.state) && (proItem.commentId !== 0) && (dataList.skus[0].ifAdd !== 1)"
  229. type="blue" plain width="180upx" height="60rpx"
  230. margin="0 12upx 0 0"
  231. @click="handleAddEvaluate(proItem)"
  232. >
  233. 追加评价
  234. </tui-button>
  235. </view>
  236. </view>
  237. </view>
  238. <view class="delivery-way-box">
  239. <view class="item">
  240. <text class="way">商品总价</text>
  241. <text class="way">¥{{ dataList.orderPrice }}</text>
  242. </view>
  243. <view class="item">
  244. <text class="way">快递运费</text>
  245. <text class="way">¥{{ dataList.logisticsPrice }}</text>
  246. </view>
  247. <view class="item">
  248. <text class="way">平台优惠</text>
  249. <text class="way">-¥{{ dataList.discountPrice }}</text>
  250. </view>
  251. </view>
  252. </view>
  253. <!-- 待发货 待收货 已完成 -->
  254. <view v-if="[2, 3, 4, 9, 10].includes(dataList.state)" class="order-total-box">
  255. <text>实付款</text>
  256. <text class="way-color">¥{{ dataList.price }}</text>
  257. </view>
  258. <!-- 待付款 价格是橙色 -->
  259. <view v-else-if="[1, 9].includes(dataList.state)" class="order-total-box">
  260. <text>需付款</text>
  261. <text class="way-color">¥{{ dataList.price }}</text>
  262. </view>
  263. <!-- 退款成功 交易关闭 -->
  264. <view
  265. v-else-if="((dataList.returnType == 1) && (dataList.moneyReturnList.status == 4)) || ((dataList.returnType == 2) && (dataList.goodsReturn.status == 6)) || [ 5 ].includes(dataList.state)"
  266. class="order-total-box"
  267. >
  268. <text>需付款</text>
  269. <text>¥{{ dataList.price }}</text>
  270. </view>
  271. </view>
  272. </view>
  273. </view>
  274. </view>
  275. <view class="order-details-information padd">
  276. <view class="order-title">
  277. <text>订单信息</text>
  278. </view>
  279. <view class="info-box">
  280. <!-- 都有 但是:待付款 待发货 退款成功 交易关闭 只有前两个item -->
  281. <view class="item">
  282. <text>订单编号:{{ dataList.orderFormid }}</text>
  283. <text class="copy-color" @click="$copy(dataList.orderFormid)">复制</text>
  284. </view>
  285. <view class="item">
  286. <text>创建时间:{{ dataList.createTime }}</text>
  287. </view>
  288. <!-- 待收货 有付款时间和发货时间 -->
  289. <view v-if="dataList.state == 3" class="item">
  290. <text>付款时间:{{ dataList.paymentTime }}</text>
  291. </view>
  292. <view v-if="dataList.state == 3 || dataList.state == 4" class="item">
  293. <text>发货时间:{{ dataList.dileveryTime }}</text>
  294. </view>
  295. <!-- 交易成功 有成交时间 -->
  296. <view v-if="dataList.state == 4" class="item">
  297. <text>成交时间:{{ dataList.receiveTime }}</text>
  298. </view>
  299. </view>
  300. </view>
  301. <view v-if="dataList.state == 3 || dataList.state == 4">
  302. <view class="order-details-information mt20">
  303. <view class="order-title-box" @click="isShowWuLiu = !isShowWuLiu">
  304. <view class="order-title padd-l">
  305. <text class="line"></text>
  306. <text>物流信息</text>
  307. </view>
  308. <tui-icon
  309. v-if="isShowWuLiu == true" :name="isShowWuLiu ? 'arrowup' : 'arrowdown'" :size="40" unit="upx"
  310. margin="30upx" color="#b7b7b7"
  311. ></tui-icon>
  312. </view>
  313. </view>
  314. <!-- 暂无物流 -->
  315. <view v-if="isShowWuLiu">
  316. <view v-if="steps.length > 0" class="logistics">
  317. <tui-steps direction="column" :items="steps" spacing="180rpx" :active-steps="0"></tui-steps>
  318. </view>
  319. <view v-else class="emptyOrder-box flex-items-plus flex-column">
  320. <image class="emptyOrder-img" src="../../../static/images/new-business/shop/bgnull.png"></image>
  321. <label class="font-color-999 fs26 mar-top-30">这里空空如也~</label>
  322. </view>
  323. </view>
  324. </view>
  325. </view>
  326. <!-- 待付款 待发货 待收货 已完成 退款成功 -->
  327. <view
  328. class="order-details-btn" style="padding-top:30upx;"
  329. :style="{ 'padding-bottom': (isIphone == true ? 40 : 0) + 'rpx' }"
  330. >
  331. <text v-if="[1, 6, 8].includes(dataList.state)" class="btn-l" @click="cancelOrder">
  332. 取消订单
  333. </text>
  334. <text v-if="[1, 9].includes(dataList.state)" class="btn btn-r" @click="showPayTypePopup = true">
  335. 立即付款
  336. </text>
  337. <text
  338. v-if="[2, 3, 9].includes(dataList.state) && dataList.skus.every(i => i.classifyId != 1439)" class="btn-l"
  339. @click="applyMoneyAllTap"
  340. >
  341. 申请退款
  342. </text>
  343. <text v-if="dataList.state == 3" class="btn btn-r" @click="confirmReceiptTap">确认收货</text>
  344. <text
  345. v-if="[2, 3, 4, 9, 10].includes(dataList.state) && [0, 6].includes(Number(dataList.afterState)) && (dataList.skus[0].ifAdd !== 1) && dataList.skus.some(i => i.classifyId != 1439)"
  346. class="btn" @click="handleApplyTap"
  347. >
  348. 申请售后
  349. </text>
  350. <text
  351. v-if="[ 6 ].includes(dataList.state)" class="btn btn-r"
  352. @click="goInviteSpll(dataList.collageId, dataList.orderId, dataList.skus[0].productId, dataList.skus[0].skuId, dataList.shopGroupWorkId)"
  353. >
  354. 邀请拼单
  355. </text>
  356. <text v-if="[ 5 ].includes(dataList.state) && !dataList.collageId" class="btn-l" @click="delOrder">删除订单</text>
  357. <text
  358. v-if="[ 5 ].includes(dataList.state) && !dataList.collageId" class="btn btn-r"
  359. @click="againCollage(dataList.skus[0].productId, dataList.shopId, dataList.skus[0].skuId, false, dataList)"
  360. >
  361. 再次购买
  362. </text>
  363. <text
  364. v-if="[ 5 ].includes(dataList.state) && dataList.collageId" class="btn"
  365. @click="againCollage(dataList.skus[0].productId, dataList.shopId, dataList.skus[0].skuId, true, dataList)"
  366. >
  367. 再次开团
  368. </text>
  369. </view>
  370. <tui-bottom-popup :show="showPayTypePopup" @close="showPayTypePopup = false">
  371. <view v-if="showPayTypePopup" style="padding: 60upx 0 128upx;">
  372. <CashierList
  373. :price-pay="dataList.orderPrice" show show-platform-pay :shop-id-pay="dataList.shopId"
  374. @change="(e) => payInfo = e"
  375. />
  376. <tui-button
  377. type="warning" width="168upx" height="64upx" margin="30upx auto 0"
  378. shape="circle"
  379. @click="handleShopGoPay"
  380. >
  381. 确认支付
  382. </tui-button>
  383. </view>
  384. </tui-bottom-popup>
  385. <tui-bottom-popup :show="isShowCustomerServicePopup" @close="isShowCustomerServicePopup = false">
  386. <ATFCustomerService :shop-id="dataList.shopId" :data="customerServiceList"></ATFCustomerService>
  387. </tui-bottom-popup>
  388. </view>
  389. </view>
  390. </template>
  391. <script>
  392. import { handleDoPay } from '../../../utils/payUtil'
  393. import {
  394. getOrderDetailApi,
  395. getOrderVerificationHxCodeApi,
  396. getProductDetailsByIdApi,
  397. getOrderDileveryShippingTraceApi,
  398. deleteShopOrderApi,
  399. cancelShopOrderApi,
  400. getOrderRefundApi,
  401. updateOrderConfirmApi
  402. } from '../../../api/anotherTFInterface'
  403. import { T_SKU_ITEM_DTO_LIST, T_REFUND_APPLY_ITEM, T_AFTER_SALE_APPLY_REFUND } from '../../../constant'
  404. import { A_TF_MAIN } from '../../../config'
  405. export default {
  406. name: 'OrderDetails',
  407. data() {
  408. return {
  409. canApplyIntervention: false,
  410. verificationCode: '',
  411. verificationCodeUrl: '',
  412. verificationStatus: '',
  413. dataList: {
  414. orderFormid: null,
  415. createTime: null,
  416. orderPrice: 0,
  417. logisticsPrice: 0,
  418. discountPrice: 0,
  419. skus: []
  420. },
  421. orderId: 0,
  422. steps: [],
  423. isShowWuLiu: false,
  424. orderRefundList: [],
  425. isIphone: false,
  426. noticeId: 0,
  427. // 客服
  428. serviceURL: '',
  429. corpId: '',
  430. remainingTime: null, // 倒计时剩余时间
  431. // 支付
  432. showPayTypePopup: false,
  433. payInfo: {},
  434. // 客服
  435. isShowCustomerServicePopup: false,
  436. customerServiceList: []
  437. }
  438. },
  439. onLoad(options) {
  440. this.isIphone = getApp().globalData.isIphone
  441. this.orderId = parseInt(options.orderId)
  442. if (options.noticeId) {
  443. this.noticeId = options.noticeId
  444. }
  445. this.getOrderDetailData(this.orderId)
  446. getOrderRefundApi({
  447. orderId: this.orderId
  448. }).then((res) => {
  449. this.orderRefundList = res.data
  450. })
  451. getOrderVerificationHxCodeApi({
  452. url: `${A_TF_MAIN}/#/pages/jump/jump?orderId=${this.orderId}&type=verification&code=${this.orderId}~`
  453. }).then((res) => {
  454. // if (res.errno === -1) return
  455. this.verificationCode = res.data.code
  456. this.verificationCodeUrl = res.data.hxCode
  457. this.verificationStatus = res.data.status
  458. })
  459. },
  460. methods: {
  461. // 去商品详情
  462. againCollage(productId, shopId, skuId, isStartAGroup, item) {
  463. if (isStartAGroup) {
  464. this.go(`/another-tf/another-serve/goodsDetails/index?shopId=${shopId}&productId=${productId}&skuId=${skuId}`)
  465. } else {
  466. this.handleGoBuyAgain(item) // 跳转详情
  467. }
  468. },
  469. async handleGoBuyAgain(item) {
  470. // 循环sku,获取商品详情
  471. const postAjax = []
  472. item.skus.forEach((skuItem) => {
  473. postAjax.push(this.queryProductDetail(skuItem))
  474. })
  475. // 并发执行
  476. const skuDetailList = await Promise.all(postAjax)
  477. const canNotBuyNameList = []
  478. // 判断库存
  479. skuDetailList.forEach((skuDetail) => {
  480. for (const skuDetailSkuMapKey in skuDetail.map) {
  481. // 判断此SKU是否存在于传进来的item
  482. const findSku = item.skus.find((findItem) => findItem.skuId === skuDetail.map[skuDetailSkuMapKey].skuId)
  483. if (findSku) {
  484. if (findSku.number > skuDetail.map[skuDetailSkuMapKey].stockNumber) {
  485. canNotBuyNameList.push(findSku.productName)
  486. }
  487. }
  488. }
  489. })
  490. // 如果有库存不足
  491. if (canNotBuyNameList.length > 0) return this.$showToast(canNotBuyNameList.join(',') + ' 库存不足')
  492. // 制造数据
  493. uni.setStorageSync(T_SKU_ITEM_DTO_LIST, [ {
  494. ifWork: item.ifWork,
  495. shopId: item.shopId,
  496. shopName: item.shopName,
  497. shopDiscountId: item.shopDiscountId,
  498. shopSeckillId: item.shopSeckillId,
  499. skus: item.skus
  500. } ])
  501. this.go('/another-tf/another-serve/orderConfirm/index?type=1')
  502. },
  503. // 获取商品详情
  504. async queryProductDetail(skuItem) {
  505. uni.showLoading({
  506. title: '加载中...',
  507. mask: true
  508. })
  509. const res = await getProductDetailsByIdApi({
  510. shopId: skuItem.shopId,
  511. productId: skuItem.productId,
  512. skuId: skuItem.skuId,
  513. terminal: 1
  514. })
  515. uni.hideLoading()
  516. return res.data
  517. },
  518. handleAddEvaluate(skuItem) {
  519. uni.navigateTo({
  520. url: '/another-tf/another-serve/addEvaluate/index?type=1',
  521. success: () => {
  522. uni.$emit('sendAddEvaluateMsg', { addCommentVOData: this.dataList, commentId: skuItem.commentId })
  523. }
  524. })
  525. },
  526. goInviteSpll(collageId, orderId, productId, skuId, shopGroupWorkId) {
  527. uni.navigateTo({
  528. url: '/another-tf/another-serve/inviteSpell/index?collageId=' + collageId + '&orderId=' + orderId + '&type=1' +
  529. '&productId=' + productId + '&skuId=' + skuId + '&shopGroupWorkId=' + shopGroupWorkId
  530. })
  531. },
  532. // 商品详情
  533. goodsItemTap(productId, skuId) {
  534. uni.navigateTo({
  535. url: '/another-tf/another-serve/goodsDetails/index?shopId=' + this.dataList.shopId + '&productId=' + productId + '&skuId=' + skuId
  536. })
  537. },
  538. getOrderDetailData(orderId) {
  539. getOrderDetailApi({
  540. orderId,
  541. noticeId: this.noticeId
  542. }).then((res) => {
  543. const data = res.data
  544. this.remainingTime = Math.floor(res.data.time / 1000)
  545. this.dataList = data
  546. this.dataList.receivePhone = this.dataList.receivePhone.replace(/(\d{3})\d+(\d{4})$/, '$1****$2')
  547. this.getShippingTrace(this.dataList.express, this.dataList.deliverFormid)
  548. if (this.dataList.state == 1 || this.dataList.state == 6) { }
  549. })
  550. },
  551. // 物流信息
  552. getShippingTrace(express, deliverFormid) {
  553. getOrderDileveryShippingTraceApi({ express, deliverFormid })
  554. .then((res) => {
  555. const traces = res.data
  556. const len = traces.length
  557. for (let i = 0; i < len; i++) {
  558. const item = traces[i]
  559. this.steps.push({
  560. title: item.reason,
  561. desc: item.time
  562. })
  563. }
  564. this.steps = this.steps.reverse()
  565. })
  566. },
  567. // 取消订单
  568. cancelOrder() {
  569. uni.showModal({
  570. title: '温馨提示',
  571. content: '您确定要取消该订单吗?',
  572. confirmText: '确定取消',
  573. cancelText: '点错了',
  574. success: (res) => {
  575. if (res.confirm) {
  576. uni.showLoading({
  577. mask: true,
  578. title: '取消中...'
  579. })
  580. cancelShopOrderApi({
  581. orderId: this.orderId
  582. }).then((result) => {
  583. uni.hideLoading()
  584. uni.showToast({
  585. title: '取消成功'
  586. })
  587. this.getOrderDetailData(this.orderId)
  588. })
  589. .catch((e) => {
  590. uni.hideLoading()
  591. })
  592. }
  593. }
  594. })
  595. },
  596. // 删除订单
  597. delOrder() {
  598. uni.showModal({
  599. title: '温馨提示',
  600. content: '您确定要删除该订单吗?',
  601. confirmText: '确定删除',
  602. cancelText: '点错了',
  603. success: (res) => {
  604. if (res.confirm) {
  605. uni.showLoading({
  606. mask: true,
  607. title: '删除中...'
  608. })
  609. deleteShopOrderApi({
  610. orderId: this.orderId
  611. }).then((result) => {
  612. uni.hideLoading()
  613. uni.showToast({
  614. title: '删除成功'
  615. })
  616. setTimeout(() => {
  617. uni.switchTab({
  618. url: '/pages/order/order'
  619. })
  620. }, 1500)
  621. })
  622. .catch((e) => {
  623. uni.hideLoading()
  624. })
  625. }
  626. }
  627. })
  628. },
  629. // 退款
  630. applayItemTap(proItem) {
  631. uni.setStorageSync(T_REFUND_APPLY_ITEM, proItem)
  632. uni.navigateTo({
  633. url: '/another-tf/another-serve/afterSaleApplyRefund/index?orderId=' + this.orderId + '&isAllSelect=' + (this.dataList.skus.length > 1) ? '0' : '1' // isAllSelect 是否为拆单售后
  634. })
  635. },
  636. // 去退款详情
  637. goApplyTap(type) {
  638. if (type == 1) {
  639. uni.navigateTo({
  640. url: `/another-tf/another-serve/refundDetails/index?item=${JSON.stringify(this.dataList)}`
  641. })
  642. } else if (type == 2) {
  643. uni.navigateTo({
  644. url: `/another-tf/another-serve/returnDetails/index?item=${JSON.stringify(this.dataList)}`
  645. })
  646. }
  647. },
  648. // 申请退款
  649. applyMoneyAllTap() {
  650. let isAllSelect = 1
  651. if (this.dataList.skus.some((item) => item.afterState)) isAllSelect = 0
  652. if (this.orderRefundList.length === 0) return this.$showToast('您所有商品已经申请退款,请勿重复申请')
  653. uni.setStorageSync(T_AFTER_SALE_APPLY_REFUND, this.orderRefundList)
  654. uni.navigateTo({
  655. url: `/another-tf/another-serve/afterSaleApplyRefund/index?orderId=${this.orderId}&isAllSelect=${isAllSelect}`
  656. })
  657. },
  658. confirmReceiptTap() {
  659. uni.showModal({
  660. title: '温馨提示',
  661. content: '确定您已经收到货物,否则会造成财产损失',
  662. confirmText: '确定收到',
  663. cancelText: '点错了',
  664. success: (res) => {
  665. if (res.confirm) {
  666. uni.showLoading({
  667. title: '确认中...'
  668. })
  669. updateOrderConfirmApi({
  670. orderId: this.dataList.orderId
  671. }).then((result) => {
  672. uni.hideLoading()
  673. uni.showToast({
  674. title: '确认成功'
  675. })
  676. this.getOrderDetailData(this.orderId)
  677. })
  678. .catch((e) => {
  679. uni.hideLoading()
  680. })
  681. }
  682. }
  683. })
  684. },
  685. // 申请售后
  686. handleApplyTap() {
  687. if (this.orderRefundList.length === 0) return this.$showToast('您所有商品已经申请退款,请勿重复申请')
  688. uni.navigateTo({
  689. url: `/another-tf/another-serve/afterSaleApply/index?orderId=${this.dataList.orderId}`
  690. })
  691. },
  692. async handleShopGoPay() {
  693. await handleDoPay({
  694. collageId: this.dataList.collageId,
  695. money: this.dataList.orderPrice,
  696. orderId: this.dataList.orderId,
  697. type: 2,
  698. ...this.payInfo
  699. }, 1)
  700. },
  701. // 打开客服
  702. async handleOpenCustomerService() {
  703. const res = await this.$store.dispatch('app/getCustomerServiceAction', {
  704. shopId: this.dataList.shopId
  705. })
  706. this.customerServiceList = res.data
  707. if (!this.customerServiceList.length) this.$showToast('暂无客服')
  708. }
  709. }
  710. }
  711. </script>
  712. <style lang="less" scoped>
  713. .order-details-container {
  714. min-height: 100vh;
  715. background: #f7f7f7;
  716. /deep/ .tui-popup-class.tui-bottom-popup {
  717. height: 85vh !important;
  718. }
  719. .content {
  720. padding: 0 0 160upx 0;
  721. .order-details-status {
  722. width: 750upx;
  723. height: 250upx;
  724. background: #333333;
  725. .status-title-box {
  726. display: flex;
  727. flex-direction: row;
  728. align-items: center;
  729. justify-content: center;
  730. padding: 40upx 30upx 0;
  731. box-sizing: border-box;
  732. text-align: center;
  733. .l {
  734. display: flex;
  735. flex-direction: column;
  736. }
  737. }
  738. .status-title-box2 {
  739. display: flex;
  740. flex-direction: column;
  741. align-items: center;
  742. padding: 40upx 30upx 0;
  743. box-sizing: border-box;
  744. }
  745. .status {
  746. font-size: 30upx;
  747. color: #fff;
  748. }
  749. .label {
  750. font-size: 24upx;
  751. color: #fff;
  752. margin-top: 14upx;
  753. }
  754. }
  755. .order-details-info-box {
  756. padding: 0 30upx;
  757. box-sizing: border-box;
  758. margin-top: -80upx;
  759. .address-box {
  760. margin-top: 20upx;
  761. background: #fff;
  762. width: 100%;
  763. padding: 30upx;
  764. box-sizing: border-box;
  765. display: flex;
  766. flex-direction: row;
  767. align-items: center;
  768. .address-r {
  769. flex: 1;
  770. display: flex;
  771. flex-direction: column;
  772. font-size: 28upx;
  773. color: #333;
  774. .address-name-box {
  775. font-size: 30upx;
  776. color: #333;
  777. .phone {
  778. font-size: 24upx;
  779. color: #999;
  780. margin-left: 20upx;
  781. }
  782. }
  783. .address-info {
  784. font-size: 28upx;
  785. color: #333;
  786. margin-top: 15upx;
  787. }
  788. }
  789. }
  790. .order-list-box {
  791. margin-top: 20upx;
  792. .item {
  793. margin-bottom: 20upx;
  794. background: #fff;
  795. .order-list-top {
  796. height: 96upx;
  797. padding: 0 30upx;
  798. box-sizing: border-box;
  799. display: flex;
  800. flex-direction: row;
  801. align-items: center;
  802. justify-content: space-between;
  803. border-bottom: 1px solid #eee;
  804. .top-l {
  805. display: flex;
  806. flex-direction: row;
  807. align-items: center;
  808. .shop-name {
  809. font-size: 30upx;
  810. color: #333;
  811. font-weight: bold;
  812. }
  813. }
  814. .toService {
  815. line-height: 40rpx;
  816. padding: 0 8rpx;
  817. border: 1rpx solid #FAF6ED;
  818. cursor: pointer;
  819. display: flex;
  820. align-items: center;
  821. text {
  822. line-height: 40rpx;
  823. }
  824. }
  825. }
  826. .order-info-box {
  827. padding: 0 30upx;
  828. box-sizing: border-box;
  829. .order-info {
  830. border-bottom: 1px solid #eee;
  831. .order-info-item {
  832. display: flex;
  833. flex-direction: row;
  834. padding: 20upx 0;
  835. .product-img {
  836. width: 180upx;
  837. height: 180upx;
  838. border-radius: 10upx;
  839. margin-right: 30upx;
  840. }
  841. .info-box {
  842. flex: 1;
  843. display: flex;
  844. flex-direction: column;
  845. justify-content: space-between;
  846. .product-name {
  847. font-size: 26upx;
  848. color: #333;
  849. height: 68upx;
  850. line-height: 34upx;
  851. display: -webkit-box;
  852. overflow: hidden;
  853. text-overflow: ellipsis;
  854. word-break: break-all;
  855. -webkit-box-orient: vertical;
  856. -webkit-line-clamp: 2;
  857. }
  858. .price-sku-box {
  859. width: 100%;
  860. display: flex;
  861. flex-direction: row;
  862. align-items: center;
  863. justify-content: space-between;
  864. .product-sku {
  865. font-size: 24upx;
  866. color: #999;
  867. display: inline-block;
  868. margin-left: -20upx;
  869. display: flex;
  870. flex-direction: row;
  871. }
  872. .product-num {
  873. font-size: 28upx;
  874. color: #999;
  875. display: inline-block;
  876. }
  877. .item-applay-btn {
  878. height: 50upx;
  879. display: flex;
  880. flex-direction: row;
  881. align-items: center;
  882. justify-content: center;
  883. padding: 0 30upx;
  884. background: rgba(255, 255, 255, 1);
  885. border: 1px solid rgba(187, 187, 187, 1);
  886. border-radius: 25upx;
  887. font-size: 24upx;
  888. font-weight: 400;
  889. color: rgba(51, 51, 51, 1);
  890. }
  891. }
  892. }
  893. }
  894. .delivery-way-box {
  895. display: flex;
  896. flex-direction: column;
  897. margin: 30upx 0 10upx;
  898. .item {
  899. display: flex;
  900. flex-direction: row;
  901. align-items: center;
  902. justify-content: space-between;
  903. font-size: 26upx;
  904. color: #333;
  905. .way {
  906. color: #999;
  907. }
  908. }
  909. }
  910. }
  911. .order-total-box {
  912. padding: 30upx 0;
  913. display: flex;
  914. flex-direction: row;
  915. align-items: center;
  916. justify-content: space-between;
  917. font-size: 26upx;
  918. color: #333;
  919. .way-color {
  920. color: #333333;
  921. font-size: 32rpx;
  922. }
  923. }
  924. }
  925. }
  926. }
  927. }
  928. .order-details-information {
  929. background: #fff;
  930. &.padd {
  931. padding: 30upx;
  932. box-sizing: border-box;
  933. }
  934. &.mt20 {
  935. margin-top: 20upx;
  936. }
  937. .order-title {
  938. font-size: 30upx;
  939. color: #333;
  940. font-weight: 500;
  941. display: flex;
  942. flex-direction: row;
  943. align-items: center;
  944. }
  945. .info-box {
  946. flex: 1;
  947. display: flex;
  948. flex-direction: column;
  949. justify-content: space-between;
  950. margin-top: 30upx;
  951. .item {
  952. display: flex;
  953. flex-direction: row;
  954. align-items: center;
  955. justify-content: space-between;
  956. font-size: 24upx;
  957. color: #666;
  958. margin-bottom: 20upx;
  959. .copy-color {
  960. font-size: 24upx;
  961. color: #C5AA7B;
  962. }
  963. }
  964. }
  965. .order-title-box {
  966. display: flex;
  967. flex-direction: row;
  968. align-items: center;
  969. justify-content: space-between;
  970. .order-title {
  971. &.padd-l {
  972. padding-left: 30upx;
  973. }
  974. }
  975. }
  976. }
  977. .logistics {
  978. padding: 20upx 20upx;
  979. }
  980. .emptyOrder-box {
  981. padding: 70upx 0;
  982. .emptyOrder-img {
  983. width: 200upx;
  984. height: 200upx;
  985. }
  986. }
  987. }
  988. .order-details-btn {
  989. position: fixed;
  990. bottom: 0;
  991. left: 0;
  992. width: 100%;
  993. min-height: 160upx;
  994. background: #fff;
  995. box-shadow: 0px 0px 10px 0px rgba(51, 51, 51, 0.1);
  996. box-sizing: border-box;
  997. display: flex;
  998. padding: 0 30upx;
  999. flex-direction: row;
  1000. align-items: center;
  1001. justify-content: space-between;
  1002. z-index: 10;
  1003. .btn {
  1004. width: 100%;
  1005. height: 100upx;
  1006. background: #333333;
  1007. font-size: 28upx;
  1008. color: #FFEBC4;
  1009. text-align: center;
  1010. line-height: 100upx;
  1011. font-weight: 500upx;
  1012. }
  1013. .btn-l {
  1014. width: 50%;
  1015. height: 100upx;
  1016. border: 2rpx solid #333333;
  1017. font-size: 28upx;
  1018. color: #333;
  1019. text-align: center;
  1020. line-height: 100upx;
  1021. box-sizing: border-box;
  1022. margin-right: 10rpx;
  1023. }
  1024. .btn-r {
  1025. width: 50%;
  1026. margin-left: 10rpx;
  1027. }
  1028. }
  1029. }
  1030. </style>