myOrder.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <view class="box">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">订单管理</view>
  12. <view style="width: 50px;"></view>
  13. </view>
  14. </view>
  15. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  16. <view style="height: 44px;"></view>
  17. <!-- 搜索框 -->
  18. <view class="newtop">
  19. <view class="searchBox">
  20. <view class="searchInputBox">
  21. <image src="../../static/img/icon_search.png" mode="" class="iconSimg"></image>
  22. <input type="text" v-model="name" placeholder="订单号、手机号、联系人" class="searchInput" @confirm="searchCf">
  23. <image @click="ssql" src="../../static/img/chahao.png" mode="" class="sschahao"></image>
  24. </view>
  25. <image @click="screenSHowBtn" src="../../static/img/icon_shai.png" mode="" class="iconShai"></image>
  26. </view>
  27. <view class="tab">
  28. <view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">全部</view>
  29. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  30. <view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">待成团</view>
  31. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>
  32. <view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
  33. </view>
  34. </view>
  35. <view class="main">
  36. <view class="itemBg" v-for="(item,index) in items" @click="goDetail(item)">
  37. <view class="itemTop">
  38. <view class="itemType" v-if="item.SheetType==1">商城-商品订单</view>
  39. <view class="itemType" v-if="item.SheetType==2">商城-项目订单</view>
  40. <view class="itemType" v-if="item.SheetType==3">商城-套餐订单</view>
  41. <view class="itemType" v-if="item.SheetType==4">救援订单</view>
  42. <view class="itemType" v-if="item.SheetType==5">钣喷订单</view>
  43. <view class="itemType" v-if="item.SheetType==6">集客订单</view>
  44. <view class="itemSheetState redColor" v-if="item.SheetState==1">待付款</view>
  45. <view class="itemSheetState orangeColor" v-if="item.SheetState==2">待服务</view>
  46. <view class="itemSheetState greenColor" v-if="item.SheetState==3">已完成</view>
  47. <view class="itemSheetState" v-if="item.SheetState==4">已取消</view>
  48. <view class="itemSheetState redColor" v-if="item.SheetState==5">待成团</view>
  49. </view>
  50. <view class="itemShopBg">
  51. <view class="shopName">{{item.SheetContent}}</view>
  52. <view style="color: #333333;font-size: 22rpx;">¥<span class="price">{{item.RealMoney}}</span></view>
  53. </view>
  54. <view class="renBox" v-if="item.SheetType==6">
  55. <image src="../../static/img/icon_ren2.png" mode="" class="renimg"></image>
  56. <view class="renMobilePhone">{{item.MobilePhone}}</view>
  57. <view class="renNickName">{{item.NickName?item.NickName:''}}</view>
  58. </view>
  59. <view class="itemName">{{item.CreateTime}}</view>
  60. <view class="itemName" style="padding-top: 2rpx;padding-bottom: 0;">{{item.ShopName}}</view>
  61. </view>
  62. <nodata v-show="items==''&&isload"></nodata>
  63. </view>
  64. <!-- 筛选弹框 -->
  65. <view class="screenBox" v-if="screenSHow" @click="screenHide">
  66. <view class="screenCont" @click.stop="">
  67. <view class="screenTitle">筛选</view>
  68. <view class="screenBt">订单类型</view>
  69. <!-- <view class="typelineBox">
  70. <view class="typeLine " :class="{typeactive:typeLineIndex==0}" @click="typeLineCk(0)">全部</view>
  71. <view class="typeLine" :class="{typeactive:typeLineIndex==1}" @click="typeLineCk(1)">商城订单</view>
  72. <view class="typeLine" :class="{typeactive:typeLineIndex==6}" @click="typeLineCk(6)">集客订单</view>
  73. <view class="typeLine" :class="{typeactive:typeLineIndex==4}" @click="typeLineCk(4)">救援订单</view>
  74. <view class="typeLine":class="{typeactive:typeLineIndex==5}" @click="typeLineCk(5)">钣喷订单</view>
  75. </view> -->
  76. <view class="typelineBox">
  77. <view class="typeLine " v-for="(item,index) in tabList"
  78. :class="{typeactive:item.ck}" @click="typeLineCk2(item)">{{item.name}}
  79. </view>
  80. </view>
  81. <view class="screenBt">门店</view>
  82. <view class="">
  83. <picker @change="bindPickerChange" :value="pickerindex" :range-key="'shopName'" :range="pickerarray">
  84. <view class="uniPicker">
  85. <view class="uniPickerName">
  86. {{shopName}}
  87. </view>
  88. <image src="../../static/img/jt.png" mode=" " class="jtShopImg"></image>
  89. </view>
  90. </picker>
  91. </view>
  92. <view class="screenBt">下单时间</view>
  93. <view class="sdTimeBox">
  94. <picker mode="date" :value="date1" @change="bindDateChange1">
  95. <view class="dateinput">{{date1?date1:'选择日期'}}</view>
  96. </picker>
  97. <view class="timeHx">-</view>
  98. <picker mode="date" :value="date2" @change="bindDateChange2">
  99. <view class="dateinput">{{date2?date2:'选择日期'}}</view>
  100. </picker>
  101. </view>
  102. <view class="screenBottom">
  103. <view class="screenCz" @click="resetting">重置</view>
  104. <view class="screenY" @click="sub">确定</view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import nodata from '@/components/nodata/nodata.vue'
  112. export default {
  113. components: {
  114. nodata
  115. },
  116. data() {
  117. return {
  118. page: 1,
  119. tabIndex: 0,
  120. items: [],
  121. isload: false,
  122. name:'',
  123. pickerindex:0,
  124. pickerarray: [],
  125. screenSHow:false,
  126. shopName:'',
  127. date1:'',
  128. date2:'',
  129. typeLineIndex:0,
  130. sheetTypeList:'',
  131. shopId:'',
  132. mrshopId:'',
  133. mrshopName:'',
  134. tabList:[
  135. {
  136. name:'全部',ck:true,sheetType:'',
  137. },
  138. {
  139. name:'商城订单',ck:false,sheetType:'1,2,3',
  140. },
  141. {
  142. name:'集客订单',ck:false,sheetType:'6',
  143. },
  144. {
  145. name:'救援订单',ck:false,sheetType:'4',
  146. },
  147. {
  148. name:'钣喷订单',ck:false,sheetType:'5',
  149. }
  150. ]
  151. }
  152. },
  153. onLoad(opt) {
  154. this.getData();
  155. this.getShopinfo();
  156. },
  157. onShow() {
  158. console.log(this.tabIndex)
  159. this.getData();
  160. },
  161. methods: {
  162. ssql(){
  163. this.name='';
  164. this.getData();
  165. },
  166. sub(){
  167. this.screenSHow=false;
  168. var arr=[]
  169. this.tabList.forEach(item=>{
  170. if(item.ck){
  171. arr.push(item.sheetType)
  172. }
  173. })
  174. this.sheetTypeList=arr.join(',');
  175. console.log(this.sheetTypeList)
  176. this.getData();
  177. },
  178. resetting(){
  179. this.date1='';
  180. this.date2='';
  181. this.typeLineIndex='';
  182. this.shopName=this.mrshopName;
  183. this.shopId=this.mrshopId;
  184. this.sheetTypeList=''
  185. this.tabList[0].ck=true
  186. this.tabList[1].ck=false
  187. this.tabList[2].ck=false
  188. this.tabList[3].ck=false
  189. this.tabList[4].ck=false
  190. },
  191. typeLineCk(num){
  192. this.typeLineIndex=num;
  193. if(num==1){
  194. this.sheetTypeList='1,2,3'
  195. }else{
  196. this.sheetTypeList=num
  197. }
  198. if(num==0){
  199. this.sheetTypeList=''
  200. }
  201. },
  202. typeLineCk2(item){
  203. if(item.name=='全部'){
  204. item.ck=true;
  205. this.tabList[1].ck=false
  206. this.tabList[2].ck=false
  207. this.tabList[3].ck=false
  208. this.tabList[4].ck=false
  209. }else{
  210. this.tabList[0].ck=false
  211. item.ck=!item.ck;
  212. }
  213. },
  214. screenSHowBtn(){
  215. this.screenSHow=true;
  216. },
  217. screenHide(){
  218. this.screenSHow=false;
  219. },
  220. bindDateChange1(e){
  221. console.log(e)
  222. this.date1=e.detail.value
  223. },
  224. bindDateChange2(e){
  225. this.date2=e.detail.value
  226. },
  227. bindPickerChange(e){
  228. console.log(e)
  229. this.shopName=this.pickerarray[e.detail.value].shopName
  230. this.shopId=this.pickerarray[e.detail.value].id
  231. },
  232. getShopinfo(){
  233. this.$http('openH5SetTheGuest/getShopInfo',{},'GET').then(res => {
  234. this.shopName=res.data.shopName;
  235. this.mrshopId=this.shopId;
  236. this.mrshopName=res.data.shopName;
  237. this.shopId=this.shopId
  238. this.getShopList();
  239. })
  240. },
  241. getShopList(){
  242. this.$http('openH5SetTheGuest/getShopList', {
  243. },'GET').then(res => {
  244. this.pickerarray=res.data;
  245. /* this.pickerarray.forEach((item,index)=>{
  246. if(this.mrshopId==item.id){
  247. this.pickerindex=index;
  248. }
  249. }) */
  250. //console.log(this.pickerarray[this.pickerindex])
  251. })
  252. },
  253. goback(){
  254. //app交互
  255. var standalone = window.navigator.standalone
  256. var userAgent = window.navigator.userAgent.toLowerCase()
  257. var safari = /safari/.test(userAgent)
  258. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  259. var android = /android/.test(userAgent)
  260. if (ios) {
  261. if ( true) {//!standalone&& !safari
  262. window.webkit.messageHandlers.goMyNav.postMessage(null)
  263. }
  264. } else if (android) {
  265. window.android.postMessage()
  266. }
  267. },
  268. tabClick(num) {
  269. this.tabIndex = num;
  270. this.page = 1;
  271. this.getData()
  272. },
  273. goDetail(item) {
  274. //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  275. if((item.SheetType==1)||(item.SheetType==2)||(item.SheetType==3)){
  276. uni.navigateTo({
  277. url: "mallOrderDetail?id=" + item.ID +"&SheetType=" + item.SheetType
  278. })
  279. }
  280. else if (item.SheetType==5){
  281. uni.navigateTo({
  282. url: "paintOrderDetail?id=" + item.ID
  283. })
  284. }
  285. else if (item.SheetType==6){
  286. uni.navigateTo({
  287. url: "activityOrderDetail?id=" + item.ID
  288. })
  289. }
  290. },
  291. searchCf(){
  292. this.getData()
  293. },
  294. getData() {
  295. uni.showLoading({
  296. title: '加载中'
  297. });
  298. this.isload = false;
  299. var padata = {
  300. page: this.page,
  301. limit: 10,
  302. sheetState: this.tabIndex > 0 ? this.tabIndex : '',
  303. name:this.name,
  304. starCreateTime:this.date1+ ' 00:00:00',
  305. endCreateTime:this.date2+ ' 23:59:59',
  306. sheetType:this.sheetTypeList,
  307. shopName:this.shopId,
  308. }
  309. this.$http('openH5Indent/getOpenSheetList', padata, 'GET').then(res => {
  310. uni.hideLoading();
  311. this.isload = true;
  312. var list = res.data.Items;
  313. if (this.page == 1) {
  314. this.items = list
  315. } else {
  316. this.items = this.items.concat(list)
  317. }
  318. })
  319. },
  320. },
  321. onReachBottom() {
  322. this.page++;
  323. this.getData()
  324. },
  325. onPullDownRefresh() {
  326. this.page = 1;
  327. this.getData()
  328. setTimeout(function() {
  329. uni.stopPullDownRefresh();
  330. }, 1000);
  331. }
  332. }
  333. </script>
  334. <style scoped>
  335. .screenBox{
  336. width: 100%;
  337. height: 100%;
  338. position: fixed;
  339. left: 0;
  340. top: 0;
  341. background: rgba(0 ,0,0,0.5);
  342. z-index: 999;
  343. }
  344. .screenBottom{
  345. width: 649rpx;
  346. height: 120rpx;
  347. background: #FFFFFF;
  348. box-shadow: 0rpx -2rpx 10rpx 0rpx rgba(153,153,153,0.2);
  349. position: absolute;
  350. bottom: 0;
  351. right: 0;
  352. display: flex;
  353. justify-content: space-around;
  354. }
  355. .screenCz{
  356. width: 291rpx;text-align: center;margin-top: 22rpx;
  357. height: 74rpx;line-height: 74rpx;
  358. background: #F4F5F7;color: #000000;
  359. border-radius: 37rpx;font-size: 28rpx;
  360. }
  361. .screenY{
  362. width: 291rpx;text-align: center;margin-top: 22rpx;
  363. height: 74rpx;line-height: 74rpx;
  364. background: #D53533;color: #FFFFFF;
  365. border-radius: 37rpx;font-size: 28rpx;
  366. }
  367. .screenCont{
  368. width: 650rpx;
  369. height: 100%;
  370. background: #FFFFFF;
  371. margin-left: 100rpx;
  372. }
  373. .screenTitle{
  374. font-weight: 400;font-size: 24rpx;padding-top: 70rpx;padding-left: 20rpx;
  375. color: #333333;
  376. }
  377. .screenBt{
  378. font-weight: 400;font-size: 24rpx;
  379. color: #333333;padding-left: 20rpx;padding-top: 30rpx;
  380. }
  381. .iconShai{
  382. width: 36rpx;height: 39rpx;margin-top: 17rpx;
  383. margin-left: 30rpx;
  384. }
  385. .iconSimg{
  386. width: 40rpx;height: 40rpx;margin-top: 16rpx;margin-left: 20rpx;
  387. }
  388. .searchBox{
  389. display: flex;background: #FFFFFF;padding: 24rpx;
  390. left: 0;
  391. }
  392. .typeLine{
  393. width: 178rpx;color: #3C3C3C;
  394. height: 64rpx;font-size: 24rpx;
  395. background: #F4F5F7;margin-top: 20rpx;
  396. border-radius: 36rpx;margin-right: 30rpx;
  397. text-align: center;
  398. line-height: 64rpx;
  399. }
  400. .typeactive{
  401. border: 2rpx solid #D53533;height: 60rpx;color: #D53533;background: #FFFFFF;width: 174rpx;
  402. }
  403. .typelineBox{
  404. display: flex;flex-wrap: wrap;padding-left: 20rpx;
  405. }
  406. .uniPicker{
  407. width: 606rpx;
  408. height: 64rpx;
  409. background: #F4F5F7;font-size: 24rpx;
  410. border-radius: 36rpx;color: #3C3C3C;
  411. display: flex;justify-content: space-between;
  412. margin-top: 20rpx;margin-left: 20rpx;
  413. }
  414. .jtShopImg{
  415. width: 24rpx;height: 24rpx;margin-top: 20rpx;margin-right: 26rpx;
  416. }
  417. .uniPickerName{
  418. padding-left: 20rpx;line-height: 64rpx;
  419. overflow:hidden;
  420. white-space: nowrap;
  421. text-overflow: ellipsis;
  422. -o-text-overflow:ellipsis;
  423. width: 500rpx;
  424. }
  425. .dateinput{
  426. width: 270rpx;color: #999999;
  427. height: 64rpx;font-size: 24rpx;line-height: 64rpx;
  428. background: #F4F5F7;padding-left: 20rpx;
  429. border-radius: 36rpx;
  430. }
  431. .sdTimeBox{
  432. display: flex;
  433. padding-top: 20rpx;padding-left: 20rpx;
  434. }
  435. .timeHx{
  436. font-weight: 400;line-height: 64rpx;padding: 0 4rpx;
  437. color: #DDDDDD;font-size: 24rpx;
  438. }
  439. .newtop{
  440. position: fixed;z-index: 11;
  441. }
  442. .searchInputBox{
  443. width: 630rpx;
  444. height: 72rpx;
  445. background: #F4F5F7;
  446. border-radius: 36rpx;
  447. display: flex;
  448. }
  449. .searchInput{
  450. font-size: 28rpx;padding-left: 16rpx;height: 72rpx;line-height: 72rpx;
  451. width: 500rpx;
  452. }
  453. .box {
  454. min-height: 100vh;
  455. background: #F4F5F7;
  456. }
  457. .zdyNavBox {
  458. width: 100vw;
  459. background: #FFFFFF;
  460. position: fixed;
  461. top: 0;
  462. left: 0;
  463. z-index: 99;
  464. }
  465. .zdyNav {
  466. height: 44px;
  467. display: flex;
  468. justify-content: space-between;
  469. align-items: center;
  470. }
  471. .backImg {
  472. width: 44rpx;
  473. height: 44rpx;
  474. margin-left: 10rpx;
  475. margin-right: 20rpx;
  476. }
  477. .homeImg {
  478. width: 44rpx;
  479. height: 44rpx;
  480. }
  481. .zdyNavLeft {
  482. display: flex;
  483. align-items: center;
  484. }
  485. .zdyNavTitle {
  486. height: 44px;
  487. background: #FFFFFF;
  488. text-align: center;
  489. font-size: 34rpx;
  490. line-height: 44px;
  491. }
  492. .tab {
  493. background: #FFFFFF;
  494. display: flex;
  495. justify-content: space-between;
  496. line-height: 92rpx;
  497. /* position: fixed; */
  498. width: calc(100vw - 100rpx);
  499. padding-left: 50rpx;
  500. padding-right: 50rpx;
  501. height: 92rpx;
  502. z-index: 11;
  503. }
  504. .tabLine {
  505. font-size: 28rpx;
  506. color: #333333;
  507. text-align: center;
  508. }
  509. .tabActive {
  510. color: #FF0000;
  511. font-weight: bold;
  512. border-bottom: 4rpx solid #FF0000;
  513. }
  514. .main {
  515. padding-top: 210rpx;
  516. padding-bottom: 20rpx;
  517. background-color: #F4F5F7;
  518. }
  519. .itemBg {
  520. margin: 20rpx 24rpx;
  521. background-color: #FFFFFF;
  522. border-radius: 10rpx;
  523. padding: 20rpx;
  524. }
  525. .itemTop {
  526. display: flex;
  527. justify-content: space-between;
  528. }
  529. .itemType {
  530. color: #999999;
  531. font-size: 24rpx;
  532. }
  533. .itemSheetState {
  534. font-size: 24rpx;
  535. color: #999999
  536. }
  537. .redColor {
  538. color: #FF0000;
  539. }
  540. .orangeColor {
  541. color: #F19D01;
  542. }
  543. .greenColor {
  544. color: #00A040;
  545. }
  546. .itemShopBg {
  547. display: flex;
  548. justify-content: space-between;
  549. margin-top: 20rpx;
  550. }
  551. .shopName {
  552. color: #333333;
  553. font-size: 30rpx;
  554. font-weight: bold;
  555. /* 隐藏文字显示 ...不换行 */
  556. overflow: hidden;
  557. text-overflow: ellipsis;
  558. white-space: nowrap;
  559. }
  560. .price {
  561. color: #333333;
  562. font-weight: bold;
  563. font-size: 32rpx;
  564. }
  565. .itemName {
  566. color: #666666;
  567. font-size: 24rpx;
  568. padding: 16rpx 0;
  569. height: 30rpx;
  570. overflow: hidden;
  571. text-overflow: ellipsis;
  572. white-space: nowrap;
  573. }
  574. .plateBg {
  575. display: flex;
  576. justify-content: space-between;
  577. align-items: center;
  578. }
  579. .plateNumber {
  580. color: #666666;
  581. font-size: 24rpx;
  582. margin-bottom: 20rpx;
  583. display: flex;
  584. }
  585. .itemLineBottom {
  586. display: flex;
  587. justify-content: flex-end;
  588. }
  589. .itemBtn1 {
  590. width: 150rpx;
  591. height: 56rpx;
  592. border-radius: 36rpx;
  593. border: 2rpx solid #DDDDDD;
  594. text-align: center;
  595. line-height: 56rpx;
  596. font-size: 28rpx;
  597. color: #3C3C3C;
  598. margin-left: 40rpx;
  599. }
  600. .itemBtn2 {
  601. width: 150rpx;
  602. height: 56rpx;
  603. border-radius: 36rpx;
  604. border: 2rpx solid #FF4F00;
  605. text-align: center;
  606. line-height: 56rpx;
  607. font-size: 28rpx;
  608. color: #FF4F00;
  609. margin-left: 40rpx;
  610. }
  611. .orderState {
  612. color: #F19D01;
  613. font-size: 24rpx;
  614. padding-left: 20rpx;
  615. }
  616. .renBox{
  617. color: #1A1A1A;
  618. background: #F7F7F7;
  619. border-radius: 10rpx;
  620. display: flex;
  621. padding: 20rpx;font-size: 24rpx;
  622. line-height: 30rpx;
  623. margin-top: 16rpx;
  624. }
  625. .renimg{
  626. width: 30rpx;height: 30rpx;
  627. }
  628. .renMobilePhone{
  629. padding-left: 13rpx;
  630. }
  631. .renNickName{
  632. padding-left: 20rpx;
  633. }
  634. .sschahao{
  635. width: 40rpx;
  636. height: 40rpx;
  637. padding-top: 16rpx;
  638. }
  639. </style>