queryOrder.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="container">
  3. <view>
  4. <!-- #ifdef MP-WEIXIN -->
  5. <NavigateBar title="订单查询" control="back" bgcolor="#a09cc4"></NavigateBar>
  6. <!-- #endif -->
  7. <!-- #ifdef MP-ALIPAY -->
  8. <NavigateBar title="订单查询" bgcolor="#a09cc4"></NavigateBar>
  9. <!-- #endif -->
  10. </view>
  11. <view class="text-item">
  12. <u-input v-model="name" clearable type="text" prefixIcon="account" prefixIconStyle="font-size: 60rpx;"
  13. shape="circle" placeholder="请输入姓名"></u-input>
  14. </view>
  15. <view class="text-item">
  16. <u-input v-model="phone" clearable type="number" prefixIcon="phone" prefixIconStyle="font-size: 60rpx;"
  17. shape="circle" placeholder="请输入电话号码" maxlength="11"></u-input>
  18. </view>
  19. <view class="btn">
  20. <u-button text="点击查询" color="#9e97c3" @click="gotoQueryOrderResult"></u-button>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. mapState,
  27. mapMutations
  28. } from 'vuex'
  29. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  30. export default {
  31. components: {
  32. NavigateBar
  33. },
  34. data() {
  35. return {
  36. name: '',
  37. phone: '',
  38. orderList: []
  39. };
  40. },
  41. computed: {
  42. ...mapState('m_user', ['userInfo']),
  43. ...mapState('m_business', ['currentHotel'])
  44. },
  45. methods: {
  46. ...mapMutations('m_business', ['updateReservationInfo', 'updateQueryOrderResult']),
  47. async gotoQueryOrderResult() {
  48. this.orderList = []
  49. if (!this.name && !this.phone) {
  50. uni.$showMsg('请填写信息!')
  51. return
  52. }
  53. let res = await uni.$http.post('/hotelOrder/queryByCondition', {
  54. name: this.name,
  55. phone: this.phone,
  56. hotelId: this.currentHotel.hotelId,
  57. deleted: false,
  58. status: 'ROOM_SELECTED',
  59. outDated: false,
  60. orderSource: 'PMS_GREEN_CLOUD',
  61. pageNo: 1,
  62. pageSize: 99
  63. })
  64. this.orderList = res.data.data.records
  65. if (this.orderList.length > 0) {
  66. this.orderList.forEach((order) => {
  67. order.isResv = true
  68. })
  69. this.updateQueryOrderResult(this.orderList)
  70. uni.navigateTo({
  71. url: '/subpkg_checkin/queryOrderResult/queryOrderResult'
  72. })
  73. } else {
  74. uni.$showMsg('未查询到预定信息!')
  75. }
  76. }
  77. },
  78. onLoad() {
  79. // this.name = this.userInfo.name
  80. },
  81. // #ifdef MP-WEIXIN
  82. onShareAppMessage(info) {
  83. return {
  84. title: '源享住',
  85. path: 'pages/login/login',
  86. imageUrl: "/static/logo.png"
  87. }
  88. }
  89. // #endif
  90. }
  91. </script>
  92. <style>
  93. page {
  94. background-color: #EFEFF4;
  95. }
  96. </style>
  97. <style lang="less" scoped>
  98. .container {
  99. display: flex;
  100. flex-direction: column;
  101. .text-item {
  102. width: 90vw;
  103. margin: 20rpx 40rpx 0;
  104. background-color: #FFFFFF;
  105. border-radius: 38rpx;
  106. }
  107. .btn {
  108. bottom: 340rpx;
  109. left: 40rpx;
  110. right: 40rpx;
  111. position: fixed;
  112. }
  113. }
  114. </style>