正在完善 wifi连接
This commit is contained in:
parent
584ef9e193
commit
247b2582ab
|
@ -20,8 +20,8 @@ const install = (Vue, vm) => {
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
Vue.prototype.$u.http.setConfig({
|
Vue.prototype.$u.http.setConfig({
|
||||||
// baseUrl: 'http://192.168.2.143:10002',
|
baseUrl: 'http://192.168.2.143:10002',
|
||||||
baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
// baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
||||||
loadingText: '努力加载中~',
|
loadingText: '努力加载中~',
|
||||||
loadingTime: 1000,
|
loadingTime: 1000,
|
||||||
// 设置自定义头部content-type
|
// 设置自定义头部content-type
|
||||||
|
|
|
@ -3,6 +3,20 @@
|
||||||
<u-navbar title="设备设置" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36'
|
<u-navbar title="设备设置" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36'
|
||||||
height='50'></u-navbar>
|
height='50'></u-navbar>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
|
|
||||||
|
<view class="icon">
|
||||||
|
<view class="imgbox" v-if="userImgs">
|
||||||
|
<button style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;" @click="getImage">
|
||||||
|
<image style="border-radius: 10rpx;" :src="userImgs" mode="aspectFit"></image>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<view class="imgbox" v-else>
|
||||||
|
<button style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;" @click="getImage">
|
||||||
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uY8CPw9YE6JxPzcHUaqf" mode="aspectFit"></image>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="li" @click.stop="sremakemc()">
|
<view class="li" @click.stop="sremakemc()">
|
||||||
<view class="tit">
|
<view class="tit">
|
||||||
设备名称
|
设备名称
|
||||||
|
@ -48,7 +62,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li" @click="btnwifi">
|
<view class="li" @click="btnwifi">
|
||||||
<view class="tit">
|
<view class="tit">
|
||||||
Wifi配网
|
WiFi配网
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="txt">
|
<view class="txt">
|
||||||
|
@ -224,7 +238,9 @@
|
||||||
name:'',
|
name:'',
|
||||||
deviceId:'',
|
deviceId:'',
|
||||||
isMch:false,
|
isMch:false,
|
||||||
taocan:''
|
taocan:'',
|
||||||
|
token:'',
|
||||||
|
userImgs:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -236,6 +252,7 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.taocan = ''
|
this.taocan = ''
|
||||||
|
this.getQiniuToken()
|
||||||
this.getgroup()
|
this.getgroup()
|
||||||
this.getuserinfo()
|
this.getuserinfo()
|
||||||
this.getao()
|
this.getao()
|
||||||
|
@ -257,10 +274,64 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 修改图片
|
||||||
|
getImage(e) {
|
||||||
|
let _this = this
|
||||||
|
let math = 'static/' + _this.$u.guid(20)
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 9,
|
||||||
|
type: 'all',
|
||||||
|
success(res) {
|
||||||
|
// console.log(res);
|
||||||
|
const tempFilePaths = res.tempFilePaths[0]
|
||||||
|
wx.uploadFile({
|
||||||
|
url: 'https://up-z2.qiniup.com',
|
||||||
|
name: 'file',
|
||||||
|
filePath: tempFilePaths,
|
||||||
|
formData: {
|
||||||
|
token: _this.token, //后端返回的token
|
||||||
|
key: 'smartmeter/img/' + math
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log(res, 'resres');
|
||||||
|
let str = JSON.parse(res.data)
|
||||||
|
_this.userImgs = 'https://api.ccttiot.com/' + str.key
|
||||||
|
let data = {
|
||||||
|
deviceId:_this.id,
|
||||||
|
customPicture:_this.userImgs
|
||||||
|
}
|
||||||
|
_this.$u.put('/app/device', data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.getDevice()
|
||||||
|
uni.showToast({
|
||||||
|
title: '操作成功',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取上传七牛云token
|
||||||
|
getQiniuToken() {
|
||||||
|
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.token = res.token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
getao(){
|
getao(){
|
||||||
this.$u.get(`/app/suit/listByDeviceId/${this.id}`).then(res => {
|
this.$u.get(`/app/suit/listByDeviceId/${this.id}`).then(res => {
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
if(res.data.length > 0){
|
if(res.data.length <= 1){
|
||||||
|
res.data.forEach(item => {
|
||||||
|
this.taocan += item.name
|
||||||
|
})
|
||||||
|
}else{
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
this.taocan += item.name + ','
|
this.taocan += item.name + ','
|
||||||
})
|
})
|
||||||
|
@ -271,7 +342,7 @@
|
||||||
// 点击设置套餐
|
// 点击设置套餐
|
||||||
btntc(){
|
btntc(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_components/newtaocan?id=' + this.id
|
url:'/page_fenbao/statulist/taocanlist/index?id=' + this.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取当前用户信息
|
// 获取当前用户信息
|
||||||
|
@ -284,6 +355,9 @@
|
||||||
},
|
},
|
||||||
// 点击wifi进行配网
|
// 点击wifi进行配网
|
||||||
btnwifi(){
|
btnwifi(){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '蓝牙连接中...'
|
||||||
|
})
|
||||||
if(this.deviceId == ''){
|
if(this.deviceId == ''){
|
||||||
xBlufi.initXBlufi(1);
|
xBlufi.initXBlufi(1);
|
||||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
||||||
|
@ -325,23 +399,27 @@
|
||||||
uni.removeStorageSync('mac');
|
uni.removeStorageSync('mac');
|
||||||
let systemInfo = uni.getSystemInfoSync();
|
let systemInfo = uni.getSystemInfoSync();
|
||||||
if (systemInfo.platform == 'android') {
|
if (systemInfo.platform == 'android') {
|
||||||
|
uni.hideLoading()
|
||||||
// 当前设备是 Android
|
// 当前设备是 Android
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_components/wifilist/index?deviceId=' +this.deviceId + '&name=' +this.name
|
url: '/page_components/wifilist/index?deviceId=' +this.deviceId + '&name=' +this.name
|
||||||
})
|
})
|
||||||
} else if (systemInfo.platform == 'ios') {
|
} else if (systemInfo.platform == 'ios') {
|
||||||
|
uni.hideLoading()
|
||||||
// 当前设备是 iOS
|
// 当前设备是 iOS
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name
|
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}else if(res.msg == '设备编号和mac不能同时为空'){
|
}else if(res.msg == '设备编号和mac不能同时为空'){
|
||||||
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '未找到设备',
|
title: '未连接到设备,请查看蓝牙是否打开以及在设备范围内',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
@ -384,7 +462,7 @@
|
||||||
}
|
}
|
||||||
}else if(res.msg == '设备编号和mac不能同时为空'){
|
}else if(res.msg == '设备编号和mac不能同时为空'){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '未找到设备',
|
title: '未连接到设备,请查看蓝牙是否打开以及在设备范围内',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -629,6 +707,9 @@
|
||||||
this.$u.get("/app/device/" + id).then((res) => {
|
this.$u.get("/app/device/" + id).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.listobj = res.data
|
this.listobj = res.data
|
||||||
|
if(res.data.customPicture){
|
||||||
|
this.userImgs = res.data.customPicture
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -689,11 +770,11 @@
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
||||||
if (!options.result) {
|
if (!options.result) {
|
||||||
console.log("蓝牙未开启", options);
|
console.log("蓝牙未开启", options);
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '蓝牙未开启',
|
// title: '蓝牙未开启',
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
duration: 3000
|
// duration: 3000
|
||||||
});
|
// });
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
// this.searching = true
|
// this.searching = true
|
||||||
|
@ -819,8 +900,8 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #FFFFFF;
|
color: #000;
|
||||||
background-color: #2A82E4;
|
background-color:#fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn1 {
|
.btn1 {
|
||||||
|
@ -831,8 +912,8 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #000;
|
color: #fff;
|
||||||
background-color: #fff;
|
background-color: #8883F0;
|
||||||
border: 1rpx solid #ccc;
|
border: 1rpx solid #ccc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -933,7 +1014,7 @@
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-family: Source Han Sans, Source Han Sans;
|
font-family: Source Han Sans, Source Han Sans;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #2A82E4;
|
color: #8883F0;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -978,4 +1059,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.icon {
|
||||||
|
// display: flex;
|
||||||
|
// flex-wrap: wrap;
|
||||||
|
// align-items: center;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
.imgbox {
|
||||||
|
// width: 33%;
|
||||||
|
image {
|
||||||
|
width: 142rpx;
|
||||||
|
height: 142rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -4,14 +4,14 @@
|
||||||
title-size='36' height='50'></u-navbar> -->
|
title-size='36' height='50'></u-navbar> -->
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uyr6T0Vfkefty2blkDmU" mode="" style="width: 52rpx;height: 52rpx;margin-right: 10rpx;vertical-align: bottom;vertical-align: bottom;" @click="btnshouye"></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uyr6T0Vfkefty2blkDmU" mode="" style="width: 52rpx;height: 52rpx;margin-right: 10rpx;vertical-align: bottom;vertical-align: bottom;" @click="btnshouye"></image>
|
||||||
{{deviceobj.deviceName == undefined ? '--' : deviceobj.deviceName}}
|
<text style="width: 80%;text-align: center;display: inline-block;">{{deviceobj.deviceName == undefined ? '--' : deviceobj.deviceName}}</text>
|
||||||
<view class="wz">
|
<view class="wz">
|
||||||
<!-- 该设备还剩余时长:{{expireTimeStr}}分钟 -->
|
<!-- 该设备还剩余时长:{{expireTimeStr}}分钟 -->
|
||||||
</view>
|
</view>
|
||||||
<view class="wz" v-if="deviceobj.storeContactMobile == null">
|
<view class="wz" style="text-align: right;padding-right: 20rpx;" v-if="deviceobj.storeContactMobile == null">
|
||||||
联系客服:<text @click="call">{{deviceobj.userMobile == undefined ? '--' : deviceobj.userMobile}}</text>
|
联系客服:<text @click="call">{{deviceobj.userMobile == undefined ? '--' : deviceobj.userMobile}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="wz" v-else>
|
<view class="wz" style="text-align: right;padding-right: 20rpx;" v-else>
|
||||||
联系客服:<text @click="call">{{deviceobj.storeContactMobile == undefined ? '--' : deviceobj.storeContactMobile}}</text>
|
联系客服:<text @click="call">{{deviceobj.storeContactMobile == undefined ? '--' : deviceobj.storeContactMobile}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
v-for="(item,index) in deviceobj.suitList" :key="index" @click="btnactive(item)">
|
v-for="(item,index) in deviceobj.suitList" :key="index" @click="btnactive(item)">
|
||||||
<view class="lt">
|
<view class="lt">
|
||||||
<view class="tc">
|
<view class="tc">
|
||||||
{{item.name.length > 5 ? item.name.substring(0,5) + '...' : item.name}}
|
{{item.name.length > 4 ? item.name.substring(0,4) + '...' : item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="date">
|
<view class="date">
|
||||||
{{item.value}} <text v-if="item.timeUnit == 1">日</text> <text v-if="item.timeUnit == 2">时</text> <text v-if="item.timeUnit == 3">分钟</text> <text v-if="item.timeUnit == 4">秒</text>
|
{{item.value}} <text v-if="item.timeUnit == 1">日</text> <text v-if="item.timeUnit == 2">时</text> <text v-if="item.timeUnit == 3">分钟</text> <text v-if="item.timeUnit == 4">秒</text>
|
||||||
|
@ -821,7 +821,7 @@
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
margin-top: 110rpx;
|
margin-top: 110rpx;
|
||||||
height: 200rpx;
|
height: 126rpx;
|
||||||
|
|
||||||
.wz {
|
.wz {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
height='50'></u-navbar>
|
height='50'></u-navbar>
|
||||||
|
|
||||||
<view class="box" v-if="loading">
|
<view class="box" v-if="loading">
|
||||||
|
<view class="" style="color: #ccc;font-size: 28rpx;font-weight: 600;">
|
||||||
|
左滑可删除指定套餐
|
||||||
|
</view>
|
||||||
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in list" :key="item.suitId" @click="click(item)" @open="open" :options="options">
|
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in list" :key="item.suitId" @click="click(item)" @open="open" :options="options">
|
||||||
<view class="boxlist" @click="btnedit(item)">
|
<view class="boxlist" @click="btnedit(item)">
|
||||||
<view class="toptime">
|
<view class="toptime">
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
<view class="device">
|
<view class="device">
|
||||||
<span class="device-list-title">WIFI选择</span>
|
<span class="device-list-title">WIFI选择</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row items-center flex-1 group">
|
<view class="flex-row items-center flex-1 group" style="display: flex;justify-content: space-between;align-items: center;">
|
||||||
<text class="text_3 ml-3">请选择您需要连接的2.4Gwifi名称</text>
|
<view class="text_3 ml-3">请选择您需要连接的2.4GwiFi名称</view>
|
||||||
|
<view class="text_3 ml-3" style="color: #8883F0;display: flex;justify-content: space-between;align-items: center;" @click="btnwifi">
|
||||||
|
<image style="width: 34rpx;height: 34rpx;vertical-align: middle; margin-right: 10rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uhhg02VV44LLPaDJDJO2" mode=""></image> <text>刷新</text> </view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- wifi列表 -->
|
<!-- wifi列表 -->
|
||||||
|
@ -61,6 +63,7 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
var xBlufi = require("@/page_components/blufi/xBlufi.js")
|
||||||
// import jpSelect from '@/components/jp-select/jp-select.vue';
|
// import jpSelect from '@/components/jp-select/jp-select.vue';
|
||||||
// var xBlufi = require("@/page_components/blufi/xBlufi.js");
|
// var xBlufi = require("@/page_components/blufi/xBlufi.js");
|
||||||
export default {
|
export default {
|
||||||
|
@ -124,16 +127,13 @@
|
||||||
that.wifiList = res.wifiList
|
that.wifiList = res.wifiList
|
||||||
// 升序排序
|
// 升序排序
|
||||||
that.wifiList.sort(function(a, b) {
|
that.wifiList.sort(function(a, b) {
|
||||||
return b.signalStrength - a
|
return b.signalStrength - a.signalStrength;
|
||||||
.signalStrength;
|
|
||||||
});
|
});
|
||||||
// 去重
|
// 去重
|
||||||
for (var i = 0; i < that.wifiList.length; i++) {
|
for (var i = 0; i < that.wifiList.length; i++) {
|
||||||
for (var j = i + 1; j < that.wifiList
|
for (var j = i + 1; j < that.wifiList
|
||||||
.length; j++) {
|
.length; j++) {
|
||||||
if (that.wifiList[i].SSID == that.wifiList[
|
if (that.wifiList[i].SSID == that.wifiList[j].SSID) {
|
||||||
j]
|
|
||||||
.SSID) {
|
|
||||||
that.wifiList.splice(j, 1);
|
that.wifiList.splice(j, 1);
|
||||||
j--
|
j--
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,13 @@
|
||||||
onLoad: function(option) {
|
onLoad: function(option) {
|
||||||
// 传过来的蓝牙信息
|
// 传过来的蓝牙信息
|
||||||
this.objlist = option
|
this.objlist = option
|
||||||
console.log(this.objlist, 'listlist')
|
|
||||||
|
// 接受蓝牙信息
|
||||||
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
||||||
|
xBlufi.notifyInitBleEsp32({
|
||||||
|
deviceId: this.objlist.deviceId
|
||||||
|
})
|
||||||
|
|
||||||
var that = this
|
var that = this
|
||||||
wx.startWifi({
|
wx.startWifi({
|
||||||
success: function() {
|
success: function() {
|
||||||
|
@ -231,10 +237,59 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 点击重新获取wifi
|
||||||
|
btnwifi(){
|
||||||
|
var that = this
|
||||||
|
wx.startWifi({
|
||||||
|
success: function() {
|
||||||
|
// Wi-Fi 模块初始化成功
|
||||||
|
console.log('Wi-Fi 模块已初始化');
|
||||||
|
// 在这里可以调用 wx.getWifiList
|
||||||
|
wx.getWifiList({
|
||||||
|
success: function(res) {
|
||||||
|
// 获取 Wi-Fi 列表成功
|
||||||
|
console.log('获取 Wi-Fi 列表成功:', res);
|
||||||
|
// 在这里可以处理 Wi-Fi 列表数据
|
||||||
|
wx.onGetWifiList(function(res) {
|
||||||
|
// 这里是监听获取到 Wi-Fi 列表后的回调函数
|
||||||
|
console.log('ios监听到获取到 Wi-Fi 列表:', res.wifiList);
|
||||||
|
that.wifiList = res.wifiList
|
||||||
|
// 降序排序
|
||||||
|
that.wifiList.sort(function(a, b) {
|
||||||
|
return b.signalStrength - a.signalStrength;
|
||||||
|
});
|
||||||
|
// 去重
|
||||||
|
for (var i = 0; i < that.wifiList.length; i++) {
|
||||||
|
for (var j = i + 1; j < that.wifiList
|
||||||
|
.length; j++) {
|
||||||
|
if (that.wifiList[i].SSID == that.wifiList[j]
|
||||||
|
.SSID) {
|
||||||
|
that.wifiList.splice(j, 1);
|
||||||
|
j--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
that.signalStrengthflag = true
|
||||||
|
that.list = that.wifiList
|
||||||
|
console.log(that.list, '1010'); //在这里提取列表数据
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
// 获取 Wi-Fi 列表失败
|
||||||
|
console.error('获取 Wi-Fi 列表失败:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
// 初始化失败
|
||||||
|
console.error('Wi-Fi 初始化失败:', err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// 点击判断索引是否相同显示图片
|
// 点击判断索引是否相同显示图片
|
||||||
btnqhwifi(index, item) {
|
btnqhwifi(index, item) {
|
||||||
this.indexs = index
|
this.indexs = index
|
||||||
// console.log(item.SSID)
|
|
||||||
this.ssid = item.SSID
|
this.ssid = item.SSID
|
||||||
},
|
},
|
||||||
// 点击进行下一步
|
// 点击进行下一步
|
||||||
|
@ -242,26 +297,179 @@
|
||||||
console.log('panduan1', this.indexs);
|
console.log('panduan1', this.indexs);
|
||||||
if (this.indexs == -1) {
|
if (this.indexs == -1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择需要连接的wifi',
|
title: '请选择需要连接的WiFi',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('panduan2');
|
console.log('panduan2');
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_user/wifijoint/index?ssid=' + JSON.stringify(this.ssid) + '&objlist=' + JSON
|
url: '/page_user/wifijoint/index?ssid=' + JSON.stringify(this.ssid) + '&objlist=' + JSON.stringify(this.objlist)
|
||||||
.stringify(this.objlist)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
btnsd() {
|
btnsd() {
|
||||||
this.ssid = ''
|
this.ssid = ''
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_user/wifijoint/index?objlist=' + JSON.stringify(this.objlist) + '&ssid=' + JSON
|
url: '/page_user/wifijoint/index?objlist=' + JSON.stringify(this.objlist) + '&ssid=' + JSON.stringify(this.ssid)
|
||||||
.stringify(this.ssid)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 点击连接操作
|
||||||
|
content_wf() {
|
||||||
|
if (!this.name) {
|
||||||
|
uni.showToast({
|
||||||
|
title: 'SSID不能为空',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.password) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '密码不能为空',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在配网',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
xBlufi.notifySendCustomData({
|
||||||
|
customData: "ssid@" + this.name + "pass@" + this.password
|
||||||
|
})
|
||||||
|
// xBlufi.notifySendCustomData({
|
||||||
|
// customData: "ssid@" + this.name
|
||||||
|
// })
|
||||||
|
|
||||||
|
// xBlufi.notifySendCustomData({
|
||||||
|
// customData: "pass@" + this.password
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 蓝牙回调
|
||||||
|
funListenDeviceMsgEvent: function(options) {
|
||||||
|
let that = this;
|
||||||
|
switch (options.type) {
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: {
|
||||||
|
console.log('状态', options.result)
|
||||||
|
uni.showModal({
|
||||||
|
title: '很抱歉提醒你!',
|
||||||
|
content: '蓝牙异常断开,请重新连接…',
|
||||||
|
showCancel: false,
|
||||||
|
success: function(res) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/index/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.statusflag = false
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECT_ROUTER_RESULT:
|
||||||
|
uni.hideLoading();
|
||||||
|
if (!options.result)
|
||||||
|
this.statusflag = false,
|
||||||
|
uni.hideLoading(),
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '配网失败,请重试',
|
||||||
|
showCancel: false //是否显示取消按钮
|
||||||
|
});
|
||||||
|
else {
|
||||||
|
if (options.data.progress == 100) {
|
||||||
|
let ssid = options.data.ssid;
|
||||||
|
this.statusflag = false
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: `连接成功`,
|
||||||
|
showCancel: false,
|
||||||
|
success: function(res) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
// let ids = that.$store.state.user.deviceId
|
||||||
|
wx.closeBLEConnection({
|
||||||
|
deviceId: this.objlist.deviceId,
|
||||||
|
})
|
||||||
|
|
||||||
|
// getwifi(ids).then(res => {
|
||||||
|
// console.log(res);
|
||||||
|
// uni.switchTab({
|
||||||
|
// url:'/pages/index/index'
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
|
||||||
|
this.loadPercent = options.data;
|
||||||
|
this.loadText = '文件读取中'
|
||||||
|
console.log("文件读取中", options.data);
|
||||||
|
break;
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
|
||||||
|
|
||||||
|
this.ver_data = this.parseCustomData(options.data)
|
||||||
|
console.log("1收到设备发来的自定义数据结果:", this.ver_data);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case xBlufi.XBLUFI_TYPE.TYPE_INIT_ESP32_RESULT:
|
||||||
|
uni.hideLoading();
|
||||||
|
if (options.result) {
|
||||||
|
console.log('初始化成功');
|
||||||
|
} else {
|
||||||
|
console.log('初始化失败');
|
||||||
|
uni.showModal({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: `设备初始化失败`,
|
||||||
|
showCancel: false,
|
||||||
|
//是否显示取消按钮
|
||||||
|
success: function(res) {
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '../search/search'
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 解析自定义数据
|
||||||
|
parseCustomData(data) {
|
||||||
|
// 将字符串按照 "@" 分割成数组
|
||||||
|
const dataArray = data.split('@');
|
||||||
|
|
||||||
|
// 根据约定,解析各个字段的值
|
||||||
|
const voltage = parseFloat(dataArray[0].substring(1)); // 去除前缀 "V",并将字符串转换为浮点数
|
||||||
|
const switchState = dataArray[1].substring(1); // 去除前缀 "S"
|
||||||
|
const current = parseFloat(dataArray[2].substring(1)); // 去除前缀 "A",并将字符串转换为浮点数
|
||||||
|
const power = parseFloat(dataArray[4].substring(1)); // 去除前缀 "P",并将字符串转换为浮点数
|
||||||
|
const remainingPower = parseFloat(dataArray[5].substring(1)); // 去除前缀 "M",并将字符串转换为浮点数
|
||||||
|
const setMode = dataArray[6].substring(3); // 去除前缀 "SET"
|
||||||
|
|
||||||
|
// 返回解析后的数据对象
|
||||||
|
return {
|
||||||
|
voltage,
|
||||||
|
switchState,
|
||||||
|
current,
|
||||||
|
power,
|
||||||
|
remainingPower,
|
||||||
|
setMode
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -197,6 +197,12 @@
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
|
}else if(this.shopname.length > 5) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '店铺名称过长,不能超过五个字',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
} else if (this.selectortext == '请选择商铺类型') {
|
} else if (this.selectortext == '请选择商铺类型') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择商铺类型',
|
title: '请选择商铺类型',
|
||||||
|
|
|
@ -26,8 +26,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
|
|
||||||
<HM-dragSorts v-if="tcidlist.length > 0" ref="dragSorts" :list="newobj" :tcidlist="tcidlist" @update:tcidlist="handleTcidlistUpdate" :autoScroll="true" :feedbackGenerator="false" @newList="handleNewList" rowHeight='50'
|
<HM-dragSorts ref="dragSorts" :list="newobj" :tcidlist="tcidlist"
|
||||||
@change="change" @confirm="confirm" @onclick="onclick" :listBackgroundColor='F7FAFE'></HM-dragSorts>
|
@update:tcidlist="handleTcidlistUpdate" :autoScroll="true" :feedbackGenerator="false"
|
||||||
|
@newList="handleNewList" rowHeight='50' @change="change" @confirm="confirm" @onclick="onclick"
|
||||||
|
:listBackgroundColor='F7FAFE'></HM-dragSorts>
|
||||||
|
|
||||||
<view class="" v-if="list == ''"
|
<view class="" v-if="list == ''"
|
||||||
style="color: #ccc;font-size: 36rpx;margin-top: 200rpx;text-align: center;">
|
style="color: #ccc;font-size: 36rpx;margin-top: 200rpx;text-align: center;">
|
||||||
|
@ -74,7 +76,7 @@
|
||||||
checkboxes: [],
|
checkboxes: [],
|
||||||
tcidlist: [],
|
tcidlist: [],
|
||||||
titaoc: [],
|
titaoc: [],
|
||||||
newobj:[]
|
newobj: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -108,33 +110,31 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleTcidlistUpdate(newTcidlist) {
|
handleTcidlistUpdate(newTcidlist) {
|
||||||
// 这里是处理接收到的新 tcidlist 的地方
|
// 这里是处理接收到的新 tcidlist 的地方
|
||||||
console.log('接收到的 tcidlist:', newTcidlist);
|
console.log('接收到的 tcidlist:', newTcidlist);
|
||||||
this.tcidlist = newTcidlist
|
this.tcidlist = newTcidlist
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
handleNewList(newList) {
|
handleNewList(newList) {
|
||||||
let list = [this.list, ...newList];
|
let list = [this.list, ...newList]
|
||||||
const newSortedList = list.map((item, index) => {
|
const newSortedList = list.map((item, index) => {
|
||||||
return {
|
return {
|
||||||
storeId: item.suitId,
|
suitId: item.suitId,
|
||||||
groupSort: index + 1 // 使用索引值加 1 作为 groupSort
|
sort: index + 1 // 使用索引值加 1 作为 groupSort
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
console.log("新的排列数据:", newSortedList);
|
let filteredArr = newSortedList.filter(item => item.suitId !== undefined)
|
||||||
setTimeout(()=> {
|
console.log("新的排列数据:", filteredArr)
|
||||||
this.$u.put("/app/store/changeSort",newSortedList).then((res) => {
|
setTimeout(() => {
|
||||||
// this.$forceUpdate()
|
this.$u.put("/app/suit/sort", filteredArr).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// this.getgroup()
|
// this.getgroup()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200)
|
||||||
|
|
||||||
// 在这里处理新的排列数据,可以将其存储到父组件的数据中,或者进行其他操作
|
|
||||||
},
|
},
|
||||||
change(){
|
change() {
|
||||||
|
|
||||||
},
|
},
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
|
@ -152,17 +152,20 @@
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
this.titaoc = res.data
|
this.titaoc = res.data
|
||||||
let uniqueSuitIds = new Set();
|
let uniqueSuitIds = new Set();
|
||||||
this.list.forEach(item => {
|
this.list.forEach(item => {
|
||||||
if (this.titaoc.some(titaocItem => titaocItem.sourceId === item.suitId || titaocItem.suitId === item.suitId)) {
|
if (this.titaoc.some(titaocItem => titaocItem.sourceId === item.suitId || titaocItem.suitId === item.suitId)) {
|
||||||
uniqueSuitIds.add(item.suitId);
|
uniqueSuitIds.add(item.suitId);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.tcidlist = Array.from(uniqueSuitIds);
|
this.tcidlist = Array.from(uniqueSuitIds);
|
||||||
let matchedItems = this.list.filter(item => uniqueSuitIds.has(item.suitId))
|
let matchedItems = this.list.filter(item => uniqueSuitIds.has(item.suitId))
|
||||||
let unmatchedItems = this.list.filter(item => !uniqueSuitIds.has(item.suitId))
|
let unmatchedItems = this.list.filter(item => !uniqueSuitIds.has(item.suitId))
|
||||||
this.list = matchedItems.concat(unmatchedItems)
|
this.list = matchedItems.concat(unmatchedItems)
|
||||||
|
this.newobj = this.list
|
||||||
|
}else{
|
||||||
this.newobj = this.list
|
this.newobj = this.list
|
||||||
|
this.tcidlist = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -181,7 +184,7 @@
|
||||||
|
|
||||||
// 点击确定
|
// 点击确定
|
||||||
btnqd() {
|
btnqd() {
|
||||||
this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res=>{})
|
this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res => {})
|
||||||
let numArr = this.tcidlist.map(item => parseInt(item, 10))
|
let numArr = this.tcidlist.map(item => parseInt(item, 10))
|
||||||
let data = {
|
let data = {
|
||||||
deviceId: this.deviceId,
|
deviceId: this.deviceId,
|
||||||
|
@ -213,9 +216,7 @@
|
||||||
this.list = res.rows
|
this.list = res.rows
|
||||||
this.list = this.list.map(item => ({
|
this.list = this.list.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
checked: false,
|
tcidlist: this.tcidlist
|
||||||
isActive: false,
|
|
||||||
tcidlist:this.tcidlist
|
|
||||||
}))
|
}))
|
||||||
// console.log(this.list);
|
// console.log(this.list);
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
<text class="sm"> {{texts}} </text -->
|
<text class="sm"> {{texts}} </text -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="dblist" v-for="(item, index) in devicesLists" :key="index">
|
<view class="dblist" v-for="(item, index) in devicesLists" :key="index">
|
||||||
|
<!-- <view class="dblist"> -->
|
||||||
<view class="lt">
|
<view class="lt">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uoQO0pUZ1UHcW5uVKkuR" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uGVs6cbSjcuQNXuHhoWi" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="cen">
|
<view class="cen">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
|
@ -19,6 +20,12 @@
|
||||||
<view class="mac">
|
<view class="mac">
|
||||||
MAC:{{item.localName.substring(5)}}
|
MAC:{{item.localName.substring(5)}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="" style="color: #8883F0;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
|
||||||
|
蓝牙强度:{{item.RSSI}}
|
||||||
|
</view>
|
||||||
|
<view @click="btnshows(item,index)" style="color: #8883F0;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
|
||||||
|
型号选择:{{item.xuanz == undefined ? '--' : item.xuanz}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rt">
|
<view class="rt">
|
||||||
<!-- <text style="margin-bottom: 10rpx;" :id="item.deviceId" @tap="createBLEConnections(item)">响铃</text> -->
|
<!-- <text style="margin-bottom: 10rpx;" :id="item.deviceId" @tap="createBLEConnections(item)">响铃</text> -->
|
||||||
|
@ -37,12 +44,14 @@
|
||||||
<text>未扫描到附近未绑定设备:</text>
|
<text>未扫描到附近未绑定设备:</text>
|
||||||
<text>1.确保待连接设备在附近且蓝牙处于打开状态。</text>
|
<text>1.确保待连接设备在附近且蓝牙处于打开状态。</text>
|
||||||
<text>2.确保设备未与其他设备进行蓝牙连接。</text>
|
<text>2.确保设备未与其他设备进行蓝牙连接。</text>
|
||||||
<text>确保设备未被添加过。</text>
|
<text>3.确保设备未被添加过。</text>
|
||||||
<text>...</text>
|
|
||||||
<button @click="btnyc">好的</button>
|
<button @click="btnyc">好的</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="mengcflag" class="mengc" style="width: 100%;height: 100vh;background-color: #000;opacity: .5;position: fixed;top: 0;left: 0;"></view>
|
<view v-if="mengcflag" class="mengc" style="width: 100%;height: 100vh;background-color: #000;opacity: .5;position: fixed;top: 0;left: 0;"></view>
|
||||||
|
|
||||||
|
<!-- 选择蓝牙型号 -->
|
||||||
|
<u-select v-model="shows" :list="arr" @confirm="confirm"></u-select>
|
||||||
<!-- <view class="containers" v-show="statusflag">
|
<!-- <view class="containers" v-show="statusflag">
|
||||||
<uni-section>
|
<uni-section>
|
||||||
<uni-load-more :status="status" />
|
<uni-load-more :status="status" />
|
||||||
|
@ -85,12 +94,16 @@
|
||||||
backgroundColor: "#8883f0",
|
backgroundColor: "#8883f0",
|
||||||
},
|
},
|
||||||
lurulist: [],
|
lurulist: [],
|
||||||
|
arr:[],
|
||||||
|
shows:false,
|
||||||
|
arrname:'',
|
||||||
|
valuexh:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// console.log(option);
|
// console.log(option);
|
||||||
this.getluru()
|
this.getluru()
|
||||||
|
this.getxingh()
|
||||||
this.storeId = option.sn
|
this.storeId = option.sn
|
||||||
xBlufi.initXBlufi(1);
|
xBlufi.initXBlufi(1);
|
||||||
console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
|
console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
|
||||||
|
@ -152,6 +165,37 @@
|
||||||
this.videoContext = uni.createVideoContext('myVideo', this)
|
this.videoContext = uni.createVideoContext('myVideo', this)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getxingh(){
|
||||||
|
this.$u.get(`/app/model/all`).then(res => {
|
||||||
|
if(res.code == 200){
|
||||||
|
this.arr = res.data
|
||||||
|
this.arr.forEach(item => {
|
||||||
|
if (item.hasOwnProperty('modelId')) {
|
||||||
|
item.value = item.modelId;
|
||||||
|
}
|
||||||
|
if (item.hasOwnProperty('modelName')) {
|
||||||
|
item.label = item.modelName;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log(this.arr,'2121212')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
btnshows(item,index){
|
||||||
|
this.arrname = item.name
|
||||||
|
this.shows = true
|
||||||
|
},
|
||||||
|
// 选择型号
|
||||||
|
confirm(e){
|
||||||
|
this.devicesLists.forEach(item => {
|
||||||
|
if(item.name == this.arrname){
|
||||||
|
item.xuanz = e[0].label
|
||||||
|
this.valuexh = e[0].value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.devicesLists,'021515615');
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
btnyc() {
|
btnyc() {
|
||||||
this.titleflag = false
|
this.titleflag = false
|
||||||
|
@ -161,7 +205,7 @@
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
||||||
if (options.result) {
|
if (options.result) {
|
||||||
let devicesarr = options.data
|
let devicesarr = options.data
|
||||||
console.log(devicesarr,100100);
|
// console.log(devicesarr,100100);
|
||||||
devicesarr.forEach(device => {
|
devicesarr.forEach(device => {
|
||||||
const mac = device.name.substring(5);
|
const mac = device.name.substring(5);
|
||||||
if (device.name.substring(0, 4) == "CTKG") {
|
if (device.name.substring(0, 4) == "CTKG") {
|
||||||
|
@ -171,6 +215,7 @@
|
||||||
const deviceId = device.name.substring(5);
|
const deviceId = device.name.substring(5);
|
||||||
return !this.lurulist.includes(deviceId);
|
return !this.lurulist.includes(deviceId);
|
||||||
})
|
})
|
||||||
|
// console.log(this.devicesLists);
|
||||||
// 将去重后的数组重新赋值给 this.devicesList
|
// 将去重后的数组重新赋值给 this.devicesList
|
||||||
// this.devicesList = uniqueDevicesList;
|
// this.devicesList = uniqueDevicesList;
|
||||||
}
|
}
|
||||||
|
@ -189,46 +234,6 @@
|
||||||
{
|
{
|
||||||
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
||||||
"连接回调options.data.name:" + options.data.name);
|
"连接回调options.data.name:" + options.data.name);
|
||||||
|
|
||||||
// let data = {
|
|
||||||
// sn:this.storeId,
|
|
||||||
// mac:this.mac
|
|
||||||
// }
|
|
||||||
// this.$u.post('/app/device', data).then((res) => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '录入成功',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// })
|
|
||||||
// uni.hideLoading()
|
|
||||||
// uni.removeStorageSync('mac');
|
|
||||||
|
|
||||||
// let vm = this
|
|
||||||
// uni.showModal({
|
|
||||||
// title: '提示',
|
|
||||||
// content: '你已录入成功,是否返回首页?',
|
|
||||||
// success: function (res) {
|
|
||||||
// if (res.confirm) {
|
|
||||||
// setTimeout(()=>{
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:'/pages/shouye/index'
|
|
||||||
// })
|
|
||||||
// },1000)
|
|
||||||
// } else if (res.cancel) {
|
|
||||||
// console.log('用户点击了取消');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// uni.hideLoading()
|
|
||||||
// uni.showToast({
|
|
||||||
// title: res.msg,
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,9 +262,14 @@
|
||||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||||
// console.log(uniqueDevicesList,'uniqueDevicesListuniqueDevicesList');
|
// console.log(uniqueDevicesList,'uniqueDevicesListuniqueDevicesList');
|
||||||
// 将去重后的数组重新赋值给 this.devicesList
|
// 将去重后的数组重新赋值给 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 !this.lurulist.includes(deviceId);
|
// return !this.lurulist.includes(deviceId);
|
||||||
|
// })
|
||||||
|
this.devicesLists = uniqueDevicesList.map(device => {
|
||||||
|
const deviceId = device.name.substring(5);
|
||||||
|
const newDevice = { ...device, xuanz: "请选择" }; // 直接在复制时添加 xuanz 字段
|
||||||
|
return newDevice;
|
||||||
})
|
})
|
||||||
console.log('蓝牙停止搜索ok')
|
console.log('蓝牙停止搜索ok')
|
||||||
if (this.devicesLists.length == 0) {
|
if (this.devicesLists.length == 0) {
|
||||||
|
@ -327,12 +337,13 @@
|
||||||
// 录入设备
|
// 录入设备
|
||||||
let data = {
|
let data = {
|
||||||
sn: this.storeId,
|
sn: this.storeId,
|
||||||
mac: this.mac
|
mac: this.mac,
|
||||||
|
modelId:this.valuexh
|
||||||
}
|
}
|
||||||
this.$u.post('/app/device', data).then((res) => {
|
this.$u.post('/app/device', data).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '设备录入成功',
|
title: '设备:'+ this.mac +'已录入成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
@ -340,7 +351,7 @@
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},2000)
|
},1000)
|
||||||
uni.removeStorageSync('mac');
|
uni.removeStorageSync('mac');
|
||||||
// uni.showModal({
|
// uni.showModal({
|
||||||
// title: '提示',
|
// title: '提示',
|
||||||
|
@ -434,7 +445,7 @@
|
||||||
|
|
||||||
.pages {
|
.pages {
|
||||||
// padding-top: 136rpx !important;
|
// padding-top: 136rpx !important;
|
||||||
padding: 0 66rpx;
|
padding: 0 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,16 +499,16 @@
|
||||||
.lt {
|
.lt {
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin-right: 38rpx;
|
margin-right: 18rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 42rpx;
|
width: 120rpx;
|
||||||
// height: 112rpx;
|
height: 200rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cen {
|
.cen {
|
||||||
width: 370rpx;
|
width: 365rpx;
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
@ -527,8 +538,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.rt {
|
.rt {
|
||||||
margin-top: 22rpx;
|
margin-top: 32rpx;
|
||||||
|
padding-top: 50rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
text {
|
text {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 108rpx;
|
width: 108rpx;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<!-- 拖拽中显示的行 -->
|
<!-- 拖拽中显示的行 -->
|
||||||
<view class="rowBox-shadow" id="shadowRowBox">
|
<view class="rowBox-shadow" id="shadowRowBox">
|
||||||
<view class="hm-row-shadow move" id="shadowRow">
|
<view class="hm-row-shadow move" id="shadowRow">
|
||||||
<view class="modules" v-if="false">
|
<view class="modules" >
|
||||||
<!-- 内容 -->
|
<!-- 内容 v-if="false"-->
|
||||||
<view class="row-content">
|
<view class="row-content">
|
||||||
<view class="row" :style="{'height': rowHeight+'px'}">
|
<view class="row" :style="{'height': rowHeight+'px'}">
|
||||||
<image v-if="shadowRow.icon" class="icon" :src="shadowRow.icon"></image>
|
<image v-if="shadowRow.icon" class="icon" :src="shadowRow.icon"></image>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="card" >
|
<view class="card">
|
||||||
|
|
||||||
<view class="card_left">
|
<view class="card_left">
|
||||||
<view class="img">
|
<view class="img">
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card_right">
|
<view class="card_right">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uzgOF6t4abt95qDf111j" mode="" @click.stop="xiugai(row.storeId)"
|
<image 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>
|
||||||
|
@ -279,8 +279,8 @@
|
||||||
this.pushWxsData('longTouch', this.longTouch);
|
this.pushWxsData('longTouch', this.longTouch);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
xiugai(id){
|
xiugai(id,name){
|
||||||
this.$parent.putgroupname(id)
|
this.$parent.putgroupname(id,name)
|
||||||
},
|
},
|
||||||
del(id){
|
del(id){
|
||||||
this.$parent.delgroup(id)
|
this.$parent.delgroup(id)
|
||||||
|
|
|
@ -136,6 +136,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
}else if(num==2){
|
}else if(num==2){
|
||||||
|
|
||||||
let data ={
|
let data ={
|
||||||
name:this.price,
|
name:this.price,
|
||||||
groupSort:1
|
groupSort:1
|
||||||
|
@ -195,8 +196,9 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
putgroupname(id){
|
putgroupname(id,name){
|
||||||
this.groupid=id
|
this.groupid=id
|
||||||
|
this.remake = name
|
||||||
this.sremake()
|
this.sremake()
|
||||||
},
|
},
|
||||||
handleNewList(newList) {
|
handleNewList(newList) {
|
||||||
|
@ -209,8 +211,9 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
console.log("新的排列数据:", newSortedList);
|
console.log("新的排列数据:", newSortedList);
|
||||||
|
let filteredArr = newSortedList.filter(item => item.storeId !== null)
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
this.$u.put("/app/store/changeSort",newSortedList).then((res) => {
|
this.$u.put("/app/store/changeSort",filteredArr).then((res) => {
|
||||||
// this.$forceUpdate()
|
// this.$forceUpdate()
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// this.getgroup()
|
// this.getgroup()
|
||||||
|
@ -376,8 +379,8 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #FFFFFF;
|
color: #000;
|
||||||
background-color: #2A82E4;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.btn1{
|
.btn1{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -392,8 +395,8 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #000;
|
color: #fff;
|
||||||
background-color: #fff;
|
background-color: #8883F0;
|
||||||
border: 1rpx solid #ccc;
|
border: 1rpx solid #ccc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
<view class="mid_left">
|
<view class="mid_left">
|
||||||
<button v-if="opflag" style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;border: 1rpx solid #ccc;"
|
<button v-if="opflag" style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;border: 1rpx solid #ccc;"
|
||||||
type="primary reverse" open-type="chooseAvatar" @chooseavatar="btnpic">
|
type="primary reverse" open-type="chooseAvatar" @chooseavatar="btnpic">
|
||||||
<image :src="imglist" mode=""
|
<image :src="imglist" mode="aspectFit"
|
||||||
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
||||||
</button>
|
</button>
|
||||||
<image v-else :src="imglist" mode=""
|
<image v-else :src="imglist" mode="aspectFit"
|
||||||
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
||||||
<!-- <image :src="imglist" mode=""></image> -->
|
<!-- <image :src="imglist" mode=""></image> -->
|
||||||
</view>
|
</view>
|
||||||
|
@ -35,10 +35,10 @@
|
||||||
<view class="txt" v-if="deviceInfo">
|
<view class="txt" v-if="deviceInfo">
|
||||||
S/N码:{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
|
S/N码:{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
|
||||||
<div class="tip" v-if="deviceInfo.onlineStatus==1">在线</div>
|
<div class="tip" v-if="deviceInfo.onlineStatus==1">在线</div>
|
||||||
<div class="tip" v-if="deviceInfo.onlineStatus==0">离线</div>
|
<div class="tip" v-if="deviceInfo.onlineStatus==0" style="color: #ccc;">离线</div>
|
||||||
<div class="tip" v-if="deviceInfo.status==1">空闲</div>
|
<div class="tip" v-if="deviceInfo.status==1">空闲</div>
|
||||||
<div class="tip" v-if="deviceInfo.status==2">使用中</div>
|
<div class="tip" v-if="deviceInfo.status==2">使用中</div>
|
||||||
<div class="tip" v-if="deviceInfo.status==3">维修中</div>
|
<div class="tip" v-if="deviceInfo.status==3" style="color: red;">维修中</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -297,33 +297,33 @@
|
||||||
}, 100)
|
}, 100)
|
||||||
this.getQiniuToken()
|
this.getQiniuToken()
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
// onUnload: function() {
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
// xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
xBlufi.notifyStartDiscoverBle({
|
// xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
// 'isStart': false
|
||||||
});
|
// });
|
||||||
wx.closeBLEConnection({
|
// wx.closeBLEConnection({
|
||||||
deviceId: this.deviceId,
|
// deviceId: this.deviceId,
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
onHide() {
|
// onHide() {
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
// xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
xBlufi.notifyStartDiscoverBle({
|
// xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
// 'isStart': false
|
||||||
});
|
// });
|
||||||
wx.closeBLEConnection({
|
// wx.closeBLEConnection({
|
||||||
deviceId: this.deviceId,
|
// deviceId: this.deviceId,
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
onBeforeUnmount() {
|
// onBeforeUnmount() {
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
// xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
xBlufi.notifyStartDiscoverBle({
|
// xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
// 'isStart': false
|
||||||
});
|
// });
|
||||||
wx.closeBLEConnection({
|
// wx.closeBLEConnection({
|
||||||
deviceId: this.deviceId,
|
// deviceId: this.deviceId,
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
// 开启和关闭
|
// 开启和关闭
|
||||||
btnkq(){
|
btnkq(){
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<view class="tit">
|
<view class="tit">
|
||||||
Wifi名称
|
WiFi名称
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="txt">
|
<view class="txt">
|
||||||
|
|
|
@ -107,21 +107,18 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="card_left_no" @click="todetail(item.deviceId)">
|
<view class="card_left_no" :class="item.onlineStatus == 0 ? 'activewzgl' : ''" @click="todetail(item.deviceId)">
|
||||||
S/N码:{{item.deviceNo}}
|
S/N码:{{item.deviceNo}}
|
||||||
</view>
|
</view>
|
||||||
<view @click="sremakes(item)" v-if="item.storeId == null" class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 180rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-top: 20rpx;">
|
<view @click="sremakes(item)" v-if="item.storeId == null" class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 180rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-top: 20rpx;">
|
||||||
未分配店铺
|
未分配店铺
|
||||||
</view>
|
</view>
|
||||||
<view v-else style="color: #ccc;margin-top: 20rpx;" @click="todetail(item.deviceId)">
|
<view v-else :class="item.onlineStatus == 0 ? 'activewzgl' : ''" style="color: #95989D;margin-top: 20rpx;" @click="todetail(item.deviceId)">
|
||||||
归属店铺: {{item.storeName == null ? '--' : item.storeName}}
|
归属店铺: {{item.storeName == null ? '--' : item.storeName}} | <text v-if="item.onlineStatus == 1" style="margin-left: 10rpx;">在线</text> <text v-else>离线</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view @click="sremakes(item)" v-else class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 200rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-top: 20rpx;">
|
|
||||||
已分配店铺
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="card_right" @click="todetail(item.deviceId)">
|
<view class="card_right" @click="todetail(item.deviceId)">
|
||||||
<image v-if="item.customPicture" :src="item.customPicture" mode=""
|
<image v-if="item.customPicture" :src="item.customPicture" mode="aspectFit"
|
||||||
style="border-radius: 20rpx;"></image>
|
style="border-radius: 20rpx;"></image>
|
||||||
<image v-else :src="item.picture" mode=""></image>
|
<image v-else :src="item.picture" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
|
@ -884,6 +881,9 @@
|
||||||
background-color: #F7FAFE;
|
background-color: #F7FAFE;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.activewzgl{
|
||||||
|
color: #ccc !important;
|
||||||
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1436,7 +1436,7 @@
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||||
|
|
||||||
.card_left {
|
.card_left {
|
||||||
width: 310rpx;
|
width: 100%;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-left: 50rpx;
|
margin-left: 50rpx;
|
||||||
|
|
||||||
|
|
|
@ -75,10 +75,10 @@
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uGlrjkSOTDXMFuuRb03l" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uGlrjkSOTDXMFuuRb03l" mode=""></image>
|
||||||
<view class="txt">意见反馈</view>
|
<view class="txt">意见反馈</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="botcard" @click="btnmy">
|
<!-- <view class="botcard" @click="btnmy">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uCtxeWyTyH2DHQZaRv5Q" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uCtxeWyTyH2DHQZaRv5Q" mode=""></image>
|
||||||
<view class="txt">秘钥管理</view>
|
<view class="txt">秘钥管理</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="botcard" @click="btnguanli">
|
<view class="botcard" @click="btnguanli">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/umjPUc8nDKf1JwVqRAeb" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/umjPUc8nDKf1JwVqRAeb" mode=""></image>
|
||||||
<view class="txt">套餐管理</view>
|
<view class="txt">套餐管理</view>
|
||||||
|
|
|
@ -13,14 +13,19 @@
|
||||||
<view class="ongoing_order" v-if="sylist.length > 0">
|
<view class="ongoing_order" v-if="sylist.length > 0">
|
||||||
<view class="order_top">
|
<view class="order_top">
|
||||||
<view class="order_lt">
|
<view class="order_lt">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uFNuOet0fB5Bwe1c26sk" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uFNuOet0fB5Bwe1c26sk" mode="">
|
||||||
|
</image>
|
||||||
<text>您有正在使用中的设备...</text>
|
<text>您有正在使用中的设备...</text>
|
||||||
</view>
|
</view>
|
||||||
<image @click="btnorder" v-if="!listflag" src="https://api.ccttiot.com/smartmeter/img/static/ublEB3HEjyfZbnKS2Ai9" mode=""></image>
|
<image @click="btnorder" v-if="!listflag"
|
||||||
<image @click="btnorders" v-if="listflag" style="transform: rotate(180deg);margin-top: 20rpx;" src="https://api.ccttiot.com/smartmeter/img/static/ublEB3HEjyfZbnKS2Ai9" mode=""></image>
|
src="https://api.ccttiot.com/smartmeter/img/static/ublEB3HEjyfZbnKS2Ai9" mode=""></image>
|
||||||
|
<image @click="btnorders" v-if="listflag" style="transform: rotate(180deg);margin-top: 20rpx;"
|
||||||
|
src="https://api.ccttiot.com/smartmeter/img/static/ublEB3HEjyfZbnKS2Ai9" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="order_list" v-for="(item,index) in sylist" :key="index" v-if="listflag" @click="btnitem(item.deviceId)">
|
<view class="order_list" v-for="(item,index) in sylist" :key="index" v-if="listflag"
|
||||||
<text>{{item.deviceName}}</text> <image src="https://api.ccttiot.com/smartmeter/img/static/uZoBXJ0MLrGUSBFk5lGp" mode=""></image>
|
@click="btnitem(item.deviceId)">
|
||||||
|
<text>{{item.deviceName}}</text>
|
||||||
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uZoBXJ0MLrGUSBFk5lGp" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 正在进行中的订单结束 --><!-- 正在进行中的订单结束 -->
|
<!-- 正在进行中的订单结束 --><!-- 正在进行中的订单结束 -->
|
||||||
|
@ -53,7 +58,8 @@
|
||||||
style="width: 96rpx;height:94rpx;"></image>
|
style="width: 96rpx;height:94rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="gr" @click="btnindex(6)" v-else>
|
<view class="gr" @click="btnindex(6)" v-else>
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/u3NDAI21OIGQH0Exdmdd" mode="" style="width: 96rpx;height:94rpx;"></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/u3NDAI21OIGQH0Exdmdd" mode=""
|
||||||
|
style="width: 96rpx;height:94rpx;"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="guangg" @click="btnad">
|
<view class="guangg" @click="btnad">
|
||||||
|
@ -90,7 +96,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listflag:false,
|
listflag: false,
|
||||||
params: {
|
params: {
|
||||||
year: true,
|
year: true,
|
||||||
month: true,
|
month: true,
|
||||||
|
@ -119,91 +125,79 @@
|
||||||
},
|
},
|
||||||
deviceobj: {},
|
deviceobj: {},
|
||||||
deviceCount: 0,
|
deviceCount: 0,
|
||||||
sylist:[]
|
sylist: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
if (option.flag) {
|
// if (option.flag) {
|
||||||
let id = option.id
|
// let id = option.id
|
||||||
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
|
// this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
|
||||||
if (res.code == 200) {
|
// if (res.code == 200) {
|
||||||
this.deviceobj = res.data
|
// this.deviceobj = res.data
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
let that = this
|
// let that = this
|
||||||
// uni.showModal({
|
// let data = {
|
||||||
// title: '提示',
|
// deviceNo: id
|
||||||
// content: '该设备未被绑定,你需进行绑定吗?',
|
// }
|
||||||
// success: function(res) {
|
// that.$u.put("/app/device/bind", data).then(res => {
|
||||||
// if (res.confirm) {
|
// if (res.code == 200) {
|
||||||
let data = {
|
// uni.showModal({
|
||||||
deviceNo: id
|
// title: '提示',
|
||||||
}
|
// content: '该设备未绑定,你需进行绑定吗?',
|
||||||
that.$u.put("/app/device/bind", data).then(res => {
|
// success: function(res) {
|
||||||
if (res.code == 200) {
|
// if (res.confirm) {
|
||||||
uni.showModal({
|
// uni.navigateTo({
|
||||||
title: '提示',
|
// url: '/page_components/bindsz?id=' + that.deviceobj.deviceId
|
||||||
content: '该设备未绑定,你需进行绑定吗?',
|
// })
|
||||||
success: function(res) {
|
// } else if (res.cancel) {
|
||||||
if (res.confirm) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/page_components/bindsz?id=' + that.deviceobj.deviceId
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
if (res.msg == '设备未录入') {
|
// if (res.msg == '设备未录入') {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: '提示',
|
// title: '提示',
|
||||||
content: '该设备未录入,你需进行录入吗?',
|
// content: '该设备未录入,你需进行录入吗?',
|
||||||
success: function(res) {
|
// success: function(res) {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: '/page_fenbao/zhuce?sn=' + id
|
// url: '/page_fenbao/zhuce?sn=' + id
|
||||||
})
|
// })
|
||||||
} else if (res.cancel) {
|
// } else if (res.cancel) {
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: res.msg,
|
// title: res.msg,
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
duration: 1000
|
// duration: 1000
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
// } else if (res.cancel) {
|
// }
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/shouye/index'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 分享到好友(会话)
|
// 分享到好友(会话)
|
||||||
onShareAppMessage: function () {
|
onShareAppMessage: function() {
|
||||||
return {
|
return {
|
||||||
title: '创想物联',
|
title: '创想物联',
|
||||||
path: '/pages/shouye/index'
|
path: '/pages/shouye/index'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
onShareTimeline: function () {
|
onShareTimeline: function() {
|
||||||
return {
|
return {
|
||||||
title: '创想物联',
|
title: '创想物联',
|
||||||
query: '',
|
query: '',
|
||||||
path: '/pages/shouye/index'
|
path: '/pages/shouye/index'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.logins()
|
this.logins()
|
||||||
this.getad()
|
this.getad()
|
||||||
|
@ -223,7 +217,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 请求正在使用的设备列表
|
// 请求正在使用的设备列表
|
||||||
getshiy(){
|
getshiy() {
|
||||||
this.$u.get("/app/device/usingDevice").then((res) => {
|
this.$u.get("/app/device/usingDevice").then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.sylist = res.data
|
this.sylist = res.data
|
||||||
|
@ -231,17 +225,17 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
btnitem(deviceId){
|
btnitem(deviceId) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_components/eletj?id=' + deviceId
|
url: '/page_components/eletj?id=' + deviceId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 点击显示使用中设备
|
// 点击显示使用中设备
|
||||||
btnorder(){
|
btnorder() {
|
||||||
this.listflag = true
|
this.listflag = true
|
||||||
},
|
},
|
||||||
btnorders(){
|
btnorders() {
|
||||||
this.listflag = false
|
this.listflag = false
|
||||||
},
|
},
|
||||||
|
|
||||||
btnad() {
|
btnad() {
|
||||||
|
@ -288,10 +282,54 @@
|
||||||
let decodedValue = decodeURIComponent(sceneValue)
|
let decodedValue = decodeURIComponent(sceneValue)
|
||||||
let id = getQueryParam(decodedValue, 's')
|
let id = getQueryParam(decodedValue, 's')
|
||||||
// console.log(res, id)
|
// console.log(res, id)
|
||||||
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
|
let that = this
|
||||||
if (res.code == 200) {
|
let data = {
|
||||||
uni.navigateTo({
|
deviceNo: id
|
||||||
url: '/page_components/fuwu/index?id=' + id
|
}
|
||||||
|
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
|
||||||
|
if (res.data == 2) {
|
||||||
|
that.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/page_components/fuwu/index?id=' + id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (res.data == 1) {
|
||||||
|
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) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/page_components/bindsz?id=' + res.data.deviceId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (res.data == 0) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '该设备未录入,你需进行录入吗?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/page_fenbao/zhuce?sn=' + id
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -926,7 +964,8 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 48rpx;
|
top: 48rpx;
|
||||||
left: 34rpx;
|
left: 34rpx;
|
||||||
.order_list{
|
|
||||||
|
.order_list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
// background-color: rgba(0, 0, 0, 0.6);
|
// background-color: rgba(0, 0, 0, 0.6);
|
||||||
|
@ -941,16 +980,18 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
line-height: 110rpx;
|
line-height: 110rpx;
|
||||||
animation: fadeInDown .5s ease-out forwards;
|
animation: fadeInDown .5s ease-out forwards;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 17rpx;
|
width: 17rpx;
|
||||||
height: 34rpx;
|
height: 34rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.order_top {
|
.order_top {
|
||||||
width: 622rpx;
|
width: 622rpx;
|
||||||
height: 94rpx;
|
height: 94rpx;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0,0,0,0.3);
|
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.3);
|
||||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -964,13 +1005,15 @@
|
||||||
.order_lt {
|
.order_lt {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 44rpx;
|
width: 44rpx;
|
||||||
height: 62rpx;
|
height: 62rpx;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 47rpx;
|
width: 47rpx;
|
||||||
height: 47rpx;
|
height: 47rpx;
|
||||||
padding-bottom: 10rpx;
|
padding-bottom: 10rpx;
|
||||||
|
@ -1021,14 +1064,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeInDown {
|
@keyframes fadeInDown {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-20px);
|
transform: translateY(-20px);
|
||||||
}
|
}
|
||||||
to {
|
|
||||||
opacity: 1;
|
to {
|
||||||
transform: translateY(0);
|
opacity: 1;
|
||||||
}
|
transform: translateY(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user