开关
This commit is contained in:
parent
17c0b28017
commit
93e248469e
|
@ -126,7 +126,6 @@
|
||||||
path: '/pages/shouye/index'
|
path: '/pages/shouye/index'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
onShareTimeline: function() {
|
onShareTimeline: function() {
|
||||||
return {
|
return {
|
||||||
|
@ -175,7 +174,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getxingh() {
|
getxingh() {
|
||||||
this.$u.get(`/app/model/all`).then(res => {
|
this.$u.get(`/app/model/all`).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
@ -205,8 +203,6 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
btnyc() {
|
btnyc() {
|
||||||
this.titleflag = false
|
this.titleflag = false
|
||||||
},
|
},
|
||||||
|
@ -254,7 +250,7 @@
|
||||||
if (!options.result) {
|
if (!options.result) {
|
||||||
this.mengcflag = false
|
this.mengcflag = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
console.log("蓝牙未开启", options);
|
console.log("蓝牙未开启", options)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '蓝牙未开启,请打开手机蓝牙',
|
title: '蓝牙未开启,请打开手机蓝牙',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
@ -268,20 +264,20 @@
|
||||||
if (options.result) {
|
if (options.result) {
|
||||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||||
this.devicesLists = uniqueDevicesList.map(device => {
|
this.devicesLists = uniqueDevicesList.map(device => {
|
||||||
const deviceId = device.name.substring(5);
|
const deviceId = device.name.substring(5)
|
||||||
const newDevice = {
|
const newDevice = {
|
||||||
...device,
|
...device,
|
||||||
xuanz: "请选择",
|
xuanz: "请选择",
|
||||||
}; // 直接在复制时添加 xuanz 字段
|
}; // 直接在复制时添加 xuanz 字段
|
||||||
return newDevice;
|
return newDevice
|
||||||
})
|
})
|
||||||
let devicesarr = options.data
|
let devicesarr = options.data
|
||||||
this.devicesList.forEach(device => {
|
this.devicesList.forEach(device => {
|
||||||
if (device.name.substring(0, 4) == "CCYK") {
|
if (device.name.substring(0, 4) == "CCYK") {
|
||||||
this.devicesList.push(device);
|
this.devicesList.push(device)
|
||||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
let uniqueDevicesList = Array.from(new Set(this.devicesList))
|
||||||
this.devicesLists = uniqueDevicesList.filter(device => {
|
this.devicesLists = uniqueDevicesList.filter(device => {
|
||||||
const deviceId = device.name.substring(5);
|
const deviceId = device.name.substring(5)
|
||||||
return deviceId
|
return deviceId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -299,26 +295,25 @@
|
||||||
this.arrs = arr.join(',')
|
this.arrs = arr.join(',')
|
||||||
this.$u.get(`/app/device/getExistMac/${this.arrs}`).then(res => {
|
this.$u.get(`/app/device/getExistMac/${this.arrs}`).then(res => {
|
||||||
if (res.code == 200 && Array.isArray(res.data)) {
|
if (res.code == 200 && Array.isArray(res.data)) {
|
||||||
const existingDevices = new Map(res.data.map(item => [item.mac, true])); // 使用Map来存储已找到的MAC
|
const existingDevices = new Map(res.data.map(item => [item.mac, true]))// 使用Map来存储已找到的MAC
|
||||||
|
|
||||||
this.devicesLists = this.devicesLists.map(device => {
|
this.devicesLists = this.devicesLists.map(device => {
|
||||||
const trimmedName = device.name.slice(5); // 假设name中包含MAC地址的一部分
|
const trimmedName = device.name.slice(5) // 假设name中包含MAC地址的一部分
|
||||||
const mac = trimmedName; // 如果trimmedName直接就是MAC,则不需要再处理
|
const mac = trimmedName // 如果trimmedName直接就是MAC,则不需要再处理
|
||||||
device.found = existingDevices.has(mac); // 添加一个found属性来标记是否找到
|
device.found = existingDevices.has(mac) // 添加一个found属性来标记是否找到
|
||||||
if (device.found) {
|
if (device.found) {
|
||||||
const sn = res.data.find(val => val.mac === mac)?.sn; // 从res.data中找到匹配的sn
|
const sn = res.data.find(val => val.mac === mac)?.sn // 从res.data中找到匹配的sn
|
||||||
if (sn) {
|
if (sn) {
|
||||||
device.sn = sn; // 设置sn
|
device.sn = sn // 设置sn
|
||||||
}
|
}
|
||||||
device.flags = true; // 设置flags为true,因为找到了匹配的MAC
|
device.flags = true // 设置flags为true,因为找到了匹配的MAC
|
||||||
} else {
|
} else {
|
||||||
device.flags = false; // 可选:如果你想要明确表示未找到
|
device.flags = false // 可选:如果你想要明确表示未找到
|
||||||
}
|
}
|
||||||
return device; // 但map函数仍然需要return来保持结构
|
return device // 但map函数仍然需要return来保持结构
|
||||||
});
|
})
|
||||||
this.devicesLists.sort((a, b) => {
|
this.devicesLists.sort((a, b) => {
|
||||||
if (a.found && !b.found) return 1; // b排在a前面(即a在后面)
|
if (a.found && !b.found) return 1 // b排在a前面(即a在后面)
|
||||||
if (!a.found && b.found) return -1; // a排在b前面
|
if (!a.found && b.found) return -1 // a排在b前面
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -333,7 +328,7 @@
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
},2000)
|
},2000)
|
||||||
console.log('蓝牙停止搜索失败');
|
console.log('蓝牙停止搜索失败')
|
||||||
}
|
}
|
||||||
this.searching = false
|
this.searching = false
|
||||||
break
|
break
|
||||||
|
@ -477,13 +472,13 @@
|
||||||
};
|
};
|
||||||
// 遍历数组并解析每个字段
|
// 遍历数组并解析每个字段
|
||||||
for (let i = 0; i < dataArray.length; i++) {
|
for (let i = 0; i < dataArray.length; i++) {
|
||||||
const field = dataArray[i];
|
const field = dataArray[i]
|
||||||
for (const prefix in prefixMap) {
|
for (const prefix in prefixMap) {
|
||||||
if (field.startsWith(prefix)) {
|
if (field.startsWith(prefix)) {
|
||||||
const value = field.substring(1);
|
const value = field.substring(1)
|
||||||
const propertyName = prefixMap[prefix];
|
const propertyName = prefixMap[prefix]
|
||||||
parsedData[propertyName] = isNaN(parseFloat(value)) ? value : parseFloat(value);
|
parsedData[propertyName] = isNaN(parseFloat(value)) ? value : parseFloat(value)
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,7 +511,7 @@
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// uni.navigateBack()
|
// uni.navigateBack()
|
||||||
// }, 1000)
|
// }, 1000)
|
||||||
uni.removeStorageSync('mac');
|
uni.removeStorageSync('mac')
|
||||||
} else {
|
} else {
|
||||||
this.mengcflag = false
|
this.mengcflag = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
@ -524,7 +519,7 @@
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -551,6 +546,7 @@
|
||||||
this.texts = '正在扫描蓝牙设备...'
|
this.texts = '正在扫描蓝牙设备...'
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.statusflag = false
|
this.statusflag = false
|
||||||
|
uni.hideLoading()
|
||||||
// if (this.searching) {
|
// if (this.searching) {
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
'isStart': false
|
||||||
|
@ -575,7 +571,6 @@
|
||||||
this.tishiflag = false
|
this.tishiflag = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -585,7 +580,6 @@
|
||||||
padding-bottom: 300rpx;
|
padding-bottom: 300rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containers {
|
.containers {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
@ -595,27 +589,16 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 999 !important;
|
z-index: 999 !important;
|
||||||
/* background-color: #fff; */
|
|
||||||
z-index: 99;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pages {
|
.pages {
|
||||||
// padding-top: 136rpx !important;
|
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
// text{
|
|
||||||
// display: block;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.sm {
|
.sm {
|
||||||
color: #77808D;
|
color: #77808D;
|
||||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||||
// margin-top: 48rpx;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin-bottom: 84rpx;
|
margin-bottom: 84rpx;
|
||||||
margin-top: 50rpx;
|
margin-top: 50rpx;
|
||||||
|
@ -628,7 +611,6 @@
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
text:nth-child(1) {
|
text:nth-child(1) {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 66rpx;
|
font-size: 66rpx;
|
||||||
|
@ -641,7 +623,6 @@
|
||||||
margin-bottom: 48rpx;
|
margin-bottom: 48rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dblist {
|
.dblist {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -653,23 +634,19 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
|
|
||||||
.lt {
|
.lt {
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-right: 18rpx;
|
margin-right: 18rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 120rpx;
|
width: 120rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cen {
|
.cen {
|
||||||
width: 365rpx;
|
width: 365rpx;
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
|
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -681,7 +658,6 @@
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mac {
|
.mac {
|
||||||
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
|
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -694,11 +670,9 @@
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rt {
|
.rt {
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
display: block;
|
display: block;
|
||||||
width: 108rpx;
|
width: 108rpx;
|
||||||
|
@ -713,7 +687,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.anniu {
|
.anniu {
|
||||||
padding: 0 90rpx;
|
padding: 0 90rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -721,14 +694,12 @@
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 112rpx;
|
bottom: 112rpx;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
background: #8883F0;
|
background: #8883F0;
|
||||||
border-radius: 52rpx 52rpx 52rpx 52rpx;
|
border-radius: 52rpx 52rpx 52rpx 52rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mask {
|
.mask {
|
||||||
width: 622rpx;
|
width: 622rpx;
|
||||||
height: 710rpx;
|
height: 710rpx;
|
||||||
|
@ -743,7 +714,6 @@
|
||||||
padding-left: 60rpx;
|
padding-left: 60rpx;
|
||||||
padding-right: 60rpx;
|
padding-right: 60rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.titles {
|
.titles {
|
||||||
font-size: 48rpx;
|
font-size: 48rpx;
|
||||||
color: #262B37;
|
color: #262B37;
|
||||||
|
@ -751,7 +721,6 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
@ -759,7 +728,6 @@
|
||||||
line-height: 56rpx;
|
line-height: 56rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
margin-top: 46rpx;
|
margin-top: 46rpx;
|
||||||
width: 266rpx;
|
width: 266rpx;
|
||||||
|
|
|
@ -57,8 +57,11 @@
|
||||||
{{row.name.length > 10 ? row.name.substring(0, 10) + '...' : row.name }}({{row.deviceCount}})
|
{{row.name.length > 10 ? row.name.substring(0, 10) + '...' : row.name }}({{row.deviceCount}})
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card_right">
|
<view class="card_right" style="display: flex;align-items: center;">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uzgOF6t4abt95qDf111j" mode="" @click.stop="xiugai(row.storeId,row.name)"
|
<text style="margin-right: 20rpx;font-size: 24rpx;" v-if="row.status == 2">
|
||||||
|
(修改审核中)
|
||||||
|
</text>
|
||||||
|
<image v-else src="https://api.ccttiot.com/smartmeter/img/static/uzgOF6t4abt95qDf111j" mode="" @click.stop="xiugai(row.storeId,row.name)"
|
||||||
style="width: 34rpx;height: 34rpx;margin-right: 30rpx;"></image>
|
style="width: 34rpx;height: 34rpx;margin-right: 30rpx;"></image>
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/u5rf4EUUv9e5KBef4efW" mode="" :data-id="row.HMDrag_id" @touchstart="drag.touchstart"
|
<image src="https://api.ccttiot.com/smartmeter/img/static/u5rf4EUUv9e5KBef4efW" mode="" :data-id="row.HMDrag_id" @touchstart="drag.touchstart"
|
||||||
@touchmove="drag.touchmove" @touchend="drag.touchend"></image>
|
@touchmove="drag.touchmove" @touchend="drag.touchend"></image>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<u-popup v-model="showpopup" mode="center" border-radius='20'>
|
<u-popup v-model="showpopup" mode="center" border-radius='20'>
|
||||||
<view class="popcard" v-if="showremake">
|
<view class="popcard" v-if="showremake">
|
||||||
<view class="tit">
|
<view class="tit">
|
||||||
修改分组名称
|
修改店铺名称
|
||||||
</view>
|
</view>
|
||||||
<view class="ipt">
|
<view class="ipt">
|
||||||
<u-input v-model="remake" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' />
|
<u-input v-model="remake" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' />
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
新建分组
|
新建分组
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="ipt">
|
<view class="ipt">
|
||||||
<u-input v-model="price" placeholder="请输入分组名称" border='surround' placeholder-style='font-size: 24rpx;'/>
|
<u-input v-model="price" placeholder="请输入店铺名称" border='surround' placeholder-style='font-size: 24rpx;'/>
|
||||||
</view>
|
</view>
|
||||||
<view class="btnbox">
|
<view class="btnbox">
|
||||||
<view class="btn2" @click="close()">
|
<view class="btn2" @click="close()">
|
||||||
|
|
|
@ -212,6 +212,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getPhoneNumber(){
|
getPhoneNumber(){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '登录中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
let taht = this
|
let taht = this
|
||||||
wx.login({
|
wx.login({
|
||||||
success(res) {
|
success(res) {
|
||||||
|
@ -221,6 +225,7 @@
|
||||||
}
|
}
|
||||||
taht.$u.post('/app/auth/wxLogin', data).then(res => {
|
taht.$u.post('/app/auth/wxLogin', data).then(res => {
|
||||||
if (res.code == 10003) {
|
if (res.code == 10003) {
|
||||||
|
uni.hideLoading()
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
})
|
||||||
|
@ -268,6 +273,7 @@
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
async ceshi() {
|
async ceshi() {
|
||||||
|
uni.hideLoading()
|
||||||
this.$u.get("/app/user/userInfo").then((res) => {
|
this.$u.get("/app/user/userInfo").then((res) => {
|
||||||
if (this.id == 1) {
|
if (this.id == 1) {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user