index.vue 21 KB

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