开关
This commit is contained in:
parent
d504666dba
commit
c96782e800
|
@ -32,7 +32,7 @@
|
|||
<view class="rt" :id="item.deviceId" @click="createBLEConnections(item)">
|
||||
<!-- <text style="margin-bottom: 10rpx;" :id="item.deviceId" @click="createBLEConnections(item)">{{item.lj}}</text> -->
|
||||
<text style="margin-bottom: 10rpx;">选择</text>
|
||||
<text style="margin-bottom: 10rpx;margin-top: 30rpx;" @click.stop="btnkongzhi(item)">控制</text>
|
||||
<text v-if="item.sn" style="margin-bottom: 10rpx;margin-top: 30rpx;" @click.stop="btnkongzhi(item.sn)">控制</text>
|
||||
<!-- <text @click="scanQRCode(item)" style="margin-bottom: 10rpx;">扫码</text>
|
||||
<text :id="item.deviceId" @click="createBLEConnection(item)">录入</text> -->
|
||||
</view>
|
||||
|
@ -352,8 +352,9 @@
|
|||
})
|
||||
},
|
||||
btnkongzhi(e){
|
||||
console.log(e);
|
||||
uni.reLaunch({
|
||||
url:'/page_user/wifijoint/index?mac=' + e.name.substring(5)
|
||||
url:'/page_user/wifijoint/index?sn=' + e
|
||||
})
|
||||
},
|
||||
parseCustomData(data) {
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
</image>
|
||||
</view>
|
||||
<input type="text" class="ips" v-model="storeId" placeholder="请扫描设备上的二维码" style="margin-left: 32rpx;"
|
||||
placeholder-class="my-placeholder" v-if="storeId"/>
|
||||
<input type="text" class="ips" v-model="storeIds" v-if="storeIds" placeholder="请扫描设备上的二维码" style="margin-left: 32rpx;"
|
||||
placeholder-class="my-placeholder" />
|
||||
placeholder-class="my-placeholder"/>
|
||||
<!-- <input type="text" class="ips" v-model="storeIds" v-if="storeIds" placeholder="请扫描设备上的二维码" style="margin-left: 32rpx;"
|
||||
placeholder-class="my-placeholder" /> -->
|
||||
</view>
|
||||
<view class="machao">
|
||||
MAC号:{{obj.mac == undefined ? '--' : obj.mac}}
|
||||
|
@ -84,10 +84,7 @@
|
|||
if (options.sn) {
|
||||
this.storeId = options.sn
|
||||
this.getsn()
|
||||
} else if (options.mac) {
|
||||
this.storeIds = options.mac
|
||||
this.getsn()
|
||||
}
|
||||
}
|
||||
},
|
||||
// 分享到好友(会话)
|
||||
onShareAppMessage: function() {
|
||||
|
|
|
@ -177,6 +177,7 @@
|
|||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// this.getuserinfo()
|
||||
if (option.id) {
|
||||
let id = option.id
|
||||
let that = this
|
||||
|
@ -193,34 +194,25 @@
|
|||
}
|
||||
})
|
||||
} else if (res.data == 1) {
|
||||
console.log(1);
|
||||
if(that.phonenumber == ''){
|
||||
that.huoqutelflag = true
|
||||
that.xuanzeflag = false
|
||||
console.log(11);
|
||||
}else{
|
||||
console.log(12);
|
||||
that.xuanzeflag = false
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该设备未绑定,你需进行绑定吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$u.put("/app/device/bind", data).then(res => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该设备未绑定,你需进行绑定吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$u.put("/app/device/bind", data).then(res => {
|
||||
if (res.code == 200) {
|
||||
that.$u.get(`/app/device/${id}/bySn`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
that.$u.get(`/app/device/${id}/bySn`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.navigateTo({
|
||||
url: '/page_components/bindsz?id=' + res.data.deviceId
|
||||
})
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/page_components/bindsz?id=' + res.data.deviceId
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (res.data == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
@ -847,13 +839,13 @@
|
|||
getuserinfo() {
|
||||
this.$u.get("/app/user/userInfo").then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.phonenumber = res.data.phonenumber
|
||||
this.type = res.data.type
|
||||
this.isStaff = res.data.isStaff
|
||||
this.isMch = res.data.isMch
|
||||
uni.setStorageSync('userType', res.data)
|
||||
this.userType = res.data.userType
|
||||
this.deviceCount = res.data.deviceCount
|
||||
this.phonenumber = res.data.phonenumber
|
||||
} else {
|
||||
this.jmlogin()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user