index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. <template>
  2. <view class="pages" style="position: relative;">
  3. <view style="position: fixed;top: 0;left: 0;right: 0;z-index: 99;width: 100%;" class="bg" >
  4. <view class="flex bg justify-between padding-lr-xl">
  5. <view @click="switchTab(2)" :class="orderType==2? 'select':''" class="tabBtn" v-if="XCXIsSelect=='是'">
  6. <view class="title">外卖配送</view>
  7. <view :class="orderType==2? 'active':''"></view>
  8. </view>
  9. <view @click="switchTab(1)" :class="orderType==1? 'select':''" class="tabBtn" v-if="XCXIsSelect=='是'">
  10. <view class="title">到店取餐</view>
  11. <view :class="orderType==1? 'active':''"></view>
  12. </view>
  13. <view @click="switchTab(3)" :class="orderType==3? 'select':''" class="tabBtn" v-if="XCXIsSelect=='是'">
  14. <view class="title">跑腿订单</view>
  15. <view :class="orderType==3? 'active':''"></view>
  16. </view>
  17. </view>
  18. <view>
  19. <u-tabs v-if="orderType == 1" active-color="#FF8D1A" :list="qucanList" :is-scroll="true"
  20. :current="current" @change="change"></u-tabs>
  21. <u-tabs v-if="orderType == 2" active-color="#FF8D1A" :list="waimaiList" :is-scroll="true"
  22. :current="current1" @change="change1">
  23. </u-tabs>
  24. <u-tabs v-if="orderType == 3" :list="paotuiList" :is-scroll="true" active-color="#FCD202"
  25. :current="current2" @change="change2"></u-tabs>
  26. </view>
  27. </view>
  28. <!-- 全部订单 -->
  29. <view class="cont_one" v-if="orderType != 3&&XCXIsSelect=='是'">
  30. <view v-for="(item,index) in orderList" :key='index'
  31. @click="goNav('/pages/order/takefood?orderId='+item.orderId+'&shopId='+item.shopId)">
  32. <view class="cont" v-if="item.orderType == 1">
  33. <view class="order_success">
  34. <view class="order_name" v-if="item.status == 6">制作中</view>
  35. <view class="order_name" v-if="item.status == 3">待取餐</view>
  36. <view class="order_name" v-if="item.status == 4">已完成</view>
  37. <view class="order_name" v-if="item.status == 5">已取消</view>
  38. <view class="order_name" v-if="item.status == 7">待接单</view>
  39. <view class="order_name" v-if="item.status == 8">已取消</view>
  40. <view class="order_data">{{item.payTime}}</view>
  41. </view>
  42. <u-line color="#E6E6E6" />
  43. <view class="cont_two_top">
  44. <view class="text-lg text-bold text-black flex align-center">
  45. <image :src="item.shopCover" style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
  46. mode=""></image>
  47. <view class="margin-left-xs">{{item.shopName}}</view>
  48. </view>
  49. </view>
  50. <view class="cont_two_text">{{item.orderCode}}</view>
  51. <view class="cont_two_text2" v-if="item.status == 6">前面还有<text>{{item.countOrder}}</text>个人排队</view>
  52. <!-- <view class="cont_two_bottom">
  53. <view class="cont_two_bottom_le">点餐详情</view>
  54. <view class="cont_two_bottom_ri">
  55. <image src="../../static/images/order/right1.png" mode=""></image>
  56. </view>
  57. </view> -->
  58. <u-line color="#E6E6E6" />
  59. <view class="flex justify-between align-center padding-lr-sm padding-tb-sm">
  60. <view class="text-sm text-gray">实收 <text
  61. class="text-lg text-bold text-black margin-left-xs">¥{{item.payMoney}}</text></view>
  62. <view class="flex padding-tb-sm">
  63. <view v-if="item.status == 7" class="btn" @click.stop="cancel(item)">取消订单</view>
  64. </view>
  65. <view v-if="item.status == 4 &&item.commentFlag!=1" class="btn" @click.stop="pingjia(item)">
  66. 评价订单</view>
  67. </view>
  68. </view>
  69. <view class="cont" v-if="item.orderType == 2">
  70. <view class="order_success">
  71. <view class="order_name" v-if="item.status == 3">配送中<text style="color: #666666;margin-left: 10upx;">{{item.autoSendOrder==1?'商家配送':'平台配送'}}</text></view>
  72. <view class="order_name" v-if="item.status == 4">已完成</view>
  73. <view class="order_name" v-if="item.status == 5">已取消</view>
  74. <view class="order_name" v-if="item.status == 6">制作中</view>
  75. <view class="order_name" v-if="item.status == 7">待接单</view>
  76. <view class="order_name" v-if="item.status == 8">已取消</view>
  77. <view class="order_data">{{item.payTime}}</view>
  78. </view>
  79. <u-line color="#E6E6E6" />
  80. <view class="flex justify-between padding align-center">
  81. <view class="text-lg text-bold text-black flex align-center">
  82. <image :src="item.shopCover" style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
  83. mode=""></image>
  84. <view class="margin-left-xs">{{item.shopName}}</view>
  85. </view>
  86. </view>
  87. <view class="">
  88. <view class=" padding-lr margin-tb-sm" v-for="(ite,ind) in item.orderGoodsList" :key='ind'>
  89. <view class="flex">
  90. <image :src="ite.goodsPicture[0]" mode=""
  91. style="width: 120rpx;height: 120rpx;border-radius: 10rpx;"></image>
  92. <view class="margin-left-sm flex flex-direction justify-between">
  93. <view class="text-black text-bold text-lg">{{ite.goodsName}}</view>
  94. <view class="text-gray text-sm" v-if="ite.skuMessage">{{ite.skuMessage}}</view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <u-line color="#E6E6E6" />
  100. <view class="flex justify-between align-center padding-lr-sm">
  101. <view class="text-sm text-gray">实收 <text
  102. class="text-lg text-bold text-black margin-left-xs">¥{{item.payMoney}}</text></view>
  103. <view class="flex padding-tb-sm">
  104. <view v-if="item.status == 3" class="btn" @click.stop="finish(item)">确认收货</view>
  105. <view v-if="item.status == 6||item.status == 7" class="btn" @click.stop="cancel(item)">取消订单
  106. </view>
  107. <view v-if="item.status == 4 &&item.commentFlag!=1" class="btn" @click.stop="pingjia(item)">
  108. 评价订单</view>
  109. <view class="btn_" @click.stop="goShop(item.shopId)">再来一单</view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <empty v-if="!orderList.length" style="z-index:0"></empty>
  115. </view>
  116. <view v-if="orderType == 3" style="margin-top: 160rpx;">
  117. <view>
  118. <view class="order_box" v-for="(item,index) in order" :key="index"
  119. @click="bindorderDetail(item.indentNumber)">
  120. <view class="order_success">
  121. <view class="order_name" v-if="item.indentState == 0">待付款</view>
  122. <view class="order_name"
  123. v-if="item.indentState == 1||item.indentState == 8||item.indentState == 9||item.indentState == 10">
  124. 已取消</view>
  125. <view class="order_name" v-if="item.indentState == 2">待接单</view>
  126. <view class="order_name" v-if="item.indentState == 5">待确认</view>
  127. <view class="order_name" v-if="item.indentState == 3">已接单</view>
  128. <view class="order_name" v-if="item.indentState == 4">派送中</view>
  129. <view class="order_name" v-if="item.indentState ==6||item.indentState ==7">
  130. 已完成</view>
  131. <view class="order_name" v-if="item.indentState == 10">
  132. 已取消</view>
  133. <view class="order_data">{{item.createTime}}</view>
  134. </view>
  135. <u-line color="#E6E6E6" />
  136. <view class="order_city">
  137. <view class="city_type">
  138. <view class="type_name" v-if="item.indentType == 1">帮我送</view>
  139. <view class="type_name" v-if="item.indentType == 2">帮我取</view>
  140. <view class="type_name" v-if="item.indentType == 3">同城帮买</view>
  141. <view class="type_name" v-if="item.indentType == 4">同城服务</view>
  142. <view class="type_name" v-if="item.indentType == 5">同城外卖</view>
  143. <view class="city_text" v-if="item.indentType == 1||item.indentType == 2">
  144. {{item.itemType}}
  145. </view>
  146. <view class="city_text" v-if="item.indentType == 3&&item.buyType == 0">骑手购买</view>
  147. <view class="city_text" v-if="item.indentType == 3&&item.buyType == 1">指定购买</view>
  148. <view class="city_text" v-if="item.indentType == 4&&item.serviceType">{{item.serviceType}}
  149. </view>
  150. </view>
  151. <view class="city_address">
  152. <view class="fh_box"
  153. v-if="(item.indentType == 1||item.indentType == 2||item.indentType == 3)">
  154. <view class="fh_image">
  155. <image src="../../static/images/order/mai.png" v-if="item.indentType == 3"></image>
  156. <image src="../../static/images/order/icon_f.png" v-else></image>
  157. </view>
  158. <view class="box">
  159. <view class="fh_name">{{item.shopAddressDetail}}</view>
  160. <view class="fh_type" v-if="item.indentType != 3">{{item.shopName}}
  161. <text>{{item.shopPhone}}</text>
  162. </view>
  163. </view>
  164. </view>
  165. <view class="sh_box">
  166. <view class="sh_image">
  167. <image src="../../static/images/order/icon_s.png"></image>
  168. </view>
  169. <view class="box">
  170. <view class="sh_name">{{item.userAddressDetail}}</view>
  171. <view class="sh_type">{{item.userName}}
  172. <text>{{item.userPhone}}</text>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. <u-line color="#E6E6E6" />
  179. <view class="order_btn">
  180. <!-- <view class="btn1" v-if="item.indentState == 7||item.indentState == 6 &&!item.evaluateMessage"
  181. @tap.stop="pingjia(item)">
  182. 去评论
  183. </view> -->
  184. <view class="btn" v-if="item.indentState == 0||item.indentState == 2"
  185. @tap.stop="bindorderOff(item)">取消订单</view>
  186. <view class="btn" @tap.stop="bindconfirm(item)" v-if="item.indentState == 5">确认订单</view>
  187. <view class="btn_" @tap.stop="bindorder(item)" v-if="item.indentState == 1||item.indentState == 3||item.indentState ==8||
  188. item.indentState ==9||item.indentState ==10||item.indentState == 4||item.indentState == 6">再来一单</view>
  189. <view class="btn_" v-if="item.indentState == 0" @tap.stop="bindorderpay(item)">立即付款</view>
  190. </view>
  191. </view>
  192. </view>
  193. <empty v-if="!order.length" style="z-index:0"></empty>
  194. </view>
  195. </view>
  196. </template>
  197. <script>
  198. import empty from '@/components/empty.vue'
  199. export default {
  200. components: {
  201. empty
  202. },
  203. data() {
  204. return {
  205. show: false,
  206. page: 1,
  207. limit: 10,
  208. orderType: 2,
  209. orderList: [],
  210. status: '',
  211. current: 0,
  212. current1: 0,
  213. current2: 0,
  214. qucanList: [{
  215. name: '全部'
  216. },
  217. {
  218. name: '待接单'
  219. },
  220. {
  221. name: '制作中'
  222. },
  223. {
  224. name: '待取餐'
  225. },
  226. {
  227. name: '已完成'
  228. },
  229. {
  230. name: '已取消'
  231. }
  232. ],
  233. waimaiList: [{
  234. name: '全部'
  235. },
  236. {
  237. name: '待接单'
  238. },
  239. {
  240. name: '制作中'
  241. },
  242. {
  243. name: '配送中'
  244. },
  245. {
  246. name: '已完成'
  247. },
  248. {
  249. name: '已取消'
  250. }
  251. ],
  252. paotuiList: [{
  253. name: '全部',
  254. id: 1
  255. },
  256. {
  257. name: '待付款',
  258. id: 2
  259. },
  260. {
  261. name: '待接单',
  262. id: 3
  263. },
  264. {
  265. name: '已接单',
  266. id: 4
  267. },
  268. {
  269. name: '派送中',
  270. id: 5
  271. },
  272. {
  273. name: '已完成',
  274. id: 6
  275. },
  276. {
  277. name: '已取消',
  278. id: 7
  279. }
  280. ],
  281. userId: '',
  282. currentIndex: 1,
  283. order: [],
  284. waimaiCount: 0,
  285. paotuiCount: 0,
  286. XCXIsSelect: '是',
  287. arr:[]
  288. };
  289. },
  290. onLoad(option) {
  291. this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
  292. this.userId = uni.getStorageSync('userId')
  293. if (option.orderType) {
  294. this.orderType = option.orderType
  295. }
  296. uni.showLoading({
  297. title: '加载中...'
  298. })
  299. this.$Request.getT('/app/common/type/266').then(res => { //订单取消通知
  300. if (res.code == 0) {
  301. if (res.data && res.data.value) {
  302. this.arr.push(res.data.value)
  303. }
  304. }
  305. })
  306. this.$Request.getT('/app/common/type/269').then(res => { //订单状态通知
  307. if (res.code == 0) {
  308. if (res.data && res.data.value) {
  309. this.arr.push(res.data.value)
  310. }
  311. }
  312. })
  313. },
  314. onShow() {
  315. this.userId = uni.getStorageSync('userId')
  316. if (uni.getStorageSync('current') && this.userId) {
  317. this.current1 = uni.getStorageSync('current')
  318. this.status = uni.getStorageSync('current')
  319. this.page = 1
  320. this.orderType = 2
  321. uni.removeStorageSync('current')
  322. this.getOrderList()
  323. }
  324. if (this.userId) {
  325. if (this.orderType == 3) {
  326. this.orderList_()
  327. } else {
  328. this.getOrderList()
  329. }
  330. } else {
  331. this.order = []
  332. this.orderList = []
  333. }
  334. uni.hideLoading()
  335. },
  336. methods: {
  337. bindopen() {
  338. this.show = true
  339. },
  340. bindx() {
  341. this.show = false
  342. },
  343. // 取消跑腿订单
  344. bindorderOff(e) {
  345. // #ifdef MP-WEIXIN
  346. if (uni.getStorageSync('sendMsg')) {
  347. console.log('授权+1')
  348. wx.requestSubscribeMessage({
  349. tmplIds: this.arr,
  350. success(re) {
  351. console.log(JSON.stringify(re), 111111111111)
  352. var datas = JSON.stringify(re);
  353. if (datas.indexOf("accept") != -1) {
  354. // console.log(re)
  355. }
  356. },
  357. fail: (res) => {
  358. // console.log(res)
  359. }
  360. })
  361. }
  362. // #endif
  363. console.log(e)
  364. let indentNumber = e.indentNumber
  365. console.log(indentNumber)
  366. uni.showModal({
  367. title: '温馨提示',
  368. // content: '取消订单平台将扣除您'+e.userFine+'元?',
  369. content: '确定取消订单?',
  370. showCancel: true,
  371. cancelText: '取消',
  372. confirmText: '确认',
  373. success: res => {
  374. if (res.confirm) {
  375. this.$Request.postT('/app/tbindent/userCancleIndent?indentNumber=' + indentNumber)
  376. .then(res => {
  377. // console.log(res)
  378. if (res.code == 0) {
  379. uni.showToast({
  380. title: '订单取消成功'
  381. });
  382. this.page = 1;
  383. this.orderList_()
  384. } else {
  385. uni.hideLoading();
  386. uni.showModal({
  387. showCancel: false,
  388. title: '订单失败',
  389. content: res.msg
  390. });
  391. }
  392. });
  393. }
  394. }
  395. });
  396. },
  397. // 取消外卖订单
  398. cancel(e) {
  399. // #ifdef MP-WEIXIN
  400. if (uni.getStorageSync('sendMsg')) {
  401. console.log('授权+1')
  402. wx.requestSubscribeMessage({
  403. tmplIds: this.arr,
  404. success(re) {
  405. console.log(JSON.stringify(re), 111111111111)
  406. var datas = JSON.stringify(re);
  407. if (datas.indexOf("accept") != -1) {
  408. // console.log(re)
  409. }
  410. },
  411. fail: (res) => {
  412. // console.log(res)
  413. }
  414. })
  415. }
  416. // #endif
  417. let that = this
  418. console.log(e)
  419. uni.showModal({
  420. title: '提示',
  421. content: '确认取消订单吗?',
  422. success: function(res) {
  423. if (res.confirm) {
  424. console.log('用户点击确定');
  425. let data = {
  426. orderId: e.orderId
  427. }
  428. that.$Request.get("/app/order/userCancelOrder", data).then(res => {
  429. if (res.code == 0) {
  430. uni.showToast({
  431. title: '订单取消成功',
  432. icon: 'none'
  433. })
  434. that.page = 1
  435. that.getOrderList()
  436. } else {
  437. uni.showToast({
  438. title: res.msg,
  439. icon: 'none'
  440. })
  441. }
  442. });
  443. } else if (res.cancel) {
  444. console.log('用户点击取消');
  445. }
  446. }
  447. });
  448. },
  449. // 评价订单
  450. pingjia(e) {
  451. // #ifdef MP-WEIXIN
  452. if (uni.getStorageSync('sendMsg')) {
  453. console.log('授权+1')
  454. wx.requestSubscribeMessage({
  455. tmplIds: this.arr,
  456. success(re) {
  457. console.log(JSON.stringify(re), 111111111111)
  458. var datas = JSON.stringify(re);
  459. if (datas.indexOf("accept") != -1) {
  460. // console.log(re)
  461. }
  462. },
  463. fail: (res) => {
  464. // console.log(res)
  465. }
  466. })
  467. }
  468. // #endif
  469. console.log(e)
  470. let ordersId = e.orderId
  471. let orderNumber = e.orderNumber
  472. let goodsId = []
  473. if (e.orderGoodsList) {
  474. e.orderGoodsList.forEach(res => {
  475. goodsId.push(res.goodsId)
  476. })
  477. }
  478. uni.navigateTo({
  479. url: '/pages/order/feedback?ordersId=' + ordersId + '&orderNumber=' + orderNumber +
  480. '&goodsId=' + goodsId.toString() + '&shopId=' + e.shopId
  481. })
  482. },
  483. goShop(e) {
  484. // #ifdef MP-WEIXIN
  485. if (uni.getStorageSync('sendMsg')) {
  486. console.log('授权+1')
  487. wx.requestSubscribeMessage({
  488. tmplIds: this.arr,
  489. success(re) {
  490. console.log(JSON.stringify(re), 111111111111)
  491. var datas = JSON.stringify(re);
  492. if (datas.indexOf("accept") != -1) {
  493. // console.log(re)
  494. }
  495. },
  496. fail: (res) => {
  497. // console.log(res)
  498. }
  499. })
  500. }
  501. // #endif
  502. uni.navigateTo({
  503. url: '/pages/index/shop/index?shopId=' + e
  504. })
  505. },
  506. // 完成订单
  507. finish(e) {
  508. // #ifdef MP-WEIXIN
  509. if (uni.getStorageSync('sendMsg')) {
  510. console.log('授权+1')
  511. wx.requestSubscribeMessage({
  512. tmplIds: this.arr,
  513. success(re) {
  514. console.log(JSON.stringify(re), 111111111111)
  515. var datas = JSON.stringify(re);
  516. if (datas.indexOf("accept") != -1) {
  517. // console.log(re)
  518. }
  519. },
  520. fail: (res) => {
  521. // console.log(res)
  522. }
  523. })
  524. }
  525. // #endif
  526. let that = this
  527. console.log(e)
  528. uni.showModal({
  529. title: '提示',
  530. content: '确认订单完成吗?',
  531. success: function(res) {
  532. if (res.confirm) {
  533. console.log('用户点击确定');
  534. let data = {
  535. orderId: e.orderId
  536. }
  537. that.$Request.post("/app/order/accomplishOrder", data).then(res => {
  538. if (res.code == 0) {
  539. uni.showToast({
  540. title: '订单完成',
  541. icon: 'none'
  542. })
  543. that.getOrderList()
  544. } else {
  545. uni.showToast({
  546. title: res.msg,
  547. icon: 'none'
  548. })
  549. }
  550. });
  551. } else if (res.cancel) {
  552. console.log('用户点击取消');
  553. }
  554. }
  555. });
  556. },
  557. switchTab(e) {
  558. // #ifdef MP-WEIXIN
  559. if (uni.getStorageSync('sendMsg')) {
  560. console.log('授权+1')
  561. wx.requestSubscribeMessage({
  562. tmplIds: this.arr,
  563. success(re) {
  564. console.log(JSON.stringify(re), 111111111111)
  565. var datas = JSON.stringify(re);
  566. if (datas.indexOf("accept") != -1) {
  567. // console.log(re)
  568. }
  569. },
  570. fail: (res) => {
  571. // console.log(res)
  572. }
  573. })
  574. }
  575. // #endif
  576. this.page = 1
  577. this.status = ''
  578. this.orderType = e
  579. this.current = 0;
  580. this.current1 = 0;
  581. this.order = []
  582. this.orderList = []
  583. console.log(e)
  584. if (this.orderType == 3) {
  585. this.orderList_()
  586. } else {
  587. this.getOrderList()
  588. }
  589. },
  590. change(index) {
  591. // #ifdef MP-WEIXIN
  592. if (uni.getStorageSync('sendMsg')) {
  593. console.log('授权+1')
  594. wx.requestSubscribeMessage({
  595. tmplIds: this.arr,
  596. success(re) {
  597. console.log(JSON.stringify(re), 111111111111)
  598. var datas = JSON.stringify(re);
  599. if (datas.indexOf("accept") != -1) {
  600. // console.log(re)
  601. }
  602. },
  603. fail: (res) => {
  604. // console.log(res)
  605. }
  606. })
  607. }
  608. // #endif
  609. this.page = 1
  610. this.current = index;
  611. switch (index) {
  612. case 0:
  613. this.status = '' //全部
  614. break;
  615. case 1:
  616. this.status = 7 //待接单
  617. break;
  618. case 2:
  619. this.status = 6 //制作中
  620. break;
  621. case 3:
  622. this.status = 3 //待取餐
  623. break;
  624. case 4:
  625. this.status = 4 //已完成
  626. break;
  627. case 5:
  628. this.status = 5 //已取消
  629. break;
  630. }
  631. this.getOrderList()
  632. },
  633. change1(index) {
  634. // #ifdef MP-WEIXIN
  635. if (uni.getStorageSync('sendMsg')) {
  636. console.log('授权+1')
  637. wx.requestSubscribeMessage({
  638. tmplIds: this.arr,
  639. success(re) {
  640. console.log(JSON.stringify(re), 111111111111)
  641. var datas = JSON.stringify(re);
  642. if (datas.indexOf("accept") != -1) {
  643. // console.log(re)
  644. }
  645. },
  646. fail: (res) => {
  647. // console.log(res)
  648. }
  649. })
  650. }
  651. // #endif
  652. this.page = 1
  653. this.current1 = index;
  654. switch (index) {
  655. case 0:
  656. this.status = '' //全部
  657. break;
  658. case 1:
  659. this.status = 7 //待接单
  660. break;
  661. case 2:
  662. this.status = 6 //制作中
  663. break;
  664. case 3:
  665. this.status = 3 //配送中
  666. break;
  667. case 4:
  668. this.status = 4 //已完成
  669. break;
  670. case 5:
  671. this.status = 5 //已取消
  672. break;
  673. }
  674. this.getOrderList()
  675. },
  676. change2(index) {
  677. // #ifdef MP-WEIXIN
  678. if (uni.getStorageSync('sendMsg')) {
  679. console.log('授权+1')
  680. wx.requestSubscribeMessage({
  681. tmplIds: this.arr,
  682. success(re) {
  683. console.log(JSON.stringify(re), 111111111111)
  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.current2 = index;
  696. this.currentIndex = this.paotuiList[index].id
  697. this.page = 1;
  698. this.orderList_()
  699. },
  700. goNav(url) {
  701. // #ifdef MP-WEIXIN
  702. if (uni.getStorageSync('sendMsg')) {
  703. console.log('授权+1')
  704. wx.requestSubscribeMessage({
  705. tmplIds: this.arr,
  706. success(re) {
  707. console.log(JSON.stringify(re), 111111111111)
  708. var datas = JSON.stringify(re);
  709. if (datas.indexOf("accept") != -1) {
  710. // console.log(re)
  711. }
  712. },
  713. fail: (res) => {
  714. // console.log(res)
  715. }
  716. })
  717. }
  718. // #endif
  719. uni.navigateTo({
  720. url
  721. })
  722. },
  723. // 跑腿订单获取
  724. orderList_() {
  725. let data = {
  726. page: this.page,
  727. limit: this.limit,
  728. indentState: this.currentIndex
  729. }
  730. this.$Request.getT('/app/tbindent/findUserIndent', data).then(res => {
  731. // console.log(res)
  732. var that = this
  733. if (res.code === 0) {
  734. this.paotuiCount = res.data.totalCount
  735. if (that.page == 1) {
  736. that.order = res.data.list
  737. that.totalPage = res.data.totalPage
  738. }
  739. if (that.page > 1) {
  740. if (res.data.list.length > 0) {
  741. that.order = that.order.concat(res.data.list)
  742. }
  743. }
  744. }
  745. uni.stopPullDownRefresh();
  746. uni.hideLoading()
  747. });
  748. },
  749. // 外卖数据列表
  750. getOrderList() {
  751. let data = {
  752. page: this.page,
  753. limit: this.limit,
  754. status: this.status,
  755. orderType: this.orderType
  756. }
  757. this.$Request.get("/app/order/waitTakeFood", data).then(res => {
  758. if (res.code == 0) {
  759. this.waimaiCount = res.data.totalCount
  760. res.data.list.forEach(res => {
  761. res.orderGoodsList.forEach(ret => {
  762. if(ret.goodsPicture ){
  763. ret.goodsPicture = ret.goodsPicture.split(',')
  764. }
  765. })
  766. res.orderCode = res.orderCode.substring(res.orderCode.length - 3, res.orderCode
  767. .length)
  768. })
  769. if (this.page == 1) {
  770. this.orderList = res.data.list
  771. } else {
  772. this.orderList = [...this.orderList, ...res.data.list]
  773. }
  774. }
  775. uni.stopPullDownRefresh();
  776. uni.hideLoading()
  777. });
  778. },
  779. // 再来一单
  780. bindorder(e) {
  781. // #ifdef MP-WEIXIN
  782. if (uni.getStorageSync('sendMsg')) {
  783. console.log('授权+1')
  784. wx.requestSubscribeMessage({
  785. tmplIds: this.arr,
  786. success(re) {
  787. console.log(JSON.stringify(re), 111111111111)
  788. var datas = JSON.stringify(re);
  789. if (datas.indexOf("accept") != -1) {
  790. // console.log(re)
  791. }
  792. },
  793. fail: (res) => {
  794. // console.log(res)
  795. }
  796. })
  797. }
  798. // #endif
  799. console.log(e)
  800. let index = e.indentType
  801. let current = e.buyType
  802. if (e.indentType == 1 || e.indentType == 2) {
  803. uni.navigateTo({
  804. url: '/running/Helpsend/Helpsend?indentNumber=' + e.indentNumber + '&index=' + index
  805. })
  806. } else if (e.indentType == 3) {
  807. uni.navigateTo({
  808. url: '/running/Helppay/Helppay?indentNumber=' + e.indentNumber + '&index=' + index +
  809. '&current=' + current
  810. })
  811. } else {
  812. uni.navigateTo({
  813. url: '/running/Cityservice/Cityservice?indentNumber=' + e.indentNumber + '&index=' + index
  814. })
  815. }
  816. },
  817. // 订单详情
  818. bindorderDetail(indentNumber) {
  819. // #ifdef MP-WEIXIN
  820. if (uni.getStorageSync('sendMsg')) {
  821. console.log('授权+1')
  822. wx.requestSubscribeMessage({
  823. tmplIds: this.arr,
  824. success(re) {
  825. console.log(JSON.stringify(re), 111111111111)
  826. var datas = JSON.stringify(re);
  827. if (datas.indexOf("accept") != -1) {
  828. // console.log(re)
  829. }
  830. },
  831. fail: (res) => {
  832. // console.log(res)
  833. }
  834. })
  835. }
  836. // #endif
  837. console.log(indentNumber)
  838. uni.navigateTo({
  839. url: '/pages/order/detail?indentNumber=' + indentNumber
  840. })
  841. },
  842. // 立即付款
  843. bindorderpay(e) {
  844. uni.navigateTo({
  845. url: '/running/order/pay/pay?indentNumber=' + e.indentNumber
  846. })
  847. }
  848. },
  849. onReachBottom: function() {
  850. if (this.orderType == 3) {
  851. if (this.order.length < this.paotuiCount) {
  852. this.page = this.page + 1;
  853. this.orderList_()
  854. } else {
  855. uni.showToast({
  856. title: '已经到底了',
  857. icon: 'none'
  858. })
  859. }
  860. } else {
  861. if (this.orderList.length < this.waimaiCount) {
  862. this.page = this.page + 1;
  863. this.getOrderList()
  864. } else {
  865. uni.showToast({
  866. title: '已经到底了',
  867. icon: 'none'
  868. })
  869. }
  870. }
  871. },
  872. onPullDownRefresh: function() {
  873. this.page = 1
  874. this.status = ''
  875. this.current = 0;
  876. this.current1 = 0;
  877. // console.log(e)
  878. if (this.orderType == 3) {
  879. this.orderList_()
  880. } else {
  881. this.getOrderList()
  882. }
  883. },
  884. }
  885. </script>
  886. <style scoped>
  887. .active {
  888. /* width: 82rpx; */
  889. height: 16rpx;
  890. background: #FF8D1A;
  891. position: relative;
  892. top: -20rpx;
  893. z-index: 9;
  894. }
  895. .bg {
  896. background-color: #FFFFFF;
  897. }
  898. /* 切换选项 */
  899. .nav {
  900. display: flex;
  901. align-items: center;
  902. justify-content: center;
  903. background-color: #FFFFFF;
  904. color: #999999;
  905. }
  906. .btn {
  907. width: 150rpx;
  908. height: 60rpx;
  909. line-height: 60rpx;
  910. text-align: center;
  911. background: #F5F5F5;
  912. font-size: 28rpx;
  913. border: 2rpx solid ##F5F5F5;
  914. color: #666666;
  915. border-radius: 50rpx;
  916. font-weight: 700;
  917. margin-left: 10rpx;
  918. }
  919. .btn_ {
  920. width: 150rpx;
  921. height: 60rpx;
  922. line-height: 60rpx;
  923. text-align: center;
  924. background: #FCD202;
  925. font-size: 28rpx;
  926. border: 2rpx solid #FCD202;
  927. color: #333333;
  928. border-radius: 50rpx;
  929. font-weight: 700;
  930. margin-left: 10rpx;
  931. }
  932. .tabBtn {
  933. /* background-color: #f6f6fa; */
  934. height: 60rpx;
  935. line-height: 60rpx;
  936. color: #999999;
  937. font-size: 38rpx;
  938. }
  939. .title {
  940. position: relative;
  941. z-index: 100;
  942. }
  943. .shaix {
  944. width: 30%;
  945. text-align: center;
  946. display: flex;
  947. align-items: center;
  948. justify-content: center;
  949. letter-spacing: 4rpx;
  950. font-size: 27rpx;
  951. }
  952. .select {
  953. color: #000000;
  954. font-weight: bold;
  955. background-color: #fff;
  956. z-index: 10;
  957. }
  958. .nav view {
  959. flex-grow: 1;
  960. margin: 3% 6.5% 2%;
  961. text-align: center;
  962. }
  963. .nav_btna {
  964. font-size: 42rpx;
  965. line-height: 34rpx;
  966. color: #000000;
  967. font-weight: bold;
  968. border-bottom: 14rpx solid #FCD202;
  969. }
  970. /* 内容 */
  971. /* 全部订单 */
  972. .cont_one {
  973. margin-top: 160rpx;
  974. }
  975. /* .cont_one image {
  976. width: 80%;
  977. height: 353rpx;
  978. } */
  979. /* 到店取餐 */
  980. .cont_two {
  981. display: none;
  982. width: 94%;
  983. margin: 3% auto;
  984. background-color: #FFFFFF;
  985. border-radius: 18rpx;
  986. }
  987. .cont {
  988. /* display: none; */
  989. width: 94%;
  990. margin: 3% auto;
  991. background-color: #FFFFFF;
  992. border-radius: 18rpx;
  993. /* padding: 20rpx 0; */
  994. }
  995. .cont_two_top {
  996. width: 94%;
  997. padding: 4% 3% 0;
  998. margin: 0 auto;
  999. display: flex;
  1000. justify-content: space-between;
  1001. }
  1002. .cont_two_top_le {
  1003. /* width: 85%; */
  1004. font-size: 30rpx;
  1005. font-weight: 500;
  1006. color: #333333;
  1007. /* line-height: 2; */
  1008. margin: 5rpx 0;
  1009. }
  1010. .cont_two_top_ri {
  1011. /* width: 15%; */
  1012. padding: 6rpx 10rpx;
  1013. text-align: center;
  1014. background: rgba(255, 19, 10, 0.2);
  1015. font-size: 24rpx;
  1016. border: 2rpx solid #FF130A;
  1017. color: #FF130A;
  1018. opacity: 0.6;
  1019. border-radius: 8rpx;
  1020. }
  1021. .cont_two_top_ri1 {
  1022. /* width: 15%; */
  1023. text-align: center;
  1024. /* line-height: 2; */
  1025. padding: 6rpx 10rpx;
  1026. background: #62ba8b;
  1027. font-size: 24rpx;
  1028. border: 2rpx solid #62ba8b;
  1029. color: #fff;
  1030. /* opacity: 0.6; */
  1031. border-radius: 8rpx;
  1032. }
  1033. .cont_two_top_ri2 {
  1034. /* width: 15%; */
  1035. text-align: center;
  1036. /* line-height: 2; */
  1037. padding: 6rpx 10rpx;
  1038. background: #FCD202;
  1039. font-size: 24rpx;
  1040. border: 2rpx solid #FCD202;
  1041. color: #fff;
  1042. /* opacity: 0.6; */
  1043. border-radius: 8rpx;
  1044. }
  1045. .cont_two_text {
  1046. font-size: 58rpx;
  1047. text-align: center;
  1048. font-weight: bold;
  1049. color: red;
  1050. margin: 3% 0;
  1051. line-height: 32rpx;
  1052. }
  1053. .cont_two_text2 {
  1054. font-size: 30rpx;
  1055. width: 100%;
  1056. font-weight: 500;
  1057. color: #333333;
  1058. text-align: center;
  1059. padding-bottom: 3%;
  1060. /* line-height: 32rpx; */
  1061. }
  1062. .cont_two_text2 text {
  1063. color: #FF130A;
  1064. }
  1065. .cont_two_bottom {
  1066. width: 94%;
  1067. padding: 3%;
  1068. margin: 0 auto;
  1069. display: flex;
  1070. border-top: 1rpx solid #E6E6E6;
  1071. }
  1072. .cont_two_bottom_le {
  1073. flex: 1;
  1074. font-size: 24rpx;
  1075. font-weight: 500;
  1076. color: #999999;
  1077. line-height: 32rpx;
  1078. }
  1079. .cont_two_bottom_ri {
  1080. flex: 1;
  1081. text-align: right;
  1082. }
  1083. .cont_two_bottom_ri image {
  1084. width: 14rpx;
  1085. height: 24rpx;
  1086. }
  1087. /* 外卖订单 */
  1088. .cont_three {
  1089. display: none;
  1090. width: 94%;
  1091. margin: 3% auto;
  1092. background-color: #FFFFFF;
  1093. border-radius: 18rpx;
  1094. }
  1095. .cont_three_top {
  1096. width: 94%;
  1097. padding: 4% 3% 0;
  1098. margin: 0 auto;
  1099. display: flex;
  1100. }
  1101. .cont_three_top_le {
  1102. flex: 2;
  1103. font-size: 30rpx;
  1104. font-weight: 500;
  1105. color: #D80204;
  1106. line-height: 32rpx;
  1107. }
  1108. .cont_three_top_ri {
  1109. flex: 1;
  1110. text-align: right;
  1111. font-size: 24rpx;
  1112. font-weight: 500;
  1113. color: #999999;
  1114. line-height: 32rpx;
  1115. }
  1116. .cont_three_text {
  1117. padding: 2% 0 2% 3%;
  1118. font-size: 24rpx;
  1119. font-weight: 500;
  1120. color: #999999;
  1121. line-height: 32rpx;
  1122. }
  1123. .cont_three_cen {
  1124. width: 94%;
  1125. padding: 0.5% 3%;
  1126. margin: 0 auto;
  1127. display: flex;
  1128. }
  1129. .cont_three_cen_le {
  1130. flex: 2;
  1131. font-size: 30rpx;
  1132. font-weight: 500;
  1133. color: #333333;
  1134. line-height: 32rpx;
  1135. }
  1136. .cont_three_cen_ri {
  1137. flex: 1;
  1138. text-align: right;
  1139. font-size: 24rpx;
  1140. font-weight: 500;
  1141. color: #999999;
  1142. line-height: 32rpx;
  1143. }
  1144. .cont_three_text2 {
  1145. font-size: 24rpx;
  1146. font-weight: 500;
  1147. color: #D80204;
  1148. padding: 0 3%;
  1149. line-height: 32rpx;
  1150. }
  1151. .cont_three_bottom {
  1152. width: 94%;
  1153. padding: 3%;
  1154. margin: 3% auto 0;
  1155. display: flex;
  1156. border-top: 1rpx solid #E6E6E6;
  1157. }
  1158. .cont_three_bottom_le {
  1159. flex: 1;
  1160. font-size: 24rpx;
  1161. font-weight: 500;
  1162. color: #999999;
  1163. line-height: 32rpx;
  1164. }
  1165. .cont_three_bottom_ri {
  1166. flex: 1;
  1167. text-align: right;
  1168. }
  1169. .cont_dis {
  1170. display: block;
  1171. }
  1172. .box {
  1173. /* width: 100%;
  1174. height: 100vh;
  1175. background-color: rgba(0, 0, 0, 0.2);
  1176. position: absolute;
  1177. top: 40px;
  1178. z-index: 999 */
  1179. }
  1180. .popbox {
  1181. width: 749upx;
  1182. /* height: 764upx; */
  1183. background: #FFFFFF;
  1184. padding-bottom: 72rpx;
  1185. z-inde: 999;
  1186. position: fixed;
  1187. top: 39px;
  1188. left: 0;
  1189. right: 0;
  1190. }
  1191. .impute {
  1192. background: #F2F2F2;
  1193. height: 80rpx;
  1194. margin: 20rpx 0;
  1195. }
  1196. .btns {
  1197. width: 690upx;
  1198. height: 88upx;
  1199. background: #FFCC00;
  1200. box-shadow: 0upx 10upx 20upx 0upx #FFD9B3;
  1201. border-radius: 16upx;
  1202. text-align: center;
  1203. line-height: 88rpx;
  1204. font-size: 32rpx;
  1205. font-weight: bold;
  1206. margin: 0 auto;
  1207. }
  1208. .empty {
  1209. width: 100%;
  1210. background: #ffffff;
  1211. /* #ifdef MP-WEIXIN */
  1212. height: 93vh;
  1213. /* #endif */
  1214. /* #ifndef MP-WEIXIN */
  1215. height: 80vh;
  1216. /* #endif */
  1217. }
  1218. .tabs_box {
  1219. display: none;
  1220. }
  1221. .dis {
  1222. display: block;
  1223. width: 100%;
  1224. }
  1225. .u-tab-item {
  1226. font-size: 30rpx !important;
  1227. /* color: #666666 !important; */
  1228. }
  1229. .success_box {
  1230. width: 100%;
  1231. }
  1232. .order_box {
  1233. width: 95%;
  1234. margin: 0 auto;
  1235. /* height: 420rpx; */
  1236. background: #FFFFFF;
  1237. margin-top: 20rpx;
  1238. border-radius: 10px;
  1239. /* padding: 20rpx 0rpx; */
  1240. }
  1241. .order_success {
  1242. width: 90%;
  1243. margin: 0 auto;
  1244. display: flex;
  1245. height: 80upx;
  1246. }
  1247. .order_name {
  1248. flex: 1;
  1249. display: flex;
  1250. justify-content: left;
  1251. align-items: center;
  1252. font-weight: bold;
  1253. font-size: 31rpx;
  1254. letter-spacing: 1upx;
  1255. }
  1256. .order_data {
  1257. flex: 1;
  1258. color: #999999;
  1259. display: flex;
  1260. justify-content: flex-end;
  1261. align-items: center;
  1262. font-size: 27rpx;
  1263. }
  1264. .city_type {
  1265. width: 90%;
  1266. margin: 0 auto;
  1267. height: 60upx;
  1268. line-height: 60upx;
  1269. display: flex;
  1270. justify-content: left;
  1271. align-items: center;
  1272. }
  1273. .type_name {
  1274. font-size: 27rpx;
  1275. }
  1276. .city_text {
  1277. line-height: 36rpx;
  1278. color: #49A5FF;
  1279. background: #c4e2ff;
  1280. text-align: center;
  1281. font-size: 25rpx;
  1282. margin-left: 20rpx;
  1283. padding: 2rpx 10rpx;
  1284. }
  1285. .city_address {
  1286. width: 90%;
  1287. margin: 0 auto;
  1288. /* margin-top: -10rpx; */
  1289. }
  1290. /* 发货地址 */
  1291. .fh_box {
  1292. display: flex;
  1293. /* height: 80upx; */
  1294. margin-top: 25rpx;
  1295. }
  1296. .fh_image {
  1297. /* flex: 1; */
  1298. width: 10%;
  1299. }
  1300. .box {
  1301. /* flex: 11; */
  1302. width: 85%;
  1303. overflow: hidden;
  1304. }
  1305. .fh_name {
  1306. font-size: 31rpx;
  1307. font-weight: 600;
  1308. letter-spacing: 2upx;
  1309. }
  1310. .fh_type {
  1311. color: #999999;
  1312. font-size: 28rpx;
  1313. margin-top: 10rpx;
  1314. }
  1315. .fh_type text {
  1316. margin-left: 20upx;
  1317. }
  1318. /* 送货地址 */
  1319. .sh_box {
  1320. display: flex;
  1321. margin-bottom: 14upx;
  1322. margin-top: 25rpx;
  1323. }
  1324. .sh_image {
  1325. /* flex: 1; */
  1326. width: 10%;
  1327. }
  1328. .sh_name {
  1329. font-size: 31rpx;
  1330. font-weight: 600;
  1331. letter-spacing: 2upx;
  1332. }
  1333. .sh_type {
  1334. color: #999999;
  1335. font-size: 28rpx;
  1336. margin-top: 10rpx;
  1337. }
  1338. .sh_type text {
  1339. margin-left: 20upx;
  1340. }
  1341. .fh_image image {
  1342. width: 45upx;
  1343. height: 45upx;
  1344. }
  1345. .sh_image image {
  1346. width: 45upx;
  1347. height: 45upx;
  1348. }
  1349. .order_btn {
  1350. display: flex;
  1351. justify-content: flex-end;
  1352. align-items: center;
  1353. height: 80upx;
  1354. margin-top: 8upx;
  1355. padding: 0 20rpx;
  1356. }
  1357. .btn1 {
  1358. width: 170upx;
  1359. font-size: 26rpx;
  1360. line-height: 60upx;
  1361. text-align: center;
  1362. border: 3upx solid #9C9C9C;
  1363. border-radius: 20upx;
  1364. color: #9C9C9C;
  1365. margin-right: 30upx;
  1366. }
  1367. .btn2 {
  1368. width: 170upx;
  1369. line-height: 60upx;
  1370. color: white;
  1371. background: #FF6A04;
  1372. font-size: 27rpx;
  1373. text-align: center;
  1374. margin-right: 30upx;
  1375. border-radius: 20upx;
  1376. }
  1377. .btn3 {
  1378. width: 120upx;
  1379. font-size: 26rpx;
  1380. line-height: 60upx;
  1381. text-align: center;
  1382. border: 2upx solid #FF130A;
  1383. border-radius: 10upx;
  1384. color: #FF130A;
  1385. margin-right: 30upx;
  1386. background: rgba(255, 19, 10, 0.2);
  1387. opacity: 0.6;
  1388. }
  1389. </style>