index.vue 21 KB

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