index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930
  1. <template>
  2. <view class="flex-common-css box-border-box">
  3. <Nav class="nav-b" :leftShow='false' :customNav='true' bgckgroundBox='#fff'>
  4. <template>
  5. <view slot="custom" class="text-align-center fw-600 fs-36">
  6. 我的订单
  7. </view>
  8. </template>
  9. </Nav>
  10. <view class="nav-box box-border-box bgc-f display-flex">
  11. <view class="nav-item" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'" v-for="(item,i) in navList" :key="i"
  12. @click="selectType(item.id)">
  13. {{item.name}}
  14. <view v-if="type == item.id" class="nav-item-x"></view>
  15. </view>
  16. </view>
  17. <scroll-view class="nav-type-box bgc-f p-12-24 box-border-box" :scroll-x="true">
  18. <view class="nav-type-item text-align-center fs-28" v-for="(item,index) in navTypeData"
  19. @click="navTypeClick(item.key)"
  20. :class="navTypeKey== item.key?'bgc-E4F3FD fw-600 fc-41ABF5':'bgc-F4F5F7 fw-400 fc-3'">
  21. {{item.name}}
  22. </view>
  23. </scroll-view>
  24. <view v-if="list.length == 0" class="scroll-view-css">
  25. <EnBlank :customSrc='true'>
  26. <template v-slot:blankImg>
  27. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  28. </template>
  29. </EnBlank>
  30. </view>
  31. <scroll-view v-else :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  32. <view class="list-box">
  33. <view class="list-item bgc-f b-rad-20 mb-32 p-24 box-border-box" v-for="(item,index) in list"
  34. @click="goToInfo(item)">
  35. <view class="align-items-center flex-justify-space mb-24">
  36. <view class="align-items-center">
  37. <image v-if="item.site_logo" class="shops-img" :src="item.site_logo" mode="aspectFit">
  38. </image>
  39. <image v-else-if="item.shop_logo" class="shops-img" :src="item.shop_logo" mode="aspectFit">
  40. </image>
  41. <image v-else class="shops-img" src="@/static/img/logo/logo.png" mode=""></image>
  42. <view v-if="item.site_name" class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  43. {{item.site_name}}
  44. </view>
  45. <view @click="goToShop(item)" v-else-if="item.shop_name"
  46. class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  47. {{item.shop_name}}
  48. </view>
  49. <view v-else class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  50. 君子校园
  51. </view>
  52. <!-- <image class="icons" src="@/static/img/toRight.png" mode=""></image> -->
  53. </view>
  54. <view class="fc-41ABF5 fs-28">
  55. {{item.order_status_str}}
  56. </view>
  57. </view>
  58. <view class="align-items-center flex-justify-space mb-24">
  59. <view class="goods-box" v-if="type == 1 || type == 2 || type == 5">
  60. <view class="" v-if="item.item.length == 1">
  61. <view class="align-items-center" v-for="(itemGoods,indexGoods) in item.item">
  62. <image class="goods-img flex-shrink0" :src="itemGoods.goods_img" mode="aspectFit">
  63. </image>
  64. <view class="fs-28 fc-6 text-overflow-ellipsis">
  65. {{itemGoods.goods_name}}
  66. </view>
  67. </view>
  68. </view>
  69. <view class="align-items-center goods-two" v-else>
  70. <view class="flex-direction" v-for="(itemGoods,indexGoods) in item.item">
  71. <image class="goods-img flex-shrink0" :src="itemGoods.goods_img" mode="aspectFit">
  72. </image>
  73. <view class="fs-28 fc-6 text-overflow-ellipsis-one goods-two-name text-align-center">
  74. {{itemGoods.goods_name}}
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="goods-box" v-else>
  80. <view class="align-items-center">
  81. <image class="goods-img flex-shrink0" :src="item.goods_img" mode="aspectFit">
  82. </image>
  83. <view class="fs-28 fc-6 text-overflow-ellipsis">
  84. {{item.goods_name}}
  85. </view>
  86. </view>
  87. </view>
  88. <view class="goods-num text-align-center">
  89. 共 {{item.goods_number}} 件
  90. </view>
  91. </view>
  92. <view class="align-items-center flex-justify-space mb-24">
  93. <view class="fs-24 fc-9">
  94. 下单时间:{{item.created_at}}
  95. </view>
  96. <view class="fs-28 fc-9">
  97. {{item.order_status == 1?'需付':'实付'}} <text class="fs-32 fc-3 fw-600">¥{{item.pay_money}}</text>
  98. </view>
  99. </view>
  100. <view class="align-items-center flex-justify-end">
  101. <view class="item-but but-class-two fs-28 mr-18" @click="assess(item)"
  102. v-if="type == 1 && item.order_status == 7 && item.is_comment == 0">
  103. 评价
  104. </view>
  105. <view class="item-but but-class-two fs-28 mr-18" @click.stop="tackOut(item)"
  106. v-if="type == 1 && item.order_status == 2 || type == 1 && item.order_status == 4">
  107. <!-- 外卖 -->
  108. 取消订单
  109. </view>
  110. <view class="item-but but-class-two fs-28 mr-18" @click.stop="cancel(item)"
  111. v-if="type == 5 && item.order_status == 2">
  112. <!-- 干洗 -->
  113. 取消订单
  114. </view>
  115. <view class="item-but but-class-two fs-28 mr-18" @click.stop="expressCancel(item)"
  116. v-if="type == 2 && item.order_status == 2">
  117. <!-- 代取 -->
  118. 取消订单
  119. </view>
  120. <view class="item-but but-class-one fs-28 mr-18" @click.stop="orderPay(item)" v-if="item.order_status == 1">
  121. 立即支付
  122. </view>
  123. <view class="item-but but-class-one fs-28" @click.stop="openCode(item)"
  124. v-if="type == 5 && item.order_status == 2 || type == 5 && item.order_status == 4">
  125. 二维码
  126. </view>
  127. <view @click.stop="goToUrl('takeOut', item)" class="item-but but-class-one fs-28 mr-18"
  128. v-if="type == 1 && item.order_status == 3 || type == 1 && item.order_status == 7 || type == 1 && item.order_status == 8 || type == 1 && item.order_status == 9 || type == 1 && item.order_status == 10">
  129. <!-- 外卖 -->
  130. 再来一单
  131. </view>
  132. <view @click.stop="goToUrl('express', item)" class="item-but but-class-one fs-28 mr-18"
  133. v-if="type == 2 && item.order_status == 4 || type == 2 && item.order_status == 5 || type == 2 && item.order_status == 6">
  134. <!-- 代取 -->
  135. 再来一单
  136. </view>
  137. <view @click.stop="goToUrl('group', item)" class="item-but but-class-one fs-28 mr-18"
  138. v-if="type == 3 && item.order_status == 2 || type == 3 && item.order_status == 4">
  139. <!-- 团购 -->
  140. 再来一单
  141. </view>
  142. <view @click.stop="goToUrl('ticket', item)" class="item-but but-class-one fs-28 mr-18"
  143. v-if="type == 4 && item.order_status == 2 || type == 4 && item.order_status == 4">
  144. <!-- 票务 -->
  145. 再来一单
  146. </view>
  147. <view @click.stop="goToUrl('laundry', item)" class="item-but but-class-one fs-28 mr-18"
  148. v-if="type == 5 && item.order_status == 5 || type == 5 && item.order_status == 6 || type == 5 && item.order_status == 7">
  149. <!-- 干洗 -->
  150. 再来一单
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </scroll-view>
  156. <uni-popup ref="popup" border-radius="10px 10px 10px 10px" @maskClick='maskClick'>
  157. <view class="bgc-f b-rad-20" v-if="qrcodeData">
  158. <!-- <UniQrcode :text="qrcodeData"></UniQrcode> -->
  159. <uv-qrcode class="b-rad-20" ref="qrcode" :value="qrcodeData" :options="options2"></uv-qrcode>
  160. </view>
  161. </uni-popup>
  162. </view>
  163. </template>
  164. <script>
  165. // import UniQrcode from 'uniapp-qrcode'
  166. import tools from '@/service/tools';
  167. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  168. import {
  169. orderStatus,
  170. orderList,
  171. orderCancel,
  172. orderPay
  173. } from "@/api/order.js"
  174. import {
  175. getExpressPay
  176. } from "@/api/express.js"
  177. import {
  178. expressOrderStatus,
  179. expressOrderList,
  180. expressOrderCancel
  181. } from "@/api/expressOrder.js"
  182. import {
  183. groupPay
  184. } from '@/api/groupOrder.js';
  185. import {
  186. groupOrderStatus,
  187. groupOrderList
  188. } from "@/api/groupOrder.js"
  189. import {
  190. ticketPay
  191. } from '@/api/ticket.js';
  192. import {
  193. ticketOrderStatus,
  194. ticketOrderList
  195. } from "@/api/ticketOrder.js"
  196. import {
  197. laundryOrderStatus,
  198. laundryOrderList,
  199. laundryOrderCancel,
  200. laundryPay
  201. } from "@/api/laundryOrder.js"
  202. export default {
  203. components: {
  204. EnBlank
  205. },
  206. data() {
  207. return {
  208. type: 1,
  209. navList: [{
  210. name: '外卖',
  211. id: 1
  212. },
  213. {
  214. name: '代取',
  215. id: 2
  216. },
  217. {
  218. name: '团购',
  219. id: 3
  220. },
  221. {
  222. name: '票务',
  223. id: 4
  224. },
  225. {
  226. name: '干洗',
  227. id: 5
  228. },
  229. ],
  230. page: 1,
  231. list: [],
  232. total: 0,
  233. navTypeData: [],
  234. navTypeKey: 0,
  235. isAjax: false,
  236. qrcodeData: '',
  237. options2: {}
  238. };
  239. },
  240. onShow() {
  241. let orderPayType = uni.getStorageSync('orderPayType')
  242. let orderInfoType = uni.getStorageSync('orderInfoType')
  243. console.log(orderPayType, 'orderPayType');
  244. if (orderPayType) {
  245. this.selectType(orderPayType)
  246. console.log('固定type');
  247. } else if (orderInfoType) {
  248. return
  249. } else {
  250. this.resetList();
  251. }
  252. uni.showTabBar()
  253. },
  254. onLoad() {
  255. uni.$on('takeOutData', (data) => {
  256. console.log(data, '^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
  257. this.list.forEach((v, k) => {
  258. if (v.id == data.id) {
  259. v.order_status = data.order_status
  260. v.order_status_str = data.order_status_str
  261. }
  262. })
  263. this.$forceUpdate()
  264. uni.removeStorageSync('orderInfoType')
  265. console.log(this.list, 'this.list');
  266. })
  267. },
  268. onHide() {
  269. uni.removeStorageSync('orderPayType')
  270. },
  271. onUnload() {},
  272. mounted() {},
  273. methods: {
  274. openCode(item) {
  275. let m_id = uni.getStorageSync('m_id');
  276. this.qrcodeData = m_id + "_" + item.order_sn
  277. this.options2 = {
  278. size: 300,
  279. margin: 10
  280. }
  281. uni.hideTabBar()
  282. this.$refs.popup.open('center')
  283. },
  284. maskClick() {
  285. this.$refs.popup.close()
  286. this.qrcodeData = ''
  287. uni.showTabBar()
  288. },
  289. goToShop(item) {
  290. // 进入店铺
  291. uni.navigateTo({
  292. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  293. })
  294. },
  295. goToUrl(type, item) {
  296. // 再来一单
  297. if (type == 'takeOut') {
  298. // uni.navigateTo({
  299. // url: '/pages-takeout/takeout'
  300. // })
  301. uni.navigateTo({
  302. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  303. })
  304. } else if (type == 'express') {
  305. uni.navigateTo({
  306. url: '/pages-takeout/replace-take'
  307. })
  308. } else if (type == 'group') {
  309. uni.navigateTo({
  310. url: '/pages-buy/group'
  311. })
  312. } else if (type == 'ticket') {
  313. uni.navigateTo({
  314. url: '/pages-buy/ticket'
  315. })
  316. } else if (type == 'laundry') {
  317. uni.navigateTo({
  318. url: '/pages-buy/dry-clean'
  319. })
  320. }
  321. },
  322. goToInfo(item) {
  323. if (this.type === 1) {
  324. uni.navigateTo({
  325. url: `/pages-order/takeout-info?orderId=` + item.id
  326. })
  327. } else if (this.type === 2) {
  328. uni.navigateTo({
  329. url: `/pages-order/express-info?orderId=` + item.id
  330. })
  331. } else if (this.type === 3) {
  332. uni.navigateTo({
  333. url: `/pages-order/group-info?orderId=` + item.id
  334. })
  335. } else if (this.type === 4) {
  336. uni.navigateTo({
  337. url: `/pages-order/ticket-info?orderId=` + item.id
  338. })
  339. } else if (this.type === 5) {
  340. uni.navigateTo({
  341. url: `/pages-order/laundry-info?orderId=` + item.id
  342. })
  343. }
  344. uni.setStorageSync('orderInfoType', this.type)
  345. },
  346. orderPay(item) {
  347. // 立即支付
  348. if (this.type === 1) {
  349. this.takeawayPay(item.id)
  350. } else if (this.type === 2) {
  351. this.getExpressPay(item.id)
  352. } else if (this.type === 3) {
  353. this.groupPay(item.id)
  354. } else if (this.type === 4) {
  355. this.ticketPay(item.id)
  356. } else if (this.type === 5) {
  357. this.laundryPay(item.id)
  358. }
  359. },
  360. navTypeClick(key) {
  361. if (this.navTypeKey != key) {
  362. this.navTypeKey = key
  363. this.page = 1
  364. this.list = []
  365. if (this.type === 1) {
  366. this.orderList()
  367. } else if (this.type === 2) {
  368. this.expressOrderList()
  369. } else if (this.type === 3) {
  370. this.groupOrderList()
  371. } else if (this.type === 4) {
  372. this.ticketOrderList()
  373. } else if (this.type === 5) {
  374. this.laundryOrderList()
  375. }
  376. }
  377. },
  378. resetList() {
  379. this.page = 1;
  380. this.list = [];
  381. this.getList();
  382. uni.removeStorageSync('orderPayType')
  383. },
  384. selectType(type) {
  385. let orderPayType = uni.getStorageSync('orderPayType')
  386. if (type != this.type || orderPayType) {
  387. this.type = type;
  388. this.navTypeKey = 0
  389. this.resetList();
  390. }
  391. },
  392. assess(item) {
  393. // 外卖评价
  394. uni.navigateTo({
  395. url: `/pages-my/appraise?orderId=` + item.id + '&shopName=' + item.shop_name + '&shopLogo=' +
  396. item.shop_logo
  397. })
  398. },
  399. tackOut(item) {
  400. // 外卖取消订单
  401. uni.showModal({
  402. title: '提示',
  403. content: '是否取消订单?',
  404. confirmText: '确定',
  405. confirmColor: '#FB3D03',
  406. success: (res) => {
  407. if (res.confirm === true) {
  408. if (this.isAJAX) {
  409. return
  410. }
  411. this.isAJAX = true;
  412. orderCancel({
  413. order_id: item.id
  414. }).then((res) => {
  415. if (res.code == 1) {
  416. tools.success(res.msg)
  417. setTimeout(() => {
  418. this.page = 1;
  419. this.list = [];
  420. this.orderList()
  421. }, 1500)
  422. this.isAJAX = false;
  423. } else {
  424. tools.error(res.msg)
  425. this.isAJAX = false;
  426. }
  427. })
  428. }
  429. }
  430. });
  431. },
  432. expressCancel(item) {
  433. // 代取取消订单
  434. uni.showModal({
  435. title: '提示',
  436. content: '是否取消订单?',
  437. confirmText: '确定',
  438. confirmColor: '#FB3D03',
  439. success: (res) => {
  440. if (res.confirm === true) {
  441. if (this.isAJAX) {
  442. return
  443. }
  444. this.isAJAX = true;
  445. expressOrderCancel({
  446. order_id: item.id
  447. }).then((res) => {
  448. if (res.code == 1) {
  449. tools.success(res.msg)
  450. setTimeout(() => {
  451. this.page = 1;
  452. this.list = [];
  453. this.expressOrderList()
  454. }, 1500)
  455. this.isAJAX = false;
  456. } else {
  457. tools.error(res.msg)
  458. this.isAJAX = false;
  459. }
  460. })
  461. }
  462. }
  463. });
  464. },
  465. cancel(item) {
  466. // 干洗取消订单
  467. uni.showModal({
  468. title: '提示',
  469. content: '是否取消订单?',
  470. confirmText: '确定',
  471. confirmColor: '#FB3D03',
  472. success: (res) => {
  473. if (res.confirm === true) {
  474. if (this.isAJAX) {
  475. return
  476. }
  477. this.isAJAX = true;
  478. laundryOrderCancel({
  479. order_id: item.id
  480. }).then((res) => {
  481. if (res.code == 1) {
  482. tools.success(res.msg)
  483. setTimeout(() => {
  484. this.page = 1;
  485. this.list = [];
  486. this.laundryOrderList()
  487. }, 1500)
  488. this.isAJAX = false;
  489. } else {
  490. tools.error(res.msg)
  491. this.isAJAX = false;
  492. }
  493. })
  494. }
  495. }
  496. });
  497. },
  498. scrolltolower() {
  499. ++this.page
  500. if (this.type === 1) {
  501. this.orderList()
  502. } else if (this.type === 2) {
  503. this.expressOrderList()
  504. } else if (this.type === 3) {
  505. this.groupOrderList()
  506. } else if (this.type === 4) {
  507. this.ticketOrderList()
  508. } else if (this.type === 5) {
  509. this.laundryOrderList()
  510. }
  511. // console.log('触底');
  512. },
  513. getList() {
  514. if (this.type === 1) {
  515. this.orderStatus()
  516. this.orderList()
  517. } else if (this.type === 2) {
  518. this.expressOrderStatus()
  519. this.expressOrderList()
  520. } else if (this.type === 3) {
  521. this.groupOrderStatus()
  522. this.groupOrderList()
  523. } else if (this.type === 4) {
  524. this.ticketOrderStatus()
  525. this.ticketOrderList()
  526. } else if (this.type === 5) {
  527. this.laundryOrderStatus()
  528. this.laundryOrderList()
  529. }
  530. },
  531. expressOrderStatus() {
  532. // 代取订单状态
  533. expressOrderStatus().then((res) => {
  534. if (res.code == 1) {
  535. this.navTypeData = res.data
  536. }
  537. })
  538. },
  539. orderStatus() {
  540. // 外卖订单状态
  541. orderStatus().then((res) => {
  542. if (res.code == 1) {
  543. this.navTypeData = res.data
  544. }
  545. })
  546. },
  547. groupOrderStatus() {
  548. // 团购订单状态
  549. groupOrderStatus().then((res) => {
  550. if (res.code == 1) {
  551. this.navTypeData = res.data
  552. }
  553. })
  554. },
  555. ticketOrderStatus() {
  556. // 票务订单状态
  557. ticketOrderStatus().then((res) => {
  558. if (res.code == 1) {
  559. this.navTypeData = res.data
  560. }
  561. })
  562. },
  563. laundryOrderStatus() {
  564. // 干洗订单状态
  565. laundryOrderStatus().then((res) => {
  566. if (res.code == 1) {
  567. this.navTypeData = res.data
  568. }
  569. })
  570. },
  571. orderList() {
  572. // 外卖订单列表
  573. orderList({
  574. status: this.navTypeKey,
  575. page: this.page
  576. }).then((res) => {
  577. if (res.code == 1) {
  578. if (res.data.items.length > 0) {
  579. this.list.push(...res.data.items)
  580. }
  581. }
  582. })
  583. },
  584. expressOrderList() {
  585. // 代取订单列表
  586. expressOrderList({
  587. status: this.navTypeKey,
  588. page: this.page
  589. }).then((res) => {
  590. if (res.code == 1) {
  591. if (res.data.items.length > 0) {
  592. this.list.push(...res.data.items)
  593. }
  594. }
  595. })
  596. },
  597. groupOrderList() {
  598. // 团购订单列表
  599. groupOrderList({
  600. status: this.navTypeKey,
  601. page: this.page
  602. }).then((res) => {
  603. if (res.code == 1) {
  604. if (res.data.items.length > 0) {
  605. this.list.push(...res.data.items)
  606. }
  607. }
  608. })
  609. },
  610. ticketOrderList() {
  611. // 票务订单列表
  612. ticketOrderList({
  613. status: this.navTypeKey,
  614. page: this.page
  615. }).then((res) => {
  616. if (res.code == 1) {
  617. if (res.data.items.length > 0) {
  618. this.list.push(...res.data.items)
  619. }
  620. }
  621. })
  622. },
  623. laundryOrderList() {
  624. // 干洗订单列表
  625. laundryOrderList({
  626. status: this.navTypeKey,
  627. page: this.page
  628. }).then((res) => {
  629. if (res.code == 1) {
  630. if (res.data.items.length > 0) {
  631. this.list.push(...res.data.items)
  632. }
  633. }
  634. })
  635. },
  636. takeawayPay(id) {
  637. // 外卖支付
  638. if (this.isAJAX) {
  639. return
  640. }
  641. this.isAJAX = true;
  642. orderPay({
  643. order_id: id
  644. }).then((ret) => {
  645. if (ret.code === 1) {
  646. uni.requestPayment({
  647. provider: "wxpay", //支付类型-固定值
  648. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  649. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  650. package: ret.data.wx_pay.package, // 固定值
  651. signType: ret.data.wx_pay.signType, //固定值
  652. paySign: ret.data.wx_pay.paySign, //签名
  653. success: (ren) => {
  654. tools.success("支付成功");
  655. this.isAJAX = false;
  656. this.page = 1;
  657. this.list = [];
  658. this.orderList()
  659. },
  660. fail: (err) => {
  661. this.isAJAX = false;
  662. tools.error("支付失败");
  663. },
  664. });
  665. } else {
  666. this.isAJAX = false;
  667. tools.error("支付失败");
  668. }
  669. })
  670. },
  671. getExpressPay(id) {
  672. // 代取支付
  673. if (this.isAJAX) {
  674. return
  675. }
  676. this.isAJAX = true;
  677. getExpressPay({
  678. order_id: id
  679. }).then((ret) => {
  680. if (ret.code === 1) {
  681. uni.requestPayment({
  682. provider: "wxpay", //支付类型-固定值
  683. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  684. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  685. package: ret.data.wx_pay.package, // 固定值
  686. signType: ret.data.wx_pay.signType, //固定值
  687. paySign: ret.data.wx_pay.paySign, //签名
  688. success: (ren) => {
  689. tools.success("支付成功");
  690. this.isAJAX = false;
  691. this.page = 1;
  692. this.list = [];
  693. this.expressOrderList()
  694. },
  695. fail: (err) => {
  696. this.isAJAX = false;
  697. tools.error("支付失败");
  698. },
  699. });
  700. } else {
  701. this.isAJAX = false;
  702. tools.error("支付失败");
  703. }
  704. })
  705. },
  706. groupPay(id) {
  707. // 团购支付
  708. if (this.isAJAX) {
  709. return
  710. }
  711. this.isAJAX = true;
  712. groupPay({
  713. order_id: id
  714. }).then((ret) => {
  715. if (ret.code === 1) {
  716. uni.requestPayment({
  717. provider: "wxpay", //支付类型-固定值
  718. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  719. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  720. package: ret.data.wx_pay.package, // 固定值
  721. signType: ret.data.wx_pay.signType, //固定值
  722. paySign: ret.data.wx_pay.paySign, //签名
  723. success: (ren) => {
  724. tools.success("支付成功");
  725. this.isAJAX = false;
  726. this.page = 1;
  727. this.list = [];
  728. this.groupOrderList()
  729. },
  730. fail: (err) => {
  731. this.isAJAX = false;
  732. tools.error("支付失败");
  733. },
  734. });
  735. } else {
  736. this.isAJAX = false;
  737. tools.error("支付失败");
  738. }
  739. })
  740. },
  741. ticketPay(id) {
  742. // 票务支付
  743. if (this.isAJAX) {
  744. return
  745. }
  746. this.isAJAX = true;
  747. ticketPay({
  748. order_id: id
  749. }).then((ret) => {
  750. if (ret.code === 1) {
  751. uni.requestPayment({
  752. provider: "wxpay", //支付类型-固定值
  753. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  754. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  755. package: ret.data.wx_pay.package, // 固定值
  756. signType: ret.data.wx_pay.signType, //固定值
  757. paySign: ret.data.wx_pay.paySign, //签名
  758. success: (ren) => {
  759. tools.success("支付成功");
  760. this.isAJAX = false;
  761. this.page = 1;
  762. this.list = [];
  763. this.ticketOrderList()
  764. },
  765. fail: (err) => {
  766. this.isAJAX = false;
  767. tools.error("支付失败");
  768. },
  769. });
  770. } else {
  771. this.isAJAX = false;
  772. tools.error("支付失败");
  773. }
  774. })
  775. },
  776. laundryPay(id) {
  777. // 干洗支付
  778. if (this.isAJAX) {
  779. return
  780. }
  781. this.isAJAX = true;
  782. laundryPay({
  783. order_id: id
  784. }).then((ret) => {
  785. if (ret.code === 1) {
  786. uni.requestPayment({
  787. provider: "wxpay", //支付类型-固定值
  788. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  789. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  790. package: ret.data.wx_pay.package, // 固定值
  791. signType: ret.data.wx_pay.signType, //固定值
  792. paySign: ret.data.wx_pay.paySign, //签名
  793. success: (ren) => {
  794. tools.success("支付成功");
  795. this.isAJAX = false;
  796. this.page = 1;
  797. this.list = [];
  798. this.laundryOrderList()
  799. },
  800. fail: (err) => {
  801. this.isAJAX = false;
  802. tools.error("支付失败");
  803. },
  804. });
  805. } else {
  806. this.isAJAX = false;
  807. tools.error("支付失败");
  808. }
  809. })
  810. }
  811. },
  812. }
  813. </script>
  814. <style lang="scss" scoped>
  815. .nav-b {
  816. position: relative;
  817. z-index: -1 !important;
  818. }
  819. .nav-box {
  820. padding: 26rpx 44rpx;
  821. overflow-x: scroll;
  822. .nav-item {
  823. margin-right: 76rpx;
  824. white-space: nowrap;
  825. position: relative;
  826. .nav-item-x {
  827. position: absolute;
  828. width: 48rpx;
  829. height: 6rpx;
  830. border-radius: 20rpx;
  831. background-color: #41ABF5;
  832. left: 12rpx;
  833. bottom: -10rpx;
  834. }
  835. }
  836. }
  837. .nav-type-box {
  838. width: 100%;
  839. white-space: nowrap;
  840. }
  841. .nav-type-item {
  842. width: 144rpx;
  843. height: 64rpx;
  844. line-height: 64rpx;
  845. margin: 0 24rpx 0 0;
  846. border-radius: 200rpx;
  847. display: inline-block;
  848. }
  849. .nav-type-item:last-child {
  850. margin: 0;
  851. }
  852. .list-box {
  853. padding: 20rpx;
  854. box-sizing: border-box;
  855. }
  856. .shops-img {
  857. width: 48rpx;
  858. height: 48rpx;
  859. margin: 0 8rpx 0 0;
  860. border-radius: 50%;
  861. }
  862. .shops-name {
  863. max-width: 452rpx;
  864. margin: 0 8rpx 0 0;
  865. }
  866. .icons {
  867. width: 32rpx;
  868. height: 32rpx;
  869. }
  870. .goods-box {
  871. max-width: 506rpx;
  872. height: auto;
  873. }
  874. .goods-num {
  875. width: 24rpx;
  876. height: auto;
  877. }
  878. .goods-img {
  879. width: 144rpx;
  880. height: 144rpx;
  881. border-radius: 12rpx;
  882. margin: 0 16rpx 0 0;
  883. }
  884. .goods-two {
  885. overflow-x: scroll;
  886. overflow: auto;
  887. }
  888. .goods-two-name {
  889. width: 144rpx;
  890. }
  891. .item-but {
  892. width: 160rpx;
  893. height: 64rpx;
  894. line-height: 64rpx;
  895. text-align: center;
  896. border-radius: 200rpx;
  897. }
  898. .but-class-one {
  899. background: linear-gradient(225deg, #41ABF5 0%, #5BD8FB 100%);
  900. color: #fff;
  901. }
  902. .but-class-two {
  903. background: #fff;
  904. border: 2rpx solid #CCCCCC;
  905. color: #333;
  906. }
  907. </style>