123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <template>
- <view class="container">
- <view>
- <!-- #ifdef MP-WEIXIN -->
- <NavigateBar title="订单查询" control="back" bgcolor="#a09cc4"></NavigateBar>
- <!-- #endif -->
- <!-- #ifdef MP-ALIPAY -->
- <NavigateBar title="订单查询" bgcolor="#a09cc4"></NavigateBar>
- <!-- #endif -->
- </view>
- <view class="text-item">
- <u-input v-model="name" clearable type="text" prefixIcon="account" prefixIconStyle="font-size: 60rpx;"
- shape="circle" placeholder="请输入姓名"></u-input>
- </view>
- <view class="text-item">
- <u-input v-model="phone" clearable type="number" prefixIcon="phone" prefixIconStyle="font-size: 60rpx;"
- shape="circle" placeholder="请输入电话号码" maxlength="11"></u-input>
- </view>
- <view class="btn">
- <u-button text="点击查询" color="#9e97c3" @click="gotoQueryOrderResult"></u-button>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex'
- import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
- export default {
- components: {
- NavigateBar
- },
- data() {
- return {
- name: '',
- phone: '',
- orderList: []
- };
- },
- computed: {
- ...mapState('m_user', ['userInfo']),
- ...mapState('m_business', ['currentHotel'])
- },
- methods: {
- ...mapMutations('m_business', ['updateReservationInfo', 'updateQueryOrderResult']),
- async gotoQueryOrderResult() {
- this.orderList = []
- if (!this.name && !this.phone) {
- uni.$showMsg('请填写信息!')
- return
- }
- let res = await uni.$http.post('/order/reservation', {
- name: this.name,
- phone: this.phone,
- hotelId: this.currentHotel.hotelId,
- pageNo: 1,
- pageSize: 10
- })
- this.orderList = res.data.data.records
- if (this.orderList.length > 0) {
- this.updateQueryOrderResult(this.orderList)
- uni.navigateTo({
- url: '/subpkg_checkin/queryOrderResult/queryOrderResult'
- })
- } else {
- uni.$showMsg('未查询到预定信息!')
- }
- }
- },
- onLoad() {
- // this.name = this.userInfo.name
- },
- // #ifdef MP-WEIXIN
- onShareAppMessage(info) {
- return {
- title: '源享住',
- path: 'pages/login/login',
- imageUrl: "/static/logo.png"
- }
- }
- // #endif
- }
- </script>
- <style>
- page {
- background-color: #EFEFF4;
- }
- </style>
- <style lang="less" scoped>
- .container {
- display: flex;
- flex-direction: column;
- .text-item {
- width: 90vw;
- margin: 20rpx 40rpx 0;
- background-color: #FFFFFF;
- border-radius: 38rpx;
- }
- .btn {
- bottom: 340rpx;
- left: 40rpx;
- right: 40rpx;
- position: fixed;
- }
- }
- </style>
|