index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  1. <template>
  2. <view class="flex-common-css box-border-box">
  3. <Nav class="nav-b" :leftShow='false' :customNav='true' bgckgroundBox='#fff'>
  4. <template>
  5. <view slot="custom" class="text-align-center fw-600 fs-36">
  6. 我的订单
  7. </view>
  8. </template>
  9. </Nav>
  10. <view class="nav-box box-border-box bgc-f display-flex">
  11. <view class="nav-item" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'" v-for="(item,i) in navList"
  12. :key="i" @click="selectType(item.id)">
  13. {{item.name}}
  14. <view v-if="type == item.id" class="nav-item-x"></view>
  15. </view>
  16. </view>
  17. <scroll-view class="nav-type-box bgc-f p-12-24 box-border-box" :scroll-x="true">
  18. <view class="nav-type-item text-align-center fs-28" v-for="(item,index) in navTypeData"
  19. @click="navTypeClick(item.key)"
  20. :class="navTypeKey== item.key?'bgc-E4F3FD fw-600 fc-41ABF5':'bgc-F4F5F7 fw-400 fc-3'">
  21. {{item.name}}
  22. </view>
  23. </scroll-view>
  24. <view v-if="list.length == 0" class="scroll-view-css">
  25. <EnBlank :customSrc='true'>
  26. <template v-slot:blankImg>
  27. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  28. </template>
  29. </EnBlank>
  30. </view>
  31. <scroll-view v-else :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  32. <view class="list-box">
  33. <view class="list-item bgc-f b-rad-20 mb-32 p-24 box-border-box" v-for="(item,index) in list"
  34. @click="goToInfo(item)">
  35. <view class="align-items-center flex-justify-space mb-24">
  36. <view class="align-items-center">
  37. <image v-if="item.site_logo" class="shops-img" :src="item.site_logo" mode="aspectFit">
  38. </image>
  39. <image v-else-if="item.shop_logo" class="shops-img" :src="item.shop_logo" mode="aspectFit">
  40. </image>
  41. <image v-else class="shops-img" src="@/static/img/logo/logo.png" mode=""></image>
  42. <view v-if="item.site_name" class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  43. {{item.site_name}}
  44. </view>
  45. <view @click="goToShop(item)" v-else-if="item.shop_name"
  46. class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  47. {{item.shop_name}}
  48. </view>
  49. <view v-else class="fs-32 fc-3 fw-600 shops-name text-overflow-ellipsis-one">
  50. 君子校园
  51. </view>
  52. <!-- <image class="icons" src="@/static/img/toRight.png" mode=""></image> -->
  53. </view>
  54. <view class="fc-41ABF5 fs-28">
  55. {{item.order_status_str}}
  56. </view>
  57. </view>
  58. <view class="align-items-center flex-justify-space mb-24">
  59. <view class="goods-box" v-if="type == 1 || type == 2 || type == 5">
  60. <view class="" v-if="item.item.length == 1">
  61. <view class="align-items-center" v-for="(itemGoods,indexGoods) in item.item">
  62. <image class="goods-img flex-shrink0" :src="itemGoods.goods_img" mode="aspectFit">
  63. </image>
  64. <view class="fs-28 fc-6 text-overflow-ellipsis">
  65. {{itemGoods.goods_name}}
  66. </view>
  67. </view>
  68. </view>
  69. <view class="align-items-center goods-two" v-else>
  70. <view class="flex-direction" v-for="(itemGoods,indexGoods) in item.item">
  71. <image class="goods-img flex-shrink0" :src="itemGoods.goods_img" mode="aspectFit">
  72. </image>
  73. <view
  74. class="fs-28 fc-6 text-overflow-ellipsis-one goods-two-name text-align-center">
  75. {{itemGoods.goods_name}}
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="goods-box" v-else>
  81. <view class="align-items-center">
  82. <image class="goods-img flex-shrink0" :src="item.goods_img" mode="aspectFit">
  83. </image>
  84. <view class="fs-28 fc-6 text-overflow-ellipsis">
  85. {{item.goods_name}}
  86. </view>
  87. </view>
  88. </view>
  89. <view class="goods-num text-align-center">
  90. 共 {{item.goods_number}} 件
  91. </view>
  92. </view>
  93. <view class="align-items-center flex-justify-space mb-24">
  94. <view class="fs-24 fc-9">
  95. 下单时间:{{item.created_at}}
  96. </view>
  97. <view class="fs-28 fc-9">
  98. {{item.order_status == 1?'需付':'实付'}} <text
  99. class="fs-32 fc-3 fw-600">¥{{item.pay_money}}</text>
  100. </view>
  101. </view>
  102. <view class="align-items-center flex-justify-end">
  103. <view class="item-but but-class-two fs-28 mr-18" @click="assess(item)"
  104. v-if="type == 1 && item.order_status == 7 && item.is_comment == 0">
  105. 评价
  106. </view>
  107. <view class="item-but but-class-two fs-28 mr-18" @click.stop="tackOut(item)"
  108. v-if="type == 1 && item.order_status == 2 || type == 1 && item.order_status == 4">
  109. <!-- 外卖 -->
  110. 取消订单
  111. </view>
  112. <view class="item-but but-class-two fs-28 mr-18" @click.stop="cancel(item)"
  113. v-if="type == 5 && item.order_status == 2">
  114. <!-- 干洗 -->
  115. 取消订单
  116. </view>
  117. <view class="item-but but-class-two fs-28 mr-18" @click.stop="expressCancel(item)"
  118. v-if="type == 2 && item.order_status == 2">
  119. <!-- 代取 -->
  120. 取消订单
  121. </view>
  122. <view class="item-but but-class-one fs-28 mr-18" @click.stop="orderPay(item)"
  123. v-if="item.order_status == 1">
  124. 立即支付
  125. </view>
  126. <view class="item-but but-class-one fs-28" @click.stop="openCode(item)"
  127. v-if="type == 5 && item.order_status == 2 || type == 5 && item.order_status == 4">
  128. 二维码
  129. </view>
  130. <view @click.stop="goToUrl('takeOut', item)" class="item-but but-class-one fs-28 mr-18"
  131. v-if="type == 1 && item.order_status == 3 || type == 1 && item.order_status == 7 || type == 1 && item.order_status == 8 || type == 1 && item.order_status == 9 || type == 1 && item.order_status == 10">
  132. <!-- 外卖 -->
  133. 再来一单
  134. </view>
  135. <view @click.stop="goToUrl('express', item)" class="item-but but-class-one fs-28 mr-18"
  136. v-if="type == 2 && item.order_status == 4 || type == 2 && item.order_status == 5 || type == 2 && item.order_status == 6">
  137. <!-- 代取 -->
  138. 再来一单
  139. </view>
  140. <view @click.stop="goToUrl('group', item)" class="item-but but-class-one fs-28 mr-18"
  141. v-if="type == 3 && item.order_status == 2 || type == 3 && item.order_status == 4">
  142. <!-- 团购 -->
  143. 再来一单
  144. </view>
  145. <view @click.stop="goToUrl('ticket', item)" class="item-but but-class-one fs-28 mr-18"
  146. v-if="type == 4 && item.order_status == 2 || type == 4 && item.order_status == 4">
  147. <!-- 票务 -->
  148. 再来一单
  149. </view>
  150. <view @click.stop="goToUrl('laundry', item)" class="item-but but-class-one fs-28 mr-18"
  151. v-if="type == 5 && item.order_status == 5 || type == 5 && item.order_status == 6 || type == 5 && item.order_status == 7">
  152. <!-- 干洗 -->
  153. 再来一单
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </scroll-view>
  159. <uni-popup ref="popup" border-radius="10px 10px 10px 10px" @maskClick='maskClick'>
  160. <view class="bgc-f b-rad-20" v-if="qrcodeData">
  161. <!-- <UniQrcode :text="qrcodeData"></UniQrcode> -->
  162. <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. console.log('返回刷新');
  245. let orderPayType = uni.getStorageSync('orderPayType')
  246. if (orderPayType) {
  247. this.selectType(orderPayType)
  248. console.log('固定type');
  249. } else {
  250. this.resetList();
  251. console.log('默认type');
  252. }
  253. },
  254. methods: {
  255. openCode(item) {
  256. let m_id = uni.getStorageSync('m_id');
  257. this.qrcodeData = m_id + "_" + item.order_sn
  258. this.options2 = {
  259. size: 300,
  260. margin: 10
  261. }
  262. uni.hideTabBar()
  263. this.$refs.popup.open('center')
  264. },
  265. maskClick() {
  266. this.$refs.popup.close()
  267. this.qrcodeData = ''
  268. uni.showTabBar()
  269. },
  270. goToShop(item) {
  271. // 进入店铺
  272. uni.navigateTo({
  273. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  274. })
  275. },
  276. goToUrl(type, item) {
  277. // 再来一单
  278. if (type == 'takeOut') {
  279. // uni.navigateTo({
  280. // url: '/pages-takeout/takeout'
  281. // })
  282. uni.navigateTo({
  283. url: '/pages-takeout/shop?shop_id=' + item.shop_id
  284. })
  285. } else if (type == 'express') {
  286. uni.navigateTo({
  287. url: '/pages-takeout/replace-take'
  288. })
  289. } else if (type == 'group') {
  290. uni.navigateTo({
  291. url: '/pages-buy/group'
  292. })
  293. } else if (type == 'ticket') {
  294. uni.navigateTo({
  295. url: '/pages-buy/ticket'
  296. })
  297. } else if (type == 'laundry') {
  298. uni.navigateTo({
  299. url: '/pages-buy/dry-clean'
  300. })
  301. }
  302. },
  303. goToInfo(item) {
  304. if (this.type === 1) {
  305. uni.navigateTo({
  306. url: `/pages-order/takeout-info?orderId=` + item.id
  307. })
  308. } else if (this.type === 2) {
  309. uni.navigateTo({
  310. url: `/pages-order/express-info?orderId=` + item.id
  311. })
  312. } else if (this.type === 3) {
  313. uni.navigateTo({
  314. url: `/pages-order/group-info?orderId=` + item.id
  315. })
  316. } else if (this.type === 4) {
  317. uni.navigateTo({
  318. url: `/pages-order/ticket-info?orderId=` + item.id
  319. })
  320. } else if (this.type === 5) {
  321. uni.navigateTo({
  322. url: `/pages-order/laundry-info?orderId=` + item.id
  323. })
  324. }
  325. },
  326. orderPay(item) {
  327. // 立即支付
  328. if (this.type === 1) {
  329. this.takeawayPay(item.id)
  330. } else if (this.type === 2) {
  331. this.getExpressPay(item.id)
  332. } else if (this.type === 3) {
  333. this.groupPay(item.id)
  334. } else if (this.type === 4) {
  335. this.ticketPay(item.id)
  336. } else if (this.type === 5) {
  337. this.laundryPay(item.id)
  338. }
  339. },
  340. navTypeClick(key) {
  341. if (this.navTypeKey != key) {
  342. this.navTypeKey = key
  343. this.page = 1
  344. this.list = []
  345. if (this.type === 1) {
  346. this.orderList()
  347. } else if (this.type === 2) {
  348. this.expressOrderList()
  349. } else if (this.type === 3) {
  350. this.groupOrderList()
  351. } else if (this.type === 4) {
  352. this.ticketOrderList()
  353. } else if (this.type === 5) {
  354. this.laundryOrderList()
  355. }
  356. }
  357. },
  358. resetList() {
  359. this.page = 1;
  360. this.list = [];
  361. this.getList();
  362. },
  363. selectType(type) {
  364. let orderPayType = uni.getStorageSync('orderPayType')
  365. if (type != this.type || orderPayType) {
  366. this.type = type;
  367. this.navTypeKey = 0
  368. this.resetList();
  369. uni.removeStorageSync('orderPayType')
  370. }
  371. },
  372. assess(item) {
  373. // 外卖评价
  374. uni.navigateTo({
  375. url: `/pages-my/appraise?orderId=` + item.id + '&shopName=' + item.shop_name + '&shopLogo=' +
  376. item.shop_logo
  377. })
  378. },
  379. tackOut(item) {
  380. // 外卖取消订单
  381. uni.showModal({
  382. title: '提示',
  383. content: '是否取消订单?',
  384. confirmText: '确定',
  385. confirmColor: '#FB3D03',
  386. success: (res) => {
  387. if (res.confirm === true) {
  388. if (this.isAJAX) {
  389. return
  390. }
  391. this.isAJAX = true;
  392. orderCancel({
  393. order_id: item.id
  394. }).then((res) => {
  395. if (res.code == 1) {
  396. tools.success(res.msg)
  397. setTimeout(() =>{
  398. this.page = 1;
  399. this.list = [];
  400. this.orderList()
  401. }, 1500)
  402. this.isAJAX = false;
  403. } else {
  404. tools.error(res.msg)
  405. this.isAJAX = false;
  406. }
  407. })
  408. }
  409. }
  410. });
  411. },
  412. expressCancel(item) {
  413. // 代取取消订单
  414. uni.showModal({
  415. title: '提示',
  416. content: '是否取消订单?',
  417. confirmText: '确定',
  418. confirmColor: '#FB3D03',
  419. success: (res) => {
  420. if (res.confirm === true) {
  421. if (this.isAJAX) {
  422. return
  423. }
  424. this.isAJAX = true;
  425. expressOrderCancel({
  426. order_id: item.id
  427. }).then((res) => {
  428. if (res.code == 1) {
  429. tools.success(res.msg)
  430. setTimeout(() =>{
  431. this.page = 1;
  432. this.list = [];
  433. this.expressOrderList()
  434. }, 1500)
  435. this.isAJAX = false;
  436. } else {
  437. tools.error(res.msg)
  438. this.isAJAX = false;
  439. }
  440. })
  441. }
  442. }
  443. });
  444. },
  445. cancel(item) {
  446. // 干洗取消订单
  447. uni.showModal({
  448. title: '提示',
  449. content: '是否取消订单?',
  450. confirmText: '确定',
  451. confirmColor: '#FB3D03',
  452. success: (res) => {
  453. if (res.confirm === true) {
  454. if (this.isAJAX) {
  455. return
  456. }
  457. this.isAJAX = true;
  458. laundryOrderCancel({
  459. order_id: item.id
  460. }).then((res) => {
  461. if (res.code == 1) {
  462. tools.success(res.msg)
  463. setTimeout(() =>{
  464. this.page = 1;
  465. this.list = [];
  466. this.laundryOrderList()
  467. }, 1500)
  468. this.isAJAX = false;
  469. } else {
  470. tools.error(res.msg)
  471. this.isAJAX = false;
  472. }
  473. })
  474. }
  475. }
  476. });
  477. },
  478. scrolltolower() {
  479. ++this.page
  480. if (this.type === 1) {
  481. this.orderList()
  482. } else if (this.type === 2) {
  483. this.expressOrderList()
  484. } else if (this.type === 3) {
  485. this.groupOrderList()
  486. } else if (this.type === 4) {
  487. this.ticketOrderList()
  488. } else if (this.type === 5) {
  489. this.laundryOrderList()
  490. }
  491. // console.log('触底');
  492. },
  493. getList() {
  494. if (this.type === 1) {
  495. this.orderStatus()
  496. this.orderList()
  497. } else if (this.type === 2) {
  498. this.expressOrderStatus()
  499. this.expressOrderList()
  500. } else if (this.type === 3) {
  501. this.groupOrderStatus()
  502. this.groupOrderList()
  503. } else if (this.type === 4) {
  504. this.ticketOrderStatus()
  505. this.ticketOrderList()
  506. } else if (this.type === 5) {
  507. this.laundryOrderStatus()
  508. this.laundryOrderList()
  509. }
  510. },
  511. expressOrderStatus() {
  512. // 代取订单状态
  513. expressOrderStatus().then((res) => {
  514. if (res.code == 1) {
  515. this.navTypeData = res.data
  516. }
  517. })
  518. },
  519. orderStatus() {
  520. // 外卖订单状态
  521. orderStatus().then((res) => {
  522. if (res.code == 1) {
  523. this.navTypeData = res.data
  524. }
  525. })
  526. },
  527. groupOrderStatus() {
  528. // 团购订单状态
  529. groupOrderStatus().then((res) => {
  530. if (res.code == 1) {
  531. this.navTypeData = res.data
  532. }
  533. })
  534. },
  535. ticketOrderStatus() {
  536. // 票务订单状态
  537. ticketOrderStatus().then((res) => {
  538. if (res.code == 1) {
  539. this.navTypeData = res.data
  540. }
  541. })
  542. },
  543. laundryOrderStatus() {
  544. // 干洗订单状态
  545. laundryOrderStatus().then((res) => {
  546. if (res.code == 1) {
  547. this.navTypeData = res.data
  548. }
  549. })
  550. },
  551. orderList() {
  552. // 外卖订单列表
  553. orderList({
  554. status: this.navTypeKey,
  555. page: this.page
  556. }).then((res) => {
  557. if (res.code == 1) {
  558. if (res.data.items.length > 0) {
  559. this.list.push(...res.data.items)
  560. }
  561. }
  562. })
  563. },
  564. expressOrderList() {
  565. // 代取订单列表
  566. expressOrderList({
  567. status: this.navTypeKey,
  568. page: this.page
  569. }).then((res) => {
  570. if (res.code == 1) {
  571. if (res.data.items.length > 0) {
  572. this.list.push(...res.data.items)
  573. }
  574. }
  575. })
  576. },
  577. groupOrderList() {
  578. // 团购订单列表
  579. groupOrderList({
  580. status: this.navTypeKey,
  581. page: this.page
  582. }).then((res) => {
  583. if (res.code == 1) {
  584. if (res.data.items.length > 0) {
  585. this.list.push(...res.data.items)
  586. }
  587. }
  588. })
  589. },
  590. ticketOrderList() {
  591. // 票务订单列表
  592. ticketOrderList({
  593. status: this.navTypeKey,
  594. page: this.page
  595. }).then((res) => {
  596. if (res.code == 1) {
  597. if (res.data.items.length > 0) {
  598. this.list.push(...res.data.items)
  599. }
  600. }
  601. })
  602. },
  603. laundryOrderList() {
  604. // 干洗订单列表
  605. laundryOrderList({
  606. status: this.navTypeKey,
  607. page: this.page
  608. }).then((res) => {
  609. if (res.code == 1) {
  610. if (res.data.items.length > 0) {
  611. this.list.push(...res.data.items)
  612. }
  613. }
  614. })
  615. },
  616. takeawayPay(id) {
  617. // 外卖支付
  618. if (this.isAJAX) {
  619. return
  620. }
  621. this.isAJAX = true;
  622. orderPay({
  623. order_id: id
  624. }).then((ret) => {
  625. if (ret.code === 1) {
  626. uni.requestPayment({
  627. provider: "wxpay", //支付类型-固定值
  628. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  629. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  630. package: ret.data.wx_pay.package, // 固定值
  631. signType: ret.data.wx_pay.signType, //固定值
  632. paySign: ret.data.wx_pay.paySign, //签名
  633. success: (ren) => {
  634. tools.success("支付成功");
  635. this.isAJAX = false;
  636. this.page = 1;
  637. this.list = [];
  638. this.orderList()
  639. },
  640. fail: (err) => {
  641. this.isAJAX = false;
  642. tools.error("支付失败");
  643. },
  644. });
  645. } else {
  646. this.isAJAX = false;
  647. tools.error("支付失败");
  648. }
  649. })
  650. },
  651. getExpressPay(id) {
  652. // 代取支付
  653. if (this.isAJAX) {
  654. return
  655. }
  656. this.isAJAX = true;
  657. getExpressPay({
  658. order_id: id
  659. }).then((ret) => {
  660. if (ret.code === 1) {
  661. uni.requestPayment({
  662. provider: "wxpay", //支付类型-固定值
  663. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  664. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  665. package: ret.data.wx_pay.package, // 固定值
  666. signType: ret.data.wx_pay.signType, //固定值
  667. paySign: ret.data.wx_pay.paySign, //签名
  668. success: (ren) => {
  669. tools.success("支付成功");
  670. this.isAJAX = false;
  671. this.page = 1;
  672. this.list = [];
  673. this.expressOrderList()
  674. },
  675. fail: (err) => {
  676. this.isAJAX = false;
  677. tools.error("支付失败");
  678. },
  679. });
  680. } else {
  681. this.isAJAX = false;
  682. tools.error("支付失败");
  683. }
  684. })
  685. },
  686. groupPay(id) {
  687. // 团购支付
  688. if (this.isAJAX) {
  689. return
  690. }
  691. this.isAJAX = true;
  692. groupPay({
  693. order_id: id
  694. }).then((ret) => {
  695. if (ret.code === 1) {
  696. uni.requestPayment({
  697. provider: "wxpay", //支付类型-固定值
  698. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  699. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  700. package: ret.data.wx_pay.package, // 固定值
  701. signType: ret.data.wx_pay.signType, //固定值
  702. paySign: ret.data.wx_pay.paySign, //签名
  703. success: (ren) => {
  704. tools.success("支付成功");
  705. this.isAJAX = false;
  706. this.page = 1;
  707. this.list = [];
  708. this.groupOrderList()
  709. },
  710. fail: (err) => {
  711. this.isAJAX = false;
  712. tools.error("支付失败");
  713. },
  714. });
  715. } else {
  716. this.isAJAX = false;
  717. tools.error("支付失败");
  718. }
  719. })
  720. },
  721. ticketPay(id) {
  722. // 票务支付
  723. if (this.isAJAX) {
  724. return
  725. }
  726. this.isAJAX = true;
  727. ticketPay({
  728. order_id: id
  729. }).then((ret) => {
  730. if (ret.code === 1) {
  731. uni.requestPayment({
  732. provider: "wxpay", //支付类型-固定值
  733. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  734. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  735. package: ret.data.wx_pay.package, // 固定值
  736. signType: ret.data.wx_pay.signType, //固定值
  737. paySign: ret.data.wx_pay.paySign, //签名
  738. success: (ren) => {
  739. tools.success("支付成功");
  740. this.isAJAX = false;
  741. this.page = 1;
  742. this.list = [];
  743. this.ticketOrderList()
  744. },
  745. fail: (err) => {
  746. this.isAJAX = false;
  747. tools.error("支付失败");
  748. },
  749. });
  750. } else {
  751. this.isAJAX = false;
  752. tools.error("支付失败");
  753. }
  754. })
  755. },
  756. laundryPay(id) {
  757. // 干洗支付
  758. if (this.isAJAX) {
  759. return
  760. }
  761. this.isAJAX = true;
  762. laundryPay({
  763. order_id: id
  764. }).then((ret) => {
  765. if (ret.code === 1) {
  766. uni.requestPayment({
  767. provider: "wxpay", //支付类型-固定值
  768. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  769. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  770. package: ret.data.wx_pay.package, // 固定值
  771. signType: ret.data.wx_pay.signType, //固定值
  772. paySign: ret.data.wx_pay.paySign, //签名
  773. success: (ren) => {
  774. tools.success("支付成功");
  775. this.isAJAX = false;
  776. this.page = 1;
  777. this.list = [];
  778. this.laundryOrderList()
  779. },
  780. fail: (err) => {
  781. this.isAJAX = false;
  782. tools.error("支付失败");
  783. },
  784. });
  785. } else {
  786. this.isAJAX = false;
  787. tools.error("支付失败");
  788. }
  789. })
  790. }
  791. },
  792. }
  793. </script>
  794. <style lang="scss" scoped>
  795. .nav-b {
  796. position: relative;
  797. z-index: -1 !important;
  798. }
  799. .nav-box {
  800. padding: 26rpx 44rpx;
  801. overflow-x: scroll;
  802. .nav-item {
  803. margin-right: 76rpx;
  804. white-space: nowrap;
  805. position: relative;
  806. .nav-item-x {
  807. position: absolute;
  808. width: 48rpx;
  809. height: 6rpx;
  810. border-radius: 20rpx;
  811. background-color: #41ABF5;
  812. left: 12rpx;
  813. bottom: -10rpx;
  814. }
  815. }
  816. }
  817. .nav-type-box {
  818. width: 100%;
  819. white-space: nowrap;
  820. }
  821. .nav-type-item {
  822. width: 144rpx;
  823. height: 64rpx;
  824. line-height: 64rpx;
  825. margin: 0 24rpx 0 0;
  826. border-radius: 200rpx;
  827. display: inline-block;
  828. }
  829. .nav-type-item:last-child {
  830. margin: 0;
  831. }
  832. .list-box {
  833. padding: 20rpx;
  834. box-sizing: border-box;
  835. }
  836. .shops-img {
  837. width: 48rpx;
  838. height: 48rpx;
  839. margin: 0 8rpx 0 0;
  840. border-radius: 50%;
  841. }
  842. .shops-name {
  843. max-width: 452rpx;
  844. margin: 0 8rpx 0 0;
  845. }
  846. .icons {
  847. width: 32rpx;
  848. height: 32rpx;
  849. }
  850. .goods-box {
  851. max-width: 506rpx;
  852. height: auto;
  853. }
  854. .goods-num {
  855. width: 24rpx;
  856. height: auto;
  857. }
  858. .goods-img {
  859. width: 144rpx;
  860. height: 144rpx;
  861. border-radius: 12rpx;
  862. margin: 0 16rpx 0 0;
  863. }
  864. .goods-two {
  865. overflow-x: scroll;
  866. overflow: auto;
  867. }
  868. .goods-two-name {
  869. width: 144rpx;
  870. }
  871. .item-but {
  872. width: 160rpx;
  873. height: 64rpx;
  874. line-height: 64rpx;
  875. text-align: center;
  876. border-radius: 200rpx;
  877. }
  878. .but-class-one {
  879. background: linear-gradient(225deg, #41ABF5 0%, #5BD8FB 100%);
  880. color: #fff;
  881. }
  882. .but-class-two {
  883. background: #fff;
  884. border: 2rpx solid #CCCCCC;
  885. color: #333;
  886. }
  887. </style>