index.vue 24 KB

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