This commit is contained in:
3321822538@qq.com 2024-11-22 16:51:32 +08:00
parent 8be8b404c9
commit 0be970db6f
7 changed files with 92 additions and 212 deletions

View File

@ -19,7 +19,7 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ 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', baseUrl: 'https://kg.chuangtewl.com/prod-api',
// loadingText: '加载中...', // loadingText: '加载中...',
// loadingTime: 1000, // loadingTime: 1000,

View File

@ -198,7 +198,7 @@
payNo:'', payNo:'',
q:'', q:'',
channelId:'', channelId:'',
swindleflag:true, swindleflag:false,
phonenumber:'', phonenumber:'',
mchShowBillMobile:'', mchShowBillMobile:'',
telslag:false, telslag:false,
@ -244,7 +244,6 @@
}, },
onShow() { onShow() {
// this.getuserinfo() // this.getuserinfo()
this.swindleflag = true
this.getzfqd() this.getzfqd()
setTimeout(()=>{ setTimeout(()=>{
if (this.id != '') { if (this.id != '') {
@ -285,33 +284,9 @@
}) })
}, },
methods: { methods: {
// //
btnswindleflag(){ btnswindleflag(){
this.swindleflag = false 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(){ getzfqd(){
this.$u.get(`/app/channel/recharge/enabledList`).then(res =>{ this.$u.get(`/app/channel/recharge/enabledList`).then(res =>{
@ -457,6 +432,36 @@
this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => { this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.deviceobj = res.data 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] this.zfobj = res.data.suitList[0]
let targetDateStr = this.deviceobj.expireTime let targetDateStr = this.deviceobj.expireTime
this.mchShowBillMobile = res.data.mchShowBillMobile this.mchShowBillMobile = res.data.mchShowBillMobile

View File

@ -6,6 +6,9 @@
<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">WIFI选择</span>
<view class="">
当前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">请选择您需要连接的2.4GwiFi名称</view> <view class="text_3 ml-3">请选择您需要连接的2.4GwiFi名称</view>
@ -196,12 +199,7 @@
</template> </template>
<script> <script>
var xBlufi = require("@/page_components/blufi/xBlufi.js") 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 { export default {
// components: {
// jpSelect
// },nin
data() { data() {
return { return {
passmm:false, passmm:false,
@ -307,6 +305,7 @@
// //
this.Binddevice() this.Binddevice()
this.objlist = option this.objlist = option
console.log(this.objlist);
setTimeout(() =>{ setTimeout(() =>{
if(this.ver_data == ''){ if(this.ver_data == ''){
uni.showModal({ uni.showModal({

View File

@ -510,9 +510,7 @@
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
// justify-content: space-between;
width: 658rpx; width: 658rpx;
// height: 282rpx;
padding: 54rpx 48rpx; padding: 54rpx 48rpx;
background: #fff; background: #fff;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0); box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0);
@ -579,27 +577,18 @@
box-sizing: border-box; box-sizing: border-box;
left: 0; left: 0;
z-index: 999 !important; z-index: 999 !important;
/* background-color: #fff; */
z-index: 99;
} }
.pages { .pages {
// padding-top: 136rpx !important;
padding: 0 66rpx; padding: 0 66rpx;
box-sizing: border-box; box-sizing: border-box;
} }
// text{
// display: block;
// }
.sm { .sm {
color: #77808D; color: #77808D;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
// margin-top: 48rpx;
display: inline-block; display: inline-block;
} }
.title { .title {
margin-bottom: 84rpx; margin-bottom: 84rpx;
@ -642,7 +631,6 @@
image { image {
width: 42rpx; width: 42rpx;
// height: 112rpx;
} }
} }
@ -699,10 +687,6 @@
padding: 0 90rpx; padding: 0 90rpx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
// position: fixed;
// left: 0;
// bottom: 112rpx;
button { button {
background: #8883F0; background: #8883F0;
border-radius: 52rpx 52rpx 52rpx 52rpx; border-radius: 52rpx 52rpx 52rpx 52rpx;

View File

@ -22,6 +22,7 @@
bgc: { bgc: {
backgroundColor: "#8883f0", backgroundColor: "#8883f0",
}, },
wifi:''
} }
}, },
// //
@ -44,11 +45,12 @@
console.log(option, 'opopop') console.log(option, 'opopop')
this.deviceId = option.deviceId this.deviceId = option.deviceId
this.name = option.name this.name = option.name
this.wifi = option.wifi
}, },
methods: { methods: {
btnxyb() { btnxyb() {
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 + '&wifi=' + this.wifi
}) })
} }
} }

View File

@ -1091,21 +1091,12 @@
uni.getConnectedBluetoothDevices({ uni.getConnectedBluetoothDevices({
success(res) { success(res) {
setTimeout(() => { setTimeout(() => {
that.$u.put( that.$u.put(`/app/device/${that.id}/reset?requiredIot=false`).then(res => {
`/app/device/${that.id}/reset?requiredIot=false` if (res.code == 200) {
).then(res => { that.deviceInfo.status = 1
if (res that.imgflag = false
.code == that.tdtxt = '关闭'
200) { that.timeday = 0
that.deviceInfo
.status =
1
that.imgflag =
false
that.tdtxt =
'关闭'
that.timeday =
0
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: '@time0' customData: '@time0'
}) })
@ -1122,8 +1113,7 @@
}) })
} else { } else {
uni.showToast({ uni.showToast({
title: res title: res.msg,
.msg,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
@ -1161,18 +1151,19 @@
}) })
} else if (num == 5) { } else if (num == 5) {
this.btnmsk = false this.btnmsk = false
if(this.deviceInfo.wifi == null){
let systemInfo = uni.getSystemInfoSync() let systemInfo = uni.getSystemInfoSync()
if (systemInfo.platform == 'android') { if (systemInfo.platform == 'android') {
// Android // Android
uni.navigateTo({ uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' + this url: '/page_components/wifilist/index?deviceId=' + this
.qrResult + '&name=' + this.name .qrResult + '&name=' + this.name + '&wifi=' + '暂无配网'
}) })
} else if (systemInfo.platform == 'ios') { } else if (systemInfo.platform == 'ios') {
// iOS // iOS
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' + this url: '/page_fenbao/device/wifivideo?deviceId=' + this
.qrResult + '&name=' + this.name .qrResult + '&name=' + this.name + '&wifi=' + '暂无配网'
}) })
}else{ }else{
uni.showToast({ uni.showToast({
@ -1181,12 +1172,33 @@
duration: 2000 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) { } else if (num == 6) {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: 0,//0 scrollTop: 0,//0
duration: 0// duration: 0//
}) })
this.btnmsk = false this.btnmsk = false
this.vipflag = true this.vipflag = true
this.focus = true this.focus = true
@ -1355,7 +1367,6 @@
}); });
} }
} }
break; break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA: case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
console.log("文件读取中", options.data); console.log("文件读取中", options.data);
@ -1377,10 +1388,8 @@
parseCustomData(data) { parseCustomData(data) {
// "@" // "@"
const dataArray = data.split('@'); const dataArray = data.split('@');
// //
const parsedData = {}; const parsedData = {};
// //
const prefixMap = { const prefixMap = {
'V': 'voltage', 'V': 'voltage',
@ -1391,7 +1400,6 @@
'T': 'setMode', 'T': 'setMode',
'W': 'temperature' 'W': 'temperature'
}; };
// //
for (let i = 0; i < dataArray.length; i++) { for (let i = 0; i < dataArray.length; i++) {
const field = dataArray[i]; const field = dataArray[i];
@ -1410,11 +1418,9 @@
} }
} }
} }
// //
return parsedData; return parsedData;
}, },
} }
} }
</script> </script>

View File

@ -55,9 +55,6 @@
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<!-- <view class="fd_set" @click="show = true">
+
</view> -->
<view class="fd_set iconfont icon-liebiao" @click="showfz = 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> <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> </view>
@ -80,7 +77,6 @@
</view> </view>
<view class="card_cont"> <view class="card_cont">
<view class="cards" v-for="(item,index) in groupLists" :key="index"> <view class="cards" v-for="(item,index) in groupLists" :key="index">
<!-- //@click="changeGp(item)" groupLists -->
<view class="txt"> <view class="txt">
{{item.name}} {{item.name}}
</view> </view>
@ -1059,7 +1055,6 @@
this.groupList = res.data.filter(item => { this.groupList = res.data.filter(item => {
return item.name === '全部' return item.name === '全部'
}) })
// console.log(this.groupLists,'')
this.storeId = this.groupList[0].storeId this.storeId = this.groupList[0].storeId
this.getlist() this.getlist()
} }
@ -1082,12 +1077,9 @@
} }
if (this.pagenum > 1) { if (this.pagenum > 1) {
this.pagenum++ this.pagenum++
// this.wateringList = []
// this.wateringList = this.wateringList.concat(res.rows)
this.wateringList = res.rows this.wateringList = res.rows
this.shujuflag = false this.shujuflag = false
this.qingqiuflag = true this.qingqiuflag = true
// console.log(this.wateringList);
this.groupLists.forEach(groupItem => { this.groupLists.forEach(groupItem => {
groupItem.wateringList 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() uni.hideLoading()
} else { } else {
this.pagenum++ this.pagenum++
this.wateringList = res.rows this.wateringList = res.rows
this.qingqiuflag = true this.qingqiuflag = true
// console.log(this.wateringList,'000')
this.groupLists.forEach(groupItem => { this.groupLists.forEach(groupItem => {
groupItem.wateringList = [] 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() uni.hideLoading()
} }
this.isLoading = false 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() { tosetpage() {
this.showfz = false this.showfz = false
uni.navigateTo({ uni.navigateTo({
@ -1440,10 +1327,8 @@
}, },
getDeviceList() { getDeviceList() {
this.$u.get("/app/device/list").then((res) => { this.$u.get("/app/device/list").then((res) => {
// this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
this.deviceList = res.rows.filter(row => row.isDefault === true) this.deviceList = res.rows.filter(row => row.isDefault === true)
// console.log(this.deviceList)
this.total = res.total this.total = res.total
if (this.deviceList == '') { if (this.deviceList == '') {
this.addflag = true this.addflag = true
@ -1473,7 +1358,6 @@
this.sbflag = true this.sbflag = true
} }
uni.setStorageSync('deviceId', this.deviceInfo.deviceId) uni.setStorageSync('deviceId', this.deviceInfo.deviceId)
// this.initChart()
this.order() this.order()
}) })
}, },