2024-03-13 10:54:22 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="page">
|
2024-05-24 16:48:42 +08:00
|
|
|
|
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
|
2024-06-03 16:47:25 +08:00
|
|
|
|
title-size='36' height='50' id="navbar">
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</u-navbar>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
<view class="zhuhu">
|
2024-03-13 10:54:22 +08:00
|
|
|
|
<view class="card1">
|
|
|
|
|
<view class="top">
|
|
|
|
|
<view class="left">
|
|
|
|
|
设备
|
|
|
|
|
</view>
|
|
|
|
|
<view class="right">
|
2024-09-05 18:00:53 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mid">
|
2024-06-12 18:02:28 +08:00
|
|
|
|
<view class="mid_left">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view v-if="opflag"
|
|
|
|
|
style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;"
|
|
|
|
|
@click="btnpic">
|
2024-07-24 18:02:34 +08:00
|
|
|
|
<image :src="imglist" mode="aspectFit"
|
2024-06-12 18:02:28 +08:00
|
|
|
|
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
2024-08-12 21:49:12 +08:00
|
|
|
|
</view>
|
2024-07-22 18:03:27 +08:00
|
|
|
|
<image v-else :src="imglist" mode="aspectFit"
|
2024-07-09 18:03:16 +08:00
|
|
|
|
style="width: 142rpx;height: 142rpx;border-radius: 20rpx;"></image>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
<ksp-cropper mode="free" :width="142" :height="142" :maxWidth="1024" :maxHeight="1024"
|
|
|
|
|
:url="url" @cancel="oncancel" @ok="onok"></ksp-cropper>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="mid_right">
|
|
|
|
|
<view class="mid_top">
|
2024-06-04 14:50:30 +08:00
|
|
|
|
{{ deviceInfo.deviceName == null ? '' : deviceInfo.deviceName }}
|
2024-06-13 18:02:12 +08:00
|
|
|
|
<view class="" style="font-size: 26rpx;margin-top: 8rpx;">
|
2024-06-17 13:57:53 +08:00
|
|
|
|
更新时间:{{deviceInfo.lastPullTime == null ? '--' : deviceInfo.lastPullTime}}</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<text
|
|
|
|
|
style="font-size: 24rpx;color: #8883F0;display: inline-block;border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;border-radius: 10rpx;">{{deviceInfo.model == undefined ? '' : deviceInfo.model}}</text>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="mid_bot">
|
2024-06-05 18:07:50 +08:00
|
|
|
|
<view class="txt" v-if="deviceInfo">
|
|
|
|
|
S/N码:{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<div class="tip" v-if="deviceInfo.onlineStatus==1"
|
|
|
|
|
style="color: seagreen;border: 2rpx solid;">在线</div>
|
|
|
|
|
<div class="tip" v-if="deviceInfo.onlineStatus==0" style="color: red;border: 2rpx solid;">离线
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tip" v-if="deviceInfo.status==1" style="color: seagreen;border: 2rpx solid;">空闲
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tip" v-if="deviceInfo.status==2" style="color: seagreen;border: 2rpx solid;">使用中
|
|
|
|
|
</div>
|
2024-07-22 18:03:27 +08:00
|
|
|
|
<div class="tip" v-if="deviceInfo.status==3" style="color: red;">维修中</div>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bot">
|
2024-08-05 18:00:54 +08:00
|
|
|
|
<!-- 设备租期到期时间: {{deviceInfo.rentTime}} -->
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="card2">
|
|
|
|
|
<view class="tit">实时</view>
|
2024-06-05 18:07:50 +08:00
|
|
|
|
<view class="bot_right">
|
|
|
|
|
<view class="cont" style="text-align: center;">
|
|
|
|
|
<view class="tit">
|
|
|
|
|
{{deviceInfo.orderAmount == null ? 0 : deviceInfo.orderAmount}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="txt">
|
|
|
|
|
订单金额
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cont" style="text-align: center;">
|
|
|
|
|
<view class="tit">
|
|
|
|
|
{{deviceInfo.orderCount == null ? 0 : deviceInfo.orderCount}}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="txt">
|
|
|
|
|
订单数
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="cont" style="text-align: center;">
|
|
|
|
|
<view class="tit">
|
2024-07-18 18:06:40 +08:00
|
|
|
|
{{formattedTime}}
|
2024-06-13 18:02:12 +08:00
|
|
|
|
<!-- sb:{{setMode}} -->
|
2024-06-05 18:07:50 +08:00
|
|
|
|
</view>
|
|
|
|
|
<view class="txt">
|
2024-07-09 18:03:16 +08:00
|
|
|
|
剩余时长
|
2024-06-05 18:07:50 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
2024-07-09 18:03:16 +08:00
|
|
|
|
<view class="card3" v-if="opflag">
|
2024-03-13 10:54:22 +08:00
|
|
|
|
<view class="tit">其他</view>
|
2024-05-10 17:37:36 +08:00
|
|
|
|
<view class="cont_box" style="display: block;">
|
2024-07-09 18:03:16 +08:00
|
|
|
|
<view class="" style="display: flex;">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="topage(0)">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
<view class="top">
|
2024-06-11 18:03:16 +08:00
|
|
|
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uKrpw3p37UHW56IypPJU" mode=""
|
2024-07-31 18:01:34 +08:00
|
|
|
|
style="width: 58rpx;height: 58rpx;"></image>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-07-31 18:01:34 +08:00
|
|
|
|
<view class="bot">充值记录</view>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="topage(1)">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
<view class="top">
|
2024-06-11 18:03:16 +08:00
|
|
|
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uaS4iFmD786AtBt2tKFs" mode=""
|
2024-05-13 15:32:48 +08:00
|
|
|
|
style="width: 58rpx;height: 58rpx;"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bot">归零</view>
|
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="topage(6)">
|
2024-06-17 13:57:53 +08:00
|
|
|
|
<view class="top">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<image style="width: 58rpx;height: 58rpx;"
|
|
|
|
|
src="https://api.ccttiot.com/smartmeter/img/static/uAnBmmayp3tVGwXntdaM" mode="">
|
|
|
|
|
</image>
|
2024-06-17 13:57:53 +08:00
|
|
|
|
</view>
|
2024-07-18 18:06:40 +08:00
|
|
|
|
<view class="bot">充值</view>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="topage(2)">
|
2024-07-27 18:43:42 +08:00
|
|
|
|
<view class="top">
|
|
|
|
|
<image src="https://api.ccttiot.com/smartmeter/img/static/ue0X00T1C3fh7TCgjopm" mode=""
|
2024-07-31 18:01:34 +08:00
|
|
|
|
style="width: 58rpx;height: 58rpx;"></image>
|
2024-07-27 18:43:42 +08:00
|
|
|
|
</view>
|
2024-08-02 18:00:50 +08:00
|
|
|
|
<view class="bot">上报异常</view>
|
2024-07-27 18:43:42 +08:00
|
|
|
|
</view>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
2024-07-31 18:01:34 +08:00
|
|
|
|
<view class="" style="display: flex;margin-top: 20rpx;padding-right: 5rpx;box-sizing: border-box;">
|
2024-07-16 15:00:10 +08:00
|
|
|
|
<view class="cont" @click="topage(3)">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
<view class="top">
|
2024-06-11 18:03:16 +08:00
|
|
|
|
<image src="https://api.ccttiot.com/smartmeter/img/static/umjPUc8nDKf1JwVqRAeb" mode=""
|
2024-07-31 18:01:34 +08:00
|
|
|
|
style="width: 50rpx;height: 58rpx;"></image>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-07-31 18:01:34 +08:00
|
|
|
|
<view class="bot">收费方式</view>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-09-06 18:03:19 +08:00
|
|
|
|
<view class="cont" @click="topage(5)" v-if="!modelId.some(tag => tag == 3)">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
<view class="top">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<image style="width: 58rpx;height: 58rpx;"
|
|
|
|
|
src="https://api.ccttiot.com/smartmeter/img/static/uik9veDG6pMVG5M1Vxze" mode="">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</image>
|
|
|
|
|
</view>
|
2024-07-27 18:43:42 +08:00
|
|
|
|
<view class="bot">配网</view>
|
2024-05-13 15:32:48 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="topage(4)">
|
2024-05-21 10:49:02 +08:00
|
|
|
|
<view class="top">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<image style="width: 58rpx;height: 58rpx;"
|
|
|
|
|
src="https://api.ccttiot.com/smartmeter/img/static/u2Uco0iXf8aure0H2ihz" mode="">
|
2024-05-21 10:49:02 +08:00
|
|
|
|
</image>
|
|
|
|
|
</view>
|
2024-07-27 18:43:42 +08:00
|
|
|
|
<view class="bot">设置</view>
|
2024-05-21 10:49:02 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="cont" @click="qrFun">
|
2024-07-18 18:06:40 +08:00
|
|
|
|
<view class="top">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<image style="width: 58rpx;height: 58rpx;"
|
|
|
|
|
src="https://api.ccttiot.com/smartmeter/img/static/u7o1YnOGEKxM6KZ4WGXO" mode="">
|
|
|
|
|
</image>
|
2024-07-18 18:06:40 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="bot">分享</view>
|
2024-07-18 18:06:40 +08:00
|
|
|
|
</view>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-09-05 18:00:53 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
<view class="cont_box" style="padding-left: 30rpx;">
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-09-05 18:00:53 +08:00
|
|
|
|
<view class="" style="display: flex;margin-top: 20rpx;padding: 50rpx;box-sizing: border-box;width: 100%;
|
|
|
|
|
height: 80rpx;align-items: center;justify-content: space-between;background-color: #fff;border-radius: 20rpx;">
|
|
|
|
|
<view class="bot">手动操作:{{tdtxt}}</view>
|
|
|
|
|
<view class="cont" @click="btnkq">
|
|
|
|
|
<view class="top">
|
|
|
|
|
<u-switch v-model="checked" active-color="#8883F0"></u-switch>
|
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
<view class="tanc" v-if="vipflag">
|
|
|
|
|
<view class="tit">请输入您需要充值的时长(分钟)</view>
|
|
|
|
|
<input type="number" :focus="focus" v-model="cztime" />
|
|
|
|
|
<view class="xian"></view>
|
|
|
|
|
<view class="anniu">
|
|
|
|
|
<text @click="btnqx">取消</text> <text style="border-left: 1px solid #D8D8D8;color: #8883F0;"
|
|
|
|
|
@click="trueje">确定</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="maskss" v-if="vipflag"></view>
|
|
|
|
|
<!-- 蓝牙连接 -->
|
|
|
|
|
<view class="bluetoothbox" v-if="bluetoothflag">
|
|
|
|
|
<view class="stop">
|
|
|
|
|
正在连接该设备蓝牙
|
|
|
|
|
</view>
|
2024-07-23 18:00:01 +08:00
|
|
|
|
<view class="xtop">
|
|
|
|
|
请将手机与设备尽量靠近
|
|
|
|
|
</view>
|
|
|
|
|
<image src="https://api.ccttiot.com/smartmeter/img/static/ucDphMKsozqwwllJTAKL" mode=""></image>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 蓝牙连接失败 -->
|
|
|
|
|
<view class="bluetoothbox" v-if="shibaiflag">
|
|
|
|
|
<image class="img" src="https://api.ccttiot.com/smartmeter/img/static/uTb3vSlbcHdPMFQMBjyL" mode=""></image>
|
|
|
|
|
<view class="one">
|
|
|
|
|
蓝牙连接失败
|
|
|
|
|
</view>
|
|
|
|
|
<view class="two">
|
|
|
|
|
请确保手机足够靠近设备
|
|
|
|
|
</view>
|
|
|
|
|
<view class="thr">
|
|
|
|
|
并且设备处于上电状态
|
|
|
|
|
</view>
|
2024-09-05 18:00:53 +08:00
|
|
|
|
<view class="anfour">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
<view class="qx" @click="btnlyqx">
|
|
|
|
|
取消
|
|
|
|
|
</view>
|
2024-07-23 18:00:01 +08:00
|
|
|
|
<view class="cx" @click="topage(5)">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
重新连接
|
2024-07-23 18:00:01 +08:00
|
|
|
|
</view>
|
2024-09-02 18:03:58 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 展示二维码 -->
|
|
|
|
|
<view class="imgewm" v-if="wemflag" @longpress="saveCanvas">
|
|
|
|
|
<canvas canvas-id="qrcode" style="height: 100%;margin: 0 auto;" />
|
|
|
|
|
<view class="" style="width: 100%;text-align: center;margin-top: 20rpx;">
|
|
|
|
|
SN:{{deviceNo}}
|
|
|
|
|
</view>
|
2024-09-05 18:00:53 +08:00
|
|
|
|
<view class=""
|
|
|
|
|
style="border: 1px solid; padding: 20rpx;box-sizing: border-box;width: 100%;text-align: center;margin-top: 400rpx;"
|
|
|
|
|
@click="wemflag = false">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
关闭二维码
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="imgewmflag" v-if="wemflag" @click.stop="ewmyc"></view>
|
|
|
|
|
|
|
|
|
|
<view v-if="btnmsk"
|
|
|
|
|
style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .1;z-index: 999;">
|
|
|
|
|
</view>
|
2024-09-05 18:00:53 +08:00
|
|
|
|
</view>
|
2024-03-13 10:54:22 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-10 19:51:14 +08:00
|
|
|
|
var xBlufi = require("@/page_components/blufi/xBlufi.js")
|
2024-09-02 18:03:58 +08:00
|
|
|
|
import uQRCode from '@/common/uqrcode.js'
|
2024-05-10 21:35:42 +08:00
|
|
|
|
import uniEcCanvas from '@/components/uni-ec-canvas/uni-ec-canvas.vue'
|
|
|
|
|
import * as echarts from '@/components/uni-ec-canvas/echarts'
|
|
|
|
|
let chart = null
|
2024-03-13 10:54:22 +08:00
|
|
|
|
export default {
|
2024-05-10 21:35:42 +08:00
|
|
|
|
components: {
|
|
|
|
|
uniEcCanvas
|
|
|
|
|
},
|
2024-03-13 10:54:22 +08:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
wemflag: false,
|
|
|
|
|
btnmsk: false,
|
|
|
|
|
bluetoothflag: false,
|
|
|
|
|
shibaiflag: false,
|
2024-03-13 10:54:22 +08:00
|
|
|
|
bgc: {
|
2024-05-21 18:02:34 +08:00
|
|
|
|
backgroundColor: "#8883f0",
|
2024-03-13 10:54:22 +08:00
|
|
|
|
},
|
2024-05-10 21:35:42 +08:00
|
|
|
|
ec: {
|
|
|
|
|
lazyLoad: true
|
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
deviceInfo: {},
|
|
|
|
|
loadings: false,
|
|
|
|
|
info: '',
|
2024-09-02 18:03:58 +08:00
|
|
|
|
checked: false,
|
2024-07-10 18:01:40 +08:00
|
|
|
|
tittxt: "设备详情",
|
2024-09-02 18:03:58 +08:00
|
|
|
|
titlist: [],
|
|
|
|
|
tdtxt: '开启',
|
2024-05-13 15:32:48 +08:00
|
|
|
|
curtitidx: 0,
|
|
|
|
|
id: '',
|
2024-09-02 18:03:58 +08:00
|
|
|
|
focus: false,
|
2024-05-13 15:32:48 +08:00
|
|
|
|
timeday: '',
|
|
|
|
|
imglist: '',
|
|
|
|
|
token: '',
|
|
|
|
|
userImgs: '',
|
|
|
|
|
imgflag: true,
|
2024-05-30 17:24:10 +08:00
|
|
|
|
mac: "",
|
|
|
|
|
name: '',
|
|
|
|
|
deviceId: '',
|
|
|
|
|
storeId: '',
|
2024-06-04 17:50:05 +08:00
|
|
|
|
qrResult: '',
|
2024-06-05 18:07:50 +08:00
|
|
|
|
devicesList: [],
|
2024-09-02 18:03:58 +08:00
|
|
|
|
setMode: null,
|
|
|
|
|
vipflag: false,
|
|
|
|
|
cztime: '',
|
|
|
|
|
opflag: true,
|
2024-07-23 18:00:01 +08:00
|
|
|
|
timer: null,
|
2024-07-24 18:02:34 +08:00
|
|
|
|
url: "",
|
2024-09-05 18:00:53 +08:00
|
|
|
|
deviceNo: '',
|
2024-09-06 18:03:19 +08:00
|
|
|
|
modelId:[]
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
let id = option.id
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.id = id
|
2024-07-18 18:06:40 +08:00
|
|
|
|
// this.getDevice(id)
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (option.flag) {
|
|
|
|
|
this.opflag = false
|
|
|
|
|
} else {
|
|
|
|
|
this.opflag = true
|
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
},
|
2024-07-17 17:59:51 +08:00
|
|
|
|
// 分享到好友(会话)
|
2024-09-02 18:03:58 +08:00
|
|
|
|
onShareAppMessage: function() {
|
|
|
|
|
return {
|
|
|
|
|
title: '创想物联',
|
|
|
|
|
path: '/pages/shouye/index'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 分享到朋友圈
|
|
|
|
|
onShareTimeline: function() {
|
|
|
|
|
return {
|
|
|
|
|
title: '创想物联',
|
|
|
|
|
query: '',
|
|
|
|
|
path: '/pages/shouye/index'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
formattedTime() {
|
|
|
|
|
if (this.timeday.days > 0) {
|
|
|
|
|
// 只展示天和小时
|
|
|
|
|
return `${this.timeday.days}天${this.timeday.hours}小时`
|
|
|
|
|
} else if (this.timeday.hours > 0) {
|
|
|
|
|
// 展示小时和分钟
|
|
|
|
|
return `${this.timeday.hours}小时${this.timeday.minutes}分钟`
|
|
|
|
|
} else if (this.timeday.minutes > 0) {
|
|
|
|
|
// 展示分钟和秒
|
|
|
|
|
return `${this.timeday.minutes}分钟${this.timeday.seconds}秒`
|
|
|
|
|
} else {
|
|
|
|
|
// 展示秒或0(如果秒也为0)
|
|
|
|
|
return this.timeday.seconds > 0 ? `${this.timeday.seconds}秒` : '0'
|
|
|
|
|
}
|
2024-09-05 18:00:53 +08:00
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
// 组件销毁前清除定时器,防止内存泄漏
|
|
|
|
|
if (this.timer) {
|
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
this.timer = null
|
|
|
|
|
console.log('已销毁')
|
2024-09-11 18:01:14 +08:00
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
},
|
|
|
|
|
onHide() {
|
|
|
|
|
if (this.timer) {
|
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
this.timer = null
|
|
|
|
|
console.log('已销毁')
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-09-11 18:01:14 +08:00
|
|
|
|
onUnload: function() {
|
|
|
|
|
console.log("unload ");
|
|
|
|
|
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
|
|
|
|
wx.closeBLEConnection({
|
|
|
|
|
deviceId: this.deviceId,
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
onShow() {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.getDevice(this.id)
|
2024-07-18 18:06:40 +08:00
|
|
|
|
}, 100)
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.getQiniuToken()
|
|
|
|
|
},
|
2024-09-02 18:03:58 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
this.drawCanvas()
|
|
|
|
|
},
|
2024-03-13 10:54:22 +08:00
|
|
|
|
methods: {
|
2024-09-05 18:00:53 +08:00
|
|
|
|
capture() {
|
|
|
|
|
var pages = getCurrentPages(); //获取当前页面信息
|
|
|
|
|
var page = pages[pages.length - 1];
|
|
|
|
|
var bitmap = null;
|
|
|
|
|
var currentWebview = page.$getAppWebview();
|
|
|
|
|
bitmap = new plus.nativeObj.Bitmap('amway_img');
|
|
|
|
|
// 将webview内容绘制到Bitmap对象中
|
|
|
|
|
currentWebview.draw(bitmap, function() {
|
|
|
|
|
// console.log('截屏绘制图片成功');
|
|
|
|
|
//这里我将文件名用四位随机数拼接了,不然会出现当前图片替换上一张图片只能保存一张图片的问题
|
|
|
|
|
let rand = Math.floor(Math.random() * 10000)
|
|
|
|
|
let saveUrl = '_doc/' + rand + 'a.jpg'
|
|
|
|
|
bitmap.save(saveUrl, {}, function(i) {
|
|
|
|
|
// console.log('保存图片成功:' + JSON.stringify(i));
|
|
|
|
|
uni.saveImageToPhotosAlbum({
|
|
|
|
|
filePath: i.target,
|
|
|
|
|
success: function() {
|
|
|
|
|
// bitmap.clear(); //销毁Bitmap图片
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '保存图片成功',
|
|
|
|
|
mask: false,
|
|
|
|
|
duration: 1500
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, function(e) {
|
|
|
|
|
console.log('保存图片失败:' + JSON.stringify(e));
|
|
|
|
|
});
|
|
|
|
|
}, function(e) {
|
|
|
|
|
console.log('截屏绘制图片失败:' + JSON.stringify(e));
|
|
|
|
|
});
|
|
|
|
|
//currentWebview.append(amway_bit);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
2024-09-02 18:03:58 +08:00
|
|
|
|
drawCanvas() {
|
|
|
|
|
const ctx = uni.createCanvasContext('qrcode', this);
|
|
|
|
|
ctx.setFillStyle('#fff');
|
|
|
|
|
ctx.fillRect(10, 10, 250, 250);
|
|
|
|
|
ctx.draw();
|
|
|
|
|
},
|
|
|
|
|
// 长按保存二维码
|
|
|
|
|
saveCanvas() {
|
|
|
|
|
uni.canvasToTempFilePath({
|
|
|
|
|
canvasId: 'qrcode',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
console.log(res.tempFilePath); // 打印图片路径
|
|
|
|
|
uni.saveImageToPhotosAlbum({
|
|
|
|
|
filePath: res.tempFilePath,
|
|
|
|
|
success: function() {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '保存成功',
|
|
|
|
|
icon: 'success'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//**生成二维码**//
|
|
|
|
|
qrFun: function() {
|
|
|
|
|
this.wemflag = true
|
|
|
|
|
uQRCode.make({
|
|
|
|
|
canvasId: 'qrcode',
|
|
|
|
|
// componentInstance: this,
|
|
|
|
|
text: 'https://kg.chuantewulian.cn/w?s=' + this.deviceNo,
|
|
|
|
|
size: 250,
|
|
|
|
|
margin: 0,
|
|
|
|
|
backgroundColor: '#ffffff',
|
|
|
|
|
foregroundColor: '#000000',
|
|
|
|
|
fileType: 'jpg',
|
|
|
|
|
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
ewmyc() {
|
|
|
|
|
this.wemflag = false
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
btnlyqx() {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = false
|
|
|
|
|
this.bluetoothflag = false
|
|
|
|
|
},
|
2024-07-18 18:06:40 +08:00
|
|
|
|
// 开启和关闭
|
2024-09-02 18:03:58 +08:00
|
|
|
|
btnkq() {
|
|
|
|
|
if (this.deviceInfo.onlineStatus == 1) {
|
|
|
|
|
if (this.tdtxt == '开启') {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
this.$u.put(`/app/device/${this.id}/changePower?status=0`).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.tdtxt = '关闭'
|
|
|
|
|
this.checked = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
this.checked = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
this.$u.put(`/app/device/${this.id}/changePower?status=1`).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.checked = true
|
|
|
|
|
this.tdtxt = '开启'
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
this.checked = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
|
|
|
|
if (this.setMode == null) {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
this.btnmsk = false
|
|
|
|
|
this.shibaiflag = false
|
|
|
|
|
this.bluetoothflag = true
|
2024-09-02 18:03:58 +08:00
|
|
|
|
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
|
|
|
|
|
})
|
|
|
|
|
xBlufi.notifyInitBleEsp32({
|
|
|
|
|
deviceId: this.deviceId
|
|
|
|
|
})
|
|
|
|
|
let name = ''
|
|
|
|
|
let index = this.name.indexOf('-')
|
|
|
|
|
if (index !== -1) {
|
|
|
|
|
name = this.name.slice(index + 1)
|
|
|
|
|
}
|
|
|
|
|
if (this.deviceInfo.powerStatus == 0) {
|
|
|
|
|
this.checked = false
|
|
|
|
|
} else {
|
|
|
|
|
this.checked = true
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
} else {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
// console.log(this.tdtxt,'020202');
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (this.tdtxt == '开启') {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
let that = this
|
2024-09-02 18:03:58 +08:00
|
|
|
|
uni.getNetworkType({
|
|
|
|
|
success(res) {
|
|
|
|
|
if (res.networkType !== 'none') {
|
|
|
|
|
uni.getConnectedBluetoothDevices({
|
|
|
|
|
success(res) {
|
|
|
|
|
setTimeout(() => {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
// console.log('close关闭');
|
|
|
|
|
that.tdtxt = '关闭'
|
|
|
|
|
that.checked = false
|
2024-09-02 18:03:58 +08:00
|
|
|
|
xBlufi.notifySendCustomData({
|
|
|
|
|
customData: 'close'
|
|
|
|
|
})
|
|
|
|
|
}, 1000)
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
let that = this
|
2024-09-02 18:03:58 +08:00
|
|
|
|
uni.getNetworkType({
|
|
|
|
|
success(res) {
|
|
|
|
|
if (res.networkType !== 'none') {
|
|
|
|
|
uni.getConnectedBluetoothDevices({
|
|
|
|
|
success(res) {
|
|
|
|
|
setTimeout(() => {
|
2024-08-31 17:41:21 +08:00
|
|
|
|
// console.log('open开启');
|
|
|
|
|
that.tdtxt = '开启'
|
|
|
|
|
that.checked = true
|
2024-09-02 18:03:58 +08:00
|
|
|
|
xBlufi.notifySendCustomData({
|
|
|
|
|
customData: 'open'
|
|
|
|
|
})
|
|
|
|
|
}, 1000)
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
console.error('获取已连接蓝牙设备信息失败:', err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-07-18 18:06:40 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
getQiniuToken() {
|
|
|
|
|
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
2024-03-13 10:54:22 +08:00
|
|
|
|
if (res.code == 200) {
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.token = res.token
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
|
2024-07-24 18:02:34 +08:00
|
|
|
|
btnpic() {
|
|
|
|
|
uni.chooseImage({
|
|
|
|
|
count: 1,
|
|
|
|
|
success: (rst) => {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
this.url = rst.tempFilePaths[0]
|
2024-07-24 18:02:34 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onok(ev) {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
this.url = ""
|
2024-07-24 18:02:34 +08:00
|
|
|
|
this.path = ev.path;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
let _this = this
|
|
|
|
|
let math = 'static/' + _this.$u.guid(20)
|
2024-06-13 18:02:12 +08:00
|
|
|
|
wx.uploadFile({
|
|
|
|
|
url: 'https://up-z2.qiniup.com',
|
|
|
|
|
name: 'file',
|
2024-07-24 18:02:34 +08:00
|
|
|
|
filePath: _this.path,
|
2024-06-13 18:02:12 +08:00
|
|
|
|
formData: {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
token: _this.token,
|
2024-06-13 18:02:12 +08:00
|
|
|
|
key: 'smartmeter/img/' + math
|
|
|
|
|
},
|
|
|
|
|
success: function(res) {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// console.log(res);
|
2024-06-13 18:02:12 +08:00
|
|
|
|
let str = JSON.parse(res.data)
|
2024-07-24 18:02:34 +08:00
|
|
|
|
_this.userImgs = 'https://api.ccttiot.com/' + str.key
|
|
|
|
|
_this.imglist = _this.userImgs
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// console.log(_this.imglist,'_this.imglist_this.imglist')
|
2024-07-24 18:02:34 +08:00
|
|
|
|
let data = {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
deviceId: _this.id,
|
|
|
|
|
customPicture: _this.imglist
|
2024-07-24 18:02:34 +08:00
|
|
|
|
}
|
|
|
|
|
_this.putdevice(data)
|
2024-05-10 17:37:36 +08:00
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2024-07-24 18:02:34 +08:00
|
|
|
|
oncancel() {
|
|
|
|
|
// url设置为空,隐藏控件
|
|
|
|
|
this.url = ""
|
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
putdevice(data) {
|
|
|
|
|
this.$u.put('/app/device', data).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '修改成功',
|
2024-05-24 16:48:42 +08:00
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
2024-06-13 18:02:12 +08:00
|
|
|
|
} else {
|
2024-05-24 16:48:42 +08:00
|
|
|
|
uni.showToast({
|
2024-06-13 18:02:12 +08:00
|
|
|
|
title: res.msg,
|
2024-05-13 15:32:48 +08:00
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取设备详情
|
|
|
|
|
getDevice(id) {
|
|
|
|
|
this.$u.get("/app/device/" + id).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.deviceInfo = res.data
|
2024-09-06 18:03:19 +08:00
|
|
|
|
this.modelId = res.data.modelTags
|
|
|
|
|
// res.data.modelTags.forEach(item => {
|
|
|
|
|
// if(item == 3){
|
|
|
|
|
// return this.modelId = 34
|
|
|
|
|
// }else{
|
|
|
|
|
// this.modelId = item
|
|
|
|
|
// }
|
|
|
|
|
// })
|
2024-05-24 16:48:42 +08:00
|
|
|
|
this.storeId = res.data.storeId
|
2024-09-02 18:03:58 +08:00
|
|
|
|
this.deviceNo = res.data.deviceNo
|
2024-08-12 21:49:12 +08:00
|
|
|
|
// this.qrResult = 'CTKG-' + res.data.mac
|
|
|
|
|
this.qrResult = res.data.mac
|
2024-06-14 18:51:43 +08:00
|
|
|
|
if (res.data.customPicture != null) {
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.imglist = res.data.customPicture
|
|
|
|
|
} else {
|
|
|
|
|
this.imglist = res.data.picture
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (this.deviceInfo.expireTime == null) {
|
2024-06-13 18:02:12 +08:00
|
|
|
|
this.timeday = 0
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-06-14 18:51:43 +08:00
|
|
|
|
let expireTimeStr = this.deviceInfo.expireTime
|
|
|
|
|
let expireTimeParts = expireTimeStr.split(" ");
|
|
|
|
|
let expireDateParts = expireTimeParts[0].split("-");
|
|
|
|
|
let expireTimePartsTime = expireTimeParts[1].split(":");
|
2024-09-05 18:00:53 +08:00
|
|
|
|
let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[
|
|
|
|
|
2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
|
2024-08-03 18:03:02 +08:00
|
|
|
|
let now = new Date()
|
|
|
|
|
let differenceInMs = expireDate - now
|
2024-06-14 18:51:43 +08:00
|
|
|
|
if (differenceInMs <= 0) {
|
|
|
|
|
this.timeday = 0
|
|
|
|
|
} else {
|
2024-07-18 18:06:40 +08:00
|
|
|
|
this.timeday = this.formatMilliseconds(differenceInMs)
|
|
|
|
|
this.startTimer()
|
2024-06-14 18:51:43 +08:00
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (res.data.powerStatus == 0) {
|
2024-07-19 18:07:24 +08:00
|
|
|
|
this.checked = false
|
|
|
|
|
this.tdtxt = '关闭'
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-07-19 18:07:24 +08:00
|
|
|
|
this.checked = true
|
|
|
|
|
this.tdtxt = '开启'
|
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.loadings = true
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
2024-07-19 18:07:24 +08:00
|
|
|
|
})
|
2024-05-10 17:37:36 +08:00
|
|
|
|
},
|
2024-09-02 18:03:58 +08:00
|
|
|
|
startTimer() {
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
if (this.timeday.seconds > 0) {
|
|
|
|
|
this.timeday.seconds--
|
|
|
|
|
} else if (this.timeday.minutes > 0) {
|
|
|
|
|
this.timeday.seconds = 59 // 重置秒数为59
|
|
|
|
|
this.timeday.minutes--
|
|
|
|
|
} else if (this.timeday.hours > 0) {
|
|
|
|
|
this.timeday.minutes = 59 // 重置分钟数为59
|
|
|
|
|
this.timeday.hours--
|
|
|
|
|
this.timeday.seconds = 0 // 同时重置秒数为0
|
|
|
|
|
} else if (this.timeday.days > 0) {
|
|
|
|
|
this.timeday.hours = 23 // 重置小时数为23
|
|
|
|
|
this.timeday.minutes = 59 // 重置分钟数为59
|
|
|
|
|
this.timeday.seconds = 0 // 重置秒数为0
|
|
|
|
|
this.timeday.days--
|
|
|
|
|
} else {
|
|
|
|
|
// 所有时间单位都已减为0,停止定时器
|
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
this.timer = null;
|
|
|
|
|
// console.log('时间已到期')
|
|
|
|
|
}
|
|
|
|
|
}, 1000); // 每秒执行一次
|
|
|
|
|
},
|
2024-07-18 18:06:40 +08:00
|
|
|
|
// 计算天时分秒
|
2024-09-02 18:03:58 +08:00
|
|
|
|
formatMilliseconds(milliseconds) {
|
|
|
|
|
// 计算天数
|
|
|
|
|
let days = Math.floor(milliseconds / (1000 * 60 * 60 * 24))
|
|
|
|
|
// 计算剩余的小时数
|
|
|
|
|
let hours = Math.floor((milliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
|
|
|
|
|
// 计算剩余的分钟数
|
|
|
|
|
let minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60))
|
|
|
|
|
// 计算剩余的秒数
|
|
|
|
|
let seconds = Math.floor((milliseconds % (1000 * 60)) / 1000)
|
|
|
|
|
// 返回一个对象,包含天、小时、分钟和秒
|
|
|
|
|
return {
|
|
|
|
|
days: days,
|
|
|
|
|
hours: hours,
|
|
|
|
|
minutes: minutes,
|
|
|
|
|
seconds: seconds
|
|
|
|
|
}
|
2024-07-18 18:06:40 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
opendevice() {
|
|
|
|
|
let stause = 0
|
|
|
|
|
if (this.deviceInfo.powerStatus == 1) {
|
|
|
|
|
stause = 0
|
|
|
|
|
} else {
|
|
|
|
|
stause = 1
|
2024-05-10 17:37:36 +08:00
|
|
|
|
}
|
2024-07-19 18:07:24 +08:00
|
|
|
|
// console.log(stause, 'stausestause');
|
2024-05-13 15:32:48 +08:00
|
|
|
|
this.$u.put(`/app/device/${this.deviceInfo.deviceId}/changePower?status=` + stause).then((res) => {
|
2024-05-10 17:37:36 +08:00
|
|
|
|
if (res.code == 200) {
|
2024-05-13 15:32:48 +08:00
|
|
|
|
// this.groupList=res.rows
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.getDevice(this.id)
|
|
|
|
|
}, 2000)
|
|
|
|
|
|
|
|
|
|
// this.loadings=true
|
|
|
|
|
} else {
|
2024-05-10 17:37:36 +08:00
|
|
|
|
uni.showToast({
|
2024-05-13 15:32:48 +08:00
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none'
|
2024-08-06 18:04:09 +08:00
|
|
|
|
})
|
2024-05-10 17:37:36 +08:00
|
|
|
|
}
|
2024-08-06 18:04:09 +08:00
|
|
|
|
})
|
2024-05-10 17:37:36 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
opendevices() {
|
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
swiperchange(e) {
|
|
|
|
|
this.curtitidx = e.detail.current
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// console.log(e, 'aaaa');
|
2024-03-13 10:54:22 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
changeidx(index) {
|
|
|
|
|
this.curtitidx = index
|
2024-03-13 10:54:22 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
|
|
|
|
toydfx() {
|
2024-03-13 10:54:22 +08:00
|
|
|
|
uni.navigateTo({
|
2024-05-13 15:32:48 +08:00
|
|
|
|
url: "/page_components/eletj?id=" + this.id
|
2024-03-13 10:54:22 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-25 19:46:07 +08:00
|
|
|
|
// 其他部分 点击进行跳转
|
2024-05-13 15:32:48 +08:00
|
|
|
|
topage(num) {
|
2024-08-02 18:00:50 +08:00
|
|
|
|
this.btnmsk = true
|
2024-05-13 15:32:48 +08:00
|
|
|
|
if (num == 0) {
|
2024-08-02 18:00:50 +08:00
|
|
|
|
this.btnmsk = false
|
2024-03-25 19:46:07 +08:00
|
|
|
|
uni.navigateTo({ //抄表
|
2024-05-13 15:32:48 +08:00
|
|
|
|
url: '/page_user/cbRecord?id=' + this.id
|
2024-03-25 19:46:07 +08:00
|
|
|
|
})
|
2024-05-13 15:32:48 +08:00
|
|
|
|
} else if (num == 1) {
|
2024-06-12 18:02:28 +08:00
|
|
|
|
let that = this
|
2024-06-11 18:03:16 +08:00
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '提示',
|
2024-09-02 18:03:58 +08:00
|
|
|
|
content: '您确定要将设备时间归零吗?',
|
2024-06-11 18:03:16 +08:00
|
|
|
|
success: function(res) {
|
|
|
|
|
if (res.confirm) {
|
2024-08-02 18:00:50 +08:00
|
|
|
|
that.btnmsk = false
|
2024-09-02 18:03:58 +08:00
|
|
|
|
//归零
|
|
|
|
|
that.$u.put(`/app/device/${that.id}/reset`).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
// console.log(res.data);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
that.getDevice(that.id)
|
2024-07-19 18:07:24 +08:00
|
|
|
|
this.checked = false
|
|
|
|
|
this.tdtxt = '关闭'
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else if (res.msg == '设备剩余时间不足,无需归零') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '设备剩余时间不足,无需归零',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
} else if (res.code == 500) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
// uni.showLoading({
|
|
|
|
|
// title: '充值中...'
|
|
|
|
|
// })
|
|
|
|
|
// let vm = this; // 将外部的 this 绑定到 vm 上
|
|
|
|
|
// uni.getNetworkType({
|
|
|
|
|
// success(res) {
|
|
|
|
|
// if (res.networkType !== 'none') {
|
|
|
|
|
// uni.getConnectedBluetoothDevices({
|
|
|
|
|
// success(res) {
|
|
|
|
|
// console.log('已连接的蓝牙设备信息:', res);
|
|
|
|
|
// xBlufi.notifySendCustomData({
|
|
|
|
|
// customData: "time@" + 0
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// fail(err) {
|
|
|
|
|
// console.error('获取已连接蓝牙设备信息失败:', err);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// // vm.$u.get(`/app/bill/recharge/${vm.billNo}/bluetoothSuccess`).then(res => {
|
|
|
|
|
// // if(res.code == 200){
|
|
|
|
|
// // setTimeout(()=>{
|
|
|
|
|
// // uni.hideLoading()
|
|
|
|
|
// // uni.navigateBack()
|
|
|
|
|
// // },1000)
|
|
|
|
|
// // }
|
|
|
|
|
// // })
|
|
|
|
|
// } else {
|
|
|
|
|
// console.log('手机未连接网络');
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-06-11 18:03:16 +08:00
|
|
|
|
} else if (res.cancel) {
|
2024-08-02 18:00:50 +08:00
|
|
|
|
that.btnmsk = false
|
2024-08-06 18:04:09 +08:00
|
|
|
|
console.log('用户点击了取消')
|
2024-06-11 18:03:16 +08:00
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
2024-06-11 18:03:16 +08:00
|
|
|
|
|
2024-05-13 15:32:48 +08:00
|
|
|
|
} else if (num == 2) { //异常
|
2024-09-02 18:03:58 +08:00
|
|
|
|
this.btnmsk = false
|
2024-03-25 19:46:07 +08:00
|
|
|
|
uni.navigateTo({
|
2024-05-13 15:32:48 +08:00
|
|
|
|
url: '/page_fenbao/statulist/fault/yichang/index'
|
2024-03-25 19:46:07 +08:00
|
|
|
|
})
|
2024-05-13 15:32:48 +08:00
|
|
|
|
} else if (num == 3) {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
this.btnmsk = false
|
2024-03-25 19:46:07 +08:00
|
|
|
|
uni.navigateTo({
|
2024-05-13 15:32:48 +08:00
|
|
|
|
url: "/page_fenbao/statulist/taocanlist/index?id=" + this.id
|
|
|
|
|
})
|
|
|
|
|
} else if (num == 4) { //设置
|
2024-09-02 18:03:58 +08:00
|
|
|
|
this.btnmsk = false
|
2024-05-13 15:32:48 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/page_user/setting?id=' + this.id
|
2024-03-25 19:46:07 +08:00
|
|
|
|
})
|
2024-05-24 16:48:42 +08:00
|
|
|
|
} else if (num == 5) {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
// uni.showLoading({
|
|
|
|
|
// title: '蓝牙连接中...'
|
|
|
|
|
// })
|
2024-08-02 18:00:50 +08:00
|
|
|
|
this.btnmsk = false
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = false
|
|
|
|
|
this.bluetoothflag = true
|
2024-09-11 18:01:14 +08:00
|
|
|
|
console.log(this.deviceId,'idididididdidii');
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (this.setMode == null) {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
xBlufi.initXBlufi(1)
|
2024-08-06 18:04:09 +08:00
|
|
|
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
|
2024-05-24 16:48:42 +08:00
|
|
|
|
xBlufi.notifyStartDiscoverBle({
|
2024-06-05 18:07:50 +08:00
|
|
|
|
'isStart': true
|
|
|
|
|
})
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
// 停止蓝牙搜索
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
xBlufi.notifyStartDiscoverBle({
|
|
|
|
|
'isStart': false
|
2024-07-19 18:07:24 +08:00
|
|
|
|
})
|
2024-06-04 17:50:05 +08:00
|
|
|
|
xBlufi.notifyConnectBle({
|
|
|
|
|
isStart: true,
|
|
|
|
|
deviceId: this.deviceId,
|
|
|
|
|
name: this.name
|
|
|
|
|
})
|
2024-06-05 18:07:50 +08:00
|
|
|
|
xBlufi.notifyInitBleEsp32({
|
|
|
|
|
deviceId: this.deviceId
|
|
|
|
|
})
|
|
|
|
|
let name = ''
|
2024-08-06 18:04:09 +08:00
|
|
|
|
let index = this.name.indexOf('-')
|
2024-06-05 18:07:50 +08:00
|
|
|
|
if (index !== -1) {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
name = this.name.slice(index + 1)
|
2024-06-05 18:07:50 +08:00
|
|
|
|
}
|
|
|
|
|
let data = {
|
|
|
|
|
storeId: this.storeId,
|
|
|
|
|
mac: this.mac
|
|
|
|
|
}
|
|
|
|
|
this.$u.put('/app/device/bind', data).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
uni.hideLoading();
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = false
|
|
|
|
|
this.bluetoothflag = false
|
2024-06-05 18:07:50 +08:00
|
|
|
|
uni.removeStorageSync('mac');
|
2024-08-06 18:04:09 +08:00
|
|
|
|
let systemInfo = uni.getSystemInfoSync()
|
2024-06-05 18:07:50 +08:00
|
|
|
|
if (systemInfo.platform == 'android') {
|
|
|
|
|
// 当前设备是 Android
|
|
|
|
|
uni.navigateTo({
|
2024-09-11 18:01:14 +08:00
|
|
|
|
url: '/page_components/wifilist/index?deviceId=' + this.deviceId + '&name=' + this.name
|
2024-06-05 18:07:50 +08:00
|
|
|
|
})
|
|
|
|
|
} else if (systemInfo.platform == 'ios') {
|
|
|
|
|
// 当前设备是 iOS
|
|
|
|
|
uni.navigateTo({
|
2024-09-11 18:01:14 +08:00
|
|
|
|
url: '/page_fenbao/device/wifivideo?deviceId=' + this.deviceId + '&name=' + this.name
|
2024-06-05 18:07:50 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else if (res.msg == '设备编号和mac不能同时为空') {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = true
|
|
|
|
|
this.bluetoothflag = false
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '连接失败',
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 2000
|
|
|
|
|
// });
|
2024-06-05 18:07:50 +08:00
|
|
|
|
} else {
|
2024-07-16 15:00:10 +08:00
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: res.msg,
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 2000
|
|
|
|
|
// });
|
2024-06-05 18:07:50 +08:00
|
|
|
|
// uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-09-11 18:01:14 +08:00
|
|
|
|
}, 2000)
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
let name = ''
|
2024-08-06 18:04:09 +08:00
|
|
|
|
let index = this.name.indexOf('-')
|
2024-06-05 18:07:50 +08:00
|
|
|
|
if (index !== -1) {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
name = this.name.slice(index + 1)
|
2024-06-05 18:07:50 +08:00
|
|
|
|
}
|
|
|
|
|
let data = {
|
|
|
|
|
storeId: this.storeId,
|
|
|
|
|
mac: this.mac
|
|
|
|
|
}
|
|
|
|
|
this.$u.put('/app/device/bind', data).then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
2024-07-19 18:07:24 +08:00
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '绑定成功',
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 2000
|
|
|
|
|
// })
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = false
|
|
|
|
|
this.bluetoothflag = false
|
2024-06-05 18:07:50 +08:00
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.removeStorageSync('mac');
|
2024-08-06 18:04:09 +08:00
|
|
|
|
let systemInfo = uni.getSystemInfoSync()
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (systemInfo.platform == 'android') {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
// 当前设备是 Android
|
|
|
|
|
uni.navigateTo({
|
2024-09-11 18:01:14 +08:00
|
|
|
|
url: '/page_components/wifilist/index?deviceId=' + this.deviceId +'&name=' + this.name
|
2024-06-05 18:07:50 +08:00
|
|
|
|
})
|
|
|
|
|
} else if (systemInfo.platform == 'ios') {
|
|
|
|
|
// 当前设备是 iOS
|
|
|
|
|
uni.navigateTo({
|
2024-09-11 18:01:14 +08:00
|
|
|
|
url: '/page_fenbao/device/wifivideo?deviceId=' + this.deviceId +'&name=' + this.name
|
2024-06-05 18:07:50 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else {
|
|
|
|
|
if (res.msg == '设备编号和mac不能同时为空') {
|
|
|
|
|
this.shibaiflag = true
|
|
|
|
|
this.bluetoothflag = false
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '连接失败',
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 2000
|
|
|
|
|
// })
|
2024-07-19 18:07:24 +08:00
|
|
|
|
} else {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = true
|
|
|
|
|
this.bluetoothflag = false
|
2024-07-19 18:07:24 +08:00
|
|
|
|
uni.hideLoading()
|
2024-07-09 18:03:16 +08:00
|
|
|
|
uni.showToast({
|
2024-09-02 18:03:58 +08:00
|
|
|
|
title: res.msg,
|
2024-07-09 18:03:16 +08:00
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
2024-07-19 18:07:24 +08:00
|
|
|
|
})
|
|
|
|
|
// uni.navigateBack()
|
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else if (num == 6) {
|
2024-08-02 18:00:50 +08:00
|
|
|
|
this.btnmsk = false
|
2024-06-05 18:07:50 +08:00
|
|
|
|
this.vipflag = true
|
2024-07-16 15:00:10 +08:00
|
|
|
|
this.focus = true
|
2024-03-25 19:46:07 +08:00
|
|
|
|
}
|
2024-05-24 16:48:42 +08:00
|
|
|
|
},
|
2024-09-02 18:03:58 +08:00
|
|
|
|
trueje() {
|
2024-07-18 18:06:40 +08:00
|
|
|
|
if (this.timer) {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
this.timer = null
|
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
let id = this.deviceInfo.deviceId
|
|
|
|
|
this.vipflag = false
|
|
|
|
|
this.$u.put('/app/device/addTime/' + id + '?amount=' + this.cztime).then(res => {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
if (res.code == 200) {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '充值成功',
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
this.getDevice(this.id)
|
|
|
|
|
this.cztime = ''
|
2024-09-02 18:03:58 +08:00
|
|
|
|
} else if (res.code == 500) {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
2024-06-06 14:54:12 +08:00
|
|
|
|
icon: 'none',
|
2024-06-05 18:07:50 +08:00
|
|
|
|
duration: 2000
|
2024-09-02 18:03:58 +08:00
|
|
|
|
})
|
2024-06-06 13:32:16 +08:00
|
|
|
|
// let vm = this; // 将外部的 this 绑定到 vm 上
|
|
|
|
|
// uni.getNetworkType({
|
|
|
|
|
// success(res) {
|
|
|
|
|
// if (res.networkType !== 'none') {
|
|
|
|
|
// uni.getConnectedBluetoothDevices({
|
|
|
|
|
// success(res) {
|
|
|
|
|
// console.log('已连接的蓝牙设备信息:', res);
|
|
|
|
|
// xBlufi.notifySendCustomData({
|
|
|
|
|
// customData: "time@" + vm.setMode + vm.cztime
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// fail(err) {
|
|
|
|
|
// console.error('获取已连接蓝牙设备信息失败:', err);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// // vm.$u.get(`/app/bill/recharge/${vm.billNo}/bluetoothSuccess`).then(res => {
|
|
|
|
|
// // if(res.code == 200){
|
|
|
|
|
// // setTimeout(()=>{
|
|
|
|
|
// // uni.hideLoading()
|
|
|
|
|
// // uni.navigateBack()
|
|
|
|
|
// // },1000)
|
|
|
|
|
// // }
|
|
|
|
|
// // })
|
|
|
|
|
// } else {
|
|
|
|
|
// console.log('手机未连接网络');
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
2024-06-05 18:07:50 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-09-02 18:03:58 +08:00
|
|
|
|
btnqx() {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
this.vipflag = false
|
|
|
|
|
this.cztime = ''
|
|
|
|
|
},
|
|
|
|
|
|
2024-05-24 16:48:42 +08:00
|
|
|
|
|
2024-05-30 17:24:10 +08:00
|
|
|
|
funListenDeviceMsgEvent: function(options) {
|
|
|
|
|
switch (options.type) {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
|
|
|
|
|
let loadPercent = options.data;
|
|
|
|
|
let loadText = '文件读取中'
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// console.log("文件读取中", options.data)
|
2024-06-05 18:07:50 +08:00
|
|
|
|
break;
|
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
|
2024-09-02 18:03:58 +08:00
|
|
|
|
let ver_data = this.parseCustomData(options.data)
|
2024-06-05 18:07:50 +08:00
|
|
|
|
this.setMode = Math.floor(ver_data.setMode / 60)
|
2024-09-02 18:03:58 +08:00
|
|
|
|
console.log("1收到设备发来的自定义数据结果:", ver_data, this.setMode)
|
2024-06-05 18:07:50 +08:00
|
|
|
|
break;
|
2024-05-30 17:24:10 +08:00
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
|
|
|
|
if (options.result) {
|
|
|
|
|
let devicesarr = options.data
|
2024-09-10 18:34:35 +08:00
|
|
|
|
console.log(devicesarr,'devicesarrdevicesarr')
|
2024-05-30 17:24:10 +08:00
|
|
|
|
devicesarr.forEach(device => {
|
2024-07-19 18:07:24 +08:00
|
|
|
|
const mac = device.name.substring(5)
|
2024-08-12 21:49:12 +08:00
|
|
|
|
if (device.name.slice(5, 17) == this.qrResult) {
|
2024-05-30 17:24:10 +08:00
|
|
|
|
this.deviceId = device.deviceId
|
|
|
|
|
this.name = device.name
|
|
|
|
|
this.mac = device.name.slice(5, 17)
|
2024-09-11 18:01:14 +08:00
|
|
|
|
console.log(this.mac,this.deviceId,this.name, 'macmacmac')
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// this.devicesList = uniqueDevicesList
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
2024-06-04 17:50:05 +08:00
|
|
|
|
})
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
2024-08-06 18:04:09 +08:00
|
|
|
|
// console.log("连接回调:" + JSON.stringify(options))
|
2024-05-30 17:24:10 +08:00
|
|
|
|
if (options.result) {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.bluetoothflag = false
|
2024-05-30 17:24:10 +08:00
|
|
|
|
uni.hideLoading();
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '连接成功',
|
|
|
|
|
// icon: 'none'
|
|
|
|
|
// });
|
|
|
|
|
{
|
|
|
|
|
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
2024-08-06 18:04:09 +08:00
|
|
|
|
"连接回调options.data.name:" + options.data.name)
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
} else {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.shibaiflag = true
|
|
|
|
|
this.bluetoothflag = false
|
2024-06-04 17:50:05 +08:00
|
|
|
|
uni.hideLoading()
|
2024-07-19 18:07:24 +08:00
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '设备离线或不在范围内',
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 2000
|
|
|
|
|
// })
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
|
|
|
|
|
if (!options.result) {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
setTimeout(() => {
|
2024-07-19 18:07:24 +08:00
|
|
|
|
uni.hideLoading()
|
2024-07-23 18:00:01 +08:00
|
|
|
|
this.bluetoothflag = false
|
2024-09-02 18:03:58 +08:00
|
|
|
|
}, 3000)
|
2024-08-06 18:04:09 +08:00
|
|
|
|
console.log("蓝牙未开启", options)
|
2024-09-02 18:03:58 +08:00
|
|
|
|
this.shibaiflag = true
|
2024-07-18 18:06:40 +08:00
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: '蓝牙未开启',
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// duration: 3000
|
|
|
|
|
// });
|
2024-07-09 18:03:16 +08:00
|
|
|
|
return
|
2024-05-30 17:24:10 +08:00
|
|
|
|
} else {
|
|
|
|
|
// this.searching = true
|
|
|
|
|
//蓝牙搜索开始
|
|
|
|
|
// _this.setData({
|
|
|
|
|
// searching: true
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
|
|
|
|
|
if (options.result) {
|
2024-08-06 18:04:09 +08:00
|
|
|
|
let uniqueDevicesList = Array.from(new Set(this.devicesList))
|
2024-05-30 17:24:10 +08:00
|
|
|
|
|
|
|
|
|
// 将去重后的数组重新赋值给 this.devicesList
|
2024-08-06 18:04:09 +08:00
|
|
|
|
this.devicesList = uniqueDevicesList
|
2024-05-30 17:24:10 +08:00
|
|
|
|
let list = []
|
2024-09-10 18:34:35 +08:00
|
|
|
|
// 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 {
|
2024-05-30 17:24:10 +08:00
|
|
|
|
|
2024-09-10 18:34:35 +08:00
|
|
|
|
// }
|
|
|
|
|
// })
|
2024-05-30 17:24:10 +08:00
|
|
|
|
|
2024-09-10 18:34:35 +08:00
|
|
|
|
// });
|
2024-05-30 17:24:10 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.devicesList = list
|
|
|
|
|
}, 200)
|
|
|
|
|
|
2024-08-06 18:04:09 +08:00
|
|
|
|
console.log('蓝牙停止搜索ok')
|
2024-05-30 17:24:10 +08:00
|
|
|
|
} else {
|
|
|
|
|
//蓝牙停止搜索失败
|
2024-08-06 18:04:09 +08:00
|
|
|
|
console.log('蓝牙停止搜索失败')
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
|
|
|
|
this.searching = false
|
2024-08-06 18:04:09 +08:00
|
|
|
|
break
|
2024-06-05 18:07:50 +08:00
|
|
|
|
|
2024-05-30 17:24:10 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-08-16 22:23:20 +08:00
|
|
|
|
// parseCustomData(data) {
|
|
|
|
|
// // 将字符串按照 "@" 分割成数组
|
|
|
|
|
// const dataArray = data.split('@')
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-08-16 22:23:20 +08:00
|
|
|
|
// // 根据约定,解析各个字段的值
|
|
|
|
|
// const voltage = parseFloat(dataArray[0].substring(1)) // 去除前缀 "V",并将字符串转换为浮点数
|
|
|
|
|
// const switchState = dataArray[1].substring(1)// 去除前缀 "S"
|
|
|
|
|
// const current = parseFloat(dataArray[2].substring(1)) // 去除前缀 "A",并将字符串转换为浮点数
|
|
|
|
|
// const power = parseFloat(dataArray[4].substring(1)) // 去除前缀 "P",并将字符串转换为浮点数
|
|
|
|
|
// const remainingPower = parseFloat(dataArray[5].substring(1)) // 去除前缀 "M",并将字符串转换为浮点数
|
|
|
|
|
// const setMode = dataArray[6].substring(1) // 去除前缀 "T"
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-08-16 22:23:20 +08:00
|
|
|
|
// // 返回解析后的数据对象
|
|
|
|
|
// return {
|
|
|
|
|
// voltage,
|
|
|
|
|
// switchState,
|
|
|
|
|
// current,
|
|
|
|
|
// power,
|
|
|
|
|
// remainingPower,
|
|
|
|
|
// setMode
|
|
|
|
|
// };
|
|
|
|
|
// },
|
2024-09-02 18:03:58 +08:00
|
|
|
|
parseCustomData(data) {
|
|
|
|
|
// 将字符串按照 "@" 分割成数组
|
|
|
|
|
const dataArray = data.split('@');
|
|
|
|
|
|
|
|
|
|
// 初始化一个空对象来存储解析后的数据
|
|
|
|
|
const parsedData = {};
|
|
|
|
|
|
|
|
|
|
// 前缀到属性名的映射
|
|
|
|
|
const prefixMap = {
|
|
|
|
|
'V': 'voltage',
|
|
|
|
|
'S': 'switchState',
|
|
|
|
|
'A': 'current',
|
|
|
|
|
'P': 'power',
|
|
|
|
|
'M': 'remainingPower',
|
|
|
|
|
'T': 'setMode',
|
|
|
|
|
'W': 'temperature'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 遍历数组并解析每个字段
|
|
|
|
|
for (let i = 0; i < dataArray.length; i++) {
|
|
|
|
|
const field = dataArray[i];
|
|
|
|
|
for (const prefix in prefixMap) {
|
|
|
|
|
if (field.startsWith(prefix)) {
|
|
|
|
|
// 去除前缀并将剩余部分转换为适当的类型(这里默认为浮点数或字符串)
|
|
|
|
|
const value = field.substring(1);
|
|
|
|
|
const propertyName = prefixMap[prefix];
|
|
|
|
|
|
|
|
|
|
// 根据需要,这里可以添加更复杂的类型转换逻辑
|
|
|
|
|
// 但为了简单起见,我们总是尝试将其转换为浮点数,如果失败则保留为字符串
|
|
|
|
|
parsedData[propertyName] = isNaN(parseFloat(value)) ? value : parseFloat(value);
|
|
|
|
|
|
|
|
|
|
// 找到了匹配的前缀,跳出内层循环
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 返回解析后的数据对象
|
|
|
|
|
return parsedData;
|
2024-06-05 18:07:50 +08:00
|
|
|
|
},
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2024-09-02 18:03:58 +08:00
|
|
|
|
/deep/ .panel {
|
|
|
|
|
position: fixed;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
z-index: 99 !important;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.imgewmflag {
|
|
|
|
|
width: 750rpx;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
2024-07-31 18:01:34 +08:00
|
|
|
|
|
2024-09-02 18:03:58 +08:00
|
|
|
|
.imgewm {
|
|
|
|
|
width: 250px;
|
|
|
|
|
height: 250px;
|
2024-07-24 18:02:34 +08:00
|
|
|
|
position: fixed;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
top: 20%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
z-index: 2;
|
2024-07-24 18:02:34 +08:00
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.conts {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 50rpx;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
background-color: #fff;
|
2024-09-05 18:00:53 +08:00
|
|
|
|
|
2024-09-02 18:03:58 +08:00
|
|
|
|
.bot {
|
|
|
|
|
// width: 100%;
|
|
|
|
|
// height: 80rpx;
|
|
|
|
|
// line-height: 80rpx;
|
|
|
|
|
// text-align: center;
|
|
|
|
|
// border-radius: 30rpx;
|
|
|
|
|
// background-color: #fff;
|
|
|
|
|
// margin-top: 30rpx;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bluetoothbox {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: #f4f1f6;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
text-align: center;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.img {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
margin-top: 400rpx;
|
|
|
|
|
width: 320rpx;
|
|
|
|
|
height: 320rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.one {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
color: #000;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.two {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #ccc;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.thr {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #ccc;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.anfour {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 220rpx;
|
|
|
|
|
box-sizing: border-box;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.qx {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
width: 100rpx;
|
|
|
|
|
height: 70rpx;
|
|
|
|
|
line-height: 70rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border: 1px solid #3D3D3D;
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.cx {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
width: 200rpx;
|
|
|
|
|
height: 70rpx;
|
|
|
|
|
line-height: 70rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background-color: #8883F0;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.stop {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
color: #000;
|
|
|
|
|
margin-top: 380rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.xtop {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #ccc;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
.xqx {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
width: 530rpx;
|
|
|
|
|
height: 90rpx;
|
|
|
|
|
line-height: 90rpx;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
margin: auto;
|
|
|
|
|
margin-top: 200rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
|
|
|
|
image {
|
2024-07-23 18:00:01 +08:00
|
|
|
|
width: 500rpx;
|
|
|
|
|
height: 500rpx;
|
|
|
|
|
margin-top: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
/deep/ .u-title {
|
2024-06-03 16:47:25 +08:00
|
|
|
|
padding-bottom: 22rpx;
|
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
|
|
|
|
|
/deep/ .u-icon__icon {
|
2024-06-03 16:47:25 +08:00
|
|
|
|
padding-bottom: 22rpx;
|
|
|
|
|
}
|
2024-06-05 18:07:50 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
page {
|
2024-05-13 15:32:48 +08:00
|
|
|
|
background-color: #F7FAFE;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-07-24 18:02:34 +08:00
|
|
|
|
.maskss {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
width: 750rpx;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background: #000000;
|
|
|
|
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
|
|
|
|
opacity: 0.2;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.tanc {
|
|
|
|
|
width: 610rpx;
|
|
|
|
|
height: 282rpx;
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 628rpx;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
z-index: 2;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.tit {
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-top: 28rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
color: #3D3D3D;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
input {
|
|
|
|
|
width: 504rpx;
|
|
|
|
|
height: 62rpx;
|
|
|
|
|
background: #EEEEEE;
|
|
|
|
|
border-radius: 6rpx 6rpx 6rpx 6rpx;
|
|
|
|
|
margin: auto;
|
|
|
|
|
margin-top: 22rpx;
|
|
|
|
|
padding-left: 20rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.xian {
|
|
|
|
|
width: 610rpx;
|
|
|
|
|
height: 2rpx;
|
|
|
|
|
background: #D8D8D8;
|
|
|
|
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
|
|
|
|
margin-top: 26rpx;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.anniu {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
height: 98rpx;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
text {
|
|
|
|
|
padding: 24rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
color: #3D3D3D;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-13 10:54:22 +08:00
|
|
|
|
|
|
|
|
|
.page {
|
|
|
|
|
.zhuhu {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
margin-top: 60rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
padding: 0 40rpx;
|
|
|
|
|
|
|
|
|
|
.card1 {
|
|
|
|
|
padding: 34rpx 0 0 40rpx;
|
|
|
|
|
width: 670rpx;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
height: 320rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
box-shadow: 0rpx 14rpx 35rpx 0rpx rgba(53, 140, 255, 0.1);
|
|
|
|
|
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
|
|
|
|
|
|
|
|
|
.top {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
font-size: 35rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #8883F0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
margin-right: 56rpx;
|
|
|
|
|
|
|
|
|
|
.img1 {
|
|
|
|
|
width: 76rpx;
|
|
|
|
|
height: 76rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mid {
|
2024-05-10 17:37:36 +08:00
|
|
|
|
margin-top: 20rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
align-content: flex-start;
|
|
|
|
|
|
|
|
|
|
.mid_left {
|
|
|
|
|
image {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
width: 160rpx;
|
2024-05-10 17:37:36 +08:00
|
|
|
|
height: 160rpx;
|
2024-05-24 16:48:42 +08:00
|
|
|
|
border-radius: 20rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mid_right {
|
2024-09-02 18:03:58 +08:00
|
|
|
|
margin-left: 20rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
.mid_top {
|
|
|
|
|
width: 100%;
|
|
|
|
|
font-size: 42rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mid_bot {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
align-items: center;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
margin-top: 6rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
|
|
|
|
|
.txt {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
font-size: 26rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #95989D;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tip {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin-left: 19rpx;
|
2024-08-06 18:04:09 +08:00
|
|
|
|
|
2024-06-12 18:02:28 +08:00
|
|
|
|
padding: 0 10rpx;
|
2024-05-25 18:05:40 +08:00
|
|
|
|
box-sizing: border-box;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
background: rgba(204, 204, 204, 0);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
border: 2rpx solid #8883F0;
|
2024-06-12 18:02:28 +08:00
|
|
|
|
border-radius: 15rpx;
|
2024-06-05 18:07:50 +08:00
|
|
|
|
font-size: 26rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #8883F0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bot {
|
2024-08-05 18:00:54 +08:00
|
|
|
|
margin-top: 20rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.bot_left {
|
|
|
|
|
width: 210rpx;
|
2024-05-11 13:33:17 +08:00
|
|
|
|
height: 180rpx;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
margin-right: 34rpx;
|
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.echarts {
|
2024-05-11 13:33:17 +08:00
|
|
|
|
height: 200rpx;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-05-10 21:35:42 +08:00
|
|
|
|
.uni-ec-canvas {
|
|
|
|
|
width: 100%;
|
2024-05-11 13:33:17 +08:00
|
|
|
|
height: 100rpx !important;
|
2024-05-10 21:35:42 +08:00
|
|
|
|
display: block;
|
|
|
|
|
}
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bot_right {
|
|
|
|
|
display: flex;
|
2024-05-30 17:24:10 +08:00
|
|
|
|
width: 100%;
|
2024-05-25 18:05:40 +08:00
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding-left: 80rpx;
|
2024-06-18 13:43:37 +08:00
|
|
|
|
padding-right: 80rpx;
|
2024-05-25 18:05:40 +08:00
|
|
|
|
box-sizing: border-box;
|
2024-05-30 17:24:10 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.cont {
|
|
|
|
|
.tit {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
line-height: 49rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.txt {
|
2024-06-05 18:07:50 +08:00
|
|
|
|
font-size: 26rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.bot_right {
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100%;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding-left: 80rpx;
|
2024-06-18 13:43:37 +08:00
|
|
|
|
padding-right: 80rpx;
|
2024-06-05 18:07:50 +08:00
|
|
|
|
box-sizing: border-box;
|
2024-09-02 18:03:58 +08:00
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.cont {
|
|
|
|
|
.tit {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
line-height: 49rpx;
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
}
|
2024-09-02 18:03:58 +08:00
|
|
|
|
|
2024-06-05 18:07:50 +08:00
|
|
|
|
.txt {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-13 10:54:22 +08:00
|
|
|
|
|
|
|
|
|
.card2 {
|
|
|
|
|
padding-top: 40rpx;
|
|
|
|
|
margin-top: 24rpx;
|
|
|
|
|
width: 670rpx;
|
|
|
|
|
height: 254rpx;
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(53, 140, 255, 0.1);
|
|
|
|
|
border-radius: 28rpx;
|
|
|
|
|
|
|
|
|
|
.tit {
|
|
|
|
|
margin-left: 40rpx;
|
|
|
|
|
|
|
|
|
|
font-size: 35rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #8883F0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.cont_box {
|
|
|
|
|
margin-top: 32rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
justify-content: space-around;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
|
|
|
|
|
.cont {
|
2024-05-10 17:37:36 +08:00
|
|
|
|
width: 25%;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
text-align: center;
|
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.top {
|
2024-07-16 15:00:10 +08:00
|
|
|
|
width: 100%;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bot {
|
|
|
|
|
margin-top: 20rpx;
|
2024-06-05 18:07:50 +08:00
|
|
|
|
font-size: 26rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #262B37;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card3 {
|
|
|
|
|
padding-top: 40rpx;
|
|
|
|
|
margin-top: 24rpx;
|
|
|
|
|
width: 670rpx;
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(53, 140, 255, 0.1);
|
|
|
|
|
border-radius: 28rpx;
|
|
|
|
|
padding-bottom: 20rpx;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.tit {
|
|
|
|
|
margin-left: 40rpx;
|
|
|
|
|
|
|
|
|
|
font-size: 35rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #8883F0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.cont_box {
|
2024-05-10 17:37:36 +08:00
|
|
|
|
padding: 0 40rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
margin-top: 32rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: nowrap;
|
2024-05-10 17:37:36 +08:00
|
|
|
|
justify-content: space-around;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
|
|
|
|
.cont:last-child {
|
2024-03-13 10:54:22 +08:00
|
|
|
|
margin-right: 0rpx;
|
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.cont {
|
2024-07-16 15:00:10 +08:00
|
|
|
|
width: 25%;
|
|
|
|
|
text-align: center;
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
.top {
|
|
|
|
|
image {
|
|
|
|
|
width: 56rpx;
|
|
|
|
|
height: 56rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bot {
|
2024-07-31 18:01:34 +08:00
|
|
|
|
margin-top: 8rpx;
|
2024-03-13 10:54:22 +08:00
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #808080;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.button {
|
|
|
|
|
margin-left: 76rpx;
|
|
|
|
|
margin-top: 178rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 520rpx;
|
|
|
|
|
height: 104rpx;
|
|
|
|
|
background: #8883F0;
|
|
|
|
|
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
|
|
|
|
|
border-radius: 52rpx 52rpx 52rpx 52rpx;
|
|
|
|
|
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-13 15:32:48 +08:00
|
|
|
|
|
|
|
|
|
|
2024-03-13 10:54:22 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|