remoteOpen.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!-- 远程开门 -->
  2. <template>
  3. <view id="empowerOpen">
  4. <view class="page-one" v-if="pageType==1">
  5. <view class="header">
  6. <view class="header-n">
  7. <input class="header-l" type="text" v-model="getData.searchValue" placeholder="实验室名称">
  8. <view class="header-r" v-if="getData.searchValue" @click="clearSearch()" >
  9. <img src="@/pages/images/clear.png" />
  10. </view>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <view class="list-li">
  15. <view class="list-li-l">实验室名称(房间号)</view>
  16. <view class="list-li-r">开门</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="success" v-if="successVisible">
  21. <view class="null-box" @click="closeTip()"></view>
  22. <view class="panel">
  23. <img class="panel-t" v-if="authorizeStatus==1" src="@/pages/images/icon_kcxq_cg.png" />
  24. <img class="panel-t" v-if="authorizeStatus==2" src="@/pages/images/icon_kcxq_sb.png" />
  25. <view class="panel-m">{{authorizeStatus==1?'开门成功':'开门失败'}}</view>
  26. <view class="panel-b">({{count}}S)</view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. config
  34. } from '@/api/request/config.js'
  35. export default {
  36. components: {
  37. },
  38. data() {
  39. return {
  40. pageType: 1,
  41. baseUrl: config.base_url,
  42. getData:{
  43. searchValue:'',
  44. },
  45. newData: {
  46. },
  47. addForm:{
  48. },
  49. authorizeStatus:2,//1成功 2失败
  50. successVisible: false,
  51. timer: null,
  52. count: '',
  53. }
  54. },
  55. onLoad(option) {
  56. },
  57. onShow() {
  58. },
  59. methods: {
  60. clearSearch(){
  61. console.log(111)
  62. this.getData.searchValue='';
  63. },
  64. cancelClick(){
  65. },
  66. submitForm(){
  67. this.$set(this,'successVisible',true)
  68. this.getCode();
  69. },
  70. //关闭弹框倒计时
  71. getCode() {
  72. let self=this;
  73. const TIME_COUNT = 3;
  74. if (!this.timer) {
  75. this.count = TIME_COUNT;
  76. this.show = false;
  77. this.timer = setInterval(() => {
  78. if (this.count > 0 && this.count <= TIME_COUNT) {
  79. this.count -= 1;
  80. } else {
  81. self.successVisible=false;
  82. clearInterval(this.timer);
  83. this.timer = null;
  84. }
  85. }, 1000);
  86. }
  87. },
  88. closeTip() {
  89. this.$set(this, 'successVisible', false)
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="stylus" scoped>
  95. #empowerOpen {
  96. .page-one {
  97. .header {
  98. width: 749rpx;
  99. height: 120rpx;
  100. background: #FFFFFF;
  101. padding: 20rpx 30rpx;
  102. box-sizing: border-box;
  103. border-bottom: 1rpx solid #D8D8D8;
  104. .header-n{
  105. position: relative;
  106. width: 690rpx;
  107. height: 80rpx;
  108. border-radius: 10rpx 10rpx 10rpx 10rpx;
  109. border: 1rpx solid #E0E0E0;
  110. padding-left: 20rpx;
  111. box-sizing: border-box;
  112. .header-l {
  113. width: 630rpx;
  114. height: 80rpx;
  115. }
  116. .header-r{
  117. position: absolute;
  118. top: 0rpx;
  119. right: 0rpx;
  120. width: 68rpx;
  121. height: 80rpx;
  122. }
  123. }
  124. }
  125. .list {
  126. padding: 0 30rpx;
  127. box-sizing: border-box;
  128. background: #fff;
  129. .list-li {
  130. height: 90rpx;
  131. display: flex;
  132. justify-content: space-between;
  133. align-items: center;
  134. border-bottom: 1rpx solid #D8D8D8;
  135. .list-li-l {
  136. flex: 1;
  137. font-family: PingFang SC, PingFang SC;
  138. font-weight: 400;
  139. font-size: 30rpx;
  140. color: #333333;
  141. line-height: 42rpx;
  142. }
  143. .list-li-r {
  144. font-family: PingFang SC, PingFang SC;
  145. font-weight: 400;
  146. font-size: 28rpx;
  147. color: #0183FA;
  148. line-height: 39rpx;
  149. }
  150. }
  151. }
  152. }
  153. .success {
  154. height: 100%;
  155. width: 100%;
  156. position: fixed;
  157. top: 0;
  158. display: flex;
  159. flex-direction: column;
  160. z-index: 10;
  161. background: rgba(0, 0, 0, 0.2);
  162. .null-box {
  163. flex: 1;
  164. }
  165. .panel {
  166. width: 550rpx;
  167. height: 255rpx;
  168. background: #FFFFFF;
  169. border-radius: 20rpx 20rpx 20rpx 20rpx;
  170. position: absolute;
  171. top: 320rpx;
  172. left: 100rpx;
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. .panel-t{
  177. width: 80rpx;
  178. height: 80rpx;
  179. margin: 40rpx 0 18rpx 0;
  180. }
  181. .panel-m{
  182. font-family: PingFang SC, PingFang SC;
  183. font-weight: 400;
  184. font-size: 30rpx;
  185. color: #3D3D3D;
  186. line-height: 42rpx;
  187. margin-bottom: 8rpx;
  188. }
  189. .panel-b{
  190. font-family: PingFang SC, PingFang SC;
  191. font-weight: 400;
  192. font-size: 30rpx;
  193. color: #999999;
  194. line-height: 42rpx;
  195. }
  196. }
  197. }
  198. }
  199. </style>