This commit is contained in:
3321822538@qq.com 2024-12-13 17:20:05 +08:00
parent 5a88ee7ace
commit 1500c8954f
2 changed files with 118 additions and 86 deletions

View File

@ -761,7 +761,7 @@
this.getzfqd() this.getzfqd()
this.getprice() this.getprice()
if (this.detaobj.suitFeeMode == 1) { if (this.detaobj.suitFeeMode == 1) {
if (this.onlineStatus == 0) { if (this.onlineStatus == 1) {
let that = this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@ -773,22 +773,32 @@
} }
that.$u.put(`/app/bill/endUse`, data).then(res => { that.$u.put(`/app/bill/endUse`, data).then(res => {
if (res.code == 200) { if (res.code == 200) {
if(res.data.deviceResult == false){ // if(res.data.deviceResult && res.data.deviceResult == false){
// uni.showToast({
// title: res.data.deviceMsg,
// icon: 'none',
// duration: 2000
// })
// setTimeout(()=>{
// uni.reLaunch({
// url: '/pages/shouye/index'
// })
// },1500)
// }else{
// uni.reLaunch({
// url: '/pages/shouye/index'
// })
// }
uni.showToast({ uni.showToast({
title: res.data.deviceMsg, title: '结束成功',
icon: 'none', icon: 'success',
duration: 2000 duration: 1000
}) })
setTimeout(()=>{ setTimeout(()=>{
uni.reLaunch({ uni.reLaunch({
url: '/pages/shouye/index' url: '/pages/shouye/index'
}) })
},1500) },1500)
}else{
uni.reLaunch({
url: '/pages/shouye/index'
})
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,

View File

@ -5,22 +5,22 @@
<!-- 样式 --> <!-- 样式 -->
<view class="container" style="margin-top: 50rpx;"> <view class="container" style="margin-top: 50rpx;">
<view class="device"> <view class="device">
<span class="device-list-title">WIFI选择</span> <span class="device-list-title"> <image style="width: 30rpx;height: 30rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uUwOlSoho5fNOXBHVQ8D" mode=""></image> 提示</span>
<view class="" v-if="objlist.wifi"> <view class="text_3 ml-3" style="font-size: 24rpx;color: #1E1D20;">本设备只支持2.4G-WiFi网络暂不支持5G-WiFi网络</view>
该设备已成功连接WIFI{{objlist.wifi}}
</view> </view>
</view> <!-- <view class="flex-row items-center flex-1 group" style="display: flex;justify-content: space-between;align-items: center;">
<view class="flex-row items-center flex-1 group" style="display: flex;justify-content: space-between;align-items: center;">
<view class="text_3 ml-3" style="width: 350rpx;flex-wrap: wrap;">本设备只支持2.4G-WIFI网络 暂不支持5G-WIFI</view>
<view class="text_3 ml-3" style="color: #8883F0;display: flex;justify-content: space-between;align-items: center;" @click="btnwifi"> <view class="text_3 ml-3" style="color: #8883F0;display: flex;justify-content: space-between;align-items: center;" @click="btnwifi">
<image class="sximg" src="https://api.ccttiot.com/smartmeter/img/static/uhhg02VV44LLPaDJDJO2" mode="aspectFit" :style="{ transform: 'rotate(' + rotateDegree + 'deg)' }" ></image> <image class="sximg" src="https://api.ccttiot.com/smartmeter/img/static/uhhg02VV44LLPaDJDJO2" mode="aspectFit" :style="{ transform: 'rotate(' + rotateDegree + 'deg)' }" ></image>
<text>刷新</text> </view> <text>刷新</text> </view>
</view> </view> -->
<!-- wifi列表 --> <!-- wifi列表 v-if="signalStrengthflag"-->
<view class="wifilist"> <view class="wifilist">
<view class="bd" v-for="(item,index) in 10" :key="index" @click="btnqhwifi(index,item)" <view class="top">
v-if="signalStrengthflag"> <image src="https://api.ccttiot.com/smartmeter/img/static/uCN5HZjWwMqVQkbccAxa" mode=""></image> 请选择您需要连接的WiFi名称
</view>
<view class="bd" v-for="(item,index) in list" :key="index" @click="btnqhwifi(index,item)"
>
<view class="bdbox"> <view class="bdbox">
<view class="box"> <view class="box">
<ul> <ul>
@ -46,10 +46,14 @@
</li> </li>
</ul> </ul>
</view> </view>
<view class="content"> <view class="content">
<view class="bt">{{item.SSID == '' ? 'CMCC-eaca' : item.SSID}}</view> <view class="bt">{{item.SSID == '' ? 'CMCC-eaca' : item.SSID}}</view>
<!-- <view class="wz" style="color: #8883F0 ;">{{item.BSSID}}</view> --> </view>
<view class="" style="font-size: 24rpx;color: #8883F0;" v-if="item.SSID == this.objlist.wifi">
已连接
</view>
<view class="" style="font-size: 24rpx;color: #8883F0;width: 20rpx;" v-else>
</view> </view>
</view> </view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uLrArPv3OrIodtWZ3gri" mode="aspectFit" <image src="https://api.ccttiot.com/smartmeter/img/static/uLrArPv3OrIodtWZ3gri" mode="aspectFit"
@ -58,8 +62,8 @@
</view> </view>
</view> </view>
<view class="annius" style="display: flex;justify-content: space-between;"> <view class="annius" style="display: flex;justify-content: space-between;">
<view class="" @click="btnsd">手动添加其他网络</view> <view style="width: 246rpx;" @click="btnwifi"> 重新搜索</view>
<!-- <view class="" @click="btnxyb">下一步</view> --> <view style="width: 374rpx;" @click="btnsd">未找到手动添加WIFI</view>
</view> </view>
</view> </view>
@ -241,7 +245,7 @@
dotShowInterval: null, dotShowInterval: null,
devicesList:[], devicesList:[],
ver_data:'', ver_data:'',
ljljflag:true // ljljflag:true
}; };
}, },
@ -255,16 +259,11 @@
var that = this var that = this
wx.startWifi({ wx.startWifi({
success: function() { success: function() {
// Wi-Fi
console.log('Wi-Fi 模块已初始化'); console.log('Wi-Fi 模块已初始化');
// wx.getWifiList
wx.getWifiList({ wx.getWifiList({
success: function(res) { success: function(res) {
// Wi-Fi
console.log('获取 Wi-Fi 列表成功:', res); console.log('获取 Wi-Fi 列表成功:', res);
// Wi-Fi
wx.onGetWifiList(function(res) { wx.onGetWifiList(function(res) {
// Wi-Fi
console.log('监听到获取到 Wi-Fi 列表:', res.wifiList); console.log('监听到获取到 Wi-Fi 列表:', res.wifiList);
that.wifiList = res.wifiList that.wifiList = res.wifiList
// //
@ -286,13 +285,11 @@
}); });
}, },
fail: function(err) { fail: function(err) {
// Wi-Fi
console.error('获取 Wi-Fi 列表失败:', err); console.error('获取 Wi-Fi 列表失败:', err);
} }
}); });
}, },
fail: function(err) { fail: function(err) {
//
console.error('Wi-Fi 初始化失败:', err); console.error('Wi-Fi 初始化失败:', err);
} }
}); });
@ -323,30 +320,16 @@
console.log('32751212'); console.log('32751212');
} }
},15000) },15000)
//
// xBlufi.initXBlufi(1)
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
// xBlufi.notifyInitBleEsp32({
// deviceId: this.objlist.deviceId
// })
var that = this
let that = this
wx.startWifi({ wx.startWifi({
success: function() { success: function() {
// Wi-Fi
console.log('Wi-Fi 模块已初始化'); console.log('Wi-Fi 模块已初始化');
// wx.getWifiList
wx.getWifiList({ wx.getWifiList({
success: function(res) { success: function(res) {
// Wi-Fi
console.log('获取 Wi-Fi 列表成功:', res); console.log('获取 Wi-Fi 列表成功:', res);
// Wi-Fi
wx.onGetWifiList(function(res) { wx.onGetWifiList(function(res) {
// Wi-Fi
console.log('ios监听到获取到 Wi-Fi 列表:', res.wifiList); console.log('ios监听到获取到 Wi-Fi 列表:', res.wifiList);
that.wifiList = res.wifiList that.wifiList = res.wifiList
// //
@ -366,20 +349,20 @@
that.list = that.wifiList.filter(item => { that.list = that.wifiList.filter(item => {
return item.SSID !== '' return item.SSID !== ''
}) })
// console.log(that.list, '1010'); // console.log(that.list, '1010'); //
}); })
}, },
fail: function(err) { fail: function(err) {
// Wi-Fi // Wi-Fi
console.error('获取 Wi-Fi 列表失败:', err); console.error('获取 Wi-Fi 列表失败:', err);
} }
}); })
}, },
fail: function(err) { fail: function(err) {
// //
console.error('Wi-Fi 初始化失败:', err); console.error('Wi-Fi 初始化失败:', err);
} }
}); })
}, },
// //
onShareAppMessage: function () { onShareAppMessage: function () {
@ -399,7 +382,6 @@
}, },
onUnload: function() { onUnload: function() {
console.log("unload返回 "); console.log("unload返回 ");
if (this.dotShowInterval) { if (this.dotShowInterval) {
clearInterval(this.dotShowInterval); clearInterval(this.dotShowInterval);
} }
@ -430,10 +412,10 @@
}); });
setTimeout(() => { setTimeout(() => {
if (this.devicesList.length == 0) { if (this.devicesList.length == 0) {
uni.showToast({ // uni.showToast({
title: '暂无发现对应设备,请重试', // title: ',',
icon: 'none' // icon: 'none'
}); // });
} else { } else {
let uniqueDevicesList = Array.from(new Set(this.devicesList)); let uniqueDevicesList = Array.from(new Set(this.devicesList));
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList;
@ -918,7 +900,7 @@
.box { .box {
margin-right: 30rpx; margin-right: 30rpx;
height: 100%; height: 100%;
padding-bottom: 40rpx; // padding-bottom: 40rpx;
box-sizing: border-box; box-sizing: border-box;
} }
@ -931,7 +913,6 @@
li { li {
image { image {
display: inline-block; display: inline-block;
margin-top: 10rpx;
width: 50rpx; width: 50rpx;
height: 52rpx; height: 52rpx;
} }
@ -944,17 +925,21 @@
// bottom: 50rpx; // bottom: 50rpx;
border-radius: 52rpx 52rpx 52rpx 52rpx; border-radius: 52rpx 52rpx 52rpx 52rpx;
// font-weight: 700; // font-weight: 700;
font-size: 38rpx; font-size: 28rpx;
width: 100%; width: 650rpx;
margin-top: 20rpx; margin-top: 20rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 62rpx;
view{ view{
height: 96rpx; height: 96rpx;
border-radius: 30rpx; border-radius: 50rpx;
line-height: 96rpx; line-height: 96rpx;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
// background-color: #8883F0 !important; background-color: #8883F0 !important;
color: #8883F0; color: #fff;
text-align: center; text-align: center;
} }
} }
@ -1093,24 +1078,48 @@
.bdbox { .bdbox {
display: flex; display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
} }
.wifilist { .wifilist {
.top{
image{
width: 50rpx;
height: 52rpx;
margin-right: 20rpx;
}
display: flex;
align-items: center;
margin-top: 40rpx;
margin-left: 42rpx;
font-size: 28rpx;
color: #77808D;
}
// margin-top: 80rpx; // margin-top: 80rpx;
width: 650rpx;
margin: auto;
margin-top: 26rpx;
height: 960rpx;
background: #FFFFFF;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08);
border-radius: 20rpx;
overflow: scroll;
.bd { .bd {
display: flex; display: flex;
justify-content: space-between; align-items: center;
width: 100%; // justify-content: space-between;
height: 148rpx; width: 498rpx;
// line-height: 148rpx; margin: auto;
padding-top: 45rpx; height: 106rpx;
// line-height: 106rpx;
box-sizing: border-box;
/* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
/* border-radius: 10rpx; */
border-bottom: 1px solid #E5E5E5;
// padding: 26rpx 76rpx;
box-sizing: border-box; box-sizing: border-box;
padding-left: 60rpx;
padding-right: 60rpx;
box-shadow: 0 0 10px rgba(0, 0, 0, .1);
border-radius: 10rpx;
margin-top: 20rpx;
.picone { .picone {
width: 58rpx; width: 58rpx;
@ -1129,7 +1138,7 @@
view { view {
height: 40rpx; height: 40rpx;
margin-top: 20rpx; // margin-top: 20rpx;
} }
.wz { .wz {
@ -1147,13 +1156,26 @@
.device{
width: 650rpx;
height: 176rpx;
background: #FFFFFF;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08);
margin: auto;
padding: 28rpx 38rpx;
box-sizing: border-box;
border-radius: 20rpx;
}
.device-list-title { .device-list-title {
color: #50565a; font-size: 32rpx;
font-size: 86rpx; color: #262B37;
font-family: SourceHanSansCN; display: flex;
margin-top: 100rpx; align-items: center;
margin-bottom: 40rpx;
image{
margin-right: 10rpx;
}
} }
.text_3 { .text_3 {