emergencyKey.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. <text class="tip">您还未入住!</text>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import { bluetooth } from "../../mixins/bluetoothMixin";
  77. import moment from "moment";
  78. import NavigateBar from "../../components/navigateBar/navigate-bar.vue";
  79. export default {
  80. mixins: [bluetooth],
  81. components: {
  82. NavigateBar
  83. },
  84. data() {
  85. return {};
  86. },
  87. methods: {
  88. preventOpenDoor() {
  89. uni.showModal({
  90. title: "温馨提示",
  91. content: "未获取到房间门锁设备信息,请稍后重试",
  92. });
  93. },
  94. formatDateTime(dateTime) {
  95. return moment(dateTime).format("YYYY年MM月DD日HH时mm分");
  96. },
  97. },
  98. // #ifdef MP-WEIXIN
  99. onShareAppMessage(info) {
  100. return {
  101. title: '源享住',
  102. path: 'pages/login/login',
  103. imageUrl: "/static/logo.png"
  104. }
  105. }
  106. // #endif
  107. };
  108. </script>
  109. <style lang="scss">
  110. page {
  111. background-color: #FFFFFF;
  112. .info {
  113. background: #F5F8FE;
  114. box-shadow: -6px 17px 21px 0px rgba(112, 152, 246, 0.14);
  115. margin-bottom: 200rpx;
  116. .title {
  117. display: flex;
  118. justify-content: space-between;
  119. padding: 0 40rpx;
  120. line-height: 80rpx;
  121. border-bottom: 2rpx solid #E0E8FB;
  122. }
  123. .checkin-info {
  124. margin: 20rpx auto;
  125. .checkin-info--item {
  126. display: flex;
  127. margin: 0 40rpx;
  128. .checkin-info--item--text {
  129. margin: 10rpx;
  130. margin-left: 0;
  131. }
  132. &:last-child {
  133. padding-bottom: 20rpx;
  134. }
  135. }
  136. }
  137. }
  138. .room__operate {
  139. height: 90rpx;
  140. display: flex;
  141. margin: 2*5rpx 2 * 15rpx;
  142. background-color: #9e97c3;
  143. align-items: center;
  144. justify-content: center;
  145. border-radius: 10rpx;
  146. .room__operate--display {
  147. height: 2 * 25rpx;
  148. margin: 5rpx;
  149. padding: 2 * 6rpx;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. width: 100%;
  154. .display__desc {
  155. height: 100%;
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. padding-left: 10rpx;
  160. font-size: 40rpx;
  161. color: #FFFFFF;
  162. font-size: 32rpx;
  163. }
  164. }
  165. }
  166. .not-reservation {
  167. display: flex;
  168. justify-content: center;
  169. height: 100%;
  170. text-align: center;
  171. vertical-align: 100rpx;
  172. .tip {
  173. padding-top: 40%;
  174. }
  175. }
  176. }
  177. </style>