wkyy 1 سال پیش
والد
کامیت
6d212e4643

+ 6 - 0
assets/img/riLine-link-unlink.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="20" height="20" style="" filter="none">
+    
+    <g>
+    <path d="M22.667 22.667h6.667v2.667h-4v4h-2.667v-6.667zM9.333 9.333h-6.667v-2.667h4v-4h2.667v6.667zM24.485 20.715l-1.885-1.888 1.885-1.885c1.219-1.208 1.973-2.883 1.973-4.735 0-3.682-2.985-6.667-6.667-6.667-1.851 0-3.526 0.755-4.734 1.973l-1.886 1.887-1.887-1.885 1.888-1.885c1.689-1.689 4.023-2.734 6.6-2.734 5.155 0 9.334 4.179 9.334 9.334 0 2.577-1.045 4.911-2.734 6.6l-1.887 1.885zM20.715 24.485l-1.887 1.885c-1.689 1.689-4.023 2.734-6.6 2.734-5.155 0-9.334-4.179-9.334-9.334 0-2.577 1.045-4.911 2.734-6.6v0l1.887-1.885 1.885 1.888-1.885 1.885c-1.219 1.208-1.973 2.883-1.973 4.735 0 3.682 2.985 6.667 6.667 6.667 1.851 0 3.526-0.755 4.734-1.973l1.886-1.886 1.887 1.885zM19.771 10.343l1.887 1.887-9.428 9.427-1.887-1.885 9.428-9.427z" fill="rgba(255,255,255,1)"></path>
+    </g>
+  </svg>

+ 58 - 39
pages/equipmentInformation/equipmentDetails.vue

@@ -122,8 +122,8 @@
 		</view>
 		<!-- 确认弹窗 -->
 		<view class="modal">
-			<u-modal v-model="bindShow" :show-title="false" :show-cancel-button="true" @confirm="submit" :cancel-text="cancelText"
-				:confirm-text="confirmText" @cancel="cancel">
+			<u-modal v-model="bindShow" :show-title="false" :show-cancel-button="true" @confirm="submit"
+				:cancel-text="cancelText" :confirm-text="confirmText" @cancel="cancel">
 				<view class="headline">
 					请确认您要绑定的账户信息
 
@@ -134,7 +134,7 @@
 							用户名称
 						</view>
 						<view class="value">
-							{{meterDetail.name}}
+							{{findByMeter.name}}
 
 						</view>
 					</view>
@@ -145,7 +145,7 @@
 
 						</view>
 						<view class="value">
-							{{meterDetail.deviceNo}}
+							{{findByMeter.deviceNo}}
 
 						</view>
 					</view>
@@ -154,7 +154,7 @@
 							所在地址
 						</view>
 						<view class="value">
-							{{meterDetail.installationAddress}}
+							{{findByMeter.installationAddress}}
 						</view>
 					</view>
 
@@ -162,7 +162,7 @@
 
 			</u-modal>
 		</view>
-		
+
 		<!-- 底部 -->
 		<view class="bottom" v-if="type == '1'">
 			<button class="scan" @click.stop.prevent="getScanCode()">
@@ -177,7 +177,7 @@
 	import * as API from '@/apis/pagejs/index.js'
 	import * as API_electricityMeter from '@/apis/pagejs/electricityMeter.js'
 	import * as WxJsApi from '@/apis/utils/wxJsApi.js'
-	
+
 	export default {
 		data() {
 			return {
@@ -195,16 +195,21 @@
 			}
 		},
 		onLoad(op) {
-			if(op.id) {
+			WxJsApi.getWxConfig(['scanQRCode']).then((res) => {
+				// //(res)
+			}).catch(error => {
+				//(res)
+			})
+
+			if (op.id) {
 				this.materId = op.id;
 				this.getMeterDetails(this.materId);
+				this.getfindByOpenId();
 			}
-			if(op.meterNo) {
+			if (op.meterNo) {
 				this.meterNo = op.meterNo
 				this.getFindByMeterNo(this.meterNo);
 			}
-			
-			this.getfindByOpenId();
 		},
 		methods: {
 			//扫码识别
@@ -214,32 +219,32 @@
 				// this.getScanCode2(code)
 			},
 			getScanCode1() {
-				WxJsApi.scanQRCode(1,null,["qrCode","barCode"]).then(res => {
+				WxJsApi.scanQRCode(1, null, ["qrCode", "barCode"]).then(res => {
 					//("scanQRCode------" + res)
 					if (res) {
 						this.getScanCode2(res)
 					}
 				}).catch(error => {
-					
+
 				})
 			},
 			getScanCode2(code) {
 				this.change = true;
 				this.cancelText = '暂不换绑';
 				this.confirmText = '确认换绑';
-				if(code){
-					if(code.indexOf(",")>-1){
-						var sz= code.split(",")
-						if(sz.length==2){
+				if (code) {
+					if (code.indexOf(",") > -1) {
+						var sz = code.split(",")
+						if (sz.length == 2) {
 							this.getFindByMeterNo(sz[1]);
 						}
-					}else{
+					} else {
 						this.getFindByMeterNo(code);
 					}
 				}
 			},
 			submit() {
-				if(this.change) {
+				if (this.change) {
 					this.getCharngeMeter();
 				} else {
 					this.getBindMeter();
@@ -255,12 +260,19 @@
 					meterNo: this.meterNo
 				}).then((response) => {
 					uni.hideLoading()
+					let pages = getCurrentPages(); // 当前页面
+					let beforePage = pages[pages.length - 2]; //上一个页面
+					uni.navigateBack({
+						success: function() {
+							beforePage.$vm.getMaterList(true);
+						}
+					})
 				}).catch(error => {
 					uni.hideLoading()
 					uni.showModal({
-						showCancel:false,
-						content:error,
-						title:"提示"
+						showCancel: false,
+						content: error,
+						title: "提示"
 					})
 				})
 			},
@@ -275,27 +287,34 @@
 					oldMeterId: this.oldMeterId
 				}).then((response) => {
 					uni.hideLoading()
-					this.cancelText = '暂不绑定';
-					this.confirmText = '确认绑定';
-					this.materId = this.newMaterId;
-					this.getMeterDetails(this.newMaterId);
+					// this.cancelText = '暂不绑定';
+					// this.confirmText = '确认绑定';
+					// this.materId = this.newMaterId;
+					// this.getMeterDetails(this.newMaterId);
+					let pages = getCurrentPages(); // 当前页面
+					let beforePage = pages[pages.length - 2]; //上一个页面
+					uni.navigateBack({
+						success: function() {
+							beforePage.$vm.getMaterList(true);
+						}
+					})
 				}).catch(error => {
 					uni.hideLoading()
 					uni.showModal({
-						showCancel:false,
-						content:error,
-						title:"提示"
+						showCancel: false,
+						content: error,
+						title: "提示"
 					})
 				})
 			},
 			cancel() {
 				this.bindShow = false;
-				if(!this.change) {
+				if (!this.change) {
 					uni.navigateBack();
 				}
 			},
 			//能源中心扫电表码
-			getFindByMeterNo(meterNo){
+			getFindByMeterNo(meterNo) {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
@@ -307,8 +326,8 @@
 					// console.log(response)
 					this.bindShow = true;
 					this.findByMeter = response.data.meter;
-					
-					if(!this.change) {
+
+					if (!this.change) {
 						this.materId = response.data.meter.id;
 						this.getMeterDetails(this.materId);
 					} else {
@@ -319,9 +338,9 @@
 				}).catch(error => {
 					uni.hideLoading()
 					uni.showModal({
-						showCancel:false,
-						content:error,
-						title:"提示"
+						showCancel: false,
+						content: error,
+						title: "提示"
 					})
 				})
 			},
@@ -455,7 +474,7 @@
 		}
 
 	}
-	
+
 	// 底部
 	.bottom {
 		background-color: rgba(255, 255, 255, 1);
@@ -465,7 +484,7 @@
 		left: 0;
 		right: 0;
 		bottom: 0;
-	
+
 		.scan {
 			color: rgba(255, 255, 255, 1);
 			font-size: 36rpx;
@@ -474,7 +493,7 @@
 			justify-content: center;
 			border-radius: 50px;
 			background: linear-gradient(-88.46deg, rgba(34, 109, 198, 1) 2.59%, rgba(9, 158, 237, 1) 97.02%);
-	
+
 			.img {
 				width: 40rpx;
 				height: 40rpx;

+ 12 - 2
pages/equipmentInformation/equipmentInformation.vue

@@ -84,8 +84,17 @@
 				show2: false, // 状态选择
 				deviceList: [],
 				companyList: [],
+				isRefresh: false
 			}
 		},
+		onLoad() {
+			WxJsApi.getWxConfig([ 'scanQRCode']).then((res) => {
+				// //(res)
+			}).catch(error => {
+				//(res)
+			})
+			
+		},
 		onReady() {
 			this.getMaterList();
 			this.getfindByOpenId();
@@ -101,12 +110,12 @@
 			//扫码识别
 			getScanCode() {
 				this.getScanCode1()
-				// var code="JPDJ01-0003"
+				// var code="2"
 				// this.getScanCode2(code)
 			},
 			getScanCode1() {
 				WxJsApi.scanQRCode(1,null,["qrCode","barCode"]).then(res => {
-					//("scanQRCode------" + res)
+					console.log("scanQRCode1------" + res)
 					if (res) {
 						this.getScanCode2(res)
 					}
@@ -115,6 +124,7 @@
 				})
 			},
 			getScanCode2(code) {
+				console.log("scanQRCode2------" + code)
 				if(code){
 					if(code.indexOf(",")>-1){
 						var sz= code.split(",")