This commit is contained in:
吴鹏 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)"> <div class="tab" @tap.stop="changeTabbar(0)">
<image src="@/static/tabbar/home.png" mode="" v-show="indexs!=0"></image> <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> <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>
<div class="tab" @tap.stop="changeTabbar(1)"> <div class="tab" @tap.stop="changeTabbar(1)">
<image src="@/static/tabbar/tj.png" mode="" v-show="indexs!=1" style="width: 36rpx;height: 36rpx;"></image> <image src="@/static/tabbar/tj.png" mode="" v-show="indexs!=1" style="width: 36rpx;height: 36rpx;"></image>

View File

@ -1,18 +1,23 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="设备设置" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36' <u-navbar title="设备设置" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
height='50'></u-navbar> title-size='36' height='50'></u-navbar>
<view class="card"> <view class="card">
<view class="icon"> <view class="icon">
<view class="imgbox" v-if="userImgs"> <view class="imgbox" v-if="userImgs">
<button style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;" @click="getImage"> <button
style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;"
@click="getImage">
<image style="border-radius: 10rpx;" :src="userImgs" mode="aspectFit"></image> <image style="border-radius: 10rpx;" :src="userImgs" mode="aspectFit"></image>
</button> </button>
</view> </view>
<view class="imgbox" v-else> <view class="imgbox" v-else>
<button style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;" @click="getImage"> <button
<image src="https://api.ccttiot.com/smartmeter/img/static/uY8CPw9YE6JxPzcHUaqf" mode="aspectFit"></image> style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;"
@click="getImage">
<image src="https://api.ccttiot.com/smartmeter/img/static/uY8CPw9YE6JxPzcHUaqf"
mode="aspectFit"></image>
</button> </button>
</view> </view>
<!-- 截图 --> <!-- 截图 -->
@ -71,7 +76,8 @@
</view> </view>
<view class="info"> <view class="info">
<view class="txt" style="display: flex;"> <view class="txt" style="display: flex;">
<view class="">{{taocan.length > 5 ? taocan.slice(0,5) + '...' : taocan}}</view> <view style="padding-top: 6rpx;" class="iconfont icon-xiangyou1"></view> <view class="">{{taocan.length > 5 ? taocan.slice(0,5) + '...' : taocan}}</view>
<view style="padding-top: 6rpx;" class="iconfont icon-xiangyou1"></view>
</view> </view>
</view> </view>
</view> </view>
@ -132,7 +138,7 @@
<u-popup v-model="showpopup" mode="center" border-radius='20'> <u-popup v-model="showpopup" mode="center" border-radius='20'>
<view class="popcard" v-if="showremake"> <view class="popcard" v-if="showremake">
<view class="tit"> <view class="tit">
修改备注 修改名称
</view> </view>
<view class="ipt"> <view class="ipt">
<u-input v-model="remake" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' /> <u-input v-model="remake" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' />
@ -494,12 +500,14 @@
if (systemInfo.platform == 'android') { if (systemInfo.platform == 'android') {
// Android // Android
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
}) })
} else if (systemInfo.platform == 'ios') { } else if (systemInfo.platform == 'ios') {
// iOS // iOS
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name url: '/page_fenbao/device/wifivideo?deviceId=' + this
.deviceId + '&name=' + this.name
}) })
} }
} else if (res.msg == '设备编号和mac不能同时为空') { } else if (res.msg == '设备编号和mac不能同时为空') {
@ -545,12 +553,14 @@
if (systemInfo.platform == 'android') { if (systemInfo.platform == 'android') {
// Android // Android
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
}) })
} else if (systemInfo.platform == 'ios') { } else if (systemInfo.platform == 'ios') {
// iOS // iOS
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name url: '/page_fenbao/device/wifivideo?deviceId=' + this.deviceId +
'&name=' + this.name
}) })
} }
} else { } else {
@ -588,7 +598,7 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url:'/page_fenbao/statulist/myshop/shopxx/index' url: '/page_fenbao/statulist/myshop/shopxx/index?id=' + that.id
}) })
} else if (res.cancel) { } else if (res.cancel) {
@ -754,10 +764,9 @@
this.getDevice() this.getDevice()
uni.showToast({ uni.showToast({
title: '修改成功', title: '修改成功',
icon: 'none', icon: 'success',
duration: 2000 duration: 2000
}); })
} }
}) })
}, },
@ -962,6 +971,7 @@
padding-top: 20rpx !important; padding-top: 20rpx !important;
box-sizing: border-box; box-sizing: border-box;
} }
/deep/ .panel { /deep/ .panel {
position: fixed; position: fixed;
width: 100%; width: 100%;
@ -972,12 +982,15 @@
z-index: 99 !important; z-index: 99 !important;
overflow: hidden; overflow: hidden;
} }
/deep/ .u-title { /deep/ .u-title {
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
/deep/ .u-icon__icon { /deep/ .u-icon__icon {
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
.bluetoothbox { .bluetoothbox {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
@ -987,32 +1000,38 @@
left: 0; left: 0;
z-index: 99; z-index: 99;
text-align: center; text-align: center;
.img { .img {
margin-top: 400rpx; margin-top: 400rpx;
width: 320rpx; width: 320rpx;
height: 320rpx; height: 320rpx;
} }
.one { .one {
font-size: 36rpx; font-size: 36rpx;
color: #000; color: #000;
// margin-top: 80rpx; // margin-top: 80rpx;
} }
.two { .two {
margin-top: 30rpx; margin-top: 30rpx;
font-size: 24rpx; font-size: 24rpx;
color: #ccc; color: #ccc;
} }
.thr { .thr {
margin-top: 30rpx; margin-top: 30rpx;
font-size: 28rpx; font-size: 28rpx;
color: #ccc; color: #ccc;
} }
.anfour { .anfour {
display: flex; display: flex;
margin-top: 30rpx; margin-top: 30rpx;
justify-content: space-between; justify-content: space-between;
padding: 0 220rpx; padding: 0 220rpx;
box-sizing: border-box; box-sizing: border-box;
.qx { .qx {
width: 100rpx; width: 100rpx;
height: 70rpx; height: 70rpx;
@ -1021,6 +1040,7 @@
border: 1px solid #3D3D3D; border: 1px solid #3D3D3D;
border-radius: 10rpx; border-radius: 10rpx;
} }
.cx { .cx {
width: 200rpx; width: 200rpx;
height: 70rpx; height: 70rpx;
@ -1031,16 +1051,19 @@
border-radius: 10rpx; border-radius: 10rpx;
} }
} }
.stop { .stop {
font-size: 36rpx; font-size: 36rpx;
color: #000; color: #000;
margin-top: 380rpx; margin-top: 380rpx;
} }
.xtop { .xtop {
margin-top: 30rpx; margin-top: 30rpx;
font-size: 24rpx; font-size: 24rpx;
color: #ccc; color: #ccc;
} }
.xqx { .xqx {
width: 530rpx; width: 530rpx;
height: 90rpx; height: 90rpx;
@ -1052,12 +1075,14 @@
margin: auto; margin: auto;
margin-top: 200rpx; margin-top: 200rpx;
} }
image { image {
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;
margin-top: 100rpx; margin-top: 100rpx;
} }
} }
page { page {
background-color: #F7FAFE; background-color: #F7FAFE;
} }
@ -1265,13 +1290,16 @@
} }
} }
} }
.icon { .icon {
// display: flex; // display: flex;
// flex-wrap: wrap; // flex-wrap: wrap;
// align-items: center; // align-items: center;
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.imgbox { .imgbox {
// width: 33%; // width: 33%;
image { image {
width: 142rpx; width: 142rpx;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
<template> <template>
<view> <view>
<u-navbar title="账单详情" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36' <u-navbar title="收支详情" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
height='50'></u-navbar> title-size='36' height='50'></u-navbar>
<view class="cont"> <view class="cont">
<view class="order_card"> <view class="order_card">
<view class="cardtop"> <view class="cardtop">
<view class="text" v-if="list.status == 2"> <!-- <view class="text" v-if="list.status == 2">
已支付 已支付
</view> </view>
<view class="text" v-if="list.status == 1"> <view class="text" v-if="list.status == 1">
@ -24,7 +24,7 @@
支付中 支付中
</view> </view>
<view class="num" v-if="list.type == 1"> <view class="num" v-if="list.type == 1">
<!-- {{list.suitTime}} 分钟 --> {{list.suitTime}} 分钟
{{list.money}} {{list.money}}
</view> </view>
<view class="text" v-if="list.type == 1"> <view class="text" v-if="list.type == 1">
@ -32,53 +32,63 @@
</view> </view>
<view class="nums" v-if="list.type == 2"> <view class="nums" v-if="list.type == 2">
提现金额{{list.money}} 提现金额{{list.money}}
</view> -->
<view class="num">
<view class="info_li">
<view class="text">
变动金额
</view> </view>
<view class="text" style="color: #8883F0;font-size: 60rpx;">
{{list.amount}}
</view>
</view>
</view>
</view> </view>
<view class="card_bot"> <view class="card_bot">
<view class="info_li"> <view class="info_li">
<view class="text" v-if="list.type == 1"> <view class="text">
到账日期 变动日期
</view>
<view class="text" v-if="list.type == 2">
提现日期
</view> </view>
<view class="text"> <view class="text">
{{list.createTime}} {{list.createTime}}
</view> </view>
</view> </view>
<view class="info_li" v-if="list.type == 1"> <view class="info_li">
<view class="text"> <view class="text">
充值设备 变动前余额
</view> </view>
<view class="text"> <view class="text">
{{list.deviceName}} {{list.beforeBalance}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
<view class="text" v-if="list.type == 1"> <view class="text">
充值类型 变动后余额
</view>
<view class="text" v-if="list.type == 2">
提现类型
</view> </view>
<view class="text"> <view class="text">
{{list.channelName}} {{list.afterBalance}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
<view class="text" v-if="list.type == 1"> <view class="text">
充值用户 用户名称
</view>
<view class="text" v-if="list.type == 2">
提现用户
</view> </view>
<view class="text"> <view class="text">
{{list.userName}} {{list.userName}}
</view> </view>
</view> </view>
</view>
</view>
<view class="info_li">
<view class="text">
变动原因
</view>
<view class="text">
{{list.reason}}
</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -116,19 +126,13 @@
}, },
methods: { methods: {
getdetail(id) { getdetail(id) {
this.$u.get("/app/bill/" + id).then((res) => { this.$u.get("/app/recordBalance/" + id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.list = res.data 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> </script>
@ -137,9 +141,11 @@
/deep/ .u-title { /deep/ .u-title {
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
/deep/ .u-icon__icon { /deep/ .u-icon__icon {
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
page { page {
background: #F7FAFE; background: #F7FAFE;
} }
@ -161,9 +167,6 @@
.cardtop { .cardtop {
margin-top: 48rpx; margin-top: 48rpx;
height: 190rpx; height: 190rpx;
// display: flex;
// flex-wrap: wrap;
// justify-content: center;
.text { .text {
text-align: center; text-align: center;
width: 100%; width: 100%;
@ -171,16 +174,21 @@
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #808080; color: #808080;
margin-top: 20rpx;
} }
.num { .num {
text-align: center; text-align: center;
margin-top: 18rpx; // margin-top: 18rpx;
padding-top: 10rpx;
box-sizing: border-box;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi; font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400; font-weight: 400;
font-size: 60rpx; // font-size: 60rpx;
color: #8883F0; color: #8883F0;
font-size: 36rpx;
} }
.nums { .nums {
text-align: center; text-align: center;
padding-top: 48rpx; padding-top: 48rpx;
@ -199,7 +207,7 @@
text-align: center; text-align: center;
.info_li { .info_li {
margin-top: 35rpx; margin-top: 20rpx;
width: 560rpx; width: 560rpx;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;

View File

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

View File

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

View File

@ -4,10 +4,9 @@
height='50'></u-navbar> 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="card_left">
<view class="top" v-if="item.type == 1">用户充值{{item.userName}}</view> <view class="top">{{item.reason}}</view>
<view class="top" v-if="item.type == 2">商户提现{{item.userName}}</view>
<view class="bot"> <view class="bot">
{{item.createTime}} {{item.createTime}}
</view> </view>
@ -16,7 +15,7 @@
<!-- <view class="top" v-if="item.type == 1">{{item.suitTime}} <!-- <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> --> <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"> <view class="bot">
{{item.money}} {{item.amount}}
</view> </view>
</view> </view>
@ -75,7 +74,7 @@
methods: { methods: {
// //
getList(){ 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) { if (res.code == 200) {
this.total = res.total this.total = res.total
if (this.total > 0) { if (this.total > 0) {
@ -89,16 +88,16 @@
this.pagenum++ this.pagenum++
} else { } else {
// //
this.noMoreData = true; this.noMoreData = true
} }
this.isLoading = false; this.isLoading = false
} }
}); });
}, },
onReachBottom() { onReachBottom() {
let sum = this.total / this.pagesize let sum = this.total / this.pagesize
if (this.pagenum-1 < sum) { if (this.pagenum-1 < sum) {
this.getList(); // this.getList() //
} else { } else {
this.jlflag = true this.jlflag = true
// uni.showToast({ // uni.showToast({

View File

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

View File

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

View File

@ -62,42 +62,6 @@
去添加 去添加
</view> </view>
</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>
<view class="btn" v-if="listflag" @click="sub()"> <view class="btn" v-if="listflag" @click="sub()">
确认提现 确认提现
@ -200,7 +164,6 @@
getinfo(){ getinfo(){
this.$u.get('/app/account' ).then((res) => { this.$u.get('/app/account' ).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// console.log(res)
this.infoList = res.data this.infoList = res.data
} }
}) })
@ -288,14 +251,11 @@
}, },
getuserinfo() { getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => { this.$u.get("/app/user/userInfo").then((res) => {
// this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
this.userinfo=res.data this.userinfo=res.data
this.money = '' this.money = ''
// console.log(this.userinfo);
} }
}); })
}, },
} }
@ -306,9 +266,6 @@
/deep/ .u-flex{ /deep/ .u-flex{
padding-top: 20rpx !important; padding-top: 20rpx !important;
} }
// /deep/ .u-iconfont{
// margin-top: 20rpx;
// }
/deep/ .u-title{ /deep/ .u-title{
padding-bottom: 22rpx; padding-bottom: 22rpx;
} }
@ -332,7 +289,6 @@
} }
.cont{ .cont{
display: flex; display: flex;
// justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
margin: 0 auto; margin: 0 auto;
width: 634rpx; width: 634rpx;
@ -399,10 +355,6 @@
} }
.ipt{ .ipt{
width: 60%; width: 60%;
// .u-input::placeholder {
// font-size: 20px;
// color: red;
// }
} }
.altx{ .altx{
display: flex; display: flex;

View File

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

View File

@ -168,8 +168,8 @@
} }
// //
if (this.networkInterval) { if (this.networkInterval) {
clearInterval(this.networkInterval); clearInterval(this.networkInterval)
this.networkInterval = null; this.networkInterval = null
} }
}, },
@ -189,7 +189,7 @@
console.error('获取网络类型失败', err); console.error('获取网络类型失败', err);
} }
}); });
}, 3000); }, 3000)
}, },
// 使 // 使
@ -268,7 +268,8 @@
that.$u.get(`/app/device/${id}/withSuitList`).then((res) => { that.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.navigateTo({ uni.navigateTo({
url: '/page_components/fuwu/index?id=' + id url: '/page_components/fuwu/index?id=' +
id
}) })
} }
}) })
@ -278,10 +279,14 @@
content: '该设备未绑定,你需进行绑定吗?', content: '该设备未绑定,你需进行绑定吗?',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$u.put("/app/device/bind", data).then(res => { that.$u.put("/app/device/bind", data).then(
if(res.code == 200){ res => {
that.$u.get(`/app/device/${id}/bySn`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
that.$u.get(
`/app/device/${id}/bySn`
).then((res) => {
if (res.code ==
200) {
uni.navigateTo({ uni.navigateTo({
url: '/page_components/bindsz?id=' + res.data.deviceId url: '/page_components/bindsz?id=' + res.data.deviceId
}) })
@ -366,9 +371,17 @@
url: '/page_fenbao/statulist/nearby/index' url: '/page_fenbao/statulist/nearby/index'
}) })
} else if (num == 6) { } else if (num == 6) {
this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
} else if (res.code == 401) {
uni.reLaunch({
url: '/pages/login/login'
})
}
})
} else if (num == 7) { } else if (num == 7) {
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/statulist/fault/yichang/index' url: '/page_fenbao/statulist/fault/yichang/index'
@ -409,7 +422,7 @@
success: (res) => { success: (res) => {
const timer = setTimeout(() => { const timer = setTimeout(() => {
clearTimeout(timer); clearTimeout(timer);
}, 500); }, 500)
} }
}) })
}, },
@ -483,16 +496,16 @@
fail: (err) => { fail: (err) => {
console.error('获取位置失败:', err); console.error('获取位置失败:', err);
} }
}); })
}, },
updateMarkers() { updateMarkers() {
this.mapContext.getScale({ this.mapContext.getScale({
success: (res) => { success: (res) => {
this.covers = []; // this.covers = [] //
if (res.scale <= 14) { if (res.scale <= 14) {
this.addMarkersWithoutLabels(); this.addMarkersWithoutLabels()
} else { } else {
this.addMarkersWithLabels(); this.addMarkersWithLabels()
} }
}, },
fail: (error) => { fail: (error) => {
@ -514,7 +527,7 @@
borderRadius: 5, borderRadius: 5,
bgColor: '#fff' bgColor: '#fff'
}; };
this.covers.push(shopCover); this.covers.push(shopCover)
} }
}); });
}, },
@ -539,14 +552,14 @@
bgColor: '#fff' bgColor: '#fff'
} }
} }
this.covers.push(shopCover); this.covers.push(shopCover)
} }
}); });
}, },
handleMarkerClick(event) { handleMarkerClick(event) {
let markerId = event.markerId; let markerId = event.markerId
uni.navigateTo({ uni.navigateTo({
url: '/page_user/mapditu/index?markerId=' + markerId url: '/page_user/mapditu/index?markerId=' + markerId
}) })
@ -575,20 +588,20 @@
if (res.code) { if (res.code) {
let data = { let data = {
loginCode: res.code, loginCode: res.code,
}; }
taht.$u.post('/app/auth/wxLogin', data).then(res => { taht.$u.post('/app/auth/wxLogin', data).then(res => {
if (res.code == 10003) { if (res.code == 10003) {
// uni.navigateTo({ // uni.navigateTo({
// url: '/pages/login/login' // url: '/pages/login/login'
// }) // })
} else if (res.code == 200) { } else if (res.code == 200) {
uni.setStorageSync('token', res.token); uni.setStorageSync('token', res.token)
taht.logins() taht.logins()
} }
}); })
} }
}, },
}); })
}, },
@ -612,12 +625,10 @@
url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj) url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
}) })
}, },
}, },
mounted() { mounted() {
this.getMyLocation(); // this.getMyLocation() //
this.startNetworkCheck(); // this.startNetworkCheck() //
} }
}; };
</script> </script>