my_orderlist.vue 22 KB

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