index.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  1. <template>
  2. <view class="pages" style="position: relative;">
  3. <!-- #ifndef H5 -->
  4. <view style="position: fixed;top: 0;left: 0;right: 0;z-index: 9999;" class="bg">
  5. <!-- #endif -->
  6. <!-- #ifdef H5 -->
  7. <view style="position: fixed;top:44px;left: 0;right: 0;z-index:9;" class="bg">
  8. <!-- #endif -->
  9. <view class="flex bg justify-between">
  10. <view class="flex justify-around" style="width: 50%;">
  11. <view @click="switchTab(2)" :class="orderType==2? 'select':''" class="tabBtn">
  12. 外卖配送
  13. <view :class="orderType==2? 'active':''"></view>
  14. </view>
  15. <view @click="switchTab(1)" :class="orderType==1? 'select':''" class="tabBtn">
  16. 到店取餐
  17. <view :class="orderType==1? 'active':''"></view>
  18. </view>
  19. </view>
  20. <view class="shaix" @click="bindopen()">
  21. 条件筛选
  22. <image src="../../static/images/order/down.png" style="width:15upx;height:9upx;"></image>
  23. </view>
  24. </view>
  25. <view class="padding-bottom-sm">
  26. <u-tabs v-if="orderType == 1" active-color="#FF8D1A" :list="qucanList" :is-scroll="false"
  27. :current="current" @change="change"></u-tabs>
  28. <u-tabs v-if="orderType == 2" active-color="#FF8D1A" :list="waimaiList" :is-scroll="false"
  29. :current="current1" @change="change1">
  30. </u-tabs>
  31. </view>
  32. </view>
  33. <!-- 全部订单 -->
  34. <view class="cont_one">
  35. <!-- #ifdef MP-WEIXIN -->
  36. <view style="margin-top: 90px">
  37. <!-- #endif -->
  38. <!-- #ifndef MP-WEIXIN -->
  39. <view style="margin-top: 90px">
  40. <!-- #endif -->
  41. <view v-for="(item,index) in orderList" :key='index'
  42. @click="goNav('/pages/order/orderDet?orderNumber='+item.orderNumber+'&orderId='+item.orderId)">
  43. <view class="cont">
  44. <view class="flex justify-between padding align-center">
  45. <view class="text-red text-lg" v-if="item.status == 6">制作中</view>
  46. <view class="text-red text-lg" v-if="item.status == 7">待接单</view>
  47. <view class="text-green text-lg" v-if="item.status == 3&&item.orderType==1">待取餐
  48. </view>
  49. <view class="text-green text-lg"
  50. v-if="item.status == 3&&item.orderType==2&&item.riderUserId==null">待配送</view>
  51. <view class="text-green text-lg"
  52. v-if="item.status == 3&&item.orderType==2&&item.riderUserId">配送中</view>
  53. <view class="text-grey text-lg" v-if="item.status == 4">已完成</view>
  54. <view class="text-gray text-lg" v-if="item.status == 5">已取消</view>
  55. <view class="text-gray text-sm">{{item.payTime}}</view>
  56. </view>
  57. <u-line color="#f2f2f2" />
  58. <view class="text-red text-xl padding-lr padding-top" v-if="item.orderType==1"><text
  59. style="font-size: 30upx;">取餐号:</text>{{item.orderCode}}</view>
  60. <view class="padding-bottom padding-lr margin-top-sm flex"
  61. v-for="(ite,ind) in item.orderGoodsList" :key='ind'>
  62. <view class="tosend_header_food_le">
  63. <image :src="ite.goodsPicture" alt="加载失败" style="border-radius: 10rpx;" mode="">
  64. </image>
  65. </view>
  66. <view class="margin-left-sm">
  67. <view class="text-black text-lg">{{ite.goodsName}}</view>
  68. <view class="flex align-center text-gray text-sm margin-top-xs">
  69. <view v-if="ite.skuMessage">{{ite.skuMessage}}</view>
  70. <view class="text-gray text-sm" style="margin-left: 5px;margin-top: 4px;">
  71. X{{ite.goodsNum}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. <u-line color="#f2f2f2" />
  76. <view class="padding-bottom padding-lr margin-top-sm text-gray">
  77. <view>手机号:{{item.phone}}</view>
  78. <view>订单号:{{item.orderNumber}}</view>
  79. </view>
  80. <u-line color="#f2f2f2" />
  81. <view class="flex align-center justify-between padding-tb">
  82. <view class="flex align-center padding-lr-sm">
  83. <view class="text-gray text-sm">实收:</view>
  84. <view class="text-sm text-black text-bold">¥<text
  85. class="text-xl">{{item.payMoney}}</text>
  86. </view>
  87. </view>
  88. <view class=" flex margin-right">
  89. <view class="flex"
  90. v-if="item.status == 6||item.status == 3">
  91. <view class="btn_" @click.stop="refund(item)" v-if="show1">退款</view>
  92. <view class="btn_" v-if="!show1"
  93. style="background:#FAB6B6;color: #F15B6C;opacity: 0.1;">退款</view>
  94. </view>
  95. <view class="flex" v-if="item.status == 6">
  96. <view class="btn_" @click.stop="finish(item)">制作完成</view>
  97. </view>
  98. <view class="flex"
  99. v-if="item.status == 3&&item.autoSendOrder==2">
  100. <view class="btn_" @click.stop="finishs(item)">配送完成</view>
  101. </view>
  102. <view class="flex" v-if="item.status == 7">
  103. <view class="btn_" @click.stop="jiedan(item)">接单</view>
  104. </view>
  105. <view class="flex" v-if="item.status == 7">
  106. <view class="btn_" @click.stop="jiedans(item)">拒绝接单</view>
  107. </view>
  108. <view class="flex" v-if="item.status == 6||item.status == 3||item.status == 4">
  109. <view class="btn_" @click.stop="xiaoPiao(item)">补打小票</view>
  110. </view>
  111. <view class="flex"
  112. v-if="item.status == 3&&item.orderType==1">
  113. <view class="btn_" @click.stop="peisong(item,1)">待取餐</view>
  114. </view>
  115. <view class="flex"
  116. v-if="item.status == 3&&item.orderType==2&&item.autoSendOrder ==1">
  117. <view class="btn_" @click.stop="succOrder(item)">完成送达</view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 筛选弹框 -->
  126. <view class="box" v-if="show">
  127. <view class="popbox" @click.stop="shop = false">
  128. <view class="padding">
  129. <view>
  130. <view>订单号</view>
  131. <view>
  132. <input type="number" v-model="orderNumber" class="impute padding-lr"
  133. placeholder="请输入订单号" />
  134. </view>
  135. </view>
  136. <view>
  137. <view>手机号</view>
  138. <view>
  139. <input type="number" v-model="phone" class="impute padding-lr"
  140. placeholder="请输入手机号码" />
  141. </view>
  142. </view>
  143. <view>
  144. <view>昵称</view>
  145. <view>
  146. <input type="text" v-model="userName" class="impute padding-lr"
  147. placeholder="请输入昵称" />
  148. </view>
  149. </view>
  150. </view>
  151. <view class="btns" @click.stop="bindx()">查询</view>
  152. </view>
  153. </view>
  154. <empty v-if="!orderList.length" style="z-index:0;position: relative;top: -20px;"></empty>
  155. </view>
  156. </template>
  157. <script>
  158. import empty from '@/components/empty.vue'
  159. export default {
  160. components: {
  161. empty
  162. },
  163. data() {
  164. return {
  165. show: false,
  166. page: 1,
  167. limit: 10,
  168. phone: '',
  169. userName: '',
  170. orderNumber: '',
  171. shopId: '',
  172. orderType: 2,
  173. orderList: [],
  174. status: '',
  175. xcxSelect: '',
  176. current: 0,
  177. current1: 0,
  178. qucanList: [{
  179. name: '全部'
  180. },
  181. {
  182. name: '待接单'
  183. },
  184. {
  185. name: '制作中'
  186. },
  187. {
  188. name: '待取餐'
  189. },
  190. {
  191. name: '已完成'
  192. },
  193. {
  194. name: '已取消'
  195. }
  196. ],
  197. waimaiList: [{
  198. name: '全部'
  199. }, {
  200. name: '待接单'
  201. },
  202. {
  203. name: '制作中'
  204. },
  205. {
  206. name: '配送中'
  207. },
  208. {
  209. name: '已完成'
  210. },
  211. {
  212. name: '已取消'
  213. }
  214. ],
  215. arr:[],
  216. show1: true,
  217. };
  218. },
  219. onLoad(option) {
  220. uni.showLoading({
  221. title: '加载中...'
  222. })
  223. this.$Request.getT('/app/common/type/354').then(res => { //订单取消通知
  224. if (res.code == 0) {
  225. if (res.data && res.data.value) {
  226. this.arr.push(res.data.value)
  227. }
  228. }
  229. })
  230. this.$Request.getT('/app/common/type/353').then(res => { //订单取消通知
  231. if (res.code == 0) {
  232. if (res.data && res.data.value) {
  233. this.arr.push(res.data.value)
  234. }
  235. }
  236. })
  237. this.$Request.getT('/app/common/type/352').then(res => { //新订单通知
  238. if (res.code == 0) {
  239. if (res.data && res.data.value) {
  240. this.arr.push(res.data.value)
  241. }
  242. }
  243. })
  244. // this.shopId = option.shopId
  245. if (option.status) {
  246. this.change(option.status)
  247. }
  248. },
  249. onShow() {
  250. this.shopId = uni.getStorageSync('shopId');
  251. this.getOrderList();
  252. this.clearOrderMsg();
  253. },
  254. methods: {
  255. //聊天室
  256. chat(e) {
  257. // #ifdef MP-WEIXIN
  258. if (uni.getStorageSync('sendindexMsg')) {
  259. uni.requestSubscribeMessage({
  260. tmplIds: this.arr,
  261. success(re) {
  262. // console.log(re,'**********')
  263. var datas = JSON.stringify(re);
  264. if (datas.indexOf("accept") != -1) {
  265. console.log(re)
  266. }
  267. },
  268. fail: (res) => {
  269. console.log(res)
  270. }
  271. })
  272. }
  273. // #endif
  274. // console.log(e)
  275. uni.navigateTo({
  276. url: '/pages/my/im?orderId=' + e.orderId
  277. })
  278. },
  279. peisong(e, index) {
  280. // #ifdef MP-WEIXIN
  281. if (uni.getStorageSync('sendindexMsg')) {
  282. uni.requestSubscribeMessage({
  283. tmplIds: this.arr,
  284. success(re) {
  285. // console.log(re,'**********')
  286. var datas = JSON.stringify(re);
  287. if (datas.indexOf("accept") != -1) {
  288. console.log(re)
  289. }
  290. },
  291. fail: (res) => {
  292. console.log(res)
  293. }
  294. })
  295. }
  296. // #endif
  297. let that = this
  298. if (index == 1) {
  299. var texts = '确认要取餐吗?'
  300. }
  301. if (index == 2) {
  302. var texts = '确认开始配送吗?'
  303. }
  304. uni.showModal({
  305. title: '提示',
  306. content: texts,
  307. success: function(res) {
  308. if (res.confirm) {
  309. console.log('用户点击确定');
  310. let data = {
  311. orderId: e.orderId,
  312. orderNumber: e.orderNumber,
  313. shopId: that.shopId,
  314. status: 4
  315. }
  316. that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
  317. if (res.code == 0) {
  318. that.getOrderList()
  319. }
  320. });
  321. } else if (res.cancel) {
  322. console.log('用户点击取消');
  323. }
  324. }
  325. });
  326. },
  327. // 清除订单未读消息
  328. clearOrderMsg() {
  329. let data = {
  330. shopIds: this.shopId
  331. }
  332. this.$Request.postA("/admin/ordermessage/allcheckOrderMessage", data).then(res => {
  333. if (res.code == 0 && res.data > 0) {
  334. }
  335. });
  336. },
  337. bindopen() {
  338. this.show = !this.show
  339. },
  340. bindx() {
  341. this.show = false
  342. this.getOrderList()
  343. this.phone = ''
  344. this.userName = ''
  345. this.orderNumber = ''
  346. },
  347. refund(e) {
  348. // #ifdef MP-WEIXIN
  349. if (uni.getStorageSync('sendindexMsg')) {
  350. uni.requestSubscribeMessage({
  351. tmplIds: this.arr,
  352. success(re) {
  353. // console.log(re,'**********')
  354. var datas = JSON.stringify(re);
  355. if (datas.indexOf("accept") != -1) {
  356. console.log(re)
  357. }
  358. },
  359. fail: (res) => {
  360. console.log(res)
  361. }
  362. })
  363. }
  364. // #endif
  365. let that = this
  366. uni.showModal({
  367. title: '提示',
  368. content: '确认退款吗?',
  369. success: function(res) {
  370. if (res.confirm) {
  371. console.log('用户点击确定');
  372. that.show1 = false
  373. let data = {
  374. orderId: e.orderId
  375. }
  376. that.$Request.postA("/admin/order/adminCancelOrder", data).then(res => {
  377. if (res.code == 0) {
  378. that.getOrderList()
  379. }
  380. });
  381. } else if (res.cancel) {
  382. console.log('用户点击取消');
  383. }
  384. }
  385. });
  386. },
  387. // 完成送达
  388. succOrder(e){
  389. // #ifdef MP-WEIXIN
  390. if (uni.getStorageSync('sendindexMsg')) {
  391. uni.requestSubscribeMessage({
  392. tmplIds: this.arr,
  393. success(re) {
  394. // console.log(re,'**********')
  395. var datas = JSON.stringify(re);
  396. if (datas.indexOf("accept") != -1) {
  397. console.log(re)
  398. }
  399. },
  400. fail: (res) => {
  401. console.log(res)
  402. }
  403. })
  404. }
  405. // #endif
  406. let that = this
  407. uni.showModal({
  408. title: '提示',
  409. content: '确认完成送达吗?',
  410. success: function(res) {
  411. if (res.confirm) {
  412. console.log('用户点击确定');
  413. let data = {
  414. orderId: e.orderId,
  415. // orderNumber: e.orderNumber,
  416. // shopId: that.shopId,
  417. // addressId: e.addressId,
  418. // status: 3
  419. }
  420. that.$Request.postT("/admin/order/accomplishOrder", data).then(res => {
  421. if (res.code == 0) {
  422. that.getOrderList()
  423. }
  424. });
  425. } else if (res.cancel) {
  426. console.log('用户点击取消');
  427. }
  428. }
  429. });
  430. },
  431. //制作完成
  432. finish(e) {
  433. // #ifdef MP-WEIXIN
  434. if (uni.getStorageSync('sendindexMsg')) {
  435. uni.requestSubscribeMessage({
  436. tmplIds: this.arr,
  437. success(re) {
  438. // console.log(re,'**********')
  439. var datas = JSON.stringify(re);
  440. if (datas.indexOf("accept") != -1) {
  441. console.log(re)
  442. }
  443. },
  444. fail: (res) => {
  445. console.log(res)
  446. }
  447. })
  448. }
  449. // #endif
  450. let that = this
  451. uni.showModal({
  452. title: '提示',
  453. content: '确认操作完成吗?',
  454. success: function(res) {
  455. if (res.confirm) {
  456. console.log('用户点击确定');
  457. let data = {
  458. orderId: e.orderId,
  459. orderNumber: e.orderNumber,
  460. shopId: that.shopId,
  461. addressId: e.addressId,
  462. status: 3
  463. }
  464. that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
  465. if (res.code == 0) {
  466. that.getOrderList()
  467. }
  468. });
  469. } else if (res.cancel) {
  470. console.log('用户点击取消');
  471. }
  472. }
  473. });
  474. },
  475. //配送完成
  476. finishs(e) {
  477. // #ifdef MP-WEIXIN
  478. if (uni.getStorageSync('sendindexMsg')) {
  479. uni.requestSubscribeMessage({
  480. tmplIds: this.arr,
  481. success(re) {
  482. // console.log(re,'**********')
  483. var datas = JSON.stringify(re);
  484. if (datas.indexOf("accept") != -1) {
  485. console.log(re)
  486. }
  487. },
  488. fail: (res) => {
  489. console.log(res)
  490. }
  491. })
  492. }
  493. // #endif
  494. let that = this
  495. uni.showModal({
  496. title: '提示',
  497. content: '确认操作完成吗?',
  498. success: function(res) {
  499. if (res.confirm) {
  500. console.log('用户点击确定');
  501. let data = {
  502. orderId: e.orderId,
  503. orderNumber: e.orderNumber,
  504. shopId: that.shopId,
  505. addressId: e.addressId,
  506. status: 4
  507. }
  508. that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
  509. if (res.code == 0) {
  510. that.getOrderList()
  511. }
  512. });
  513. } else if (res.cancel) {
  514. console.log('用户点击取消');
  515. }
  516. }
  517. });
  518. },
  519. //接单
  520. jiedan(e) {
  521. // #ifdef MP-WEIXIN
  522. if (uni.getStorageSync('sendindexMsg')) {
  523. uni.requestSubscribeMessage({
  524. tmplIds: this.arr,
  525. success(re) {
  526. // console.log(re,'**********')
  527. var datas = JSON.stringify(re);
  528. if (datas.indexOf("accept") != -1) {
  529. console.log(re)
  530. }
  531. },
  532. fail: (res) => {
  533. console.log(res)
  534. }
  535. })
  536. }
  537. // #endif
  538. let that = this
  539. uni.showModal({
  540. title: '提示',
  541. content: '确认接单吗?',
  542. success: function(res) {
  543. if (res.confirm) {
  544. console.log('用户点击确定');
  545. let data = {
  546. orderId: e.orderId,
  547. orderNumber: e.orderNumber,
  548. status: 6
  549. }
  550. that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
  551. if (res.code == 0) {
  552. that.page = 1
  553. that.getOrderList()
  554. }else{
  555. that.$queue.showToast(res.msg)
  556. }
  557. });
  558. } else if (res.cancel) {
  559. console.log('用户点击取消');
  560. }
  561. }
  562. });
  563. },
  564. // 补打小票
  565. xiaoPiao(e){
  566. // #ifdef MP-WEIXIN
  567. if (uni.getStorageSync('sendindexMsg')) {
  568. uni.requestSubscribeMessage({
  569. tmplIds: this.arr,
  570. success(re) {
  571. // console.log(re,'**********')
  572. var datas = JSON.stringify(re);
  573. if (datas.indexOf("accept") != -1) {
  574. console.log(re)
  575. }
  576. },
  577. fail: (res) => {
  578. console.log(res)
  579. }
  580. })
  581. }
  582. // #endif
  583. let that = this
  584. uni.showModal({
  585. title: '提示',
  586. content: '确认补打小票吗?',
  587. success: function(re) {
  588. if (re.confirm) {
  589. console.log('用户点击确定');
  590. let data = {
  591. orderId: e.orderId,
  592. // orderNumber: e.orderNumber,
  593. // status: 8
  594. }
  595. that.$Request.post("/admin/order/print", data).then(res => {
  596. if (res.code == 0) {
  597. // that.page = 1
  598. // that.getOrderList()
  599. }else{
  600. that.$queue.showToast(res.msg)
  601. }
  602. });
  603. } else if (re.cancel) {
  604. console.log('用户点击取消');
  605. }
  606. }
  607. });
  608. },
  609. //拒绝接单
  610. jiedans(e) {
  611. // #ifdef MP-WEIXIN
  612. if (uni.getStorageSync('sendindexMsg')) {
  613. uni.requestSubscribeMessage({
  614. tmplIds: this.arr,
  615. success(re) {
  616. // console.log(re,'**********')
  617. var datas = JSON.stringify(re);
  618. if (datas.indexOf("accept") != -1) {
  619. console.log(re)
  620. }
  621. },
  622. fail: (res) => {
  623. console.log(res)
  624. }
  625. })
  626. }
  627. // #endif
  628. let that = this
  629. uni.showModal({
  630. title: '提示',
  631. content: '确认拒绝接单吗?',
  632. success: function(res) {
  633. if (res.confirm) {
  634. console.log('用户点击确定');
  635. let data = {
  636. orderId: e.orderId,
  637. orderNumber: e.orderNumber,
  638. status: 8
  639. }
  640. that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
  641. if (res.code == 0) {
  642. that.page = 1
  643. that.getOrderList()
  644. }
  645. });
  646. } else if (res.cancel) {
  647. console.log('用户点击取消');
  648. }
  649. }
  650. });
  651. },
  652. switchTab(e) {
  653. // #ifdef MP-WEIXIN
  654. if (uni.getStorageSync('sendindexMsg')) {
  655. uni.requestSubscribeMessage({
  656. tmplIds: this.arr,
  657. success(re) {
  658. // console.log(re,'**********')
  659. var datas = JSON.stringify(re);
  660. if (datas.indexOf("accept") != -1) {
  661. console.log(re)
  662. }
  663. },
  664. fail: (res) => {
  665. console.log(res)
  666. }
  667. })
  668. }
  669. // #endif
  670. this.page = 1
  671. this.orderType = e
  672. this.current = 0
  673. this.current1 = 0
  674. this.status = ''
  675. this.getOrderList()
  676. },
  677. change(index) {
  678. // #ifdef MP-WEIXIN
  679. if (uni.getStorageSync('sendindexMsg')) {
  680. uni.requestSubscribeMessage({
  681. tmplIds: this.arr,
  682. success(re) {
  683. // console.log(re,'**********')
  684. var datas = JSON.stringify(re);
  685. if (datas.indexOf("accept") != -1) {
  686. console.log(re)
  687. }
  688. },
  689. fail: (res) => {
  690. console.log(res)
  691. }
  692. })
  693. }
  694. // #endif
  695. this.page = 1
  696. this.current = index;
  697. switch (index) {
  698. case 0:
  699. this.status = '' //全部
  700. break;
  701. case 1:
  702. this.status = 7 //待接单
  703. break;
  704. case 2:
  705. this.status = 6 //制作中
  706. break;
  707. case 3:
  708. this.status = 3 //待取餐
  709. break;
  710. case 4:
  711. this.status = 4 //已完成
  712. break;
  713. case 5:
  714. this.status = 5 //已取消
  715. break;
  716. case '2':
  717. this.status = 6 //制作中
  718. break;
  719. case '1':
  720. this.status = 7 //待接单
  721. break;
  722. case '3':
  723. this.status = 3 //制作中
  724. break;
  725. case '4':
  726. this.status = 4 //制作中
  727. break;
  728. }
  729. this.getOrderList()
  730. },
  731. change1(index) {
  732. // #ifdef MP-WEIXIN
  733. if (uni.getStorageSync('sendindexMsg')) {
  734. uni.requestSubscribeMessage({
  735. tmplIds: this.arr,
  736. success(re) {
  737. // console.log(re,'**********')
  738. var datas = JSON.stringify(re);
  739. if (datas.indexOf("accept") != -1) {
  740. console.log(re)
  741. }
  742. },
  743. fail: (res) => {
  744. console.log(res)
  745. }
  746. })
  747. }
  748. // #endif
  749. this.page = 1
  750. this.current1 = index;
  751. switch (index) {
  752. case 0:
  753. this.status = ''
  754. break;
  755. case 1:
  756. this.status = 7 //待接单
  757. break;
  758. case 2:
  759. this.status = 6
  760. break;
  761. case 3:
  762. this.status = 3
  763. break;
  764. case 4:
  765. this.status = 4
  766. break;
  767. case 5:
  768. this.status = 5
  769. break;
  770. }
  771. this.getOrderList()
  772. },
  773. goNav(url) {
  774. // #ifdef MP-WEIXIN
  775. if (uni.getStorageSync('sendindexMsg')) {
  776. uni.requestSubscribeMessage({
  777. tmplIds: this.arr,
  778. success(re) {
  779. // console.log(re,'**********')
  780. var datas = JSON.stringify(re);
  781. if (datas.indexOf("accept") != -1) {
  782. console.log(re)
  783. }
  784. },
  785. fail: (res) => {
  786. console.log(res)
  787. }
  788. })
  789. }
  790. // #endif
  791. uni.navigateTo({
  792. url
  793. })
  794. },
  795. // 获取数据列表
  796. getOrderList() {
  797. uni.showLoading({
  798. title: '加载中···'
  799. })
  800. let data = {
  801. page: this.page,
  802. limit: this.limit,
  803. phone: this.phone,
  804. userName: this.userName,
  805. orderNumber: this.orderNumber,
  806. shopId: this.shopId,
  807. status: this.status,
  808. orderType: this.orderType
  809. }
  810. this.$Request.getA("/admin/order/selectAllOrder", data).then(res => {
  811. uni.hideLoading()
  812. uni.stopPullDownRefresh();
  813. if (res.code == 0) {
  814. // this.msgData = res.data
  815. res.data.list.forEach(res => {
  816. res.orderCode = res.orderCode.substring(res.orderCode.length - 3, res.orderCode
  817. .length)
  818. var phone = res.phone;
  819. var result = phone.substring(0, 3) + "****" + phone.substring(7, 11);
  820. // console.log(result);
  821. res.phone = result
  822. })
  823. if (this.page == 1) {
  824. this.orderList = res.data.list
  825. } else {
  826. this.orderList = [...this.orderList, ...res.data.list]
  827. }
  828. this.totalCount = res.data.totalCount
  829. this.show1 = true
  830. }
  831. });
  832. }
  833. },
  834. onReachBottom: function() {
  835. this.page = this.page + 1;
  836. this.getOrderList();
  837. if (this.totalCount == this.orderList.length) {
  838. uni.showToast({
  839. title: '已经到底了~',
  840. icon: 'none'
  841. })
  842. }
  843. },
  844. onPullDownRefresh: function() {
  845. this.page = 1;
  846. this.getOrderList();
  847. },
  848. }
  849. </script>
  850. <style scoped>
  851. .active {
  852. width: 82rpx;
  853. height: 6rpx;
  854. background: #333333;
  855. margin-left: 12rpx;
  856. }
  857. .bg {
  858. background-color: #FFFFFF;
  859. }
  860. /* 切换选项 */
  861. .nav {
  862. display: flex;
  863. align-items: center;
  864. justify-content: center;
  865. background-color: #FFFFFF;
  866. color: #999999;
  867. }
  868. .btn {
  869. /* padding: 10rpx 20rpx;
  870. text-align: center;
  871. background: rgba(255, 19, 10, 0.2);
  872. font-size: 28rpx;
  873. border: 2rpx solid #FF130A;
  874. color: #FF130A;
  875. opacity: 0.6;
  876. border-radius: 8rpx; */
  877. width: 150rpx;
  878. height: 60rpx;
  879. line-height: 60rpx;
  880. text-align: center;
  881. background: #F5F5F5;
  882. font-size: 28rpx;
  883. border: 2rpx solid ##F5F5F5;
  884. color: #666666;
  885. border-radius: 50rpx;
  886. font-weight: 700;
  887. margin-left: 10rpx;
  888. }
  889. .btnCm {
  890. /* padding: 10rpx 20rpx;
  891. text-align: center;
  892. background: #0081FF;
  893. font-size: 28rpx;
  894. border: 2rpx solid #0081FF;
  895. color: #FFFFFF;
  896. opacity: 0.6;
  897. border-radius: 8rpx; */
  898. }
  899. .btn_ {
  900. width: 150rpx;
  901. height: 60rpx;
  902. line-height: 60rpx;
  903. text-align: center;
  904. background: #FCD202;
  905. font-size: 28rpx;
  906. border: 2rpx solid #FCD202;
  907. color: #333333;
  908. border-radius: 50rpx;
  909. font-weight: 700;
  910. margin-left: 15rpx;
  911. }
  912. .tabBtn {
  913. /* background-color: #f6f6fa; */
  914. height: 60rpx;
  915. line-height: 60rpx;
  916. color: #000000;
  917. font-size: 31rpx;
  918. font-weight: bold;
  919. }
  920. .shaix {
  921. width: 30%;
  922. text-align: center;
  923. display: flex;
  924. align-items: center;
  925. justify-content: center;
  926. letter-spacing: 4rpx;
  927. font-size: 27rpx;
  928. }
  929. .select {
  930. color: #000000;
  931. font-size: 31rpx;
  932. font-weight: bold;
  933. background-color: #fff;
  934. }
  935. .nav view {
  936. flex-grow: 1;
  937. margin: 3% 6.5% 2%;
  938. text-align: center;
  939. }
  940. .nav_btna {
  941. font-size: 42rpx;
  942. line-height: 34rpx;
  943. color: #000000;
  944. font-weight: bold;
  945. border-bottom: 14rpx solid #FCD202;
  946. }
  947. /* 内容 */
  948. /* 全部订单 */
  949. .cont_one {
  950. /* margin-top: 160rpx; */
  951. }
  952. .cont_one image {
  953. width: 80%;
  954. height: 353rpx;
  955. }
  956. /* 到店取餐 */
  957. .cont_two {
  958. display: none;
  959. width: 94%;
  960. margin: 3% auto;
  961. background-color: #FFFFFF;
  962. border-radius: 18rpx;
  963. }
  964. .cont {
  965. /* display: none; */
  966. width: 94%;
  967. margin: 3% auto;
  968. background-color: #FFFFFF;
  969. border-radius: 18rpx;
  970. }
  971. .cont_two_top {
  972. width: 94%;
  973. padding: 4% 3% 0;
  974. margin: 0 auto;
  975. display: flex;
  976. justify-content: space-between;
  977. }
  978. .cont_two_top_le {
  979. width: 85%;
  980. font-size: 30rpx;
  981. font-weight: 500;
  982. color: #333333;
  983. /* line-height: 2; */
  984. margin: 5rpx 0;
  985. }
  986. .cont_two_top_ri {
  987. /* width: 15%; */
  988. padding: 6rpx 10rpx;
  989. text-align: center;
  990. background: rgba(255, 19, 10, 0.2);
  991. font-size: 24rpx;
  992. border: 2rpx solid #FF130A;
  993. color: #FF130A;
  994. opacity: 0.6;
  995. border-radius: 8rpx;
  996. }
  997. .cont_two_top_ri1 {
  998. /* width: 15%; */
  999. text-align: center;
  1000. /* line-height: 2; */
  1001. padding: 6rpx 10rpx;
  1002. background: #62ba8b;
  1003. font-size: 24rpx;
  1004. border: 2rpx solid #62ba8b;
  1005. color: #fff;
  1006. /* opacity: 0.6; */
  1007. border-radius: 8rpx;
  1008. }
  1009. .cont_two_top_ri2 {
  1010. /* width: 15%; */
  1011. text-align: center;
  1012. /* line-height: 2; */
  1013. padding: 6rpx 10rpx;
  1014. background: #FCD202;
  1015. font-size: 24rpx;
  1016. border: 2rpx solid #FCD202;
  1017. color: #fff;
  1018. /* opacity: 0.6; */
  1019. border-radius: 8rpx;
  1020. }
  1021. .cont_two_text {
  1022. font-size: 58rpx;
  1023. text-align: center;
  1024. font-weight: bold;
  1025. color: red;
  1026. margin: 3% 0;
  1027. line-height: 32rpx;
  1028. }
  1029. .cont_two_text2 {
  1030. font-size: 30rpx;
  1031. width: 100%;
  1032. font-weight: 500;
  1033. color: #333333;
  1034. text-align: center;
  1035. padding-bottom: 3%;
  1036. /* line-height: 32rpx; */
  1037. }
  1038. .cont_two_text2 text {
  1039. color: #FF130A;
  1040. }
  1041. .cont_two_bottom {
  1042. width: 94%;
  1043. padding: 3%;
  1044. margin: 0 auto;
  1045. display: flex;
  1046. border-top: 1rpx solid #E6E6E6;
  1047. }
  1048. .cont_two_bottom_le {
  1049. flex: 1;
  1050. font-size: 24rpx;
  1051. font-weight: 500;
  1052. color: #999999;
  1053. line-height: 32rpx;
  1054. }
  1055. .cont_two_bottom_ri {
  1056. flex: 1;
  1057. text-align: right;
  1058. }
  1059. .cont_two_bottom_ri image {
  1060. width: 14rpx;
  1061. height: 24rpx;
  1062. }
  1063. /* 外卖订单 */
  1064. .cont_three {
  1065. display: none;
  1066. width: 94%;
  1067. margin: 3% auto;
  1068. background-color: #FFFFFF;
  1069. border-radius: 18rpx;
  1070. }
  1071. .cont_three_top {
  1072. width: 94%;
  1073. padding: 4% 3% 0;
  1074. margin: 0 auto;
  1075. display: flex;
  1076. }
  1077. .cont_three_top_le {
  1078. flex: 2;
  1079. font-size: 30rpx;
  1080. font-weight: 500;
  1081. color: #D80204;
  1082. line-height: 32rpx;
  1083. }
  1084. .cont_three_top_ri {
  1085. flex: 1;
  1086. text-align: right;
  1087. font-size: 24rpx;
  1088. font-weight: 500;
  1089. color: #999999;
  1090. line-height: 32rpx;
  1091. }
  1092. .cont_three_text {
  1093. padding: 2% 0 2% 3%;
  1094. font-size: 24rpx;
  1095. font-weight: 500;
  1096. color: #999999;
  1097. line-height: 32rpx;
  1098. }
  1099. .cont_three_cen {
  1100. width: 94%;
  1101. padding: 0.5% 3%;
  1102. margin: 0 auto;
  1103. display: flex;
  1104. }
  1105. .cont_three_cen_le {
  1106. flex: 2;
  1107. font-size: 30rpx;
  1108. font-weight: 500;
  1109. color: #333333;
  1110. line-height: 32rpx;
  1111. }
  1112. .cont_three_cen_ri {
  1113. flex: 1;
  1114. text-align: right;
  1115. font-size: 24rpx;
  1116. font-weight: 500;
  1117. color: #999999;
  1118. line-height: 32rpx;
  1119. }
  1120. .cont_three_text2 {
  1121. font-size: 24rpx;
  1122. font-weight: 500;
  1123. color: #D80204;
  1124. padding: 0 3%;
  1125. line-height: 32rpx;
  1126. }
  1127. .cont_three_bottom {
  1128. width: 94%;
  1129. padding: 3%;
  1130. margin: 3% auto 0;
  1131. display: flex;
  1132. border-top: 1rpx solid #E6E6E6;
  1133. }
  1134. .cont_three_bottom_le {
  1135. flex: 1;
  1136. font-size: 24rpx;
  1137. font-weight: 500;
  1138. color: #999999;
  1139. line-height: 32rpx;
  1140. }
  1141. .cont_three_bottom_ri {
  1142. flex: 1;
  1143. text-align: right;
  1144. }
  1145. .cont_dis {
  1146. display: block;
  1147. }
  1148. .box {
  1149. width: 100%;
  1150. height: 100vh;
  1151. background-color: rgba(0, 0, 0, 0.2);
  1152. /* opacity: 0.2; */
  1153. position: absolute;
  1154. top: 40px;
  1155. z-index: 999
  1156. }
  1157. .popbox {
  1158. width: 749upx;
  1159. /* height: 764upx; */
  1160. background: #FFFFFF;
  1161. padding-bottom: 72rpx;
  1162. z-inde: 999;
  1163. /* #ifdef H5 */
  1164. position: fixed;
  1165. top: 120px;
  1166. left: 0;
  1167. right: 0;
  1168. /* #endif */
  1169. /* #ifndef H5 */
  1170. position: fixed;
  1171. top: 66rpx;
  1172. left: 0;
  1173. right: 0;
  1174. /* #endif */
  1175. }
  1176. .impute {
  1177. background: #F2F2F2;
  1178. height: 80rpx;
  1179. margin: 20rpx 0;
  1180. }
  1181. .btns {
  1182. width: 690upx;
  1183. height: 88upx;
  1184. background: #FF8D1A;
  1185. box-shadow: 0upx 10upx 20upx 0upx #FFD9B3;
  1186. border-radius: 16upx;
  1187. text-align: center;
  1188. line-height: 88rpx;
  1189. font-size: 32rpx;
  1190. font-weight: bold;
  1191. margin: 0 auto;
  1192. }
  1193. .tosend_header_food_le {
  1194. width: 15%;
  1195. }
  1196. .tosend_header_food_le image {
  1197. width: 110rpx;
  1198. height: 110rpx;
  1199. }
  1200. .u-border-top:after {
  1201. border: none !important;
  1202. }
  1203. </style>