Explorar o código

绑定地锁, 地锁列表

zhengkaixin hai 1 mes
pai
achega
90e6583f6d

+ 14 - 1
apis/pagejs/deviceTab.js

@@ -1,6 +1,19 @@
 import requestWhite from '@/apis/utils/requestWhite'
 
-
+export function add(data) {
+ 	return requestWhite({
+ 		method: 'post',
+ 		data: data,
+ 		url: '/mobile/application/add'
+ 	})
+}
+export function bindStatusByNo(data) {
+ 	return requestWhite({
+ 		method: 'post',
+ 		data: data,
+ 		url: '/mobile/application/bindStatusByNo'
+ 	})
+}
 
 export function companyInfoStatusList(data) {
 	var url='/mobile/sysUser/companyInfoStatusList';

+ 3 - 1
config/.env.dev.js

@@ -4,7 +4,9 @@ const UNI_APP = {
 
 	
 	BASE_URL: 'https://youdian-test.hbjp.com.cn/floorlock-server/',
-	BASE_URL:"https://zbyj.hbjp.com.cn/floorlock-server/",
+	//##https://youdian-test.hbjp.com.cn/floorlock-portal/#/home
+	
+	//BASE_URL:"https://zbyj.hbjp.com.cn/floorlock-server/",
 	//BASE_URL: 'https://dgj.jzrccs.com/electric-manager-api/',
 	
 	//BASE_URL:'http://192.168.77.162:8081/electric-manager-api/', //sz

+ 60 - 18
pages/deviceTab/bindLock.vue

@@ -1,14 +1,14 @@
 <template>
+	
 	<view class="jpmain  ">
+		<u-navbar  title="绑定地锁"  ></u-navbar>
 		<u-picker mode="selector"
 		 v-model="isswitchshow" 
 		 :range="columns" range-key="label"
 		  :default-selector="columnsindex"
 		   @confirm="switchBtn" ></u-picker>
 		
-		<view class="body">
-			<u-steps :list="numList" mode="number" :current="current" un-active-color="#999999"></u-steps>
-			</view>
+	
 			<view class="list" @click="gotoscan">
 				<view class="item">
 					<view class="name">
@@ -44,7 +44,7 @@
 			</view>
 
 			<view class="list">
-				<view class="item" >
+				<!-- <view class="item" >
 					<view class="name">
 						所属停车场
 
@@ -53,7 +53,7 @@
 						<view>{{bindInfo.parkingIdN?bindInfo.parkingIdN:'请选择所属停车场'}}</view>
 						<u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
 					</view>
-				</view>
+				</view> -->
 				<view class="item" v-if="bindInfo.lockNo">
 					<view class="name">
 						车位类型
@@ -87,7 +87,7 @@
 			<view class="floating-button">
 				<view class="button"  @click="submit" >
 					
-					提交申请
+					提交绑定
 				</view>
 				
 			</view>
@@ -97,8 +97,10 @@
 </template>
 
 <script>
-	import * as API from '@/apis/pagejs/index.js'
+
+	import * as API from '@/apis/pagejs/deviceTab.js'
 	
+	import * as WxJsApi from '@/apis/utils/wxJsApi.js'
 	export default {
 		data() {
 			return {
@@ -123,10 +125,18 @@
 				}],
 			};
 		},
-		onLoad() {
+		onLoad(op) {
+			this.bindInfo.parkingId=op.parkingId
 			this.userInfo = this.jphelp.getPersonInfo()
 			this.bindInfo.phone=this.userInfo.phone
 		},
+		onReady() {
+				WxJsApi.getWxConfig([ 'scanQRCode']).then((res) => {
+					// //(res)
+				}).catch(error => {
+					//(res)
+				})
+		},
 		computed:{
 			columns(){
 				var sz=[]
@@ -188,6 +198,14 @@
 			},
 			submit(){
 				
+				if(!this.bindInfo.lockNo){
+					uni.showToast({
+						title: "请扫码识别地锁",
+						icon: "none"
+					})
+					return
+				}
+				
 				if(!this.bindInfo.name){
 					uni.showToast({
 						title: "请填写用户真实姓名",
@@ -220,11 +238,23 @@
 				})
 				API.add( this.bindInfo ).then((res) => {
 				
-					uni.redirectTo({
-						url:"/pages/mylock/bindLockStatus?id="+res.data.applicationRecord.id
+					
+					uni.hideLoading();
+					uni.showModal({
+						title: '提示',
+						showCancel: false,
+						content: "操作成功",
+						success: res1 => {
+							if (res1.confirm) {
+								uni.navigateBack()
+							} else if (res1.cancel) {
+								//('用户点击取消');
+							}
+						}
 					})
-						uni.hideLoading();
+					const eventChannel = this.getOpenerEventChannel();
 					
+					eventChannel.emit('acceptDataFromOpenerPage', { data: 'data from starter page' })
 							 
 				}).catch(error => {
 					uni.showToast({
@@ -246,14 +276,26 @@
 			},
 			gotoscan() {
 				
-				// #ifdef H5
-					this.gotoscanH5()
-				// #endif
+				// // #ifdef H5
+				// 
+				// // #endif
+				
+				// // #ifdef MP-WEIXIN
+					
+				// 		this.gotoscanMP()
+				// // #endif
+				if (process.env.NODE_ENV === "development"){
+						this.gotoscanH5()
+				}else{
+					WxJsApi.scanQRCode(1).then(res => {
+						var url=res;
+						this.getscan(url)
+					}).catch(error => {
+					
+					})
+				}
 				
-				// #ifdef MP-WEIXIN
 					
-						this.gotoscanMP()
-				// #endif
 			},
 			getscan(val) {
 			 	
@@ -267,7 +309,7 @@
 			 
 			 	}).then((res) => {
 			 		uni.hideLoading();
-			 		if (res.data.openBind) {
+			 		if (res.data.openBind||1) {
 			 			
 			 			var nowscan=res.data.floorlockInfoList;
 						if(nowscan&&nowscan.length){

+ 2 - 1
pages/deviceTab/dataLock.vue

@@ -1762,10 +1762,11 @@
 		border-top: 1px solid rgba(245, 245, 245, 1);
 		display: flex;
 		flex-wrap: wrap;
-		    justify-content: space-between;
+		justify-content: space-between;
 		padding-top: 16rpx;
 		margin-top: 16rpx;
 		.item-span{
+			white-space: pre;
 			    display: flex;
 			    align-items: center;
 				   margin-top: 4rpx;

+ 27 - 4
pages/deviceTab/deviceList.vue

@@ -67,8 +67,8 @@
 				
 			</view>
 			
-			<view class="floating-button" v-if="0"
-			  @click="gotoUrl('/pages/deviceTab/bindLock?companyId='+listForm.companyId)">
+			<view class="floating-button" 
+			  @click="gotoBind">
 				<view class="button">
 					<img class="img" src="@/assets/img/deviceTab/index2-2.svg" alt="">
 			
@@ -129,6 +129,9 @@
 			if(op.companyId){
 				this.listForm.companyId=op.companyId
 			}
+			if(op.parkingId){
+				this.listForm.parkingId=op.parkingId
+			}
 			this.getList()
 		},
 		onReachBottom() {
@@ -137,12 +140,32 @@
 			}
 		},
 		methods: {
-			
+			gotoBind(){
+				uni.navigateTo({
+				  url: '/pages/deviceTab/bindLock?parkingId='+this.listForm.parkingId,
+				  events: {
+				    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+				    acceptDataFromOpenerPage: (item)=>{
+						
+						this.getList(1)
+				    },
+				 
+				  }
+				  // ,
+				  // success: function(res) {
+				  //   // 通过eventChannel向被打开页面传送数据
+				  //  
+				  // }
+				})
+			},
 			myLoadmore(){
 				this.listForm.pageIndex += 1;
 				this.getList()
 			},
-			getList() {
+			getList(bl) {
+				if(bl){
+					this.listForm.pageIndex = 1
+				}
 				uni.showLoading({
 					title: "加载中",
 					mask: true,

+ 18 - 8
pages/deviceTab/index.vue

@@ -4,7 +4,7 @@
 		<view class="main">
 			<view class="list">
 				<view class="line"  v-for="(item,i) in list" :key="i"
-				  @click="gotoUrl('/pages/deviceTab/deviceList?companyId='+item.id)" >
+				  @click="gotoUrl('/pages/deviceTab/deviceList?parkingId='+item.id)" >
 					<view class="body">
 						<view class="imgclass">
 							<image class="img" src="@/assets/img/deviceTab/index1-1.svg" mode=""></image>
@@ -14,12 +14,12 @@
 								{{item.name}}
 							</view>
 							<view class="value"  >
-								占用{{item.useNum}}<span>/</span>
+								<!-- 占用{{item.useNum}}<span>/</span>
 								空闲{{item.idleNum}}<span>/</span>
 								错误{{item.errorNum}}<span>/</span>
-								共{{item.lockNum}}台
-								
-								
+								共{{item.lockNum}}台 -->
+								<span>{{item.contacts}}</span>
+								<span>{{item.openStatusN}}</span>
 							</view>
 						</view>
 					</view>
@@ -77,9 +77,19 @@
 					mask: true,
 				})
 							 
-				API.companyInfoStatusList(this.listForm).then((res) => {
+				API.parkingList(this.listForm).then((res) => {
 					
-					this.list = res.data.companyInfoList
+					var list=this.list 
+					
+					if (this.listForm.pageIndex == 1) {
+						list = res.data.parkingInfoList;
+					} else {
+						list = [
+							...list,
+							...res.data.parkingInfoList
+						];
+					}
+					this.list=list
 					uni.hideLoading();
 				
 				}).catch(error => {
@@ -130,7 +140,7 @@
 						 								 	color: rgba(119,119,119,1);
 						 								 	font-size: 24rpx;
 						 											 span{
-						 												  margin: 0 8rpx;
+						 												  margin-right: 16rpx;
 						 											 }
 						 								 }
 						 }

+ 2 - 2
pages/index/index.vue

@@ -627,8 +627,8 @@
 			},
 			
 			gotoDeviceList() {
-				if (this.companyId) {
-					this.gotoUrl('/pages/deviceTab/deviceList?companyId=' + this.companyId)
+				if (this.parkingId) {
+					this.gotoUrl('/pages/deviceTab/deviceList?parkingId=' + this.parkingId)
 				} else {
 					
 					uni.switchTab({