europeOrder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view class="box">
  3. <view class="zdyNavBox">
  4. <view class="zdyNav">
  5. <view class="zdyNavLeft">
  6. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  7. </image>
  8. </view>
  9. <view class="zdyNavTitle">订单管理</view>
  10. <view style="width: 50px;"></view>
  11. </view>
  12. </view>
  13. <view style="height: 44px;"></view>
  14. <view class="tab">
  15. <view class="tabLine" :class="{tabActive:tabIndex==5}" @click="tabClick(5)">全部</view>
  16. <view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">待付款</view>
  17. <view class="tabLine" :class="{tabActive:tabIndex==2}" @click="tabClick(2)">待服务</view>
  18. <view class="tabLine" :class="{tabActive:tabIndex==3}" @click="tabClick(3)">已完成</view>
  19. </view>
  20. <view class="topss">
  21. <view class="inputBox">
  22. <img src="../../static/img/icon_search.png" alt="" class="searchImg">
  23. <input v-model="code" type="text" placeholder="订单单号、联系人姓名、手机号、车牌号" class="topInput" @confirm="inputconfirm">
  24. </view>
  25. </view>
  26. <view class="main">
  27. <view class="itemLine" v-for="(item,index) in items" @click="goDetail(item.ID)">
  28. <view class="flex2 itemlineTOp">
  29. <view class="itemCode">{{item.Code}}</view>
  30. <view class="itemSheetState" v-if="item.SheetState==1">待付款</view>
  31. <view class="itemSheetState" v-if="item.SheetState==2">待服务</view>
  32. <view class="itemSheetState" v-if="item.SheetState==3||item.SheetState==5">已完成</view>
  33. <view class="itemSheetState" v-if="item.SheetState==4">已完成</view>
  34. <view class="itemSheetState" v-if="item.SheetState==0">已取消</view>
  35. </view>
  36. <view class="itemLineImgBox">
  37. <view class="itemGoddsImgBox" v-if="item.goodsUrl">
  38. <view v-for="(v,i) in item.goodsUrl.split(',')" v-if="i<4">
  39. <image :src="v" mode="" class="goodsImg" v-if="i<4&&v"></image>
  40. <image src="../../static/img/noimg.png" mode="" class="goodsImg" v-else></image>
  41. </view>
  42. </view>
  43. <view class="itemGoddsImgBox" v-else>
  44. <view >
  45. <image src="../../static/img/noimg.png" mode="" class="goodsImg" ></image>
  46. </view>
  47. </view>
  48. <view v-if="item.goodsUrl&&item.goodsUrl.split(',').length>3">
  49. <image src="../../static/img/diandian.png" mode="widthFix" class="diandianImg"></image>
  50. </view>
  51. </view>
  52. <view class="raleMoneyBox">
  53. <span>实付款</span> <span class="raleMoneySpan">¥{{item.PayMoney}}</span>
  54. </view>
  55. <!-- 待服务的-->
  56. <view class="daifuwuBOxDiv" v-if="item.SheetState==2">
  57. <view class="daifuwuBOx">
  58. <view class="daifuwuBOxTop">
  59. <image src="../../static/img/orderyytime.png" mode="" class="orderyytimeImg"></image>
  60. <view class="daifuwuBOxTitle">预约信息</view>
  61. </view>
  62. <view class="daifuwuBOxLIne">门店名称:{{item.ShopName}}</view>
  63. <view class="daifuwuBOxLIne">预约到店信息:{{item.OrderTime}}</view>
  64. </view>
  65. </view>
  66. <!-- <view class="itemLineBottom" v-if="item.SheetState==1||item.SheetState==3||item.SheetState==4||item.SheetState==2">
  67. <view class="itemBtn1" v-if="item.SheetState==1||item.SheetState==2" @click.stop="cancelOrder(item)">取消订单</view>
  68. <view class="itemBtn2" v-if="item.SheetState==1" @click.stop="orderPay(item)">立即支付</view>
  69. <view class="itemBtn2" v-if="item.EvaluateState==0&&item.EState==1" @click.stop="goEvaluate(item)">立即评价</view>
  70. <view class="itemBtn1" v-if="item.EvaluateState==1" @click.stop="gopingjia(item)">查看评价</view>
  71. </view> -->
  72. </view>
  73. <nodata v-show="items==''&&isload"></nodata>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import nodata from '@/components/nodata/nodata.vue'
  79. export default {
  80. components: {
  81. nodata
  82. },
  83. data() {
  84. return {
  85. page:1,
  86. state:'',
  87. num:'',
  88. tabIndex:5,
  89. items:[],
  90. isload:false,
  91. iOSInfo:'',
  92. code:'',
  93. }
  94. },
  95. onLoad(opt) {
  96. // var num=opt.num;
  97. // this.tabIndex=num;
  98. // this.items=[]
  99. // if(num==5){
  100. // this.state=''
  101. // }else{
  102. // this.state=num
  103. // }
  104. //this.getData()
  105. var qxnum = uni.getStorageSync("quanxian");
  106. if (qxnum == 1) {
  107. this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
  108. }else if(qxnum==2){
  109. window.getAndroid=this.getAndroid;
  110. }
  111. },
  112. onShow() {
  113. console.log(this.tabIndex)
  114. // var evaluate = uni.getStorageSync("evaluate")
  115. // if(evaluate){
  116. // this.items=[]
  117. // this.getData()
  118. // uni.removeStorageSync('evaluate');
  119. // }
  120. this.items=[]
  121. this.getData()
  122. },
  123. methods: {
  124. inputconfirm(){
  125. this.items=[]
  126. this.getData()
  127. },
  128. getAndroid(e){
  129. this.iOSInfo=e
  130. },
  131. goback(){
  132. //app交互
  133. var standalone = window.navigator.standalone
  134. var userAgent = window.navigator.userAgent.toLowerCase()
  135. var safari = /safari/.test(userAgent)
  136. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  137. var android = /android/.test(userAgent)
  138. if (ios) {
  139. if ( true) {//!standalone&& !safari
  140. window.webkit.messageHandlers.goMyNav.postMessage(null)
  141. }
  142. } else if (android) {
  143. window.android.postMessage()
  144. }
  145. },
  146. goEvaluate(item){
  147. uni.navigateTo({
  148. url:'evaluate?shopID=' + item.ShopID + '&sheetID=' + item.ID
  149. })
  150. },
  151. gopingjia(item){
  152. uni.navigateTo({
  153. url:'../me/myAppraiseDetail?id='+item.ID
  154. })
  155. },
  156. cancelOrder(item){
  157. var that=this;
  158. uni.showModal({
  159. title: '提示',
  160. content: '确定要取消订单吗',
  161. success: function (res) {
  162. if (res.confirm) {
  163. uni.showLoading({ title: '加载中'});
  164. that.$http('miniAppMyBMemberCar/updateBMSheetState', {
  165. id:item.ID
  166. },'POST').then(res => {
  167. uni.hideLoading();
  168. that.page=1;
  169. if(item.SheetState==1){
  170. uni.showModal({
  171. title: '提示',
  172. content: '订单取消成功',
  173. showCancel:false,
  174. success: function (res) {
  175. that.items=[]
  176. that.getData()
  177. }
  178. });
  179. }else{
  180. that.items=[]
  181. that.getData()
  182. uni.showModal({
  183. title: '订单取消成功,请耐心等待银行处理',
  184. content: '金额将原路退还至您的账户。若您使用了优惠券,将退至您的账户',
  185. showCancel:false,
  186. success: function (res) {
  187. }
  188. });
  189. }
  190. })
  191. } else if (res.cancel) {
  192. }
  193. }
  194. });
  195. },
  196. tabClick(num){
  197. this.tabIndex=num;
  198. if(num==5){
  199. this.state=''
  200. }else{
  201. this.state=num
  202. }
  203. this.items=[];
  204. this.page=1;
  205. this.getData()
  206. },
  207. goDetail(id){
  208. uni.navigateTo({
  209. url:'eorderDetail?id='+id+'&type=2'
  210. })
  211. },
  212. getData(){
  213. uni.showLoading({ title: '加载中'});
  214. this.isload=false;
  215. if(this.state==4){
  216. var padata={
  217. page:this.page,
  218. limit:10,
  219. evaluateState:1,
  220. }
  221. }else{
  222. var padata={
  223. page:this.page,
  224. limit:10,
  225. sheetState:this.state,
  226. code:this.code,
  227. }
  228. }
  229. this.$http('h5BmSheet/listH5BMSheetPage', padata,'GET').then(res => {
  230. uni.hideLoading();
  231. this.isload=true;
  232. //this.list=res.data;
  233. var a=res.data.Items;
  234. this.items=this.items.concat(a)
  235. console.log( this.items)
  236. })
  237. },
  238. orderPay(item){
  239. uni.showLoading({ title: '加载中'});
  240. this.$http('miniApp/maintainOrder/orderPay', {
  241. sheetID:item.ID
  242. },'POST').then(res => {
  243. uni.hideLoading();
  244. var payInfo=JSON.parse(res.data.payInfo)
  245. uni.requestPayment({
  246. provider: 'wxpay',
  247. // timeStamp: String(Date.now()),
  248. timeStamp:payInfo.timeStamp,
  249. nonceStr: payInfo.nonceStr,
  250. package: payInfo.package,
  251. signType: payInfo.signType,
  252. paySign: payInfo.paySign,
  253. success: function (res) {
  254. console.log('success:' + JSON.stringify(res));
  255. uni.showToast({
  256. title: '支付成功',
  257. icon:'none',
  258. duration: 2000
  259. });
  260. uni.switchTab({
  261. url:'../index/index'
  262. })
  263. },
  264. fail: function (err) {
  265. console.log('fail:' + JSON.stringify(err));
  266. }
  267. });
  268. })
  269. },
  270. },
  271. onReachBottom(){
  272. this.page++;
  273. /* if(this.tabindex==2){
  274. this.getbMemberShopList()
  275. }else if(this.tabindex==3){
  276. this.getShopFootprint()
  277. } */
  278. this.getData()
  279. },
  280. onPullDownRefresh() {
  281. this.page=1;
  282. this.items=[];
  283. this.getData()
  284. setTimeout(function () {
  285. uni.stopPullDownRefresh();
  286. }, 1000);
  287. }
  288. }
  289. </script>
  290. <style scoped>
  291. .topss{
  292. position: fixed;
  293. left: 0;
  294. top: calc(44px + 89rpx);
  295. width: 750rpx;
  296. z-index: 11;
  297. height: 90rpx;
  298. background-color: #FFFFFF;
  299. padding-top: 10rpx;
  300. }
  301. .searchImg{
  302. width: 40rpx;
  303. height: 40rpx;
  304. margin-top: 16rpx;
  305. margin-left: 20rpx;
  306. }
  307. .inputBox{
  308. width: 702rpx;
  309. height: 72rpx;
  310. background: #F4F5F7;
  311. border-radius: 36rpx;
  312. margin-left: 24rpx;
  313. display:flex;
  314. position: relative;
  315. }
  316. .topInput{
  317. font-size: 28rpx;
  318. height: 72rpx;
  319. line-height: 72rpx;
  320. padding-left: 16rpx;
  321. width: 500rpx;
  322. }
  323. .zdyNavBox {
  324. width: 100vw;
  325. background: #FFFFFF;
  326. position: fixed;
  327. top: 0;
  328. left: 0;
  329. z-index: 9999999;
  330. }
  331. .zdyNav {
  332. height: 44px;
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. }
  337. .backImg {
  338. width: 44rpx;
  339. height: 44rpx;
  340. margin-left: 10rpx;
  341. margin-right: 20rpx;
  342. }
  343. .homeImg {
  344. width: 44rpx;
  345. height: 44rpx;
  346. }
  347. .zdyNavLeft {
  348. display: flex;
  349. align-items: center;
  350. }
  351. .zdyNavTitle {
  352. height: 44px;
  353. background: #FFFFFF;
  354. text-align: center;
  355. font-size: 34rpx;
  356. line-height: 44px;
  357. }
  358. .box{
  359. min-height: 100vh;
  360. background: #F4F5F7;
  361. }
  362. .tab{
  363. background: #FFFFFF;
  364. display: flex;
  365. justify-content: space-between;
  366. padding: 0 15rpx;
  367. line-height: 84rpx;
  368. position: fixed;
  369. left: 0;
  370. top: 44px;
  371. width: 720rpx;
  372. z-index: 11;
  373. }
  374. .main{
  375. padding-top:188rpx;
  376. padding-left: 24rpx;
  377. padding-right: 24rpx;
  378. }
  379. /* #ifdef MP-WEIXIN */
  380. .tab{
  381. position: fixed;
  382. left: 0;
  383. top: 0;
  384. }
  385. .main{
  386. padding-top: 88rpx ;
  387. }
  388. /* #endif */
  389. .tabLine{
  390. width: 180rpx;
  391. text-align: center;
  392. }
  393. .tabActive{
  394. color: #3F90F7;
  395. border-bottom: 4rpx solid #3F90F7;
  396. }
  397. .flex2{
  398. display: flex;
  399. justify-content: space-between;
  400. }
  401. .itemLine{
  402. background: #FFFFFF;
  403. margin-top: 20rpx;
  404. }
  405. .itemCode{
  406. font-size: 28rpx;
  407. color: #999999;
  408. }
  409. .itemlineTOp{
  410. padding: 25rpx 20rpx;
  411. }
  412. .itemSheetState{
  413. font-size: 30rpx;
  414. color: #FF4F00
  415. }
  416. .goodsImg{
  417. width: 126rpx;
  418. height: 126rpx;
  419. margin-left: 18rpx;
  420. border-radius: 5rpx;
  421. }
  422. .itemLineImgBox{
  423. display: flex;
  424. }
  425. .itemGoddsImgBox{
  426. display: flex;
  427. width:558rpx;
  428. }
  429. .diandianImg{
  430. width: 50rpx;
  431. margin-left: 50rpx;
  432. margin-top: 50rpx;
  433. }
  434. .raleMoneyBox{
  435. text-align: right;
  436. color: #666666;
  437. font-size: 24rpx;
  438. line-height: 50rpx;
  439. padding-bottom: 20rpx;
  440. /* border-bottom: 1px solid #EEEEEE; */
  441. }
  442. .raleMoneySpan{
  443. color: #3C3C3C;
  444. font-size: 32rpx;
  445. padding-right: 24rpx;
  446. padding-left: 10rpx;
  447. }
  448. .itemLineBottom{
  449. display: flex;
  450. justify-content: flex-end;
  451. padding-top: 20rpx;padding-bottom: 20rpx;padding-right: 20rpx;
  452. border-top: 1px solid #EEEEEE; ;
  453. }
  454. .daifuwuBOxDiv{
  455. padding: 20rpx;
  456. padding-top: 0;
  457. }
  458. .itemBtn1{
  459. width: 150rpx;
  460. height: 56rpx;
  461. border-radius: 36rpx;
  462. border: 2rpx solid #DDDDDD;
  463. text-align: center;
  464. line-height: 56rpx;
  465. font-size: 28rpx;
  466. color: #3C3C3C;
  467. margin-left: 40rpx;
  468. }
  469. .itemBtn2{
  470. width: 150rpx;
  471. height: 56rpx;
  472. border-radius: 36rpx;
  473. border: 2rpx solid #FF4F00;
  474. text-align: center;
  475. line-height: 56rpx;
  476. font-size: 28rpx;
  477. color: #FF4F00;
  478. margin-left: 40rpx;
  479. }
  480. .daifuwuBOx{
  481. width: 662rpx;
  482. height: 175rpx;
  483. background: rgba(255, 79, 0, 0.04);
  484. border-radius: 6rpx;
  485. }
  486. .orderyytimeImg{
  487. width: 32rpx;
  488. height: 32rpx;
  489. }
  490. .daifuwuBOxTop{
  491. display: flex;
  492. padding: 20rpx 0 20rpx 20rpx;
  493. color: #FF4F00;
  494. font-size: 28rpx;
  495. }
  496. .daifuwuBOxTitle{
  497. line-height: 32rpx;padding-left: 10rpx;
  498. }
  499. .daifuwuBOxLIne{
  500. color: #666666;
  501. font-size: 26rpx;
  502. line-height: 40rpx;
  503. padding-left: 20rpx;
  504. }
  505. </style>