europeOrder.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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==4}" @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. },
  121. methods: {
  122. inputconfirm(){
  123. this.items=[]
  124. this.getData()
  125. },
  126. getAndroid(e){
  127. this.iOSInfo=e
  128. },
  129. goback(){
  130. //app交互
  131. var standalone = window.navigator.standalone
  132. var userAgent = window.navigator.userAgent.toLowerCase()
  133. var safari = /safari/.test(userAgent)
  134. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  135. var android = /android/.test(userAgent)
  136. if (ios) {
  137. if ( true) {//!standalone&& !safari
  138. window.webkit.messageHandlers.goMyNav.postMessage(null)
  139. }
  140. } else if (android) {
  141. window.android.postMessage()
  142. }
  143. },
  144. goEvaluate(item){
  145. uni.navigateTo({
  146. url:'evaluate?shopID=' + item.ShopID + '&sheetID=' + item.ID
  147. })
  148. },
  149. gopingjia(item){
  150. uni.navigateTo({
  151. url:'../me/myAppraiseDetail?id='+item.ID
  152. })
  153. },
  154. cancelOrder(item){
  155. var that=this;
  156. uni.showModal({
  157. title: '提示',
  158. content: '确定要取消订单吗',
  159. success: function (res) {
  160. if (res.confirm) {
  161. uni.showLoading({ title: '加载中'});
  162. that.$http('miniAppMyBMemberCar/updateBMSheetState', {
  163. id:item.ID
  164. },'POST').then(res => {
  165. uni.hideLoading();
  166. that.page=1;
  167. if(item.SheetState==1){
  168. uni.showModal({
  169. title: '提示',
  170. content: '订单取消成功',
  171. showCancel:false,
  172. success: function (res) {
  173. that.items=[]
  174. that.getData()
  175. }
  176. });
  177. }else{
  178. that.items=[]
  179. that.getData()
  180. uni.showModal({
  181. title: '订单取消成功,请耐心等待银行处理',
  182. content: '金额将原路退还至您的账户。若您使用了优惠券,将退至您的账户',
  183. showCancel:false,
  184. success: function (res) {
  185. }
  186. });
  187. }
  188. })
  189. } else if (res.cancel) {
  190. }
  191. }
  192. });
  193. },
  194. tabClick(num){
  195. this.tabIndex=num;
  196. if(num==5){
  197. this.state=''
  198. }else{
  199. this.state=num
  200. }
  201. this.items=[];
  202. this.page=1;
  203. this.getData()
  204. },
  205. goDetail(id){
  206. uni.navigateTo({
  207. url:'eorderDetail?id='+id
  208. })
  209. },
  210. getData(){
  211. uni.showLoading({ title: '加载中'});
  212. this.isload=false;
  213. if(this.state==4){
  214. var padata={
  215. page:this.page,
  216. limit:10,
  217. evaluateState:1,
  218. }
  219. }else{
  220. var padata={
  221. page:this.page,
  222. limit:10,
  223. sheetState:this.state,
  224. code:this.code,
  225. }
  226. }
  227. this.$http('h5BmSheet/listH5BMSheetPage', padata,'GET').then(res => {
  228. uni.hideLoading();
  229. this.isload=true;
  230. //this.list=res.data;
  231. var a=res.data.Items;
  232. this.items=this.items.concat(a)
  233. console.log( this.items)
  234. })
  235. },
  236. orderPay(item){
  237. uni.showLoading({ title: '加载中'});
  238. this.$http('miniApp/maintainOrder/orderPay', {
  239. sheetID:item.ID
  240. },'POST').then(res => {
  241. uni.hideLoading();
  242. var payInfo=JSON.parse(res.data.payInfo)
  243. uni.requestPayment({
  244. provider: 'wxpay',
  245. // timeStamp: String(Date.now()),
  246. timeStamp:payInfo.timeStamp,
  247. nonceStr: payInfo.nonceStr,
  248. package: payInfo.package,
  249. signType: payInfo.signType,
  250. paySign: payInfo.paySign,
  251. success: function (res) {
  252. console.log('success:' + JSON.stringify(res));
  253. uni.showToast({
  254. title: '支付成功',
  255. icon:'none',
  256. duration: 2000
  257. });
  258. uni.switchTab({
  259. url:'../index/index'
  260. })
  261. },
  262. fail: function (err) {
  263. console.log('fail:' + JSON.stringify(err));
  264. }
  265. });
  266. })
  267. },
  268. },
  269. onReachBottom(){
  270. this.page++;
  271. /* if(this.tabindex==2){
  272. this.getbMemberShopList()
  273. }else if(this.tabindex==3){
  274. this.getShopFootprint()
  275. } */
  276. this.getData()
  277. },
  278. onPullDownRefresh() {
  279. this.page=1;
  280. this.items=[];
  281. this.getData()
  282. setTimeout(function () {
  283. uni.stopPullDownRefresh();
  284. }, 1000);
  285. }
  286. }
  287. </script>
  288. <style scoped>
  289. .topss{
  290. position: fixed;
  291. left: 0;
  292. top: calc(44px + 89rpx);
  293. width: 750rpx;
  294. z-index: 11;
  295. height: 90rpx;
  296. background-color: #FFFFFF;
  297. padding-top: 10rpx;
  298. }
  299. .searchImg{
  300. width: 40rpx;
  301. height: 40rpx;
  302. margin-top: 16rpx;
  303. margin-left: 20rpx;
  304. }
  305. .inputBox{
  306. width: 702rpx;
  307. height: 72rpx;
  308. background: #F4F5F7;
  309. border-radius: 36rpx;
  310. margin-left: 24rpx;
  311. display:flex;
  312. position: relative;
  313. }
  314. .topInput{
  315. font-size: 28rpx;
  316. height: 72rpx;
  317. line-height: 72rpx;
  318. padding-left: 16rpx;
  319. width: 500rpx;
  320. }
  321. .zdyNavBox {
  322. width: 100vw;
  323. background: #FFFFFF;
  324. position: fixed;
  325. top: 0;
  326. left: 0;
  327. z-index: 9999999;
  328. }
  329. .zdyNav {
  330. height: 44px;
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. }
  335. .backImg {
  336. width: 44rpx;
  337. height: 44rpx;
  338. margin-left: 10rpx;
  339. margin-right: 20rpx;
  340. }
  341. .homeImg {
  342. width: 44rpx;
  343. height: 44rpx;
  344. }
  345. .zdyNavLeft {
  346. display: flex;
  347. align-items: center;
  348. }
  349. .zdyNavTitle {
  350. height: 44px;
  351. background: #FFFFFF;
  352. text-align: center;
  353. font-size: 34rpx;
  354. line-height: 44px;
  355. }
  356. .box{
  357. min-height: 100vh;
  358. background: #F4F5F7;
  359. }
  360. .tab{
  361. background: #FFFFFF;
  362. display: flex;
  363. justify-content: space-between;
  364. padding: 0 15rpx;
  365. line-height: 84rpx;
  366. position: fixed;
  367. left: 0;
  368. top: 44px;
  369. width: 720rpx;
  370. z-index: 11;
  371. }
  372. .main{
  373. padding-top:188rpx;
  374. padding-left: 24rpx;
  375. padding-right: 24rpx;
  376. }
  377. /* #ifdef MP-WEIXIN */
  378. .tab{
  379. position: fixed;
  380. left: 0;
  381. top: 0;
  382. }
  383. .main{
  384. padding-top: 88rpx ;
  385. }
  386. /* #endif */
  387. .tabLine{
  388. width: 180rpx;
  389. text-align: center;
  390. }
  391. .tabActive{
  392. color: #FF4F00;
  393. border-bottom: 4rpx solid #FF4F00;
  394. }
  395. .flex2{
  396. display: flex;
  397. justify-content: space-between;
  398. }
  399. .itemLine{
  400. background: #FFFFFF;
  401. margin-top: 20rpx;
  402. }
  403. .itemCode{
  404. font-size: 28rpx;
  405. color: #999999;
  406. }
  407. .itemlineTOp{
  408. padding: 25rpx 20rpx;
  409. }
  410. .itemSheetState{
  411. font-size: 30rpx;
  412. color: #FF4F00
  413. }
  414. .goodsImg{
  415. width: 126rpx;
  416. height: 126rpx;
  417. margin-left: 18rpx;
  418. border-radius: 5rpx;
  419. }
  420. .itemLineImgBox{
  421. display: flex;
  422. }
  423. .itemGoddsImgBox{
  424. display: flex;
  425. width:558rpx;
  426. }
  427. .diandianImg{
  428. width: 50rpx;
  429. margin-left: 50rpx;
  430. margin-top: 50rpx;
  431. }
  432. .raleMoneyBox{
  433. text-align: right;
  434. color: #666666;
  435. font-size: 24rpx;
  436. line-height: 50rpx;
  437. padding-bottom: 20rpx;
  438. /* border-bottom: 1px solid #EEEEEE; */
  439. }
  440. .raleMoneySpan{
  441. color: #3C3C3C;
  442. font-size: 32rpx;
  443. padding-right: 24rpx;
  444. padding-left: 10rpx;
  445. }
  446. .itemLineBottom{
  447. display: flex;
  448. justify-content: flex-end;
  449. padding-top: 20rpx;padding-bottom: 20rpx;padding-right: 20rpx;
  450. border-top: 1px solid #EEEEEE; ;
  451. }
  452. .daifuwuBOxDiv{
  453. padding: 20rpx;
  454. }
  455. .itemBtn1{
  456. width: 150rpx;
  457. height: 56rpx;
  458. border-radius: 36rpx;
  459. border: 2rpx solid #DDDDDD;
  460. text-align: center;
  461. line-height: 56rpx;
  462. font-size: 28rpx;
  463. color: #3C3C3C;
  464. margin-left: 40rpx;
  465. }
  466. .itemBtn2{
  467. width: 150rpx;
  468. height: 56rpx;
  469. border-radius: 36rpx;
  470. border: 2rpx solid #FF4F00;
  471. text-align: center;
  472. line-height: 56rpx;
  473. font-size: 28rpx;
  474. color: #FF4F00;
  475. margin-left: 40rpx;
  476. }
  477. .daifuwuBOx{
  478. width: 662rpx;
  479. height: 175rpx;
  480. background: rgba(255, 79, 0, 0.04);
  481. border-radius: 6rpx;
  482. }
  483. .orderyytimeImg{
  484. width: 32rpx;
  485. height: 32rpx;
  486. }
  487. .daifuwuBOxTop{
  488. display: flex;
  489. padding: 20rpx 0 20rpx 20rpx;
  490. color: #FF4F00;
  491. font-size: 28rpx;
  492. }
  493. .daifuwuBOxTitle{
  494. line-height: 32rpx;padding-left: 10rpx;
  495. }
  496. .daifuwuBOxLIne{
  497. color: #666666;
  498. font-size: 26rpx;
  499. line-height: 40rpx;
  500. padding-left: 20rpx;
  501. }
  502. </style>