This commit is contained in:
3321822538@qq.com 2024-08-06 18:04:09 +08:00
parent eded78b18e
commit 1800a6be1d
16 changed files with 749 additions and 864 deletions

View File

@ -3,7 +3,7 @@
<div class="tab" @tap.stop="changeTabbar(0)">
<image src="@/static/tabbar/home.png" mode="" v-show="indexs!=0"></image>
<image src="@/static/tabbar/home-active.png" mode="" v-show="indexs==0"></image>
<div class="txt" :class="indexs==0?'act1':''">首页</div>
<div class="txt" :class="indexs==0?'act1':''">设备</div>
</div>
<div class="tab" @tap.stop="changeTabbar(1)">
<image src="@/static/tabbar/tj.png" mode="" v-show="indexs!=1" style="width: 36rpx;height: 36rpx;"></image>

File diff suppressed because it is too large Load Diff

View File

@ -149,105 +149,9 @@
this.sceneValue = option.q
let decodedValue = decodeURIComponent(this.sceneValue);
this.id = getQueryParam(decodedValue, 's')
// this.$u.get("/app/user/userInfo").then((res) => {
// if (res.code == 200) {
// this.getone()
// } else {
// uni.navigateTo({
// url: '/pages/login/login?id=' + 1
// })
// }
// })
} else {
this.id = option.id
// this.$u.get("/app/user/userInfo").then((res) => {
// if (res.code == 200) {
// this.getone()
// } else {
// uni.navigateTo({
// url: '/pages/login/login?id=' + 1
// })
// }
// })
// let that = this
// let data = {
// deviceNo: that.id
// }
// that.$u.get(`/app/device/isBind?deviceNo=${that.id}`).then(res => {
// if (res.data == 2) {
// that.$u.get(`/app/device/${that.id}/withSuitList`).then((res) => {
// if (res.code == 200) {
// that.$u.get(`/app/device/${that.id}/bySn`).then((res) => {
// if (res.code == 200) {
// that.mac = 'CTKG-' + res.data.mac
// that.onlineStatus = res.data.onlineStatus
// if (that.onlineStatus == 0) {
// //
// xBlufi.initXBlufi(1)
// xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
// 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)
// }
// }
// })
// }
// })
// } else if (res.data == 1) {
// console.log(222);
// uni.showModal({
// title: '',
// content: ',',
// success: function(res) {
// if (res.confirm) {
// that.$u.put("/app/device/bind", data).then(res => {
// if(res.code == 200){
// that.$u.get(`/app/device/${that.id}/bySn`).then((res) => {
// if (res.code == 200) {
// uni.navigateTo({
// url: '/page_components/bindsz?id=' + res.data.deviceId
// })
// }
// })
// }
// })
// } else if (res.cancel) {
// }
// }
// })
// } else if (res.data == 0) {
// uni.showModal({
// title: '',
// content: ',',
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: '/page_fenbao/zhuce?sn=' + that.id
// })
// } else if (res.cancel) {
// }
// }
// })
// }
// })
// this.gettaoc()
}
},
computed: {
@ -286,7 +190,7 @@
},
onUnload: function() {
if (this.timer) {
clearInterval(this.timer);
clearInterval(this.timer)
this.timer = null;
}
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
@ -304,7 +208,7 @@
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
})
},
methods: {
getone(){
@ -423,10 +327,10 @@
uni.makePhoneCall({
phoneNumber: phoneNumber,
success: function(res) {
console.log('拨打电话成功', res);
console.log('拨打电话成功', res)
},
fail: function(err) {
console.error('拨打电话失败', err);
console.error('拨打电话失败', err)
uni.showToast({
title: '拨打电话失败',
icon: 'none'
@ -466,15 +370,15 @@
gettaoc() {
this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => {
if (res.code == 200) {
this.deviceobj = res.data;
this.deviceobj = res.data
this.zfobj = res.data.suitList[0]
let targetDateStr = this.deviceobj.expireTime;
let targetParts = targetDateStr.split(/[- :]/);
let targetDate = new Date(targetParts[0], targetParts[1] - 1, targetParts[2], targetParts[3], targetParts[4], targetParts[5]);
let now = new Date();
let differenceInMs = targetDate - now;
let targetDateStr = this.deviceobj.expireTime
let targetParts = targetDateStr.split(/[- :]/)
let targetDate = new Date(targetParts[0], targetParts[1] - 1, targetParts[2], targetParts[3], targetParts[4], targetParts[5])
let now = new Date()
let differenceInMs = targetDate - now
if (differenceInMs <= 0) {
this.expireTimeStr = '0';
this.expireTimeStr = '0'
} else {
this.expireTimeStr = '1'
}
@ -528,9 +432,9 @@
paySign: res.data.paySign,
success: (res) => {
this.zhifuflag = true
// console.log(res, '');
// console.log(res, '')
if (that.timer) {
clearInterval(this.timer);
clearInterval(this.timer)
that.timer = null;
}
that.$u.put(`/app/bill/${that.orderno}/refreshPayResult`).then(res => {})
@ -591,7 +495,7 @@ x
if (res.confirm) {
} else if (res.cancel) {
console.log('用户点击了取消');
console.log('用户点击了取消')
}
}
})

View File

@ -39,8 +39,6 @@
<view class="jinwei">
<view class="tit"> 详细地址</view>
<view class="but">
<!-- <input type="text" v-model="latitude" disabled="true" style="color: #666;" />
<input type="text" v-model="longitude" disabled="true" style="color: #666;" /> -->
<input type="text" placeholder="请输入详细地址" v-model="xqdz" />
<u-icon name="map-fill" style="position: absolute;top: 20rpx;right: 22rpx;z-index: 99;"
size="32" @click="btnjwd"></u-icon>
@ -50,10 +48,6 @@
<view class="tit"> 是否展示店铺</view>
<u-switch v-model="checked" active-color="#8883F0"></u-switch>
</view>
<!-- <view class="listval">
<view class="tit"> 详细地址</view>
<view class="but"> <input type="text" placeholder="请输入详细地址" v-model="xqdz" /> </view>
</view> -->
<view class="icon">
<view class="list_box">
<view class="lt">
@ -152,11 +146,15 @@
province: '',
city: '',
area: '',
url:''
url:'',
id:''
}
},
onLoad() {
onLoad(option) {
if(option.id){
this.id = option.id
// console.log(option,'ididididdidi');
}
},
onShow() {
this.getQiniuToken()
@ -215,7 +213,7 @@
title: '请输入店铺名称',
icon: 'none',
duration: 1000
});
})
}else if(this.shopname.length > 5) {
uni.showToast({
title: '店铺名称过长,不能超过五个字',
@ -227,55 +225,55 @@
title: '请选择商铺类型',
icon: 'none',
duration: 1000
});
})
} else if (this.ksyy == '开始营业时间') {
uni.showToast({
title: '请选择开始营业时间',
icon: 'none',
duration: 2000
});
})
} else if (this.jsyy == '结束营业时间') {
uni.showToast({
title: '请选择结束营业时间',
icon: 'none',
duration: 2000
});
})
} else if (this.regiontext == '请选择省市区') {
uni.showToast({
title: '请选择省市区',
icon: 'none',
duration: 1000
});
})
} else if (this.lxname == '') {
uni.showToast({
title: '请输入联系人',
icon: 'none',
duration: 1000
});
})
} else if (this.lxphone == '') {
uni.showToast({
title: '请输入联系电话',
icon: 'none',
duration: 1000
});
})
} else if (this.longitude == '请输入经度') {
uni.showToast({
title: '请点击地图图标选择位置',
icon: 'none',
duration: 1000
});
})
} else if (this.xqdz == '') {
uni.showToast({
title: '请输入详细地址',
icon: 'none',
duration: 1000
});
})
} else if (this.imglist == '') {
uni.showToast({
title: '请上传一张商铺门面照',
icon: 'none',
duration: 1000
});
})
} else {
this.btnmsk = true
let data = {
@ -297,15 +295,41 @@
}
this.$u.post("/app/store", data).then(res => {
if (res.code == 200) {
uni.showToast({
title: '创建成功',
icon: 'success',
duration: 1000
})
setTimeout(()=>{
uni.navigateBack()
this.btnmsk = false
},1000)
if(this.id){
let list = []
this.$u.get("/app/store/listCount").then((res) => {
if (res.data != 0) {
list = res.data
let data = {
deviceId: this.id,
storeId:list[1].storeId
}
this.$u.put('/app/device', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '创建成功',
icon: 'success',
duration: 1000
})
setTimeout(()=>{
uni.navigateBack()
this.btnmsk = false
},1000)
}
})
}
})
}else{
uni.showToast({
title: '创建成功',
icon: 'success',
duration: 1000
})
setTimeout(()=>{
uni.navigateBack()
this.btnmsk = false
},1000)
}
}else{
uni.showToast({
title: res.msg,
@ -353,7 +377,7 @@
//
}
},
});
})
},
@ -362,7 +386,7 @@
if (res.code == 200) {
this.token = res.token
}
});
})
},
// btn() {
// let _this = this

View File

@ -122,15 +122,15 @@
})
},
hidePlaceholder() {
this.placeholderVisible = false;
this.placeholderVisible = false
},
showPlaceholder() {
if (!this.textValue) {
this.placeholderVisible = true;
this.placeholderVisible = true
}
},
updateWordCount() {
this.currentCount = this.textValue.trim().replace(/\s+/g, '').length;
this.currentCount = this.textValue.trim().replace(/\s+/g, '').length
},
sub() {
if (this.cutidx == -1) {
@ -147,7 +147,7 @@
});
} else {
this.btnmsk = true
var imgString = this.imglist.join(',');
var imgString = this.imglist.join(',')
let data = {
type: this.cutidx,
content: this.textValue,
@ -196,7 +196,7 @@
key: 'smartmeter/img/' + math
},
success: function(res) {
console.log(res, 'resres');
// console.log(res, 'resres');
let str = JSON.parse(res.data)
_this.userImgs = 'https://api.ccttiot.com/' + str.key
_this.imglist.push(_this.userImgs)

View File

@ -106,9 +106,9 @@
this.pagenum++
} else {
//
this.noMoreData = true;
this.noMoreData = true
}
this.isLoading = false;
this.isLoading = false
}
})
},

View File

@ -94,7 +94,7 @@
},
computed: {
totalHeight() {
return this.obj.length * this.cardHeight;
return this.obj.length * this.cardHeight
},
},
//
@ -146,7 +146,7 @@
this.$u.post("/app/store",data).then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
this.getgroup();
this.getgroup()
// this.loadings=true
// this.initChart()
@ -163,7 +163,7 @@
// console.log(this.groupList)
this.firstlist= this.groupList[0]
this.newobj = this.groupList.slice(1)
console.log(this.newobj,'2121212121');
// console.log(this.newobj,'2121212121');
// this.newobj = this.groupList
this.remake=''
this.price=''
@ -191,7 +191,7 @@
}
})
} else if (res.cancel) {
console.log('用户点击了取消');
console.log('用户点击了取消')
}
}
})
@ -276,45 +276,45 @@
handleTouchStart(e) {
this.touchStartIndex = e.currentTarget.dataset.index;
this.startY = e.touches[0].clientY;
this.touchStartIndex = e.currentTarget.dataset.index
this.startY = e.touches[0].clientY
},
handleTouchMove(e) {
clearTimeout(this.touchMoveTimer);
clearTimeout(this.touchMoveTimer)
this.touchMoveTimer = setTimeout(() => {
const deltaY = e.touches[0].clientY - this.startY;
const newIndex = Math.floor((this.obj[this.touchStartIndex].top + deltaY) / this.cardHeight);
const maxIndex = this.obj.length - 1;
const deltaY = e.touches[0].clientY - this.startY
const newIndex = Math.floor((this.obj[this.touchStartIndex].top + deltaY) / this.cardHeight)
const maxIndex = this.obj.length - 1
if (newIndex >= 1 && newIndex <= maxIndex) {
this.obj[this.touchStartIndex].top += deltaY;
this.obj[newIndex].top -= deltaY;
this.obj[this.touchStartIndex].top += deltaY
this.obj[newIndex].top -= deltaY
this.startY = e.touches[0].clientY;
this.startY = e.touches[0].clientY
this.$nextTick(() => {
this.direction = 'vertical';
this.direction = 'vertical'
});
} else {
this.direction = 'none';
this.direction = 'none'
}
}, 16); // 60
},
handleTouchEnd() {
this.touchStartIndex = -1;
this.startY = 0;
this.touchStartIndex = -1
this.startY = 0
},
handleMoveChange(e) {
this.obj = e.detail.source;
this.obj = e.detail.source
//
this.obj.forEach((item, index) => {
// item
if (item) {
item.top = index * this.cardHeight;
item.top = index * this.cardHeight
}
});
},

View File

@ -1,11 +1,11 @@
<template>
<view>
<u-navbar title="账单详情" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36'
height='50'></u-navbar>
<u-navbar title="收支详情" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
title-size='36' height='50'></u-navbar>
<view class="cont">
<view class="order_card">
<view class="cardtop">
<view class="text" v-if="list.status == 2">
<!-- <view class="text" v-if="list.status == 2">
已支付
</view>
<view class="text" v-if="list.status == 1">
@ -24,7 +24,7 @@
支付中
</view>
<view class="num" v-if="list.type == 1">
<!-- {{list.suitTime}} 分钟 -->
{{list.suitTime}} 分钟
{{list.money}}
</view>
<view class="text" v-if="list.type == 1">
@ -32,53 +32,63 @@
</view>
<view class="nums" v-if="list.type == 2">
提现金额{{list.money}}
</view> -->
<view class="num">
<view class="info_li">
<view class="text">
变动金额
</view>
<view class="text" style="color: #8883F0;font-size: 60rpx;">
{{list.amount}}
</view>
</view>
</view>
</view>
<view class="card_bot">
<view class="info_li">
<view class="text" v-if="list.type == 1">
到账日期
</view>
<view class="text" v-if="list.type == 2">
提现日期
<view class="text">
变动日期
</view>
<view class="text">
{{list.createTime}}
</view>
</view>
<view class="info_li" v-if="list.type == 1">
<view class="info_li">
<view class="text">
充值设备
变动前余额
</view>
<view class="text">
{{list.deviceName}}
{{list.beforeBalance}}
</view>
</view>
<view class="info_li">
<view class="text" v-if="list.type == 1">
充值类型
</view>
<view class="text" v-if="list.type == 2">
提现类型
<view class="text">
变动后余额
</view>
<view class="text">
{{list.channelName}}
{{list.afterBalance}}
</view>
</view>
<view class="info_li">
<view class="text" v-if="list.type == 1">
充值用户
</view>
<view class="text" v-if="list.type == 2">
提现用户
<view class="info_li">
<view class="text">
用户名称
</view>
<view class="text">
{{list.userName}}
</view>
</view>
<view class="info_li">
<view class="text">
变动原因
</view>
<view class="text">
{{list.reason}}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -95,51 +105,47 @@
}
},
//
onShareAppMessage: function () {
return {
title: '创想物联',
path: '/pages/shouye/index'
}
},
//
onShareTimeline: function () {
return {
title: '创想物联',
query: '',
path: '/pages/shouye/index'
}
},
onShareAppMessage: function() {
return {
title: '创想物联',
path: '/pages/shouye/index'
}
},
//
onShareTimeline: function() {
return {
title: '创想物联',
query: '',
path: '/pages/shouye/index'
}
},
onLoad(option) {
// console.log(option)
this.getdetail(option.id)
},
methods: {
getdetail(id) {
this.$u.get("/app/bill/" + id).then((res) => {
this.$u.get("/app/recordBalance/" + id).then((res) => {
if (res.code == 200) {
this.list = res.data
// if (res.data.payType == 1) {
// this.payType = ''
// } else if (res.data.payType == 2) {
// this.payType = ''
// } else if (res.data.payType == 3) {
// this.payType = ''
// }
}
});
})
},
}
}
</script>
<style lang="scss">
/deep/ .u-title{
/deep/ .u-title {
padding-bottom: 22rpx;
}
/deep/ .u-icon__icon{
/deep/ .u-icon__icon {
padding-bottom: 22rpx;
}
page {
background: #F7FAFE;
}
@ -160,10 +166,7 @@
.cardtop {
margin-top: 48rpx;
height: 190rpx;
// display: flex;
// flex-wrap: wrap;
// justify-content: center;
height: 190rpx;
.text {
text-align: center;
width: 100%;
@ -171,25 +174,30 @@
font-weight: 400;
font-size: 28rpx;
color: #808080;
margin-top: 20rpx;
}
.num {
text-align: center;
margin-top: 18rpx;
// margin-top: 18rpx;
padding-top: 10rpx;
box-sizing: border-box;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
// font-size: 60rpx;
color: #8883F0;
font-size: 36rpx;
}
.nums {
text-align: center;
padding-top: 48rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 60rpx;
color: #8883F0;
}
.nums {
text-align: center;
padding-top: 48rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 60rpx;
color: #8883F0;
}
}
.card_bot {
@ -199,7 +207,7 @@
text-align: center;
.info_li {
margin-top: 35rpx;
margin-top: 20rpx;
width: 560rpx;
display: flex;
flex-wrap: nowrap;

View File

@ -100,14 +100,6 @@
</view>
<view class="bot">归零</view>
</view>
<!-- <view class="cont" style="width: 120rpx;" @click="toydfx()">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uDVSE5BFHQnjG2JTVE62" mode="">
</image>
</view>
<view class="bot">用电分析</view>
</view> -->
<view class="cont" @click="topage(6)">
<view class="top">
<image style="width: 58rpx;height: 58rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uAnBmmayp3tVGwXntdaM" mode=""></image>
@ -319,25 +311,25 @@
formattedTime() {
if (this.timeday.days > 0) {
//
return `${this.timeday.days}${this.timeday.hours}小时`;
return `${this.timeday.days}${this.timeday.hours}小时`
} else if (this.timeday.hours > 0) {
//
return `${this.timeday.hours}小时${this.timeday.minutes}分钟`;
return `${this.timeday.hours}小时${this.timeday.minutes}分钟`
} else if (this.timeday.minutes > 0) {
//
return `${this.timeday.minutes}分钟${this.timeday.seconds}`;
return `${this.timeday.minutes}分钟${this.timeday.seconds}`
} else {
// 00
return this.timeday.seconds > 0 ? `${this.timeday.seconds}` : '0';
return this.timeday.seconds > 0 ? `${this.timeday.seconds}` : '0'
}
}
},
beforeDestroy() {
//
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
console.log('已销毁');
clearInterval(this.timer)
this.timer = null
console.log('已销毁')
}
},
onShow() {
@ -433,12 +425,12 @@
uni.chooseImage({
count: 1,
success: (rst) => {
this.url = rst.tempFilePaths[0];
this.url = rst.tempFilePaths[0]
}
})
},
onok(ev) {
this.url = "";
this.url = ""
this.path = ev.path;
let _this = this
let math = 'static/' + _this.$u.guid(20)
@ -451,11 +443,11 @@
key: 'smartmeter/img/' + math
},
success: function(res) {
console.log(res);
// console.log(res);
let str = JSON.parse(res.data)
_this.userImgs = 'https://api.ccttiot.com/' + str.key
_this.imglist = _this.userImgs
console.log(_this.imglist,'_this.imglist_this.imglist');
// console.log(_this.imglist,'_this.imglist_this.imglist')
let data = {
deviceId:_this.id,
customPicture:_this.imglist
@ -591,16 +583,16 @@
uni.showToast({
title: res.msg,
icon: 'none'
});
})
}
});
})
},
opendevices() {
},
swiperchange(e) {
this.curtitidx = e.detail.current
console.log(e, 'aaaa');
// console.log(e, 'aaaa');
},
changeidx(index) {
this.curtitidx = index
@ -688,7 +680,7 @@
})
} else if (res.cancel) {
that.btnmsk = false
console.log('用户点击了取消');
console.log('用户点击了取消')
}
}
})
@ -718,7 +710,7 @@
// console.log(this.deviceId,'idididididdidii');
if(this.setMode == null){
xBlufi.initXBlufi(1)
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
@ -737,9 +729,9 @@
deviceId: this.deviceId
})
let name = ''
let index = this.name.indexOf('-');
let index = this.name.indexOf('-')
if (index !== -1) {
name = this.name.slice(index + 1);
name = this.name.slice(index + 1)
}
let data = {
storeId: this.storeId,
@ -751,7 +743,7 @@
this.shibaiflag = false
this.bluetoothflag = false
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
let systemInfo = uni.getSystemInfoSync()
if (systemInfo.platform == 'android') {
// Android
uni.navigateTo({
@ -783,9 +775,9 @@
}, 1000)
}else{
let name = ''
let index = this.name.indexOf('-');
let index = this.name.indexOf('-')
if (index !== -1) {
name = this.name.slice(index + 1);
name = this.name.slice(index + 1)
}
let data = {
storeId: this.storeId,
@ -802,7 +794,7 @@
this.bluetoothflag = false
uni.hideLoading();
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
let systemInfo = uni.getSystemInfoSync()
if (systemInfo.platform == 'android') {
// Android
uni.navigateTo({
@ -908,7 +900,7 @@
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
let loadPercent = options.data;
let loadText = '文件读取中'
// console.log("", options.data);
// console.log("", options.data)
break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
let ver_data = this.parseCustomData(options.data)
@ -918,22 +910,22 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
let devicesarr = options.data
// console.log(devicesarr,'devicesarrdevicesarr');
// console.log(devicesarr,'devicesarrdevicesarr')
devicesarr.forEach(device => {
const mac = device.name.substring(5)
if (device.name == this.qrResult) {
this.deviceId = device.deviceId
this.name = device.name
this.mac = device.name.slice(5, 17)
// console.log(this.mac, 'macmacmac');
// this.devicesList = uniqueDevicesList;
// console.log(this.mac, 'macmacmac')
// this.devicesList = uniqueDevicesList
}
})
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
// console.log("" + JSON.stringify(options));
// console.log("" + JSON.stringify(options))
if (options.result) {
this.bluetoothflag = false
uni.hideLoading();
@ -943,7 +935,7 @@
// });
{
console.log("连接回调options.data.deviceId" + options.data.deviceId,
"连接回调options.data.name" + options.data.name);
"连接回调options.data.name" + options.data.name)
}
} else {
this.shibaiflag = true
@ -964,7 +956,7 @@
uni.hideLoading()
this.bluetoothflag = false
},3000)
console.log("蓝牙未开启", options);
console.log("蓝牙未开启", options)
// uni.showToast({
// title: '',
// icon: 'none',
@ -983,14 +975,14 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) {
let uniqueDevicesList = Array.from(new Set(this.devicesList));
let uniqueDevicesList = Array.from(new Set(this.devicesList))
// this.devicesList
this.devicesList = uniqueDevicesList;
this.devicesList = uniqueDevicesList
let list = []
filteredDevices.forEach(device => {
// MAC MAC 6
let macFromName = device.name.substring(device.name.length - 12);
let macFromName = device.name.substring(device.name.length - 12)
this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
if (res.data == false) {
list.push(device)
@ -1004,31 +996,27 @@
this.devicesList = list
}, 200)
console.log('蓝牙停止搜索ok');
console.log('蓝牙停止搜索ok')
} else {
//
console.log('蓝牙停止搜索失败');
console.log('蓝牙停止搜索失败')
}
this.searching = false
// _this.setData({
// searching: false
// });
break;
break
}
},
parseCustomData(data) {
// "@"
const dataArray = data.split('@');
const dataArray = data.split('@')
//
const voltage = parseFloat(dataArray[0].substring(1)); // "V"
const switchState = dataArray[1].substring(1); // "S"
const current = parseFloat(dataArray[2].substring(1)); // "A"
const power = parseFloat(dataArray[4].substring(1)); // "P"
const remainingPower = parseFloat(dataArray[5].substring(1)); // "M"
const setMode = dataArray[6].substring(1); // "T"
const voltage = parseFloat(dataArray[0].substring(1)) // "V"
const switchState = dataArray[1].substring(1)// "S"
const current = parseFloat(dataArray[2].substring(1)) // "A"
const power = parseFloat(dataArray[4].substring(1)) // "P"
const remainingPower = parseFloat(dataArray[5].substring(1)) // "M"
const setMode = dataArray[6].substring(1) // "T"
//
return {
@ -1076,7 +1064,6 @@
.one{
font-size: 36rpx;
color: #000;
// margin-top: 80rpx;
}
.two{
margin-top: 30rpx;
@ -1126,7 +1113,6 @@
width: 530rpx;
height: 90rpx;
line-height: 90rpx;
// border: 1px solid #808080;
border-radius: 20rpx;
text-align: center;
background-color: #fff;
@ -1298,8 +1284,7 @@
align-items: center;
justify-content: center;
margin-left: 19rpx;
// width: 38rpx;
// height: 23rpx;
padding: 0 10rpx;
box-sizing: border-box;
background: rgba(204, 204, 204, 0);
@ -1327,22 +1312,18 @@
margin-right: 34rpx;
.echarts {
// width: 210rpx;
height: 200rpx;
.uni-ec-canvas {
width: 100%;
height: 100rpx !important;
display: block;
// margin-top: 30rpx;
}
}
}
.bot_right {
// margin-top: 50rpx;
display: flex;
// flex-wrap: nowrap;
width: 100%;
justify-content: space-between;
padding-left: 80rpx;
@ -1369,9 +1350,7 @@
}
}
.bot_right {
// margin-top: 50rpx;
display: flex;
// flex-wrap: nowrap;
width: 100%;
justify-content: space-between;
padding-left: 80rpx;
@ -1453,7 +1432,6 @@
padding-top: 40rpx;
margin-top: 24rpx;
width: 670rpx;
// height: 318rpx;
background: #FFFFFF;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(53, 140, 255, 0.1);
border-radius: 28rpx;
@ -1469,8 +1447,6 @@
}
.cont_box {
// padding-left: 30rpx;
// padding-right: 30rpx;
padding: 0 40rpx;
margin-top: 32rpx;
display: flex;
@ -1484,11 +1460,6 @@
.cont {
width: 25%;
text-align: center;
// display: flex;
// flex-wrap: wrap;
// align-items: center;
// justify-content: center;
// margin-right: 80rpx;
.top {
image {

View File

@ -321,7 +321,7 @@
this.showshop = true
},
confirms(e){
console.log(e);
// console.log(e);
let data = {
deviceId: this.id,
storeId:e[0].value
@ -358,7 +358,7 @@
onReachBottom() {
let sum = this.total / this.pagesize
if (this.pagenum - 1 < sum) {
this.getlist(); //
this.getlist() //
} else {
uni.showToast({
title: '没有更多订单记录了',
@ -389,6 +389,7 @@
},
sub(num) {
if (num == 1) {
console.log(this.remake)
let data = {
deviceId: this.id,
remark: this.remake
@ -396,7 +397,6 @@
this.showpopup = false
this.showremake = false
this.putdevice(data)
} else if (num == 2) {
let data = {
deviceId: this.id,
@ -407,7 +407,7 @@
this.showmc = false
this.putdevice(data)
}else if(num == 3){
console.log(this.xgname);
// console.log(this.xgname);
let data = {
deviceId: this.id,
deviceName: this.xgname,
@ -455,13 +455,13 @@
duration: 2000
})
this.btnmsk = false
});
})
} else if (resModal.cancel) { //
uni.showToast({
title: '已取消',
icon: 'none',
duration: 1000
});
})
}
}
});
@ -481,13 +481,12 @@
title: '修改成功',
icon: 'success',
duration: 2000
});
})
}
})
},
sremakemc(){
console.log(1);
// console.log(1);
this.showmc = true
this.xgname = this.listobj.deviceName
},
@ -521,15 +520,13 @@
// this.loadings=true
// this.initChart()
}
});
})
},
getgroup() {
this.$u.get("/app/store/listCount").then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
this.groupList = res.data
// this.loadings=true
// this.initChart()
}
@ -779,13 +776,9 @@
}
}
.icon {
// display: flex;
// flex-wrap: wrap;
// align-items: center;
margin-top: 40rpx;
margin-bottom: 30rpx;
.imgbox {
// width: 33%;
image {
width: 142rpx;
height: 142rpx;

View File

@ -4,10 +4,9 @@
height='50'></u-navbar>
<view class="cards" v-for="(item,index) in wateringList" :key="index" @click="btndetail(item.billId)" @scrolltolower="onReachBottom">
<view class="cards" v-for="(item,index) in wateringList" :key="index" @click="btndetail(item.id)" @scrolltolower="onReachBottom">
<view class="card_left">
<view class="top" v-if="item.type == 1">用户充值{{item.userName}}</view>
<view class="top" v-if="item.type == 2">商户提现{{item.userName}}</view>
<view class="top">{{item.reason}}</view>
<view class="bot">
{{item.createTime}}
</view>
@ -16,7 +15,7 @@
<!-- <view class="top" v-if="item.type == 1">{{item.suitTime}}
<text v-if="item.timeUnit == 1">日</text> <text v-if="item.timeUnit == 2">时</text> <text v-if="item.timeUnit == 3">分钟</text> <text v-if="item.timeUnit == 4"></text></view> -->
<view class="bot">
{{item.money}}
{{item.amount}}
</view>
</view>
@ -75,7 +74,7 @@
methods: {
//
getList(){
this.$u.get(`/app/bill/incomeList?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
this.$u.get(`/app/recordBalance/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
if (res.code == 200) {
this.total = res.total
if (this.total > 0) {
@ -89,16 +88,16 @@
this.pagenum++
} else {
//
this.noMoreData = true;
this.noMoreData = true
}
this.isLoading = false;
this.isLoading = false
}
});
},
onReachBottom() {
let sum = this.total / this.pagesize
if (this.pagenum-1 < sum) {
this.getList(); //
this.getList() //
} else {
this.jlflag = true
// uni.showToast({

View File

@ -225,12 +225,12 @@
this.pagenum++
} else {
//
this.noMoreData = true;
this.noMoreData = true
setTimeout(()=>{
this.jlflag = true
})
}
this.isLoading = false;
this.isLoading = false
}
});
},
@ -238,7 +238,7 @@
onReachBottom() {
let sum = this.total / this.pagesize
if (this.pagenum-1 < sum) {
this.getList(); //
this.getList() //
} else {
this.jlflag = true
// uni.showToast({

View File

@ -169,8 +169,6 @@
}
},
methods: {
btnwz(num){
if(num == 1){
this.type = 'user'

View File

@ -62,42 +62,6 @@
去添加
</view>
</view>
<!-- <view class="type_box" @click="pay(1,'3')">
<view class="box_left">
<image style="border-radius: 50%;" src="https://api.ccttiot.com/smartmeter/img/static/umHaHtYaD540zBB7NXQ7" mode=""></image>
<view class="text">
银行卡提现
</view>
</view>
<view class="box_right" :class="currentindex==1?'act1':''">
<span v-if="currentindex==1" style="color: #fff;"> <u-icon style="margin-top: 22rpx;" name="checkbox-mark" color="#fff" size="28"></u-icon> </span>
</view>
</view> -->
<!-- <view class="type_box" @click="pay(1,'2')">
<view class="box_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/uRsKrUoCa4XXCKyIMTwb" mode=""></image>
<view class="text">
支付宝提现
</view>
</view>
<view class="box_right" :class="currentindex==1?'act1':''">
<span v-if="currentindex==1"> </span>
</view>
</view> -->
<!-- <view class="type_box" v-for="(item,index) in infoList.BANK_CARD" :key="index" @click="pay(index+2,'3',item.accountNo)">
<view class="box_left">
<image :src="'http://bkaear.market.alicloudapi.com/banklogo/' + item.cardInfo.Icon" mode=""></image>
<view class="text">
{{item.cardInfo.bankName}}
</view>
</view>
<view class="box_right" :class="currentindex==index+2?'act1':''">
<span v-if="currentindex==index+2"> </span>
</view>
</view> -->
</view>
<view class="btn" v-if="listflag" @click="sub()">
确认提现
@ -200,7 +164,6 @@
getinfo(){
this.$u.get('/app/account' ).then((res) => {
if (res.code == 200) {
// console.log(res)
this.infoList = res.data
}
})
@ -288,14 +251,11 @@
},
getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
this.userinfo=res.data
this.money = ''
// console.log(this.userinfo);
}
});
})
},
}
@ -306,9 +266,6 @@
/deep/ .u-flex{
padding-top: 20rpx !important;
}
// /deep/ .u-iconfont{
// margin-top: 20rpx;
// }
/deep/ .u-title{
padding-bottom: 22rpx;
}
@ -332,7 +289,6 @@
}
.cont{
display: flex;
// justify-content: center;
flex-wrap: wrap;
margin: 0 auto;
width: 634rpx;
@ -399,10 +355,6 @@
}
.ipt{
width: 60%;
// .u-input::placeholder {
// font-size: 20px;
// color: red;
// }
}
.altx{
display: flex;

View File

@ -449,9 +449,6 @@
storeId: e[0].value
}
this.putdevice(data)
// setTimeout(() => {
// this.getlist()
// }, 1000)
},
putdevice(data) {
this.$u.put('/app/device', data).then((res) => {

View File

@ -61,7 +61,7 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/u3NDAI21OIGQH0Exdmdd" mode=""
style="width: 96rpx;height:94rpx;"></image>
</view>
</view>
</view>
<view class="guangg" @click="btnad">
<image :src="imgad" mode=""></image>
</view>
@ -126,8 +126,8 @@
deviceobj: {},
deviceCount: 0,
sylist: [],
networkInterval:null,
wangluo:true
networkInterval: null,
wangluo: true
};
},
onLoad(option) {
@ -150,7 +150,7 @@
}
},
onShow() {
this.logins()
this.getad()
this.gethuidaio()
@ -168,29 +168,29 @@
}
//
if (this.networkInterval) {
clearInterval(this.networkInterval);
this.networkInterval = null;
}
clearInterval(this.networkInterval)
this.networkInterval = null
}
},
methods: {
startNetworkCheck() {
this.networkInterval = setInterval(() => {
uni.getNetworkType({
success: (res) => {
// console.log(res);
if (res.networkType == "none") {
this.wangluo = false
} else {
this.wangluo = true
}
},
fail: (err) => {
console.error('获取网络类型失败', err);
}
});
}, 3000);
},
startNetworkCheck() {
this.networkInterval = setInterval(() => {
uni.getNetworkType({
success: (res) => {
// console.log(res);
if (res.networkType == "none") {
this.wangluo = false
} else {
this.wangluo = true
}
},
fail: (err) => {
console.error('获取网络类型失败', err);
}
});
}, 3000)
},
// 使
getshiy() {
@ -245,95 +245,100 @@
},
scanQRCode() {
if(this.wangluo == true){
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue)
let id = getQueryParam(decodedValue, 's')
// console.log(res, id)
let that = this
let data = {
deviceNo: id
}
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
if (res.data == 2) {
that.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_components/fuwu/index?id=' + id
})
}
})
} else if (res.data == 1) {
uni.showModal({
title: '提示',
content: '该设备未绑定,你需进行绑定吗?',
success: function(res) {
if (res.confirm) {
that.$u.put("/app/device/bind", data).then(res => {
if(res.code == 200){
that.$u.get(`/app/device/${id}/bySn`).then((res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_components/bindsz?id=' + res.data.deviceId
})
}
})
}
})
} else if (res.cancel) {
}
}
})
} else if (res.data == 0) {
uni.showModal({
title: '提示',
content: '该设备未录入,你需进行录入吗?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/page_fenbao/zhuce?sn=' + id
})
} else if (res.cancel) {
}
}
})
}
})
},
fail: err => {
console.error('扫描失败:', err)
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
}else{
uni.showModal({
title: '提示',
content: '请打开网络再进行操作',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
if (this.wangluo == true) {
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue)
let id = getQueryParam(decodedValue, 's')
// console.log(res, id)
let that = this
let data = {
deviceNo: id
}
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
if (res.data == 2) {
that.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_components/fuwu/index?id=' +
id
})
}
})
} else if (res.data == 1) {
uni.showModal({
title: '提示',
content: '该设备未绑定,你需进行绑定吗?',
success: function(res) {
if (res.confirm) {
that.$u.put("/app/device/bind", data).then(
res => {
if (res.code == 200) {
that.$u.get(
`/app/device/${id}/bySn`
).then((res) => {
if (res.code ==
200) {
uni.navigateTo({
url: '/page_components/bindsz?id=' + res.data.deviceId
})
}
})
}
})
} else if (res.cancel) {
}
}
})
} else if (res.data == 0) {
uni.showModal({
title: '提示',
content: '该设备未录入,你需进行录入吗?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/page_fenbao/zhuce?sn=' + id
})
} else if (res.cancel) {
}
}
})
}
})
},
fail: err => {
console.error('扫描失败:', err)
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
} else {
uni.showModal({
title: '提示',
content: '请打开网络再进行操作',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
}
},
getad() {
this.$u.get("/app/ad").then((res) => {
if (res.code == 200) {
@ -344,45 +349,53 @@
btnindex(num) {
if(this.wangluo = true){ //
if (num == 2) {
uni.navigateTo({
url: '/page_fenbao/statulist/question/index'
})
} else if (num == 3) {
uni.navigateTo({
url: '/page_fenbao/statulist/about/index'
})
} else if (num == 1) {
uni.navigateTo({
url: '/page_fenbao/statulist/myorder/index'
})
} else if (num == 4) {
uni.navigateTo({
url: '/page_fenbao/statulist/merchant/index'
})
} else if (num == 5) {
uni.navigateTo({
url: '/page_fenbao/statulist/nearby/index'
})
} else if (num == 6) {
uni.switchTab({
url: '/pages/index/index'
})
} else if (num == 7) {
uni.navigateTo({
url: '/page_fenbao/statulist/fault/yichang/index'
})
}
}else{
if (this.wangluo = true) { //
if (num == 2) {
uni.navigateTo({
url: '/page_fenbao/statulist/question/index'
})
} else if (num == 3) {
uni.navigateTo({
url: '/page_fenbao/statulist/about/index'
})
} else if (num == 1) {
uni.navigateTo({
url: '/page_fenbao/statulist/myorder/index'
})
} else if (num == 4) {
uni.navigateTo({
url: '/page_fenbao/statulist/merchant/index'
})
} else if (num == 5) {
uni.navigateTo({
url: '/page_fenbao/statulist/nearby/index'
})
} else if (num == 6) {
this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) {
uni.switchTab({
url: '/pages/index/index'
})
} else if (res.code == 401) {
uni.reLaunch({
url: '/pages/login/login'
})
}
})
} else if (num == 7) {
uni.navigateTo({
url: '/page_fenbao/statulist/fault/yichang/index'
})
}
} else {
uni.showModal({
title: '提示',
content: '请打开网络再进行操作',
success: function(res) {
if (res.confirm) {
} else if (res.cancel) {
}
}
})
@ -409,7 +422,7 @@
success: (res) => {
const timer = setTimeout(() => {
clearTimeout(timer);
}, 500);
}, 500)
}
})
},
@ -483,16 +496,16 @@
fail: (err) => {
console.error('获取位置失败:', err);
}
});
})
},
updateMarkers() {
this.mapContext.getScale({
success: (res) => {
this.covers = []; //
this.covers = [] //
if (res.scale <= 14) {
this.addMarkersWithoutLabels();
this.addMarkersWithoutLabels()
} else {
this.addMarkersWithLabels();
this.addMarkersWithLabels()
}
},
fail: (error) => {
@ -514,7 +527,7 @@
borderRadius: 5,
bgColor: '#fff'
};
this.covers.push(shopCover);
this.covers.push(shopCover)
}
});
},
@ -539,14 +552,14 @@
bgColor: '#fff'
}
}
this.covers.push(shopCover);
this.covers.push(shopCover)
}
});
},
handleMarkerClick(event) {
let markerId = event.markerId;
let markerId = event.markerId
uni.navigateTo({
url: '/page_user/mapditu/index?markerId=' + markerId
})
@ -575,20 +588,20 @@
if (res.code) {
let data = {
loginCode: res.code,
};
}
taht.$u.post('/app/auth/wxLogin', data).then(res => {
if (res.code == 10003) {
// uni.navigateTo({
// url: '/pages/login/login'
// })
} else if (res.code == 200) {
uni.setStorageSync('token', res.token);
uni.setStorageSync('token', res.token)
taht.logins()
}
});
})
}
},
});
})
},
@ -612,12 +625,10 @@
url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
})
},
},
mounted() {
this.getMyLocation(); //
this.startNetworkCheck(); //
this.getMyLocation() //
this.startNetworkCheck() //
}
};
</script>