main.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <view>
  3. <componentLogin ref="refLogin"
  4. @findByOpenId="findByOpenId" @findByOpenIdErr="findByOpenIdErr"></componentLogin>
  5. <view v-show="isReady" class="isReady">
  6. <view class="gradient-header">
  7. <view class="jpback">
  8. </view>
  9. </view>
  10. <view v-show="floorlockInfo.id" class="isReady_1">
  11. <lockInfo ref="lockInfoRef"></lockInfo>
  12. </view>
  13. <view v-show="!floorlockInfo.id" class="isReady_2">
  14. <view class="page-top" >
  15. <view class="name">
  16. <img class="img" src="@/assets/img/lockstatus/index0.svg" alt="">
  17. </view>
  18. <view class=" value r2text" >
  19. <view class="r2text1">暂无地锁</view>
  20. <view class="r2text2">您尚未绑定地锁或未被授权使用地锁</view>
  21. </view>
  22. <view class="valuebutton" >
  23. <view class="jpbutton jpbutton1" @click="gotobindLock()">
  24. <u-icon name="scan" label="绑定新地锁" color="#fff" label-color="#fff"
  25. label-size="36"></u-icon>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-modal v-model="loginBl" @confirm="loginconfirm" :show-cancel-button="true"
  32. ref="uModal" title="提示" content="当前用户未登录,是否前往登录" confirm-text="登录"></u-modal>
  33. <tabbar ></tabbar>
  34. </view>
  35. </template>
  36. <script>
  37. import componentLogin from '@/components/componentLogin.vue';
  38. import tabbar from '@/pages/business/as-components/Tabbar.vue';
  39. import lockInfo from '@/pages/business/as-components/componentLockInfo.vue';
  40. import * as API from '@/apis/pagejs/pagesIndex.js'
  41. export default {
  42. components: {
  43. componentLogin,
  44. tabbar,
  45. lockInfo
  46. //'u-collapse-item': () => import('@/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item'),
  47. //'u-collapse': () => import('@/uni_modules/uview-ui/components/u-collapse/u-collapse'),
  48. },
  49. data() {
  50. return {
  51. isBack:false,
  52. isMy:0,
  53. showtabbar:false,
  54. isReady: false,
  55. id: "",
  56. opid:"",
  57. whiteList: [],
  58. list: [],
  59. mylist: [],
  60. loginBl: false,
  61. floorlockInfo: {
  62. lockStatusN: ""
  63. },
  64. itemList: [{
  65. head: "操作指南",
  66. body: "点击“降锁”按钮,等待地锁降下后系统会提示降锁成功,此时即可将车辆驶入指定车位。",
  67. open: true,
  68. disabled: true
  69. },{
  70. head: "温馨提示",
  71. body: "1、成功降锁后请于三分钟内将车辆驶入指定车位;超时地锁会自动升起,需重新扫码降锁;2、请按降锁流程说明停车,严禁使用外力降锁;3、地锁服务热线 400-8899-619。",
  72. open: false,
  73. }],
  74. content: "400-8899-619",
  75. setIntervalId: "",
  76. userInfo:{},
  77. userInfoPlus:{
  78. whiteList:[],
  79. myAllList:[]
  80. },
  81. showMessage: 0,
  82. openLockBl:false,
  83. closeLockBl:false,
  84. openModalBl: false,
  85. formX:0,
  86. loginBl: false,
  87. }
  88. },
  89. onLoad(op) {
  90. this.userInfo = this.jphelp.getPersonInfo()
  91. this.userInfoPlus=this.jphelp.getPersonInfoPlus()
  92. if(this.userInfo.id){
  93. }
  94. //this.lockInfoOnLoad()
  95. },
  96. onShow(){
  97. //
  98. },
  99. onReady() {
  100. this.$refs.refLogin.findByOpenId()
  101. },
  102. onShareTimeline(){
  103. return {
  104. title: '智泊e家',
  105. }
  106. },
  107. onShareAppMessage(res) {
  108. return {
  109. title: '智泊e家',
  110. }
  111. },
  112. methods: {
  113. loginconfirm(){
  114. this.$refs.refLogin.ashow()
  115. },
  116. gotobindLock(){
  117. if(!this.jphelp.getPersonInfo().id){
  118. this.loginBl=true;
  119. return
  120. }
  121. uni.navigateTo({
  122. url:'/pages/mylock/bindLock'
  123. })
  124. },
  125. findByOpenIdErr(){
  126. this.isReady=1
  127. },
  128. findByOpenId(res) {
  129. this.getFloorlockList()
  130. },
  131. confirmPhone() {
  132. this.openModalBl = false;
  133. uni.makePhoneCall({
  134. phoneNumber: this.content //仅为示例
  135. });
  136. },
  137. lockStatus3(){
  138. uni.showToast({
  139. title: "下降中...",
  140. icon: "none"
  141. })
  142. },
  143. lockStatus0(){
  144. this.openModalBl=true;
  145. },
  146. loginconfirm(){
  147. this.$refs.refLogin.ashow()
  148. },
  149. gotoMain(){
  150. uni.reLaunch({
  151. url:"/pages/business/index"
  152. })
  153. },
  154. operateBtn() {
  155. if(!this.jphelp.getPersonInfo().id){
  156. this.loginBl=true;
  157. }else if(this.floorlockInfo.status==0){
  158. this.lockStatus0()
  159. }else{
  160. if(this.floorlockInfo.lockStatus==4){
  161. this.lockStatus0() //异常
  162. }else if(this.floorlockInfo.lockStatus==1){
  163. //this.lockStatus1() //未使用
  164. this.openLockBl=true;
  165. }else if(this.floorlockInfo.lockStatus==2){
  166. //this.lockStatus2()
  167. //this.closeLockBl=true;
  168. //使用
  169. }else if(this.floorlockInfo.lockStatus==3){
  170. this.lockStatus3() //过程
  171. }
  172. }
  173. },
  174. getFloorlockList() {
  175. uni.showLoading({
  176. title: "加载中",
  177. mask: true,
  178. })
  179. this.list = []
  180. API.myParkingSpot().then((res) => {
  181. this.mylist = res.data.floorList
  182. for(var i in this.mylist){
  183. var item=this.mylist[i]
  184. if(item.id==this.id){
  185. this.isMy=1
  186. }
  187. }
  188. this.whiteList = res.data.whiteList
  189. if(this.mylist.length){
  190. this.id = this.mylist[0].id
  191. this.getFloorlockDetails()
  192. }else if(this.whiteList.length){
  193. this.id = this.whiteList[0].id
  194. this.getFloorlockDetails()
  195. }else{
  196. this.isReady=1
  197. }
  198. uni.hideLoading();
  199. }).catch(error => {
  200. uni.hideLoading();
  201. uni.showToast({
  202. title: error,
  203. icon: "none"
  204. })
  205. })
  206. },
  207. getFloorlockDetails(bl) {
  208. if (!this.id) {
  209. return
  210. }
  211. if (!bl) {
  212. uni.showLoading({
  213. title: "加载中",
  214. mask: true,
  215. })
  216. }
  217. var obj = {
  218. id: this.id
  219. }
  220. this.isBack=false
  221. API.floorlockDetails(obj).then((res) => {
  222. this.floorlockInfo = res.data.floorlockInfo
  223. this.isReady=1;
  224. this.$refs['lockInfoRef'].initRef(this.id,2)
  225. if (!bl) {
  226. uni.hideLoading();
  227. }
  228. }).catch(error => {
  229. uni.hideLoading();
  230. uni.showToast({
  231. title: error,
  232. icon: "none"
  233. })
  234. })
  235. }
  236. }
  237. }
  238. </script>
  239. <style>
  240. page{
  241. background-color:#F2F4F6;
  242. }
  243. </style>
  244. <style scoped lang="scss">
  245. .body {
  246. padding: 32rpx;
  247. }
  248. .gradient-header {
  249. height: 0px;
  250. }
  251. .jpback {
  252. height: 760rpx;
  253. background: linear-gradient(180deg, rgba(203, 234, 255, 1) 0%, rgba(203, 234, 255, 0) 100%);
  254. }
  255. .isReady_2{
  256. margin-top: 80rpx;
  257. .r2text{
  258. text-align: center;
  259. .r2text1{
  260. color: rgba(51,51,51,1);
  261. font-size: 40rpx;
  262. font-weight: bold;
  263. }
  264. .r2text2{
  265. font-weight: 400;
  266. color: rgba(51,51,51,1);
  267. font-size: 32rpx;
  268. }
  269. }
  270. }
  271. .page-top {
  272. padding: 40rpx;
  273. padding-top: 0rpx;
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. .name {
  278. width: 320rpx;
  279. height: 320rpx;
  280. display: flex;
  281. align-items: flex-end;
  282. .img {
  283. width: 320rpx;
  284. height: 320rpx;
  285. }
  286. .img2 {
  287. width: 320rpx;
  288. height: 140rpx;
  289. }
  290. }
  291. .value {
  292. //margin-top: 24rpx;
  293. font-size: 40rpx;
  294. font-weight: bold;
  295. color: #333333;
  296. }
  297. }
  298. .pagemanage{
  299. margin-top: 80rpx;
  300. margin-bottom: 80rpx;
  301. .mitem{
  302. width: 33%;
  303. display: flex;
  304. flex-direction: column;
  305. align-items: center;
  306. img{
  307. width: 48rpx;
  308. height: 48rpx;
  309. margin-bottom: 8rpx;
  310. }
  311. border-right: 1px solid rgba(187,187,187,0.43);
  312. }
  313. .end{
  314. border-right:0
  315. }
  316. }
  317. .page {
  318. border-radius: 16rpx;
  319. background-color: rgba(255, 255, 255, 1);
  320. color: rgba(16, 16, 16, 1);
  321. box-shadow: 0px 4px 8px 0px rgba(22,119,255,0.2);
  322. padding: 32rpx;
  323. margin-bottom: 32rpx;
  324. font-size: 32rpx;
  325. color: rgb(16, 16, 16);
  326. width: 100%;
  327. .page-border{
  328. border-bottom: 1px solid rgba(232,232,232,1);
  329. padding-bottom: 16rpx;
  330. }
  331. .page-main {
  332. display: flex;
  333. justify-content: space-between;
  334. align-items: center;
  335. .name {
  336. color: rgba(51, 51, 51, 1);
  337. font-size: 36rpx;
  338. display: flex;
  339. flex-direction: column;
  340. display: flex;
  341. .name-info{
  342. display: flex;
  343. .name-text{
  344. font-size: 36rpx;
  345. font-weight: bold;
  346. }
  347. }
  348. .code-info{
  349. font-size: 24rpx;
  350. color: rgba(119,119,119,1);
  351. }
  352. }
  353. .tags{
  354. display: flex;
  355. align-items: center;
  356. margin-left: 8rpx;
  357. .tag {
  358. font-size: 24rpx;
  359. border: 1px solid rgba(187, 187, 187, 1);
  360. border-radius: 4px;
  361. color: rgba(22,119,255,1);
  362. padding: 1px 8rpx;
  363. margin-left: 8rpx;
  364. }
  365. .typeN1{
  366. color:#1677FF ;
  367. border: 1px solid #1677FF ;
  368. }
  369. .typeN2{
  370. color:#8161FF;
  371. border: 1px solid #8161FF;
  372. }
  373. .status1{
  374. color:#00B962;
  375. border: 1px solid #00B962;
  376. }
  377. .status0{
  378. color:#A7A2A2;
  379. border: 1px solid #A7A2A2;
  380. }
  381. }
  382. .value1{
  383. display: flex;
  384. flex-direction: column;
  385. align-items: center;
  386. justify-content: space-between;
  387. .item1{
  388. .img{
  389. width: 48rpx;
  390. height: 48rpx;
  391. }
  392. display: flex;
  393. }
  394. .item2 {
  395. font-size: 24rpx;
  396. color: rgba(119,119,119,1);
  397. }
  398. }
  399. }
  400. .page-info{
  401. padding-top: 16rpx;
  402. font-size: 24rpx;
  403. color: #777777;
  404. display: flex;
  405. justify-content: space-between;
  406. .address{
  407. .name{
  408. color: rgba(119,119,119,1);
  409. font-size: 28rpx;
  410. }
  411. .text{
  412. color: rgba(51,51,51,1);
  413. font-size: 24rpx;
  414. }
  415. }
  416. .value2{
  417. display: flex;
  418. flex-direction: column;
  419. align-items: center;
  420. justify-content: space-between;
  421. .item1{
  422. .img{
  423. width: 32rpx;
  424. height: 32rpx;
  425. }
  426. display: flex;
  427. }
  428. .item2 {
  429. font-size: 24rpx;
  430. color: rgba(119,119,119,1);
  431. }
  432. }
  433. }
  434. .page-content {
  435. .step {
  436. margin-bottom: 16rpx;
  437. }
  438. .tip-title {
  439. color: #101010;
  440. font-size: 36rpx;
  441. font-weight: bold;
  442. margin-bottom: 24rpx;
  443. }
  444. .tip1 {
  445. .step {
  446. color: #101010
  447. }
  448. border-bottom: 1px solid rgba(241, 241, 241, 1);
  449. margin-bottom: 24rpx;
  450. padding-bottom: 8rpx;
  451. }
  452. .tip2 {
  453. .step {
  454. color: #333333
  455. }
  456. }
  457. }
  458. }
  459. .jpbutton {
  460. margin-top: 30rpx;
  461. margin-bottom: 30rpx;
  462. border-radius: 100rpx;
  463. width: 400rpx;
  464. height: 84rpx;
  465. color: #fff;
  466. padding: 8rpx;
  467. display: flex;
  468. align-items: center;
  469. justify-content: center;
  470. font-size: 36rpx;
  471. .img {
  472. margin-right: 8rpx;
  473. width: 36rpx;
  474. height: 32rpx;
  475. }
  476. }
  477. .jpbutton1 {
  478. background-color: #2979FF;
  479. .img {
  480. width: 32rpx;
  481. height: 32rpx;
  482. }
  483. }
  484. .jpbutton2 {
  485. background-color: #2979FF;
  486. .img {
  487. width: 40rpx;
  488. height: 40rpx;
  489. animation: spin 2s linear infinite;
  490. /* 添加无限旋转动画 */
  491. }
  492. /* 定义旋转动画 */
  493. @keyframes spin {
  494. from {
  495. transform: rotate(0deg);
  496. /* 起始角度 */
  497. }
  498. to {
  499. transform: rotate(360deg);
  500. /* 结束角度 */
  501. }
  502. }
  503. }
  504. .jpbutton3 {
  505. background-color: #00B962;
  506. }
  507. .jpbutton4 {
  508. background-color: #A7A2A2;
  509. }
  510. .jpbutton6 {
  511. background-color: #FF7B00;
  512. }
  513. .jpbutton5 {
  514. background-color: #1677FF;
  515. }
  516. </style>