my_orderlist.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <view class="content" :scroll="false">
  3. <!-- 切换栏 -->
  4. <scroll-view :scroll-x="true" class="inv-h-w">
  5. <view :class="['inv-h',Inv==6?'inv-h-se':'']" @click="changeTab(6)">全部</view>
  6. <view :class="['inv-h',Inv==1?'inv-h-se':'']" @click="changeTab(1)">待支付</view>
  7. <view :class="['inv-h',Inv==2?'inv-h-se':'']" @click="changeTab(2)">待入住</view>
  8. <view :class="['inv-h',Inv==3?'inv-h-se':'']" @click="changeTab(3)">已入住</view>
  9. <view :class="['inv-h',Inv==0?'inv-h-se':'']" @click="changeTab(0)">已取消</view>
  10. <view :class="['inv-h',Inv==4?'inv-h-se':'']" @click="changeTab(4)">待结账</view>
  11. <view :class="['inv-h',Inv==5?'inv-h-se':'']" @click="changeTab(5)">已完成</view>
  12. </scroll-view>
  13. <!-- 订单样式 -->
  14. <uni-list class="room-kuang">
  15. <view class="room-xinxi" v-for="(item,index) in troom" :key="index">
  16. <view @click="navigateToOrderMark(item.id)">
  17. <image class="room-image" :src="item.roomTypeMasterImg"></image>
  18. <view class="room-name">{{item.roomTypeName}}</view>
  19. <view class="room-time">{{item.enableStartTime|snippet}}-{{item.enableEndTime|snippet}}</view>
  20. <view class="room-order">订单号:{{item.id}}</view>
  21. <view class="room-type">
  22. <text v-if="item.orderStatu==0">已取消</text>
  23. <text v-if="item.orderStatu==1">待支付</text>
  24. <text v-if="item.orderStatu==2">待入住</text>
  25. <text v-if="item.orderStatu==3">已入住</text>
  26. <text v-if="item.orderStatu==4">
  27. 待结账
  28. </text>
  29. <text v-if="item.orderStatu==5">已完成</text>
  30. </view>
  31. <view class="room-price">¥{{item.payAmount}}</view>
  32. </view>
  33. <uni-countdown v-if="item.orderStatu == 1" class="room-count" color="#FF5733" :show-day="false" :second="timeupSecond" @timeup="timeup(item.createTime)" />
  34. <text v-if="item.orderStatu == 1" class="room-count-txt">之后取消</text>
  35. <view class="room-button" v-if="item.orderStatu != 4 && item.orderStatu != 2 && item.orderStatu != 3">
  36. <text v-if="item.orderStatu == 0" @click="openDel(item.id,'warn')">删除</text>
  37. <text v-if="item.orderStatu == 1" @click="openQu(item.id,'warn')">取消订单</text>
  38. <text v-if="item.orderStatu == 5" @click="openDel(item.id,'warn')">删除</text>
  39. <!-- <text v-if="item.orderStatu == 2">取消订单</text> -->
  40. <!-- <text v-if="item.orderStatu == 3" @click="navigateToXuzhu">续住</text> -->
  41. </view>
  42. <view class="room-button2" :class="{'room-button3': item.orderStatu == 1 || item.orderStatu == 4}">
  43. <text v-if="item.orderStatu == 0" @click="navigateToZaici(item.enableStartTime,item.enableEndTime,item.roomTypeId)">再次预定</text>
  44. <text v-if="item.orderStatu == 1" @click="getOrderPay(item.id)">支付</text>
  45. <text v-if="item.orderStatu == 4" @click="navigateToJiezhang(item.id)">去处理</text>
  46. <text v-if="item.orderStatu == 5" @click="navigateToWanchengZaici(item.roomTypeId)">再次预定</text>
  47. <text v-if="item.orderStatu == 2" @click="openRu(item.id,'warn')">办理入住</text>
  48. <text v-if="item.orderStatu == 3" @click="openTui(item.id,'warn')">退房</text>
  49. </view>
  50. <view class="room-line" v-if="index<(troom.length-1)"></view>
  51. </view>
  52. </uni-list>
  53. <!-- 提示时弹框 -->
  54. <uni-popup ref="popup_order2" type="dialog">
  55. <uni-popup-dialog :type="msgType2" cancelText="关闭" confirmText="确定" :content='order_txt2' @confirm="dialogConfirm"
  56. @close="dialogClose"></uni-popup-dialog>
  57. </uni-popup>
  58. <uni-popup ref="popup_order" type="dialog">
  59. <uni-popup-dialog :type="msgType" cancelText="关闭" :content='order_txt'></uni-popup-dialog>
  60. </uni-popup>
  61. <!-- 办理续住弹窗 -->
  62. <uni-popup ref="popup_xuzhu" type="dialog" :mask-click="false">
  63. <view class="popup_bg_xu">
  64. <text class="popup_title">办理续住</text>
  65. <text class="popup_error" @click="popupXuzhuClose"></text>
  66. <text class="popup_xu_line"></text>
  67. <!-- 时间选择 -->
  68. <view class="select-time-xu" @click="openXuCalendar">
  69. <view class="select-time-one-xu">
  70. <text class="select-list">周四入住</text>
  71. <text class="select-list-time">07月21日</text>
  72. </view>
  73. <view class="select-center">
  74. <view class="select-line1"></view>
  75. <view class="select-circle">1晚</view>
  76. <view class="select-line2"></view>
  77. </view>
  78. <view class="select-time-one-xu">
  79. <text class="select-list">周五离店</text>
  80. <text class="select-list-time">07月22日</text>
  81. </view>
  82. </view>
  83. <text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
  84. <!-- 支付框 -->
  85. <view class="fukuan">
  86. <view class="fu-price"><text style="font-size: 28rpx;">总计:</text>¥20.00</view>
  87. <view class="fu-zhifu">立即支付</view>
  88. </view>
  89. </view>
  90. </uni-popup>
  91. <uni-popup ref="popup_xu" :mask-click="true">
  92. <uni-calendar :selected="infoXu.selected" class="uni-calendar--hook" :clear-date="true" :date="infoXu.date" :insert="infoXu.insert" :lunar="infoXu.lunar" :startDate="infoXu.startDate"
  93. :endDate="infoXu.endDate" :range="infoXu.range" @change="changeXu"/>
  94. </uni-popup>
  95. </view>
  96. </template>
  97. <script>
  98. /**
  99. * 获取任意时间
  100. */
  101. function getDate(date, AddDayCount = 0) {
  102. if (!date) {
  103. date = new Date()
  104. }
  105. if (typeof date !== 'object') {
  106. date = date.replace(/-/g, '/')
  107. }
  108. const dd = new Date(date)
  109. dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
  110. var a = new Array("日", "一", "二", "三", "四", "五", "六");
  111. var week = new Date().getDay();
  112. var week2 = new Date().getDay()+1;
  113. const y = dd.getFullYear()
  114. const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
  115. const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
  116. const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  117. const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  118. const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  119. return {
  120. fullDate: y + '-' + m + '-' + d,
  121. fullDate2: y + '-' + m + '-' + d+' '+h+':'+f+':'+s,
  122. fullTime: m + '月' + d + '日',
  123. year: y,
  124. month: m,
  125. date: d,
  126. day: dd.getDay(),
  127. sWeek:"周"+ a[week],
  128. eWeek:"周"+ a[week2]
  129. }
  130. }
  131. // 导入图片
  132. import room1 from '../../static/index/room_image.svg'
  133. import room2 from '../../static/index/room_image.svg'
  134. import {
  135. getorderpage,
  136. getorderpay,
  137. getorderreturn,
  138. getorderhold,
  139. getorderdelete,
  140. getordercancel
  141. } from '../../utils/api_hotel.js'
  142. export default {
  143. data(){
  144. return {
  145. Inv: 6,
  146. room:[],
  147. troom:[],
  148. timeupSecond:null,
  149. //续住里选择器
  150. infoXu: {
  151. lunar: true,
  152. range: true,
  153. insert: true,
  154. selected: [],
  155. startDate:'',
  156. date:'',
  157. endDate:'',
  158. order_txt:'',//提交订单时信息
  159. },
  160. msgType:'warn',
  161. msgType2:'warn',
  162. order_txt:'',//
  163. order_txt2:'',//
  164. tankuang:false,//弹框是否确定
  165. order_txt_id:'',
  166. curPage:1,
  167. pageSize:10,
  168. total: 0,
  169. loadStatus: '',
  170. }
  171. },
  172. filters:{
  173. //字过长变为...
  174. snippet: function(value) {
  175. if(value.length>10) {
  176. return value.slice(0,4)+'/'+value.slice(5,7)+'/'+value.slice(8, 10);
  177. } else {
  178. return value.slice(0,4)+'/'+value.slice(5,7)+'/'+value.slice(8, 10);
  179. }
  180. },
  181. },
  182. onShow() {
  183. // 模拟从后台拿到的数据
  184. var room = []
  185. // list数组中为每一项添加双向绑定的属性---这个属性要在页面显示(onShow)添加
  186. room.forEach(el => el.isChecked = false);
  187. this.room = room;
  188. this.troom = room;//真实数据赋值给页面数据
  189. this.changeTab(this.Inv)
  190. },
  191. //下拉刷新
  192. onPullDownRefresh() {
  193. this.getOrderPage(this.Inv)
  194. setTimeout(function () {
  195. uni.stopPullDownRefresh();
  196. }, 1000);
  197. },
  198. //上拉加载
  199. onReachBottom() {
  200. let allTotal = this.curPage * this.pageSize
  201. if (allTotal < this.total) {
  202. this.loadStatus = 'loading'
  203. this.curPage += 1
  204. this.getOrderPage(this.Inv)
  205. }else {
  206. this.loadStatus = 'nomore'
  207. }
  208. },
  209. onLoad(option) {
  210. this.Inv=option.Inv;
  211. },
  212. /**
  213. * 生命周期函数--监听页面卸载
  214. */
  215. onUnload: function () {
  216. clearInterval(this.timer);
  217. },
  218. mounted(){
  219. },
  220. onReady() {
  221. this.$nextTick(() => {
  222. this.showCalendar = true
  223. })
  224. // TODO 模拟请求异步同步数据
  225. setTimeout(() => {
  226. // console.log('date:'+getDate(new Date()).fullDate)
  227. // console.log('startDate:'+getDate(new Date()).fullDate)
  228. // console.log('endDate:'+getDate(new Date(),6).fullDate)
  229. this.infoXu.date = getDate(new Date()).fullDate
  230. this.infoXu.startDate = getDate(new Date()).fullDate
  231. this.infoXu.endDate = getDate(new Date(),6).fullDate
  232. }, 2000)
  233. },
  234. methods:{
  235. // 订单列表
  236. getOrderPage() {
  237. let _self = this
  238. var Inv2=this.Inv
  239. _self.troom = []
  240. _self.room = []
  241. if (this.Inv==6) {
  242. Inv2=''
  243. }
  244. var data='?curPage='+this.curPage+"&pageSize="+this.pageSize+"&statu="+Inv2
  245. getorderpage(data).then((res) => {
  246. if (res.success) {
  247. res.data.list.forEach(data => {
  248. _self.troom.push(data)
  249. _self.room.push(data)
  250. })
  251. _self.total=res.data.totalCount
  252. return;
  253. } else {
  254. this.$message.warning('没有符合条件的数据!')
  255. }
  256. }).catch((err) => {
  257. this.$message.error(err.message)
  258. });
  259. // this.$axios.get("/hotel/ihotel-api/ihotel/hotelOrder/user/order/page?curPage="+this.curPage+"&pageSize="+this.pageSize+"&statu="+Inv2,
  260. // {
  261. // headers:{
  262. // 'user_token':localStorage.getItem('token')
  263. // },
  264. // }).then(res => {
  265. // res = res.data
  266. // if (res.success) {
  267. // // console.log(res)
  268. // res.data.list.forEach(data => {
  269. // _self.troom.push(data)
  270. // _self.room.push(data)
  271. // })
  272. // _self.total=res.data.totalCount
  273. // } else {
  274. // console.log('获取订单列表失败')
  275. // // _self.troom = [
  276. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  277. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  278. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  279. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  280. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  281. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'1',enableStartTime:'111111',enableEndTime:''},
  282. // // {roomTypeName:'11',roomTypeMasterImg:'',id:'2',enableStartTime:'111111',enableEndTime:''},
  283. // // ]
  284. // }
  285. // });
  286. },
  287. //待确认的弹框操作
  288. dialogConfirm() {
  289. this.$refs.popup_order2.close()
  290. this.tankuang=true
  291. if(this.tankuang==true) {
  292. if(this.order_txt2=='确定删除?') {
  293. this.getOrderDelete(this.order_txt_id)
  294. } else if(this.order_txt2=='确定退房?') {
  295. this.getOrderReturn(this.order_txt_id)
  296. } else if(this.order_txt2=='确定入住?') {
  297. this.getOrderHold(this.order_txt_id)
  298. } else if(this.order_txt2=='确定取消订单?') {
  299. this.getOrderCancel(this.order_txt_id)
  300. }
  301. }
  302. },
  303. dialogClose(){
  304. this.$refs.popup_order2.close()
  305. },
  306. //删除弹框
  307. openDel(id,type){
  308. this.order_txt_id=id
  309. this.msgType2 = type
  310. this.order_txt2='确定删除?'
  311. this.$refs.popup_order2.open()
  312. },
  313. //退房弹框
  314. openTui(id,type) {
  315. this.order_txt_id=id
  316. this.msgType2 = type
  317. this.order_txt2='确定退房?'
  318. this.$refs.popup_order2.open()
  319. },
  320. //入住弹框
  321. openRu(id,type) {
  322. this.order_txt_id=id
  323. this.msgType2 = type
  324. this.order_txt2='确定入住?'
  325. this.$refs.popup_order2.open()
  326. },
  327. //取消订单弹框
  328. openQu(id,type) {
  329. this.order_txt_id=id
  330. this.msgType2 = type
  331. this.order_txt2='确定取消订单?'
  332. this.$refs.popup_order2.open()
  333. },
  334. // 支付订单
  335. getOrderPay(id) {
  336. let _self = this
  337. var data=id
  338. getorderpay(data).then((res) => {
  339. if (res.success) {
  340. if(res.data.payAmount==0) {
  341. uni.navigateTo({
  342. url: '../zhifuchenggong/zhifuchenggong?orderId='+res.data.orderId
  343. })
  344. } else {
  345. window.location.href = res.data.payUrl;
  346. }
  347. return;
  348. } else {
  349. this.order_txt=res.message
  350. this.$refs.popup_order.open()
  351. }
  352. }).catch((err) => {
  353. this.$message.error(err.message)
  354. });
  355. // this.$axios.get(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/pay/${id}`,
  356. // {
  357. // headers:{
  358. // 'user_token':localStorage.getItem('token')
  359. // }
  360. // }).then(res => {
  361. // res = res.data
  362. // if (res.success) {
  363. // if(res.data.payAmount==0) {
  364. // uni.navigateTo({
  365. // url: '../zhifuchenggong/zhifuchenggong?orderId='+res.data.orderId
  366. // })
  367. // } else {
  368. // window.location.href = res.data.payUrl;
  369. // }
  370. // } else {
  371. // this.order_txt=res.message
  372. // this.$refs.popup_order.open()
  373. // console.log('支付失败')
  374. // }
  375. // });
  376. },
  377. // 办理退房
  378. getOrderReturn(order_txt_id) {
  379. let _self = this
  380. var data=order_txt_id
  381. getorderreturn(data).then((res) => {
  382. if (res.success) {
  383. this.order_txt='退房成功'
  384. this.$refs.popup_order.open()
  385. this.getOrderPage()
  386. return;
  387. } else {
  388. this.order_txt=res.message
  389. this.$refs.popup_order.open()
  390. }
  391. }).catch((err) => {
  392. this.$message.error(err.message)
  393. });
  394. // this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
  395. // this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`,).then(res => {
  396. // res = res.data
  397. // if (res.success) {
  398. // this.order_txt='退房成功'
  399. // this.$refs.popup_order.open()
  400. // this.getOrderPage()
  401. // } else {
  402. // this.order_txt=res.message
  403. // this.$refs.popup_order.open()
  404. // }
  405. // });
  406. this.tankuang==false
  407. },
  408. // 办理入住
  409. getOrderHold(order_txt_id) {
  410. let _self = this
  411. var data=order_txt_id
  412. getorderhold(data).then((res) => {
  413. if (res.success) {
  414. this.order_txt='办理入住成功'
  415. this.$refs.popup_order.open()
  416. this.getOrderPage()
  417. return;
  418. } else {
  419. this.order_txt=res.message
  420. this.$refs.popup_order.open()
  421. }
  422. }).catch((err) => {
  423. this.$message.error(err.message)
  424. });
  425. // this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
  426. // this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`,).then(res => {
  427. // res = res.data
  428. // if (res.success) {
  429. // this.order_txt='办理入住成功'
  430. // this.$refs.popup_order.open()
  431. // this.getOrderPage()
  432. // } else {
  433. // this.order_txt=res.message
  434. // this.$refs.popup_order.open()
  435. // }
  436. // });
  437. },
  438. // 删除订单
  439. getOrderDelete(order_txt_id) {
  440. let _self = this
  441. var data=order_txt_id
  442. getorderdelete(data).then((res) => {
  443. if (res.success) {
  444. this.order_txt='删除订单成功'
  445. this.$refs.popup_order.open()
  446. this.getOrderPage()
  447. return;
  448. } else {
  449. this.order_txt=res.message
  450. this.$refs.popup_order.open()
  451. }
  452. }).catch((err) => {
  453. this.$message.error(err.message)
  454. });
  455. // this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
  456. // this.$axios.delete(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/${this.order_txt_id}`,).then(res => {
  457. // res = res.data
  458. // if (res.success) {
  459. // this.order_txt='删除订单成功'
  460. // this.$refs.popup_order.open()
  461. // this.getOrderPage()
  462. // } else {
  463. // this.order_txt=res.message
  464. // this.$refs.popup_order.open()
  465. // }
  466. // });
  467. this.tankuang==false
  468. },
  469. // 待支付取消订单
  470. getOrderCancel(order_txt_id) {
  471. let _self = this
  472. var data=order_txt_id
  473. getordercancel(data).then((res) => {
  474. if (res.success) {
  475. this.order_txt='取消成功'
  476. this.$refs.popup_order.open()
  477. this.getOrderPage()
  478. return;
  479. } else {
  480. this.order_txt=res.message
  481. this.$refs.popup_order.open()
  482. }
  483. }).catch((err) => {
  484. this.$message.error(err.message)
  485. });
  486. // this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
  487. // this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/cancel/${this.order_txt_id}`,).then(res => {
  488. // res = res.data
  489. // if (res.success) {
  490. // this.order_txt='取消成功'
  491. // this.$refs.popup_order.open()
  492. // this.getOrderPage()
  493. // } else {
  494. // this.order_txt=res.message
  495. // this.$refs.popup_order.open()
  496. // }
  497. // });
  498. },
  499. // 订单取消再次预订
  500. navigateToZaici(enableStartTime,enableEndTime,roomTypeId){
  501. uni.navigateTo({
  502. url:"../order_room/order_room?enableStartTime="+enableStartTime+"&enableEndTime="+enableEndTime+"&startTime="+enableStartTime.substring(5,7)+'月'+enableStartTime.substring(8,10)+'日'+"&endTime="+enableEndTime.substring(5,7)+'月'+enableEndTime.substring(8,10)+'日'+"&roomTypeId="+roomTypeId
  503. })
  504. },
  505. // 订单已完成再次预订
  506. navigateToWanchengZaici(roomTypeId){
  507. uni.navigateTo({
  508. url:'../order_room/order_room?roomTypeId='+roomTypeId
  509. })
  510. },
  511. //处理结账
  512. navigateToJiezhang(id) {
  513. uni.navigateTo({
  514. url:"../order_mark/order_mark?orderId="+id
  515. })
  516. },
  517. /*
  518. * @Explain:选项卡点击切换
  519. */
  520. changeTab(Inv) {
  521. console.log(Inv)
  522. var that = this;
  523. this.Inv =Inv
  524. var arr = [];
  525. this.getOrderPage(this.Inv)
  526. that.room.map(item => {//遍历真实数据,拿到所需要的数据放在页面数据tlist中,展示在页面上
  527. if(item.orderStatu == this.Inv){
  528. arr.push(item);
  529. }
  530. })
  531. that.troom = arr;
  532. // if(this.Inv == 6){//获取全部数据
  533. // that.troom = that.room;
  534. // }
  535. //滚动到顶部
  536. uni.pageScrollTo({
  537. duration: 0, //过渡时间必须为0,否则运行到手机会报错
  538. scrollTop: 0 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离(如res.top - data.top)
  539. })
  540. },
  541. // 倒计时
  542. timeup(createTime) {
  543. var that = this;
  544. /**setInterval间歇调用 */
  545. that.timer = setInterval(function () {
  546. //订单下单时间
  547. var buy_time = createTime;
  548. //计算剩余下单时间
  549. var time = (new Date(buy_time).getTime() + 10* 60 * 1000) - (new Date().getTime());
  550. if(time>0){
  551. //计算剩余的分钟
  552. var minutes = parseInt(time / 1000 / 60 % 60, 10);
  553. //计算剩余的秒数
  554. var seconds = parseInt(time / 1000 % 60, 10);
  555. that.timeupSecond=parseInt(time / 1000);
  556. // console.log(that.timeupSecond)
  557. //判断分钟和秒数小于10要在前面加个0.
  558. if(minutes<10){
  559. minutes = '0' + minutes;
  560. }
  561. if (seconds < 10) {
  562. seconds = '0' + seconds;
  563. }
  564. var timer = minutes + ":" + seconds;
  565. }
  566. }, 1000);
  567. if(that.timeupSecond==0) {
  568. uni.showToast({
  569. title: '时间到'
  570. })
  571. this.getOrderPage()
  572. }
  573. // this.timeupSecond = 0
  574. },
  575. // 跳转到订单详情
  576. navigateToOrderMark(id) {
  577. // console.log(id)
  578. uni.navigateTo({
  579. url: "../order_mark/order_mark?orderId="+id,
  580. })
  581. },
  582. //办理续住弹窗
  583. navigateToXuzhu(){
  584. this.$refs.popup_xuzhu.open()
  585. },
  586. popupXuzhuClose() {
  587. this.$refs.popup_xuzhu.close()
  588. },
  589. // 续住里日期选择器弹窗
  590. openXuCalendar() {
  591. this.$refs.popup_xu.open()
  592. },
  593. changeXu(e) {
  594. console.log('1change 返回:', e)
  595. // 模拟动态打卡
  596. if (this.infoXu.selected.length > 5) return
  597. this.infoXu.selected.push({
  598. date: e.range.before,
  599. info: '到店'
  600. })
  601. this.infoXu.selected.push({
  602. date: e.range.after,
  603. info: '离店'
  604. })
  605. },
  606. },
  607. }
  608. </script>
  609. <style>
  610. @import url(./css/my_orderlist.css);
  611. </style>