main.vue 11 KB

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