emergencyKey.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="top">
  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 v-if="Object.keys(checkinInfo).length > 0">
  12. <view class="info">
  13. <view class="title">
  14. <view class="hotel-name">
  15. <u-text :text="currentHotel.name" bold color="#333333" size="30rpx"></u-text>
  16. </view>
  17. <view class="tips">
  18. <u-text text="入住信息" color="#666666" size="24rpx"></u-text>
  19. </view>
  20. </view>
  21. <view class="checkin-info">
  22. <view class="checkin-info--item">
  23. <view class="checkin-info--item--text">
  24. <u-text text="所在楼层 : " color="#999999" size="26rpx"></u-text>
  25. </view>
  26. <view class="checkin-info--item--text">
  27. <u-text :text="checkinInfo.floor+'楼'" color="#999999" size="26rpx"></u-text>
  28. </view>
  29. </view>
  30. <view class="checkin-info--item">
  31. <view class="checkin-info--item--text">
  32. <u-text text="房间信息 : " color="#999999" size="26rpx"></u-text>
  33. </view>
  34. <view class="checkin-info--item--text">
  35. <u-text :text="checkinInfo.room+'楼'" color="#999999" size="26rpx"></u-text>
  36. </view>
  37. </view>
  38. <view class="checkin-info--item">
  39. <view class="checkin-info--item--text">
  40. <u-text text="起始时间 : " color="#999999" size="26rpx"></u-text>
  41. </view>
  42. <view class="checkin-info--item--text">
  43. <u-text :text="formatDateTime(checkinInfo.startTime)" color="#999999" size="26rpx"></u-text>
  44. </view>
  45. </view>
  46. <view class="checkin-info--item">
  47. <view class="checkin-info--item--text">
  48. <u-text text="结束时间 : " color="#999999" size="26rpx"></u-text>
  49. </view>
  50. <view class="checkin-info--item--text">
  51. <u-text :text="formatDateTime(checkinInfo.endTime)" color="#999999" size="26rpx"></u-text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="room__operate">
  57. <view v-if="allowedOpenDoor === 0" class="room__operate--display" @click="bluetoothOperate">
  58. <u-icon name="lock-open" color="#FFFFFF" size="25"></u-icon>
  59. <view class="display__desc">手机开门</view>
  60. </view>
  61. <view v-else-if="allowedOpenDoor === 1" class="room__operate--display">
  62. <u-loading-icon :show="isOpeningDoor" :text="loadingContent" color="#FFFFFF" textColor="#FFFFFF"></u-loading-icon>
  63. </view>
  64. <view v-else-if="allowedOpenDoor === 2" class="room__operate--display" @click="preventOpenDoor">
  65. <u-icon name="lock-open" color="#FFFFFF" size="30"></u-icon>
  66. <view class="display__desc">手机开门</view>
  67. </view>
  68. </view>
  69. </view>
  70. <view v-else class="not-reservation">
  71. <u-text class="tip" text="您还未入住!" align="center"></u-text>
  72. <u-text class="tip" text="若已退房或房间到期,请至前台办理" align="center"></u-text>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import { bluetooth } from "../../mixins/bluetoothMixin";
  78. import moment from "moment";
  79. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  80. export default {
  81. mixins: [bluetooth],
  82. components: {
  83. NavigateBar
  84. },
  85. data() {
  86. return {};
  87. },
  88. methods: {
  89. preventOpenDoor() {
  90. uni.showModal({
  91. title: "温馨提示",
  92. content: "未获取到房间门锁设备信息,请稍后重试",
  93. });
  94. },
  95. formatDateTime(dateTime) {
  96. return moment(dateTime).format("YYYY年MM月DD日HH时mm分");
  97. },
  98. },
  99. // #ifdef MP-WEIXIN
  100. onShareAppMessage(info) {
  101. return {
  102. title: '源享住',
  103. path: 'pages/login/login',
  104. imageUrl: "/static/logo.png"
  105. }
  106. }
  107. // #endif
  108. };
  109. </script>
  110. <style lang="scss">
  111. page {
  112. background-color: #FFFFFF;
  113. .info {
  114. background: #F5F8FE;
  115. box-shadow: -6px 17px 21px 0px rgba(112, 152, 246, 0.14);
  116. margin-bottom: 200rpx;
  117. .title {
  118. display: flex;
  119. justify-content: space-between;
  120. padding: 0 40rpx;
  121. line-height: 80rpx;
  122. border-bottom: 2rpx solid #E0E8FB;
  123. }
  124. .checkin-info {
  125. margin: 20rpx auto;
  126. .checkin-info--item {
  127. display: flex;
  128. margin: 0 40rpx;
  129. .checkin-info--item--text {
  130. margin: 10rpx;
  131. margin-left: 0;
  132. }
  133. &:last-child {
  134. padding-bottom: 20rpx;
  135. }
  136. }
  137. }
  138. }
  139. .room__operate {
  140. height: 90rpx;
  141. display: flex;
  142. margin: 2*5rpx 2 * 15rpx;
  143. background-color: #9e97c3;
  144. align-items: center;
  145. justify-content: center;
  146. border-radius: 10rpx;
  147. .room__operate--display {
  148. height: 2 * 25rpx;
  149. margin: 5rpx;
  150. padding: 2 * 6rpx;
  151. display: flex;
  152. align-items: center;
  153. justify-content: center;
  154. width: 100%;
  155. .display__desc {
  156. height: 100%;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. padding-left: 10rpx;
  161. font-size: 40rpx;
  162. color: #FFFFFF;
  163. font-size: 32rpx;
  164. }
  165. }
  166. }
  167. }
  168. .not-reservation {
  169. margin-top: 40%;
  170. }
  171. </style>