开关
This commit is contained in:
parent
8be8b404c9
commit
0be970db6f
|
@ -19,7 +19,7 @@ const install = (Vue, vm) => {
|
|||
// },
|
||||
// });
|
||||
Vue.prototype.$u.http.setConfig({
|
||||
// baseUrl: 'http://192.168.2.27:10002',
|
||||
// baseUrl: 'http://192.168.2.18:10002',
|
||||
baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
||||
// loadingText: '加载中...',
|
||||
// loadingTime: 1000,
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
payNo:'',
|
||||
q:'',
|
||||
channelId:'',
|
||||
swindleflag:true,
|
||||
swindleflag:false,
|
||||
phonenumber:'',
|
||||
mchShowBillMobile:'',
|
||||
telslag:false,
|
||||
|
@ -244,7 +244,6 @@
|
|||
},
|
||||
onShow() {
|
||||
// this.getuserinfo()
|
||||
this.swindleflag = true
|
||||
this.getzfqd()
|
||||
setTimeout(()=>{
|
||||
if (this.id != '') {
|
||||
|
@ -285,33 +284,9 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
// 点击我已知晓判断设备是否有套餐
|
||||
// 点击我已知晓隐藏防骗提示
|
||||
btnswindleflag(){
|
||||
this.swindleflag = false
|
||||
if(this.userId == this.deviceobj.userId && this.deviceobj.suitList.length == 0){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该设备暂无套餐,是否前去配置?',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('tcidlist', that.arrlists)
|
||||
uni.navigateTo({
|
||||
url: '/page_components/newtaocan'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}else if(this.userId != this.deviceobj.userId && this.deviceobj.suitList.length == 0){
|
||||
uni.showToast({
|
||||
title:'该设备暂无套餐,请联系商家添加套餐在使用',
|
||||
icon: 'none',
|
||||
duration:5000
|
||||
})
|
||||
}
|
||||
},
|
||||
getzfqd(){
|
||||
this.$u.get(`/app/channel/recharge/enabledList`).then(res =>{
|
||||
|
@ -457,6 +432,36 @@
|
|||
this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.deviceobj = res.data
|
||||
// 判断该设备有没有套餐
|
||||
if(this.deviceobj.suitList.length == 0 || this.deviceobj.suitList == ''){
|
||||
this.swindleflag = false
|
||||
if(this.userId == this.deviceobj.userId && this.deviceobj.suitList.length == 0){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该设备暂无套餐,是否前去配置?',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('tcidlist', that.arrlists)
|
||||
uni.navigateTo({
|
||||
url: '/page_components/newtaocan'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}else if(this.userId != this.deviceobj.userId && this.deviceobj.suitList.length == 0){
|
||||
uni.showToast({
|
||||
title:'该设备暂无套餐,请联系商家添加套餐在使用',
|
||||
icon: 'none',
|
||||
duration:5000
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.swindleflag = true
|
||||
}
|
||||
this.zfobj = res.data.suitList[0]
|
||||
let targetDateStr = this.deviceobj.expireTime
|
||||
this.mchShowBillMobile = res.data.mchShowBillMobile
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
<view class="container" style="margin-top: 50rpx;">
|
||||
<view class="device">
|
||||
<span class="device-list-title">WIFI选择</span>
|
||||
<view class="">
|
||||
当前WIFI配网:{{objlist.wifi}}
|
||||
</view>
|
||||
</view>
|
||||
<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">请选择您需要连接的2.4GwiFi名称</view>
|
||||
|
@ -196,12 +199,7 @@
|
|||
</template>
|
||||
<script>
|
||||
var xBlufi = require("@/page_components/blufi/xBlufi.js")
|
||||
// import jpSelect from '@/components/jp-select/jp-select.vue';
|
||||
// var xBlufi = require("@/page_components/blufi/xBlufi.js");
|
||||
export default {
|
||||
// components: {
|
||||
// jpSelect
|
||||
// },nin
|
||||
data() {
|
||||
return {
|
||||
passmm:false,
|
||||
|
@ -307,6 +305,7 @@
|
|||
// 传过来的蓝牙信息
|
||||
this.Binddevice()
|
||||
this.objlist = option
|
||||
console.log(this.objlist);
|
||||
setTimeout(() =>{
|
||||
if(this.ver_data == ''){
|
||||
uni.showModal({
|
||||
|
|
|
@ -510,9 +510,7 @@
|
|||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
// justify-content: space-between;
|
||||
width: 658rpx;
|
||||
// height: 282rpx;
|
||||
padding: 54rpx 48rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0);
|
||||
|
@ -579,27 +577,18 @@
|
|||
box-sizing: border-box;
|
||||
left: 0;
|
||||
z-index: 999 !important;
|
||||
/* background-color: #fff; */
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.pages {
|
||||
// padding-top: 136rpx !important;
|
||||
padding: 0 66rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// text{
|
||||
// display: block;
|
||||
// }
|
||||
|
||||
.sm {
|
||||
color: #77808D;
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
// margin-top: 48rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-bottom: 84rpx;
|
||||
|
||||
|
@ -642,7 +631,6 @@
|
|||
|
||||
image {
|
||||
width: 42rpx;
|
||||
// height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -699,10 +687,6 @@
|
|||
padding: 0 90rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
// position: fixed;
|
||||
// left: 0;
|
||||
// bottom: 112rpx;
|
||||
|
||||
button {
|
||||
background: #8883F0;
|
||||
border-radius: 52rpx 52rpx 52rpx 52rpx;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
bgc: {
|
||||
backgroundColor: "#8883f0",
|
||||
},
|
||||
wifi:''
|
||||
}
|
||||
},
|
||||
// 分享到好友(会话)
|
||||
|
@ -44,11 +45,12 @@
|
|||
console.log(option, 'opopop')
|
||||
this.deviceId = option.deviceId
|
||||
this.name = option.name
|
||||
this.wifi = option.wifi
|
||||
},
|
||||
methods: {
|
||||
btnxyb() {
|
||||
uni.navigateTo({
|
||||
url: '/page_components/wifilist/index?deviceId=' + this.deviceId + '&name=' + this.name
|
||||
url: '/page_components/wifilist/index?deviceId=' + this.deviceId + '&name=' + this.name + '&wifi=' + this.wifi
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1091,21 +1091,12 @@
|
|||
uni.getConnectedBluetoothDevices({
|
||||
success(res) {
|
||||
setTimeout(() => {
|
||||
that.$u.put(
|
||||
`/app/device/${that.id}/reset?requiredIot=false`
|
||||
).then(res => {
|
||||
if (res
|
||||
.code ==
|
||||
200) {
|
||||
that.deviceInfo
|
||||
.status =
|
||||
1
|
||||
that.imgflag =
|
||||
false
|
||||
that.tdtxt =
|
||||
'关闭'
|
||||
that.timeday =
|
||||
0
|
||||
that.$u.put(`/app/device/${that.id}/reset?requiredIot=false`).then(res => {
|
||||
if (res.code == 200) {
|
||||
that.deviceInfo.status = 1
|
||||
that.imgflag = false
|
||||
that.tdtxt = '关闭'
|
||||
that.timeday = 0
|
||||
xBlufi.notifySendCustomData({
|
||||
customData: '@time0'
|
||||
})
|
||||
|
@ -1122,8 +1113,7 @@
|
|||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res
|
||||
.msg,
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
|
@ -1161,18 +1151,19 @@
|
|||
})
|
||||
} else if (num == 5) {
|
||||
this.btnmsk = false
|
||||
if(this.deviceInfo.wifi == null){
|
||||
let systemInfo = uni.getSystemInfoSync()
|
||||
if (systemInfo.platform == 'android') {
|
||||
// 当前设备是 Android
|
||||
uni.navigateTo({
|
||||
url: '/page_components/wifilist/index?deviceId=' + this
|
||||
.qrResult + '&name=' + this.name
|
||||
.qrResult + '&name=' + this.name + '&wifi=' + '暂无配网'
|
||||
})
|
||||
} else if (systemInfo.platform == 'ios') {
|
||||
// 当前设备是 iOS
|
||||
uni.navigateTo({
|
||||
url: '/page_fenbao/device/wifivideo?deviceId=' + this
|
||||
.qrResult + '&name=' + this.name
|
||||
.qrResult + '&name=' + this.name + '&wifi=' + '暂无配网'
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
|
@ -1181,12 +1172,33 @@
|
|||
duration: 2000
|
||||
})
|
||||
}
|
||||
}else{
|
||||
let systemInfo = uni.getSystemInfoSync()
|
||||
if (systemInfo.platform == 'android') {
|
||||
// 当前设备是 Android
|
||||
uni.navigateTo({
|
||||
url: '/page_components/wifilist/index?deviceId=' + this
|
||||
.qrResult + '&name=' + this.name + '&wifi=' + this.deviceInfo.wifi
|
||||
})
|
||||
} else if (systemInfo.platform == 'ios') {
|
||||
// 当前设备是 iOS
|
||||
uni.navigateTo({
|
||||
url: '/page_fenbao/device/wifivideo?deviceId=' + this
|
||||
.qrResult + '&name=' + this.name + '&wifi=' + this.deviceInfo.wifi
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '目前仅支持安卓和iOS系统',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if (num == 6) {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,//滚动到距离顶部为0
|
||||
duration: 0//滚动时长
|
||||
})
|
||||
|
||||
this.btnmsk = false
|
||||
this.vipflag = true
|
||||
this.focus = true
|
||||
|
@ -1355,7 +1367,6 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
|
||||
console.log("文件读取中", options.data);
|
||||
|
@ -1377,10 +1388,8 @@
|
|||
parseCustomData(data) {
|
||||
// 将字符串按照 "@" 分割成数组
|
||||
const dataArray = data.split('@');
|
||||
|
||||
// 初始化一个空对象来存储解析后的数据
|
||||
const parsedData = {};
|
||||
|
||||
// 前缀到属性名的映射
|
||||
const prefixMap = {
|
||||
'V': 'voltage',
|
||||
|
@ -1391,7 +1400,6 @@
|
|||
'T': 'setMode',
|
||||
'W': 'temperature'
|
||||
};
|
||||
|
||||
// 遍历数组并解析每个字段
|
||||
for (let i = 0; i < dataArray.length; i++) {
|
||||
const field = dataArray[i];
|
||||
|
@ -1410,11 +1418,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 返回解析后的数据对象
|
||||
return parsedData;
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -55,9 +55,6 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<!-- <view class="fd_set" @click="show = true">
|
||||
+
|
||||
</view> -->
|
||||
<view class="fd_set iconfont icon-liebiao" @click="showfz = true"></view>
|
||||
<image style="width: 32rpx;height: 34rpx;margin-top: 10rpx;margin-left: 20rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uiZneL59hHNJ2EsOE557" mode="aspectFit" @click="pxshow = true"></image>
|
||||
</view>
|
||||
|
@ -80,7 +77,6 @@
|
|||
</view>
|
||||
<view class="card_cont">
|
||||
<view class="cards" v-for="(item,index) in groupLists" :key="index">
|
||||
<!-- //@click="changeGp(item)" groupLists -->
|
||||
<view class="txt">
|
||||
{{item.name}}
|
||||
</view>
|
||||
|
@ -1059,7 +1055,6 @@
|
|||
this.groupList = res.data.filter(item => {
|
||||
return item.name === '全部'
|
||||
})
|
||||
// console.log(this.groupLists,'第一')
|
||||
this.storeId = this.groupList[0].storeId
|
||||
this.getlist()
|
||||
}
|
||||
|
@ -1082,12 +1077,9 @@
|
|||
}
|
||||
if (this.pagenum > 1) {
|
||||
this.pagenum++
|
||||
// this.wateringList = []
|
||||
// this.wateringList = this.wateringList.concat(res.rows)
|
||||
this.wateringList = res.rows
|
||||
this.shujuflag = false
|
||||
this.qingqiuflag = true
|
||||
// console.log(this.wateringList);
|
||||
this.groupLists.forEach(groupItem => {
|
||||
groupItem.wateringList
|
||||
})
|
||||
|
@ -1103,29 +1095,11 @@
|
|||
}
|
||||
})
|
||||
})
|
||||
// this.groupLists[0] = this.groupLists[0].map(group => {
|
||||
// // 使用一个对象来跟踪已经遇到的 deviceId
|
||||
// const seenDeviceIds = {};
|
||||
// // 使用 reduce 来创建一个新的 wateringList,只包含唯一的 deviceId
|
||||
// const uniqueWateringList = group.wateringList.reduce((acc, item) => {
|
||||
// if (!seenDeviceIds[item.deviceId]) {
|
||||
// seenDeviceIds[item.deviceId] = true;
|
||||
// acc.push(item);
|
||||
// }
|
||||
// return acc;
|
||||
// }, []);
|
||||
// // 返回更新后的组对象
|
||||
// return {
|
||||
// ...group,
|
||||
// wateringList: uniqueWateringList
|
||||
// };
|
||||
// })
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
this.pagenum++
|
||||
this.wateringList = res.rows
|
||||
this.qingqiuflag = true
|
||||
// console.log(this.wateringList,'000')
|
||||
this.groupLists.forEach(groupItem => {
|
||||
groupItem.wateringList = []
|
||||
})
|
||||
|
@ -1139,24 +1113,6 @@
|
|||
}
|
||||
})
|
||||
})
|
||||
// console.log(this.groupLists)
|
||||
// this.groupLists[0] = this.groupLists[0].map(group => {
|
||||
// // 使用一个对象来跟踪已经遇到的 deviceId
|
||||
// const seenDeviceIds = {};
|
||||
// // 使用 reduce 来创建一个新的 wateringList,只包含唯一的 deviceId
|
||||
// const uniqueWateringList = group.wateringList.reduce((acc, item) => {
|
||||
// if (!seenDeviceIds[item.deviceId]) {
|
||||
// seenDeviceIds[item.deviceId] = true;
|
||||
// acc.push(item);
|
||||
// }
|
||||
// return acc;
|
||||
// }, []);
|
||||
// // 返回更新后的组对象
|
||||
// return {
|
||||
// ...group,
|
||||
// wateringList: uniqueWateringList
|
||||
// };
|
||||
// })
|
||||
uni.hideLoading()
|
||||
}
|
||||
this.isLoading = false
|
||||
|
@ -1167,75 +1123,6 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
changeGp(item, index) {
|
||||
// console.log(item);
|
||||
this.pagenum = 1
|
||||
this.showfz = false
|
||||
if (item == 1) {
|
||||
this.getDeviceList()
|
||||
} else {
|
||||
if (item.storeId == null) {
|
||||
this.pagenum = 1
|
||||
// this.wateringList = []
|
||||
this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total
|
||||
if (res.rows.length > 0) {
|
||||
// 有数据,追加到列表
|
||||
// this.wateringList = this.wateringList.concat(res.rows)
|
||||
// this.pagenum++
|
||||
this.shujuflag = false
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
// 没有更多数据
|
||||
this.shujuflag = true
|
||||
uni.hideLoading()
|
||||
}
|
||||
if (this.pagenum > 1) {
|
||||
this.wateringList = this.wateringList.concat(res.rows)
|
||||
this.shujuflag = false
|
||||
} else {
|
||||
this.wateringList = res.rows
|
||||
}
|
||||
this.pagenum++
|
||||
this.isLoading = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.pagenum = 1
|
||||
// this.wateringList = []
|
||||
this.$u.get(`/app/device/list?storeId=${item.storeId}&pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total
|
||||
// if(this.pagenum > 1){
|
||||
// this.wateringList = this.wateringList.concat(res.rows)
|
||||
// }else{
|
||||
// this.wateringList = res.rows
|
||||
// }
|
||||
if (res.rows.length > 0) {
|
||||
// 有数据,追加到列表
|
||||
// this.wateringList = this.wateringList.concat(res.rows)
|
||||
// this.pagenum++
|
||||
this.shujuflag = false
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
// 没有更多数据
|
||||
this.shujuflag = true
|
||||
uni.hideLoading()
|
||||
}
|
||||
if (this.pagenum > 1) {
|
||||
this.wateringList = this.wateringList.concat(res.rows)
|
||||
this.shujuflag = false
|
||||
} else {
|
||||
this.wateringList = res.rows
|
||||
}
|
||||
this.pagenum++
|
||||
this.isLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
tosetpage() {
|
||||
this.showfz = false
|
||||
uni.navigateTo({
|
||||
|
@ -1440,10 +1327,8 @@
|
|||
},
|
||||
getDeviceList() {
|
||||
this.$u.get("/app/device/list").then((res) => {
|
||||
// this.$forceUpdate()
|
||||
if (res.code == 200) {
|
||||
this.deviceList = res.rows.filter(row => row.isDefault === true)
|
||||
// console.log(this.deviceList)
|
||||
this.total = res.total
|
||||
if (this.deviceList == '') {
|
||||
this.addflag = true
|
||||
|
@ -1473,7 +1358,6 @@
|
|||
this.sbflag = true
|
||||
}
|
||||
uni.setStorageSync('deviceId', this.deviceInfo.deviceId)
|
||||
// this.initChart()
|
||||
this.order()
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user