myOrder.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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 v-if="name" @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.getShopinfo();
  160. //this.getData();
  161. },
  162. methods: {
  163. ssql(){
  164. this.name='';
  165. this.getData();
  166. },
  167. sub(){
  168. this.screenSHow=false;
  169. var arr=[]
  170. this.items=[]
  171. this.tabList.forEach(item=>{
  172. if(item.ck){
  173. arr.push(item.sheetType)
  174. }
  175. })
  176. this.sheetTypeList=arr.join(',');
  177. console.log(this.sheetTypeList)
  178. this.getData();
  179. },
  180. resetting(){
  181. this.date1='';
  182. this.date2='';
  183. this.typeLineIndex='';
  184. this.shopName=this.mrshopName;
  185. this.shopId=this.mrshopId;
  186. this.sheetTypeList=''
  187. this.tabList[0].ck=true
  188. this.tabList[1].ck=false
  189. this.tabList[2].ck=false
  190. this.tabList[3].ck=false
  191. this.tabList[4].ck=false
  192. },
  193. typeLineCk(num){
  194. this.typeLineIndex=num;
  195. if(num==1){
  196. this.sheetTypeList='1,2,3'
  197. }else{
  198. this.sheetTypeList=num
  199. }
  200. if(num==0){
  201. this.sheetTypeList=''
  202. }
  203. },
  204. typeLineCk2(item){
  205. if(item.name=='全部'){
  206. item.ck=true;
  207. this.tabList[1].ck=false
  208. this.tabList[2].ck=false
  209. this.tabList[3].ck=false
  210. this.tabList[4].ck=false
  211. }else{
  212. this.tabList[0].ck=false
  213. item.ck=!item.ck;
  214. }
  215. },
  216. screenSHowBtn(){
  217. this.screenSHow=true;
  218. },
  219. screenHide(){
  220. this.screenSHow=false;
  221. },
  222. bindDateChange1(e){
  223. console.log(e)
  224. this.date1=e.detail.value
  225. },
  226. bindDateChange2(e){
  227. this.date2=e.detail.value
  228. },
  229. bindPickerChange(e){
  230. console.log(e)
  231. this.shopName=this.pickerarray[e.detail.value].shopName
  232. this.shopId=this.pickerarray[e.detail.value].id
  233. },
  234. getShopinfo(){
  235. this.$http('openH5SetTheGuest/getShopInfo',{},'GET').then(res => {
  236. this.shopName=res.data.shopName;
  237. this.mrshopId=res.data.id;
  238. this.mrshopName=res.data.shopName;
  239. this.shopId=this.mrshopId
  240. this.getShopList();
  241. this.getData()
  242. })
  243. },
  244. getShopList(){
  245. this.$http('openH5SetTheGuest/getShopList', {
  246. },'GET').then(res => {
  247. this.pickerarray=res.data;
  248. /* this.pickerarray.forEach((item,index)=>{
  249. if(this.mrshopId==item.id){
  250. this.pickerindex=index;
  251. }
  252. }) */
  253. //console.log(this.pickerarray[this.pickerindex])
  254. })
  255. },
  256. goback(){
  257. //app交互
  258. var standalone = window.navigator.standalone
  259. var userAgent = window.navigator.userAgent.toLowerCase()
  260. var safari = /safari/.test(userAgent)
  261. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  262. var android = /android/.test(userAgent)
  263. if (ios) {
  264. if ( true) {//!standalone&& !safari
  265. window.webkit.messageHandlers.goMyNav.postMessage(null)
  266. }
  267. } else if (android) {
  268. window.android.postMessage()
  269. }
  270. },
  271. tabClick(num) {
  272. this.tabIndex = num;
  273. this.page = 1;
  274. this.getData()
  275. },
  276. goDetail(item) {
  277. //SheetType 1 商品2项目3套餐4救援5钣喷6集客
  278. if((item.SheetType==1)||(item.SheetType==2)||(item.SheetType==3)){
  279. uni.navigateTo({
  280. url: "mallOrderDetail?id=" + item.ID +"&SheetType=" + item.SheetType+'&back=1'
  281. })
  282. }
  283. else if (item.SheetType==5){
  284. uni.navigateTo({
  285. url: "paintOrderDetail?id=" + item.ID+'&back=1'
  286. })
  287. }
  288. else if (item.SheetType==6){
  289. uni.navigateTo({
  290. url: "activityOrderDetail?id=" + item.ID+'&back=1'
  291. })
  292. }
  293. },
  294. searchCf(){
  295. this.items=[]
  296. this.getData()
  297. },
  298. getData() {
  299. uni.showLoading({
  300. title: '加载中'
  301. });
  302. this.isload = false;
  303. var padata = {
  304. page: this.page,
  305. limit: 10,
  306. sheetState: this.tabIndex > 0 ? this.tabIndex : '',
  307. name:this.name,
  308. starCreateTime:this.date1+ ' 00:00:00',
  309. endCreateTime:this.date2+ ' 23:59:59',
  310. sheetType:this.sheetTypeList,
  311. shopName:this.shopId,
  312. }
  313. this.$http('openH5Indent/getOpenSheetList', padata, 'GET').then(res => {
  314. uni.hideLoading();
  315. this.isload = true;
  316. var list = res.data.Items;
  317. if (this.page == 1) {
  318. this.items = list
  319. } else {
  320. this.items = this.items.concat(list)
  321. }
  322. })
  323. },
  324. },
  325. onReachBottom() {
  326. this.page++;
  327. this.getData()
  328. },
  329. onPullDownRefresh() {
  330. this.page = 1;
  331. this.getData()
  332. setTimeout(function() {
  333. uni.stopPullDownRefresh();
  334. }, 1000);
  335. }
  336. }
  337. </script>
  338. <style scoped>
  339. .screenBox{
  340. width: 100%;
  341. height: 100%;
  342. position: fixed;
  343. left: 0;
  344. top: 0;
  345. background: rgba(0 ,0,0,0.5);
  346. z-index: 999;
  347. }
  348. .screenBottom{
  349. width: 649rpx;
  350. height: 120rpx;
  351. background: #FFFFFF;
  352. box-shadow: 0rpx -2rpx 10rpx 0rpx rgba(153,153,153,0.2);
  353. position: absolute;
  354. bottom: 0;
  355. right: 0;
  356. display: flex;
  357. justify-content: space-around;
  358. }
  359. .screenCz{
  360. width: 291rpx;text-align: center;margin-top: 22rpx;
  361. height: 74rpx;line-height: 74rpx;
  362. background: #F4F5F7;color: #000000;
  363. border-radius: 37rpx;font-size: 28rpx;
  364. }
  365. .screenY{
  366. width: 291rpx;text-align: center;margin-top: 22rpx;
  367. height: 74rpx;line-height: 74rpx;
  368. background: #D53533;color: #FFFFFF;
  369. border-radius: 37rpx;font-size: 28rpx;
  370. }
  371. .screenCont{
  372. width: 650rpx;
  373. height: 100%;
  374. background: #FFFFFF;
  375. margin-left: 100rpx;
  376. }
  377. .screenTitle{
  378. font-weight: 400;font-size: 24rpx;padding-top: 70rpx;padding-left: 20rpx;
  379. color: #333333;
  380. }
  381. .screenBt{
  382. font-weight: 400;font-size: 24rpx;
  383. color: #333333;padding-left: 20rpx;padding-top: 30rpx;
  384. }
  385. .iconShai{
  386. width: 36rpx;height: 39rpx;margin-top: 17rpx;
  387. margin-left: 30rpx;
  388. }
  389. .iconSimg{
  390. width: 40rpx;height: 40rpx;margin-top: 16rpx;margin-left: 20rpx;
  391. }
  392. .searchBox{
  393. display: flex;background: #FFFFFF;padding: 24rpx;
  394. left: 0;
  395. }
  396. .typeLine{
  397. width: 178rpx;color: #3C3C3C;
  398. height: 64rpx;font-size: 24rpx;
  399. background: #F4F5F7;margin-top: 20rpx;
  400. border-radius: 36rpx;margin-right: 30rpx;
  401. text-align: center;
  402. line-height: 64rpx;
  403. }
  404. .typeactive{
  405. border: 2rpx solid #D53533;height: 60rpx;color: #D53533;background: #FFFFFF;width: 174rpx;
  406. }
  407. .typelineBox{
  408. display: flex;flex-wrap: wrap;padding-left: 20rpx;
  409. }
  410. .uniPicker{
  411. width: 606rpx;
  412. height: 64rpx;
  413. background: #F4F5F7;font-size: 24rpx;
  414. border-radius: 36rpx;color: #3C3C3C;
  415. display: flex;justify-content: space-between;
  416. margin-top: 20rpx;margin-left: 20rpx;
  417. }
  418. .jtShopImg{
  419. width: 24rpx;height: 24rpx;margin-top: 20rpx;margin-right: 26rpx;
  420. }
  421. .uniPickerName{
  422. padding-left: 20rpx;line-height: 64rpx;
  423. overflow:hidden;
  424. white-space: nowrap;
  425. text-overflow: ellipsis;
  426. -o-text-overflow:ellipsis;
  427. width: 500rpx;
  428. }
  429. .dateinput{
  430. width: 270rpx;color: #999999;
  431. height: 64rpx;font-size: 24rpx;line-height: 64rpx;
  432. background: #F4F5F7;padding-left: 20rpx;
  433. border-radius: 36rpx;
  434. }
  435. .sdTimeBox{
  436. display: flex;
  437. padding-top: 20rpx;padding-left: 20rpx;
  438. }
  439. .timeHx{
  440. font-weight: 400;line-height: 64rpx;padding: 0 4rpx;
  441. color: #DDDDDD;font-size: 24rpx;
  442. }
  443. .newtop{
  444. position: fixed;z-index: 11;
  445. }
  446. .searchInputBox{
  447. width: 630rpx;
  448. height: 72rpx;
  449. background: #F4F5F7;
  450. border-radius: 36rpx;
  451. display: flex;
  452. }
  453. .searchInput{
  454. font-size: 28rpx;padding-left: 16rpx;height: 72rpx;line-height: 72rpx;
  455. width: 500rpx;
  456. }
  457. .box {
  458. min-height: 100vh;
  459. background: #F4F5F7;
  460. }
  461. .zdyNavBox {
  462. width: 100vw;
  463. background: #FFFFFF;
  464. position: fixed;
  465. top: 0;
  466. left: 0;
  467. z-index: 99;
  468. }
  469. .zdyNav {
  470. height: 44px;
  471. display: flex;
  472. justify-content: space-between;
  473. align-items: center;
  474. }
  475. .backImg {
  476. width: 44rpx;
  477. height: 44rpx;
  478. margin-left: 10rpx;
  479. margin-right: 20rpx;
  480. }
  481. .homeImg {
  482. width: 44rpx;
  483. height: 44rpx;
  484. }
  485. .zdyNavLeft {
  486. display: flex;
  487. align-items: center;
  488. }
  489. .zdyNavTitle {
  490. height: 44px;
  491. background: #FFFFFF;
  492. text-align: center;
  493. font-size: 34rpx;
  494. line-height: 44px;
  495. }
  496. .tab {
  497. background: #FFFFFF;
  498. display: flex;
  499. justify-content: space-between;
  500. line-height: 92rpx;
  501. /* position: fixed; */
  502. width: calc(100vw - 100rpx);
  503. padding-left: 50rpx;
  504. padding-right: 50rpx;
  505. height: 92rpx;
  506. z-index: 11;
  507. }
  508. .tabLine {
  509. font-size: 28rpx;
  510. color: #333333;
  511. text-align: center;
  512. }
  513. .tabActive {
  514. color: #3F90F7;
  515. font-weight: bold;
  516. border-bottom: 4rpx solid #3F90F7;
  517. }
  518. .main {
  519. padding-top: 210rpx;
  520. padding-bottom: 20rpx;
  521. background-color: #F4F5F7;
  522. }
  523. .itemBg {
  524. margin: 20rpx 24rpx;
  525. background-color: #FFFFFF;
  526. border-radius: 10rpx;
  527. padding: 20rpx;
  528. }
  529. .itemTop {
  530. display: flex;
  531. justify-content: space-between;
  532. }
  533. .itemType {
  534. color: #999999;
  535. font-size: 24rpx;
  536. }
  537. .itemSheetState {
  538. font-size: 24rpx;
  539. color: #999999
  540. }
  541. .redColor {
  542. color: #FF0000;
  543. }
  544. .orangeColor {
  545. color: #F19D01;
  546. }
  547. .greenColor {
  548. color: #00A040;
  549. }
  550. .itemShopBg {
  551. display: flex;
  552. justify-content: space-between;
  553. margin-top: 20rpx;
  554. }
  555. .shopName {
  556. color: #333333;
  557. font-size: 30rpx;
  558. font-weight: bold;
  559. /* 隐藏文字显示 ...不换行 */
  560. overflow: hidden;
  561. text-overflow: ellipsis;
  562. white-space: nowrap;
  563. }
  564. .price {
  565. color: #333333;
  566. font-weight: bold;
  567. font-size: 32rpx;
  568. }
  569. .itemName {
  570. color: #666666;
  571. font-size: 24rpx;
  572. padding: 16rpx 0;
  573. height: 30rpx;
  574. overflow: hidden;
  575. text-overflow: ellipsis;
  576. white-space: nowrap;
  577. }
  578. .plateBg {
  579. display: flex;
  580. justify-content: space-between;
  581. align-items: center;
  582. }
  583. .plateNumber {
  584. color: #666666;
  585. font-size: 24rpx;
  586. margin-bottom: 20rpx;
  587. display: flex;
  588. }
  589. .itemLineBottom {
  590. display: flex;
  591. justify-content: flex-end;
  592. }
  593. .itemBtn1 {
  594. width: 150rpx;
  595. height: 56rpx;
  596. border-radius: 36rpx;
  597. border: 2rpx solid #DDDDDD;
  598. text-align: center;
  599. line-height: 56rpx;
  600. font-size: 28rpx;
  601. color: #3C3C3C;
  602. margin-left: 40rpx;
  603. }
  604. .itemBtn2 {
  605. width: 150rpx;
  606. height: 56rpx;
  607. border-radius: 36rpx;
  608. border: 2rpx solid #FF4F00;
  609. text-align: center;
  610. line-height: 56rpx;
  611. font-size: 28rpx;
  612. color: #FF4F00;
  613. margin-left: 40rpx;
  614. }
  615. .orderState {
  616. color: #F19D01;
  617. font-size: 24rpx;
  618. padding-left: 20rpx;
  619. }
  620. .renBox{
  621. color: #1A1A1A;
  622. background: #F7F7F7;
  623. border-radius: 10rpx;
  624. display: flex;
  625. padding: 20rpx;font-size: 24rpx;
  626. line-height: 30rpx;
  627. margin-top: 16rpx;
  628. }
  629. .renimg{
  630. width: 30rpx;height: 30rpx;
  631. }
  632. .renMobilePhone{
  633. padding-left: 13rpx;
  634. }
  635. .renNickName{
  636. padding-left: 20rpx;
  637. }
  638. .sschahao{
  639. width: 40rpx;
  640. height: 40rpx;
  641. padding-top: 16rpx;
  642. }
  643. </style>