yuyueOrder.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. <template>
  2. <view class="container">
  3. <view class="bgf pof">
  4. <view class="flex-center search-content">
  5. <view class="search flex-y-center" style="margin-bottom: 0;">
  6. <icon type="search" size="16" />
  7. <input placeholder="请输入订单编号搜索" class="flex-grow-1" type="text" value="" @confirm="firmSeach"
  8. @input="putSeach" />
  9. </view>
  10. <text @click="bindSeach">搜索</text>
  11. </view>
  12. <view class="box-pack-between header-hg100 flex-y-center ">
  13. <view class="flex-y-center flex-grow-1 ft26 header-text">
  14. <view class="flex-grow-1 flex-center" data-text="1" :class="act_index==5?'act':''"
  15. @click="onTopBtnTap(5)" v-if="admin_id">
  16. <view class="store-name">{{level_text}}</view>
  17. <view class="d3" :style="'border-color:'+act_index==1?'#007AFF':''"></view>
  18. </view>
  19. <view class="flex-grow-1 flex-center" data-text="1" :class="act_index==1?'act':''"
  20. @click="onTopBtnTap(1)">
  21. {{status_text}}
  22. <view class="d3" :style="'border-color:'+act_index==1?'#007AFF':''"></view>
  23. </view>
  24. <view class="flex-grow-1 flex-center" data-text="3" :class="act_index==3?'act':''"
  25. @click="onTopBtnTap(3)">
  26. {{pay_text}}
  27. <view class="d3"></view>
  28. </view>
  29. <view class="flex-grow-1 flex-center" data-text="4" :class="act_index==4?'act':''"
  30. @click="onTopBtnTap(4)">
  31. {{start_text}}
  32. <view class="d3"></view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="list">
  38. <navigator :url="`/saomaDiancan/order/yuyueOrderDetail?id=${item.id}`" class="item"
  39. v-for="(item,index) in list" :key="index">
  40. <view class="top flex flex-y-center box-pack-between">
  41. <view class="name text-1">{{item.order_no}}</view>
  42. </view>
  43. <view class="content" style="border-bottom: 1rpx solid #f1f1f1;">
  44. <view class="box-pack-between">
  45. <view class="cell flex flex-y-center">
  46. <view class="title">支付金额:</view>
  47. <view class="desc" style="color:red">¥{{item.money}}</view>
  48. </view>
  49. <view class="pay-info flex flex-y-center">
  50. <image
  51. :src="item.pay_type == 1?'../../static/images/wx.png':item.pay_type == 2?'../../static/images/ali.png':'../static/images/yu.png'"
  52. class="pay-type-icon"></image>
  53. <view class="pay-status">{{['待付款','待使用','已完成','已取消','已退款','退款中','退款拒绝'][item.state-1]}}
  54. </view>
  55. </view>
  56. </view>
  57. <view class="cell flex flex-y-center" >
  58. <view class="title">付款方式:</view>
  59. <view class="desc" style="color:red">
  60. {{['微信','支付宝','余额'][item.pay_type-1]}}
  61. </view>
  62. </view>
  63. <view class="cell flex flex-y-center arr-r">
  64. <view class="title">订单时间 :</view>
  65. <view class="desc">{{item.create_time}}</view>
  66. </view>
  67. </view>
  68. </navigator>
  69. <view class="no-more" v-if="is_bottom">
  70. ---没有更多了---
  71. </view>
  72. </view>
  73. <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
  74. <view class="showpay">
  75. <block v-if='act_index==5'>
  76. <view class="box-li" :class="store_id==0?'active':''" @click="Onlevel(0,'全部')" data-text='全部'>全部
  77. </view>
  78. <scroll-view scroll-y="true" style="height: 400rpx;">
  79. <view class="box-li" v-for="(item,index) of tableTypeList" :key='index'
  80. :class="item.id==store_id?'active':''" @click="Onlevel(item.id,item.title)">
  81. {{item.title}}
  82. </view>
  83. </scroll-view>
  84. </block>
  85. <block v-if='act_index==1'>
  86. <view class="box-li" :class="status==''?'active':''" @click="payStatus(0,'全部')" data-type=''
  87. data-text='全部'>全部
  88. </view>
  89. <view class="box-li" :class="status==1?'active':''" @click="payStatus(1,'待付款')" data-type='1'
  90. data-text='待付款'>待付款
  91. </view>
  92. <view class="box-li" :class="status==2?'active':''" @click="payStatus(2,'待使用')" data-type='2'
  93. data-text='待使用'>待使用
  94. </view>
  95. <view class="box-li" :class="status==3?'active':''" @click="payStatus(3,'已完成')" data-type='3'
  96. data-text='已完成'>已完成
  97. </view>
  98. <view class="box-li" :class="status==4?'active':''" @click="payStatus(4,'已取消')" data-type='4'
  99. data-text='已取消'>已取消
  100. </view>
  101. <view class="box-li" :class="status==5?'active':''" @click="payStatus(5,'已退款')" data-type='5'
  102. data-text='已退款'>已退款
  103. </view>
  104. <view class="box-li" :class="status==6?'active':''" @click="payStatus(6,'退款中')" data-type='6'
  105. data-text='退款中'>退款中
  106. </view>
  107. <view class="box-li" :class="status==7?'active':''" @click="payStatus(7,'退款拒绝')" data-type='7'
  108. data-text='退款拒绝'>退款拒绝
  109. </view>
  110. </block>
  111. <block v-if='act_index==3'>
  112. <view class="box-li" :class="pay_type==0?'active':''" @click="payType(0,'全部')" data-text='微信'>全部
  113. </view>
  114. <view class="box-li" :class="pay_type==1?'active':''" @click="payType(1,'微信')" data-text='微信'>微信
  115. </view>
  116. <view class="box-li" :class="pay_type==2?'active':''" @click="payType(2,'支付宝')" data-text='支付宝'>支付宝
  117. </view>
  118. <view class="box-li" :class="pay_type==3?'active':''" @click="payType(3,'余额支付')" data-text='余额支付'>
  119. 余额支付
  120. </view>
  121. </block>
  122. <block v-if='act_index==4'>
  123. <view class="model">
  124. <view class="flex-center model-date box-pack-between">
  125. <view class="model-item" :class="time_index==1?'act':''">
  126. <picker mode='date' :value="start" :start="startDate" :end="endDate"
  127. @change="bindDateChange1" data-index="1">
  128. <view class="flex-center">
  129. <text>{{start}}</text>
  130. </view>
  131. </picker>
  132. </view>
  133. <view class="model-item" :class="time_index==2?'act':''">
  134. <picker mode='date' :value="end" :start="startDate" :end="endDate"
  135. @change="bindDateChange2" data-index="1">
  136. <view class="flex-center">
  137. <text>{{end}}</text>
  138. </view>
  139. </picker>
  140. </view>
  141. </view>
  142. <view class="flex">
  143. <view class="model-btn-close model-btn flex-center" @click="clear">
  144. 清空
  145. </view>
  146. <view class="model-btn-success flex-center model-btn" @click="sure">
  147. 确定
  148. </view>
  149. </view>
  150. </view>
  151. </block>
  152. </view>
  153. </uni-popup-top>
  154. </view>
  155. </template>
  156. <script>
  157. import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
  158. export default {
  159. components: {
  160. uniPopupTop
  161. },
  162. data() {
  163. return {
  164. pay_type: 0,
  165. URL: getApp().globalData.URL,
  166. admin_id: "",
  167. store_id: "",
  168. list: [],
  169. page: 1,
  170. is_bottom: false,
  171. act_index: 1,
  172. time_index: 0,
  173. time_index2: 0,
  174. start: "开始时间",
  175. end: "结束时间",
  176. top: "200rpx",
  177. maskClass: {
  178. 'position': 'fixed',
  179. 'bottom': 0,
  180. 'top': "100rpx",
  181. 'left': 0,
  182. 'right': 0,
  183. 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
  184. },
  185. tableTypeList: [], //门店列表
  186. level_text: '门店',
  187. status_text: '订单状态',
  188. order_text: '下单方式',
  189. pay_text: '支付方式',
  190. start_text: '日期查找',
  191. status: ""
  192. }
  193. },
  194. onLoad(options) {
  195. console.log(options)
  196. this.store_id = options.store_id || '';
  197. this.admin_id = options.admin_id || '';
  198. if (options.admin_id) {
  199. this.shop_store_index()
  200. this.act_index = 5
  201. }
  202. if (options.day) {
  203. this.end = options.day;
  204. this.start = options.day;
  205. this.start_text = options.day;
  206. }
  207. if (options.state && options.order_text) {
  208. this.order_text = options.order_text
  209. this.state = options.state
  210. }
  211. console.log(this.state)
  212. this.getData(1);
  213. },
  214. onShow() {
  215. },
  216. onReachBottom() {
  217. if (!this.is_bottom) {
  218. this.getData(this.page + 1)
  219. }
  220. },
  221. methods: {
  222. shop_store_index() {
  223. this.request({
  224. url: 'Smdcshop/shop_store_index',
  225. data: {
  226. admin_id: this.admin_id,
  227. }
  228. }).then(res => {
  229. if (res.code == 200) {
  230. if (res.data.length > 0) {
  231. this.tableTypeList = res.data;
  232. }
  233. }
  234. })
  235. },
  236. Onlevel(e, text) {
  237. this.store_id = e;
  238. this.level_text = text;
  239. this.list = [];
  240. this.getData(1);
  241. this.$refs.popup.close();
  242. },
  243. // 键盘完成事件
  244. firmSeach(e) {
  245. this.serch = e.detail.value;
  246. this.getData(1);
  247. this.$refs.popup.close();
  248. },
  249. // 监听input
  250. putSeach(e) {
  251. this.serch = e.detail.value;
  252. if (!e.detail.value) {
  253. this.getData(1);
  254. }
  255. },
  256. // 搜索
  257. bindSeach(e) {
  258. this.getData(1);
  259. this.$refs.popup.close();
  260. },
  261. // 订单状态
  262. payStatus(e, text) {
  263. this.status = e;
  264. this.status_text = text;
  265. this.getData(1);
  266. this.$refs.popup.close();
  267. },
  268. // 支付方式搜索
  269. payType(e, text) {
  270. this.pay_type = e;
  271. this.pay_text = text;
  272. this.getData(1);
  273. this.$refs.popup.close();
  274. },
  275. bindDateChange1(e) {
  276. this.time_index = e.currentTarget.dataset.index;
  277. this.start = e.target.value;
  278. },
  279. bindDateChange2(e) {
  280. this.time_index2 = e.currentTarget.dataset.index;
  281. this.end = e.target.value;
  282. },
  283. sure(e) {
  284. this.getData(1);
  285. this.$refs.popup.close();
  286. this.start_text = this.end;
  287. },
  288. clear() {
  289. this.start = '开始时间';
  290. this.start_text = '日期查找';
  291. this.end = '结束时间';
  292. this.getData(1);
  293. this.$refs.popup.close();
  294. },
  295. onTopBtnTap(e) {
  296. this.act_index = e;
  297. this.$refs.popup.open();
  298. },
  299. getData(page) {
  300. if (page == 1) {
  301. this.list = []
  302. this.page = 1
  303. this.is_bottom = false
  304. }
  305. this.request({
  306. url: 'smdcshop/yyorderlist',
  307. data: {
  308. page,
  309. limit: 10,
  310. admin_id: this.admin || uni.getStorageSync('admin_id'),
  311. store_id: this.store_id,
  312. serch: this.serch,
  313. state: this.status || '',
  314. // order_xdtime: this.start == '选择时间' ? '' : this.start,
  315. start: this.start == '开始时间' ? '' : `${this.start} 00:00:00`,
  316. end: this.end == '结束时间' ? '' : `${this.end} 23:59:59`,
  317. pay_type: this.pay_type || '',
  318. }
  319. }).then(res => {
  320. if (res.code == 200 && res.data.length) {
  321. this.list = this.list.concat(res.data)
  322. this.page = page
  323. if (res.data.is_dd == 1 && res.data.is_send == 1) {
  324. this.GetDadaInfo(res.data.info.id);
  325. }
  326. } else {
  327. this.is_bottom = true
  328. }
  329. })
  330. },
  331. GetDadaInfo(id) {
  332. this.request({
  333. url: 'Smdcshop/GetDadaInfo',
  334. data: {
  335. id: id
  336. }
  337. }).then(res => {
  338. this.obj = res.data;
  339. })
  340. },
  341. //提醒取餐
  342. onQucan(index) {
  343. console.log(index)
  344. this.request({
  345. url: 'merchant/take_meal',
  346. is_agent: 'agent',
  347. data: {
  348. order_id: this.list[index].id
  349. }
  350. }).then(res => {
  351. if (res.code == 200) {
  352. uni.showModal({
  353. content: "已提醒取单",
  354. showCancel: false,
  355. success: r => {
  356. this.list[index].no_meal = 2
  357. console.log(this.list[index])
  358. }
  359. })
  360. }
  361. })
  362. }
  363. },
  364. }
  365. </script>
  366. <style lang="scss">
  367. .store-name {
  368. max-width: 150rpx;
  369. text-overflow: ellipsis;
  370. white-space: nowrap;
  371. overflow: hidden;
  372. }
  373. .header-text .act {
  374. color: red;
  375. }
  376. .header-text .act .d3 {
  377. border-color: red transparent transparent transparent;
  378. }
  379. .pof {
  380. position: fixed;
  381. left: 0;
  382. z-index: 999;
  383. background: #fff;
  384. width: 100%;
  385. }
  386. .search-content {
  387. width: 100%;
  388. height: 100rpx;
  389. font-size: 28rpx;
  390. top: 0;
  391. .search {
  392. width: 80%;
  393. border: 1rpx solid #F1F1F1;
  394. margin-right: 15rpx;
  395. padding: 10rpx;
  396. border-radius: 50rpx;
  397. icon {
  398. margin-right: 15rpx;
  399. }
  400. }
  401. }
  402. .model {
  403. width: 100%;
  404. z-index: 10;
  405. background: #FFFFFF;
  406. padding-bottom: 20rpx;
  407. .model-date {
  408. width: 100%;
  409. padding: 20rpx 80rpx;
  410. border-bottom: 1rpx solid #F1F1F1;
  411. .model-item {
  412. width: 270rpx;
  413. text-align: center;
  414. font-size: 28rpx;
  415. color: #999;
  416. position: relative;
  417. padding: 10rpx 0;
  418. text-align: center;
  419. border-radius: 8rpx;
  420. border: 1rpx solid #999;
  421. }
  422. .act {
  423. // color: #FFFFFF;
  424. // background: #FFBE2C;
  425. // border: 1rpx solid #FFBE2C;
  426. }
  427. }
  428. .model-btn {
  429. border-radius: 8rpx;
  430. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  431. margin: 0 auto;
  432. margin-top: 20rpx;
  433. text-align: center;
  434. width: 41%;
  435. height: 80rpx;
  436. border-radius: none;
  437. }
  438. .model-btn-close {
  439. border: 1rpx solid #F1F1F1;
  440. color: #000;
  441. }
  442. .model-btn-success {
  443. color: #FFFFFF;
  444. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  445. }
  446. }
  447. page {
  448. background-color: #F4F5F7;
  449. }
  450. .showpay .active {
  451. color: red
  452. }
  453. .header-hg100 {
  454. height: 100rpx;
  455. top: 100rpx;
  456. width: 100%;
  457. }
  458. .list {
  459. padding: 210rpx 25rpx 0;
  460. }
  461. .list .item {
  462. background-color: #fff;
  463. border-radius: 8rpx;
  464. overflow: hidden;
  465. padding: 0 25rpx;
  466. margin-bottom: 30rpx;
  467. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
  468. }
  469. .list .item .top {
  470. height: 80rpx;
  471. border-bottom: 1rpx solid #f5f5f5;
  472. }
  473. .list .item .top .pay-info {
  474. flex: none;
  475. }
  476. .pay-type-icon {
  477. display: block;
  478. width: 28rpx;
  479. height: 28rpx;
  480. flex: none;
  481. margin-right: 8rpx;
  482. }
  483. .pay-status {
  484. font-size: 28rpx;
  485. color: #464646;
  486. }
  487. .list .item .content {
  488. padding: 20rpx 0;
  489. }
  490. .list .content .cell {
  491. margin-bottom: 16rpx;
  492. font-size: 26rpx;
  493. color: #99A0AD;
  494. }
  495. .list .content .cell:last-child {
  496. margin-bottom: 0;
  497. }
  498. .list .content .cell .title {
  499. color: #99A0AD;
  500. }
  501. .list .content .cell .desc {
  502. color: #666;
  503. }
  504. .qc-btn {
  505. background-color: #3387FF;
  506. color: #fff;
  507. border-radius: 6rpx;
  508. height: 48rpx;
  509. line-height: 48rpx;
  510. padding: 0 20rpx;
  511. margin-left: 10rpx;
  512. }
  513. .header-text {
  514. text-align: center;
  515. }
  516. .box-li {
  517. background-color: #fff;
  518. text-align: center;
  519. border-bottom: 1rpx solid #f1f1f1;
  520. height: 80rpx;
  521. line-height: 80rpx;
  522. font-size: 26rpx;
  523. }
  524. .goods_list {
  525. font-size: 28rpx;
  526. }
  527. .goods_list-title {
  528. padding: 20rpx 0;
  529. }
  530. .goods_list-price {
  531. font-size: 26rpx;
  532. color: red;
  533. }
  534. .goods_list-num {
  535. font-size: 26rpx;
  536. }
  537. .d3 {
  538. width: 0;
  539. height: 0;
  540. border-width: 12rpx;
  541. border-style: solid;
  542. border-color: #000 transparent transparent transparent;
  543. margin-top: 14rpx;
  544. margin-left: 6rpx;
  545. }
  546. </style>