This commit is contained in:
3321822538@qq.com 2024-06-04 17:50:05 +08:00
parent 10b5790c94
commit 800a961d1e
8 changed files with 81 additions and 86 deletions

View File

@ -60,9 +60,6 @@
</view> </view>
</view> </view>
<view class="imgbox" @click="btn"> <view class="imgbox" @click="btn">
<!-- <image v-if="imgflag"
src="https://api.ccttiot.com/smartmeter/img/static/uY8CPw9YE6JxPzcHUaqf" mode="">
</image> -->
<image :src="imglist" mode="" <image :src="imglist" mode=""
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image> style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
@ -387,7 +384,7 @@
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
color: #666;
.box { .box {
width: 750rpx; width: 750rpx;
height: 1440rpx; height: 1440rpx;

View File

@ -9,13 +9,13 @@
</view> </view>
<view class="list" @scrolltolower="onReachBottom"> <view class="list" @scrolltolower="onReachBottom">
<view class="listitem" v-for="(item,index) in wateringList" :key="index"> <view class="listitem" v-for="(item,index) in wateringList" :key="index" @click="btnshopxq(item.storeId)">
<view class="toptit"> <view class="toptit">
<image src="https://api.ccttiot.com/smartmeter/img/static/uIKex42Zr1fwfzYGgGKz" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uIKex42Zr1fwfzYGgGKz" mode=""></image>
<view class="tit"> <view class="tit">
{{item.name}} {{item.name}}
</view> </view>
<view class="yuan" @click="btnshopxq(item.storeId)"> <view class="yuan">
<text <text
style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;background-color: #000;display: inline-block;"></text> style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;background-color: #000;display: inline-block;"></text>
<text <text

View File

@ -4,7 +4,7 @@
title-size='36' height='50'></u-navbar> title-size='36' height='50'></u-navbar>
<view class="box"> <view class="box">
<view class="shopname"> <view class="shopname">
{{listobj.name}} {{listobj.name == null ? '' : listobj.name}}
</view> </view>
<view class="shoplist"> <view class="shoplist">
<view class="tit"> <view class="tit">
@ -15,7 +15,7 @@
</view> </view>
<view class="jiben"> <view class="jiben">
<text class="qian">营业时间</text> <text <text class="qian">营业时间</text> <text
class="shen">{{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}</text> class="shen">{{listobj.businessTimeStart == null ? '' : listobj.businessTimeStart}}~{{listobj.businessTimeEnd == null ? '' : listobj.businessTimeEnd}}</text>
</view> </view>
<view class="jiben"> <view class="jiben">
<text class="qian">详细地址</text> <text class="shen">{{listobj.address}}</text> <text class="qian">详细地址</text> <text class="shen">{{listobj.address}}</text>

View File

@ -155,17 +155,28 @@
}); });
}, },
delgroup(id){ delgroup(id){
this.$u.delete("/app/store/"+id).then((res) => { let that = this
if (res.code == 200) { uni.showModal({
this.getgroup(); title: '提示',
}else if(res.code == 500){ content: '你确定要删掉该店铺吗?',
uni.showToast({ success: function (res) {
title: res.msg, if (res.confirm) {
icon: 'none', that.$u.delete("/app/store/"+id).then((res) => {
duration:2000 if (res.code == 200) {
}); that.getgroup();
} }else if(res.code == 500){
}); uni.showToast({
title: res.msg,
icon: 'none',
duration:2000
});
}
})
} else if (res.cancel) {
console.log('用户点击了取消');
}
}
})
}, },
putgroupname(id){ putgroupname(id){
this.groupid=id this.groupid=id

View File

@ -191,7 +191,8 @@
name: '', name: '',
deviceId: '', deviceId: '',
storeId: '', storeId: '',
qrResult: '' qrResult: '',
devicesList:[]
} }
}, },
onLoad(option) { onLoad(option) {
@ -469,11 +470,21 @@
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
'isStart': false 'isStart': false
}); });
xBlufi.notifyConnectBle({
isStart: true, xBlufi.notifyConnectBle({
deviceId: this.deviceId, isStart: true,
name: this.name deviceId: this.deviceId,
}); name: this.name
})
// if(this.devicesList.length == 0){
// uni.hideLoading();
// uni.showToast({
// title: '线',
// icon: 'none',
// duration: 2000
// });
// }
}, 2000) }, 2000)
} }
@ -494,8 +505,7 @@
console.log(this.mac, 'macmacmac'); console.log(this.mac, 'macmacmac');
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList;
} }
})
});
} }
break; break;
@ -531,7 +541,7 @@
let vm = this let vm = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '你已绑定成功,需前去配网吗?', content: '你已绑定该设备,需前去配网吗?',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
@ -573,6 +583,13 @@
} }
}) })
} }
}else{
uni.hideLoading()
uni.showToast({
title: '设备离线或不在范围内',
icon: 'none',
duration: 2000
})
} }
break; break;

View File

@ -22,11 +22,11 @@
</view> </view>
<view class="fd"> <view class="fd">
<view class="fd_top"> <view class="fd_top">
<view class="fd_da" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd"> <view class="fd_da">
<view class="fd_lt" :style="{ transform: `translateX(${-curtitidx * 100 }rpx)`}"> <view class="fd_lt" :style="{ transform: `translateX(${-curtitidx * 100}rpx)`}">
<view class="fd_tit" v-for="(item,index) in groupLists" :key="index" <view class="fd_tit" v-for="(item,index) in groupLists" :key="index"
:class="index==curtitidx?'act1':''" @click="changeidx(index)"> :class="index==curtitidx?'act1':''" @click="changeidx(index)">
{{item.name}} {{item.name.length > 5 ? item.name.slice(0, 5) + '...' : item.name}}
</view> </view>
</view> </view>
</view> </view>
@ -204,13 +204,11 @@
onShow() { onShow() {
this.pagenum = 1 this.pagenum = 1
this.wateringList = [] this.wateringList = []
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); let that = this
let that = this; // this that
setTimeout(() => { setTimeout(() => {
if (this.userType === '01') { // '01' if (this.userType === '01') { // '01'
if (uni.getStorageSync('mac')) { if (uni.getStorageSync('mac')) {
@ -218,7 +216,6 @@
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: function(lb) { success: function(lb) {
that.gps.lat = lb.latitude; that.gps.lat = lb.latitude;
that.gps.lon = lb.longitude; that.gps.lon = lb.longitude;
that.tobind() that.tobind()
@ -240,37 +237,30 @@
this.showtip = false this.showtip = false
this.order() this.order()
} }
// console.log(this.deviceInfo,'this.deviceInfo'); })
});
} }
} }
}, 2000); }, 2000);
}, },
methods: { methods: {
tocz() { tocz() {
this.showtip = false this.showtip = false
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/device/czDevice?orderinfo=' + JSON.stringify(this.orderinfo) url: '/page_fenbao/device/czDevice?orderinfo=' + JSON.stringify(this.orderinfo)
}); })
}, },
checkModelTags(modelTags) { checkModelTags(modelTags) {
return modelTags && modelTags.some(tag => tag === 2); return modelTags && modelTags.some(tag => tag === 2);
}, },
order() { order() {
console.log('调用了');
this.$u.get("/app/bill/recharge/device/fail/list").then((res) => { this.$u.get("/app/bill/recharge/device/fail/list").then((res) => {
if (res.data.length != 0) { if (res.data.length != 0) {
this.showtip = true this.showtip = true
this.orderinfo = res.data[0] this.orderinfo = res.data[0]
} else { } else {
this.orderinfo = null this.orderinfo = null
} }
})
});
}, },
towifi(mac) { towifi(mac) {
uni.navigateTo({ uni.navigateTo({
@ -285,7 +275,6 @@
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') { if (systemInfo.platform === 'android') {
// Android // Android
} else if (systemInfo.platform === 'ios') { } else if (systemInfo.platform === 'ios') {
// console.log('aaaaaaaaaaaa'); // console.log('aaaaaaaaaaaa');
uni.navigateTo({ uni.navigateTo({
@ -321,16 +310,14 @@
setTimeout(() => { setTimeout(() => {
this.getdevice() this.getdevice()
}, 2000) }, 2000)
// this.loadings=true
// this.initChart() // this.initChart()
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}); })
} }
}); })
}, },
getgroup() { getgroup() {
this.$u.get("/app/store/listCount").then((res) => { this.$u.get("/app/store/listCount").then((res) => {
@ -338,13 +325,13 @@
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.name === '全部'; 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
this.getlist() this.getlist()
} }
}); })
}, },
getlist() { getlist() {
this.shujuflag = false this.shujuflag = false
@ -423,11 +410,11 @@
this.pagenum++ this.pagenum++
} else { } else {
// //
this.noMoreData = true; this.noMoreData = true
} }
this.isLoading = false; this.isLoading = false
} }
}); })
} else { } else {
this.pagenum = 1 this.pagenum = 1
this.wateringList = [] this.wateringList = []
@ -443,16 +430,11 @@
this.pagenum++ this.pagenum++
} else { } else {
// //
this.noMoreData = true; this.noMoreData = true
} }
this.isLoading = false; this.isLoading = false
} }
}); })
// this.$u.put(`/app/store/${item.storeId}/setDefault`).then((res) => {
// if (res.code == 200) {
// }
// })
} }
} }
}, },
@ -464,7 +446,6 @@
}, },
// //
confirm(e) { confirm(e) {
// console.log(e,'eeeeeeeeee');
let type = e[0].value let type = e[0].value
if (type == '1') { if (type == '1') {
this.scanQRCode() this.scanQRCode()
@ -521,7 +502,6 @@
url: '/page_fenbao/device/index' url: '/page_fenbao/device/index'
}) })
}, },
async initChart() { async initChart() {
let value = 100; let value = 100;
let value2 = this.deviceInfo.surplusElectriQuantity let value2 = this.deviceInfo.surplusElectriQuantity
@ -545,7 +525,6 @@
startAngle: 90, // startAngle: 90, //
z: 0, z: 0,
zlevel: 0, zlevel: 0,
data: [{ data: [{
value: value, value: value,
name: '占比', // name: '占比', //
@ -633,9 +612,7 @@
], ],
}; };
// console.log( this.$refs.chartRef,'1111');
const chart = await this.$refs.chart.init(echarts); const chart = await this.$refs.chart.init(echarts);
// console.log(option);
chart.setOption(option) chart.setOption(option)
return chart return chart
@ -646,7 +623,6 @@
// this.$forceUpdate() // this.$forceUpdate()
if (res.code == 200) { if (res.code == 200) {
this.deviceInfo = res.data this.deviceInfo = res.data
// console.log(this.deviceInfo, 1111);
this.loadings = true this.loadings = true
} }
}); });
@ -668,7 +644,7 @@
} else { } else {
this.jmlogin() this.jmlogin()
} }
}); })
}, },
jmlogin() { jmlogin() {
let taht = this let taht = this
@ -677,16 +653,13 @@
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) {
// console.log("",res.data)
uni.setStorageSync('token', res.token); uni.setStorageSync('token', res.token);
taht.logins() taht.logins()
} }

View File

@ -213,7 +213,6 @@ page{
background-color: #F7FAFE; background-color: #F7FAFE;
} }
.page{ .page{
// position: relative;
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
.userpage{ .userpage{
@ -230,7 +229,6 @@ page{
padding: 40rpx 50rpx ; padding: 40rpx 50rpx ;
margin-top: -50rpx; margin-top: -50rpx;
width: 750rpx; width: 750rpx;
// min-height: 500rpx;
background: #F7FAFE; background: #F7FAFE;
border-radius: 50rpx 50rpx 0 0; border-radius: 50rpx 50rpx 0 0;
.userinfo{ .userinfo{
@ -376,7 +374,6 @@ page{
padding: 40rpx 50rpx ; padding: 40rpx 50rpx ;
margin-top: -50rpx; margin-top: -50rpx;
width: 750rpx; width: 750rpx;
// min-height: 500rpx;
background: #F7FAFE; background: #F7FAFE;
border-radius: 50rpx 50rpx 0 0; border-radius: 50rpx 50rpx 0 0;
.botcard{ .botcard{

View File

@ -723,25 +723,25 @@
} }
.guangg { .guangg {
margin-top: 24rpx; margin-top: 10rpx;
margin-bottom: 28rpx; margin-bottom: 10rpx;
image { image {
border-radius: 30rpx; border-radius: 30rpx;
width: 680rpx; width: 680rpx;
height: 238rpx; height: 218rpx;
} }
} }
.saoma { .saoma {
width: 750rpx; width: 750rpx;
height: 186rpx; height: 166rpx;
background: #FFFFFF; background: #FFFFFF;
position: relative; position: relative;
left: -34rpx; left: -34rpx;
padding-top: 38rpx; padding-top: 22rpx;
border-radius: 54rpx 54rpx 0 0; border-radius: 54rpx 54rpx 0 0;
margin-top: 20rpx;
view { view {
text-align: center; text-align: center;
width: 676rpx; width: 676rpx;