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