开关代理模式新增 时间待调

This commit is contained in:
3321822538@qq.com 2024-11-05 18:03:35 +08:00
parent a5628ff71d
commit 5f5562ebe1
9 changed files with 168 additions and 360 deletions

View File

@ -154,7 +154,8 @@
countdown: 10, // countdown: 10, //
intervalId: null, intervalId: null,
contwz:'', contwz:'',
sn:'' sn:'',
arrlists:[]
} }
}, },
onLoad(option) { onLoad(option) {
@ -306,6 +307,8 @@
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
this.arrlists.push(res.data)
uni.setStorageSync('tcidlist', this.arrlists)
} }
}) })
}, },

View File

@ -343,6 +343,7 @@
computed: { computed: {
// //
formattedTime() { formattedTime() {
// console.log(this.timeday,'00000');
if (this.timeday.days > 0) { if (this.timeday.days > 0) {
// //
return `${this.timeday.days}${this.timeday.hours}小时` return `${this.timeday.days}${this.timeday.hours}小时`
@ -400,7 +401,7 @@
}, 1000) }, 1000)
}, },
onHide() { onHide() {
this.stopTimer(); // this.stopTimer();
}, },
beforeDestroy() { beforeDestroy() {
// //
@ -615,6 +616,7 @@
// //
shuaxin(txt){ shuaxin(txt){
// this.timeday = ''
this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => { this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.getDevice() this.getDevice()
@ -1158,7 +1160,10 @@
clearInterval(this.timerId) clearInterval(this.timerId)
} }
// timerCallback // timerCallback
this.timerId = setInterval(this.getDevice, 60000) // this.timerId = setInterval(this.getDevice,this.shuaxin, 60000)
this.timerId = setInterval(() => {
this.shuaxin()
}, 60000);
}, },
// //
stopTimer() { stopTimer() {
@ -1208,14 +1213,16 @@
if (this.detaobj.suitExpireTime == null) { if (this.detaobj.suitExpireTime == null) {
this.timeday = 0 this.timeday = 0
} else { } else {
let expireTimeStr = this.detaobj.suitExpireTime let expireTimeStr = ''
expireTimeStr = this.detaobj.suitExpireTime
let expireTimeParts = expireTimeStr.split(" ") let expireTimeParts = expireTimeStr.split(" ")
let expireDateParts = expireTimeParts[0].split("-") let expireDateParts = expireTimeParts[0].split("-")
let expireTimePartsTime = expireTimeParts[1].split(":") let expireTimePartsTime = expireTimeParts[1].split(":")
let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[ let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
let now = new Date() let now = new Date()
let differenceInMs = expireDate - now; let differenceInMs = expireDate - now
console.log(differenceInMs,expireDate,now,this.formatMilliseconds(differenceInMs),'101010');
this.timeday == ''
if (differenceInMs <= 0) { if (differenceInMs <= 0) {
this.timeday = 0 this.timeday = 0
} else { } else {

View File

@ -206,7 +206,8 @@
userId:'', userId:'',
hasCalledGetczly:false, hasCalledGetczly:false,
hasCalledGetczlys:false, hasCalledGetczlys:false,
hasCalledGetczlyss:false hasCalledGetczlyss:false,
arrlists:[]
} }
}, },
onLoad(option) { onLoad(option) {
@ -284,15 +285,17 @@
}) })
}, },
methods: { methods: {
// //
btnswindleflag(){ btnswindleflag(){
this.swindleflag = false this.swindleflag = false
if(this.userId == this.deviceobj.userId && this.deviceobj.suitList.length == 0){ if(this.userId == this.deviceobj.userId && this.deviceobj.suitList.length == 0){
let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '该设备暂无套餐,是否前去配置?', content: '该设备暂无套餐,是否前去配置?',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.setStorageSync('tcidlist', that.arrlists)
uni.navigateTo({ uni.navigateTo({
url: '/page_components/newtaocan' url: '/page_components/newtaocan'
}) })
@ -331,6 +334,8 @@
if (res.code == 200) { if (res.code == 200) {
that.$u.get(`/app/device/${that.id}/bySn`).then((res) => { that.$u.get(`/app/device/${that.id}/bySn`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.arrlists.push(res.data)
console.log(that.arrlists);
that.mac = 'CTKG-' + res.data.mac that.mac = 'CTKG-' + res.data.mac
that.onlineStatus = res.data.onlineStatus that.onlineStatus = res.data.onlineStatus
} }
@ -796,39 +801,6 @@
// }) // })
} }
}) })
// this.czflag = true
// let that = this
// xBlufi.initXBlufi(1);
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvents);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': false
// })
// if (that.devicesList.length > 0) {
// xBlufi.notifyConnectBle({
// isStart: true,
// deviceId: that.deviceId,
// name: that.name
// })
// }
// }, 2000)
// setTimeout(()=>{
// if(this.ver_data == ''){
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 5000
// })
// this.czflag = false
// this.zhifuflag = false
// setTimeout(()=>{
// uni.hideLoading()
// },5000)
// }
// },10000)
} }
}) })
} else { } else {
@ -932,38 +904,6 @@
// }) // })
} }
}) })
// that.czflag = true
// xBlufi.initXBlufi(1);
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEventss);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': false
// })
// if (that.devicesList.length > 0) {
// xBlufi.notifyConnectBle({
// isStart: true,
// deviceId: that.deviceId,
// name: that.name
// })
// }
// }, 2000)
// setTimeout(()=>{
// if(that.ver_data == ''){
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 5000
// })
// that.czflag = false
// that.zhifuflag = false
// setTimeout(()=>{
// uni.hideLoading()
// },5000)
// }
// },10000)
} }
}) })
if(that.ver_data != ''){ if(that.ver_data != ''){
@ -1139,38 +1079,6 @@
// }) // })
} }
}) })
// that.czflag = true
// xBlufi.initXBlufi(1);
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvents);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': false
// })
// if (that.devicesList.length > 0) {
// xBlufi.notifyConnectBle({
// isStart: true,
// deviceId: that.deviceId,
// name: that.name
// })
// }
// }, 2000)
// setTimeout(()=>{
// if(that.ver_data == ''){
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 5000
// })
// that.czflag = false
// that.zhifuflag = false
// setTimeout(()=>{
// uni.hideLoading()
// },5000)
// }
// },10000)
} }
}) })
} else { } else {
@ -1305,53 +1213,9 @@
// }) // })
} }
}) })
// that.czflag = true
// xBlufi.initXBlufi(1);
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEventss);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': false
// })
// if (that.devicesList.length > 0) {
// xBlufi.notifyConnectBle({
// isStart: true,
// deviceId: that.deviceId,
// name: that.name
// })
// }
// }, 2000)
// setTimeout(()=>{
// if(that.ver_data == ''){
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 5000
// })
// that.czflag = false
// that.zhifuflag = false
// setTimeout(()=>{
// uni.hideLoading()
// },5000)
// }else{
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 5000
// })
// that.czflag = false
// that.zhifuflag = false
// setTimeout(()=>{
// uni.hideLoading()
// },5000)
// }
// },10000)
} }
}) })
} else { } else {
console.log('手机未连接网络') console.log('手机未连接网络')
// this.baiflag = false // this.baiflag = false

View File

@ -72,6 +72,7 @@
onLoad(option) { onLoad(option) {
uni.removeStorageSync('tcidlist') uni.removeStorageSync('tcidlist')
this.shu = option.shu this.shu = option.shu
this.deviceId = option.id this.deviceId = option.id
if(option.title == '确定'){ if(option.title == '确定'){
this.titflag = '确定' this.titflag = '确定'
@ -215,7 +216,7 @@
let data = { let data = {
pageNum: 1, pageNum: 1,
pageSize: 99, pageSize: 99,
modelTag:this.shu // modelTag:this.shu
} }
this.$u.get(`/app/device/list`, data).then((res) => { this.$u.get(`/app/device/list`, data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -231,7 +232,6 @@
}else{ }else{
this.getao() this.getao()
} }
// console.log(this.list); // console.log(this.list);
this.loading = true this.loading = true
}else{ }else{
@ -239,7 +239,7 @@
} }
} }
}); })
}, },
} }

View File

@ -133,26 +133,49 @@
url:'/page_user/yetx' url:'/page_user/yetx'
}) })
}, },
btnyz() { btnyz() {
let data = { function isAgeOver18(idCard) {
realName: this.name, //
realIdCard: this.names, const birthYear = idCard.substr(6, 4); // 710
type:this.type //
} const currentYear = new Date().getFullYear();
this.$u.put('/app/user/realName', data).then(res => { //
if (res.code == 200) { const age = currentYear - parseInt(birthYear, 10);
let https = encodeURIComponent(res.data.jumpUrl) // 18
uni.navigateTo({ return age >= 18;
url: '/pages/sjshiming?https=' + https }
}) const idCard = this.names
} else { //
uni.showToast({ if (isAgeOver18(idCard)) {
title: res.msg, console.log('身份证对应的用户已年满18岁');
icon: 'none', let data = {
duration: 2000 realName: this.name,
}) realIdCard: this.names,
} type:this.type
}) }
this.$u.put('/app/user/realName', data).then(res => {
if (res.code == 200) {
let https = encodeURIComponent(res.data.jumpUrl)
uni.navigateTo({
url: '/pages/sjshiming?https=' + https
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else {
console.log('身份证对应的用户未满18岁');
uni.showToast({
title: '实名认证需年满18岁',
icon: 'none',
duration: 2000
})
}
} }
} }

View File

@ -471,6 +471,21 @@
this.getxieyi() this.getxieyi()
if (uni.getStorageSync('tcidlist')) { if (uni.getStorageSync('tcidlist')) {
this.deviceList = uni.getStorageSync('tcidlist') this.deviceList = uni.getStorageSync('tcidlist')
function uniqueByProperty(arr, prop) {
const seen = new Set();
return arr.filter(item => {
const val = item[prop];
if (seen.has(val)) {
return false;
} else {
seen.add(val);
return true;
}
});
}
// 使 this.deviceList 'id'
this.deviceList = uniqueByProperty(this.deviceList, 'id');
console.log(this.deviceList)
} }
setTimeout(() => { setTimeout(() => {
if (this.suitId) { if (this.suitId) {

View File

@ -27,16 +27,16 @@
<view class="li" @click.stop="sremakemc()"> <view class="li" @click.stop="sremakemc()">
<view class="tit"> <view class="tit">
设备名称 服务费费率
</view> </view>
<view class="info"> <view class="info">
<view class="txt"> <view class="txt">
{{listobj.deviceName}} {{listobj.agentServiceRate == undefined ? '--' : listobj.agentServiceRate + '%'}}
</view> </view>
<view class="iconfont icon-xiangyou1"></view> <view class="iconfont icon-xiangyou1"></view>
</view> </view>
</view> </view>
<view class="li" @click.stop="sremake()"> <!-- <view class="li" @click.stop="sremake()">
<view class="tit"> <view class="tit">
备注代理 备注代理
</view> </view>
@ -46,14 +46,15 @@
</view> </view>
<view class="iconfont icon-xiangyou1"></view> <view class="iconfont icon-xiangyou1"></view>
</view> </view>
</view> </view> -->
<view class="li" @click.stop="sremakes()"> <!-- @click.stop="sremakes()" -->
<view class="li">
<view class="tit"> <view class="tit">
所属商户 所属商户
</view> </view>
<view class="info"> <view class="info">
<view class="txt"> <view class="txt">
{{listobj.storeName == null ? '' : listobj.storeName}} {{listobj.userName == null ? '' : listobj.userName}}
</view> </view>
<!-- <view class="iconfont icon-xiangyou1"></view> --> <!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
@ -164,7 +165,7 @@
<u-popup v-model="showmc" mode="center" border-radius='20'> <u-popup v-model="showmc" mode="center" border-radius='20'>
<view class="popcard" v-if="showmc"> <view class="popcard" v-if="showmc">
<view class="tit"> <view class="tit">
修改名称 修改服务费费率
</view> </view>
<view class="ipt"> <view class="ipt">
<u-input v-model="xgname" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' /> <u-input v-model="xgname" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' />
@ -329,7 +330,6 @@
this.showshop = true this.showshop = true
}, },
confirms(e){ confirms(e){
// console.log(e);
let data = { let data = {
deviceId: this.id, deviceId: this.id,
storeId:e[0].value storeId:e[0].value
@ -341,26 +341,26 @@
}, },
gettanc(){ gettanc(){
this.$u.get('/app/store/listCount').then((res) => { // this.$u.get('/app/store/listCount').then((res) => {
if (res.code == 200) { // if (res.code == 200) {
this.total = res.total // this.total = res.total
if (res.data.length > 0) { // if (res.data.length > 0) {
// // //
let arr = res.data.map(row => ({ // let arr = res.data.map(row => ({
value: row.storeId, // storeIdvalue // value: row.storeId, // storeIdvalue
label: row.name // namelabel // label: row.name // namelabel
})); // }));
this.wateringList = this.wateringList.concat(arr) // this.wateringList = this.wateringList.concat(arr)
this.wateringList = this.wateringList.slice(1) // this.wateringList = this.wateringList.slice(1)
this.pagenum++ // this.pagenum++
console.log(this.wateringList); // console.log(this.wateringList);
} else { // } else {
// // //
this.noMoreData = true; // this.noMoreData = true;
} // }
this.isLoading = false; // this.isLoading = false;
} // }
}) // })
}, },
onReachBottom() { onReachBottom() {
@ -372,7 +372,7 @@
title: '没有更多订单记录了', title: '没有更多订单记录了',
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); })
} }
}, },
@ -415,10 +415,9 @@
this.showmc = false this.showmc = false
this.putdevice(data) this.putdevice(data)
}else if(num == 3){ }else if(num == 3){
// console.log(this.xgname);
let data = { let data = {
deviceId: this.id, deviceId: this.id,
deviceName: this.xgname, agentServiceRate: this.xgname,
} }
this.showpopup = false this.showpopup = false
this.showpeice = false this.showpeice = false
@ -482,7 +481,7 @@
this.putdevice(data) this.putdevice(data)
}, },
putdevice(data) { putdevice(data) {
this.$u.put('/app/device', data).then((res) => { this.$u.put('/agent/device', data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.getDevice() this.getDevice()
uni.showToast({ uni.showToast({
@ -496,7 +495,7 @@
sremakemc(){ sremakemc(){
// console.log(1); // console.log(1);
this.showmc = true this.showmc = true
this.xgname = this.listobj.deviceName this.xgname = this.listobj.agentServiceRate
}, },
sremake() { sremake() {
this.showpopup = true this.showpopup = true
@ -514,7 +513,6 @@
}, },
getDevice(id) { getDevice(id) {
this.$u.get("/app/device/" + this.id).then((res) => { this.$u.get("/app/device/" + this.id).then((res) => {
// this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
this.deviceInfo = res.data this.deviceInfo = res.data
console.log(this.deviceInfo, 'resres'); console.log(this.deviceInfo, 'resres');
@ -531,14 +529,14 @@
}) })
}, },
getgroup() { getgroup() {
this.$u.get("/app/store/listCount").then((res) => { // this.$u.get("/app/store/listCount").then((res) => {
// this.$forceUpdate() // // this.$forceUpdate()
if (res.code == 200) { // if (res.code == 200) {
this.groupList = res.data // this.groupList = res.data
// this.loadings=true // // this.loadings=true
// this.initChart() // // this.initChart()
} // }
}); // });
}, },
getlistobj(id) { getlistobj(id) {
@ -550,7 +548,7 @@
}) })
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#000" title-color='#000' <u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
title-size='36' height='50' id="navbar"> title-size='36' height='50' id="navbar">
</u-navbar> </u-navbar>
<view class="zhuhu"> <view class="zhuhu">
@ -34,10 +34,12 @@
</view> </view>
<view class="txt" v-if="deviceInfo"> <view class="txt" v-if="deviceInfo">
SN{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view> SN{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
<view class="" style="font-size: 24rpx;color: #95989D;"> <view class="" style="font-size: 24rpx;color: #95989D;width: 100%;">
更新时间{{deviceInfo.lastPullTime == null ? '--' : deviceInfo.lastPullTime}}</view> 更新时间{{deviceInfo.lastPullTime == null ? '--' : deviceInfo.lastPullTime}}</view>
<view class="" style="font-size: 24rpx;color: #95989D;"> <view class="" style="font-size: 24rpx;color: #95989D;">
归属商户111</view> 归属商户{{deviceInfo.userName == null ? '--' : deviceInfo.userName}}</view>
<view class="" style="font-size: 24rpx;color: #95989D;width: 100%;">
服务费费率{{deviceInfo.agentServiceRate == null ? '--' : deviceInfo.agentServiceRate + '%'}}</view>
</view> </view>
<view class="mid_left" style="position: relative;"> <view class="mid_left" style="position: relative;">
<view v-if="opflag" <view v-if="opflag"
@ -235,14 +237,6 @@
</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(2)">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/ueQ5V8QAidDZGt0FpqXb" mode=""
style="width: 44rpx;height: 40rpx;"></image>
<view class="bot">上报异常</view>
</view>
<image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode=""></image>
</view> -->
<view class="cont" @click="topage(4)"> <view class="cont" @click="topage(4)">
<view class="top" style="border: 0;"> <view class="top" style="border: 0;">
<image style="width: 44rpx;height: 44rpx;" <image style="width: 44rpx;height: 44rpx;"
@ -327,7 +321,7 @@
style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .1;z-index: 999;"> style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .1;z-index: 999;">
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -364,7 +358,7 @@
label: '度' label: '度'
}], }],
bgc: { bgc: {
backgroundColor: "#F9F8FF ", backgroundColor: "#8883f0 ",
}, },
ec: { ec: {
lazyLoad: true lazyLoad: true
@ -621,7 +615,7 @@
fail: (err) => { fail: (err) => {
console.error(err); console.error(err);
} }
}); })
}, },
//****// //****//
qrFun: function() { qrFun: function() {
@ -1353,8 +1347,7 @@
customData: 'mmney@' + that.cztime customData: 'mmney@' + that.cztime
}) })
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: '11mmney@' + that customData: '11mmney@' + that.cztime
.cztime
}) })
that.getaddtime() that.getaddtime()
} else if (that.damweiid == 4) { } else if (that.damweiid == 4) {
@ -1367,22 +1360,18 @@
that.getaddtime() that.getaddtime()
} else if (that.damweiid == 3) { } else if (that.damweiid == 3) {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: 'time@' + that.cztime * customData: 'time@' + that.cztime * 60
60
}) })
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: '11time@' + that customData: '11time@' + that.cztime * 60
.cztime * 60
}) })
that.getaddtime() that.getaddtime()
} else if (that.damweiid == 2) { } else if (that.damweiid == 2) {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: 'time@' + that.cztime * customData: 'time@' + that.cztime * 60 * 60
60 * 60
}) })
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: '11time@' + that customData: '11time@' + that.cztime * 60 * 60
.cztime * 60 * 60
}) })
that.getaddtime() that.getaddtime()
} }

View File

@ -8,19 +8,20 @@
</view> </view>
<u-mask :show="showtip" @click="show = false" :z-index='1000' /> <u-mask :show="showtip" @click="show = false" :z-index='1000' />
<view class="mxshanghuflag" v-if="shanghuflag"></view>
<view class="fd"> <view class="fd">
<!-- 刷新动画 --> <!-- 刷新动画 -->
<view class="shuaxin" v-if="shuaxin"> <view class="shuaxin" v-if="shuaxin">
<image src="https://api.ccttiot.com/smartmeter/img/static/uO9UFjzbzS9YlabzL4HV" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uO9UFjzbzS9YlabzL4HV" mode=""></image>
</view> </view>
<view class="fd_top u-skeleton-fillet" style="display: flex;justify-content: space-between;align-items: center;"> <view class="fd_top u-skeleton-fillet" style="display: flex;justify-content: space-between;align-items: center;position: relative;z-index: 999;">
<u-select v-model="pxshow" :list="pxlist" @confirm="pxconfirm"></u-select> <u-select v-model="pxshow" :list="pxlist" @confirm="pxconfirm"></u-select>
<view class="inpus"> <view class="inpus">
<input type="text" placeholder="请输入搜索内容"/> <u-icon name="arrow-down" color="#000" size="28" style="margin-left: 30rpx;" @click="btnshanghu"></u-icon> <input type="text" placeholder="请输入搜索内容" v-model="keyword"/>
<!-- <u-icon name="arrow-down" color="#000" size="28" style="margin-left: 30rpx;" @click="btnshanghu"></u-icon> -->
</view> </view>
<view class="seachsou"> <view class="seachsou" @click="btnsousuo">
搜索 搜索
</view> </view>
<view class="right"> <view class="right">
@ -33,7 +34,7 @@
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
<view class="mxshanghuflag" v-if="shanghuflag"></view>
<u-mask :show="showfz" @click="showfz=false"></u-mask> <u-mask :show="showfz" @click="showfz=false"></u-mask>
<view class="fz" v-show="showfz"> <view class="fz" v-show="showfz">
@ -67,12 +68,12 @@
<swiper class="swiper" style="height: 100%;" :current='curtitidx' @change="swiperchange" <swiper class="swiper" style="height: 100%;" :current='curtitidx' @change="swiperchange"
@touchstart="touchStart" @touchend="touchEnd"> @touchstart="touchStart" @touchend="touchEnd">
<swiper-item class=""> <swiper-item class="">
<!-- <view class="" v-if="wateringList && wateringList.length == 0" <view class="" v-if="wateringList == '' && wateringList.length == 0"
style="width: 100%;height: 200rpx;margin: auto;margin-top: 230rpx;text-align: center;"> style="width: 100%;height: 200rpx;margin: auto;margin-top: 230rpx;text-align: center;">
<image style="width: 200rpx;height: 200rpx;" <image style="width: 200rpx;height: 200rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uZFUpcz0YZZ4f4RjvGg2" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/uZFUpcz0YZZ4f4RjvGg2" mode=""></image>
<view class="" style="font-size: 28rpx;color: #808080;margin-top: 30rpx;"></view> <view class="" style="font-size: 28rpx;color: #808080;margin-top: 30rpx;">暂无设备...</view>
</view> --> </view>
<view class="swiper_item"> <view class="swiper_item">
<view class="card_box" v-for="(item,indexs) in wateringList" :key="indexs"> <view class="card_box" v-for="(item,indexs) in wateringList" :key="indexs">
<view class="card"> <view class="card">
@ -104,14 +105,14 @@
S/N码{{item.deviceNo}} S/N码{{item.deviceNo}}
</view> </view>
<!-- @click="sremakes(item)" --> <!-- @click="sremakes(item)" -->
<view v-if="item.storeId == null" class="dianpu" <view v-if="item.userName == null" class="dianpu" @click="todetail(item.deviceId)"
style="border: 1px solid #ccc;padding: 5rpx;font-size:26rpx: border-box;width: 180rpx;border-radius: 20rpx;color: #ccc;text-align: center;margin-top: 10rpx;"> style="border: 1px solid #ccc;padding: 5rpx;font-size:26rpx: border-box;width: 180rpx;border-radius: 20rpx;color: #ccc;text-align: center;margin-top: 10rpx;">
未绑定商户 未绑定商户
</view> </view>
<view v-else :class="item.onlineStatus == 0 ? 'activewzgl' : ''" <view v-else :class="item.onlineStatus == 0 ? 'activewzgl' : ''"
style="color: #95989D;padding-top: 20rpx;font-size: 26rpx;" style="color: #95989D;padding-top: 20rpx;font-size: 26rpx;"
@click="todetail(item.deviceId)"> @click="todetail(item.deviceId)">
归属商户{{item.storeName == null ? '--' : item.storeName}} 归属商户{{item.userName == null ? '--' : item.userName}}
</view> </view>
</view> </view>
<view class="card_right" @click="todetail(item.deviceId)"> <view class="card_right" @click="todetail(item.deviceId)">
@ -128,9 +129,10 @@
<!-- 选择店铺 --> <!-- 选择店铺 -->
<u-select v-model="showshop" :list="shoplist" @confirm="confirms"></u-select> <u-select v-model="showshop" :list="shoplist" @confirm="confirms"></u-select>
<image v-if="curtitidx == 0" class="saoyisao" @click="saoyisao" <!-- 扫描二维码 -->
src="https://api.ccttiot.com/smartmeter/img/static/uiDR6MnGHguBRNSYFTVw" mode=""></image> <!-- <image v-if="curtitidx == 0" class="saoyisao" @click="saoyisao"
src="https://api.ccttiot.com/smartmeter/img/static/uiDR6MnGHguBRNSYFTVw" mode=""></image> -->
<!-- <tab-bar :indexs='0'></tab-bar> --> <!-- <tab-bar :indexs='0'></tab-bar> -->
@ -292,7 +294,8 @@
deviceNo: '', deviceNo: '',
btnmsk:false, btnmsk:false,
pxzt:'onlineStatus', pxzt:'onlineStatus',
qingqiuflag:true qingqiuflag:true,
keyword:''
} }
}, },
onLoad() { onLoad() {
@ -771,9 +774,11 @@
}) })
} }
}, },
//
btnsousuo(){
this.pagenum = 1
this.getlist()
},
// //
touchStart(e) { touchStart(e) {
this.touchStartX = e.touches[0].clientX; this.touchStartX = e.touches[0].clientX;
@ -1045,7 +1050,7 @@
getlist() { getlist() {
this.shujuflag = false this.shujuflag = false
// if (this.storeId == null) { // if (this.storeId == null) {
this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}&orderByColumn=${this.pxzt}&isAsc=desc`).then((res) => { this.$u.get(`/agent/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}&orderByColumn=${this.pxzt}&isAsc=desc&keyword=${this.keyword}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.xiaflag = true this.xiaflag = true
this.shuaxin = false this.shuaxin = false
@ -1063,42 +1068,13 @@
this.wateringList = this.wateringList.concat(res.rows) this.wateringList = this.wateringList.concat(res.rows)
this.shujuflag = false this.shujuflag = false
this.qingqiuflag = true this.qingqiuflag = true
// console.log(this.wateringList);
// this.groupLists.forEach(groupItem => {
// groupItem.wateringList
// })
// this.wateringList.forEach(wateringItem => {
// this.groupLists[0].wateringList.push(wateringItem)
// })
// this.wateringList.forEach(wateringItem => {
// this.groupLists.forEach(groupItem => {
// if (groupItem.storeId !== null && wateringItem.storeId !== null && groupItem.storeId == wateringItem.storeId) {
// if (!groupItem.wateringList.some(item => item.storeId === wateringItem.storeId)) {
// groupItem.wateringList.push(wateringItem)
// }
// }
// })
// })
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 => {
// groupItem.wateringList = []
// })
// this.wateringList.forEach(wateringItem => {
// this.groupLists[0].wateringList.push(wateringItem);
// })
// this.wateringList.forEach(wateringItem => {
// this.groupLists.forEach(groupItem => {
// if (groupItem.storeId !== null && wateringItem.storeId !== null && groupItem.storeId == wateringItem.storeId) {
// groupItem.wateringList.push(wateringItem)
// }
// })
// })
// console.log(this.groupLists)
uni.hideLoading() uni.hideLoading()
} }
this.isLoading = false this.isLoading = false
@ -1109,75 +1085,7 @@
} }
}) })
}, },
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({
@ -1482,12 +1390,12 @@
} }
.mxshanghuflag{ .mxshanghuflag{
width: 100%; width: 100%;
height: 90vh; height: 100vh;
background-color: #000; background-color: #000;
opacity: .5 !important; opacity: .5 !important;
border-radius: 20rpx; border-radius: 20rpx;
position: fixed; position: fixed;
top: 320rpx; top: 0;
left:0; left:0;
z-index: 998; z-index: 998;
animation: slideDown .5s ease-out forwards; animation: slideDown .5s ease-out forwards;
@ -1499,6 +1407,7 @@
border-radius: 10rpx; border-radius: 10rpx;
padding-right: 20rpx; padding-right: 20rpx;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff;
input{ input{
width: 400rpx; width: 400rpx;
height: 60rpx; height: 60rpx;
@ -1585,7 +1494,7 @@
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 99; z-index: 999;
text-align: center; text-align: center;
.img { .img {