This commit is contained in:
吴鹏 2024-05-24 16:48:42 +08:00
parent 6f69ad215d
commit c7295caf71
31 changed files with 1154 additions and 273 deletions

View File

@ -53,6 +53,7 @@
</view>
</view>
</view>
</view>
</template>
@ -69,7 +70,10 @@
expireTimeStr: '',
zfobj: {},
orderno: '',
id:''
id:'',
czflag:false,
sytime:0,
datetime:0
}
},
onLoad(option) {
@ -79,6 +83,11 @@
},
computed: {
},
onShow() {
if(this.orderno){
this.gethuidaio()
}
},
methods: {
startTimer() {
@ -129,14 +138,17 @@
package: res.data.packageVal,
signType: res.data.signType,
paySign: res.data.paySign,
success(res) {
success: (res) => {
console.log(res,'支付成功');
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
//
uni.showToast({
title: '支付成功',
icon: 'success',
duration: 2000
});
uni.reLaunch({
url:'/pages/shouye/index'
})
uni.setStorageSync('time', this.expireTimeStr)
},
fail(err) {
//
@ -159,7 +171,9 @@
},
btnactive(item) {
this.sytime = item.value
this.zfobj = item
this.indexactive = item.suitId;
},
@ -178,6 +192,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
// /deep/ .u-icon__icon{
// padding-bottom: 41rpx;
// }
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}
@ -192,6 +212,56 @@
position: fixed;
top: 0;
left: 0;
.tip_box{
position: fixed;
left: 72rpx;
top: 700rpx;
width: 610rpx;
// height: 282rpx;
background: #F7FAFE;
border-radius: 30rpx 30rpx 30rpx 30rpx;
z-index: 10000000;
.top{
padding: 52rpx 38rpx 42rpx 36rpx;
.txt{
width: 100%;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
}
.bot{
border-top: 2rpx solid #D8D8D8 ;
display: flex;
flex-wrap: nowrap;
height: 100%;
.bot_left{
width: 50%;
height: 98rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
}
.bot_right{
width: 50%;
height: 98rpx;
display: flex;
align-items: center;
justify-content: center;
border-left: 2rpx solid #D8D8D8 ;
font-weight: 500;
font-size: 36rpx;
color: #8883F0;
}
}
}
.title {
margin-top: 40rpx;

View File

@ -41,6 +41,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -44,6 +44,7 @@
},
onShow() {
this.wateringList = []
this.pagenum = 1
this.getlist()
},
methods: {
@ -116,6 +117,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .uicon-nav-back{
padding-bottom: 41rpx;
}
page {
// background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}
@ -164,7 +171,7 @@
box-sizing: border-box;
margin-bottom: 26rpx;
position: fixed;
top: 170rpx;
top: 200rpx;
.top{
.yc{
width: 178rpx;

View File

@ -11,7 +11,7 @@
<view class="inp">
<input type="text" placeholder="请输入设备编号" style="padding-left: 20rpx;" v-model="deviceNo"/>
</view>
<view class="sm">
<view class="sm" @click="scanQRCode">
<image src="https://api.ccttiot.com/smartmeter/img/static/uNX9Ls3s68OsYgOTQ8dD" mode=""></image>
</view>
</view>
@ -63,10 +63,27 @@
name:'',
phone:'',
dizhi:'',
deviceNo:''
deviceNo:'',
}
},
methods: {
scanQRCode() {
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
console.log('扫描结果:', res);
this.deviceNo = res.result;
},
fail: err => {
console.error('扫描失败:', err);
uni.showToast({
title: '扫描失败',
icon: 'none'
});
}
});
},
btnshangb(){
let data = {
@ -130,6 +147,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -93,6 +93,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -91,6 +91,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -104,6 +104,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
// background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -372,6 +372,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -1,7 +1,7 @@
<template>
<view class="page">
<u-navbar title="我的店铺" :border-bottom="false" :background="bgc" title-color='#fff' title-size='36' back-icon-color="#fff"
height='58'></u-navbar>
<u-navbar title="我的店铺" :border-bottom="false" :background="bgc" title-color='#fff' title-size='36'
back-icon-color="#fff" height='58'></u-navbar>
<view class="box">
<view class="top">
<u-search placeholder="搜索" input-align="center" v-model="keyword" @custom="searchs"></u-search>
@ -80,11 +80,12 @@
methods: {
//
getlist() {
if (this.isLoading || this.noMoreData) {
return;
}
// if (this.isLoading || this.noMoreData) {
// return;
// }
this.isLoading = true;
this.$u.get("/app/store/list?pageNum=" + this.pagenum + '&pageSize='+this.pagesize + '&keyword=' + this.keyword).then(res => {
this.$u.get("/app/store/list?pageNum=" + this.pagenum + '&pageSize=' + this.pagesize + '&keyword=' + this
.keyword).then(res => {
if (res.code == 200) {
this.total = res.total
if (res.rows.length > 0) {
@ -101,7 +102,8 @@
}
var now = new Date().getTime();
var differenceInMilliseconds = now - dateTime.getTime();
var differenceInDays = Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24));
var differenceInDays = Math.floor(differenceInMilliseconds / (1000 * 60 *
60 * 24));
// daysDifference
item.daysDifference = differenceInDays;
});
@ -151,6 +153,14 @@
</script>
<style lang="scss">
/deep/ .u-title {
padding-bottom: 41rpx;
}
/deep/ .uicon-nav-back {
padding-bottom: 41rpx;
}
page {
// background: linear-gradient(180deg, #F4F5F7 0%, rgba(255, 255, 255, 0) 100%);
}
@ -161,12 +171,14 @@
// top: 0;
// left: 0;
height: 100vh;
.box {
width: 750rpx;
// height: 100%;
// background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-top: 150rpx;
.list {
// overflow-y: scroll;
// height: 100vh;
@ -312,6 +324,7 @@
justify-content: space-between;
position: fixed;
top: 200rpx;
.cjshop {
width: 200rpx;
height: 64rpx;

View File

@ -1,15 +1,14 @@
<template>
<view class="page">
<u-navbar title="设备列表" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
height='58'></u-navbar>
<u-navbar title="设备列表" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
title-size='36' height='58'></u-navbar>
<view class="box">
<view class="warp_box">
<view class="swiper" :current='curtitidx' @change="swiperchange" @scrolltolower="onReachBottom">
<view>
<view class="swiper-item ">
<view class="card_box" v-for="(item,index) in wateringList"
:key="index">
<view class="card">
<view class="card_box" v-for="(item,index) in wateringList" :key="index">
<view class="card" @click="btnxq(item.deviceId)">
<view class="card_left">
<view class="card_left_tit">
{{item.deviceName}}
@ -21,7 +20,7 @@
<view class="sta_txt" v-if="item.status==3">
维修中
</view>
<view class="sta_txt" v-if="item.status==2" style="color:#ccc;">
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
使用中
</view>
<view class="sta_txt" v-if="item.status==1" style="color:seagreen;">
@ -33,7 +32,8 @@
</view>
</view>
<view class="card_right">
<image :src="item.picture" mode=""></image>
<image v-if="item.customPicture" :src="item.customPicture" mode=""></image>
<image v-else :src="item.picture" mode=""></image>
</view>
</view>
</view>
@ -71,7 +71,8 @@
this.curtitidx = e.detail.current
},
getlist() {
this.$u.get(`/app/device/listByStore/${this.storeId}?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
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
if (res.rows.length > 0) {
@ -98,26 +99,43 @@
});
}
},
btnxq(id) {
uni.navigateTo({
url: '/page_user/sbdetail?id=' + id
})
},
}
}
</script>
<style lang="scss">
/deep/ .u-title {
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon {
padding-bottom: 41rpx;
}
.page {
width: 750rpx;
padding-bottom: 200rpx;
.box {
width: 750rpx;
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;
margin-top: 20rpx;
@ -174,9 +192,11 @@
margin-top: 30rpx;
margin-left: auto;
margin-right: 40rpx;
image {
width: 180rpx;
height: 230rpx;
border-radius: 20rpx;
}
}
}

View File

@ -37,6 +37,7 @@
</template>
<script>
var xBlufi = require("@/page_components/blufi/xBlufi.js");
export default {
data() {
return {
@ -51,13 +52,53 @@
],
show: false,
storeId:'',
listobj:{}
listobj:{},
deviceId:'',
name:'',
mac:''
}
},
onLoad(option) {
console.log(option);
this.storeId = option.id
this.getdetail()
// xBlufi.initXBlufi(1);
// console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// });
// //
// setTimeout(() => {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': false
// });
// xBlufi.notifyConnectBle({
// isStart: true,
// deviceId: this.deviceId,
// name: this.name
// });
// }, 3000)
},
onUnload: function() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
onHide(){
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
onBeforeUnmount() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
methods: {
getdetail(){
@ -95,6 +136,12 @@
setTimeout(()=>{
uni.navigateBack()
},1500)
}else if(res.code == 500){
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
}
})
} else if (res.cancel) {
@ -123,10 +170,32 @@
console.log('扫描结果:', res);
this.$u.get(`/app/device/${res.result}/bySn`).then((res) =>{
if(res.code == 200){
this.qrResult = res.data.mac
uni.navigateTo({
url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
})
this.qrResult = 'CTKG-' + res.data.mac
// uni.navigateTo({
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
// })
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
});
//
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
xBlufi.notifyConnectBle({
isStart: true,
deviceId: this.deviceId,
name: this.name
});
}, 2000)
uni.showLoading({ title: '连接中...' });
}
})
},
@ -140,11 +209,160 @@
});
},
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
let devicesarr = options.data
console.log(devicesarr,'devicesarrdevicesarr');
devicesarr.forEach(device => {
const mac = device.name.substring(5);
if (device.name == this.qrResult) {
this.deviceId = device.deviceId
this.name = device.name
this.mac = device.name.substring(5)
this.devicesList = uniqueDevicesList;
}
});
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options));
if (options.result) {
uni.hideLoading();
// uni.showToast({
// title: '',
// icon: 'none'
// });
{
console.log("连接回调options.data.deviceId" + options.data.deviceId,
"连接回调options.data.name" + options.data.name);
let name = ''
let index = this.name.indexOf('-');
if (index !== -1) {
name = this.name.slice(index + 1);
}
let data = {
storeId:this.storeId,
mac:this.mac
}
this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
});
uni.hideLoading();
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') {
// Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +
options.data.deviceId + '&name=' + options.data.name
})
} else if (systemInfo.platform === 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +
options.data.deviceId + '&name=' + options.data.name
})
}
}else if(res.code == 500){
uni.showToast({
title: '该设备已被绑定',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: '连接失败',
icon: 'none',
duration: 2000
});
// uni.navigateBack()
}
})
}
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
console.log("蓝牙未开启", options);
uni.showToast({
title: '蓝牙未开启',
icon: 'none',
duration: 3000
});
} else {
// this.searching = true
//
// _this.setData({
// searching: true
// });
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) {
let uniqueDevicesList = Array.from(new Set(this.devicesList));
// this.devicesList
this.devicesList = uniqueDevicesList;
let list = []
filteredDevices.forEach(device => {
// MAC MAC 6
let macFromName = device.name.substring(device.name.length - 12);
// console.log(macFromName);
// this.mac
this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
if (res.data == false) {
list.push(device)
} else {
}
})
});
setTimeout(() => {
this.devicesList = list
}, 200)
console.log('蓝牙停止搜索ok');
} else {
//
console.log('蓝牙停止搜索失败');
}
this.searching = false
// _this.setData({
// searching: false
// });
break;
}
},
}
}
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 40rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -248,9 +248,7 @@
icon: 'success',
duration: 1000
})
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
@ -277,7 +275,7 @@
success: (res) => {
this.latitude = res.latitude;
this.longitude = res.longitude;
console.log(this.latitude, this.longitude);
// console.log(this.latitude, this.longitude);
},
fail: function(err) {
//
@ -334,6 +332,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -96,7 +96,12 @@
width: 25,
height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
distance: distance //
distance: distance ,//
label: {
content: item.name,
// anchorX:-20,
textAlign: 'center'
}
};
// console.log(this.gxlist);
this.covers.push(shopCover); //
@ -161,6 +166,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
/deep/ .map{
width: 100%;
height: 100%;

View File

@ -118,6 +118,13 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .uicon-nav-back{
padding-bottom: 41rpx;
}
page {
// background-color: ;
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);

View File

@ -38,6 +38,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -1,6 +1,6 @@
<template>
<view class="page">
<u-navbar title="新增套餐" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
<u-navbar title="套餐设置" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
height='58'></u-navbar>
<view class="box">
<view class="list">
@ -38,7 +38,7 @@
description: '',
price: '',
title: '',
suitId:''
suitId:'',
}
},
onLoad(option) {
@ -154,6 +154,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -90,6 +90,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -100,6 +100,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
// background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}

View File

@ -24,10 +24,7 @@
@change="change" @confirm="confirm" @onclick="onclick" :listBackgroundColor='F7FAFE'></HM-dragSorts>
</view>
<!-- <view class="btn" @click="sprice()">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGAS855QnMnfJjPEKK5K" mode=""></image>
新建分组
</view> -->
<u-popup v-model="showpopup" mode="center" border-radius='20'>
<view class="popcard" v-if="showremake">
<view class="tit">
@ -159,9 +156,14 @@
},
delgroup(id){
this.$u.delete("/app/store/"+id).then((res) => {
// this.$forceUpdate()
if (res.code == 200) {
this.getgroup();
}else if(res.code == 500){
uni.showToast({
title: res.msg,
icon: 'none',
duration:2000
});
}
});
},
@ -290,6 +292,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
}

View File

@ -159,7 +159,12 @@
longitude: item.lng,
width: 25,
height: 30,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' //
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' ,//
label: {
content: item.name,
// anchorX:-20,
textAlign: 'center'
}
};
this.covers.push(shopCover); //
});
@ -216,6 +221,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
/deep/ .map{
width: 100%;
height: 100%;

View File

@ -105,6 +105,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background: #F7FAFE;
}

View File

@ -1,7 +1,7 @@
<template>
<view class="page">
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff' title-size='36'
height='58' id="navbar">
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
title-size='36' height='58' id="navbar">
</u-navbar>
<view class="zhuhu">
<view class="card1">
@ -45,7 +45,7 @@
<view class="bot_right">
<view class="cont" style="text-align: center;">
<view class="tit">
{{deviceInfo.orderCount}}
{{deviceInfo.orderCount == null ? 0 : deviceInfo.orderCount}}
</view>
<view class="txt">
订单数
@ -182,6 +182,11 @@
token: '',
userImgs: '',
imgflag: true,
mac:"",
name:'',
deviceId:'',
storeId:'',
qrResult:''
}
},
onLoad(option) {
@ -198,6 +203,24 @@
}, 1000)
this.getQiniuToken()
},
onUnload: function() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
onHide() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
onBeforeUnmount() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
},
methods: {
async initChart() {
let value = 100;
@ -222,7 +245,7 @@
label: {
normal: {
position: 'center',
formatter: ` {a|${value2}}\n\n{b|订单金额}`, //
formatter: ` {a|${value2 == null ? 0 : value2}}\n\n{b|订单金额}`, //
rich: {
a: {
fontSize: 15,
@ -236,10 +259,8 @@
},
},
},
},
],
},
],
}, ],
}, ],
};
// console.log( this.$refs.chartRef,'1111');
@ -292,6 +313,12 @@
if (res.code == 200) {
uni.showToast({
title: '修改成功',
icon: 'success',
duration: 2000
})
}else if(res.code == 500){
uni.showToast({
title: '设备不在线',
icon: 'none',
duration: 2000
})
@ -305,6 +332,8 @@
// this.$forceUpdate()
if (res.code == 200) {
this.deviceInfo = res.data
this.storeId = res.data.storeId
this.qrResult = 'CTKG-' + res.data.mac
if (res.data.customPicture != '自定义图片路径') {
this.imglist = res.data.customPicture
} else {
@ -416,12 +445,172 @@
})
} else if (num == 5) {
console.log(this.deviceInfo);
// uni.navigateTo({
// url: '/page_fenbao/device/lianjie?mac=' + this.deviceInfo.mac + '&storeId=' + this
// .deviceInfo.storeId
// })
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
});
//
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
xBlufi.notifyConnectBle({
isStart: true,
deviceId: this.deviceId,
name: this.name
});
}, 2000)
}
},
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
let devicesarr = options.data
// console.log(devicesarr,'devicesarrdevicesarr');
devicesarr.forEach(device => {
const mac = device.name.substring(5);
if (device.name == this.qrResult) {
this.deviceId = device.deviceId
this.name = device.name
this.mac = device.name.slice(5,17)
console.log(this.mac,'macmacmac');
this.devicesList = uniqueDevicesList;
}
});
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options));
if (options.result) {
uni.hideLoading();
// uni.showToast({
// title: '',
// icon: 'none'
// });
{
console.log("连接回调options.data.deviceId" + options.data.deviceId,
"连接回调options.data.name" + options.data.name);
let name = ''
let index = this.name.indexOf('-');
if (index !== -1) {
name = this.name.slice(index + 1);
}
let data = {
storeId:this.storeId,
mac:this.mac
}
this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
});
uni.hideLoading();
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') {
// Android
uni.navigateTo({
url:'/page_fenbao/device/lianjie?mac=' + this.deviceInfo.mac + '&storeId=' + this.deviceInfo.storeId
url: '/page_components/wifilist/index?deviceId=' +
options.data.deviceId + '&name=' + options.data.name
})
} else if (systemInfo.platform === 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +
options.data.deviceId + '&name=' + options.data.name
})
}
}else if(res.code == 500){
uni.showToast({
title: '该设备已被绑定',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: '连接失败',
icon: 'none',
duration: 2000
});
// uni.navigateBack()
}
})
}
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
console.log("蓝牙未开启", options);
uni.showToast({
title: '蓝牙未开启',
icon: 'none',
duration: 3000
});
} else {
// this.searching = true
//
// _this.setData({
// searching: true
// });
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) {
let uniqueDevicesList = Array.from(new Set(this.devicesList));
// this.devicesList
this.devicesList = uniqueDevicesList;
let list = []
filteredDevices.forEach(device => {
// MAC MAC 6
let macFromName = device.name.substring(device.name.length - 12);
this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
if (res.data == false) {
list.push(device)
} else {
}
})
});
setTimeout(() => {
this.devicesList = list
}, 200)
console.log('蓝牙停止搜索ok');
} else {
//
console.log('蓝牙停止搜索失败');
}
this.searching = false
// _this.setData({
// searching: false
// });
break;
}
},
}
}
</script>
@ -477,6 +666,7 @@
image {
width: 170rpx;
height: 160rpx;
border-radius: 20rpx;
}
}

View File

@ -441,6 +441,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
}

View File

@ -87,6 +87,12 @@
</script>
<style lang="scss" scoped>
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
}

View File

@ -59,6 +59,12 @@
</script>
<style lang="scss" scoped>
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
}

View File

@ -205,6 +205,12 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
}

View File

@ -159,7 +159,8 @@
// this.$forceUpdate()
if (res.code == 200) {
this.userinfo=res.data
console.log(this.userinfo);
this.money = ''
// console.log(this.userinfo);
}
});
@ -170,6 +171,12 @@
</script>
<style lang="scss" >
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page{
background: #F7FAFE;
}

View File

@ -386,6 +386,14 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "chongzhi",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#4473f6",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
]
}, {

View File

@ -22,9 +22,13 @@
</view>
<view class="fd" >
<view class="fd_top">
<view class="fd_tit">
{{titlist}}
<view class="fd_da">
<view class="fd_lt">
<view class="fd_tit" v-for="(item,index) in groupLists" :key="index"
:class="index==curtitidx?'act1':''" @click="changeidx(index)">
{{item.name}}
</view>
</view>
</view>
<view class="right">
<!-- <view class="fd_set" @click="show = true">
@ -50,7 +54,8 @@
</view>
</view>
<view class="card_cont">
<view class="cards" v-for="(item,index) in groupLists" :key="index" @click="changeGp(item)">
<view class="cards" v-for="(item,index) in groupLists" :key="index" >
<!-- //@click="changeGp(item)" -->
<view class="txt">
{{item.name}}
</view>
@ -63,11 +68,14 @@
</view>
</view>
</view>
<view class="warp_box">
<view class="swiper" style="height: 100%;" :current='curtitidx' @change="swiperchange">
<view>
<swiper class="swiper" style="height: 100%;margin-top: 20rpx;" :current='curtitidx' @change="swiperchange" @scrolltolower="onReachBottom">
<swiper-item v-for="(item,index) in groupLists" :key="index">
<view class="" v-if="shujuflag">
暂无设备...
</view>
<view class="swiper-item " >
<view class="card_box" @scrolltolower="onReachBottom" @click="todetail(item.deviceId)"
<view class="card_box" @click="todetail(item.deviceId)"
v-for="(item,index) in wateringList" :key="index">
<view class="card" >
<view class="card_left">
@ -75,13 +83,12 @@
{{item.deviceName}}
</view>
<view class="card_left_sta">
<image
src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
<image src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
mode=""></image>
<view class="sta_txt" v-if="item.status==3">
维修中
</view>
<view class="sta_txt" v-if="item.status==2" style="color:#ccc;">
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
使用中
</view>
<view class="sta_txt" v-if="item.status==1" style="color:seagreen;">
@ -93,17 +100,15 @@
</view>
</view>
<view class="card_right">
<image :src="item.picture" mode=""></image>
</view>
<image v-if="item.customPicture" :src="item.customPicture" mode="" style="border-radius: 20rpx;"></image>
<image v-else :src="item.picture" mode=""></image>
</view>
</view>
</view>
</view>
</view>
<!-- <view style="margin-left:200rpx; color: #ccc;font-size: 36rpx;margin-top: 200rpx;width: 750rpx;">
该店铺暂无设备...</view> -->
</view>
</swiper-item>
</swiper>
</view>
@ -185,14 +190,15 @@
isLoading: false,
noMoreData: false,
total: 0,
shujuflag:false
}
},
onLoad() {
},
onShow() {
this.wateringList = []
this.pagenum = 1
this.wateringList = []
this.logins();
this.getgroup();
this.deviceId = uni.getStorageSync('deviceIds');
@ -237,6 +243,13 @@
}, 2000);
},
methods: {
tocz() {
this.showtip = false
uni.navigateTo({
@ -344,9 +357,12 @@
//
this.wateringList = this.wateringList.concat(res.rows)
this.pagenum++
this.shujuflag = false
uni.hideLoading()
} else {
//
this.shujuflag = true
uni.hideLoading()
}
this.isLoading = false;
}
@ -362,9 +378,12 @@
//
this.wateringList = this.wateringList.concat(res.rows)
this.pagenum++
this.shujuflag = false
uni.hideLoading()
} else {
//
this.shujuflag = true
uni.hideLoading()
}
this.isLoading = false;
}
@ -695,8 +714,15 @@
},
swiperchange(e) {
uni.showLoading({
title: '加载中...'
});
this.wateringList = []
this.pagenum = 1
this.curtitidx = e.detail.current
// console.log(e, 'aaaa');
// console.log(this.groupLists[this.curtitidx].storeId)
this.storeId = this.groupLists[this.curtitidx].storeId
this.getlist()
},
getdevice() {
@ -745,11 +771,19 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
page {
background-color: #F7FAFE;
height: 100%;
}
.page {
height: 100%;
padding-bottom: 200rpx;
.tip_box {
@ -1214,20 +1248,52 @@
flex-wrap: nowrap;
// justify-content: space-between;
align-items: center;
// position: fixed;
// top: 220rpx;
// left: 50%;
// transform: translateX(-50%);
.fd_da {
width: 600rpx;
// overflow-x: scroll;
overflow: hidden;
overflow-x: auto;
white-space: nowrap;
-ms-overflow-style: none;
/* 去除IE和Edge的默认滚动条 */
scrollbar-width: none;
/* 去除Firefox的默认滚动条 */
&::-webkit-scrollbar {
display: none;
}
.fd_lt {
width: 100vh;
display: flex;
.fd_tit {
// width: 40%;
margin-right: 20rpx;
text-align: center;
// width: 100%;
padding: 0 30rpx;
box-sizing: border-box;
// margin-right: 20rpx;
font-size: 36rpx;
font-weight: 400;
color: #666;
}
}
}
.act1 {
color: #000000;
font-weight: 700 !important;
color: #000000 !important;
}
.right {
margin-left: auto;
display: flex;
@ -1249,12 +1315,24 @@
}
}
.shebei{
width: 750rpx;
height: 100vh;
position: fixed;
top: 0;
left: 0;
text-align: center;
padding-top: 300rpx;
font-size: 32rpx;
color: #ccc;
}
.swiper {
// height: 100vh;
.swiper-item {
height: 100%;
height: 100vh;
overflow-y: auto;
padding-bottom: 660rpx;
.card_box {
margin-top: 34rpx;
display: flex;

View File

@ -4,35 +4,39 @@
<view class="useryonghu">
<u-navbar :is-back="false" title="首页" :border-bottom="false" :background="bgc" title-color='#fff'
title-size='44' height='58'></u-navbar>
<!-- <view class="title">
充电宝
</view> -->
<view class="ditu">
<view class="dtxs">
<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
:show-location="true" :markers="covers" :scale="15"/>
@scale="onMapScaleChange" :show-location="true" :markers="covers" :scale="mapScale" />
</view>
<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/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/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/uzSmYNgLYJRMEmo4TWyA" mode=""
@click="btnindex(7)"
style="width: 58rpx;height: 58rpx;position: fixed;top: 940rpx;right: 60rpx;"></image>
</view>
<view class="tubiao">
<view class="gr" @click="btnindex(1)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uJBKoGWpRH2lM1NpQU0I" mode="" style="width: 96rpx;height:98rpx;"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uJBKoGWpRH2lM1NpQU0I" mode=""
style="width: 96rpx;height:98rpx;"></image>
<!-- 个人中心 -->
</view>
<view class="gr" @click="btnindex(2)">
<image src="https://api.ccttiot.com/smartmeter/img/static/u8rWtdPtHabALkII23Zr" mode="" style="width: 96rpx;height:102rpx;"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/u8rWtdPtHabALkII23Zr" mode=""
style="width: 96rpx;height:102rpx;"></image>
<!-- 我的订单 -->
</view>
<view class="gr" @click="btnindex(3)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uphoDfOVnT6VEyj6glfF" mode="" style="width: 96rpx;height:98rpx;"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uphoDfOVnT6VEyj6glfF" mode=""
style="width: 96rpx;height:98rpx;"></image>
<!-- 附近门店 -->
</view>
<view class="gr" @click="btnindex(4)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uBN46m7mPVlbbPth80FC" mode="" style="width: 96rpx;height:94rpx;"></image>
<image src="https://api.ccttiot.com/smartmeter/img/static/uBN46m7mPVlbbPth80FC" mode=""
style="width: 96rpx;height:94rpx;"></image>
<!-- 联系客服 -->
</view>
</view>
@ -41,10 +45,29 @@
</view>
<view class="saoma" @click="scanQRCode">
<view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uBh15vzRx6gV0wRQj7gi" mode=""></image>扫一扫
<image src="https://api.ccttiot.com/smartmeter/img/static/uBh15vzRx6gV0wRQj7gi" mode=""></image>
扫一扫
</view>
</view>
</view>
<view class="tip_box" v-if="czflag">
<view class="top">
<view class="txt">
系统检测到您的设备未联网或者为蓝牙版本,金额充值失败,请靠近设备进行蓝牙充值
</view>
</view>
<view class="bot">
<view class="bot_left" @click="czflag = false">
取消
</view>
<view class="bot_right" @click="tocz()">
蓝牙充值
</view>
</view>
</view>
</view>
</view>
</template>
@ -69,22 +92,35 @@
jinweidu: '',
userType: '',
isMch: false,
imgad:''
imgad: '',
mapScale: 15,
czflag:false,
datetime:0,
dingobj:''
};
},
onLoad() {
// this.initOtherCovers(); //
},
onShow() {
this.logins();
this.getad()
this.gethuidaio()
},
methods: {
onMapScaleChange(e) {
// console.log(this.covers,'eeeeeeeee');
this.mapScale = e.detail.scale; //
this.getMyLocation()
// this.covers.forEach(marker => {
// marker.label.content = this.mapScale > 13 ? marker.label.content : '';
// });
},
scanQRCode() {
@ -121,6 +157,8 @@
},
btnindex(num) {
if (num == 2) {
uni.navigateTo({
@ -153,18 +191,21 @@
}
},
getMyLocation() {
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log('我的位置:', 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(res => {
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
res => {
if (res.code == 200) {
console.log(res);
// console.log(res);
// res.rowslatitudelongitude
res.data.forEach(item => {
const shopCover = {
@ -254,6 +295,28 @@
},
gethuidaio(){
this.$u.get('/app/bill/recharge/device/fail/list').then(res => {
if(res.code == 200){
if(res.data.length > 0){
this.czflag = true
this.dingobj = res.data
}else{
uni.removeStorageSync('time')
}
}
})
},
tocz(){
this.czflag = false
uni.navigateTo({
url:'/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
})
},
},
mounted() {
this.getMyLocation(); //
@ -262,6 +325,13 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 41rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 41rpx;
}
/deep/ .map {
width: 100%;
height: 100%;
@ -282,11 +352,57 @@
padding-left: 34rpx;
padding-right: 34rpx;
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
height: 100%;
//
.tip_box{
position: fixed;
left: 72rpx;
top: 700rpx;
width: 610rpx;
background: #F7FAFE;
border-radius: 30rpx 30rpx 30rpx 30rpx;
z-index: 10000000;
.top{
padding: 52rpx 38rpx 42rpx 36rpx;
.txt{
width: 100%;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
}
.bot{
border-top: 2rpx solid #D8D8D8 ;
display: flex;
flex-wrap: nowrap;
height: 100%;
.bot_left{
width: 50%;
height: 98rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
}
.bot_right{
width: 50%;
height: 98rpx;
display: flex;
align-items: center;
justify-content: center;
border-left: 2rpx solid #D8D8D8 ;
font-weight: 500;
font-size: 36rpx;
color: #8883F0;
}
}
}
.userdaili {
.gongneng {
width: 680rpx;
@ -373,7 +489,6 @@
display: inline-block;
width: 148rpx;
height: 84rpx;
// background: #E1F3ED;
text-align: center;
line-height: 84rpx;
}
@ -510,7 +625,7 @@
height: 980rpx;
background: #FFFFFF;
border-radius: 38rpx 38rpx 38rpx 38rpx;
margin-top: 34rpx;
// margin-top: 34rpx;
padding-top: 16rpx;
.fujin {

View File

@ -1,7 +1,7 @@
<template>
<view class="page">
<u-navbar :is-back="false" title="统计" :border-bottom="false" :background="bgc" title-color='#fff'
title-size='44' height='58' id="navbar">
title-size='44' height='48' id="navbar">
</u-navbar>
<view v-if="userType=='01'">
@ -21,10 +21,11 @@
</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: 120rpx;">
<view class="list" style="padding-bottom: 240rpx;">
<view class="card_list" v-for="(item,index) in timelist" :key="index">
<view class="left">
{{yeartime.year + '年' + yeartime.month + '月' + item.createDay + '日'}}
@ -101,7 +102,6 @@
recharge: 0,
bgc: {
backgroundColor: "#8883f0",
},
show: false,
yeartime: {
@ -171,7 +171,7 @@
year: this.yeartime.year,
month: this.yeartime.month,
groupBy: 'create_day'
groupBy: 'create_date'
}
this.loging = false
this.$u.get('app/bill/landlordCount', data).then((res) => {
@ -426,6 +426,13 @@
</script>
<style lang="scss">
/deep/ .u-title{
padding-bottom: 20rpx;
}
/deep/ .u-icon__icon{
padding-bottom: 20rpx;
}
.uni-ec-canvas {
width: 100%;
height: 320rpx;
@ -462,7 +469,7 @@
.card {
padding-top: 32rpx;
margin-top: 46rpx;
margin-top: 10rpx;
width: 632rpx;
height: 586rpx;
background: #8883F0;
@ -506,8 +513,8 @@
// height: 80%;
width: 588rpx;
height: 320rpx;
// overflow: hidden;
// overflow-x: auto;
}
}