index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. <template>
  2. <view class="ordermanagement">
  3. <view class="ordermanagement-header">
  4. <view class="ordermanagement-header-text"> 订单管理 </view>
  5. <view class="ordermanagement-list">
  6. <view class="ordermanagement-list-yi">
  7. <view class="ordermanagement-list-yi-top">
  8. {{ orderSta.orderPayment == undefined ? 0 : orderSta.orderPayment }}
  9. </view>
  10. <view class="ordermanagement-list-yi-bottom"> 已支付订单数 </view>
  11. </view>
  12. <view class="ordermanagement-list-yi">
  13. <view class="ordermanagement-list-yi-top">
  14. {{ orderSta.payPrice == undefined ? 0 : orderSta.payPrice }}
  15. </view>
  16. <view class="ordermanagement-list-yi-bottom"> 实际支付金额 </view>
  17. </view>
  18. <view class="ordermanagement-list-yi">
  19. <view class="ordermanagement-list-yi-top">
  20. {{ orderSta.refundPrice == undefined ? 0 : orderSta.refundPrice }}
  21. </view>
  22. <view class="ordermanagement-list-yi-bottom"> 已退款金额 </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="ordermanagement-ding">
  27. <view class="view-wrapper">
  28. <view class="ordermanagement-ding-text"> 我的订单 </view>
  29. <view class="view-all" @click="jiru('all', 0)">
  30. <text>查看全部</text>
  31. <image
  32. src="/static/images/new_ui/arrow-right.png"
  33. class="icon-img"
  34. ></image>
  35. </view>
  36. </view>
  37. <view class="ordermanagement-ding-nei">
  38. <view
  39. class="ordermanagement-yisdf"
  40. v-for="(item, index) in dingdan"
  41. :key="index + '__index__'"
  42. @click="jiru(item.status, index + 1)"
  43. >
  44. <view class="ordermanagement-img">
  45. <image :src="item.img" mode="widthFix"></image>
  46. <view class="ordermanagement-img-biao" v-if="item.num > 0">
  47. {{ item.num }}
  48. </view>
  49. </view>
  50. <view class="">
  51. {{ item.name }}
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="ordermanagement-dingsss">
  57. <view class="view-wrapper">
  58. <view class="ordermanagement-ding-text"> 售后管理 </view>
  59. <view class="view-all" @click="afterSalesClick('all', 0)">
  60. <text>查看全部</text>
  61. <image
  62. src="/static/images/new_ui/arrow-right.png"
  63. class="icon-img"
  64. ></image>
  65. </view>
  66. </view>
  67. <view class="ordermanagement-ding-nei">
  68. <view
  69. class="ordermanagement-yisdf"
  70. v-for="(item, index) in dingdansss"
  71. :key="index + 'pp' + '__index__'"
  72. @click="afterSalesClick(item.status, index + 1)"
  73. >
  74. <view class="ordermanagement-img">
  75. <image :src="item.img" mode="widthFix"></image>
  76. <view class="ordermanagement-img-biao" v-if="item.num > 0">
  77. {{ item.num }}
  78. </view>
  79. </view>
  80. <view class="">
  81. {{ item.name }}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- <quickPickUpVue class="custom_pick-up"></quickPickUpVue> -->
  87. </view>
  88. </template>
  89. <script>
  90. import {
  91. getOrderStatusNumber,
  92. getOrderList,
  93. getAfterSaleList,
  94. } from "@/commit/order.js";
  95. import quickPickUpVue from "./components/quickPickUp/quickPickUp.vue";
  96. import { toQueryString } from "@/utils/index.js";
  97. import readAppInfo ,{getPhpToken}from '@/utils/readAppInfo.js';
  98. export default {
  99. components: { quickPickUpVue },
  100. data() {
  101. return {
  102. orderSta: {
  103. orderPayment: "0",
  104. payPrice: "0",
  105. refundPrice: "0",
  106. },
  107. num: {}, //正向订单状态数
  108. mer_id: 264,
  109. dingdan: [
  110. {
  111. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154736170.png",
  112. name: "待付款",
  113. status: 1,
  114. },
  115. {
  116. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154723185.png",
  117. name: "待发货",
  118. status: 2,
  119. },
  120. {
  121. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154804269.png",
  122. name: "待收货",
  123. status: 3,
  124. },
  125. {
  126. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154750259.png",
  127. name: "待评价",
  128. status: 4,
  129. },
  130. // {
  131. // img: 'https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154847886.png',
  132. // name: '已退款',
  133. //status:6
  134. // }
  135. ],
  136. dingdansss: [
  137. {
  138. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154932244.png",
  139. name: "审核中",
  140. status: 0,
  141. num: 0,
  142. },
  143. {
  144. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154949118.png",
  145. name: "处理中",
  146. num: 0,
  147. status: 2,
  148. },
  149. {
  150. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812155008586.png",
  151. name: "已完成",
  152. num: 0,
  153. status: 3,
  154. },
  155. ],
  156. uid: "",
  157. authorization: "",
  158. };
  159. },
  160. async onLoad() {
  161. console.log("进了我的页面了");
  162. await readAppInfo();
  163. await getPhpToken();
  164. return;
  165. let jurisdiction = uni.getStorageSync("jurisdiction") || [];
  166. console.log("jurisdiction", jurisdiction);
  167. let mnuList = this.mnu;
  168. if (jurisdiction) {
  169. jurisdiction.forEach((res, index) => {
  170. mnuList.forEach((result, i) => {
  171. if (res == result.id) {
  172. result.show = true;
  173. }
  174. return result;
  175. });
  176. return res;
  177. });
  178. this.mnu = mnuList;
  179. }
  180. console.log(this.mnu);
  181. setTimeout(function () {
  182. uni.hideLoading();
  183. }, 700);
  184. console.log("我的show===>>>>>>");
  185. this.authorization = uni.getStorageSync("authorization");
  186. let userinfo = uni.getStorageSync("userinfo");
  187. this.uid = userinfo.uid;
  188. console.log("onshow");
  189. return;
  190. let authorization = uni.getStorageSync("authorization");
  191. // let userinfo = uni.getStorageSync('userinfo')
  192. let selectmerchant = uni.getStorageSync("selectmerchant");
  193. let uid = userinfo.uid;
  194. console.log(selectmerchant, authorization, userinfo);
  195. if (authorization && uid) {
  196. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  197. uni.redirectTo({
  198. url: "/openmerchant/guide/index", //有或者没有商户 没有金额支付and激活码支付
  199. });
  200. return;
  201. } else if (
  202. selectmerchant.merId > 0 &&
  203. (selectmerchant.status == 1 || selectmerchant.status == 5)
  204. ) {
  205. return;
  206. } else if (
  207. selectmerchant.merId >= 0 &&
  208. (selectmerchant.status == 3 || selectmerchant.status == 4)
  209. ) {
  210. uni.redirectTo({
  211. url: "/openmerchant/shopentry/process?mer_id=" + selectmerchant.merId, //已开通商户未填写资料
  212. });
  213. return;
  214. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  215. uni.redirectTo({
  216. url: "/openmerchant/shopentry/processaudit?submitCode=" + 3, //已开通商户待审核
  217. });
  218. return;
  219. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  220. uni.redirectTo({
  221. url: "/openmerchant/shopentry/processaudit?submitCode=" + 2, //已开通商户审核拒绝
  222. });
  223. return;
  224. }
  225. }
  226. },
  227. async onShow() {
  228. let selectmerchant = uni.getStorageSync("selectmerchant");
  229. this.mer_id = selectmerchant.merId;
  230. uni.showLoading({
  231. title: "加载中",
  232. });
  233. try {
  234. await this.getOrderListData();
  235. await this.getOrderStatusNumberData();
  236. await this.getAfterSaleListData();
  237. } finally {
  238. uni.hideLoading();
  239. }
  240. },
  241. methods: {
  242. //售后管理
  243. afterSalesClick(status, index) {
  244. const params = {
  245. tabIndex: index,
  246. mer_id: this.mer_id,
  247. status: status,
  248. };
  249. uni.redirectTo({
  250. url: `../../shop/afterSalesManagement/index?${toQueryString(params)}`,
  251. });
  252. },
  253. // 订单金额
  254. async getOrderListData() {
  255. try {
  256. const res = await getOrderList({
  257. order_sn: "",
  258. order_type: -1,
  259. distribution_mode: -1,
  260. keywords: "",
  261. status: "",
  262. date: "",
  263. page: 1,
  264. limit: 20,
  265. type: 1,
  266. username: "",
  267. pay_type: -1,
  268. ylj_status: "",
  269. paid: "",
  270. });
  271. console.log(res, "resresresresres");
  272. if (res.data.status === 200) {
  273. const data = res.data.data.stat || [];
  274. let obj = {
  275. 已支付订单数量: "orderPayment",
  276. 实际支付金额: "payPrice",
  277. 已退款金额: "refundPrice",
  278. };
  279. data.forEach((item) => {
  280. this.orderSta[obj[item.name]] = item.count || undefined;
  281. });
  282. }
  283. } catch (error) {
  284. } finally {
  285. // uni.hideLoading();
  286. }
  287. },
  288. // 正向订单状态数
  289. getOrderStatusNumberData() {
  290. getOrderStatusNumber({
  291. order_sn: "",
  292. order_type: "-1",
  293. distribution_mode: "-1",
  294. keywords: "",
  295. status: "",
  296. date: "",
  297. page: 1,
  298. limit: 10,
  299. type: 1,
  300. username: "",
  301. pay_type: -1,
  302. ylj_status: "",
  303. paid: "",
  304. }).then(
  305. (res) => {
  306. if (res.data.status == 200) {
  307. this.num = res.data.data;
  308. this.dingdan = [
  309. {
  310. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154736170.png",
  311. name: "待付款",
  312. num: this.num.unpaid || 0,
  313. status: 1,
  314. },
  315. {
  316. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154723185.png",
  317. name: "待发货",
  318. num: this.num.unshipped || 0,
  319. status: 2,
  320. },
  321. {
  322. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154804269.png",
  323. name: "待收货",
  324. num: this.num.untake || 0,
  325. status: 3,
  326. },
  327. {
  328. img: "https://cdn.bjtdba.com/vod/image/2022-08-12/20220812154750259.png",
  329. name: "待评价",
  330. num: this.num.unevaluate || 0,
  331. status: 4,
  332. },
  333. ];
  334. // uni.hideLoading();
  335. }
  336. },
  337. (fail) => {
  338. // uni.hideLoading();
  339. console.log(fail);
  340. }
  341. );
  342. },
  343. //售后
  344. async getAfterSaleListData() {
  345. try {
  346. const res = await getAfterSaleList({
  347. refund_order_sn: "",
  348. status: "",
  349. date: "",
  350. page: 1,
  351. limit: 20,
  352. order_sn: "",
  353. refund_type: "",
  354. });
  355. if (res.data.status == 200) {
  356. const data = res.data.data.stat;
  357. var num = data.refuse;
  358. var num1 = data.end;
  359. var num2 = data.agree;
  360. let finishOrder = num + num1 + num2;
  361. this.dingdansss[0].num = data.audit || 0;
  362. this.dingdansss[1].num = data.backgood || 0;
  363. this.dingdansss[2].num = finishOrder || 0;
  364. }
  365. // uni.hideLoading();
  366. } catch (error) {
  367. } finally {
  368. // uni.hideLoading();
  369. }
  370. },
  371. jiru(e, i) {
  372. let authorization = uni.getStorageSync("authorization");
  373. let userinfo = uni.getStorageSync("userinfo");
  374. let selectmerchant = uni.getStorageSync("selectmerchant");
  375. let uid = userinfo.uid;
  376. uni.redirectTo({
  377. url: "../../shop/commodity/order?status=" + e + "&index=" + i,
  378. });
  379. return;
  380. if (authorization && uid) {
  381. if (selectmerchant.merId >= 0 && selectmerchant.status == -1) {
  382. uni.redirectTo({
  383. url: "/openmerchant/guide/index", //有或者没有商户 没有金额支付and激活码支付
  384. });
  385. return;
  386. } else if (
  387. selectmerchant.merId > 0 &&
  388. (selectmerchant.status == 1 || selectmerchant.status == 5)
  389. ) {
  390. uni.redirectTo({
  391. url: "../../shop/commodity/order?status=" + e + "&index=" + i,
  392. });
  393. return;
  394. } else if (
  395. selectmerchant.merId >= 0 &&
  396. (selectmerchant.status == 3 || selectmerchant.status == 4)
  397. ) {
  398. uni.redirectTo({
  399. url:
  400. "/openmerchant/shopentry/process?mer_id=" + selectmerchant.merId, //已开通商户未填写资料
  401. });
  402. return;
  403. } else if (selectmerchant.merId > 0 && selectmerchant.status == 0) {
  404. uni.redirectTo({
  405. url: "/openmerchant/shopentry/processaudit?submitCode=" + 3, //已开通商户待审核
  406. });
  407. return;
  408. } else if (selectmerchant.merId > 0 && selectmerchant.status == 2) {
  409. uni.redirectTo({
  410. url: "/openmerchant/shopentry/processaudit?submitCode=" + 2, //已开通商户审核拒绝
  411. });
  412. return;
  413. }
  414. } else {
  415. uni.navigateTo({
  416. url: "/pages/user/login/index?type=1",
  417. });
  418. return;
  419. }
  420. },
  421. },
  422. };
  423. </script>
  424. <style>
  425. page {
  426. background-color: #f7f8fc;
  427. }
  428. </style>
  429. <style lang="scss" scoped>
  430. .ordermanagement {
  431. width: 100%;
  432. height: 100%;
  433. display: flex;
  434. flex-direction: column;
  435. align-items: center;
  436. padding-bottom: 50rpx;
  437. box-sizing: border-box;
  438. .ordermanagement-header {
  439. width: 100%;
  440. height: 100%;
  441. display: flex;
  442. flex-direction: column;
  443. align-items: center;
  444. width: 100%;
  445. height: 328rpx;
  446. background: linear-gradient(
  447. 180deg,
  448. rgba(31, 124, 255, 0.22) 0%,
  449. rgba(255, 255, 255, 0.15) 100%
  450. );
  451. position: relative;
  452. display: flex;
  453. justify-content: center;
  454. .ordermanagement-header-text {
  455. position: absolute;
  456. font-size: 46rpx;
  457. font-weight: 500;
  458. color: #333333;
  459. top: 60rpx;
  460. left: 64rpx;
  461. }
  462. .ordermanagement-list {
  463. position: absolute;
  464. top: 160rpx;
  465. width: calc(100% - 54rpx);
  466. min-height: 150rpx;
  467. margin: 0 26rpx;
  468. background: #ffffff;
  469. border-radius: 16rpx;
  470. display: flex;
  471. justify-content: space-around;
  472. align-items: center;
  473. .ordermanagement-list-yi {
  474. height: 70rpx;
  475. display: flex;
  476. flex-direction: column;
  477. justify-content: space-between;
  478. align-items: center;
  479. .ordermanagement-list-yi-top {
  480. font-size: 36rpx;
  481. font-weight: bold;
  482. color: #333333;
  483. }
  484. .ordermanagement-list-yi-bottom {
  485. font-size: 26rpx;
  486. font-weight: 400;
  487. color: #333333;
  488. }
  489. }
  490. }
  491. }
  492. .view-wrapper {
  493. display: flex;
  494. justify-content: space-between;
  495. align-items: center;
  496. width: 100%;
  497. }
  498. .view-all {
  499. display: flex;
  500. justify-content: center;
  501. align-items: center;
  502. font-family: PingFangSC, PingFang SC;
  503. font-weight: 400;
  504. font-size: 24rpx;
  505. > text:first-child {
  506. padding-right: 8rpx;
  507. color: #999999;
  508. }
  509. .icon-img {
  510. width: 26rpx;
  511. height: 26rpx;
  512. }
  513. }
  514. .ordermanagement-ding {
  515. width: calc(100% - 54rpx);
  516. min-height: 216rpx;
  517. margin: 20rpx 26rpx 32rpx 26rpx;
  518. display: flex;
  519. flex-direction: column;
  520. justify-content: space-between;
  521. align-items: flex-start;
  522. .ordermanagement-ding-text {
  523. font-size: 30rpx;
  524. font-weight: 600;
  525. color: #333333;
  526. }
  527. .ordermanagement-ding-nei {
  528. width: 100%;
  529. height: 160rpx;
  530. background: #ffffff;
  531. border-radius: 16rpx;
  532. display: flex;
  533. justify-content: space-around;
  534. align-items: center;
  535. .ordermanagement-yisdf {
  536. height: 96rpx;
  537. display: flex;
  538. flex-direction: column;
  539. justify-content: space-between;
  540. align-items: center;
  541. font-size: 24rpx;
  542. font-weight: 400;
  543. color: #5f6060;
  544. }
  545. }
  546. }
  547. .ordermanagement-img {
  548. width: 48rpx;
  549. height: 48rpx;
  550. position: relative;
  551. image {
  552. width: 100%;
  553. height: 100%;
  554. }
  555. .ordermanagement-img-biao {
  556. position: absolute;
  557. left: 40rpx;
  558. bottom: 31rpx;
  559. width: 30rpx;
  560. height: 30rpx;
  561. border-radius: 50%;
  562. padding: 6rpx;
  563. background: #fe0032;
  564. font-size: 20rpx;
  565. font-weight: 400;
  566. color: #ffffff;
  567. display: flex;
  568. justify-content: center;
  569. align-items: center;
  570. }
  571. }
  572. .ordermanagement-dingsss {
  573. width: calc(100% - 52rpx);
  574. height: 216rpx;
  575. display: flex;
  576. flex-direction: column;
  577. justify-content: space-between;
  578. align-items: flex-start;
  579. .ordermanagement-ding-text {
  580. font-size: 30rpx;
  581. font-weight: 600;
  582. color: #333333;
  583. }
  584. .ordermanagement-ding-nei {
  585. width: 100%;
  586. height: 160rpx;
  587. background: #ffffff;
  588. border-radius: 16rpx;
  589. display: flex;
  590. justify-content: space-around;
  591. align-items: center;
  592. .ordermanagement-yisdf {
  593. height: 96rpx;
  594. display: flex;
  595. flex-direction: column;
  596. justify-content: space-between;
  597. align-items: center;
  598. font-size: 24rpx;
  599. font-weight: 400;
  600. color: #5f6060;
  601. .ordermanagement-img {
  602. width: 48rpx;
  603. height: 48rpx;
  604. image {
  605. width: 100%;
  606. height: 100%;
  607. }
  608. }
  609. }
  610. }
  611. }
  612. .custom_pick-up {
  613. width: calc(100% - 54rpx);
  614. margin: 0 26rpx;
  615. }
  616. }
  617. </style>