更新
This commit is contained in:
parent
f514616b96
commit
53901aec4f
|
@ -96,9 +96,10 @@
|
||||||
/deep/ .u-title{
|
/deep/ .u-title{
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-icon__icon{
|
/deep/ .uicon-nav-back{
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
|
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +159,7 @@
|
||||||
}
|
}
|
||||||
textarea{
|
textarea{
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #9F9F9F;
|
color: #333;
|
||||||
padding-right: 20rpx;
|
padding-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,7 +180,7 @@
|
||||||
}
|
}
|
||||||
input{
|
input{
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #9F9F9F;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.name{
|
.name{
|
||||||
|
@ -199,7 +200,7 @@
|
||||||
}
|
}
|
||||||
input{
|
input{
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #9F9F9F;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="pic">
|
<view class="pic" @click="btnad">
|
||||||
<image :src="imgad" mode="" class="pic"></image>
|
<image :src="imgad" mode="" class="pic"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -78,6 +78,21 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
btnad(){
|
||||||
|
this.$u.get("/app/ad").then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
if(res.data.urlType == 1){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/page_fenbao/webview?url=' + res.data.url
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: res.data.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getad(){
|
getad(){
|
||||||
this.$u.get("/app/ad").then((res) => {
|
this.$u.get("/app/ad").then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
height: 230rpx;
|
height: 200rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<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"
|
||||||
height='58'></u-navbar>
|
title-size='36' height='58'></u-navbar>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="shopname">
|
<view class="shopname">
|
||||||
{{listobj.name}}
|
{{listobj.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="shoplist">
|
<view class="shoplist">
|
||||||
<view class="tit">
|
<view class="tit">
|
||||||
基本信息
|
基本信息
|
||||||
|
@ -14,7 +14,8 @@
|
||||||
<text class="qian">绑定设备:</text> <text class="shen">{{listobj.deviceCount}}</text>
|
<text class="qian">绑定设备:</text> <text class="shen">{{listobj.deviceCount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="jiben">
|
<view class="jiben">
|
||||||
<text class="qian">营业时间:</text> <text class="shen">{{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}</text>
|
<text class="qian">营业时间:</text> <text
|
||||||
|
class="shen">{{listobj.businessTimeStart}}~{{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>
|
||||||
|
@ -24,15 +25,19 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="icons">
|
<view class="icons">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uDNcSwmkeciv4fHv4JdJ" mode="" @click="show = true"></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uDNcSwmkeciv4fHv4JdJ" mode=""
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uCaV3mfjN1LUrW1gPPzQ" mode="" @click="btnpag(1)"></image>
|
@click="show = true"></image>
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uoyO7psgUNmNuhPDoOmH" mode="" @click="btnpag(2)"></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uCaV3mfjN1LUrW1gPPzQ" mode=""
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uu7AtppWYWNucDPLkcFu" mode="" @click="btnpag(3)"></image>
|
@click="btnpag(1)"></image>
|
||||||
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uoyO7psgUNmNuhPDoOmH" mode=""
|
||||||
|
@click="btnpag(2)"></image>
|
||||||
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uu7AtppWYWNucDPLkcFu" mode=""
|
||||||
|
@click="btnpag(3)"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-select v-model="show" :list="list" title='添加方式' @confirm="confirm"></u-select>
|
<u-select v-model="show" :list="list" title='添加方式' @confirm="confirm"></u-select>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -41,34 +46,34 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [{
|
list: [{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '扫码添加'
|
label: '扫码添加'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '2',
|
value: '2',
|
||||||
label: '搜索附近设备添加'
|
label: '搜索附近设备添加'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
show: false,
|
show: false,
|
||||||
storeId:'',
|
storeId: '',
|
||||||
listobj:{},
|
listobj: {},
|
||||||
deviceId:'',
|
deviceId: '',
|
||||||
name:'',
|
name: '',
|
||||||
mac:''
|
mac: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.storeId = option.id
|
this.storeId = option.id
|
||||||
this.getdetail()
|
this.getdetail()
|
||||||
|
|
||||||
// xBlufi.initXBlufi(1);
|
// xBlufi.initXBlufi(1);
|
||||||
// console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
|
// console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
|
||||||
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
||||||
// xBlufi.notifyStartDiscoverBle({
|
// xBlufi.notifyStartDiscoverBle({
|
||||||
// 'isStart': true
|
// 'isStart': true
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// // 停止蓝牙搜索
|
// // 停止蓝牙搜索
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// xBlufi.notifyStartDiscoverBle({
|
// xBlufi.notifyStartDiscoverBle({
|
||||||
|
@ -80,7 +85,7 @@
|
||||||
// name: this.name
|
// name: this.name
|
||||||
// });
|
// });
|
||||||
// }, 3000)
|
// }, 3000)
|
||||||
|
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
|
@ -88,7 +93,7 @@
|
||||||
'isStart': false
|
'isStart': false
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onHide(){
|
onHide() {
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
'isStart': false
|
||||||
|
@ -101,31 +106,31 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getdetail(){
|
getdetail() {
|
||||||
this.$u.get("/app/store/mch/" + this.storeId).then(res => {
|
this.$u.get("/app/store/mch/" + this.storeId).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.listobj = res.data
|
this.listobj = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
btnpag(num){
|
btnpag(num) {
|
||||||
if(num == 1){
|
if (num == 1) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
|
url: '/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
|
||||||
})
|
})
|
||||||
}else if(num == 2){
|
} else if (num == 2) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
|
url: '/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
|
||||||
})
|
})
|
||||||
}else if(num == 3){
|
} else if (num == 3) {
|
||||||
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) {
|
||||||
vm.$u.delete("/app/store/" + vm.storeId).then(res => {
|
vm.$u.delete("/app/store/" + vm.storeId).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -133,10 +138,10 @@
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
})
|
})
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},1500)
|
}, 1500)
|
||||||
}else if(res.code == 500){
|
} else if (res.code == 500) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
|
@ -144,30 +149,30 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击了取消');
|
console.log('用户点击了取消');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
let type = e[0].value
|
let type = e[0].value
|
||||||
if (type == '1') {
|
if (type == '1') {
|
||||||
this.scanQRCode()
|
this.scanQRCode()
|
||||||
} else if (type == '2') {
|
} else if (type == '2') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_fenbao/device/index?storeId=' + this.storeId
|
url: '/page_fenbao/device/index?storeId=' + this.storeId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scanQRCode() {
|
scanQRCode() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
success: res => {
|
success: res => {
|
||||||
// console.log('扫描结果:', res);
|
// console.log('扫描结果:', res);
|
||||||
function getQueryParam(url, paramName) {
|
function getQueryParam(url, paramName) {
|
||||||
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
|
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
|
||||||
let results = regex.exec(url);
|
let results = regex.exec(url);
|
||||||
|
@ -176,9 +181,9 @@
|
||||||
let sceneValue = res.result
|
let sceneValue = res.result
|
||||||
let decodedValue = decodeURIComponent(sceneValue);
|
let decodedValue = decodeURIComponent(sceneValue);
|
||||||
let id = getQueryParam(decodedValue, 'deviceNo')
|
let id = getQueryParam(decodedValue, 'deviceNo')
|
||||||
this.$u.get(`/app/device/${id}/bySn`).then((res) =>{
|
this.$u.get(`/app/device/${id}/bySn`).then((res) => {
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
this.qrResult = 'CTKG-' + res.data.mac
|
this.qrResult = 'CTKG-' + res.data.mac
|
||||||
// console.log(this.qrResult);
|
// console.log(this.qrResult);
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
|
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
|
||||||
|
@ -188,200 +193,214 @@
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': true
|
'isStart': true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 停止蓝牙搜索
|
// 停止蓝牙搜索
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
xBlufi.notifyStartDiscoverBle({
|
xBlufi.notifyStartDiscoverBle({
|
||||||
'isStart': false
|
'isStart': false
|
||||||
});
|
});
|
||||||
xBlufi.notifyConnectBle({
|
xBlufi.notifyConnectBle({
|
||||||
isStart: true,
|
isStart: true,
|
||||||
deviceId: this.deviceId,
|
deviceId: this.deviceId,
|
||||||
name: this.name
|
name: this.name
|
||||||
});
|
});
|
||||||
}, 2000)
|
}, 2000)
|
||||||
uni.showLoading({ title: '连接中...' });
|
uni.showLoading({
|
||||||
|
title: '连接中...'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
console.error('扫描失败:', err);
|
console.error('扫描失败:', err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '扫描失败',
|
title: '扫描失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
funListenDeviceMsgEvent: function(options) {
|
funListenDeviceMsgEvent: function(options) {
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
||||||
if (options.result) {
|
if (options.result) {
|
||||||
let devicesarr = options.data
|
let devicesarr = options.data
|
||||||
console.log(devicesarr,'devicesarrdevicesarr');
|
console.log(devicesarr, 'devicesarrdevicesarr');
|
||||||
devicesarr.forEach(device => {
|
devicesarr.forEach(device => {
|
||||||
const mac = device.name.substring(5);
|
const mac = device.name.substring(5);
|
||||||
if (device.name == this.qrResult) {
|
if (device.name == this.qrResult) {
|
||||||
this.deviceId = device.deviceId
|
this.deviceId = device.deviceId
|
||||||
this.name = device.name
|
this.name = device.name
|
||||||
this.mac = device.name.substring(5)
|
this.mac = device.name.substring(5)
|
||||||
this.devicesList = uniqueDevicesList;
|
this.devicesList = uniqueDevicesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
break;
|
uni.showToast({
|
||||||
|
title: '没有发现设备',
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
icon: 'none'
|
||||||
console.log("连接回调:" + JSON.stringify(options));
|
});
|
||||||
if (options.result) {
|
}
|
||||||
uni.hideLoading();
|
break;
|
||||||
// uni.showToast({
|
|
||||||
// title: '连接成功',
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
||||||
// icon: 'none'
|
console.log("连接回调:" + JSON.stringify(options));
|
||||||
// });
|
if (options.result) {
|
||||||
{
|
uni.hideLoading();
|
||||||
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
// uni.showToast({
|
||||||
"连接回调options.data.name:" + options.data.name);
|
// title: '连接成功',
|
||||||
let name = ''
|
// icon: 'none'
|
||||||
let index = this.name.indexOf('-');
|
// });
|
||||||
if (index !== -1) {
|
{
|
||||||
name = this.name.slice(index + 1);
|
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
||||||
}
|
"连接回调options.data.name:" + options.data.name);
|
||||||
let data = {
|
let name = ''
|
||||||
storeId:this.storeId,
|
let index = this.name.indexOf('-');
|
||||||
mac:this.mac
|
if (index !== -1) {
|
||||||
}
|
name = this.name.slice(index + 1);
|
||||||
this.$u.put('/app/device/bind', data).then((res) => {
|
}
|
||||||
if (res.code == 200) {
|
let data = {
|
||||||
uni.showToast({
|
storeId: this.storeId,
|
||||||
title: '绑定成功',
|
mac: this.mac
|
||||||
icon: 'none',
|
}
|
||||||
duration: 2000
|
this.$u.put('/app/device/bind', data).then((res) => {
|
||||||
});
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '绑定成功',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.removeStorageSync('mac');
|
uni.removeStorageSync('mac');
|
||||||
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();
|
||||||
if (systemInfo.platform === 'android') {
|
if (systemInfo.platform === 'android') {
|
||||||
// 当前设备是 Android
|
// 当前设备是 Android
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/page_components/wifilist/index?deviceId=' + options
|
url: '/page_components/wifilist/index?deviceId=' +
|
||||||
.data.deviceId + '&name=' + options.data.name
|
options
|
||||||
})
|
.data.deviceId + '&name=' +
|
||||||
} else if (systemInfo.platform === 'ios') {
|
options.data.name
|
||||||
// 当前设备是 iOS
|
})
|
||||||
uni.navigateTo({
|
} else if (systemInfo.platform === 'ios') {
|
||||||
url: '/page_fenbao/device/wifivideo?deviceId=' + options
|
// 当前设备是 iOS
|
||||||
.data.deviceId + '&name=' + options.data.name
|
uni.navigateTo({
|
||||||
})
|
url: '/page_fenbao/device/wifivideo?deviceId=' +
|
||||||
}
|
options
|
||||||
} else if (res.cancel) {
|
.data.deviceId + '&name=' +
|
||||||
console.log('用户点击了取消');
|
options.data.name
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
})
|
} else if (res.cancel) {
|
||||||
|
console.log('用户点击了取消');
|
||||||
}else if(res.code == 500){
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} else if (res.code == 500) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '该设备已被绑定',
|
title: '该设备已被绑定',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '连接失败',
|
title: '连接失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
// uni.navigateBack()
|
// uni.navigateBack()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
||||||
if (!options.result) {
|
if (!options.result) {
|
||||||
console.log("蓝牙未开启", options);
|
console.log("蓝牙未开启", options);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '蓝牙未开启',
|
title: '蓝牙未开启',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// this.searching = true
|
// this.searching = true
|
||||||
//蓝牙搜索开始
|
//蓝牙搜索开始
|
||||||
// _this.setData({
|
// _this.setData({
|
||||||
// searching: true
|
// searching: true
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
|
||||||
if (options.result) {
|
if (options.result) {
|
||||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||||
|
|
||||||
// 将去重后的数组重新赋值给 this.devicesList
|
// 将去重后的数组重新赋值给 this.devicesList
|
||||||
this.devicesList = uniqueDevicesList;
|
this.devicesList = uniqueDevicesList;
|
||||||
let list = []
|
let list = []
|
||||||
filteredDevices.forEach(device => {
|
filteredDevices.forEach(device => {
|
||||||
// 从设备名称中提取 MAC 地址(假设 MAC 地址是设备名称的后6个字符)
|
// 从设备名称中提取 MAC 地址(假设 MAC 地址是设备名称的后6个字符)
|
||||||
let macFromName = device.name.substring(device.name.length - 12);
|
let macFromName = device.name.substring(device.name.length - 12);
|
||||||
// console.log(macFromName);
|
// console.log(macFromName);
|
||||||
// 与 this.mac 进行比较
|
// 与 this.mac 进行比较
|
||||||
this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
|
this.$u.get(`/app/device/${macFromName}/isBind`).then((res) => {
|
||||||
if (res.data == false) {
|
if (res.data == false) {
|
||||||
list.push(device)
|
list.push(device)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.devicesList = list
|
this.devicesList = list
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
console.log('蓝牙停止搜索ok');
|
console.log('蓝牙停止搜索ok');
|
||||||
} else {
|
} else {
|
||||||
//蓝牙停止搜索失败
|
//蓝牙停止搜索失败
|
||||||
console.log('蓝牙停止搜索失败');
|
console.log('蓝牙停止搜索失败');
|
||||||
}
|
}
|
||||||
this.searching = false
|
this.searching = false
|
||||||
// _this.setData({
|
// _this.setData({
|
||||||
// searching: false
|
// searching: false
|
||||||
// });
|
// });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/deep/ .u-title{
|
/deep/ .u-title {
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-icon__icon{
|
|
||||||
|
/deep/ .u-icon__icon {
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-icon__icon{
|
|
||||||
|
/deep/ .u-icon__icon {
|
||||||
padding-bottom: 40rpx;
|
padding-bottom: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
|
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
}
|
}
|
||||||
|
@ -391,14 +410,16 @@
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
.box{
|
|
||||||
|
.box {
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
height: 1440rpx;
|
height: 1440rpx;
|
||||||
background: #F4F5F7;
|
background: #F4F5F7;
|
||||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||||
padding: 22rpx 36rpx;
|
padding: 22rpx 36rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.shopname{
|
|
||||||
|
.shopname {
|
||||||
width: 680rpx;
|
width: 680rpx;
|
||||||
height: 102rpx;
|
height: 102rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
|
@ -410,7 +431,8 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
}
|
}
|
||||||
.shoplist{
|
|
||||||
|
.shoplist {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 680rpx;
|
width: 680rpx;
|
||||||
|
@ -418,28 +440,33 @@
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
.tit{
|
|
||||||
|
.tit {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
}
|
}
|
||||||
.jiben{
|
|
||||||
|
.jiben {
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.qian{
|
|
||||||
|
.qian {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #808080;
|
color: #808080;
|
||||||
width: 40%;
|
width: 40%;
|
||||||
// margin-right: 20rpx;
|
// margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.shen{
|
|
||||||
|
.shen {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.icons{
|
|
||||||
|
.icons {
|
||||||
padding-top: 30rpx;
|
padding-top: 30rpx;
|
||||||
padding-left: 50rpx;
|
padding-left: 50rpx;
|
||||||
padding-right: 50rpx;
|
padding-right: 50rpx;
|
||||||
|
@ -452,7 +479,8 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 26rpx;
|
margin-top: 26rpx;
|
||||||
image{
|
|
||||||
|
image {
|
||||||
width: 96rpx;
|
width: 96rpx;
|
||||||
height: 96rpx;
|
height: 96rpx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<u-navbar title="附近共享" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
|
<u-navbar title="附近共享" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
|
||||||
<view class="dtxs">
|
<view class="dtxs">
|
||||||
<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" />
|
<!-- <map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" :scale="mapScale"/> -->
|
||||||
|
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
|
||||||
|
:show-location="true" :markers="covers" :scale="mapScale" />
|
||||||
</view>
|
</view>
|
||||||
<view class="listbox">
|
<view class="listbox">
|
||||||
<view class="moshi">
|
<view class="moshi">
|
||||||
|
@ -47,6 +49,10 @@
|
||||||
bgc: {
|
bgc: {
|
||||||
backgroundColor: " #8883F0",
|
backgroundColor: " #8883F0",
|
||||||
},
|
},
|
||||||
|
mapScale: 15,
|
||||||
|
mapContext: null,
|
||||||
|
mapScaleInterval: null,
|
||||||
|
listmap: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
@ -55,7 +61,84 @@
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getshanghu()
|
this.getshanghu()
|
||||||
},
|
},
|
||||||
|
onReady() {
|
||||||
|
this.mapContext = uni.createMapContext('map', this);
|
||||||
|
this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 在组件卸载前清除定时器
|
||||||
|
if (this.mapScaleInterval) {
|
||||||
|
clearInterval(this.mapScaleInterval);
|
||||||
|
this.mapScaleInterval = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateMarkers() {
|
||||||
|
this.mapContext.getScale({
|
||||||
|
success: (res) => {
|
||||||
|
this.covers = []; // 清空之前的覆盖物
|
||||||
|
if (res.scale <= 14) {
|
||||||
|
this.addMarkersWithoutLabels();
|
||||||
|
} else {
|
||||||
|
this.addMarkersWithLabels();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('获取地图缩放级别失败:', error);
|
||||||
|
// 额外的错误处理逻辑...
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithoutLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
};
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
label: {
|
||||||
|
content: item.name,
|
||||||
|
anchorX:this.calculateAnchorX(item.name),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
calculateAnchorX(name) {
|
||||||
|
let chineseLength = 0;
|
||||||
|
let englishLength = 0;
|
||||||
|
for (let i = 0; i < name.length; i++) {
|
||||||
|
const charCode = name.charCodeAt(i);
|
||||||
|
// 判断是否为中文字符(这里简化了判断,只考虑了基本的中文字符范围)
|
||||||
|
if (charCode >= 0x4e00 && charCode <= 0x9fa5) {
|
||||||
|
chineseLength++;
|
||||||
|
} else if (/[a-zA-Z]/.test(name[i])) { // 判断是否为英文字符
|
||||||
|
englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度
|
||||||
|
// console.log(englishLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const totalLength = chineseLength + englishLength * 2; // 总长度(以中文字符为单位)
|
||||||
|
return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7
|
||||||
|
},
|
||||||
|
|
||||||
// 跳转导航
|
// 跳转导航
|
||||||
mapFun(item) {
|
mapFun(item) {
|
||||||
uni.openLocation({
|
uni.openLocation({
|
||||||
|
@ -81,7 +164,8 @@
|
||||||
this.jinweidu = this.longitude + ',' + this.latitude;
|
this.jinweidu = this.longitude + ',' + this.latitude;
|
||||||
// 请求附近的店铺
|
// 请求附近的店铺
|
||||||
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(response => {
|
this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
|
this.listmap = response.data
|
||||||
this.gxlist = response.data;
|
this.gxlist = response.data;
|
||||||
this.gxlist.forEach(item => {
|
this.gxlist.forEach(item => {
|
||||||
// 计算距离
|
// 计算距离
|
||||||
|
@ -99,8 +183,29 @@
|
||||||
distance: distance ,// 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
|
distance: distance ,// 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
|
||||||
label: {
|
label: {
|
||||||
content: item.name,
|
content: item.name,
|
||||||
// anchorX:-20,
|
anchorX: (() => {
|
||||||
textAlign: 'center'
|
if (item.name.length <= 2) {
|
||||||
|
return -12
|
||||||
|
} else if (item.name.length <= 3) {
|
||||||
|
return -20
|
||||||
|
} else if (item.name.length <= 4) {
|
||||||
|
return -25
|
||||||
|
} else if (item.name.length <= 5) {
|
||||||
|
return -30
|
||||||
|
} else if (item.name.length <= 6) {
|
||||||
|
return -35
|
||||||
|
} else if (item.name.length <= 8) {
|
||||||
|
return -40
|
||||||
|
} else if (item.name.length <=
|
||||||
|
10) {
|
||||||
|
return -45
|
||||||
|
} else {
|
||||||
|
return -item.name.length * 5
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// console.log(this.gxlist);
|
// console.log(this.gxlist);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<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>
|
height='58'></u-navbar>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.articleId = option.id
|
this.articleId = option.id
|
||||||
this.getxq()
|
this.getxq()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getxq(){
|
getxq(){
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<u-navbar title="地图模式" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
|
<u-navbar title="地图模式" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
|
||||||
<view class="dtxs">
|
<view class="dtxs">
|
||||||
<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true"/>
|
<!-- <map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" :scale="mapScale" /> -->
|
||||||
|
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
|
||||||
|
:show-location="true" :markers="covers" :scale="mapScale" />
|
||||||
</view>
|
</view>
|
||||||
<view class="listbox" v-if="falga">
|
<view class="listbox" v-if="falga">
|
||||||
<view class="moshi">
|
<view class="moshi">
|
||||||
|
@ -72,6 +74,10 @@
|
||||||
bgc: {
|
bgc: {
|
||||||
backgroundColor: " #8883F0",
|
backgroundColor: " #8883F0",
|
||||||
},
|
},
|
||||||
|
mapScale: 15,
|
||||||
|
mapContext: null,
|
||||||
|
mapScaleInterval: null,
|
||||||
|
listmap: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -82,7 +88,84 @@
|
||||||
}
|
}
|
||||||
this.getxq()
|
this.getxq()
|
||||||
},
|
},
|
||||||
|
onReady() {
|
||||||
|
this.mapContext = uni.createMapContext('map', this);
|
||||||
|
this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 在组件卸载前清除定时器
|
||||||
|
if (this.mapScaleInterval) {
|
||||||
|
clearInterval(this.mapScaleInterval);
|
||||||
|
this.mapScaleInterval = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateMarkers() {
|
||||||
|
this.mapContext.getScale({
|
||||||
|
success: (res) => {
|
||||||
|
this.covers = []; // 清空之前的覆盖物
|
||||||
|
if (res.scale <= 14) {
|
||||||
|
this.addMarkersWithoutLabels();
|
||||||
|
} else {
|
||||||
|
this.addMarkersWithLabels();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('获取地图缩放级别失败:', error);
|
||||||
|
// 额外的错误处理逻辑...
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithoutLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
};
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
label: {
|
||||||
|
content: item.name,
|
||||||
|
anchorX:this.calculateAnchorX(item.name),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
calculateAnchorX(name) {
|
||||||
|
let chineseLength = 0;
|
||||||
|
let englishLength = 0;
|
||||||
|
for (let i = 0; i < name.length; i++) {
|
||||||
|
const charCode = name.charCodeAt(i);
|
||||||
|
// 判断是否为中文字符(这里简化了判断,只考虑了基本的中文字符范围)
|
||||||
|
if (charCode >= 0x4e00 && charCode <= 0x9fa5) {
|
||||||
|
chineseLength++;
|
||||||
|
} else if (/[a-zA-Z]/.test(name[i])) { // 判断是否为英文字符
|
||||||
|
englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度
|
||||||
|
// console.log(englishLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const totalLength = chineseLength + englishLength * 2; // 总长度(以中文字符为单位)
|
||||||
|
return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7
|
||||||
|
},
|
||||||
|
|
||||||
scanQRCode() {
|
scanQRCode() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
|
@ -118,7 +201,7 @@
|
||||||
|
|
||||||
btnchak(id){
|
btnchak(id){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + id
|
url:'/page_fenbao/sbshouye?storeId=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -159,6 +242,7 @@
|
||||||
// 请求附近的店铺
|
// 请求附近的店铺
|
||||||
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) {
|
if (res.code == 200) {
|
||||||
|
this.listmap = res.data
|
||||||
// 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段
|
// 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
const shopCover = {
|
const shopCover = {
|
||||||
|
@ -167,24 +251,36 @@
|
||||||
longitude: item.lng,
|
longitude: item.lng,
|
||||||
width: 25,
|
width: 25,
|
||||||
height: 30,
|
height: 30,
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' ,// 你可以为每个店铺指定不同的图标
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' ,
|
||||||
label: {
|
label: {
|
||||||
content: item.name,
|
content: item.name,
|
||||||
// anchorX:-20,
|
anchorX: (() => {
|
||||||
textAlign: 'center'
|
if (item.name.length <= 2) {
|
||||||
|
return -12
|
||||||
|
} else if (item.name.length <= 3) {
|
||||||
|
return -20
|
||||||
|
} else if (item.name.length <= 4) {
|
||||||
|
return -25
|
||||||
|
} else if (item.name.length <= 5) {
|
||||||
|
return -30
|
||||||
|
} else if (item.name.length <= 6) {
|
||||||
|
return -35
|
||||||
|
} else if (item.name.length <= 8) {
|
||||||
|
return -40
|
||||||
|
} else if (item.name.length <=
|
||||||
|
10) {
|
||||||
|
return -45
|
||||||
|
} else {
|
||||||
|
return -item.name.length * 5
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.covers.push(shopCover); // 将店铺覆盖物添加到数组中
|
this.covers.push(shopCover);
|
||||||
});
|
});
|
||||||
// 添加当前位置的覆盖物(如果需要的话)
|
|
||||||
// const myLocationCover = {
|
|
||||||
// latitude: this.latitude,
|
|
||||||
// longitude: this.longitude,
|
|
||||||
// width: 20,
|
|
||||||
// height: 40,
|
|
||||||
// iconPath: '../../../static/image/icon1.png'
|
|
||||||
// };
|
|
||||||
// this.covers.push(myLocationCover);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
18
pages.json
18
pages.json
|
@ -215,6 +215,24 @@
|
||||||
"navigationBarTextStyle": "#FFFFFF",
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "webview",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#8883F0",
|
||||||
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"path": "sbshouye",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "添加设备",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#3996FD",
|
||||||
|
"navigationBarTextStyle": "#FFFFFF",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
"path": "device/lianjie",
|
"path": "device/lianjie",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
@ -71,8 +71,9 @@
|
||||||
|
|
||||||
<swiper class="swiper" style="height: 100%;margin-top: 20rpx;" :current='curtitidx' @change="swiperchange" @scrolltolower="onReachBottom">
|
<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">
|
<swiper-item v-for="(item,index) in groupLists" :key="index">
|
||||||
<view class="" v-if="shujuflag">
|
<view style="width: 100%;padding-top: 300rpx;text-align: center;font-size: 32rpx;font-weight: 600;color: #ccc;" class="" v-if="shujuflag">
|
||||||
暂无设备...
|
<image style="width: 432rpx;height: 432rpx;display: block;padding-left: 100rpx;margin-bottom: 30rpx;" src="https://api.ccttiot.com/smartmeter/img/static/unju6N2PoHUv2pyLegfV" mode=""></image>
|
||||||
|
该店铺暂无设备...
|
||||||
</view>
|
</view>
|
||||||
<view class="swiper-item " >
|
<view class="swiper-item " >
|
||||||
<view class="card_box" @click="todetail(item.deviceId)"
|
<view class="card_box" @click="todetail(item.deviceId)"
|
||||||
|
@ -347,6 +348,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getlist() {
|
getlist() {
|
||||||
|
this.shujuflag = false
|
||||||
if (this.storeId == null) {
|
if (this.storeId == null) {
|
||||||
this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
|
this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
|
|
@ -6,17 +6,17 @@
|
||||||
title-size='44' height='58'></u-navbar>
|
title-size='44' height='58'></u-navbar>
|
||||||
<view class="ditu">
|
<view class="ditu">
|
||||||
<view class="dtxs">
|
<view class="dtxs">
|
||||||
<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
|
<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
|
||||||
@scale="onMapScaleChange" :show-location="true" :markers="covers" :scale="mapScale" />
|
:show-location="true" :markers="covers" :scale="mapScale" />
|
||||||
</view>
|
</view>
|
||||||
<view class="fujin">
|
<view class="fujin">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/u7HPhEwbIJqbLRpImBON" mode=""
|
<image src="https://api.ccttiot.com/smartmeter/img/static/u7HPhEwbIJqbLRpImBON" mode=""
|
||||||
@click="btnindex(5)"></image>
|
@click="btnindex(5)"></image>
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode=""
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode=""
|
||||||
@click="btnindex(6)" v-if="isMch"></image>
|
@click="btnindex(6)" v-if="isMch"></image>
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode=""
|
<!-- <image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode=""
|
||||||
@click="btnindex(7)"
|
@click="btnindex(7)"
|
||||||
style="width: 58rpx;height: 58rpx;position: fixed;top: 940rpx;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)">
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
<!-- 联系客服 -->
|
<!-- 联系客服 -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="guangg">
|
<view class="guangg" @click="btnad">
|
||||||
<image :src="imgad" mode=""></image>
|
<image :src="imgad" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="saoma" @click="scanQRCode">
|
<view class="saoma" @click="scanQRCode">
|
||||||
|
@ -50,24 +50,24 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="tip_box" v-if="czflag">
|
<view class="tip_box" v-if="czflag">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="txt">
|
<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>
|
||||||
<view class="bot">
|
|
||||||
<view class="bot_left" @click="czflag = false">
|
|
||||||
取消
|
|
||||||
</view>
|
|
||||||
<view class="bot_right" @click="tocz()">
|
|
||||||
蓝牙充值
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -93,37 +93,118 @@
|
||||||
userType: '',
|
userType: '',
|
||||||
isMch: false,
|
isMch: false,
|
||||||
imgad: '',
|
imgad: '',
|
||||||
|
listmap: [],
|
||||||
mapScale: 15,
|
mapScale: 15,
|
||||||
czflag:false,
|
czflag: false,
|
||||||
datetime:0,
|
datetime: 0,
|
||||||
dingobj:''
|
dingobj: '',
|
||||||
|
mapContext: null,
|
||||||
|
mapScaleInterval: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// this.initOtherCovers(); // 初始化其他覆盖物
|
// this.initOtherCovers(); // 初始化其他覆盖物
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.logins();
|
this.logins();
|
||||||
this.getad()
|
this.getad()
|
||||||
this.gethuidaio()
|
this.gethuidaio()
|
||||||
},
|
},
|
||||||
|
onReady() {
|
||||||
|
this.mapContext = uni.createMapContext('map', this);
|
||||||
|
this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 在组件卸载前清除定时器
|
||||||
|
if (this.mapScaleInterval) {
|
||||||
|
clearInterval(this.mapScaleInterval);
|
||||||
|
this.mapScaleInterval = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
btnad(){
|
||||||
onMapScaleChange(e) {
|
this.$u.get("/app/ad").then((res) => {
|
||||||
// console.log(this.covers,'eeeeeeeee');
|
if (res.code == 200) {
|
||||||
this.mapScale = e.detail.scale; // 更新当前缩放级别
|
if(res.data.urlType == 1){
|
||||||
this.getMyLocation()
|
uni.navigateTo({
|
||||||
// this.covers.forEach(marker => {
|
url:'/page_fenbao/webview?url=' + res.data.url
|
||||||
// marker.label.content = this.mapScale > 13 ? marker.label.content : '';
|
})
|
||||||
// });
|
}else{
|
||||||
|
uni.navigateTo({
|
||||||
|
url: res.data.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
updateMarkers() {
|
||||||
|
this.mapContext.getScale({
|
||||||
|
success: (res) => {
|
||||||
|
this.covers = []; // 清空之前的覆盖物
|
||||||
|
if (res.scale <= 14) {
|
||||||
|
this.addMarkersWithoutLabels();
|
||||||
|
} else {
|
||||||
|
this.addMarkersWithLabels();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (error) => {
|
||||||
|
console.error('获取地图缩放级别失败:', error);
|
||||||
|
// 额外的错误处理逻辑...
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithoutLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
};
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addMarkersWithLabels() {
|
||||||
|
this.listmap.forEach((item) => {
|
||||||
|
const shopCover = {
|
||||||
|
id: parseFloat(item.storeId),
|
||||||
|
latitude: item.lat,
|
||||||
|
longitude: item.lng,
|
||||||
|
width: 25,
|
||||||
|
height: 30,
|
||||||
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
|
||||||
|
label: {
|
||||||
|
content: item.name,
|
||||||
|
anchorX:this.calculateAnchorX(item.name),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000, -2px 2px 0px #000',
|
||||||
|
rotate:20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.covers.push(shopCover);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
calculateAnchorX(name) {
|
||||||
|
let chineseLength = 0;
|
||||||
|
let englishLength = 0;
|
||||||
|
for (let i = 0; i < name.length; i++) {
|
||||||
|
const charCode = name.charCodeAt(i);
|
||||||
|
if (charCode >= 0x4e00 && charCode <= 0x9fa5) {
|
||||||
|
chineseLength++;
|
||||||
|
} else if (/[a-zA-Z]/.test(name[i])) {
|
||||||
|
englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度
|
||||||
|
// console.log(englishLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const totalLength = chineseLength + englishLength * 2;
|
||||||
|
return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7
|
||||||
},
|
},
|
||||||
|
|
||||||
scanQRCode() {
|
scanQRCode() {
|
||||||
|
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ['qrCode'],
|
scanType: ['qrCode'],
|
||||||
|
@ -161,9 +242,9 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
btnindex(num) {
|
btnindex(num) {
|
||||||
if (num == 2) {
|
if (num == 2) {
|
||||||
|
@ -213,6 +294,7 @@
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
// 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段
|
// 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段
|
||||||
|
this.listmap = res.data
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
const shopCover = {
|
const shopCover = {
|
||||||
id: parseFloat(item.storeId),
|
id: parseFloat(item.storeId),
|
||||||
|
@ -223,8 +305,32 @@
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', // 你可以为每个店铺指定不同的图标
|
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', // 你可以为每个店铺指定不同的图标
|
||||||
label: {
|
label: {
|
||||||
content: item.name,
|
content: item.name,
|
||||||
// anchorX:-20,
|
anchorX: (() => {
|
||||||
textAlign: 'center'
|
if (item.name.length <= 2) {
|
||||||
|
return -12
|
||||||
|
} else if (item.name.length <= 3) {
|
||||||
|
return -20
|
||||||
|
} else if (item.name.length <= 4) {
|
||||||
|
return -25
|
||||||
|
} else if (item.name.length <= 5) {
|
||||||
|
return -30
|
||||||
|
} else if (item.name.length <= 6) {
|
||||||
|
return -35
|
||||||
|
} else if (item.name.length <= 8) {
|
||||||
|
return -40
|
||||||
|
} else if (item.name.length <=
|
||||||
|
10) {
|
||||||
|
return -45
|
||||||
|
} else {
|
||||||
|
return -item.name.length * 5
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
fontWeight: 700,
|
||||||
|
color: '#8883F0',
|
||||||
|
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||||
|
style: {
|
||||||
|
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.covers.push(shopCover); // 将店铺覆盖物添加到数组中
|
this.covers.push(shopCover); // 将店铺覆盖物添加到数组中
|
||||||
|
@ -299,26 +405,26 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gethuidaio(){
|
gethuidaio() {
|
||||||
this.$u.get('/app/bill/recharge/device/fail/list').then(res => {
|
this.$u.get('/app/bill/recharge/device/fail/list').then(res => {
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
if(res.data.length > 0){
|
if (res.data.length > 0) {
|
||||||
this.czflag = true
|
this.czflag = true
|
||||||
this.dingobj = res.data
|
this.dingobj = res.data
|
||||||
}else{
|
} else {
|
||||||
uni.removeStorageSync('time')
|
uni.removeStorageSync('time')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
tocz(){
|
tocz() {
|
||||||
this.czflag = false
|
this.czflag = false
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
|
url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -331,10 +437,11 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/deep/ .u-title{
|
/deep/ .u-title {
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
/deep/ .u-icon__icon{
|
|
||||||
|
/deep/ .u-icon__icon {
|
||||||
padding-bottom: 41rpx;
|
padding-bottom: 41rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,9 +465,10 @@
|
||||||
padding-left: 34rpx;
|
padding-left: 34rpx;
|
||||||
padding-right: 34rpx;
|
padding-right: 34rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
// 代理样式
|
// 代理样式
|
||||||
.tip_box{
|
.tip_box {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 72rpx;
|
left: 72rpx;
|
||||||
top: 700rpx;
|
top: 700rpx;
|
||||||
|
@ -368,9 +476,11 @@
|
||||||
background: #F7FAFE;
|
background: #F7FAFE;
|
||||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||||
z-index: 10000000;
|
z-index: 10000000;
|
||||||
.top{
|
|
||||||
|
.top {
|
||||||
padding: 52rpx 38rpx 42rpx 36rpx;
|
padding: 52rpx 38rpx 42rpx 36rpx;
|
||||||
.txt{
|
|
||||||
|
.txt {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
@ -378,12 +488,14 @@
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.bot{
|
|
||||||
border-top: 2rpx solid #D8D8D8 ;
|
.bot {
|
||||||
|
border-top: 2rpx solid #D8D8D8;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.bot_left{
|
|
||||||
|
.bot_left {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -393,22 +505,24 @@
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: #3D3D3D;
|
color: #3D3D3D;
|
||||||
}
|
}
|
||||||
.bot_right{
|
|
||||||
|
.bot_right {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
border-left: 2rpx solid #D8D8D8 ;
|
border-left: 2rpx solid #D8D8D8;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color: #8883F0;
|
color: #8883F0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.userdaili {
|
.userdaili {
|
||||||
.gongneng {
|
.gongneng {
|
||||||
width: 680rpx;
|
width: 680rpx;
|
||||||
|
|
10
pages/tj.vue
10
pages/tj.vue
|
@ -134,10 +134,11 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.timelist = []
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// console.log(this.$refs)
|
// console.log(this.$refs)
|
||||||
this.$refs.canvas.init(this.initChart)
|
this.$refs.canvas.init(this.initChart)
|
||||||
}, 1000)
|
}, 500)
|
||||||
this.recharge = 0
|
this.recharge = 0
|
||||||
this.deviceId = uni.getStorageSync('deviceId')
|
this.deviceId = uni.getStorageSync('deviceId')
|
||||||
this.userType = uni.getStorageSync('userType')
|
this.userType = uni.getStorageSync('userType')
|
||||||
|
@ -146,11 +147,6 @@
|
||||||
this.yeartime.year = now.getFullYear()
|
this.yeartime.year = now.getFullYear()
|
||||||
this.yeartime.month = now.getMonth() + 1
|
this.yeartime.month = now.getMonth() + 1
|
||||||
this.gettime()
|
this.gettime()
|
||||||
// if (this.userType == '00') {
|
|
||||||
// this.gettimes()
|
|
||||||
// } else if (this.userType == '01') {
|
|
||||||
// this.gettime()
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
@ -163,7 +159,7 @@
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// console.log(this.$refs)
|
// console.log(this.$refs)
|
||||||
this.$refs.canvas.init(this.initChart)
|
this.$refs.canvas.init(this.initChart)
|
||||||
}, 1000)
|
}, 500)
|
||||||
},
|
},
|
||||||
// 进行获取用电量请求
|
// 进行获取用电量请求
|
||||||
gettime() {
|
gettime() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user