queryOrder.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.updateQueryOrderResult(this.orderList)
  67. uni.navigateTo({
  68. url: '/subpkg_checkin/queryOrderResult/queryOrderResult'
  69. })
  70. } else {
  71. uni.$showMsg('未查询到预定信息!')
  72. }
  73. }
  74. },
  75. onLoad() {
  76. // this.name = this.userInfo.name
  77. },
  78. // #ifdef MP-WEIXIN
  79. onShareAppMessage(info) {
  80. return {
  81. title: '源享住',
  82. path: 'pages/login/login',
  83. imageUrl: "/static/logo.png"
  84. }
  85. }
  86. // #endif
  87. }
  88. </script>
  89. <style>
  90. page {
  91. background-color: #EFEFF4;
  92. }
  93. </style>
  94. <style lang="less" scoped>
  95. .container {
  96. display: flex;
  97. flex-direction: column;
  98. .text-item {
  99. width: 90vw;
  100. margin: 20rpx 40rpx 0;
  101. background-color: #FFFFFF;
  102. border-radius: 38rpx;
  103. }
  104. .btn {
  105. bottom: 340rpx;
  106. left: 40rpx;
  107. right: 40rpx;
  108. position: fixed;
  109. }
  110. }
  111. </style>