main.vue 12 KB

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