emergencyKey.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <view v-if="Object.keys(checkinInfo).length > 0">
  4. <uni-card :title="checkinInfo.hotelName" extra="入住信息" note="Tips">
  5. <view class="card-item" v-if="checkinInfo.building">
  6. <view class="card-item-left">
  7. <text>所属楼栋:</text>
  8. </view>
  9. <text>{{ checkinInfo.building }}</text>
  10. </view>
  11. <view class="card-item">
  12. <view class="card-item-left">
  13. <text>所在楼层:</text>
  14. </view>
  15. <text>{{ checkinInfo.floor }}</text>
  16. </view>
  17. <view class="card-item">
  18. <view class="card-item-left">
  19. <text>房间信息:</text>
  20. </view>
  21. <text>{{ checkinInfo.room }}</text>
  22. </view>
  23. <view class="card-item">
  24. <view class="card-item-left">
  25. <text>起始时间:</text>
  26. </view>
  27. <text>{{ checkinInfo.startTime }}\n</text>
  28. </view>
  29. <view class="card-item">
  30. <view class="card-item-left">
  31. <text>结束时间:</text>
  32. </view>
  33. <text>{{ checkinInfo.endTime }}</text>
  34. </view>
  35. </uni-card>
  36. <view class="room__operate">
  37. <view>
  38. <view
  39. v-if="allowedOpenDoor === 0"
  40. class="room__operate--display"
  41. @click="bluetoothOperate"
  42. >
  43. <u-icon name="lock-open" color="#2979ff" size="70"></u-icon>
  44. <view class="display__desc">手机开门</view>
  45. </view>
  46. <view
  47. v-else-if="allowedOpenDoor === 1"
  48. class="room__operate--display"
  49. >
  50. <u-loading-icon
  51. :show="isOpeningDoor"
  52. :text="loadingContent"
  53. ></u-loading-icon>
  54. </view>
  55. <view
  56. v-else-if="allowedOpenDoor === 2"
  57. class="room__operate--display"
  58. @click="preventOpenDoor"
  59. >
  60. <u-icon name="lock-open" color="#2979ff" size="40"></u-icon>
  61. <view class="display__desc">手机开门</view>
  62. </view>
  63. </view>
  64. <!-- <view class="room__operate--display" @click="customerService">
  65. <u-icon name="kefu-ermai" color="#2979ff" size="40"></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. export default {
  78. mixins: [bluetooth],
  79. data() {
  80. return {};
  81. },
  82. methods: {
  83. customerService() {
  84. uni.showModal({
  85. title: "联系客服",
  86. content: "将要拨打客服电话:18888888888",
  87. success: (res) => {
  88. if (res.confirm) {
  89. uni.makePhoneCall({
  90. phoneNumber: "18888888888", //仅为示例
  91. });
  92. }
  93. },
  94. });
  95. },
  96. preventOpenDoor() {
  97. uni.showModal({
  98. title: "温馨提示",
  99. content: "未获取到房间门锁设备信息,请稍后重试",
  100. });
  101. },
  102. },
  103. };
  104. </script>
  105. <style lang="scss">
  106. .card-item {
  107. margin-bottom: 40rpx;
  108. display: flex;
  109. .card-item-left {
  110. width: 140rpx;
  111. }
  112. }
  113. .completeBtn {
  114. left: 80rpx;
  115. right: 80rpx;
  116. bottom: 160rpx;
  117. position: fixed;
  118. background-color: #0081ff;
  119. color: #ffffff;
  120. }
  121. .gobackBtn {
  122. left: 80rpx;
  123. right: 80rpx;
  124. bottom: 40rpx;
  125. position: fixed;
  126. background-color: #0081ff;
  127. color: #ffffff;
  128. }
  129. .not-reservation {
  130. display: flex;
  131. justify-content: center;
  132. height: 100%;
  133. text-align: center;
  134. vertical-align: 100rpx;
  135. }
  136. .tip {
  137. padding-top: 40%;
  138. }
  139. .room__operate {
  140. display: flex;
  141. border-radius: 2 * 5rpx;
  142. margin: 4rpx 30rpx;
  143. padding: 10rpx 70rpx 10rpx 10rpx;
  144. background-color: #ffffff;
  145. align-items: center;
  146. justify-content: center;
  147. .room__operate--display {
  148. width: 100%;
  149. height: 2 * 85rpx;
  150. margin: 2 * 5rpx;
  151. padding: 2 * 5rpx;
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. border: 3px solid #ffffff;
  156. background-color: #ffffff;
  157. border-radius: 2 * 5rpx;
  158. .display__desc {
  159. width: 300rpx;
  160. height: 100%;
  161. display: flex;
  162. align-items: center;
  163. justify-content: start;
  164. font-size: 70rpx;
  165. }
  166. }
  167. }
  168. </style>