123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <view>
- <view class="top">
- <!-- #ifdef MP-WEIXIN -->
- <NavigateBar title="手机开门" control="back" bgcolor="#a09cc4"></NavigateBar>
- <!-- #endif -->
- <!-- #ifdef MP-ALIPAY -->
- <NavigateBar title="手机开门" bgcolor="#a09cc4"></NavigateBar>
- <!-- #endif -->
- </view>
- <view v-if="Object.keys(checkinInfo).length > 0">
- <view class="info">
- <view class="title">
- <view class="hotel-name">
- <u-text :text="currentHotel.name" bold color="#333333" size="30rpx"></u-text>
- </view>
- <view class="tips">
- <u-text text="入住信息" color="#666666" size="24rpx"></u-text>
- </view>
- </view>
- <view class="checkin-info">
- <view class="checkin-info--item">
- <view class="checkin-info--item--text">
- <u-text text="所在楼层 : " color="#999999" size="26rpx"></u-text>
- </view>
- <view class="checkin-info--item--text">
- <u-text :text="checkinInfo.floor+'楼'" color="#999999" size="26rpx"></u-text>
- </view>
- </view>
- <view class="checkin-info--item">
- <view class="checkin-info--item--text">
- <u-text text="房间信息 : " color="#999999" size="26rpx"></u-text>
- </view>
- <view class="checkin-info--item--text">
- <u-text :text="checkinInfo.room+'楼'" color="#999999" size="26rpx"></u-text>
- </view>
- </view>
- <view class="checkin-info--item">
- <view class="checkin-info--item--text">
- <u-text text="起始时间 : " color="#999999" size="26rpx"></u-text>
- </view>
- <view class="checkin-info--item--text">
- <u-text :text="formatDateTime(checkinInfo.startTime)" color="#999999" size="26rpx"></u-text>
- </view>
- </view>
- <view class="checkin-info--item">
- <view class="checkin-info--item--text">
- <u-text text="结束时间 : " color="#999999" size="26rpx"></u-text>
- </view>
- <view class="checkin-info--item--text">
- <u-text :text="formatDateTime(checkinInfo.endTime)" color="#999999" size="26rpx"></u-text>
- </view>
- </view>
- </view>
- </view>
- <view class="room__operate">
- <view v-if="allowedOpenDoor === 0" class="room__operate--display" @click="bluetoothOperate">
- <u-icon name="lock-open" color="#FFFFFF" size="25"></u-icon>
- <view class="display__desc">手机开门</view>
- </view>
- <view v-else-if="allowedOpenDoor === 1" class="room__operate--display">
- <u-loading-icon :show="isOpeningDoor" :text="loadingContent" color="#FFFFFF" textColor="#FFFFFF"></u-loading-icon>
- </view>
- <view v-else-if="allowedOpenDoor === 2" class="room__operate--display" @click="preventOpenDoor">
- <u-icon name="lock-open" color="#FFFFFF" size="30"></u-icon>
- <view class="display__desc">手机开门</view>
- </view>
- </view>
- </view>
- <view v-else class="not-reservation">
- <u-text class="tip" text="您还未入住!" align="center"></u-text>
- <u-text class="tip" text="若已退房或房间到期,请至前台办理" align="center"></u-text>
- </view>
- </view>
- </template>
- <script>
- import { bluetooth } from "../../mixins/bluetoothMixin";
- import moment from "moment";
- import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
- export default {
- mixins: [bluetooth],
- components: {
- NavigateBar
- },
- data() {
- return {};
- },
- methods: {
- preventOpenDoor() {
- uni.showModal({
- title: "温馨提示",
- content: "未获取到房间门锁设备信息,请稍后重试",
- });
- },
- formatDateTime(dateTime) {
- return moment(dateTime).format("YYYY年MM月DD日HH时mm分");
- },
- },
- // #ifdef MP-WEIXIN
- onShareAppMessage(info) {
- return {
- title: '源享住',
- path: 'pages/login/login',
- imageUrl: "/static/logo.png"
- }
- }
- // #endif
- };
- </script>
- <style lang="scss">
- page {
- background-color: #FFFFFF;
- .info {
- background: #F5F8FE;
- box-shadow: -6px 17px 21px 0px rgba(112, 152, 246, 0.14);
- margin-bottom: 200rpx;
- .title {
- display: flex;
- justify-content: space-between;
- padding: 0 40rpx;
- line-height: 80rpx;
- border-bottom: 2rpx solid #E0E8FB;
- }
- .checkin-info {
- margin: 20rpx auto;
- .checkin-info--item {
- display: flex;
- margin: 0 40rpx;
- .checkin-info--item--text {
- margin: 10rpx;
- margin-left: 0;
- }
- &:last-child {
- padding-bottom: 20rpx;
- }
- }
- }
- }
- .room__operate {
- height: 90rpx;
- display: flex;
- margin: 2*5rpx 2 * 15rpx;
- background-color: #9e97c3;
- align-items: center;
- justify-content: center;
- border-radius: 10rpx;
- .room__operate--display {
- height: 2 * 25rpx;
- margin: 5rpx;
- padding: 2 * 6rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- .display__desc {
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- padding-left: 10rpx;
- font-size: 40rpx;
- color: #FFFFFF;
- font-size: 32rpx;
- }
- }
- }
- }
- .not-reservation {
- margin-top: 40%;
- }
- </style>
|