AllorderInfo.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div class="box-con">
  3. <div class="box-con2">
  4. <div class="box-tit" @click="navigateTo('/pages/store/homePage?id=' + storeId, false)">
  5. <div>
  6. <img :src="all.logo" alt="" />
  7. <p>{{ all.storeName }}</p>
  8. </div>
  9. <span>{{ name }}</span>
  10. </div>
  11. <div class="box-con-Cards" v-for="(item, index) in orderList" :key="index.id" @click="allorder">
  12. <img :src="item.images" alt="" />
  13. <div class="box-con-right">
  14. <p class="box-con-tit">{{ item.caseName }}</p>
  15. <div class="box-con-today">
  16. <p>卡盒选号:{{ item.boxName }}</p>
  17. </div>
  18. <div class="box-con-money">
  19. <div class="box-con-num">
  20. <p>¥{{ item.money }}</p>
  21. </div>
  22. <p>×1</p>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="box-num" v-if="status !== 'AutoRefund'">
  27. <span>实际支付</span>
  28. <span class="num">¥{{ all.total }}</span>
  29. </div>
  30. <div class="box-num" v-if="status == 'AutoRefund'">
  31. <span>退款成功</span>
  32. <span class="num">¥{{ all.total }}</span>
  33. </div>
  34. <div class="box-bor"></div>
  35. <div class="box-butm">
  36. <div v-if="status == 'CREATED'" @click="cancel" class="box-but">取消订单</div>
  37. <div v-if="status == 'CREATED'" @click="pay" class="box-but2">立即支付</div>
  38. <div v-if="status == 'PAYED'" @click="Apply" class="box-but">申请退款</div>
  39. <div v-if="status == 'PAYED'" @click="remind" class="box-but3">提醒发货</div>
  40. <div v-if="status == 'SEND'" @click="logistics" class="box-but">查看物流</div>
  41. <div v-if="status == 'SEND'" @click="comfrim" class="box-but2">确认收货</div>
  42. <div v-if="status == 'COMPETED'" @click="sales" class="box-but">申请售后</div>
  43. <div v-if="status == 'COMPETED'" @click="logistics" class="box-but3">查看物流</div>
  44. <div v-if="status == 'CANCELED'" @click="deletes" class="box-but">删除订单</div>
  45. <div v-if="status == 'CANCELED'" @click="again" class="box-but3">重新购买</div>
  46. <div v-if="status == 'REFUND'" @click="cancelrefund" class="box-but">取消退款</div>
  47. <div v-if="status == 'REFUND'" @click="sales" class="box-but3">联系卖家</div>
  48. <div v-if="status == 'REFUNDED'" @click="deletes" class="box-but">删除订单</div>
  49. <div v-if="status == 'REFUNDED'" @click="applydetails" class="box-but3">退款详情</div>
  50. <div v-if="status == 'AutoRefund'" @click="deletes" class="box-but">删除订单</div>
  51. <div v-if="status == 'AutoRefund'" @click="applydetails" class="box-but3">退款详情</div>
  52. </div>
  53. </div>
  54. <van-popup :show="show" custom-style="background:transparent;border-radius: 12px 12px 0 0;" use-slot>
  55. <div class="popup-con">
  56. <div class="popup-top">快递详情</div>
  57. <div>
  58. <span>物流快递:{{ logisTics.expName }}</span>
  59. </div>
  60. <div>
  61. <span>物流单号:{{ logisTics.number }}</span>
  62. <span class="dialog-cv" @click="logisticCopy">复制</span>
  63. </div>
  64. </div>
  65. <van-steps :steps="stepsList" direction="vertical">
  66. <div>{{ stepsList.text }}</div>
  67. <div>{{ stepsList.desc }}</div>
  68. </van-steps>
  69. <img
  70. @click="logisticShow"
  71. style="height:40px;width:40px;margin-left:150px;margin-top:30px"
  72. src="../static/imgs/icon_tanchuang_close@3x.png"
  73. alt=""
  74. />
  75. </van-popup>
  76. </div>
  77. </template>
  78. <script>
  79. export default {
  80. props: {
  81. all: {
  82. type: Object,
  83. default: () => {
  84. return {};
  85. }
  86. }
  87. },
  88. data() {
  89. return {
  90. show: false,
  91. stepsList: [],
  92. logisTics: [],
  93. userId: '',
  94. refundId: 0
  95. };
  96. },
  97. computed: {
  98. orderList() {
  99. return this.all.orderBoxDTOS || [];
  100. },
  101. status() {
  102. return this.all.status || '';
  103. },
  104. id() {
  105. return this.all.orderInfoId || 0;
  106. },
  107. caseId() {
  108. return this.all.caseId || 0;
  109. },
  110. storeId() {
  111. return this.all.storeId || 0;
  112. },
  113. storeName() {
  114. return this.all.storeName || '';
  115. },
  116. name() {
  117. if (this.all.status === 'CREATED') {
  118. return '待支付';
  119. }
  120. if (this.status === 'CANCELED') {
  121. return '已取消';
  122. }
  123. if (this.status === 'PAYED') {
  124. return '卖家待发货';
  125. }
  126. if (this.status === 'COMPETED') {
  127. return '已完成';
  128. }
  129. if (this.status === 'SEND') {
  130. return '待收货';
  131. }
  132. if (this.status === 'REFUND') {
  133. return '申请退款中';
  134. }
  135. if (this.status === 'REFUNDED') {
  136. return '退款成功';
  137. }
  138. if (this.status === 'AutoRefund') {
  139. return '拼箱失败/已退款';
  140. }
  141. return '';
  142. }
  143. },
  144. methods: {
  145. logisticShow() {
  146. this.show = false;
  147. },
  148. logistics() {
  149. this.showLoading();
  150. // 查看物流
  151. this.$http
  152. .get('/orderInfo/checkLogistic', { orderInfoId: this.id })
  153. .then(res => {
  154. this.hideLoading();
  155. this.logisTics = res.logistic.result;
  156. let steps = [];
  157. res.logistic.result.list.forEach(item => {
  158. let newStep = {
  159. desc: item.status,
  160. text: item.time
  161. };
  162. steps.push(newStep);
  163. });
  164. this.stepsList = steps;
  165. this.show = true;
  166. })
  167. .catch(e => {
  168. this.hideLoading();
  169. wx.showToast({
  170. title: '暂无物流信息',
  171. icon: 'none'
  172. });
  173. });
  174. },
  175. refreash() {
  176. this.$emit('refreash');
  177. },
  178. allorder() {
  179. if (this.status === 'REFUND' || this.status === 'REFUNDED' || this.status === 'AutoRefund') {
  180. this.navigateTo('/pages/Applydetails?id=' + this.id);
  181. } else {
  182. this.navigateTo('/pages/orderdetails?id=' + this.id);
  183. }
  184. },
  185. again() {
  186. this.navigateTo('/pages/details?id=' + this.caseId);
  187. },
  188. userIds() {
  189. this.$http.get('/store/get/' + this.storeId).then(res => {
  190. this.userId = res.userId;
  191. });
  192. },
  193. sales() {
  194. this.navigateTo('/pages/chat?toUserId=' + this.userId + '&toName=' + this.storeName);
  195. },
  196. logisticCopy() {
  197. wx.setClipboardData({
  198. data: this.logisTics.number + '',
  199. success(res) {
  200. wx.getClipboardData({
  201. success(res) {
  202. wx.showToast({
  203. title: '物流单号复制成功'
  204. });
  205. }
  206. });
  207. }
  208. });
  209. },
  210. comfrim() {
  211. wx.showModal({
  212. title: '提示',
  213. content: '确定收货?',
  214. success: res => {
  215. if (res.confirm) {
  216. this.$http.post('/orderInfo/finish', { orderInfoId: this.id }).then(res => {
  217. wx.showToast({
  218. icon: 'none',
  219. title: '收货成功'
  220. });
  221. setTimeout(() => {
  222. this.refreash();
  223. }, 1000);
  224. });
  225. }
  226. }
  227. });
  228. },
  229. pay() {
  230. wx.showLoading({
  231. title: '加载中'
  232. });
  233. this.$http
  234. .get('/payDelegation/wxPay', {
  235. orderId: this.id
  236. })
  237. .then(res => {
  238. res.package = res.packageValue;
  239. wx.requestPayment({
  240. ...res,
  241. success: () => {
  242. wx.hideLoading();
  243. wx.showToast({
  244. title: '支付成功'
  245. });
  246. this.refreash();
  247. },
  248. fail: e => {
  249. console.log(e);
  250. wx.hideLoading();
  251. wx.showToast({
  252. icon: 'none',
  253. title: '支付失败'
  254. });
  255. }
  256. });
  257. })
  258. .catch(e => {
  259. wx.hideLoading();
  260. wx.showToast({
  261. title: e.error,
  262. icon: 'none'
  263. });
  264. });
  265. },
  266. cancel() {
  267. wx.showModal({
  268. title: '提示',
  269. content: '确定取消订单?',
  270. success: res => {
  271. if (res.confirm) {
  272. this.$http.post('/orderInfo/cancel', { orderInfoId: this.id }).then(res => {
  273. wx.showToast({
  274. icon: 'none',
  275. title: '订单已取消'
  276. });
  277. setTimeout(() => {
  278. this.refreash();
  279. }, 1000);
  280. });
  281. }
  282. }
  283. });
  284. },
  285. rufundApply() {
  286. if (this.status === 'REFUND' || this.status === 'REFUNDED') {
  287. this.$http
  288. .get('/orderInfo/get/' + this.id)
  289. .then(res => {
  290. this.refundId = res.refundId;
  291. // console.log(this.refundId);
  292. this.hideLoading();
  293. })
  294. .catch(e => {
  295. this.hideLoading();
  296. if (e.error) {
  297. this.toast(e.rror);
  298. }
  299. });
  300. }
  301. },
  302. deletes() {
  303. wx.showModal({
  304. title: '提示',
  305. content: '确定删除订单?',
  306. success: res => {
  307. if (res.confirm) {
  308. this.$http.post('orderInfo/delete', { orderInfoId: this.id }).then(res => {
  309. wx.showToast({
  310. icon: 'none',
  311. title: '订单已删除'
  312. });
  313. setTimeout(() => {
  314. this.refreash();
  315. }, 1000);
  316. });
  317. }
  318. }
  319. });
  320. },
  321. cancelrefund() {
  322. wx.showModal({
  323. title: '提示',
  324. content: '确定取消退款?',
  325. success: res => {
  326. if (res.confirm) {
  327. this.$http.post('orderRefundApply/cancel', { id: this.refundId }).then(res => {
  328. wx.showToast({
  329. icon: 'none',
  330. title: '退款已取消'
  331. });
  332. setTimeout(() => {
  333. this.refreash();
  334. }, 1000);
  335. });
  336. }
  337. }
  338. });
  339. },
  340. Apply() {
  341. this.navigateTo('/pages/Apply?id=' + this.id);
  342. // if (this.status == 'PAYED') {
  343. // this.navigateTo('/pages/Apply?id=' + this.id);
  344. // } else {
  345. // wx.showToast({
  346. // icon: 'none',
  347. // title: '卡包已开箱,无法申请退款'
  348. // });
  349. // }
  350. },
  351. applydetails() {
  352. this.navigateTo('/pages/Applydetails?id=' + this.id);
  353. },
  354. remind() {
  355. this.$http.post('orderInfo/remindMy', { orderInfoId: this.id, remark: '' }).then(res => {
  356. wx.showToast({
  357. icon: 'none',
  358. title: '提醒商家成功'
  359. });
  360. });
  361. }
  362. },
  363. created() {
  364. this.rufundApply();
  365. // this.userIds();
  366. }
  367. };
  368. </script>
  369. <style lang="less" scoped>
  370. /deep/ .van-step__circle-container {
  371. height: 0;
  372. }
  373. /deep/ .van-steps {
  374. height: 307px;
  375. width: 334px;
  376. overflow: auto !important;
  377. border-radius: 0 0 12px 12px;
  378. }
  379. .box-con {
  380. background: #ffffff;
  381. border-radius: 12px;
  382. margin: 20px 20px;
  383. .popup-con {
  384. padding: 12px 0 20px 9px;
  385. background: #ffffff;
  386. .popup-top {
  387. height: 22px;
  388. font-size: 16px;
  389. font-weight: bold;
  390. color: #000000;
  391. line-height: 22px;
  392. text-align: center;
  393. padding: 50px 0 15px 0;
  394. }
  395. span {
  396. height: 20px;
  397. font-size: 14px;
  398. font-weight: 400;
  399. color: #1a1a1a;
  400. line-height: 20px;
  401. }
  402. .dialog-cv {
  403. width: 40px;
  404. height: 20px;
  405. border-radius: 2px;
  406. border: 1px solid #c8c9cc;
  407. font-size: 12px;
  408. font-weight: 400;
  409. color: #c8c9cc;
  410. line-height: 20px;
  411. text-align: center;
  412. margin-left: 8px;
  413. }
  414. }
  415. .box-con2 {
  416. margin: 0 16px;
  417. .box-tit {
  418. .flex();
  419. justify-content: space-between;
  420. padding: 16px 0 9px 0;
  421. div {
  422. .flex();
  423. img {
  424. width: 17px;
  425. height: 17px;
  426. }
  427. p {
  428. height: 22px;
  429. font-size: 14px;
  430. font-weight: bold;
  431. color: #000000;
  432. line-height: 22px;
  433. margin-left: 9px;
  434. }
  435. }
  436. span {
  437. height: 22px;
  438. font-size: 14px;
  439. font-weight: bold;
  440. line-height: 22px;
  441. color: #ff6c00;
  442. }
  443. }
  444. .box-con-Cards {
  445. margin-bottom: 16px;
  446. height: 90px;
  447. display: flex;
  448. img {
  449. width: 62px;
  450. height: 90px;
  451. border-radius: 6px;
  452. }
  453. .box-con-right {
  454. width: 237px;
  455. margin-left: 8px;
  456. .box-con-tit {
  457. height: 24px;
  458. font-size: 16px;
  459. font-weight: bold;
  460. color: #000000;
  461. line-height: 24px;
  462. overflow: hidden;
  463. }
  464. }
  465. .box-con-today {
  466. .flex();
  467. height: 30px;
  468. background: #f5f7fa;
  469. border-radius: 6px;
  470. width: 142px;
  471. margin: 4px 0 8px 0;
  472. p {
  473. height: 24px;
  474. font-size: 14px;
  475. font-weight: 400;
  476. color: #303133;
  477. line-height: 24px;
  478. }
  479. }
  480. .box-con-money {
  481. .flex();
  482. justify-content: space-between;
  483. .box-con-num {
  484. .flex();
  485. img {
  486. width: 16px;
  487. height: 16px;
  488. }
  489. p {
  490. height: 22px;
  491. font-size: 14px;
  492. font-weight: normal;
  493. color: #c8c9cc;
  494. line-height: 22px;
  495. }
  496. }
  497. p {
  498. height: 24px;
  499. font-size: 14px;
  500. font-weight: 400;
  501. color: #c8c9cc;
  502. line-height: 24px;
  503. }
  504. }
  505. }
  506. .box-num {
  507. text-align: right;
  508. padding-top: 20px;
  509. span {
  510. font-size: 14px;
  511. font-weight: bold;
  512. color: #000000;
  513. }
  514. .num {
  515. font-size: 16px;
  516. font-weight: bold;
  517. color: #f42202;
  518. padding-left: 10px;
  519. }
  520. }
  521. .box-bor {
  522. width: 303px;
  523. height: 1px;
  524. background: #f5f7fa;
  525. margin: 19px 0 16px 0;
  526. }
  527. .box-butm {
  528. display: flex;
  529. justify-content: flex-end;
  530. padding-bottom: 16px;
  531. .box-but {
  532. width: 80px;
  533. height: 36px;
  534. border-radius: 8px;
  535. border: 1px solid #c8c9cc;
  536. font-size: 14px;
  537. font-weight: 400;
  538. color: #c8c9cc;
  539. line-height: 36px;
  540. text-align: center;
  541. margin-right: 12px;
  542. }
  543. .box-but2 {
  544. width: 80px;
  545. height: 36px;
  546. background: #ff6c00;
  547. border-radius: 8px;
  548. font-size: 14px;
  549. font-weight: 400;
  550. color: #ffffff;
  551. line-height: 36px;
  552. text-align: center;
  553. }
  554. .box-but3 {
  555. width: 80px;
  556. height: 36px;
  557. border-radius: 8px;
  558. border: 1px solid #ff6c00;
  559. font-size: 14px;
  560. font-weight: 400;
  561. color: #ff6c00;
  562. line-height: 36px;
  563. text-align: center;
  564. }
  565. }
  566. }
  567. }
  568. </style>