index.vue 24 KB

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