index.vue 24 KB

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