开关完善

This commit is contained in:
3321822538@qq.com 2024-10-18 17:55:29 +08:00
parent b6e0d261cf
commit 9b88341f2d
5 changed files with 24 additions and 40 deletions

View File

@ -19,8 +19,8 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.2.15:10002', baseUrl: 'http://192.168.2.15: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

View File

@ -1267,14 +1267,9 @@
if (timeDifference.minutes !== undefined) { if (timeDifference.minutes !== undefined) {
result += `${timeDifference.minutes + 1}` result += `${timeDifference.minutes + 1}`
} }
// if (timeDifference.seconds !== undefined) { return result
// result += `${timeDifference.seconds}`
// }
return result;
}, },
startTimer() { startTimer() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
if (this.timeday.seconds > 0) { if (this.timeday.seconds > 0) {
@ -1339,9 +1334,9 @@
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}); })
} }
}); })
}, },
opendevices() { opendevices() {
@ -1366,36 +1361,30 @@
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, this.mac, '111'); // console.log(devicesarr, this.mac, '111')
devicesarr.forEach(device => { devicesarr.forEach(device => {
const mac = device.name.substring(4); const mac = device.name.substring(4)
if (device.name.slice(5, 17) == this.qrResult) { if (device.name.slice(5, 17) == this.qrResult) {
this.deviceId = device.deviceId this.deviceId = device.deviceId
this.name = device.name this.name = device.name
// console.log(device.name,this.mac,'222'); // console.log(device.name,this.mac,'222');
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.devicesList // this.devicesList
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList
} else {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 3000
// })
} }
}) })
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options)); console.log("连接回调:" + JSON.stringify(options))
if (options.result) { if (options.result) {
// console.log('125451245') // console.log('125451245')
{ {
xBlufi.notifyInitBleEsp32({ xBlufi.notifyInitBleEsp32({
deviceId: this.deviceId deviceId: this.deviceId
}) })
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvents); xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvents)
this.deviceIds = options.data.deviceId this.deviceIds = options.data.deviceId
this.name = this.name this.name = this.name
} }
@ -1418,10 +1407,9 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) { if (options.result) {
let uniqueDevicesList = Array.from(new Set(this.devicesList)); let uniqueDevicesList = Array.from(new Set(this.devicesList));
let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === "CTKG");
"CTKG");
// this.devicesList // this.devicesList
this.devicesList = filteredDevices; this.devicesList = filteredDevices
} }
break break
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:

View File

@ -284,7 +284,7 @@
// //
btnswindleflag(){ btnswindleflag(){
this.swindleflag = false this.swindleflag = false
if(this.userId == this.deviceobj.userId && this.deviceobj.suitList == null || this.deviceobj.suitList.length == 0){ if(this.userId == this.deviceobj.userId && this.deviceobj.suitList.length == 0){
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '该设备暂无套餐,是否前去配置?', content: '该设备暂无套餐,是否前去配置?',

View File

@ -178,7 +178,7 @@
</view> </view>
<image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode=""></image> <image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode=""></image>
</view> </view>
<!-- <view class="cont" @click="topage(1)"> <view class="cont" @click="topage(1)">
<view class="top"> <view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uhsqQVT62DOTdW8qW7ez" mode="" <image src="https://api.ccttiot.com/smartmeter/img/static/uhsqQVT62DOTdW8qW7ez" mode=""
style="width: 44rpx;height: 44rpx;"></image> style="width: 44rpx;height: 44rpx;"></image>
@ -194,7 +194,7 @@
<view class="bot">充值</view> <view class="bot">充值</view>
</view> </view>
<image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode=""></image> <image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode=""></image>
</view> --> </view>
</view> </view>
<view class=""> <view class="">
<view class="cont" @click="topage(5)" v-if="modelId.some(tag => tag == 2)"> <view class="cont" @click="topage(5)" v-if="modelId.some(tag => tag == 2)">
@ -1066,21 +1066,17 @@
'关闭' '关闭'
that.timeday = that.timeday =
0 0
xBlufi xBlufi.notifySendCustomData({
.notifySendCustomData({
customData: '@time0' customData: '@time0'
}) })
xBlufi xBlufi.notifySendCustomData({
.notifySendCustomData({
customData: '@mmney0' customData: '@mmney0'
}) })
xBlufi xBlufi.notifySendCustomData({
.notifySendCustomData({
customData: 'close' customData: 'close'
}) })
uni.showToast({ uni.showToast({
title: res title: res.msg,
.msg,
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
@ -1402,7 +1398,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, 'devicesarrdevicesarr') console.log(devicesarr, 'devicesarrdevicesarr')
devicesarr.forEach(device => { devicesarr.forEach(device => {
const mac = device.name.substring(5) const mac = device.name.substring(5)
// console.log(device.name,device.name(5,15), 'macmacmac') // console.log(device.name,device.name(5,15), 'macmacmac')

View File

@ -32,7 +32,7 @@
</view> </view>
</view> </view>
<view class="" style="color: red;font-size: 24rpx;padding-top: 30rpx;box-sizing: border-box;"> <view class="" style="color: red;font-size: 24rpx;padding-top: 30rpx;box-sizing: border-box;">
提现服务费为 {{roundToTwoDecimalsTraditional(this.serviceRates)}} 提现服务费为 {{roundToTwoDecimalsTraditional(this.serviceRates)}} 最低提现金额为20
</view> </view>
<view class="tit"> <view class="tit">
<view class="" style="display: flex;"> <view class="" style="display: flex;">