This commit is contained in:
3321822538@qq.com 2024-12-03 14:40:32 +08:00
parent 5b244acd81
commit deebccdd98
9 changed files with 377 additions and 188 deletions

View File

@ -200,12 +200,13 @@
<view class="">
<view class="jieshu" v-if="jieshuflag">
<text v-if="detaobj.status == 1">立即支付</text>
<text v-else>结束订单</text>
<text style="justify-content: center;" v-if="detaobj.status == 1">立即支付</text>
<text style="justify-content: center" v-else>结束订单</text>
</view>
<view class="jieshu" v-else>
<text v-if="detaobj.status == 1" @click="btnljzf">立即支付</text>
<text v-else @click="btnjieshu">结束订单</text>
<text style="border-right: 1px solid;" @click="btnxudan">续单</text>
<text style="justify-content: center;" v-if="detaobj.status == 1" @click="btnljzf">立即支付</text>
<text style="justify-content: center;width: 350rpx;" v-else @click="btnjieshu">结束订单</text>
</view>
</view>
<view class="mask" v-if="jieshufalg"></view>
@ -375,6 +376,8 @@
}
},
onShow() {
clearInterval(this.timerIds);
this.timeday = ''
setTimeout(() => {
this.startTimers()
this.gethuidaio()
@ -404,6 +407,12 @@
}
},
methods: {
//
btnxudan(){
uni.navigateTo({
url:'/page_components/fuwu/index?id=' + this.sbobj.deviceNo
})
},
start() {
this.timerIds = setInterval(() => {
//
@ -567,7 +576,8 @@
//
shuaxin(txt){
// this.timeday = ''
clearInterval(this.timerIds);
this.timeday = ''
this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => {
if(res.code == 200){
this.getDevice()
@ -1108,7 +1118,6 @@
this.getprice()
let dateTimeString = res.data.suitStartTime //
this.timeDifferenceString = this.calculateTimeDifference(dateTimeString); //
// console.log(timeDifferenceString);
if (res.data.suitGearAmount.length > 0) {
this.newArr = []
for (let i = 0; i < res.data.suitGearTime.length; i++) {
@ -1120,11 +1129,13 @@
let du = Number(this.detaobj.suitEndEle) - Number(this.detaobj.deviceTotalEle)
this.du = du.toFixed(2)
}
if (this.detaobj.suitExpireTime == null) {
if (res.data.deviceExpireTime == null) {
this.timeday = 0
console.log(res.data.deviceExpireTime,'000');
} else {
console.log(res.data.deviceExpireTime,'111');
let expireTimeStr = ''
expireTimeStr = this.detaobj.suitExpireTime
expireTimeStr = res.data.deviceExpireTime
let expireTimeParts = expireTimeStr.split(" ")
let expireDateParts = expireTimeParts[0].split("-")
let expireTimePartsTime = expireTimeParts[1].split(":")
@ -1411,9 +1422,9 @@
.jieshu {
width: 558rpx;
height: 90rpx;
display: flex;
text {
width: 558rpx;
width: 200rpx;
height: 90rpx;
display: block;
}

View File

@ -50,8 +50,9 @@
</view>
<view class="box" v-else>
<view class="tit">
选择服务
<view class="tit" style="display: flex;justify-content: space-between;width: 100%;">
<text>选择服务</text>
<!-- <image style="width: 50rpx;height: 50rpx;" :src="imglanya" mode="aspectFit"></image> -->
</view>
<view>
<view :class="indexactive == item.suitId ? 'active':''"
@ -206,7 +207,11 @@
hasCalledGetczly:false,
hasCalledGetczlys:false,
hasCalledGetczlyss:false,
arrlists:[]
arrlists:[],
imglanya:'https://api.ccttiot.com/smartmeter/img/static/ulbuqIwcbhuCYGHZPAiL',
// https://api.ccttiot.com/smartmeter/img/static/u7njR3SD9HSdu7TlOj42
//https://api.ccttiot.com/smartmeter/img/static/ulbuqIwcbhuCYGHZPAiL
//https://api.ccttiot.com/smartmeter/img/static/uzmkQ6a3gBrJ7SjbfmmU
}
},
onLoad(option) {
@ -320,6 +325,9 @@
that.mac = 'CTKG-' + res.data.mac
// getApp().set_ble_mac(this.qrResult)
that.onlineStatus = res.data.onlineStatus
if(that.onlineStatus == 1){
// that.getanya()
}
}
})
}
@ -425,9 +433,42 @@
// this.mac = 'CTKG-' + res.data.mac
this.mac = res.data.mac
this.onlineStatus = res.data.onlineStatus
}
})
},
//
getanya(){
if (this.ver_data == '') {
let that = this
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)
//
setTimeout(()=>{
if(that.ver_data == ''){
//
that.imglanya = 'https://api.ccttiot.com/smartmeter/img/static/ulbuqIwcbhuCYGHZPAiL'
}else{
that.imglanya = 'https://api.ccttiot.com/smartmeter/img/static/uzmkQ6a3gBrJ7SjbfmmU'
}
},10000)
}
},
gettaoc() {
this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => {
if (res.code == 200) {
@ -564,16 +605,6 @@
that.$u.post('/app/bill/recharge', data).then((res) => {
if (res.code == 200) {
that.orderno = res.data
// console.log(this.prices);
// if(this.prices == 0){
// 0
// that.$u.put(`/app/bill/${that.orderno}/refreshPayResult`).then(res => {})
// //
// uni.reLaunch({
// url: '/pages/shouye/index'
// })
// uni.setStorageSync('time', that.expireTimeStr)
// }
if(this.suitFeeType == 3 || this.suitFeeType == 4){
let data = {
billNo:that.orderno,
@ -1391,7 +1422,7 @@
this.czflag = false
this.zhifuflag = false
uni.hideLoading()
this.imglanya = 'https://api.ccttiot.com/smartmeter/img/static/uzmkQ6a3gBrJ7SjbfmmU'
if (!this.hasCalledGetczly) {
this.getczly()
this.hasCalledGetczly = true

View File

@ -15,11 +15,11 @@
<!-- <view class="list_val">
<view class="" style="padding-top:12rpx">手机号码</view> <input type="text" v-model="tel" placeholder="请输入手机号码" />
</view> -->
<view class="list_val" style="position: relative;">
<!-- <view class="list_val" style="position: relative;">
<view class="" style="padding-top:12rpx;width: 176rpx;">绑定店铺</view> <input @click="show = true" type="text" disabled="false" v-model="sheng" :placeholder="sheng" />
<u-icon name="arrow-down" style="position: absolute;top: 30%;right: 14rpx;" color="#808080"></u-icon>
<u-select v-model="show" :list="arr" @confirm="confirm"></u-select>
</view>
</view> -->
</view>
<view class="title">
商户权限
@ -73,10 +73,12 @@
agentLevel:'',
storeId:'',
employId:'',
tit:'创建合伙人'
tit:'创建合伙人',
storeId:''
}
},
onLoad(option) {
this.storeId = option.storeId
if(option.employId){
this.tit = '编辑合伙人'
this.employId = option.employId
@ -89,7 +91,7 @@
getedit(){
this.$u.get(`/mch/storeStaff/${this.employId}`).then(res => {
if (res.code == 200) {
this.storeId = res.data.storeId
this.storeId = this.storeId
this.ratio = res.data.point
this.level = res.data.remark
this.arrqx = res.data.permissions
@ -111,7 +113,7 @@
//
getlist() {
this.$u.get(`/app/store/list?isDefault=true&pageNum=1&pageSize=990&keyword=`).then(res => {
this.$u.get(`/app/store/list?pageNum=1&pageSize=990&keyword=`).then(res => {
if (res.code == 200) {
this.arr = res.rows.map(item => ({ label: item.name, value: item.storeId }))
}

View File

@ -85,9 +85,13 @@
keyword:'',
showflag: false,
tabindex:-1,
imgflag:false
imgflag:false,
storeId:''
}
},
onLoad(option) {
this.storeId = option.storeId
},
onShow() {
this.pagenum = 1
this.wateringList = []
@ -162,7 +166,7 @@
//
btnedit(employId){
uni.navigateTo({
url:'/page_fenbao/hehuoren/addhehuo?employId=' + employId
url:'/page_fenbao/hehuoren/addhehuo?employId=' + employId + '&storeId=' + this.storeId
})
},
@ -175,7 +179,7 @@
},
btnadd(){
uni.navigateTo({
url:'/page_fenbao/hehuoren/addhehuo'
url:'/page_fenbao/hehuoren/addhehuo?storeId='+ this.storeId
})
},
getlist() {

View File

@ -2,18 +2,20 @@
<view class="page" >
<u-navbar :custom-back="btns" title="合伙人首页" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
title-size='36' height='50'></u-navbar>
<!-- <view v-if="userType=='01'" style="padding-top: 30rpx;">
<view style="padding-top: 30rpx;">
<view class="card">
<view class="xzsj">
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
</view>
<view class="month" @click="show = true">
{{yeartime.year + '年' + yeartime.month + '月'}} <u-icon style="margin-left: 10rpx;"
name="arrow-down-fill"></u-icon>
<view class="month" style="display: flex;">
<text @click="btnshow(1)">{{yeartime.year + '' + yeartime.month + '' + yeartime.day + ''}} </text>
<view class="" style="margin: 0 10rpx;">
-
</view>
<view @click="btnshow(2)">{{yeartimes.year + '' + yeartimes.month + '' + yeartimes.day + ''}} <u-icon style="margin-left: 10rpx;margin-top: 6rpx;"name="arrow-down-fill"></u-icon></view>
</view>
<view class="tit">
本月收入{{recharge.toFixed(2)}} 累计收入{{totalRecharge.toFixed(2)}}
当前时间段收入{{recharge.toFixed(2)}} 累计收入{{totalRecharge.toFixed(2)}}
</view>
<view class="echarts" >
@ -23,10 +25,11 @@
<view class="list" style="padding-bottom: 240rpx;">
<view class="card_list" v-for="(item,index) in timelists" :key="index">
<view class="left">
{{yeartime.year + '年' + yeartime.month + '月' + item.createDay + '日'}}
<!-- // {{yeartime.year + '' + yeartime.month + '' + item.createDay + ''}} -->
{{item.key}}
</view>
<view class="right">
{{item.recharge}}
{{item.value}}
</view>
</view>
</view>
@ -40,7 +43,7 @@
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
</view>
<view class="month" @click="show = true">
{{yeartime.year + '年' + yeartime.month + '月'}}
{{yeartime.year + '年' + yeartime.month + '月' + yeartime.day + '日'}}
</view>
<view class="tit">
本月用电量
@ -51,10 +54,10 @@
<view class="echarts" v-if="loging">
</view>
</view>
</view> -->
<!-- <view class="name">
</view>
<view class="name">
更多功能
</view> -->
</view>
<view class="gongneng">
<image @click="btndingdan" src="https://api.ccttiot.com/smartmeter/img/static/uabiTqXSZVFrY5ck0MoK" mode=""></image>
<image @click="btnshebie" src="https://api.ccttiot.com/smartmeter/img/static/u5SKuZPtnuFJPdQOYe4u" mode=""></image>
@ -82,7 +85,7 @@
params: {
year: true,
month: true,
day: false,
day: true,
hour: false,
minute: false,
second: false
@ -94,7 +97,13 @@
show: false,
yeartime: {
year: '',
month: ''
month: '',
day:''
},
yeartimes: {
year: '',
month: '',
day:''
},
timelist: '',
quantity: 0, //
@ -108,7 +117,10 @@
timelists:'',
monthdui:'',
employId:'',
sceneValue:''
sceneValue:'',
kstime:'',
jstime:'',
num:''
}
},
//
@ -180,17 +192,25 @@
this.$refs.canvas.init(this.initChart)
}, 500)
this.recharge = 0
this.deviceId = uni.getStorageSync('deviceId')
this.userType = uni.getStorageSync('userType')
this.userType = '01'
const now = new Date();
this.yeartime.year = now.getFullYear()
this.yeartime.month = now.getMonth() + 1
this.monthdui = this.yeartime.month
this.dateday = String(now.getDate()).padStart(2, '0')
this.yeartime = {
year: now.getFullYear(),
month: now.getMonth() + 1, // 0+1
day: 1 //
}
this.kstime = this.yeartime.year + '-' + this.yeartime.month + '-' + (this.yeartime.day < 10 ? '0' + this.yeartime.day : this.yeartime.day)
this.yeartimes.year = now.getFullYear()
this.yeartimes.month = now.getMonth() + 1
this.yeartimes.day = now.getDate()
this.jstime = this.yeartimes.year + '-' + this.yeartimes.month + '-' + (this.yeartimes.day < 10 ? '0' + this.yeartimes.day : this.yeartimes.day)
this.gettime()
},
methods: {
//
btnshow(num){
this.show = true
this.num = num
},
//
btndianpu(){
uni.navigateTo({
@ -223,8 +243,15 @@
},
//
confirm(e) {
console.log(e);
this.recharge = 0
this.yeartime = e
if(this.num == 1){
this.yeartime = e
this.kstime = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
}else{
this.yeartimes = e
this.jstime = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
}
this.gettime()
setTimeout(() => {
console.log(this.$refs)
@ -233,33 +260,41 @@
},
//
gettime() {
let data = {
year: this.yeartime.year,
month: this.yeartime.month,
groupBy: 'create_date'
}
// let data = {
// year: this.yeartime.year,
// month: this.yeartime.month,
// groupBy: 'create_date'
// }
this.loging = false
this.$u.get('app/bill/landlordCount', data).then((res) => {
this.$u.get(`/app/dashboard/bonusDailyAmount?payDateStart=${this.kstime}&payDateEnd=${this.jstime}`).then((res) => {
if (res.code == 200) {
this.timelist = res.data
if(this.monthdui != this.yeartime.month){
this.timelists = this.timelist
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.recharge);
this.chartday = this.timelist.map(item => item.createDay + '日');
}else{
this.timelists = this.timelist.slice(0,this.dateday)
this.timelists.reverse()
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.slice(0, this.dateday).map(item => item.recharge)
this.chartday = this.timelist.slice(0, this.dateday).map(item => item.createDay + '日');
}
// if(this.monthdui != this.yeartime.month){
// this.timelists = this.timelist
// this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.value);
this.chartday = this.timelist.map(item => item.key.slice(-2) + '日');
// }else{
// this.timelists = this.timelist.slice(0,this.dateday)
// this.timelists.reverse()
// this.totalRecharge = res.totalRecharge
// this.chartData = this.timelist.slice(0, this.dateday).map(item => item.recharge)
// this.chartday = this.timelist.slice(0, this.dateday).map(item => item.createDay + '');
// }
this.timelists = this.timelist
this.totalRecharge = res.total
this.loging = true
for (let i = 0; i < this.timelist.length; i++) {
this.recharge += this.timelist[i].recharge
this.recharge += this.timelist[i].value
}
return this.recharge
this.$refs.canvas.init(this.initChart)
}else{
uni.showToast({
title:res.msg,
icon: 'none',
duration:2000
})
}
})
},
@ -409,7 +444,7 @@
margin-top: 20rpx;
}
.gongneng{
margin-top: 70rpx;
margin-top: 40rpx;
width: 632rpx;
height: 150rpx;
background: #FFFFFF;

View File

@ -41,10 +41,8 @@
@click="btnpag(1)"></image>
<image v-if="listobj.operator.del" src="https://api.ccttiot.com/smartmeter/img/static/uu7AtppWYWNucDPLkcFu" mode="aspectFit"
@click="btnpag(3)"></image>
<image @click="nav" v-if="listobj.operator.del" style="width: 120rpx;margin-top: 20rpx;" src="https://api.ccttiot.com/smartmeter/img/static/ulImlG4HEX1gU65tO00z" mode="aspectFit"></image>
</view>
<!-- <view class="icons" style="margin-top: 0;border-radius: 0 0 24rpx 24rpx;padding-top: 0;max-height: 180rpx;display: block;">
</view> -->
</view>
<u-select v-model="show" :list="list" title='添加方式' @confirm="confirm"></u-select>
@ -135,6 +133,11 @@
}
},
methods: {
nav(){
uni.navigateTo({
url:'/page_fenbao/hehuoren/index?storeId=' + this.storeId,
})
},
btnsh(){
uni.navigateTo({
url:'/page_fenbao/editshenhe?storeId=' + this.storeId
@ -525,7 +528,6 @@
font-size: 26rpx;
color: #808080;
width: 40%;
// margin-right: 20rpx;
}
.shen {
@ -541,12 +543,13 @@
padding-right: 50rpx;
box-sizing: border-box;
width: 680rpx;
max-height: 170rpx;
max-height: 360rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
margin: auto;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 26rpx;
image {
@ -554,6 +557,7 @@
height: 96rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
margin-right: 20rpx;
}
}
}

View File

@ -806,15 +806,10 @@
} else if (Math.abs(deltaY) > 50 && Math.abs(deltaX) < Math.abs(deltaY)) {
if (deltaY < 100) {
console.log("上滑")
// let sum = this.total / this.pagesize
// console.log(this.wateringList.length,this.total);
// if (this.wateringList.length < this.total) {
// this.getlist()
// }
if(this.qingqiuflag == true){
let sum = this.total / this.pagesize
console.log(this.groupLists[0].wateringList.length,this.total);
if (this.groupLists[0].wateringList.length < this.total) {
let sum = (this.pagenum - 1) * this.pagesize
console.log(sum,this.total);
if (this.total > sum) {
this.qingqiuflag = false
this.getlist()
}
@ -1063,7 +1058,7 @@
getlist() {
this.shujuflag = false
// 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(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}&orderByColumn=${this.pxzt}&isAsc=desc&storeId=${this.storeId == null ? '' : this.storeId}`).then((res) => {
if (res.code == 200) {
this.xiaflag = true
this.shuaxin = false
@ -1084,17 +1079,18 @@
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)
}
}
})
// this.groupLists[0].wateringList.push(wateringItem)
this.groupLists[this.curtitidx].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()
} else {
this.pagenum++
@ -1104,15 +1100,15 @@
groupItem.wateringList = []
})
this.wateringList.forEach(wateringItem => {
this.groupLists[0].wateringList.push(wateringItem);
this.groupLists[this.curtitidx].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)
}
})
})
// this.wateringList.forEach(wateringItem => {
// this.groupLists.forEach(groupItem => {
// if (groupItem.storeId !== null && wateringItem.storeId !== null && groupItem.storeId == wateringItem.storeId) {
// groupItem.wateringList.push(wateringItem)
// }
// })
// })
uni.hideLoading()
}
this.isLoading = false
@ -1345,6 +1341,7 @@
this.pagenum = 1
this.curtitidx = e.detail.current
this.storeId = this.groupLists[this.curtitidx].storeId
this.getlist()
},
getdevice() {

View File

@ -94,10 +94,10 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uGlrjkSOTDXMFuuRb03l" mode="aspectFit"></image>
<view class="txt">意见反馈</view>
</view> -->
<view class="botcard" @click="btnhhr">
<!-- <view class="botcard" @click="btnhhr">
<image src="https://api.ccttiot.com/smartmeter/img/static/uspdprPKiYdcIdwhtdPM"></image>
<view class="txt">合伙人</view>
</view>
</view> -->
<view class="botcard" @click="btnjiefeng">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGlrjkSOTDXMFuuRb03l" mode="aspectFit"></image>
<view class="txt">解封记录</view>

View File

@ -1,37 +1,36 @@
<template>
<view class="page" >
<u-navbar :is-back="false" title="统计" :border-bottom="false" :background="bgc" title-color='#fff'
<u-navbar :is-back="false" title="统计" :border-bottom="false" :background="bgc" title-color='#fff'
title-size='44' height='48' id="navbar">
</u-navbar>
<view v-if="userType=='01'" style="padding-top: 30rpx;">
<!-- <view class="title">
统计
</view> -->
<view style="padding-top: 30rpx;">
<view class="card">
<view class="xzsj">
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
</view>
<view class="month" @click="show = true">
{{yeartime.year + '年' + yeartime.month + '月'}} <u-icon style="margin-left: 10rpx;"
name="arrow-down-fill"></u-icon>
<view class="month" style="display: flex;">
<text @click="btnshow(1)">{{yeartime.year + '' + yeartime.month + '' + yeartime.day + ''}} </text>
<view class="" style="margin: 0 10rpx;">
-
</view>
<view @click="btnshow(2)">{{yeartimes.year + '' + yeartimes.month + '' + yeartimes.day + ''}} <u-icon style="margin-left: 10rpx;margin-top: 6rpx;"name="arrow-down-fill"></u-icon></view>
</view>
<view class="tit">
本月收入{{recharge.toFixed(2)}} 累计收入{{totalRecharge.toFixed(2)}}
当前时间段收入{{recharge.toFixed(2)}} 累计收入{{totalRecharge.toFixed(2)}}
</view>
<view class="echarts" >
<!-- <uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas" canvas-id="uni-ec-canvas" :ec="ec"></uni-ec-canvas> -->
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas" canvas-id="uni-ec-canvas" :ec="ec"></uni-ec-canvas>
</view>
</view>
<view class="list" style="padding-bottom: 240rpx;">
<view class="card_list" v-for="(item,index) in timelists" :key="index">
<view class="left">
{{yeartime.year + '年' + yeartime.month + '月' + item.createDay + '日'}}
<!-- // {{yeartime.year + '' + yeartime.month + '' + item.createDay + ''}} -->
{{item.key}}
</view>
<view class="right">
{{item.recharge}}
{{item.value}}
</view>
</view>
</view>
@ -45,7 +44,7 @@
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
</view>
<view class="month" @click="show = true">
{{yeartime.year + '年' + yeartime.month + '月'}}
{{yeartime.year + '年' + yeartime.month + '月' + yeartime.day + '日'}}
</view>
<view class="tit">
本月用电量
@ -54,29 +53,19 @@
{{quantity}}
</div>
<view class="echarts" v-if="loging">
<!-- <mpvue-echarts id="main" ref="pieChart" :echarts="echarts" @onInit="initChart" /> -->
<!-- <uni-ec-canvas ref="charts" @finished="initCharts"></uni-ec-canvas> -->
<!-- <uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas" canvas-id="uni-ec-canvas"
:ec="ec">
</uni-ec-canvas> -->
</view>
</view>
<!-- <view class="list" style="padding-bottom: 120rpx;">
<view class="card_list" v-for="(item,index) in timelists" :key="index">
<view class="left">
{{item.createYear + '年' + item.createMonth + '月' + item.createDay + '日'}}
</view>
<view class="right">
{{item.usedElectriQuantity}}
</view>
</view>
</view> -->
</view>
<!-- #ifdef MP-WEIXIN -->
<tab-bar :indexs='1'></tab-bar>
<!-- #endif -->
<!-- <view class="name">
更多功能
</view>
<view class="gongneng">
<image @click="btndingdan" src="https://api.ccttiot.com/smartmeter/img/static/uabiTqXSZVFrY5ck0MoK" mode=""></image>
<image @click="btnshebie" src="https://api.ccttiot.com/smartmeter/img/static/u5SKuZPtnuFJPdQOYe4u" mode=""></image>
<image @click="btndianpu" src="https://api.ccttiot.com/smartmeter/img/static/ubVQt7h69i4GKsvRK64V" mode=""></image>
<image @click="btngeren" src="https://api.ccttiot.com/smartmeter/img/static/uUnZuUCeUajUb5gD23O4" mode=""></image>
</view> -->
<tab-bar :indexs='1' style=""></tab-bar>
</view>
</template>
@ -97,7 +86,7 @@
params: {
year: true,
month: true,
day: false,
day: true,
hour: false,
minute: false,
second: false
@ -109,7 +98,13 @@
show: false,
yeartime: {
year: '',
month: ''
month: '',
day:''
},
yeartimes: {
year: '',
month: '',
day:''
},
timelist: '',
quantity: 0, //
@ -121,7 +116,12 @@
totalRecharge: 0,
dateday:'',
timelists:'',
monthdui:''
monthdui:'',
employId:'',
sceneValue:'',
kstime:'',
jstime:'',
num:''
}
},
//
@ -140,18 +140,51 @@
path: '/pages/shouye/index'
}
},
onLoad() {
// setTimeout(() => {
// this.initChart()
// }, 300);
// this.initChart()
//
onLoad(option) {
if(option.q){
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
let results = regex.exec(url);
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
}
this.sceneValue = option.q
let decodedValue = decodeURIComponent(this.sceneValue);
let id = getQueryParam(decodedValue, 'i')
this.employId = id
let that = this
uni.showModal({
title: '温馨提示',
content: '您确定要成为合伙人吗?',
showCancel: true,
success: function(res) {
if (res.confirm) {
that.$u.put(`/app/storeStaff/bindUser?employId=${that.employId}`).then(res => {
if (res.code == 200) {
uni.showToast({
title:'绑定成功',
icon: 'success',
duration: 2000
})
}else if(res.code == 401){
uni.reLaunch({
url:'/pages/login/login'
})
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
uni.reLaunch({
url:'/pages/shouye/index'
})
}
}
})
}
},
onShow() {
this.timelist = []
@ -160,22 +193,66 @@
this.$refs.canvas.init(this.initChart)
}, 500)
this.recharge = 0
this.deviceId = uni.getStorageSync('deviceId')
this.userType = uni.getStorageSync('userType')
this.userType = '01'
const now = new Date();
this.yeartime.year = now.getFullYear()
this.yeartime.month = now.getMonth() + 1
this.monthdui = this.yeartime.month
this.dateday = String(now.getDate()).padStart(2, '0')
this.yeartime = {
year: now.getFullYear(),
month: now.getMonth() + 1, // 0+1
day: 1 //
}
this.kstime = this.yeartime.year + '-' + this.yeartime.month + '-' + (this.yeartime.day < 10 ? '0' + this.yeartime.day : this.yeartime.day)
this.yeartimes.year = now.getFullYear()
this.yeartimes.month = now.getMonth() + 1
this.yeartimes.day = now.getDate()
this.jstime = this.yeartimes.year + '-' + this.yeartimes.month + '-' + (this.yeartimes.day < 10 ? '0' + this.yeartimes.day : this.yeartimes.day)
this.gettime()
},
methods: {
//
btnshow(num){
this.show = true
this.num = num
},
//
btndianpu(){
uni.navigateTo({
url:'/page_fenbao/statulist/myshop/index?types=' + 11
})
},
//
btns(){
uni.reLaunch({
url:'/pages/shouye/index'
})
},
//
btngeren(){
uni.navigateTo({
url:'/page_fenbao/hehuoren/geren'
})
},
//
btndingdan(){
uni.navigateTo({
url:'/page_user/switchs?type=' + 11
})
},
//
btnshebie(){
uni.navigateTo({
url:'/page_fenbao/hehuoren/shebeilist'
})
},
//
confirm(e) {
console.log(e);
this.recharge = 0
this.yeartime = e
if(this.num == 1){
this.yeartime = e
this.kstime = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
}else{
this.yeartimes = e
this.jstime = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
}
this.gettime()
setTimeout(() => {
console.log(this.$refs)
@ -184,33 +261,41 @@
},
//
gettime() {
let data = {
year: this.yeartime.year,
month: this.yeartime.month,
groupBy: 'create_date'
}
// let data = {
// year: this.yeartime.year,
// month: this.yeartime.month,
// groupBy: 'create_date'
// }
this.loging = false
this.$u.get('app/bill/landlordCount', data).then((res) => {
this.$u.get(`/app/dashboard/bonusDailyAmount?payDateStart=${this.kstime}&payDateEnd=${this.jstime}`).then((res) => {
if (res.code == 200) {
this.timelist = res.data
if(this.monthdui != this.yeartime.month){
this.timelists = this.timelist
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.recharge);
this.chartday = this.timelist.map(item => item.createDay + '日');
}else{
this.timelists = this.timelist.slice(0,this.dateday)
this.timelists.reverse()
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.slice(0, this.dateday).map(item => item.recharge)
this.chartday = this.timelist.slice(0, this.dateday).map(item => item.createDay + '日');
}
// if(this.monthdui != this.yeartime.month){
// this.timelists = this.timelist
// this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.value);
this.chartday = this.timelist.map(item => item.key.slice(-2) + '日');
// }else{
// this.timelists = this.timelist.slice(0,this.dateday)
// this.timelists.reverse()
// this.totalRecharge = res.totalRecharge
// this.chartData = this.timelist.slice(0, this.dateday).map(item => item.recharge)
// this.chartday = this.timelist.slice(0, this.dateday).map(item => item.createDay + '');
// }
this.timelists = this.timelist
this.totalRecharge = res.total
this.loging = true
for (let i = 0; i < this.timelist.length; i++) {
this.recharge += this.timelist[i].recharge
this.recharge += this.timelist[i].value
}
return this.recharge
this.$refs.canvas.init(this.initChart)
}else{
uni.showToast({
title:res.msg,
icon: 'none',
duration:2000
})
}
})
},
@ -354,7 +439,27 @@
.page {
padding: 0 59rpx;
.name{
font-size: 36rpx;
color: #3D3D3D;
margin-top: 20rpx;
}
.gongneng{
margin-top: 40rpx;
width: 632rpx;
height: 150rpx;
background: #FFFFFF;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1);
border-radius: 24rpx 24rpx 24rpx 24rpx;
display: flex;
justify-content: space-between;
padding: 26rpx 50rpx;
box-sizing: border-box;
image{
width: 96rpx;
height: 102rpx;
}
}
.title {
margin-top: 120rpx;
font-size: 48rpx;
@ -412,7 +517,7 @@
.list {
margin-top: 16rpx;
height: 600rpx;
height: 630rpx;
overflow: auto;
.card_list {
width: 632rpx;