index.vue 21 KB

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