|
@@ -1,12 +1,48 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <u-navbar title="绑定地锁" :isBack="!showtabbar" ></u-navbar>
|
|
|
+ <componentLogin ref="refLogin"
|
|
|
+ @findByOpenId="findByOpenId"></componentLogin>
|
|
|
+
|
|
|
+ <u-modal v-model="openLockBl" @confirm="lockStatus1" confirm-color="#00B962" :show-cancel-button="true"
|
|
|
+ ref="uModal" title="提示" content="是否下降当前地锁?" confirm-text="开启"></u-modal>
|
|
|
+ <u-modal v-model="closeLockBl" @confirm="lockStatus2" confirm-color="#fa3534" :show-cancel-button="true"
|
|
|
+ ref="uModal" title="提示" content="是否结束使用当前地锁?" confirm-text="结束"></u-modal>
|
|
|
+
|
|
|
+
|
|
|
+ <u-modal v-model="loginBl" @confirm="loginconfirm" :show-cancel-button="true"
|
|
|
+ ref="uModal" title="提示" content="当前用户未登录,是否前往登录" confirm-text="登录"></u-modal>
|
|
|
+
|
|
|
+
|
|
|
+ <u-modal v-model="openModalBl" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
|
|
|
+ :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" :content="content"
|
|
|
+ :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <u-popup v-model="showMessage" mode="bottom" border-radius="30">
|
|
|
+ <view class="showMessage">
|
|
|
+ <view class="title">降锁成功</view>
|
|
|
+ <view class="body">
|
|
|
+ 车位锁已经降锁,请尽快驶入车位!<br />
|
|
|
+
|
|
|
+ 若超过3分钟未停车,车位锁将自动升起上锁,如需继续使用请重新扫码降锁。
|
|
|
+
|
|
|
+ </view>
|
|
|
+ <view class="botton">
|
|
|
+ <u-button @click="showMessage=false" type="primary" shape="square">知道了</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+
|
|
|
<view v-if="isReady" class="isReady">
|
|
|
<view class="gradient-header">
|
|
|
<view class="jpback">
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="id" class="isReady_1">
|
|
|
+ <view v-if="floorlockInfo.id" class="isReady_1">
|
|
|
|
|
|
|
|
|
<view class="body">
|
|
@@ -163,7 +199,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="page ">
|
|
|
+ <view class="page " >
|
|
|
<u-collapse :itemStyle="{
|
|
|
'border':'1px solid rgba(187, 187, 187, 0.43);'
|
|
|
}">
|
|
@@ -196,7 +232,12 @@
|
|
|
|
|
|
|
|
|
</view>
|
|
|
-
|
|
|
+ <view class="page-role" v-else>
|
|
|
+ <img class="img" src="@/assets/img/nonwhitelist/info.png" alt="">
|
|
|
+ <view class="text1">{{permission?'暂无权限':'加载中...'}}</view>
|
|
|
+ <view class="text2" v-if="permission">此车位仅限车主及授权用户使用</view>
|
|
|
+ <view class="botton" @click="gotoIndex" v-if="permission">返回首页</view>
|
|
|
+ </view>
|
|
|
<tabbar v-if="showtabbar" ></tabbar>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -204,7 +245,7 @@
|
|
|
<script>
|
|
|
import componentLogin from '@/components/componentLogin.vue';
|
|
|
import tabbar from '@/components/Tabbar.vue';
|
|
|
- import * as API from '@/apis/pagejs/mylock.js'
|
|
|
+ import * as API from '@/apis/pagejs/pagesIndex.js'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -241,28 +282,142 @@
|
|
|
}],
|
|
|
content: "400-8899-619",
|
|
|
setIntervalId: "",
|
|
|
+ userInfo:{},
|
|
|
+ userInfoPlus:{
|
|
|
+ whiteList:[],
|
|
|
+ myAllList:[]
|
|
|
+ },
|
|
|
+
|
|
|
+ showMessage: 0,
|
|
|
+
|
|
|
+ openLockBl:false,
|
|
|
+ closeLockBl:false,
|
|
|
+ openModalBl: false,
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
onLoad(op) {
|
|
|
|
|
|
- if(op.showtabbar){
|
|
|
- this.showtabbar=1
|
|
|
- this.isReady = 1
|
|
|
+ if(op.q){
|
|
|
+ var val =decodeURIComponent(op.q);
|
|
|
+
|
|
|
+ if(val&&val.indexOf("?id=")>-1){
|
|
|
+ val=val.split("?id=")[1]
|
|
|
+ if(val.indexOf("&")>-1){
|
|
|
+ val=val.split("&")[0]
|
|
|
+ }
|
|
|
+ this.id = val
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- if (op.id) {
|
|
|
+
|
|
|
+
|
|
|
+ this.userInfo = this.jphelp.getPersonInfo()
|
|
|
+ this.userInfoPlus=this.jphelp.getPersonInfoPlus()
|
|
|
+ if(this.userInfo.id){
|
|
|
+
|
|
|
+ }
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: "加载中..."
|
|
|
+ })
|
|
|
+
|
|
|
+ if(this.id ){
|
|
|
+ this.showtabbar=0
|
|
|
+ this.isReady = 1
|
|
|
+ this.getFloorlockDetails()
|
|
|
+
|
|
|
+ }else if (op.id) {
|
|
|
+ this.showtabbar=0
|
|
|
this.id = op.id
|
|
|
this.isReady = 1
|
|
|
-
|
|
|
+
|
|
|
this.getFloorlockDetails()
|
|
|
+ }else{
|
|
|
+ this.showtabbar=1
|
|
|
+ this.isReady = 1
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: "快捷停车"
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow(){
|
|
|
+ if(this.id ){}
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ this.$refs.refLogin.findByOpenId()
|
|
|
+ this.setIntervalId = setInterval(() => {
|
|
|
+ this.getFloorlockDetails(1)
|
|
|
+ }, 1000 * 3)
|
|
|
+
|
|
|
+ this.jphelp.setInterval("lockInfo",this.setIntervalId)
|
|
|
+
|
|
|
+ this.getFloorlockDetails(0,1)
|
|
|
+
|
|
|
+ },
|
|
|
+ onShareTimeline(){
|
|
|
+ return {
|
|
|
+ title: '智泊e家',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShareAppMessage(res) {
|
|
|
+ return {
|
|
|
+ title: '智泊e家',
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ findByOpenId(res) {
|
|
|
+
|
|
|
+ this.getFloorlockList()
|
|
|
+
|
|
|
+ },
|
|
|
+ confirmPhone() {
|
|
|
+ this.openModalBl = false;
|
|
|
+
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber: this.content //仅为示例
|
|
|
+ });
|
|
|
+ },
|
|
|
+ lockStatus3(){
|
|
|
+ uni.showToast({
|
|
|
+ title: "下降中...",
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ lockStatus0(){
|
|
|
+ this.openModalBl=true;
|
|
|
+ },
|
|
|
+ loginconfirm(){
|
|
|
+ this.$refs.refLogin.ashow()
|
|
|
+ },
|
|
|
gotoMain(){
|
|
|
uni.switchTab({
|
|
|
url:"/pages/index/index"
|
|
|
})
|
|
|
},
|
|
|
+ operateBtn() {
|
|
|
+ if(!this.jphelp.getPersonInfo().id){
|
|
|
+ this.loginBl=true;
|
|
|
+
|
|
|
+ }else if(this.floorlockInfo.status==0){
|
|
|
+ this.lockStatus0()
|
|
|
+ }else{
|
|
|
+ if(this.floorlockInfo.lockStatus==4){
|
|
|
+ this.lockStatus0() //异常
|
|
|
+ }else if(this.floorlockInfo.lockStatus==1){
|
|
|
+ //this.lockStatus1() //未使用
|
|
|
+ this.openLockBl=true;
|
|
|
+ }else if(this.floorlockInfo.lockStatus==2){
|
|
|
+ //this.lockStatus2()
|
|
|
+ //this.closeLockBl=true;
|
|
|
+ //使用
|
|
|
+ }else if(this.floorlockInfo.lockStatus==3){
|
|
|
+ this.lockStatus3() //过程
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
getFloorlockList() {
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
@@ -272,19 +427,24 @@
|
|
|
API.myParkingSpot().then((res) => {
|
|
|
|
|
|
this.mylist = res.data.floorList
|
|
|
- this.whiteList = res.data.whiteList
|
|
|
-
|
|
|
- for (var i in this.mylist) {
|
|
|
- var item = this.mylist[i]
|
|
|
- item.phonetype = 1
|
|
|
- this.list.push(item)
|
|
|
+ for(var i in this.mylist){
|
|
|
+ var item=this.mylist[i]
|
|
|
+ if(item.id==this.id){
|
|
|
+ this.isMy=1
|
|
|
+ }
|
|
|
}
|
|
|
- for (var i in this.whiteList) {
|
|
|
- var item = this.whiteList[i]
|
|
|
- item.phonetype = 2
|
|
|
- this.list.push(item)
|
|
|
+
|
|
|
+ this.whiteList = res.data.whiteList
|
|
|
+
|
|
|
+
|
|
|
+ if(this.mylist.length){
|
|
|
+ this.id = this.mylist[0].id
|
|
|
+ this.getFloorlockDetails()
|
|
|
+ }else if(this.whiteList.length){
|
|
|
+ this.id = this.whiteList[0].id
|
|
|
+ this.getFloorlockDetails()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uni.hideLoading();
|
|
|
|
|
|
}).catch(error => {
|
|
@@ -426,6 +586,7 @@
|
|
|
}
|
|
|
.pagemanage{
|
|
|
margin-top: 80rpx;
|
|
|
+ margin-bottom: 80rpx;
|
|
|
.mitem{
|
|
|
width: 33%;
|
|
|
display: flex;
|
|
@@ -615,7 +776,8 @@
|
|
|
|
|
|
|
|
|
.jpbutton {
|
|
|
- margin-top: 60rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
border-radius: 100rpx;
|
|
|
width: 400rpx;
|
|
|
height: 84rpx;
|