lockInfo.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <view>
  3. <view class="page-role" v-if="!loading">
  4. <img class="img" src="@/assets/img/nonwhitelist/info.png" alt="">
  5. <view class="text1">{{permission?'暂无权限':'加载中...'}}</view>
  6. <view class="text2" v-if="permission" >此车位仅限车主及白名单用户使用</view>
  7. <view class="botton" v-if="permission">返回首页</view>
  8. </view>
  9. <view class="jpmain " v-else >
  10. <view class="gradient-header">
  11. <view class="jpback">
  12. </view>
  13. </view>
  14. <view class="page-top" v-if="id">
  15. <view class="name" v-if="floorlockInfo.status==0">
  16. <img class="img" src="@/assets/img/lockInfo/info1.png" alt="">
  17. </view>
  18. <view class="name" v-if="floorlockInfo.status==1">
  19. <img class="img img2" src="@/assets/img/lockInfo/info2.png" alt="">
  20. </view>
  21. <view class="name" v-if="floorlockInfo.status==2">
  22. <img class="img" src="@/assets/img/parkingDetails/item4.png" alt="">
  23. </view>
  24. <view class="value">
  25. {{floorlockInfo.status==0?'未降锁':''}}
  26. {{floorlockInfo.status==1?'使用中':''}}
  27. {{floorlockInfo.status==2?'异常':''}}
  28. </view>
  29. </view>
  30. <view class="body">
  31. <view class="page" v-if="id">
  32. <view class="page-main">
  33. <view class="name">
  34. {{floorlockInfo.name}}<span class="tag">{{floorlockInfo.typeN}}</span>
  35. </view>
  36. <view class="value" @click="operateBtn">
  37. <view class="jpbutton jpbutton1"
  38. v-if="floorlockInfo.status==0" >
  39. <img class="img" src="@/assets/img/button/lock.png" alt="">
  40. 降锁
  41. </view>
  42. <view class="jpbutton jpbutton4" v-if="floorlockInfo.status==1">
  43. 使用中
  44. </view>
  45. <view class="jpbutton jpbutton5" v-if="floorlockInfo.status==2">
  46. 异常
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="page">
  52. <view class="page-content">
  53. <view class="tip1">
  54. <view class="tip-title">温馨提示</view>
  55. <view class="step">
  56. 1、微信扫描位于充电桩立柱或站内墙面上的二维码。
  57. </view>
  58. <view class="step">
  59. 2、选择空闲车位。
  60. </view>
  61. <view class="step">
  62. 3、选择需要降锁的车位,点击“降锁”按钮。
  63. </view>
  64. <view class="step">
  65. 4、降锁完成后提示操作完成,并提示尽快停车。
  66. </view>
  67. </view>
  68. <view class="tip2">
  69. <view class="tip-title">温馨提示</view>
  70. <view class="step">1、顺利降锁后有三分钟时间,请及时就位;超时地锁自动升起,请重新扫码降锁。</view>
  71. <view class="step">2、请按降锁流程说明停车,严禁使用外力降锁。</view>
  72. <view class="step">3、地锁服务热线 400-0000-000</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import * as API from '@/apis/pagejs/index.js'
  82. export default {
  83. data() {
  84. return {
  85. id: "",
  86. loading:false,
  87. permission:false,
  88. floorlockInfo: {},
  89. setIntervalId:"",
  90. }
  91. },
  92. onLoad(op) {
  93. if (op.id) {
  94. this.id = op.id
  95. uni.setNavigationBarTitle({
  96. title: "加载中..."
  97. })
  98. this.getFloorlockDetails()
  99. } else {
  100. this.loading=true
  101. uni.setNavigationBarTitle({
  102. title: "降锁说明"
  103. })
  104. }
  105. },
  106. onReady() {
  107. this.setIntervalId=setInterval(()=>{
  108. this.getFloorlockDetails(1)
  109. },1000*5)
  110. },
  111. onUnload() {
  112. //setInterval
  113. if(this.setIntervalId){
  114. clearInterval(this.setIntervalId)
  115. }
  116. },
  117. methods: {
  118. operateBtn(){
  119. uni.showLoading({
  120. title: "加载中",
  121. mask: true,
  122. })
  123. var obj={
  124. id:this.id
  125. }
  126. API.operateFloorlock(obj).then((res) => {
  127. uni.hideLoading();
  128. this.getFloorlockDetails()
  129. }).catch(error => {
  130. uni.hideLoading();
  131. uni.showToast({
  132. title: error,
  133. icon: "none"
  134. })
  135. })
  136. },
  137. getFloorlockDetails(bl) {
  138. if(!this.id){
  139. return
  140. }
  141. if(!bl){
  142. uni.showLoading({
  143. title: "加载中",
  144. mask: true,
  145. })
  146. }
  147. var obj = {
  148. id: this.id
  149. }
  150. API.floorlockDetails(obj).then((res) => {
  151. this.floorlockInfo = res.data.floorlockInfo
  152. if(this.floorlockInfo.type==1){
  153. uni.setNavigationBarTitle({
  154. title: this.floorlockInfo.parkingName
  155. })
  156. this.loading=true
  157. }else{
  158. this.permission=true
  159. }
  160. if(!bl){
  161. uni.hideLoading();
  162. }
  163. }).catch(error => {
  164. uni.hideLoading();
  165. uni.showToast({
  166. title: error,
  167. icon: "none"
  168. })
  169. })
  170. }
  171. },
  172. }
  173. </script>
  174. <style>
  175. page {
  176. /* //background-color: rgba(242, 244, 246, 1); */
  177. }
  178. </style>
  179. <style scoped lang="scss">
  180. /* styles.css */
  181. .page-role {
  182. padding-top: 120rpx;
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. .img {
  187. width: 500rpx;
  188. height: 500rpx;
  189. }
  190. .text1 {
  191. color: rgba(51, 51, 51, 1);
  192. font-weight: bold;
  193. font-size: 48rpx;
  194. margin-bottom: 16rpx;
  195. }
  196. .text2 {
  197. color: rgba(51, 51, 51, 1);
  198. font-size: 36rpx;
  199. margin-bottom: 200rpx;
  200. }
  201. .botton {
  202. border-radius: 100rpx;
  203. width: 360rpx;
  204. text-align: center;
  205. border: 1px solid rgba(187, 187, 187, 1);
  206. color: rgba(22, 119, 255, 1);
  207. padding: 16rpx;
  208. }
  209. }
  210. .body {
  211. padding: 32rpx;
  212. }
  213. .gradient-header {
  214. height: 0px;
  215. }
  216. .jpback {
  217. height: 400rpx;
  218. background: linear-gradient(180deg, rgba(203, 234, 255, 1) 0%, rgba(203, 234, 255, 0) 100%);
  219. }
  220. .page-top {
  221. padding: 40rpx;
  222. padding-top: 120rpx;
  223. display: flex;
  224. flex-direction: column;
  225. align-items: center;
  226. .name {
  227. width: 320rpx;
  228. height: 320rpx;
  229. display: flex;
  230. align-items: flex-end;
  231. .img {
  232. width: 320rpx;
  233. height: 320rpx;
  234. }
  235. .img2 {
  236. width: 320rpx;
  237. height: 140rpx;
  238. }
  239. }
  240. .value {
  241. margin-top: 24rpx;
  242. font-size: 40rpx;
  243. font-weight: bold;
  244. color: #333333;
  245. }
  246. }
  247. .page {
  248. border-radius: 16rpx;
  249. background-color: rgba(255, 255, 255, 1);
  250. color: rgba(16, 16, 16, 1);
  251. padding: 32rpx;
  252. margin-bottom: 32rpx;
  253. font-size: 32rpx;
  254. color: rgb(16, 16, 16);
  255. .page-main {
  256. display: flex;
  257. justify-content: space-between;
  258. align-items: center;
  259. .name {
  260. color: rgba(51, 51, 51, 1);
  261. font-size: 36rpx;
  262. display: flex;
  263. align-items: center;
  264. .tag {
  265. margin-left: 8rpx;
  266. color: rgba(119, 119, 119, 1);
  267. border-radius: 8rpx;
  268. padding: 1px 4rpx;
  269. font-size: 24rpx;
  270. border: 1px solid rgba(187, 187, 187, 1);
  271. }
  272. }
  273. }
  274. .page-content {
  275. .step {
  276. margin-bottom: 16rpx;
  277. }
  278. .tip-title {
  279. color: #101010;
  280. font-size: 36rpx;
  281. font-weight: bold;
  282. margin-bottom: 24rpx;
  283. }
  284. .tip1 {
  285. .step {
  286. color: #101010
  287. }
  288. border-bottom: 1px solid rgba(241, 241, 241, 1);
  289. margin-bottom: 24rpx;
  290. padding-bottom: 8rpx;
  291. }
  292. .tip2 {
  293. .step {
  294. color: #333333
  295. }
  296. }
  297. }
  298. }
  299. .jpbutton {
  300. border-radius: 100rpx;
  301. width: 160rpx;
  302. color: #fff;
  303. padding: 8rpx;
  304. display: flex;
  305. align-items: center;
  306. justify-content: center;
  307. .img {
  308. margin-right: 8rpx;
  309. width: 32rpx;
  310. height: 32rpx;
  311. }
  312. }
  313. .jpbutton1 {
  314. background-color: #2979FF;
  315. .img {
  316. width: 32rpx;
  317. height: 32rpx;
  318. }
  319. }
  320. .jpbutton2 {
  321. background-color: #2979FF;
  322. .img {
  323. width: 40rpx;
  324. height: 40rpx;
  325. animation: spin 2s linear infinite;
  326. /* 添加无限旋转动画 */
  327. }
  328. /* 定义旋转动画 */
  329. @keyframes spin {
  330. from {
  331. transform: rotate(0deg);
  332. /* 起始角度 */
  333. }
  334. to {
  335. transform: rotate(360deg);
  336. /* 结束角度 */
  337. }
  338. }
  339. }
  340. .jpbutton3 {
  341. background-color: #00B962;
  342. }
  343. .jpbutton4 {
  344. background-color: #A7A2A2;
  345. }
  346. .jpbutton5 {
  347. background-color: red;
  348. }
  349. </style>