index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  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. <view class="align-items-center">
  163. <view class="">
  164. 唯一码
  165. </view>
  166. <view class="">
  167. {{onlyCode}}
  168. </view>
  169. </view>
  170. <uv-qrcode class="b-rad-20" ref="qrcode" :value="qrcodeData" :options="options2"></uv-qrcode>
  171. </view>
  172. </uni-popup>
  173. </view>
  174. </template>
  175. <script>
  176. // import UniQrcode from 'uniapp-qrcode'
  177. import tools from '@/service/tools';
  178. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  179. import {
  180. orderStatus,
  181. orderList,
  182. orderCancel,
  183. orderPay
  184. } from "@/api/order.js"
  185. import {
  186. getExpressPay
  187. } from "@/api/express.js"
  188. import {
  189. expressOrderStatus,
  190. expressOrderList,
  191. expressOrderCancel
  192. } from "@/api/expressOrder.js"
  193. import {
  194. groupPay
  195. } from '@/api/groupOrder.js';
  196. import {
  197. groupOrderStatus,
  198. groupOrderList
  199. } from "@/api/groupOrder.js"
  200. import {
  201. ticketPay
  202. } from '@/api/ticket.js';
  203. import {
  204. ticketOrderStatus,
  205. ticketOrderList
  206. } from "@/api/ticketOrder.js"
  207. import {
  208. laundryOrderStatus,
  209. laundryOrderList,
  210. laundryOrderCancel,
  211. laundryPay
  212. } from "@/api/laundryOrder.js"
  213. export default {
  214. components: {
  215. EnBlank
  216. },
  217. data() {
  218. return {
  219. type: 1,
  220. navList: [{
  221. name: '外卖',
  222. id: 1
  223. },
  224. {
  225. name: '代取',
  226. id: 2
  227. },
  228. {
  229. name: '团购',
  230. id: 3
  231. },
  232. {
  233. name: '票务',
  234. id: 4
  235. },
  236. {
  237. name: '干洗',
  238. id: 5
  239. },
  240. ],
  241. page: 1,
  242. list: [],
  243. total: 0,
  244. navTypeData: [],
  245. navTypeKey: 0,
  246. isAjax: false,
  247. qrcodeData: '',
  248. options2: {},
  249. onlyCode: ''
  250. };
  251. },
  252. onShow() {
  253. let orderPayType = uni.getStorageSync('orderPayType')
  254. let orderInfoType = uni.getStorageSync('orderInfoType')
  255. console.log(orderPayType, 'orderPayType');
  256. if (orderPayType) {
  257. this.selectType(orderPayType)
  258. console.log('固定type');
  259. } else if (orderInfoType) {
  260. return
  261. } else {
  262. this.resetList();
  263. }
  264. uni.showTabBar()
  265. },
  266. onLoad() {
  267. uni.$on('takeOutData', (data) => {
  268. console.log(data, '^^^^^^^^^^^^^^^^^^^^^^^^^^^^');
  269. this.list.forEach((v, k) => {
  270. if (v.id == data.id) {
  271. v.order_status = data.order_status
  272. v.order_status_str = data.order_status_str
  273. }
  274. })
  275. this.$forceUpdate()
  276. uni.removeStorageSync('orderInfoType')
  277. console.log(this.list, 'this.list');
  278. })
  279. },
  280. onHide() {
  281. uni.removeStorageSync('orderPayType')
  282. },
  283. onUnload() {},
  284. mounted() {},
  285. methods: {
  286. openCode(item) {
  287. this.onlyCode = item.only_code
  288. let m_id = uni.getStorageSync('m_id');
  289. this.qrcodeData = m_id + "_" + item.order_sn
  290. this.options2 = {
  291. size: 300,
  292. margin: 10
  293. }
  294. uni.hideTabBar()
  295. this.$refs.popup.open('center')
  296. },
  297. maskClick() {
  298. this.$refs.popup.close()
  299. this.qrcodeData = ''
  300. uni.showTabBar()
  301. },
  302. goToShop(item) {
  303. // 进入店铺
  304. uni.navigateTo({
  305. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  306. })
  307. },
  308. goToUrl(type, item) {
  309. // 再来一单
  310. if (type == 'takeOut') {
  311. // uni.navigateTo({
  312. // url: '/pages-takeout/takeout'
  313. // })
  314. uni.navigateTo({
  315. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  316. })
  317. } else if (type == 'express') {
  318. uni.navigateTo({
  319. url: '/pages-takeout/replace-take'
  320. })
  321. } else if (type == 'group') {
  322. uni.navigateTo({
  323. url: '/pages-buy/group'
  324. })
  325. } else if (type == 'ticket') {
  326. uni.navigateTo({
  327. url: '/pages-buy/ticket'
  328. })
  329. } else if (type == 'laundry') {
  330. uni.navigateTo({
  331. url: '/pages-buy/dry-clean'
  332. })
  333. }
  334. },
  335. goToInfo(item) {
  336. if (this.type === 1) {
  337. uni.navigateTo({
  338. url: `/pages-order/takeout-info?orderId=` + item.id
  339. })
  340. } else if (this.type === 2) {
  341. uni.navigateTo({
  342. url: `/pages-order/express-info?orderId=` + item.id
  343. })
  344. } else if (this.type === 3) {
  345. uni.navigateTo({
  346. url: `/pages-order/group-info?orderId=` + item.id
  347. })
  348. } else if (this.type === 4) {
  349. uni.navigateTo({
  350. url: `/pages-order/ticket-info?orderId=` + item.id
  351. })
  352. } else if (this.type === 5) {
  353. uni.navigateTo({
  354. url: `/pages-order/laundry-info?orderId=` + item.id
  355. })
  356. }
  357. uni.setStorageSync('orderInfoType', this.type)
  358. },
  359. orderPay(item) {
  360. // 立即支付
  361. if (this.type === 1) {
  362. this.takeawayPay(item.id)
  363. } else if (this.type === 2) {
  364. this.getExpressPay(item.id)
  365. } else if (this.type === 3) {
  366. this.groupPay(item.id)
  367. } else if (this.type === 4) {
  368. this.ticketPay(item.id)
  369. } else if (this.type === 5) {
  370. this.laundryPay(item.id)
  371. }
  372. },
  373. navTypeClick(key) {
  374. if (this.navTypeKey != key) {
  375. this.navTypeKey = key
  376. this.page = 1
  377. this.list = []
  378. if (this.type === 1) {
  379. this.orderList()
  380. } else if (this.type === 2) {
  381. this.expressOrderList()
  382. } else if (this.type === 3) {
  383. this.groupOrderList()
  384. } else if (this.type === 4) {
  385. this.ticketOrderList()
  386. } else if (this.type === 5) {
  387. this.laundryOrderList()
  388. }
  389. }
  390. },
  391. resetList() {
  392. this.page = 1;
  393. this.list = [];
  394. this.getList();
  395. uni.removeStorageSync('orderPayType')
  396. },
  397. selectType(type) {
  398. let orderPayType = uni.getStorageSync('orderPayType')
  399. if (type != this.type || orderPayType) {
  400. this.type = type;
  401. this.navTypeKey = 0
  402. this.resetList();
  403. }
  404. },
  405. assess(item) {
  406. // 外卖评价
  407. uni.navigateTo({
  408. url: `/pages-my/appraise?orderId=` + item.id + '&shopName=' + item.shop_name + '&shopLogo=' +
  409. item.shop_logo
  410. })
  411. },
  412. tackOut(item) {
  413. // 外卖取消订单
  414. uni.showModal({
  415. title: '提示',
  416. content: '是否取消订单?',
  417. confirmText: '确定',
  418. confirmColor: '#FB3D03',
  419. success: (res) => {
  420. if (res.confirm === true) {
  421. if (this.isAJAX) {
  422. return
  423. }
  424. this.isAJAX = true;
  425. orderCancel({
  426. order_id: item.id
  427. }).then((res) => {
  428. if (res.code == 1) {
  429. tools.success(res.msg)
  430. setTimeout(() => {
  431. this.page = 1;
  432. this.list = [];
  433. this.orderList()
  434. }, 1500)
  435. this.isAJAX = false;
  436. } else {
  437. tools.error(res.msg)
  438. this.isAJAX = false;
  439. }
  440. })
  441. }
  442. }
  443. });
  444. },
  445. expressCancel(item) {
  446. // 代取取消订单
  447. uni.showModal({
  448. title: '提示',
  449. content: '是否取消订单?',
  450. confirmText: '确定',
  451. confirmColor: '#FB3D03',
  452. success: (res) => {
  453. if (res.confirm === true) {
  454. if (this.isAJAX) {
  455. return
  456. }
  457. this.isAJAX = true;
  458. expressOrderCancel({
  459. order_id: item.id
  460. }).then((res) => {
  461. if (res.code == 1) {
  462. tools.success(res.msg)
  463. setTimeout(() => {
  464. this.page = 1;
  465. this.list = [];
  466. this.expressOrderList()
  467. }, 1500)
  468. this.isAJAX = false;
  469. } else {
  470. tools.error(res.msg)
  471. this.isAJAX = false;
  472. }
  473. })
  474. }
  475. }
  476. });
  477. },
  478. cancel(item) {
  479. // 干洗取消订单
  480. uni.showModal({
  481. title: '提示',
  482. content: '是否取消订单?',
  483. confirmText: '确定',
  484. confirmColor: '#FB3D03',
  485. success: (res) => {
  486. if (res.confirm === true) {
  487. if (this.isAJAX) {
  488. return
  489. }
  490. this.isAJAX = true;
  491. laundryOrderCancel({
  492. order_id: item.id
  493. }).then((res) => {
  494. if (res.code == 1) {
  495. tools.success(res.msg)
  496. setTimeout(() => {
  497. this.page = 1;
  498. this.list = [];
  499. this.laundryOrderList()
  500. }, 1500)
  501. this.isAJAX = false;
  502. } else {
  503. tools.error(res.msg)
  504. this.isAJAX = false;
  505. }
  506. })
  507. }
  508. }
  509. });
  510. },
  511. scrolltolower() {
  512. ++this.page
  513. if (this.type === 1) {
  514. this.orderList()
  515. } else if (this.type === 2) {
  516. this.expressOrderList()
  517. } else if (this.type === 3) {
  518. this.groupOrderList()
  519. } else if (this.type === 4) {
  520. this.ticketOrderList()
  521. } else if (this.type === 5) {
  522. this.laundryOrderList()
  523. }
  524. // console.log('触底');
  525. },
  526. getList() {
  527. if (this.type === 1) {
  528. this.orderStatus()
  529. this.orderList()
  530. } else if (this.type === 2) {
  531. this.expressOrderStatus()
  532. this.expressOrderList()
  533. } else if (this.type === 3) {
  534. this.groupOrderStatus()
  535. this.groupOrderList()
  536. } else if (this.type === 4) {
  537. this.ticketOrderStatus()
  538. this.ticketOrderList()
  539. } else if (this.type === 5) {
  540. this.laundryOrderStatus()
  541. this.laundryOrderList()
  542. }
  543. },
  544. expressOrderStatus() {
  545. // 代取订单状态
  546. expressOrderStatus().then((res) => {
  547. if (res.code == 1) {
  548. this.navTypeData = res.data
  549. }
  550. })
  551. },
  552. orderStatus() {
  553. // 外卖订单状态
  554. orderStatus().then((res) => {
  555. if (res.code == 1) {
  556. this.navTypeData = res.data
  557. }
  558. })
  559. },
  560. groupOrderStatus() {
  561. // 团购订单状态
  562. groupOrderStatus().then((res) => {
  563. if (res.code == 1) {
  564. this.navTypeData = res.data
  565. }
  566. })
  567. },
  568. ticketOrderStatus() {
  569. // 票务订单状态
  570. ticketOrderStatus().then((res) => {
  571. if (res.code == 1) {
  572. this.navTypeData = res.data
  573. }
  574. })
  575. },
  576. laundryOrderStatus() {
  577. // 干洗订单状态
  578. laundryOrderStatus().then((res) => {
  579. if (res.code == 1) {
  580. this.navTypeData = res.data
  581. }
  582. })
  583. },
  584. orderList() {
  585. // 外卖订单列表
  586. orderList({
  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. expressOrderList() {
  598. // 代取订单列表
  599. expressOrderList({
  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. groupOrderList() {
  611. // 团购订单列表
  612. groupOrderList({
  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. ticketOrderList() {
  624. // 票务订单列表
  625. ticketOrderList({
  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. laundryOrderList() {
  637. // 干洗订单列表
  638. laundryOrderList({
  639. status: this.navTypeKey,
  640. page: this.page
  641. }).then((res) => {
  642. if (res.code == 1) {
  643. if (res.data.items.length > 0) {
  644. this.list.push(...res.data.items)
  645. }
  646. }
  647. })
  648. },
  649. takeawayPay(id) {
  650. // 外卖支付
  651. if (this.isAJAX) {
  652. return
  653. }
  654. this.isAJAX = true;
  655. orderPay({
  656. order_id: id
  657. }).then((ret) => {
  658. if (ret.code === 1) {
  659. uni.requestPayment({
  660. provider: "wxpay", //支付类型-固定值
  661. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  662. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  663. package: ret.data.wx_pay.package, // 固定值
  664. signType: ret.data.wx_pay.signType, //固定值
  665. paySign: ret.data.wx_pay.paySign, //签名
  666. success: (ren) => {
  667. tools.success("支付成功");
  668. this.isAJAX = false;
  669. this.page = 1;
  670. this.list = [];
  671. this.orderList()
  672. },
  673. fail: (err) => {
  674. this.isAJAX = false;
  675. tools.error("支付失败");
  676. },
  677. });
  678. } else {
  679. this.isAJAX = false;
  680. tools.error("支付失败");
  681. }
  682. })
  683. },
  684. getExpressPay(id) {
  685. // 代取支付
  686. if (this.isAJAX) {
  687. return
  688. }
  689. this.isAJAX = true;
  690. getExpressPay({
  691. order_id: id
  692. }).then((ret) => {
  693. if (ret.code === 1) {
  694. uni.requestPayment({
  695. provider: "wxpay", //支付类型-固定值
  696. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  697. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  698. package: ret.data.wx_pay.package, // 固定值
  699. signType: ret.data.wx_pay.signType, //固定值
  700. paySign: ret.data.wx_pay.paySign, //签名
  701. success: (ren) => {
  702. tools.success("支付成功");
  703. this.isAJAX = false;
  704. this.page = 1;
  705. this.list = [];
  706. this.expressOrderList()
  707. },
  708. fail: (err) => {
  709. this.isAJAX = false;
  710. tools.error("支付失败");
  711. },
  712. });
  713. } else {
  714. this.isAJAX = false;
  715. tools.error("支付失败");
  716. }
  717. })
  718. },
  719. groupPay(id) {
  720. // 团购支付
  721. if (this.isAJAX) {
  722. return
  723. }
  724. this.isAJAX = true;
  725. groupPay({
  726. order_id: id
  727. }).then((ret) => {
  728. if (ret.code === 1) {
  729. uni.requestPayment({
  730. provider: "wxpay", //支付类型-固定值
  731. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  732. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  733. package: ret.data.wx_pay.package, // 固定值
  734. signType: ret.data.wx_pay.signType, //固定值
  735. paySign: ret.data.wx_pay.paySign, //签名
  736. success: (ren) => {
  737. tools.success("支付成功");
  738. this.isAJAX = false;
  739. this.page = 1;
  740. this.list = [];
  741. this.groupOrderList()
  742. },
  743. fail: (err) => {
  744. this.isAJAX = false;
  745. tools.error("支付失败");
  746. },
  747. });
  748. } else {
  749. this.isAJAX = false;
  750. tools.error("支付失败");
  751. }
  752. })
  753. },
  754. ticketPay(id) {
  755. // 票务支付
  756. if (this.isAJAX) {
  757. return
  758. }
  759. this.isAJAX = true;
  760. ticketPay({
  761. order_id: id
  762. }).then((ret) => {
  763. if (ret.code === 1) {
  764. uni.requestPayment({
  765. provider: "wxpay", //支付类型-固定值
  766. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  767. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  768. package: ret.data.wx_pay.package, // 固定值
  769. signType: ret.data.wx_pay.signType, //固定值
  770. paySign: ret.data.wx_pay.paySign, //签名
  771. success: (ren) => {
  772. tools.success("支付成功");
  773. this.isAJAX = false;
  774. this.page = 1;
  775. this.list = [];
  776. this.ticketOrderList()
  777. },
  778. fail: (err) => {
  779. this.isAJAX = false;
  780. tools.error("支付失败");
  781. },
  782. });
  783. } else {
  784. this.isAJAX = false;
  785. tools.error("支付失败");
  786. }
  787. })
  788. },
  789. laundryPay(id) {
  790. // 干洗支付
  791. if (this.isAJAX) {
  792. return
  793. }
  794. this.isAJAX = true;
  795. laundryPay({
  796. order_id: id
  797. }).then((ret) => {
  798. if (ret.code === 1) {
  799. uni.requestPayment({
  800. provider: "wxpay", //支付类型-固定值
  801. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  802. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  803. package: ret.data.wx_pay.package, // 固定值
  804. signType: ret.data.wx_pay.signType, //固定值
  805. paySign: ret.data.wx_pay.paySign, //签名
  806. success: (ren) => {
  807. tools.success("支付成功");
  808. this.isAJAX = false;
  809. this.page = 1;
  810. this.list = [];
  811. this.laundryOrderList()
  812. },
  813. fail: (err) => {
  814. this.isAJAX = false;
  815. tools.error("支付失败");
  816. },
  817. });
  818. } else {
  819. this.isAJAX = false;
  820. tools.error("支付失败");
  821. }
  822. })
  823. }
  824. },
  825. }
  826. </script>
  827. <style lang="scss" scoped>
  828. .nav-b {
  829. position: relative;
  830. z-index: -1 !important;
  831. }
  832. .nav-box {
  833. padding: 26rpx 44rpx;
  834. overflow-x: scroll;
  835. .nav-item {
  836. margin-right: 76rpx;
  837. white-space: nowrap;
  838. position: relative;
  839. .nav-item-x {
  840. position: absolute;
  841. width: 48rpx;
  842. height: 6rpx;
  843. border-radius: 20rpx;
  844. background-color: #41ABF5;
  845. left: 12rpx;
  846. bottom: -10rpx;
  847. }
  848. }
  849. }
  850. .nav-type-box {
  851. width: 100%;
  852. white-space: nowrap;
  853. }
  854. .nav-type-item {
  855. width: 144rpx;
  856. height: 64rpx;
  857. line-height: 64rpx;
  858. margin: 0 24rpx 0 0;
  859. border-radius: 200rpx;
  860. display: inline-block;
  861. }
  862. .nav-type-item:last-child {
  863. margin: 0;
  864. }
  865. .list-box {
  866. padding: 20rpx;
  867. box-sizing: border-box;
  868. }
  869. .shops-img {
  870. width: 48rpx;
  871. height: 48rpx;
  872. margin: 0 8rpx 0 0;
  873. border-radius: 50%;
  874. }
  875. .shops-name {
  876. max-width: 452rpx;
  877. margin: 0 8rpx 0 0;
  878. }
  879. .icons {
  880. width: 32rpx;
  881. height: 32rpx;
  882. }
  883. .goods-box {
  884. max-width: 506rpx;
  885. height: auto;
  886. }
  887. .goods-num {
  888. width: 24rpx;
  889. height: auto;
  890. }
  891. .goods-img {
  892. width: 144rpx;
  893. height: 144rpx;
  894. border-radius: 12rpx;
  895. margin: 0 16rpx 0 0;
  896. }
  897. .goods-two {
  898. overflow-x: scroll;
  899. overflow: auto;
  900. }
  901. .goods-two-name {
  902. width: 144rpx;
  903. }
  904. .item-but {
  905. width: 160rpx;
  906. height: 64rpx;
  907. line-height: 64rpx;
  908. text-align: center;
  909. border-radius: 200rpx;
  910. }
  911. .but-class-one {
  912. background: linear-gradient(225deg, #41ABF5 0%, #5BD8FB 100%);
  913. color: #fff;
  914. }
  915. .but-class-two {
  916. background: #fff;
  917. border: 2rpx solid #CCCCCC;
  918. color: #333;
  919. }
  920. </style>