This commit is contained in:
吴鹏 2024-05-13 15:32:48 +08:00
parent 9e563c8321
commit 22013aeb5c
18 changed files with 447 additions and 471 deletions

View File

@ -20,10 +20,10 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.2.71:3000/dev-api', // baseUrl: 'http://192.168.2.184:3000/dev-api',
baseUrl: 'https://kaiguan.chuantewulian.cn/prod-api', baseUrl: 'https://kaiguan.chuantewulian.cn/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 800, loadingTime: 1000,
// 设置自定义头部content-type // 设置自定义头部content-type
header: { header: {
'content-type': 'application/json;charset=UTF-8', 'content-type': 'application/json;charset=UTF-8',

View File

@ -7,7 +7,7 @@
<u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker> <u-picker mode="time" v-model="show" :params="params" @confirm="confirm"></u-picker>
</view> </view>
<view class="month" @click="show = true"> <view class="month" @click="show = true">
{{yeartime.year + '年' + yeartime.month + '月'}} {{yeartime.year + '年' + yeartime.month + '月'}} <u-icon style="margin-left: 10rpx;" name="arrow-down-fill"></u-icon>
</view> </view>
<view class="tit"> <view class="tit">
本月用电量 本月用电量
@ -83,7 +83,7 @@
// }, 300); // }, 300);
// this.initChart() // this.initChart()
setTimeout(() => { setTimeout(() => {
console.log(this.$refs) // console.log(this.$refs)
this.$refs.canvas.init(this.initChart) this.$refs.canvas.init(this.initChart)
}, 1000) }, 1000)
this.deviceId = e.id this.deviceId = e.id
@ -95,6 +95,10 @@
}, },
methods: { methods: {
confirm(e) { confirm(e) {
setTimeout(() => {
// console.log(this.$refs)
this.$refs.canvas.init(this.initChart)
}, 1000)
this.yeartime = e this.yeartime = e
this.gettimes() this.gettimes()
}, },

View File

@ -148,7 +148,7 @@
} }
}) })
}else if(res.code == 401){ }else if(res.code == 401){
uni.navigateTo({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
}) })
} }

View File

@ -112,7 +112,7 @@
uni.navigateBack() uni.navigateBack()
},1000) },1000)
} else if (res.code == 401) { } else if (res.code == 401) {
uni.navigateTo({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
}) })
}else if(res.code == 500){ }else if(res.code == 500){

View File

@ -60,7 +60,7 @@
} }
this.$u.post("/app/mchApply/submit",data).then(res => { this.$u.post("/app/mchApply/submit",data).then(res => {
if(res.code == 401){ if(res.code == 401){
uni.navigateTo({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
}) })
}else if(res.msg == '商家不允许重复申请') { }else if(res.msg == '商家不允许重复申请') {

View File

@ -50,7 +50,7 @@
</view> </view>
<view class="pic"> <view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/ujp0aRbvLeHbgB0l4hXe" mode="" class="pic"></image> <image :src="imgad" mode="" class="pic"></image>
</view> </view>
</view> </view>
</view> </view>
@ -61,12 +61,14 @@
data() { data() {
return { return {
billId:'', billId:'',
detailobj:{} detailobj:{},
imgad:''
} }
}, },
onLoad(option) { onLoad(option) {
this.billId = option.billId this.billId = option.billId
this.getlist() this.getlist()
this.getad()
}, },
methods: { methods: {
getlist(){ getlist(){
@ -76,6 +78,14 @@
} }
}) })
}, },
getad(){
this.$u.get("/app/ad").then((res) => {
if (res.code == 200) {
this.imgad = res.data.picture
}
})
},
} }
} }
</script> </script>
@ -101,6 +111,7 @@
height: 238rpx; height: 238rpx;
margin: auto; margin: auto;
margin-top: 36rpx; margin-top: 36rpx;
border-radius: 30rpx;
} }
.listxq{ .listxq{
width: 680rpx; width: 680rpx;

View File

@ -75,7 +75,7 @@
} }
this.isLoading = false; this.isLoading = false;
}else if(res.code == 401){ }else if(res.code == 401){
uni.navigateTo({ uni.reLaunch({
url:'/pages/login/login' url:'/pages/login/login'
}) })
} }

View File

@ -90,8 +90,8 @@
id: parseFloat(item.storeId), id: parseFloat(item.storeId),
latitude: item.lat, latitude: item.lat,
longitude: item.lng, longitude: item.lng,
width: 30, width: 25,
height: 40, height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
distance: distance // distance: distance //
}; };
@ -188,7 +188,7 @@
padding-bottom: 400rpx; padding-bottom: 400rpx;
.moshi{ .moshi{
position: fixed; position: fixed;
top: 588rpx; top: 570rpx;
left: 30rpx; left: 30rpx;
z-index: 99; z-index: 99;
image{ image{

View File

@ -4,7 +4,7 @@
height='36'></u-navbar> height='36'></u-navbar>
<view class="fzbox"> <view class="fzbox">
<!-- 禁用 --> <!-- 禁用 -->
<!-- <view class="card" :class="{fixed: index === 0}" v-for="(item,index) in groupList " :key="index" v-if="index==0"> <view class="card" :class="{fixed: index === 0}" v-for="(item,index) in groupList " :key="index" v-if="index==0">
<view class="card_left"> <view class="card_left">
<view class="img"> <view class="img">
<image src="https://api.ccttiot.com/smartmeter/img/static/u3jTlduBUSi1yA2H56m9" mode="" v-show="index === 0"></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u3jTlduBUSi1yA2H56m9" mode="" v-show="index === 0"></image>
@ -19,7 +19,7 @@
style="width: 34rpx;height: 34rpx;margin-right: 30rpx;"></image> style="width: 34rpx;height: 34rpx;margin-right: 30rpx;"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/u5rf4EUUv9e5KBef4efW" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u5rf4EUUv9e5KBef4efW" mode=""></image>
</view> </view>
</view> --> </view>
<HM-dragSorts ref="dragSorts" :list="newobj" :autoScroll="true" :feedbackGenerator="false" @newList="handleNewList" rowHeight='50' <HM-dragSorts ref="dragSorts" :list="newobj" :autoScroll="true" :feedbackGenerator="false" @newList="handleNewList" rowHeight='50'
@change="change" @confirm="confirm" @onclick="onclick" :listBackgroundColor='F7FAFE'></HM-dragSorts> @change="change" @confirm="confirm" @onclick="onclick" :listBackgroundColor='F7FAFE'></HM-dragSorts>
@ -142,14 +142,14 @@
} }
}, },
getgroup(){ getgroup(){
this.$u.get("/app/store/list").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.rows this.groupList=res.data
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)
this.newobj = this.groupList // this.newobj = this.groupList
this.remake='' this.remake=''
this.price='' this.price=''
// this.loadings=true // this.loadings=true
@ -296,6 +296,7 @@
.page { .page {
width: 750rpx; width: 750rpx;
padding-bottom: 200rpx;
.popcard{ .popcard{
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -149,8 +149,8 @@
id:parseFloat(item.storeId), id:parseFloat(item.storeId),
latitude: item.lat, latitude: item.lat,
longitude: item.lng, longitude: item.lng,
width: 30, width: 25,
height: 40, height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' // iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' //
}; };
this.covers.push(shopCover); // this.covers.push(shopCover); //

View File

@ -1,9 +1,9 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" title-color='#2E4975' <u-navbar :title="tittxt" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
title-size='36' height='36' id="navbar"> height='36' id="navbar">
</u-navbar> </u-navbar>
<view class="zhuhu" > <view class="zhuhu">
<view class="card1"> <view class="card1">
<view class="top"> <view class="top">
<view class="left"> <view class="left">
@ -15,19 +15,19 @@
</view> </view>
</view> </view>
<view class="mid"> <view class="mid">
<view class="mid_left"> <view class="mid_left" @click="btnpic">
<image :src="deviceInfo.picture" mode=""></image> <image :src="imglist" mode=""></image>
</view> </view>
<view class="mid_right"> <view class="mid_right">
<view class="mid_top"> <view class="mid_top">
{{ deviceInfo.deviceName }} {{ deviceInfo.deviceName }}
</view> </view>
<view class="mid_bot"> <view class="mid_bot">
<view class="txt" v-if="deviceInfo">S/N码{{ deviceInfo.deviceNo }}</view> <view class="txt" v-if="deviceInfo">S/N码{{ deviceInfo.deviceNo }}</view>
<div class="tip" v-if="deviceInfo.onlineStatus==1">在线</div> <div class="tip" v-if="deviceInfo.onlineStatus==1">在线</div>
<div class="tip" v-if="deviceInfo.onlineStatus==0">离线</div> <div class="tip" v-if="deviceInfo.onlineStatus==0">离线</div>
<div class="tip" v-if="deviceInfo.powerStatus==0">断电</div> <div class="tip" v-if="deviceInfo.powerStatus==0">断电</div>
<div class="tip" v-if="deviceInfo.powerStatus==1">正常</div> <div class="tip" v-if="deviceInfo.powerStatus==1">正常</div>
</view> </view>
</view> </view>
</view> </view>
@ -37,8 +37,8 @@
<!-- <mpvue-echarts id="main" ref="pieChart" :echarts="echarts" @onInit="initChart" /> --> <!-- <mpvue-echarts id="main" ref="pieChart" :echarts="echarts" @onInit="initChart" /> -->
<l-echart ref="chart" @finished="initChart"></l-echart> <l-echart ref="chart" @finished="initChart"></l-echart>
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas" canvas-id="uni-ec-canvas" <uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas"
:ec="ec"> canvas-id="uni-ec-canvas" :ec="ec">
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
@ -83,56 +83,58 @@
<view class="card3"> <view class="card3">
<view class="tit">其他</view> <view class="tit">其他</view>
<view class="cont_box" style="display: block;"> <view class="cont_box" style="display: block;">
<view class="" style="display: flex;justify-content: space-between;"> <view class="" style="display: flex;justify-content: space-between;">
<view class="cont" style="width: 120rpx;" @click="topage(0)"> <view class="cont" style="width: 120rpx;" @click="topage(0)">
<view class="top"> <view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uj4DT6WructS782RY0J7" mode="" style="width: 58rpx;height: 56rpx;" ></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uj4DT6WructS782RY0J7" mode=""
</view> style="width: 58rpx;height: 56rpx;"></image>
<view class="bot">充值记录</view> </view>
</view> <view class="bot">充值记录</view>
<view class="cont" style="width: 60rpx;" @click="topage(1)"> </view>
<view class="top"> <view class="cont" style="width: 60rpx;" @click="topage(1)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGaAuulryhDmaDwWLuwo" mode="" style="width: 58rpx;height: 58rpx;"></image> <view class="top">
</view> <image src="https://api.ccttiot.com/smartmeter/img/static/uGaAuulryhDmaDwWLuwo" mode=""
<view class="bot">归零</view> style="width: 58rpx;height: 58rpx;"></image>
</view> </view>
<view class="cont" style="width: 60rpx;" @click="topage(2)"> <view class="bot">归零</view>
<view class="top"> </view>
<image src="https://api.ccttiot.com/smartmeter/img/static/u8QfFAKCq8wE32dFA9Go" mode="" style="width: 58rpx;height: 60rpx;"></image> <view class="cont" style="width: 60rpx;" @click="topage(2)">
</view> <view class="top">
<view class="bot">异常</view> <image src="https://api.ccttiot.com/smartmeter/img/static/u8QfFAKCq8wE32dFA9Go" mode=""
</view> style="width: 58rpx;height: 60rpx;"></image>
<view class="cont" style="width: 120rpx;" @click="toydfx()"> </view>
<view class="top"> <view class="bot">异常</view>
<image src="https://api.ccttiot.com/smartmeter/img/static/u0N4pFke1isIzNrNT6Wh" mode=""></image> </view>
</view> <view class="cont" style="width: 120rpx;" @click="toydfx()">
<view class="bot">用电分析</view> <view class="top">
</view> <image src="https://api.ccttiot.com/smartmeter/img/static/u0N4pFke1isIzNrNT6Wh" mode="">
</view> </image>
<view class="" style="display: flex;margin-top: 20rpx;"> </view>
<view class="cont" style="width: 120rpx;" @click="topage(3)"> <view class="bot">用电分析</view>
<view class="top"> </view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uW2T5sbuiMPbPaJp9p2U" mode="" style="width: 58rpx;height: 60rpx;"></image>
</view> </view>
<view class="bot">收费方式</view> <view class="" style="display: flex;margin-top: 20rpx;">
</view> <view class="cont" style="width: 120rpx;" @click="topage(3)">
<view class="cont" style="width: 60rpx;" @click="topage(4)"> <view class="top">
<view class="top"> <image src="https://api.ccttiot.com/smartmeter/img/static/uW2T5sbuiMPbPaJp9p2U" mode=""
<image src="https://api.ccttiot.com/smartmeter/img/static/ubxoYVnbIK1rk0cfoL3j" mode=""></image> style="width: 58rpx;height: 60rpx;"></image>
</view>
<view class="bot">收费方式</view>
</view>
<view class="cont" style="width: 60rpx;" @click="topage(4)">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/ubxoYVnbIK1rk0cfoL3j" mode="">
</image>
</view>
<view class="bot">设置</view>
</view>
</view> </view>
<view class="bot">设置</view>
</view>
</view>
</view> </view>
<view class="cont_box" style="padding-left: 30rpx;"> <view class="cont_box" style="padding-left: 30rpx;">
</view> </view>
</view> </view>
<!-- <view class="button">电费充值</view> -->
<!-- <view class="zhanwei" style="width: 100%;height: 300rpx;">
</view> -->
</view> </view>
</view> </view>
@ -156,154 +158,40 @@
ec: { ec: {
lazyLoad: true lazyLoad: true
}, },
deviceInfo:{}, deviceInfo: {},
loadings:false, loadings: false,
info:'', info: '',
tittxt:"设备列表", tittxt: "设备列表",
titlist: [ titlist: [
"全部", "全部",
"电表", "电表",
"水表", "水表",
],
curtitidx:0,
id:'',
timeday:'',
],
curtitidx: 0,
id: '',
timeday: '',
imglist: '',
token: '',
userImgs: '',
imgflag: true,
} }
}, },
onLoad(option) { onLoad(option) {
setTimeout(() => { setTimeout(() => {
console.log(this.$refs)
this.$refs.canvas.init(this.initChart) this.$refs.canvas.init(this.initChart)
}, 1000) }, 1000)
let id = option.id let id = option.id
this.id=id this.id = id
this.getDevice(id) this.getDevice(id)
}, },
onShow() {
setTimeout(() => {
this.getDevice(this.id)
}, 1000)
this.getQiniuToken()
},
methods: { methods: {
// initChart(canvas, width, height, canvasDpr) {
// let that = this
// console.log(canvas, width, height, canvasDpr)
// let value = 100;
// let value2 = this.deviceInfo.orderAmount
// const option = {
// // backgroundColor:"#061740",
// title: {
// show: false,
// text: ``, //
// x: 'center',
// y: '20',
// textStyle: {
// color: '#333', //'#fff',
// fontSize: 20,
// },
// },
// series: [{
// type: 'pie', //
// radius: ['98%', '70%'], //
// silent: true,
// clockwise: true,
// startAngle: 90, //
// z: 0,
// zlevel: 0,
// data: [{
// value: value,
// name: '', //
// itemStyle: {
// normal: {
// color: '#8883F0', //
// },
// },
// label: {
// normal: {
// position: 'center',
// formatter: ` {a|${value2}}\n\n{b|}`, //
// rich: {
// a: {
// fontSize: 15,
// fontWeight: '700',
// color: '#333',
// },
// b: {
// fontSize: 11,
// color: '#888',
// },
// },
// },
// },
// },
// {
// value: 100 - value,
// name: '',
// label: {
// normal: {
// show: false,
// },
// },
// itemStyle: {
// normal: {
// color: '#173164',
// },
// },
// },
// ],
// },
// {
// type: 'gauge', //
// radius: '130%', //
// center: ['50%', '50%'], //
// startAngle: 359,
// endAngle: 359.9,
// splitNumber: 2, //
// hoverAnimation: true,
// axisTick: {
// show: true, // 线
// length: 10, // 线
// lineStyle: {
// color: 'auto',
// width: 1,
// },
// },
// splitLine: {
// length: 0, // 线线
// lineStyle: {
// width: 1,
// color: '#061740',
// },
// },
// axisLabel: {
// show: true, //
// },
// pointer: {
// show: false, //
// },
// axisLine: {
// lineStyle: {
// opacity: 0,
// },
// },
// detail: {
// show: false, //
// },
// data: [{
// value: 0,
// name: '',
// }, ],
// },
// ],
// };
// chart = echarts.init(canvas, null, {
// width: width,
// height: height,
// devicePixelRatio: canvasDpr
// })
// console.log(chart);
// // option.series[0].data = that.chartData
// canvas.setChart(chart)
// chart.setOption(option)
// return chart
// },
async initChart() { async initChart() {
let value = 100; let value = 100;
let value2 = this.deviceInfo.orderAmount let value2 = this.deviceInfo.orderAmount
@ -425,116 +313,173 @@
return chart return chart
}, },
// getQiniuToken() {
getDevice(id){ this.$u.get("/common/qiniu/uploadInfo").then((res) => {
this.$u.get("/app/device/"+id).then((res) => {
// this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
this.deviceInfo=res.data this.token = res.token
let expireTimeStr = this.deviceInfo.expireTime
let expireTimeParts = expireTimeStr.split(" ");
let expireDateParts = expireTimeParts[0].split("-");
let expireTimePartsTime = expireTimeParts[1].split(":");
let expireDate = new Date(expireDateParts[0], expireDateParts[1]-1, expireDateParts[2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2]); // 01
let now = new Date();
let differenceInMs = expireDate - now;
if(differenceInMs <= 0){
this.timeday = 0
}else{
this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60)));
} }
});
},
btnpic() {
let _this = this
let math = 'static/' + _this.$u.guid(20)
uni.chooseImage({
count: 1,
type: 'all',
success(res) {
const tempFilePaths = res.tempFiles
wx.uploadFile({
url: 'https://up-z2.qiniup.com',
name: 'file',
filePath: tempFilePaths[0].path,
formData: {
token: _this.token, //token
key: 'smartmeter/img/' + math
},
success: function(res) {
let str = JSON.parse(res.data)
_this.userImgs = 'https://api.ccttiot.com/' + str.key
_this.imglist = _this.userImgs
let data = {
deviceId: _this.id,
customPicture: _this.imglist
}
_this.putdevice(data)
// setTimeout(()=>{
// this.imglist = ''
// _this.getDevice(_this.id)
// },1000)
}
});
}
})
},
putdevice(data) {
this.$u.put('/app/device', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '修改成功',
icon: 'none',
duration: 2000
})
}
})
},
//
this.loadings=true getDevice(id) {
this.initChart() this.$u.get("/app/device/" + id).then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
this.deviceInfo = res.data
if (res.data.customPicture != '自定义图片路径') {
this.imglist = res.data.customPicture
} else {
this.imglist = res.data.picture
}
let expireTimeStr = this.deviceInfo.expireTime
let expireTimeParts = expireTimeStr.split(" ");
let expireDateParts = expireTimeParts[0].split("-");
let expireTimePartsTime = expireTimeParts[1].split(":");
let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[2],
expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2]
); // 01
let now = new Date();
let differenceInMs = expireDate - now;
if (differenceInMs <= 0) {
this.timeday = 0
} else {
this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60)));
}
this.loadings = true
this.initChart()
} }
}); });
}, },
opendevice(){ opendevice() {
let stause=0 let stause = 0
if(this.deviceInfo.powerStatus==1){ if (this.deviceInfo.powerStatus == 1) {
stause= 0 stause = 0
}else{ } else {
stause=1 stause = 1
} }
console.log(stause,'stausestause'); console.log(stause, 'stausestause');
this.$u.put(`/app/device/${this.deviceInfo.deviceId}/changePower?status=`+stause).then((res) => { this.$u.put(`/app/device/${this.deviceInfo.deviceId}/changePower?status=` + stause).then((res) => {
// this.$forceUpdate() // this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
// this.groupList=res.rows // this.groupList=res.rows
setTimeout(()=>{ setTimeout(() => {
this.getDevice(this.id) this.getDevice(this.id)
},2000) }, 2000)
// this.loadings=true // this.loadings=true
// this.initChart() // this.initChart()
}else{ } else {
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
}, },
toydfx(){ toydfx() {
uni.navigateTo({ uni.navigateTo({
url:"/page_components/eletj?id="+this.id url: "/page_components/eletj?id=" + this.id
}) })
}, },
// //
topage(num){ topage(num) {
if(num == 0){ if (num == 0) {
uni.navigateTo({ // uni.navigateTo({ //
url:'/page_user/cbRecord?id='+this.id url: '/page_user/cbRecord?id=' + this.id
}) })
}else if(num == 1){ } else if (num == 1) {
// //
this.$u.put(`/app/device/${this.id}/reset`).then((res) => { this.$u.put(`/app/device/${this.id}/reset`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.data); console.log(res.data);
uni.showToast({ uni.showToast({
title: res.data, title: res.data,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
this.getDevice(this.id) this.getDevice(this.id)
}else if(res.msg == '设备剩余时间不足,无需归零'){ } else if (res.msg == '设备剩余时间不足,无需归零') {
uni.showToast({ uni.showToast({
title: '设备剩余时间不足,无需归零', title: '设备剩余时间不足,无需归零',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
this.getDevice(this.id) this.getDevice(this.id)
} }
})
}else if(num == 2){ //
uni.navigateTo({
url:'/page_fenbao/statulist/fault/yichang/index'
}) })
}else if(num == 3){
uni.navigateTo({ } else if (num == 2) { //
url:"/page_fenbao/statulist/taocanlist/index?id="+this.id
})
}else if(num == 4){ //
uni.navigateTo({ uni.navigateTo({
url:'/page_user/setting?id='+this.id url: '/page_fenbao/statulist/fault/yichang/index'
})
} else if (num == 3) {
uni.navigateTo({
url: "/page_fenbao/statulist/taocanlist/index?id=" + this.id
})
} else if (num == 4) { //
uni.navigateTo({
url: '/page_user/setting?id=' + this.id
}) })
} }
} }
@ -651,10 +596,12 @@
.bot_left { .bot_left {
width: 210rpx; width: 210rpx;
height: 180rpx; height: 180rpx;
margin-right: 34rpx; margin-right: 34rpx;
.echarts { .echarts {
// width: 210rpx; // width: 210rpx;
height: 200rpx; height: 200rpx;
.uni-ec-canvas { .uni-ec-canvas {
width: 100%; width: 100%;
height: 100rpx !important; height: 100rpx !important;
@ -720,7 +667,8 @@
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
.top { .top {
width: 110rpx; width: 110rpx;
font-size: 32rpx; font-size: 32rpx;
@ -749,6 +697,7 @@
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;
padding-bottom: 20rpx; padding-bottom: 20rpx;
.tit { .tit {
margin-left: 40rpx; margin-left: 40rpx;
@ -766,9 +715,11 @@
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: space-around; justify-content: space-around;
.cont:last-child{
.cont:last-child {
margin-right: 0rpx; margin-right: 0rpx;
} }
.cont { .cont {
width: 112rpx; width: 112rpx;
display: flex; display: flex;
@ -776,6 +727,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 80rpx; margin-right: 80rpx;
.top { .top {
image { image {
width: 56rpx; width: 56rpx;

View File

@ -45,7 +45,6 @@
<view class="txt"> <view class="txt">
{{listobj.deviceNo}} {{listobj.deviceNo}}
</view> </view>
<!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>
<view class="li"> <view class="li">
@ -56,7 +55,6 @@
<view class="txt"> <view class="txt">
{{listobj.model}} {{listobj.model}}
</view> </view>
<!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>
<view class="li"> <view class="li">
@ -67,7 +65,6 @@
<view class="txt"> <view class="txt">
{{listobj.wifi}} {{listobj.wifi}}
</view> </view>
<!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>
@ -150,7 +147,7 @@
<view class="btn2" @click="close()"> <view class="btn2" @click="close()">
取消 取消
</view> </view>
<view class="btn1" @click="sub(2)"> <view class="btn1" @click="sub(3)">
确定 确定
</view> </view>
</view> </view>
@ -195,18 +192,23 @@
price: '', price: '',
showpeice: false, showpeice: false,
showremake: false, showremake: false,
listobj: {}, listobj: {
deviceName:'',
storeName:'',
deviceNo:'',
model:'',
wifi:'',
},
showmc:false, showmc:false,
pagenum: 1, pagenum: 1,
wateringList: [], wateringList: [],
pagesize: 10, // pagesize: 10,
isLoading: false, // isLoading: false,
noMoreData: false, // noMoreData: false,
total: 0 total: 0
} }
}, },
onLoad(option) { onLoad(option) {
let id = option.id let id = option.id
this.id = id this.id = id
this.getDevice(id) this.getDevice(id)
@ -221,26 +223,29 @@
this.showshop = true this.showshop = true
}, },
confirms(e){ confirms(e){
console.log(e[0].label); console.log(e);
let data = { let data = {
deviceId: this.id, deviceId: this.id,
storeId:e[0].value storeId:e[0].value
} }
this.getlistobj(this.id)
this.putdevice(data) this.putdevice(data)
setTimeout(()=>{
this.getlistobj(this.id)
},1000)
}, },
gettanc(){ gettanc(){
this.$u.get('/app/store/list?pageNum=' + this.pagenum + '&pageSize=' + this.pagesize).then((res) => { this.$u.get('/app/store/listCount').then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.total = res.total this.total = res.total
if (res.rows.length > 0) { if (res.data.length > 0) {
// //
let arr = res.rows.map(row => ({ let arr = res.data.map(row => ({
value: row.storeId, // storeIdvalue value: row.storeId, // storeIdvalue
label: row.name // namelabel label: row.name // namelabel
})); }));
this.wateringList = this.wateringList.concat(arr) this.wateringList = this.wateringList.concat(arr)
this.wateringList = this.wateringList.slice(1)
this.pagenum++ this.pagenum++
console.log(this.wateringList); console.log(this.wateringList);
} else { } else {
@ -266,7 +271,6 @@
}, },
changeGp(item) { changeGp(item) {
console.log(item, 'changeGp');
let data = { let data = {
deviceId: this.id, deviceId: this.id,
groupId: item.groupId groupId: item.groupId
@ -298,12 +302,25 @@
} else if (num == 2) { } else if (num == 2) {
let data = { let data = {
deviceId: this.id, deviceId: this.id,
price: this.price price: this.price,
} }
this.showpopup = false this.showpopup = false
this.showpeice = false this.showpeice = false
this.showmc = false this.showmc = false
this.putdevice(data) this.putdevice(data)
}else if(num == 3){
console.log(this.xgname);
let data = {
deviceId: this.id,
deviceName: this.xgname,
}
this.showpopup = false
this.showpeice = false
this.showmc = false
this.putdevice(data)
setTimeout(()=>{
this.getlistobj(this.id)
},1000)
} }
}, },
deldevice() { deldevice() {
@ -375,10 +392,10 @@
}, },
getgroup() { getgroup() {
this.$u.get("/app/store/list").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.rows this.groupList = res.data
// this.loadings=true // this.loadings=true
// this.initChart() // this.initChart()
@ -409,7 +426,6 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
// padding: 40rpx;
width: 550rpx; width: 550rpx;
height: 400rpx; height: 400rpx;
border-radius: 20rpx; border-radius: 20rpx;
@ -427,7 +443,6 @@
margin-top: 60rpx; margin-top: 60rpx;
width: 80%; width: 80%;
// width: 60%;
.u-input::placeholder { .u-input::placeholder {
font-size: 20px; font-size: 20px;
color: red; color: red;
@ -445,11 +460,6 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 50%; width: 50%;
// justify-content: center;
// width: 200rpx;
// height: 70rpx;
// border-radius: 20rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC; font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400; font-weight: 400;
@ -462,11 +472,6 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 50%; width: 50%;
// justify-content: center;
// width: 200rpx;
// height: 70rpx;
// border-radius: 20rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC; font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400; font-weight: 400;
@ -482,7 +487,6 @@
padding: 16rpx 38rpx; padding: 16rpx 38rpx;
margin: 60rpx auto 0; margin: 60rpx auto 0;
width: 654rpx; width: 654rpx;
// height: 734rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 30rpx; border-radius: 30rpx;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1); box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);

View File

@ -88,7 +88,6 @@
this.$u.get("/app/device/tenant").then((res) => { this.$u.get("/app/device/tenant").then((res) => {
this.deviceList = res.rows this.deviceList = res.rows
// uni.setStorageSync('deviceId', this.deviceInfo.deviceId); // uni.setStorageSync('deviceId', this.deviceInfo.deviceId);
}); });
}, },
changedefort(item){ changedefort(item){

View File

@ -1,53 +1,46 @@
<template> <template>
<view> <view>
<u-navbar :is-back="true" title='上传' title-color="#000" :border-bottom="false" :background="true" <u-navbar :is-back="true" title='上传' title-color="#000" :border-bottom="false" :background="true" id="navbar">
id="navbar">
</u-navbar> </u-navbar>
<!-- 111 --> <!-- 111 -->
<button @click="btn()">上传图片</button> <button @click="btn()">上传图片</button>
<view style="width: 750rpx;height: 750rpx;"> <view style="width: 750rpx;height: 750rpx;">
<image :src="item" v-for="(item,index) in imglist" :key="index" style="width: 750rpx;height: 750rpx;"></image> <image :src="item" v-for="(item,index) in imglist" :key="index" style="width: 750rpx;height: 750rpx;">
</image>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
imglist:[], imglist: [],
token: '', token: '',
} }
}, },
onLoad() { onLoad() {
this.getQiniuToken() this.getQiniuToken()
}, },
methods:{ methods: {
btn(){ btn() {
let _this=this let _this = this
let math='static/'+_this.$u.guid(20) let math = 'static/' + _this.$u.guid(20)
uni.chooseMessageFile({ uni.chooseMessageFile({
count: 10, count: 10,
type: 'all', type: 'all',
success (res) { success(res) {
// tempFilePathimgsrc const tempFilePaths = res.tempFiles
const tempFilePaths = res.tempFiles
// let tempFilePaths = chooseImageRes.tempFilePaths;
// console.log(tempFilePaths)
// tempFilePaths.forEach(item=>{
// //
// })
wx.uploadFile({ wx.uploadFile({
url: 'https://up-z2.qiniup.com', url: 'https://up-z2.qiniup.com',
name: 'file', name: 'file',
filePath: tempFilePaths[0].path, filePath: tempFilePaths[0].path,
formData: { formData: {
token: _this.token, //token token: _this.token, //token
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)
console.log(str.key) console.log(str.key)
_this.userImgs = 'https://api.ccttiot.com/' + str.key _this.userImgs = 'https://api.ccttiot.com/' + str.key
@ -55,54 +48,19 @@
_this.imglist.push(_this.userImgs) _this.imglist.push(_this.userImgs)
} }
}); });
} }
}) })
// uni.chooseFile({ },
// success: (chooseImageRes) => { // token
// let tempFilePaths = chooseImageRes.tempFilePaths; getQiniuToken() {
// console.log(tempFilePaths) this.$u.get("/common/qiniu/uploadInfo").then((res) => {
// tempFilePaths.forEach(item=>{ if (res.code == 200) {
// // this.token = res.token
// wx.uploadFile({ }
// url: 'https://saxn40pko.hn-bkt.clouddn.com', });
// name: 'file', },
// filePath: item,
// formData: {
// token: _this.token, //token
// key:'yasiimg/web/'+math
// },
// success: function(res) {
// let str = JSON.parse(res.data)
// // console.log(str.key)
// // _this.userImgs = 'https://file.langsi.online/' + str.key+'.pdf'
// console.log(_this.userImgs)
// _this.imglist.push(_this.userImgs)
// }
// });
// })
// }
// });
},
// token
getQiniuToken() {
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
if (res.code == 200) {
this.token=res.token
}
});
// this.$u.get('https://v2.ielts.langsi.online/file/getToken').then(res => {
// console.log(res.data);
// this.token = res.data.token
// }).catch(err => {
// console.log(err)
// })
},
}
} }
}
</script> </script>
<style> <style>

View File

@ -11,7 +11,7 @@
<view class="txt"> <view class="txt">
{{userinfo.phonenumber}} {{userinfo.phonenumber}}
</view> </view>
<view class="iconfont icon-xiangyou1"></view> <!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>

View File

@ -136,7 +136,7 @@ export default {
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
// content: `${options.data.ssid}`, // content: `${options.data.ssid}`,
content: `连接成功路由器`, content: `连接成功`,
showCancel: false, showCancel: false,
success: function (res) { success: function (res) {
// let ids = that.$store.state.user.deviceId // let ids = that.$store.state.user.deviceId

View File

@ -193,11 +193,13 @@
}, },
onShow() { onShow() {
this.wateringList = []
this.pagenum = 1
this.logins(); this.logins();
this.getgroup(); this.getgroup();
this.deviceId=uni.getStorageSync('deviceIds'); this.deviceId=uni.getStorageSync('deviceIds');
this.name=uni.getStorageSync('name'); this.name=uni.getStorageSync('name');
console.log(this.deviceId,'aaa',this.name); // console.log(this.deviceId,'aaa',this.name);
let that = this; // this that let that = this; // this that
setTimeout(() => { setTimeout(() => {
@ -325,7 +327,7 @@
this.groupList = [] this.groupList = []
this.groupLists = res.data this.groupLists = res.data
this.groupList = res.data.filter(item => { this.groupList = res.data.filter(item => {
return item.isDefault === true; return item.name === '全部';
}) })
this.titlist = this.groupList[0].name this.titlist = this.groupList[0].name
this.storeId = this.groupList[0].storeId this.storeId = this.groupList[0].storeId
@ -334,21 +336,39 @@
}); });
}, },
getlist(){ getlist(){
this.$u.get(`/app/device/listByStore/${this.storeId}?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => { if(this.storeId == null){
if (res.code == 200) { this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
this.total = res.total if (res.code == 200) {
this.wateringList = [] this.total = res.total
if (res.rows.length > 0) { // this.wateringList = []
// if (res.rows.length > 0) {
this.wateringList = this.wateringList.concat(res.rows) //
this.pagenum++ this.wateringList = this.wateringList.concat(res.rows)
} else { this.pagenum++
// } else {
this.noMoreData = true; //
this.noMoreData = true;
}
this.isLoading = false;
} }
this.isLoading = false; })
} }else{
}) this.$u.get(`/app/device/list?storeId=${this.storeId}&pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
if (res.code == 200) {
this.total = res.total
// this.wateringList = []
if (res.rows.length > 0) {
//
this.wateringList = this.wateringList.concat(res.rows)
this.pagenum++
} else {
//
this.noMoreData = true;
}
this.isLoading = false;
}
})
}
}, },
onReachBottom() { onReachBottom() {
let sum = this.total / this.pagesize let sum = this.total / this.pagesize
@ -370,30 +390,49 @@
if (item == 1) { if (item == 1) {
this.getDeviceList() this.getDeviceList()
} else { } else {
this.pagenum = 1 if(item.storeId == null){
this.wateringList = [] this.pagenum = 1
this.titlist = item.name this.wateringList = []
this.$u.get(`/app/device/listByStore/${item.storeId}?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => { this.titlist = item.name
if (res.code == 200) { this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
this.total = res.total if (res.code == 200) {
if (res.rows.length > 0) { this.total = res.total
// if (res.rows.length > 0) {
this.wateringList = this.wateringList.concat(res.rows) //
this.pagenum++ this.wateringList = this.wateringList.concat(res.rows)
} else { this.pagenum++
// } else {
this.noMoreData = true; //
this.noMoreData = true;
}
this.isLoading = false;
} }
this.isLoading = false; });
} }else{
}); this.pagenum = 1
this.$u.put(`/app/store/${item.storeId}/setDefault`).then((res) => { this.wateringList = []
if (res.code == 200) { this.titlist = item.name
this.$u.get(`/app/device/list?storeId=${item.storeId}&pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
if (res.code == 200) {
this.total = res.total
if (res.rows.length > 0) {
//
this.wateringList = this.wateringList.concat(res.rows)
this.pagenum++
} else {
//
this.noMoreData = true;
}
this.isLoading = false;
}
});
// this.$u.put(`/app/store/${item.storeId}/setDefault`).then((res) => {
// if (res.code == 200) {
} // }
}); // })
}
} }
}, },
tosetpage() { tosetpage() {
this.showfz = false this.showfz = false
@ -1120,7 +1159,7 @@
flex-wrap: wrap; flex-wrap: wrap;
align-items: baseline; align-items: baseline;
justify-content: center; justify-content: center;
// height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;

View File

@ -10,13 +10,13 @@
<view class="ditu"> <view class="ditu">
<view class="dtxs"> <view class="dtxs">
<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" <map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
:show-location="true" :markers="covers" /> :show-location="true" :markers="covers"/>
</view> </view>
<view class="fujin"> <view class="fujin">
<image src="https://api.ccttiot.com/smartmeter/img/static/u7HPhEwbIJqbLRpImBON" mode="" @click="btnindex(5)"></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u7HPhEwbIJqbLRpImBON" mode="" @click="btnindex(5)"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode="" @click="btnindex(6)" v-if="isMch"></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode="" @click="btnindex(6)" v-if="isMch"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode="" @click="btnindex(7)" <image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode="" @click="btnindex(7)"
style="width: 58rpx;height: 58rpx;position: fixed;top: 900rpx;right: 60rpx;"></image> style="width: 58rpx;height: 58rpx;position: fixed;top: 940rpx;right: 60rpx;"></image>
</view> </view>
<view class="tubiao"> <view class="tubiao">
<view class="gr" @click="btnindex(1)"> <view class="gr" @click="btnindex(1)">
@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="guangg"> <view class="guangg">
<image src="https://api.ccttiot.com/smartmeter/img/static/ujp0aRbvLeHbgB0l4hXe" mode=""></image> <image :src="imgad" mode=""></image>
</view> </view>
<view class="saoma" @click="scanQRCode"> <view class="saoma" @click="scanQRCode">
<view> <view>
@ -68,7 +68,8 @@
covers: [], // covers: [], //
jinweidu: '', jinweidu: '',
userType: '', userType: '',
isMch: false isMch: false,
imgad:''
}; };
}, },
onLoad() { onLoad() {
@ -78,6 +79,7 @@
}, },
onShow() { onShow() {
this.logins(); this.logins();
this.getad()
}, },
methods: { methods: {
@ -104,7 +106,13 @@
// }); // });
}, },
getad(){
this.$u.get("/app/ad").then((res) => {
if (res.code == 200) {
this.imgad = res.data.picture
}
})
},
btnindex(num) { btnindex(num) {
@ -112,8 +120,6 @@
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/statulist/question/index' url: '/page_fenbao/statulist/question/index'
}) })
} else if (num == 3) { } else if (num == 3) {
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/statulist/about/index' url: '/page_fenbao/statulist/about/index'
@ -159,8 +165,8 @@
id: parseFloat(item.storeId), id: parseFloat(item.storeId),
latitude: item.lat, latitude: item.lat,
longitude: item.lng, longitude: item.lng,
width: 30, width: 25,
height: 40, height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' // iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' //
}; };
this.covers.push(shopCover); // this.covers.push(shopCover); //
@ -458,7 +464,9 @@
} }
.guangg { .guangg {
image { image {
border-radius: 30rpx;
width: 680rpx; width: 680rpx;
height: 238rpx; height: 238rpx;
} }
@ -506,7 +514,7 @@
.fujin { .fujin {
position: fixed; position: fixed;
top: 900rpx; top: 940rpx;
padding-left: 30rpx; padding-left: 30rpx;
image { image {