empowerOpen.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <!-- 授权开门 -->
  2. <template>
  3. <view id="empowerOpen">
  4. <view class="page-one" v-if="pageType==1">
  5. <view class="header">
  6. <input class="header-l" type="text" v-model="newData.subId" placeholder="实验室名称">
  7. </view>
  8. <view class="list">
  9. <view class="list-li">
  10. <view class="list-li-l">实验室名称(房间号)</view>
  11. <view class="list-li-r">授权</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="page-tow" v-if="pageType==2">
  16. <view class="list-tow">
  17. <view class="list-tow-li">
  18. <view class="list-tow-li-t">被授权人</view>
  19. <input class="list-tow-li-b" type="text" v-model="newData.subId" placeholder="">
  20. </view>
  21. <view class="list-tow-li">
  22. <view class="list-tow-li-t">生效时间</view>
  23. <view class="time">
  24. <view class="time-l">2024/02/04 12:23</view>
  25. <view class="time-c">-</view>
  26. <view class="time-r">2024/02/04 12:23</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="bottom">
  32. <view class="bottom-l" @click="cancelClick()">取消</view>
  33. <view class="bottom-r" @click="submitForm()">确定</view>
  34. </view>
  35. <view class="success" v-if="successVisible">
  36. <view class="null-box" @click="closeTip()"></view>
  37. <view class="panel">
  38. <img class="panel-t" v-if="authorizeStatus==1" src="@/pages/images/icon_kcxq_cg.png" />
  39. <img class="panel-t" v-if="authorizeStatus==2" src="@/pages/images/icon_kcxq_sb.png" />
  40. <view class="panel-m">{{authorizeStatus==1?'授权成功':'授权失败'}}</view>
  41. <view class="panel-b">({{count}}S)</view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. config
  49. } from '@/api/request/config.js'
  50. import {
  51. systemSubjectGetAppSubject
  52. } from '@/pages/api/index.js'
  53. export default {
  54. components: {
  55. },
  56. data() {
  57. return {
  58. pageType: 1,
  59. baseUrl: config.base_url,
  60. newData: {
  61. },
  62. addForm:{
  63. },
  64. getData:{
  65. searchValue:'',
  66. adminId:uni.getStorageSync('userId'),
  67. },
  68. dataList:[],
  69. authorizeStatus:2,//1成功 2失败
  70. successVisible: false,
  71. timer: null,
  72. count: '',
  73. }
  74. },
  75. onLoad(option) {
  76. },
  77. onShow() {
  78. },
  79. mounted() {
  80. this.systemSubjectGetAppSubject();
  81. },
  82. methods: {
  83. //获取实验室
  84. async systemSubjectGetAppSubject() {
  85. let self = this;
  86. const {
  87. data
  88. } = await systemSubjectGetAppSubject(this.getData);
  89. if (data.code == 200) {
  90. this.dataList=data.data;
  91. }
  92. },
  93. cancelClick(){
  94. },
  95. submitForm(){
  96. this.$set(this,'successVisible',true)
  97. this.getCode();
  98. },
  99. //关闭弹框倒计时
  100. getCode() {
  101. let self=this;
  102. const TIME_COUNT = 3;
  103. if (!this.timer) {
  104. this.count = TIME_COUNT;
  105. this.show = false;
  106. this.timer = setInterval(() => {
  107. if (this.count > 0 && this.count <= TIME_COUNT) {
  108. this.count -= 1;
  109. } else {
  110. self.successVisible=false;
  111. clearInterval(this.timer);
  112. this.timer = null;
  113. }
  114. }, 1000);
  115. }
  116. },
  117. closeTip() {
  118. this.$set(this, 'successVisible', false)
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="stylus" scoped>
  124. #empowerOpen {
  125. .page-one {
  126. .header {
  127. width: 749rpx;
  128. height: 120rpx;
  129. background: #FFFFFF;
  130. padding: 20rpx 30rpx;
  131. box-sizing: border-box;
  132. border-bottom: 1rpx solid #D8D8D8;
  133. .header-l {
  134. width: 690rpx;
  135. height: 80rpx;
  136. border-radius: 10rpx 10rpx 10rpx 10rpx;
  137. border: 1rpx solid #E0E0E0;
  138. padding: 20rpx;
  139. box-sizing: border-box;
  140. }
  141. }
  142. .list {
  143. padding: 0 30rpx;
  144. box-sizing: border-box;
  145. background: #fff;
  146. .list-li {
  147. height: 90rpx;
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. border-bottom: 1rpx solid #D8D8D8;
  152. .list-li-l {
  153. flex: 1;
  154. font-family: PingFang SC, PingFang SC;
  155. font-weight: 400;
  156. font-size: 30rpx;
  157. color: #333333;
  158. line-height: 42rpx;
  159. }
  160. .list-li-r {
  161. font-family: PingFang SC, PingFang SC;
  162. font-weight: 400;
  163. font-size: 28rpx;
  164. color: #0183FA;
  165. line-height: 39rpx;
  166. }
  167. }
  168. }
  169. }
  170. .page-tow {
  171. .list-tow {
  172. padding: 0 30rpx 50rpx;
  173. box-sizing: border-box;
  174. background: #fff;
  175. .list-tow-li {
  176. overflow: hidden;
  177. .list-tow-li-t {
  178. font-family: PingFang SC, PingFang SC;
  179. font-weight: 400;
  180. font-size: 30rpx;
  181. color: #333333;
  182. line-height: 42rpx;
  183. text-align: left;
  184. margin: 24rpx 0;
  185. }
  186. .list-tow-li-b {
  187. width: 690rpx;
  188. height: 80rpx;
  189. border-radius: 10rpx 10rpx 10rpx 10rpx;
  190. border: 1rpx solid #E0E0E0;
  191. }
  192. .time {
  193. display: flex;
  194. justify-content: flex-start;
  195. align-items: center;
  196. width: 690rpx;
  197. height: 80rpx;
  198. border-radius: 10rpx 10rpx 10rpx 10rpx;
  199. border: 1rpx solid #E0E0E0;
  200. .time-l {
  201. height: 80rpx;
  202. width: 324rpx;
  203. border-right: 1rpx solid #E0E0E0;
  204. font-family: PingFang SC, PingFang SC;
  205. font-weight: 400;
  206. font-size: 28rpx;
  207. color: #333333;
  208. line-height: 80rpx;
  209. text-align: center;
  210. }
  211. .time-c {
  212. height: 80rpx;
  213. width: 40rpx;
  214. text-align: center;
  215. line-height: 80rpx;
  216. }
  217. .time-r {
  218. height: 80rpx;
  219. width: 324rpx;
  220. background: #E0E0E0;
  221. border-left: 1rpx solid #E0E0E0;
  222. font-family: PingFang SC, PingFang SC;
  223. font-weight: 400;
  224. font-size: 28rpx;
  225. color: #333333;
  226. line-height: 80rpx;
  227. text-align: center;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. .bottom {
  234. display: flex;
  235. justify-content: space-between;
  236. position: fixed;
  237. bottom: 0;
  238. .bottom-l {
  239. width: 375rpx;
  240. height: 90rpx;
  241. background: #FFFFFF;
  242. font-family: PingFang SC, PingFang SC;
  243. font-weight: 400;
  244. font-size: 30rpx;
  245. color: #333333;
  246. line-height: 90rpx;
  247. text-align: center;
  248. }
  249. .bottom-r {
  250. font-family: PingFang SC, PingFang SC;
  251. font-weight: 400;
  252. font-size: 30rpx;
  253. color: #FFFFFF;
  254. line-height: 90rpx;
  255. text-align: center;
  256. width: 375rpx;
  257. height: 90rpx;
  258. background: #0183FA;
  259. }
  260. }
  261. .success {
  262. height: 100%;
  263. width: 100%;
  264. position: fixed;
  265. top: 0;
  266. display: flex;
  267. flex-direction: column;
  268. z-index: 10;
  269. background: rgba(0, 0, 0, 0.2);
  270. .null-box {
  271. flex: 1;
  272. }
  273. .panel {
  274. width: 550rpx;
  275. height: 255rpx;
  276. background: #FFFFFF;
  277. border-radius: 20rpx 20rpx 20rpx 20rpx;
  278. position: absolute;
  279. top: 320rpx;
  280. left: 100rpx;
  281. display: flex;
  282. flex-direction: column;
  283. align-items: center;
  284. .panel-t{
  285. width: 80rpx;
  286. height: 80rpx;
  287. margin: 40rpx 0 18rpx 0;
  288. }
  289. .panel-m{
  290. font-family: PingFang SC, PingFang SC;
  291. font-weight: 400;
  292. font-size: 30rpx;
  293. color: #3D3D3D;
  294. line-height: 42rpx;
  295. margin-bottom: 8rpx;
  296. }
  297. .panel-b{
  298. font-family: PingFang SC, PingFang SC;
  299. font-weight: 400;
  300. font-size: 30rpx;
  301. color: #999999;
  302. line-height: 42rpx;
  303. }
  304. }
  305. }
  306. }
  307. </style>