index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929
  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"
  12. :key="i" @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
  74. class="fs-28 fc-6 text-overflow-ellipsis-one goods-two-name text-align-center">
  75. {{itemGoods.goods_name}}
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="goods-box" v-else>
  81. <view class="align-items-center">
  82. <image class="goods-img flex-shrink0" :src="item.goods_img" mode="aspectFit">
  83. </image>
  84. <view class="fs-28 fc-6 text-overflow-ellipsis">
  85. {{item.goods_name}}
  86. </view>
  87. </view>
  88. </view>
  89. <view class="goods-num text-align-center">
  90. 共 {{item.goods_number}} 件
  91. </view>
  92. </view>
  93. <view class="align-items-center flex-justify-space mb-24">
  94. <view class="fs-24 fc-9">
  95. 下单时间:{{item.created_at}}
  96. </view>
  97. <view class="fs-28 fc-9">
  98. {{item.order_status == 1?'需付':'实付'}} <text
  99. class="fs-32 fc-3 fw-600">¥{{item.pay_money}}</text>
  100. </view>
  101. </view>
  102. <view class="align-items-center flex-justify-end">
  103. <view class="item-but but-class-two fs-28 mr-18" @click="assess(item)"
  104. v-if="type == 1 && item.order_status == 7 && item.is_comment == 0">
  105. 评价
  106. </view>
  107. <view class="item-but but-class-two fs-28 mr-18" @click.stop="tackOut(item)"
  108. v-if="type == 1 && item.order_status == 2 || type == 1 && item.order_status == 4">
  109. <!-- 外卖 -->
  110. 取消订单
  111. </view>
  112. <view class="item-but but-class-two fs-28 mr-18" @click.stop="cancel(item)"
  113. v-if="type == 5 && item.order_status == 2">
  114. <!-- 干洗 -->
  115. 取消订单
  116. </view>
  117. <view class="item-but but-class-two fs-28 mr-18" @click.stop="expressCancel(item)"
  118. v-if="type == 2 && item.order_status == 2">
  119. <!-- 代取 -->
  120. 取消订单
  121. </view>
  122. <view class="item-but but-class-one fs-28 mr-18" @click.stop="orderPay(item)"
  123. v-if="item.order_status == 1">
  124. 立即支付
  125. </view>
  126. <view class="item-but but-class-one fs-28" @click.stop="openCode(item)"
  127. v-if="type == 5 && item.order_status == 2 || type == 5 && item.order_status == 4">
  128. 二维码
  129. </view>
  130. <view @click.stop="goToUrl('takeOut', item)" class="item-but but-class-one fs-28 mr-18"
  131. 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">
  132. <!-- 外卖 -->
  133. 再来一单
  134. </view>
  135. <view @click.stop="goToUrl('express', item)" class="item-but but-class-one fs-28 mr-18"
  136. v-if="type == 2 && item.order_status == 4 || type == 2 && item.order_status == 5 || type == 2 && item.order_status == 6">
  137. <!-- 代取 -->
  138. 再来一单
  139. </view>
  140. <view @click.stop="goToUrl('group', item)" class="item-but but-class-one fs-28 mr-18"
  141. v-if="type == 3 && item.order_status == 2 || type == 3 && item.order_status == 4">
  142. <!-- 团购 -->
  143. 再来一单
  144. </view>
  145. <view @click.stop="goToUrl('ticket', item)" class="item-but but-class-one fs-28 mr-18"
  146. v-if="type == 4 && item.order_status == 2 || type == 4 && item.order_status == 4">
  147. <!-- 票务 -->
  148. 再来一单
  149. </view>
  150. <view @click.stop="goToUrl('laundry', item)" class="item-but but-class-one fs-28 mr-18"
  151. v-if="type == 5 && item.order_status == 5 || type == 5 && item.order_status == 6 || type == 5 && item.order_status == 7">
  152. <!-- 干洗 -->
  153. 再来一单
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </scroll-view>
  159. <uni-popup ref="popup" border-radius="10px 10px 10px 10px" @maskClick='maskClick'>
  160. <view class="bgc-f b-rad-20" v-if="qrcodeData">
  161. <!-- <UniQrcode :text="qrcodeData"></UniQrcode> -->
  162. <uv-qrcode class="b-rad-20" ref="qrcode" :value="qrcodeData" :options="options2"></uv-qrcode>
  163. </view>
  164. </uni-popup>
  165. </view>
  166. </template>
  167. <script>
  168. // import UniQrcode from 'uniapp-qrcode'
  169. import tools from '@/service/tools';
  170. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  171. import {
  172. orderStatus,
  173. orderList,
  174. orderCancel,
  175. orderPay
  176. } from "@/api/order.js"
  177. import {
  178. getExpressPay
  179. } from "@/api/express.js"
  180. import {
  181. expressOrderStatus,
  182. expressOrderList,
  183. expressOrderCancel
  184. } from "@/api/expressOrder.js"
  185. import {
  186. groupPay
  187. } from '@/api/groupOrder.js';
  188. import {
  189. groupOrderStatus,
  190. groupOrderList
  191. } from "@/api/groupOrder.js"
  192. import {
  193. ticketPay
  194. } from '@/api/ticket.js';
  195. import {
  196. ticketOrderStatus,
  197. ticketOrderList
  198. } from "@/api/ticketOrder.js"
  199. import {
  200. laundryOrderStatus,
  201. laundryOrderList,
  202. laundryOrderCancel,
  203. laundryPay
  204. } from "@/api/laundryOrder.js"
  205. export default {
  206. components: {
  207. EnBlank
  208. },
  209. data() {
  210. return {
  211. type: 1,
  212. navList: [{
  213. name: '外卖',
  214. id: 1
  215. },
  216. {
  217. name: '代取',
  218. id: 2
  219. },
  220. {
  221. name: '团购',
  222. id: 3
  223. },
  224. {
  225. name: '票务',
  226. id: 4
  227. },
  228. {
  229. name: '干洗',
  230. id: 5
  231. },
  232. ],
  233. page: 1,
  234. list: [],
  235. total: 0,
  236. navTypeData: [],
  237. navTypeKey: 0,
  238. isAjax: false,
  239. qrcodeData: '',
  240. options2: {}
  241. };
  242. },
  243. onShow() {
  244. let orderPayType = uni.getStorageSync('orderPayType')
  245. console.log(orderPayType, 'orderPayType');
  246. if (orderPayType) {
  247. this.selectType(orderPayType)
  248. console.log('固定type');
  249. }
  250. },
  251. onLoad() {
  252. uni.$on('takeOutData', (data) => {
  253. console.log(data, '^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
  254. this.list.forEach((v, k) => {
  255. if (v.id == data.id) {
  256. v.order_status = data.order_status
  257. v.order_status_str = data.order_status_str
  258. }
  259. })
  260. this.$forceUpdate()
  261. console.log(this.list, 'this.list');
  262. })
  263. },
  264. onHide() {
  265. uni.removeStorageSync('orderPayType')
  266. },
  267. onUnload() {
  268. console.log("监听页面卸载");
  269. },
  270. mounted() {
  271. this.resetList();
  272. console.log('默认type');
  273. },
  274. methods: {
  275. openCode(item) {
  276. let m_id = uni.getStorageSync('m_id');
  277. this.qrcodeData = m_id + "_" + item.order_sn
  278. this.options2 = {
  279. size: 300,
  280. margin: 10
  281. }
  282. uni.hideTabBar()
  283. this.$refs.popup.open('center')
  284. },
  285. maskClick() {
  286. this.$refs.popup.close()
  287. this.qrcodeData = ''
  288. uni.showTabBar()
  289. },
  290. goToShop(item) {
  291. // 进入店铺
  292. uni.navigateTo({
  293. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  294. })
  295. },
  296. goToUrl(type, item) {
  297. // 再来一单
  298. if (type == 'takeOut') {
  299. // uni.navigateTo({
  300. // url: '/pages-takeout/takeout'
  301. // })
  302. uni.navigateTo({
  303. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  304. })
  305. } else if (type == 'express') {
  306. uni.navigateTo({
  307. url: '/pages-takeout/replace-take'
  308. })
  309. } else if (type == 'group') {
  310. uni.navigateTo({
  311. url: '/pages-buy/group'
  312. })
  313. } else if (type == 'ticket') {
  314. uni.navigateTo({
  315. url: '/pages-buy/ticket'
  316. })
  317. } else if (type == 'laundry') {
  318. uni.navigateTo({
  319. url: '/pages-buy/dry-clean'
  320. })
  321. }
  322. },
  323. goToInfo(item) {
  324. if (this.type === 1) {
  325. uni.navigateTo({
  326. url: `/pages-order/takeout-info?orderId=` + item.id
  327. })
  328. } else if (this.type === 2) {
  329. uni.navigateTo({
  330. url: `/pages-order/express-info?orderId=` + item.id
  331. })
  332. } else if (this.type === 3) {
  333. uni.navigateTo({
  334. url: `/pages-order/group-info?orderId=` + item.id
  335. })
  336. } else if (this.type === 4) {
  337. uni.navigateTo({
  338. url: `/pages-order/ticket-info?orderId=` + item.id
  339. })
  340. } else if (this.type === 5) {
  341. uni.navigateTo({
  342. url: `/pages-order/laundry-info?orderId=` + item.id
  343. })
  344. }
  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>