This commit is contained in:
3321822538@qq.com 2024-05-11 17:51:30 +08:00
parent d74eb83a16
commit 9e563c8321
8 changed files with 262 additions and 287 deletions

View File

@ -9,7 +9,6 @@
<view class="swiper-item ">
<view class="card_box" v-for="(item,index) in wateringList"
:key="index">
<!-- @click="todetail(item.deviceId)" -->
<view class="card">
<view class="card_left">
<view class="card_left_tit">
@ -30,7 +29,7 @@
</view>
</view>
<view class="card_left_no">
SN号{{item.deviceNo}}
S/N码{{item.deviceNo}}
</view>
</view>
<view class="card_right">
@ -57,9 +56,9 @@
},
pagenum: 1,
wateringList: [],
pagesize: 10, //
isLoading: false, //
noMoreData: false, //
pagesize: 10,
isLoading: false,
noMoreData: false,
total: 0
}
},
@ -104,35 +103,23 @@
</script>
<style lang="scss">
page {
// background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}
.page {
width: 750rpx;
// position: fixed;
// top: 0;
// left: 0;
padding-bottom: 200rpx;
.box{
width: 750rpx;
// height: 1440rpx;
background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-left: 40rpx;
.swiper {
.swiper-item {
height: 100%;
.card_box {
margin-top: 34rpx;
display: flex;
flex-wrap: wrap;
.card {
display: flex;
// align-items: center;
margin-top: 20rpx;
width: 658rpx;
height: 282rpx;
@ -186,7 +173,6 @@
.card_right {
margin-top: 30rpx;
margin-left: auto;
// margin-right: 94rpx;
margin-right: 40rpx;
image {
width: 180rpx;

View File

@ -7,11 +7,8 @@
<view class="listbox">
<view class="moshi">
<image src="https://api.ccttiot.com/smartmeter/img/static/uCux5cJrpLFhwYjVTz4J" mode="" @click="btndt(1)" class="img"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode="" @click="btndt(2)" v-if="isMch"></image>
<!-- <image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode="" @click="btndt(2)" v-if="isMch"></image> -->
</view>
<!-- <view class="title">
<text :class="index == 1 ? 'active' : ''" @click="btntab(1)">可共享</text> <text :class="index == 2 ? 'active' : ''" @click="btntab(2)">共享中</text> <text :class="index == 3 ? 'active' : ''" @click="btntab(3)">全部共享</text>
</view> -->
<view class="list" v-for="(item,index) in gxlist" :key="index">
<view class="pic">
<image :src="item.picture" mode=""></image>
@ -41,9 +38,9 @@
export default {
data() {
return {
latitude: '', //
longitude: '', //
covers: [], //
latitude: '',
longitude: '',
covers: [],
index:1,
isMch:false,
gxlist:[]
@ -56,14 +53,11 @@
this.getshanghu()
},
methods: {
//
mapFun(item) {
console.log(item);
uni.openLocation({
latitude: item.lat,
// - /
longitude: item.lng,
// - /
name: item.county,
address: item.address
});
@ -79,11 +73,9 @@
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log('我的位置:', res);
this.latitude = res.latitude;
this.longitude = res.longitude;
this.jinweidu = this.longitude + ',' + this.latitude;
//
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(response => {
if (response.code == 200) {
@ -100,7 +92,7 @@
longitude: item.lng,
width: 30,
height: 40,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', //
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
distance: distance //
};
// console.log(this.gxlist);
@ -123,18 +115,12 @@
const phi2 = lat2 * Math.PI / 180;
const deltaPhi = (lat2 - lat1) * Math.PI / 180;
const deltaLambda = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) +
Math.cos(phi1) * Math.cos(phi2) *
Math.sin(deltaLambda / 2) * Math.sin(deltaLambda / 2);
const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) + Math.cos(phi1) * Math.cos(phi2) * Math.sin(deltaLambda / 2) * Math.sin(deltaLambda / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c; //
const distance = R * c;
return distance;
},
handleMarkerClick(event) {
const markerId = event.markerId;
uni.navigateTo({
@ -171,7 +157,6 @@
height: 100%;
}
page {
// background-color: ;
background: linear-gradient(180deg, #D9D8FF 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
@ -250,7 +235,6 @@
}
}
.cen{
// margin-right: 140rpx;
.cena{
font-weight: 500;
font-size: 28rpx;
@ -274,7 +258,6 @@
display: inline-block;
padding: 4rpx 18rpx;
box-sizing: border-box;
// border: 1px solid #ccc;
border-radius: 20rpx;
}
.bu{

View File

@ -20,10 +20,10 @@
</view>
<view class="mid_right">
<view class="mid_top">
{{ deviceInfo.deviceName }}
{{ deviceInfo.deviceName }}
</view>
<view class="mid_bot">
<view class="txt" v-if="deviceInfo">电表号{{ deviceInfo.deviceId }}</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==0">离线</div>
<div class="tip" v-if="deviceInfo.powerStatus==0">断电</div>
@ -182,145 +182,143 @@
this.getDevice(id)
},
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: false, //
},
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
},
// 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() {
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,
},
},
// title: {
// show: false,
// text: ``, //
// x: 'center',
// y: '20',
// textStyle: {
// color: '#333', //'#fff',
// fontSize: 20,
// },
// },
series: [{
type: 'pie', //
radius: ['98%', '70%'], //
@ -355,70 +353,70 @@
},
},
},
{
value: 100 - value,
name: '',
label: {
normal: {
show: false,
},
},
itemStyle: {
normal: {
color: '#173164',
},
},
},
// {
// value: 100 - value2,
// 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: false, //
},
pointer: {
show: false, //
},
axisLine: {
lineStyle: {
opacity: 0,
},
},
detail: {
show: false, //
},
data: [{
value: 0,
name: '',
}, ],
},
// {
// 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: false, //
// },
// pointer: {
// show: false, //
// },
// axisLine: {
// lineStyle: {
// opacity: 0,
// },
// },
// detail: {
// show: false, //
// },
// data: [{
// value: 0,
// name: '',
// }, ],
// },
],
};
// console.log( this.$refs.chartRef,'1111');
const chart = await this.$refs.chart.init(echarts);
console.log(option,11);
// console.log(option,11);
chart.setOption(option)
// chart.resize({
// width: uni.upx2px(210), // Convert 210rpx to pixels

View File

@ -3,6 +3,17 @@
<u-navbar title="设置" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='36'></u-navbar>
<view class="card">
<view class="li" @click.stop="sremakemc()">
<view class="tit">
设备名称
</view>
<view class="info">
<view class="txt">
{{listobj.deviceName}}
</view>
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
<view class="li" @click.stop="sremake()">
<view class="tit">
备注
@ -125,9 +136,26 @@
确定
</view>
</view>
</view>
</u-popup>
<u-popup v-model="showmc" mode="center" border-radius='20'>
<view class="popcard" v-if="showmc">
<view class="tit">
修改名称
</view>
<view class="ipt">
<u-input v-model="xgname" placeholder=" " border='surround' placeholder-style='font-size: 24rpx;' />
</view>
<view class="btnbox">
<view class="btn2" @click="close()">
取消
</view>
<view class="btn1" @click="sub(2)">
确定
</view>
</view>
</view>
</u-popup>
<view class="btn" @click="deldevice()">
解除绑定
</view>
@ -159,6 +187,7 @@
}
],
id: '',
xgname:'',
deviceInfo: {},
groupList: {},
showpopup: false,
@ -167,7 +196,7 @@
showpeice: false,
showremake: false,
listobj: {},
showmc:false,
pagenum: 1,
wateringList: [],
pagesize: 10, //
@ -188,12 +217,6 @@
this.getgroup()
},
methods: {
// taocan(){
// uni.navigateTo({
// url:'/page_fenbao/statulist/taocanlist/index'
// })
// },
sremakes() {
this.showshop = true
},
@ -279,6 +302,7 @@
}
this.showpopup = false
this.showpeice = false
this.showmc = false
this.putdevice(data)
}
},
@ -317,6 +341,11 @@
}
})
},
sremakemc(){
console.log(1);
this.showmc = true
this.xgname = this.listobj.deviceName
},
sremake() {
this.showpopup = true
this.showremake = true
@ -329,7 +358,7 @@
this.showpeice = false
this.showremake = false
this.showpopup = false
this.showmc = false
},
getDevice(id) {
this.$u.get("/app/device/" + this.id).then((res) => {

View File

@ -109,9 +109,7 @@
<view class="dd">
<u-select v-model="show" :list="list" title='角色切换' @confirm="confirm"></u-select>
</view>
<view class="btn" @click="btntc">
退出商户中心
</view>
</view>
</template>
@ -143,11 +141,7 @@
this.getuserinfo()
},
methods: {
btntc(){
uni.reLaunch({
url:'/pages/shouye/index'
})
},
btnwz(num){
if(num == 1){
@ -263,22 +257,7 @@
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
margin: 52rpx auto 0;
width: 654rpx;
height: 100rpx;
background: #FF4F4F;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
opacity: 1;
border-radius: 30rpx;
font-size: 32rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #FFFFFF;
}
.fz {

View File

@ -3,9 +3,6 @@
<u-navbar :is-back="false" :title="tittxt" :border-bottom="false" :background="bgc" title-color='#2E4975'
title-size='44' height='44' id="navbar">
</u-navbar>
<!-- <view class="" @click="scanQRCode()">
扫码添加
</view> -->
<u-mask :show="showtip" @click="show = false" :z-index='1000'/>
<view class="tip_box" v-if="showtip">
<view class="top">
@ -23,7 +20,6 @@
</view>
</view>
</view>
<!-- 房东 -->
<view class="fd" >
<view class="fd_top">
@ -94,7 +90,7 @@
</view>
</view>
<view class="card_left_no">
电表号{{item.deviceNo}}
S/N码{{item.deviceNo}}
</view>
</view>
<view class="card_right">
@ -187,9 +183,9 @@
pagenum: 1,
wateringList: [],
pagesize: 10, //
isLoading: false, //
noMoreData: false, //
pagesize: 10,
isLoading: false,
noMoreData: false,
total: 0
}
},
@ -204,19 +200,14 @@
console.log(this.deviceId,'aaa',this.name);
let that = this; // this that
// let options= JSON.parse(storedData);
setTimeout(() => {
if (this.userType === '01') { // '01'
if (uni.getStorageSync('mac')) {
this.mac = uni.getStorageSync('mac');
uni.getLocation({
type: 'wgs84',
success: function(lb) {
console.log('位置信息', lb);
console.log('当前位置的经度:' + lb.longitude);
console.log('当前位置的纬度:' + lb.latitude);
that.gps.lat = lb.latitude;
that.gps.lon = lb.longitude;
that.tobind()
@ -284,7 +275,7 @@
// Android
} else if (systemInfo.platform === 'ios') {
console.log('aaaaaaaaaaaa');
// console.log('aaaaaaaaaaaa');
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' + this.deviceId + '&name=' + this.name
})
@ -297,7 +288,7 @@
uni.removeStorageSync('mac');
uni.removeStorageSync('deviceIds');
uni.removeStorageSync('name');
this.getDeviceList(); // 使 that this
this.getDeviceList();
} else {
//
}

View File

@ -78,6 +78,10 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uYWpW30vIQ6M4svb7Vnb"></image>
<view class="txt">设置</view>
</view>
<view class="botcard" style="padding-left: 220rpx;font-size: 40rpx;font-weight: 600;" @click="btntc">
切换用户端
</view>
</view>
</view>
@ -106,6 +110,11 @@
this.logins()
},
methods: {
btntc(){
uni.reLaunch({
url:'/pages/shouye/index'
})
},
topage(num){
if(num==0){
uni.navigateTo({
@ -320,7 +329,7 @@ page{
}
.num{
margin-top: 20rpx;
font-size: 22rpx;
font-size: 28rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #ABA8F4;

View File

@ -3,7 +3,7 @@
<!-- 用户首页显示 -->
<view class="useryonghu">
<u-navbar :is-back="false" title="首页" :border-bottom="false" :background="bgc" title-color='#000'
title-size='36' height='8'></u-navbar>
title-size='44' height='44'></u-navbar>
<!-- <view class="title">
充电宝
</view> -->