246 Commits 0f4a6006c0 ... 3a459adf1c

Auteur SHA1 Message Date
  332777428@qq.com 3a459adf1c feat: 添加特殊指定图片 il y a 1 mois
  332777428@qq.com 0a62f89d53 feat: 对WIFI配网支持双频WIFI设备指示图判断 il y a 1 mois
  332777428@qq.com a4a1728f7c feat: 处理设备是否支持5g信号处理 il y a 1 mois
  332777428@qq.com e7526e4978 feat: 图片展示不出来修复 il y a 2 mois
  332777428@qq.com 7bdb30f873 feat: 路由切换修复 il y a 2 mois
  332777428@qq.com 07e33df377 feat: 路由切换 il y a 2 mois
  zeng.chen 49deb01d99 fix:统一设置密码的保存 il y a 2 mois
  zeng.chen 5af63f8615 fix:修改黑胶的设置密码的问题 il y a 2 mois
  zeng.chen fdedee0edd fix:修改密码框的文案 il y a 2 mois
  zeng.chen 15f9844a93 fix:修改IOS的用明文输入框 il y a 2 mois
  zeng.chen 9a4aeb4374 fix:增加wifi设备下线的通知 il y a 2 mois
  zeng.chen 25ee7160fc fix:修改蓝牙设备下线的空值错误问题 il y a 2 mois
  zeng.chen 911c54369e fix:优化蓝牙设备上线的判断 il y a 2 mois
  zeng.chen b597778486 fix:增加wifi设备在线的蓝牙设备的在线判断 il y a 2 mois
  zeng.chen ab0612e0a5 fix:判断蓝牙设备的在线问题 il y a 2 mois
  332777428@qq.com 31ac10d675 feat: 处理【Android】连接设备页面图片被拉长的问题 il y a 2 mois
  332777428@qq.com c1004447f8 feat: 处理上传壁纸页面返回导航栏不显示的问题 il y a 2 mois
  zeng.chen 661ae65fdd fix:修改黑胶连接成功的更新列表方法 il y a 2 mois
  zeng.chen 0f0e8782f2 fix:修改黑胶连接成功的更新列表方法 il y a 2 mois
  332777428@qq.com 48994a5d8e feature: 添加分享和复制当前页面点击进入 il y a 2 mois
  zeng.chen 8a1b683cb2 fix:修改黑胶音箱的重连问题 il y a 2 mois
  332777428@qq.com 4a9ba044d7 feature: 处理ios输入框,自动填充密码,获取不到值的问题 il y a 2 mois
  332777428@qq.com a43c257b5e feature: 对君正设备兼容设备特殊处理 il y a 2 mois
  332777428@qq.com ce979d8e75 feature: 处理搜索配网退出界面停止搜索 il y a 2 mois
  332777428@qq.com 5d60eded5b feature: 处理君正方案ios数据不全的问题优化 il y a 2 mois
  332777428@qq.com d9d56942fb feature: 处理君正方案ios数据不全的问题 il y a 2 mois
  zeng.chen eddd1ae6c5 fix:修改IOS搜索,第一次没有localName的问题 il y a 2 mois
  332777428@qq.com a69bbdd18d feature: 处理我的页面,点击头像,未进入登录页面的问题 il y a 2 mois
  332777428@qq.com d64294b24f feature: 处理猫王妙播用户协议和猫王妙播隐私协议入口不明显,颜色区分的问题 il y a 2 mois
  332777428@qq.com 9783a8dd36 feature: 处理我的页面点击关于我们无反应的问题 il y a 2 mois
  332777428@qq.com 2fc3abd70b feature: 调整内链和外链跳转的域名权限问题 il y a 3 mois
  332777428@qq.com a4c7806cf6 feature: 跳转内链和跳转外链区分 il y a 3 mois
  332777428@qq.com f648d0681e feature: 解决登录界面猫王用户协议和用户协议字体区分 il y a 3 mois
  332777428@qq.com b9dc29cadd feature: 屏蔽外链链接处理 il y a 3 mois
  332777428@qq.com bb1d62d0ef feature: 解决修改进入微信小程序入口,无法找到对应的网页的问题 il y a 3 mois
  332777428@qq.com 3ee708d040 feature: 处理登录之后,还可以继续登录的问题 il y a 3 mois
  332777428@qq.com 9c1467ae3c feature: 解决测试环境体验版本打不开,打开无法找到网页的问题 il y a 3 mois
  332777428@qq.com 2c754aed67 feature: 解决测试环境体验版本打不开,打开无法找到网页的问题 il y a 3 mois
  332777428@qq.com 6d865ce27b feature: 删除重复注销mqtt clinet数据 il y a 3 mois
  332777428@qq.com 1915553f0d feature: 对设备2AXD设备进行适配配网,相关指令调整 il y a 3 mois
  332777428@qq.com 6a403db716 feature: 对添加设备未登录,和直接登录方式不一样处理 il y a 3 mois
  332777428@qq.com 44c7f27b6a feature: 调整测试环境 il y a 3 mois
  332777428@qq.com 09837d7126 feature: 君正系统设备连接成功后,断开连接,连接mqtt处理 il y a 3 mois
  332777428@qq.com 51a74000d8 feature: 对蓝牙连接,授权,请求权限方法类合并 il y a 3 mois
  332777428@qq.com c0ea2b063e feature: 对连接第一个界面方法类合并 il y a 3 mois
  332777428@qq.com f0146cb1b5 feature: 对蓝牙、wifi、4G连接界面方法类合并 il y a 3 mois
  332777428@qq.com fa4a2ee838 feature: 对君正方案预留处理方式 il y a 3 mois
  332777428@qq.com 776ab44397 feature: 处理wifi连接不成功返回当前界面处理 il y a 3 mois
  332777428@qq.com 11fc6e432c feature: 删除无用文件,减小包体量 il y a 3 mois
  332777428@qq.com 1cd6a1857c feature: 删除打印 il y a 3 mois
  332777428@qq.com 3e637ab43d feature: 删除没有用到的图片 il y a 3 mois
  332777428@qq.com 9298042de4 feature: 更新新添加的数据 il y a 3 mois
  332777428@qq.com f0743e1172 feature: 调整设备连接状态的更新 il y a 3 mois
  332777428@qq.com fc7472fdbd feature: 增加丢失文件 il y a 3 mois
  332777428@qq.com eee142f150 feature: 记录主包大小 il y a 3 mois
  332777428@qq.com 49f1e867f5 feature: 主界面多方法类合体 il y a 3 mois
  332777428@qq.com 2f3f5ebc07 feature: 合并方法类到contants il y a 3 mois
  332777428@qq.com 7d93e85b7b feature: 删除无用代码 il y a 4 mois
  332777428@qq.com aacfbf814c feature: 增加定位权限json内申明权限 il y a 4 mois
  332777428@qq.com 7de3bc4d66 feature: 增加定位权限json内申明权限 il y a 4 mois
  332777428@qq.com 8f55f0f77e feature: 加入设备vip购买订单记录分包 il y a 4 mois
  332777428@qq.com ff87ebdb70 feature: 加入设备vip支付购买详情分包 il y a 4 mois
  332777428@qq.com ec72f77d10 feature: 加入设备vip充值详情分包 il y a 4 mois
  332777428@qq.com af4649e942 feature: 加入设备设置ota数据分包 il y a 4 mois
  332777428@qq.com a2b098ef2f feature: 加入设备频道详细数据分包 il y a 4 mois
  332777428@qq.com 33330b8386 feature: 加入设备wifi、4G、蓝牙连接分包 il y a 4 mois
  332777428@qq.com dbabaa08b1 feature: 加入设备唤醒音设置分包 il y a 4 mois
  332777428@qq.com 2881a692b0 feature: 加入设备模定时设置分包 il y a 4 mois
  332777428@qq.com b915fe6d81 feature: 加入设备模式wifi、蓝牙、4G选择分包 il y a 4 mois
  332777428@qq.com 3214061ac8 feature: 对首页banner做优先缓存展示处理 il y a 4 mois
  332777428@qq.com 0760d52702 feature: 对唤醒重复设置进行分包 il y a 4 mois
  332777428@qq.com e7a3f23589 feature: 对ota固件升级进行分包 il y a 4 mois
  332777428@qq.com a10ecfee44 feature: 对download下载进行分包 il y a 4 mois
  332777428@qq.com 2a6e2ada2e feature: 对隐私协议和用户协议进行分包 il y a 4 mois
  332777428@qq.com a7947fcb34 feature: 增加关于我们的分包处理 il y a 4 mois
  332777428@qq.com 56a52d54ec feature: 增加点击头像进行登录,增大整条实现更多反馈和关于我们的点击范围 il y a 4 mois
  332777428@qq.com b4b2f2c572 feature: 处理登录被选中和不选中图标和位置不对称和不明显的问题 il y a 4 mois
  332777428@qq.com 33bba1287e feature: 处理设备详情和weview分包 il y a 4 mois
  332777428@qq.com 409070e765 feature: 解决报错问题 il y a 4 mois
  332777428@qq.com e56b90a0d8 feature: 对设备裁剪详情分包处理 il y a 4 mois
  332777428@qq.com dcfe46c8b8 feature: 对壁纸裁剪和壁纸测试分包处理 il y a 4 mois
  332777428@qq.com 4a08a7ee34 feature: 处理君正和乐鑫方案wifi和4G连接跳转方式 il y a 4 mois
  332777428@qq.com d689a0bf21 feature: 删除无用代码处理 il y a 4 mois
  332777428@qq.com 9463dba3bd feature: 删除无用代码处理 il y a 4 mois
  332777428@qq.com 488c4354fd feature: 统一带参跳转处理 il y a 4 mois
  332777428@qq.com 9a355df942 feature: 各类统一类index、json等名称类名 il y a 4 mois
  332777428@qq.com 9ef76f7754 feature: 构建pageB类,加入连接流程 il y a 4 mois
  332777428@qq.com 42606bd19f feature: 删除无用类,处理分包pageA il y a 4 mois
  332777428@qq.com f75e0af9f8 feature: 分饱pageA,退出登录,对当前wifi设备进行退出连接处理 il y a 4 mois
  332777428@qq.com a72380c25d feature: 解决部份界面报警告的问题 il y a 4 mois
  332777428@qq.com 85f36376d9 feature: 解决丢失部份图片的问题 il y a 4 mois
  332777428@qq.com 488ddffff9 feature: 解决路由方法名称报错的问题 il y a 4 mois
  332777428@qq.com 1b25807023 feature: 调整界面参数数据 il y a 4 mois
  332777428@qq.com 91f5e7447b feature: 解决路由跳转indexRoot不统一的问题 il y a 4 mois
  332777428@qq.com f8b011a760 feature: 解决名称不对称问题 il y a 4 mois
  332777428@qq.com 4218776df7 feature: 对数据报错异常修复处理 il y a 4 mois
  332777428@qq.com df47db93b2 feature: 对数据转换类修改名称 il y a 4 mois
  332777428@qq.com a289c3d7a9 feature: 对页get、post等方法类修改名称 il y a 4 mois
  332777428@qq.com 0c09ba2e96 feature: 对页api请求方法类修改名称 il y a 4 mois
  332777428@qq.com 5fb24d4dcc feature: 对页时文字弹窗类修改名称 il y a 4 mois
  332777428@qq.com 41f05624cc feature: 对页时间获取当前时间类修改名称 il y a 4 mois
  332777428@qq.com 37fa87fbc8 feature: 对页eventbus消息通知类修改名称 il y a 4 mois
  332777428@qq.com 5d0d2f7df0 feature: 对页16进制与10进制切换方法类修改名称 il y a 4 mois
  332777428@qq.com 29ad48329a feature: 对页权限申请方法类修改名称 il y a 4 mois
  332777428@qq.com 3959e70887 feature: 对页面路由路径方法类修改名称 il y a 4 mois
  332777428@qq.com 2c20dda364 feature: 添加页面路由路径 il y a 4 mois
  332777428@qq.com 5116a30d36 feature: 修改页面路径合集名称 il y a 4 mois
  332777428@qq.com 42c4436dd0 feature: 处理插件文件的迁移 il y a 4 mois
  332777428@qq.com aee2028d26 feature: 注释相关代码待定项目内容 il y a 4 mois
  332777428@qq.com 7f514fe962 feature: 添加支付功能 il y a 4 mois
  332777428@qq.com 586bbf6985 feature: 增加vip开通详情界面 il y a 4 mois
  332777428@qq.com 1d52ac605b feature: 增加vip开通记录界面 il y a 4 mois
  332777428@qq.com 0c30104a29 feature: 处理内容会员充值界面的UI il y a 4 mois
  332777428@qq.com 5a2e5c95b9 feature: 添加内容会员充值界面 il y a 4 mois
  332777428@qq.com d80e5c35b7 feature: 添加充值内容会员跳转按钮 il y a 4 mois
  332777428@qq.com 850d4aecfb feature: 修复报错问题 il y a 4 mois
  332777428@qq.com d0bb8dd2aa feature: 删除无效打印 il y a 4 mois
  332777428@qq.com 2dd9a1e867 feature: 首页Banner缓存处理 il y a 4 mois
  332777428@qq.com b4b8ee38d5 feature: 君正方案与乐鑫方案跳转处理 il y a 4 mois
  332777428@qq.com d4af57a5a6 feature: 2AXD搜索与配网成功 il y a 4 mois
  332777428@qq.com 17ea842d1c feature: 2AXD搜索处理 il y a 4 mois
  332777428@qq.com caac19d4a9 feature: 增加2AXD的适配 il y a 4 mois
  332777428@qq.com 3421032c66 feature: 测试环境,增加2AXD设备 il y a 4 mois
  zeng.chen b63ec7de0d fix:小程序增加黑胶的断线判断 il y a 4 mois
  zeng.chen 71ce9979d2 fix:fix:修改空壁纸的toast提示 il y a 4 mois
  zeng.chen 0a0290e645 fix:修改空壁纸的toast提示 il y a 4 mois
  332777428@qq.com 4b9696007c feature: 切换正式环境 il y a 4 mois
  zeng.chen fb99644221 fix:fix:修改小程序黑胶的空密码的输入问题 il y a 5 mois
  zeng.chen 4fdf86f940 fix:增加小程序点击切换设备,不用弹掉线框 il y a 5 mois
  zeng.chen b194b82c29 fix:修改小程序空密码的输入问题 il y a 5 mois
  zeng.chen 03033df69b fix:小程序增加mtu设置 il y a 5 mois
  332777428@qq.com 8af437c2ec Merge branch 'develop/3.2.7' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.7 il y a 5 mois
  332777428@qq.com d7ccd06a69 feature: 处理君正方案隐蔽 il y a 5 mois
  zeng.chen 50e8d6288c Merge branch 'develop/3.2.7' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.7 il y a 5 mois
  zeng.chen cce113d55f fix:修改小程序的黑胶,wifi配网可以输入空密码 il y a 5 mois
  332777428@qq.com 4920f52b1b feature: WiFi连接X2和蓝牙连接并选中黑胶音箱时,其他手机WiFi连接X2后,当前小程序X2设备会自选中 il y a 5 mois
  332777428@qq.com a80ff2ea26 Merge branch 'develop/3.2.7' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.7 il y a 5 mois
  332777428@qq.com c34e877019 feature: WiFi连接X2和蓝牙连接并选中黑胶音箱时,其他手机WiFi连接X2后,当前小程序X2设备会自选中 il y a 5 mois
  zeng.chen 98d0a08a0d fix:修改小程序的banner的ui il y a 5 mois
  zeng.chen e6972d5a1b fix:去掉小程序的测试数据 il y a 5 mois
  zeng.chen 267b72317d fix:修改蓝牙第一次弹框掉线的问题 il y a 5 mois
  zeng.chen 7f93c487f0 fix:修改小程序定位权限提示问题 il y a 5 mois
  zeng.chen aedccd2ee8 fix:修改小程序首页的黑胶下线问题 il y a 5 mois
  zeng.chen e248257b6c feature:合并小程序3.2.5的代码到3.2.7 il y a 5 mois
  332777428@qq.com 31427206a9 feature: 增加配网过程中图片的传递展示 il y a 5 mois
  332777428@qq.com a73d2ac040 feature: 处理读写数据处理先后顺序 il y a 5 mois
  332777428@qq.com bf66c65ad1 feature: 接收wifi数据处理失败try出去 il y a 5 mois
  332777428@qq.com 8fb35fe2a5 feature: 打印数据保存报错问题记录 il y a 5 mois
  332777428@qq.com 51a7a5c662 feature: 适配乐鑫和君正wifi配网mqtt处理 il y a 5 mois
  332777428@qq.com 0977141302 feature: 处理mqtt数据,有线离线,连接,接收消息处理 il y a 5 mois
  332777428@qq.com c3c9508413 feature: 只差数据接收处理 il y a 5 mois
  332777428@qq.com 6e1c624620 feature: 实现mqtt,MW-X4(BZK)设备 il y a 5 mois
  332777428@qq.com 8847d68244 feature: 配网成功后数据处理 il y a 5 mois
  332777428@qq.com fb3055cea8 feature: 数据处理 il y a 5 mois
  332777428@qq.com c71effecd4 feature: 添加测试数据部份数据 il y a 5 mois
  332777428@qq.com 916e7c18f6 feature: 处理君正连接状态下,数据交互问题 il y a 5 mois
  332777428@qq.com a57e97acb6 feature: 综合处理特征值数据 il y a 5 mois
  332777428@qq.com 8242e04c50 feature: 处理君正方案音响的特征值 il y a 5 mois
  332777428@qq.com 57e5cdf1a3 feature: 数据分析解析处理 il y a 5 mois
  332777428@qq.com d6a5aa11d6 feature: 构建君正M4设备连接处理 il y a 5 mois
  332777428@qq.com 0ff754b44e feature: 君正数据配对方案处理 il y a 5 mois
  332777428@qq.com c67e2b453d Merge branch 'develop/3.2.7' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.7 il y a 5 mois
  332777428@qq.com 99a9f805b0 feature: 添加失去的数据 il y a 5 mois
  332777428@qq.com 65849a3fea feature: 解决设备君正连接报错问题 il y a 5 mois
  332777428@qq.com d6097b7d37 feature: 加入君正ble连接方案 il y a 5 mois
  332777428@qq.com 9679a232fa feature: 加入配置君正配网条件模式 il y a 5 mois
  332777428@qq.com 37a1e9be03 feature: 构建君正配网界面 il y a 5 mois
  332777428@qq.com 7f3cd46646 feature: 添加M4设备相关数据适配 il y a 5 mois
  332777428@qq.com 6916235c76 feature: 组合设备mac地址数据 il y a 5 mois
  zeng.chen dc72a9e08e feature:修改黑胶设备的掉线监听问题 il y a 5 mois
  zeng.chen 3ee36fc7fb Revert "feature:修改黑胶设备的掉线监听问题" il y a 5 mois
  zeng.chen 73cba7f7b9 feature:修改黑胶设备的掉线监听问题 il y a 5 mois
  zeng.chen 4e517b8ebd feature:修改小程序的IOS获取wifi名称问题 il y a 6 mois
  332777428@qq.com 82bb166ad5 feature: 更新正式环境 il y a 6 mois
  zeng.chen 1414b15c34 feature:修改上传服务器图片的问题 il y a 6 mois
  zeng.chen 585a47be1e feature:修改IOS裁剪上传图片的问题 il y a 6 mois
  zeng.chen 16aa2529b4 feature:修改多个设备的上下线,切换问题 il y a 6 mois
  zeng.chen be9e7fcc9e feature:增加空密码的输入 il y a 6 mois
  zeng.chen 03fa05a7ea feature:修改连接的报错 il y a 6 mois
  zeng.chen 557391987b feature:修改多个设备的切换问题 il y a 6 mois
  zeng.chen c0e9c907de feature:增加设备的mac地址 il y a 6 mois
  zeng.chen 487bc36cd5 feature:修改多个设备的掉线问题,去掉日志 il y a 6 mois
  zeng.chen 0b99331ddc feature:修改掉线的监控问题 il y a 6 mois
  zeng.chen 65afd23d24 feature:修改壁纸的替换,排序问题 il y a 6 mois
  332777428@qq.com f511494921 feature: 删除无效打印 il y a 6 mois
  332777428@qq.com d803ce7026 Merge branch 'develop/3.2.4_黑胶' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.4_黑胶 il y a 6 mois
  332777428@qq.com fa4202d8f8 feature: 去掉无效打印 il y a 6 mois
  zeng.chen 5870c80e5d feature:修改多次弹框的问题 il y a 6 mois
  zeng.chen 6379f1c80d feature:修改循环遍历上线的问题 il y a 6 mois
  332777428@qq.com 5b45dee398 feature: 解决多个设备蓝牙切换效果不明显的问题 il y a 6 mois
  332777428@qq.com 98fd3824f9 feature: 解决多个设备蓝牙切换效果不明显的问题 il y a 6 mois
  zeng.chen 1f8a894433 feature:修改设备掉线的问题,增加版本号 il y a 6 mois
  zeng.chen 1ccd31c70e feature:修改壁纸列表的保存,显示问题 il y a 6 mois
  332777428@qq.com d946d808b2 feature: 解决多个设备都在线进行切换数据处理 il y a 6 mois
  332777428@qq.com 59c74f5388 feature: 解决蓝牙,多个离线不能删除的问题 il y a 6 mois
  zeng.chen b087fb8a53 feature:增加裁剪壁纸的保存 il y a 6 mois
  zeng.chen 68976a098b feature:修改蓝牙设备的掉线监听问题 il y a 6 mois
  zeng.chen cbc64115ac feature:增加wifi界面的图片 il y a 6 mois
  zeng.chen ac5a7a2baa feature:修改蓝牙设备的掉线监听 il y a 6 mois
  zeng.chen 99b9d7c097 feature:修改OTA界面的升级流程 il y a 6 mois
  zeng.chen ad899fccdb feature:修改裁剪界面的返回壁纸的流程 il y a 6 mois
  zeng.chen ddef055d35 feature:修改wifi界面的UI il y a 6 mois
  332777428@qq.com 0208422b81 feature: 统一调用类方式 il y a 6 mois
  332777428@qq.com 4640b2df61 feature: 添加权限类 il y a 6 mois
  332777428@qq.com a591071185 feature: 加入蓝牙适配器拒绝后权限处理 il y a 6 mois
  332777428@qq.com bf14fb7923 Merge branch 'develop/3.2.4_黑胶' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.4_黑胶 il y a 6 mois
  332777428@qq.com 0150f11d8e feature: 数据储存 il y a 6 mois
  zeng.chen 31ba09974d feature:增加蓝牙设备的下线监听 il y a 6 mois
  zeng.chen 4a9e3c55ff feature:修改壁纸页空白的问题 il y a 6 mois
  zeng.chen 96f3772e0d feature:修改壁纸裁剪的MD5读取方法 il y a 6 mois
  zeng.chen 2a3bf338fe feature:修改上传壁纸的报错问题 il y a 6 mois
  zeng.chen 0ccffb448d feature:修改壁纸列表的选择方法 il y a 6 mois
  zeng.chen 3d0f21fe1b feature:增加c语言的md5计算方法 il y a 6 mois
  zeng.chen 8c1e3edde2 feature:修改wifi的输入信息的报错问题 il y a 6 mois
  zeng.chen eb460247fc feature:更新壁纸的md5流程 il y a 6 mois
  zeng.chen 3ab93fb5ae feature:更新壁纸的流程 il y a 6 mois
  zeng.chen d682e8b9c0 feature:修改wifi的0x75指令问题 il y a 6 mois
  zeng.chen 30eb74f220 feature:修改wifi的解析指令问题 il y a 6 mois
  zeng.chen 7cfb97a7b3 feature:优化最终的wifi连接流程 il y a 6 mois
  zeng.chen fff04803ef feature:优化wifi连接流程 il y a 6 mois
  zeng.chen 36b15344ce feature:修改首页自动连接流程 il y a 6 mois
  zeng.chen 24ec1eb07a feature:增加设置wifi的demo功能 il y a 6 mois
  332777428@qq.com 33f35fc1b6 Merge remote-tracking branch 'origin/develop/3.2.4_黑胶' into develop/3.2.4_黑胶 il y a 6 mois
  332777428@qq.com cef6d37f2f Merge branch 'develop/3.2.5' into develop/3.2.4_黑胶 il y a 6 mois
  332777428@qq.com a4014658ed Merge remote-tracking branch 'origin/master' into develop/3.2.5 il y a 6 mois
  zeng.chen a6b9428588 feature:修改壁纸延迟30ms传一次 il y a 6 mois
  zeng.chen 3b710280a7 Merge branch 'develop/3.2.5' into develop/3.2.4_黑胶 il y a 6 mois
  zeng.chen f0c310f258 Merge branch 'develop/3.2.4' into develop/3.2.4_黑胶 il y a 6 mois
  zeng.chen 7d0a392487 feature:新增OTA的wifi界面 il y a 6 mois
  zeng.chen fa7d4d46ed feature:新增OTA的wifi界面,修改OTA的URL指令 il y a 6 mois
  Damon 635e6884ec feature: 调整首页UI il y a 6 mois
  Damon 50e86a7f9c feature: 适配ios15和华为的banner il y a 6 mois
  Damon b4df60a19c Merge remote-tracking branch 'origin/master' into develop/3.2.5 il y a 6 mois
  zeng.chen 7dd9056a65 feature:修改校验指令的解析 il y a 6 mois
  zeng.chen 4fd9211ff7 feature:增加黑胶的wifi解析指令功能 il y a 7 mois
  zeng.chen 0c1528f1bb feature:增加黑胶的wifi逻辑 il y a 7 mois
  Damon 681e0bca70 feature: 处理报错的问题 il y a 7 mois
  Damon e599c912c2 feature: 解决解决连接之后会有一段时间显示离线,先添加进去就不会了的问题 il y a 7 mois
  Damon 13e638dad1 feature: 解决数据处理报错的问题 il y a 7 mois
  Damon fbd05830aa feature: 对设备连接接收的数据进行buffer字节处理 il y a 7 mois
  Damon de904b1e8a feature: 代码优化与数据处理 il y a 7 mois
  Damon 7215c8a611 feature: 发送数据和接受数据处理 il y a 7 mois
  Damon 49003a7b19 feature: 蓝牙数据发送监听和接收数据监听处理 il y a 7 mois
  Damon 095b2bd0ae feature: 删除无用类 il y a 7 mois
  Damon 3f3c84f413 feature: 加入蓝牙ble新方法 il y a 7 mois
  zeng.chen 67b26a7eb9 feature:修改黑胶壁纸上传jpg图片 il y a 7 mois
100 fichiers modifiés avec 2009 ajouts et 13634 suppressions
  1. 14 1
      app.js
  2. 53 20
      app.json
  3. 0 133
      common/main.js
  4. 0 17
      common/main.wxss
  5. 0 158
      common/runtime.js
  6. 0 11312
      common/vendor.js
  7. 82 5
      pages/components/image-cropper/image-cropper.js
  8. 0 0
      components/image-cropper/image-cropper.json
  9. 0 0
      components/image-cropper/image-cropper.wxml
  10. 0 0
      components/image-cropper/image-cropper.wxss
  11. 1 5
      pages/components/navbar/navbar.js
  12. 0 0
      components/navbar/navbar.json
  13. 8 0
      components/navbar/navbar.wxml
  14. 0 0
      components/navbar/navbar.wxss
  15. 0 0
      components/toast/toast.js
  16. 0 0
      components/toast/toast.json
  17. 0 0
      components/toast/toast.wxml
  18. 0 0
      components/toast/toast.wxss
  19. 217 109
      devices/ble_manager.js
  20. 105 51
      devices/bluetooth/bt_cmd.js
  21. 573 511
      devices/bluetooth/bt_parse.js
  22. 33 24
      devices/bt_helper.js
  23. 41 1
      devices/cmd_key_event.js
  24. BIN
      images/common/item_wifi.png
  25. BIN
      images/common/lock.png
  26. BIN
      images/common/wifi.png
  27. BIN
      images/common/wifi_icon.png
  28. BIN
      images/device/mode_bg.png
  29. BIN
      img/BG@2x.png
  30. BIN
      img/e1.png
  31. BIN
      img/g0.png
  32. BIN
      img/g1.png
  33. BIN
      img/jj.png
  34. BIN
      img/jx.png
  35. BIN
      img/login_agree_nor.png
  36. BIN
      img/login_agree_sel.png
  37. BIN
      img/min.png
  38. BIN
      img/nz.png
  39. BIN
      img/sj.png
  40. BIN
      img/sx.png
  41. BIN
      img/u.png
  42. BIN
      img/v.png
  43. BIN
      img/x.png
  44. BIN
      img/yy.png
  45. 0 73
      pages/about/about.js
  46. 0 5
      pages/about/about.json
  47. 0 5
      pages/aboutInfo/aboutInfo.json
  48. 0 5
      pages/channelDetails/channelDetails.json
  49. 0 8
      pages/components/navbar/navbar.wxml
  50. 0 5
      pages/connectBle/connectBle.json
  51. 0 4
      pages/deviceConMode/index.json
  52. 0 5
      pages/deviceConnect0/deviceConnect0.json
  53. 0 5
      pages/deviceConnect1/deviceConnect1.json
  54. 0 32
      pages/deviceConnect1/deviceConnect1.wxml
  55. 0 5
      pages/deviceConnect2/deviceConnect2.json
  56. 0 5
      pages/deviceConnect3/deviceConnect3.json
  57. 0 5
      pages/deviceDetail/detail.json
  58. 0 29
      pages/deviceDetail/detail.wxml
  59. 0 74
      pages/deviceDetail/detail.wxss
  60. 0 6
      pages/deviceList/deviceList.json
  61. 0 6
      pages/deviceWake/deviceWake.json
  62. 0 5
      pages/download/download.json
  63. 515 282
      pages/index/index.js
  64. 1 1
      pages/index/index.json
  65. 29 30
      pages/index/index.wxml
  66. 21 3
      pages/index/index.wxss
  67. 0 5
      pages/login/login.json
  68. 0 18
      pages/login/login.wxml
  69. 0 358
      pages/ota/ota.js
  70. 0 5
      pages/ota/ota.json
  71. 0 33
      pages/ota/ota.wxml
  72. 0 100
      pages/ota/ota.wxss
  73. 16 21
      pages/deviceList/deviceList.js
  74. 5 0
      pages/pageA/deviceList/deviceList.json
  75. 0 0
      pages/pageA/deviceList/deviceList.wxml
  76. 0 0
      pages/pageA/deviceList/deviceList.wxss
  77. 18 13
      pages/login/login.js
  78. 5 0
      pages/pageA/login/login.json
  79. 17 0
      pages/pageA/login/login.wxml
  80. 0 1
      pages/login/login.wxss
  81. 26 20
      pages/connectBle/connectBle.js
  82. 5 0
      pages/pageB/connectBle/connectBle.json
  83. 0 1
      pages/connectBle/connectBle.wxml
  84. 0 1
      pages/connectBle/connectBle.wxss
  85. 11 14
      pages/deviceConnect0/deviceConnect0.js
  86. 5 0
      pages/pageB/deviceConnect0/deviceConnect0.json
  87. 3 4
      pages/deviceConnect0/deviceConnect0.wxml
  88. 0 0
      pages/pageB/deviceConnect0/deviceConnect0.wxss
  89. 50 14
      pages/deviceConnect1/deviceConnect1.js
  90. 5 0
      pages/pageB/deviceConnect1/deviceConnect1.json
  91. 27 0
      pages/pageB/deviceConnect1/deviceConnect1.wxml
  92. 8 3
      pages/deviceConnect1/deviceConnect1.wxss
  93. 80 51
      pages/deviceConnect2/deviceConnect2.js
  94. 5 0
      pages/pageB/deviceConnect2/deviceConnect2.json
  95. 0 2
      pages/deviceConnect2/deviceConnect2.wxml
  96. 0 0
      pages/pageB/deviceConnect2/deviceConnect2.wxss
  97. 23 21
      pages/deviceConnect3/deviceConnect3.js
  98. 5 0
      pages/pageB/deviceConnect3/deviceConnect3.json
  99. 2 4
      pages/deviceConnect3/deviceConnect3.wxml
  100. 0 0
      pages/deviceConnect3/deviceConnect3.wxss

+ 14 - 1
app.js

@@ -8,8 +8,11 @@ import env from './utils/env.js';
 // const host = 'wxs://mqtt.test.radio1964.com';
 // const host = 'wxs://mqtt.ssl.keepradioon.net:8884'
 
+// const iosHost = 'wxs://mqtt.test.radio1964.com:8884';
+// const androidHost = 'wxs://mqtt.ssl.keepradioon.net:8884'
+
 const iosHost = 'wxs://mqtt.test.radio1964.com:8884';
-const androidHost = 'wxs://mqtt.ssl.keepradioon.net:8884'
+const androidHost = 'wxs://mqtt.test.radio1964.com:8884'
 App({
   globalData: {
     isRelease: true,
@@ -17,6 +20,7 @@ App({
     baseUrl: env.prod.baseUrl,
 
     userInfo: null,
+    bannerList: [],
     classifyProducts: "",
     statusBarHeight: 0,
     safeBottomHeight: 0,
@@ -29,6 +33,7 @@ App({
     userData: null,
     client: null,
     oneInitBluetooth: true,
+    webSkipUrl: "",
 
     mDeviceList: [],
     // 当前设备
@@ -58,6 +63,12 @@ App({
       that.globalData.userInfo = userInfo;
     }
 
+    ///首页banner
+    var bannerList = store.getStore("homeBanner");
+    if (!strings.isEmpty(bannerList)) {
+      that.globalData.bannerList = bannerList;
+    }
+
     ///设备列表
     var classifyProducts = store.getStore("classifyProducts");
     if (!strings.isEmpty(classifyProducts)) {
@@ -216,6 +227,7 @@ App({
       //订阅主题
       // err:null
       // granted:[{"topic":"/AIrSMArT_861210052355545/status/onoffline","qos":0}]
+      console.log("gadfsqwerqewqrqr==222==" + topic);
       that.globalData.client.subscribe(topic, function (err, granted) {
         if (!err) {
           if (callback) {
@@ -277,6 +289,7 @@ App({
       var publish = `/${DstDeviceName}/user/sub_control`;
       // {"type":"get_dev_info","DstDeviceName":"AIrSMArT_7cdfa1fd3af0","SrcDeviceName":"ALY_933625"}
       var dataString = `${JSON.stringify(data)}`;
+      console.log("gadfsqwerqewqrqr==111==" + dataString);
       that.globalData.client.publish(publish, dataString, (err) => {
         if (err) {
           console.log("发布消息失败");

+ 53 - 20
app.json

@@ -1,25 +1,54 @@
 {
+  "entryPagePath": "pages/index/index",
   "pages": [
     "pages/index/index",
-    "pages/login/login",
-    "pages/about/about",
-    "pages/repeat/repeat",
-    "pages/deviceWake/deviceWake",
-    "pages/channelDetails/channelDetails",
-    "pages/deviceConnect3/deviceConnect3",
-    "pages/deviceConnect0/deviceConnect0",
-    "pages/deviceConnect2/deviceConnect2",
-    "pages/deviceConnect1/deviceConnect1",
-    "pages/download/download",
-    "pages/wakeList/wakeList",
-    "pages/aboutInfo/aboutInfo",
-    "pages/deviceList/deviceList",
-    "pages/deviceConMode/index",
-    "pages/connectBle/connectBle",
-    "pages/deviceDetail/detail",
-    "pages/piano/wallpaper/wallpaper",
-    "pages/ota/ota",
-    "pages/piano/cropper/cropper"
+    "pages/pageA/login/login",
+    "pages/pageA/deviceList/deviceList"
+  ],
+  "subPackages": [
+    {
+      "root": "pages/pageB/",
+      "pages": [
+        "repeat/repeat",
+        "wakeList/wakeList",
+        "connectBle/connectBle",
+        "deviceMode/deviceMode",
+        "deviceWake/deviceWake",
+        "deviceConnect0/deviceConnect0",
+        "deviceConnect1/deviceConnect1",
+        "deviceConnect2/deviceConnect2",
+        "deviceConnect3/deviceConnect3",
+        "deviceConnect4/deviceConnect4"
+      ]
+    },
+    {
+      "root": "pages/pageC/",
+      "pages": [
+        "about/about",
+        "vipDetail/vipDetail",
+        "vipRecord/vipRecord",
+        "vipPurchase/vipPurchase",
+        "aboutInfo/aboutInfo",
+        "channelDetail/channelDetail"
+      ]
+    },
+    {
+      "root": "pages/pageD/",
+      "pages": [
+        "ota/ota",
+        "setWifi/setWifi",
+        "webview/webview",
+        "download/download"
+      ]
+    },
+    {
+      "root": "pages/piano/",
+      "pages": [
+        "cropper/cropper",
+        "wallpaper/wallpaper",
+        "deviceDetail/deviceDetail"
+      ]
+    }
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -40,5 +69,9 @@
   "requiredPrivateInfos": [
     "getFuzzyLocation"
   ],
-  "deviceOrientation": "portrait"
+  "permission": {
+    "scope.userFuzzyLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 133
common/main.js


+ 0 - 17
common/main.wxss

@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*每个页面公共css */
-

+ 0 - 158
common/runtime.js

@@ -1,158 +0,0 @@
-
-  !function(){try{var a=Function("return this")();a&&!a.Math&&(Object.assign(a,{isFinite:isFinite,Array:Array,Date:Date,Error:Error,Function:Function,Math:Math,Object:Object,RegExp:RegExp,String:String,TypeError:TypeError,setTimeout:setTimeout,clearTimeout:clearTimeout,setInterval:setInterval,clearInterval:clearInterval}),"undefined"!=typeof Reflect&&(a.Reflect=Reflect))}catch(a){}}();
-  /******/ (function(modules) { // webpackBootstrap
-/******/ 	// install a JSONP callback for chunk loading
-/******/ 	function webpackJsonpCallback(data) {
-/******/ 		var chunkIds = data[0];
-/******/ 		var moreModules = data[1];
-/******/ 		var executeModules = data[2];
-/******/
-/******/ 		// add "moreModules" to the modules object,
-/******/ 		// then flag all "chunkIds" as loaded and fire callback
-/******/ 		var moduleId, chunkId, i = 0, resolves = [];
-/******/ 		for(;i < chunkIds.length; i++) {
-/******/ 			chunkId = chunkIds[i];
-/******/ 			if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ 				resolves.push(installedChunks[chunkId][0]);
-/******/ 			}
-/******/ 			installedChunks[chunkId] = 0;
-/******/ 		}
-/******/ 		for(moduleId in moreModules) {
-/******/ 			if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
-/******/ 				modules[moduleId] = moreModules[moduleId];
-/******/ 			}
-/******/ 		}
-/******/ 		if(parentJsonpFunction) parentJsonpFunction(data);
-/******/
-/******/ 		while(resolves.length) {
-/******/ 			resolves.shift()();
-/******/ 		}
-/******/
-/******/ 		// add entry modules from loaded chunk to deferred list
-/******/ 		deferredModules.push.apply(deferredModules, executeModules || []);
-/******/
-/******/ 		// run deferred modules when all chunks ready
-/******/ 		return checkDeferredModules();
-/******/ 	};
-/******/ 	function checkDeferredModules() {
-/******/ 		var result;
-/******/ 		for(var i = 0; i < deferredModules.length; i++) {
-/******/ 			var deferredModule = deferredModules[i];
-/******/ 			var fulfilled = true;
-/******/ 			for(var j = 1; j < deferredModule.length; j++) {
-/******/ 				var depId = deferredModule[j];
-/******/ 				if(installedChunks[depId] !== 0) fulfilled = false;
-/******/ 			}
-/******/ 			if(fulfilled) {
-/******/ 				deferredModules.splice(i--, 1);
-/******/ 				result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
-/******/ 			}
-/******/ 		}
-/******/
-/******/ 		return result;
-/******/ 	}
-/******/
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-/******/
-/******/ 	// object to store loaded and loading chunks
-/******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ 	// Promise = chunk loading, 0 = chunk loaded
-/******/ 	var installedChunks = {
-/******/ 		"common/runtime": 0
-/******/ 	};
-/******/
-/******/ 	var deferredModules = [];
-/******/
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-/******/
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId]) {
-/******/ 			return installedModules[moduleId].exports;
-/******/ 		}
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			i: moduleId,
-/******/ 			l: false,
-/******/ 			exports: {}
-/******/ 		};
-/******/
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ 		// Flag the module as loaded
-/******/ 		module.l = true;
-/******/
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-/******/
-/******/
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-/******/
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-/******/
-/******/ 	// define getter function for harmony exports
-/******/ 	__webpack_require__.d = function(exports, name, getter) {
-/******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ 		}
-/******/ 	};
-/******/
-/******/ 	// define __esModule on exports
-/******/ 	__webpack_require__.r = function(exports) {
-/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ 		}
-/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
-/******/ 	};
-/******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
-/******/ 	// getDefaultExport function for compatibility with non-harmony modules
-/******/ 	__webpack_require__.n = function(module) {
-/******/ 		var getter = module && module.__esModule ?
-/******/ 			function getDefault() { return module['default']; } :
-/******/ 			function getModuleExports() { return module; };
-/******/ 		__webpack_require__.d(getter, 'a', getter);
-/******/ 		return getter;
-/******/ 	};
-/******/
-/******/ 	// Object.prototype.hasOwnProperty.call
-/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "/";
-/******/
-/******/ 	var jsonpArray = global["webpackJsonp"] = global["webpackJsonp"] || [];
-/******/ 	var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
-/******/ 	jsonpArray.push = webpackJsonpCallback;
-/******/ 	jsonpArray = jsonpArray.slice();
-/******/ 	for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
-/******/ 	var parentJsonpFunction = oldJsonpFunction;
-/******/
-/******/
-/******/ 	// run deferred modules from other chunks
-/******/ 	checkDeferredModules();
-/******/ })
-/************************************************************************/
-/******/ ([]);
-//# sourceMappingURL=../../.sourcemap/mp-weixin/common/runtime.js.map
-  

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 11312
common/vendor.js


+ 82 - 5
pages/components/image-cropper/image-cropper.js

@@ -308,21 +308,28 @@ Component({
                     height: Math.round(this.data.height * this.data.export_scale),
                     destWidth: this.data.width * this.data.export_scale,
                     destHeight: Math.round(this.data.height) * this.data.export_scale,
-                    fileType: 'png',
+                    fileType: 'jpg',
                     quality: this.data.quality,
                     canvasId: this.data.el,
                     success: (res) => {
+                        console.log("裁剪图片1", res.tempFilePath);
                         getCallback({
                             url: res.tempFilePath,
                             width: this.data.width * this.data.export_scale,
                             height: this.data.height * this.data.export_scale
                         });
+                    },
+                    fail:(err) => {
+                        wx.showToast({
+                          title: '壁纸裁剪失败'+err,
+                        })
                     }
                 }, this)
             });
-        },  /**
-         * 返回图片数据data
-         */
+        },
+        /**
+       * 返回图片数据data
+       */
         getImgData(getCallback) {
             this._draw(() => {
                 wx.canvasGetImageData({
@@ -345,6 +352,74 @@ Component({
                 }, this)
             });
         },
+        convertToStandardRGB(getCallback) {
+            try {
+                this.getImgData((res) => {
+                    console.log("获取像素数据成功", res.data);
+                    const rgbData = this._drawRGB565(res.data, res.width, res.height);
+                    console.log("转换后的 RGB 数据", rgbData.length, rgbData.byteLength);
+
+                    // 将转换后的 RGB 数据绘制回 Canvas
+                    wx.canvasPutImageData({
+                        canvasId: this.data.el,
+                        data: rgbData,
+                        x: 0,
+                        y: 0,
+                        width: res.width,
+                        height: res.height,
+                        success: (res2) => {
+                            console.log("绘制 RGB 数据成功", res2);
+                            wx.canvasToTempFilePath({
+                                width: res.width,
+                                height: res.height,
+                                destWidth: res.width,
+                                destHeight: res.height,
+                                fileType: 'jpg',
+                                quality: this.data.quality,
+                                canvasId: this.data.el,
+                                success: (res) => {
+                                    console.log("转换后的图片路径", res.tempFilePath);
+                                    getCallback({
+                                        url: res.tempFilePath,
+                                        width: res.width,
+                                        height: res.height
+                                    });
+                                },
+                                fail: (err) => {
+                                    console.error('转换失败:', err);
+                                }
+                            }, this);
+                        },
+                        fail: (err) => {
+                            console.error('绘制 RGB 数据失败:', err);
+                        }
+                    }, this);
+                });
+            } catch (e) {
+                console.log(e)
+            }
+        },
+        // 将 16 位 RGB 565 数据绘制回 Canvas
+        _drawRGB565(data, width, height, callback) {
+            const ctx = wx.createCanvasContext(this.data.el, this);
+            const imageData = ctx.createImageData(width, height);
+            console.log("转换前的 RGB 数据", data.length, data.byteLength);
+            for (let i = 0, j = 0; i < data.length; i++) {
+                const pixel = data[i];
+                const r = (pixel >> 11) & 0x1F;
+                const g = (pixel >> 5) & 0x3F;
+                const b = pixel & 0x1F;
+
+                imageData.data[j++] = (r << 3) | (r >> 2); // R
+                imageData.data[j++] = (g << 2) | (g >> 4); // G
+                imageData.data[j++] = (b << 3) | (b >> 2); // B
+                imageData.data[j++] = 255; // Alpha 设置为 255,确保没有透明通道
+            }
+            console.log("转换后的 RGB 数据", imageData.length, imageData.byteLength);
+
+            ctx.putImageData(imageData, 0, 0);
+            ctx.draw(false, callback);
+        },
         /**
          * 设置图片动画
          * {
@@ -553,6 +628,7 @@ Component({
         _initCanvas() {
             //初始化canvas
             if (!this.data.ctx) {
+                console.log("创建canvas0");
                 this.data.ctx = wx.createCanvasContext("image-cropper", this);
             }
         },
@@ -869,10 +945,11 @@ Component({
                         height: Math.round(this.data.height * this.data.export_scale),
                         destWidth: this.data.width * this.data.export_scale,
                         destHeight: Math.round(this.data.height) * this.data.export_scale,
-                        fileType: 'png',
+                        fileType: 'jpg',
                         quality: this.data.quality,
                         canvasId: this.data.el,
                         success: (res) => {
+                            console.log("裁剪图片", res.tempFilePath);
                             this.triggerEvent('tapcut', {
                                 url: res.tempFilePath,
                                 width: this.data.width * this.data.export_scale,

pages/components/image-cropper/image-cropper.json → components/image-cropper/image-cropper.json


pages/components/image-cropper/image-cropper.wxml → components/image-cropper/image-cropper.wxml


pages/components/image-cropper/image-cropper.wxss → components/image-cropper/image-cropper.wxss


+ 1 - 5
pages/components/navbar/navbar.js

@@ -10,10 +10,6 @@ Component({
       type: Object,
       value: {},
     },
-    callback: {
-      type: Boolean,
-      value: false
-    },
   },
   externalClasses: ['nav-bgc-class', 'nav-title-class'],
   options: {
@@ -33,7 +29,7 @@ Component({
    */
   methods: {
     _navback() {
-      if (this.properties.callback) {
+      if (this.properties.navbarData.callback) {
         this.triggerEvent('callback',); // 触发确定事件  
         return;
       };

pages/components/navbar/navbar.json → components/navbar/navbar.json


+ 8 - 0
components/navbar/navbar.wxml

@@ -0,0 +1,8 @@
+<view class='nav-wrap nav-bgc-class' style='height: calc({{navBarHeight}}px - {{MenuButtonTop}}px); padding-top: {{MenuButtonTop}}px;'>
+  <view class="nav-info" style="height: {{ MenuButtonheight }}px;">
+    <view bindtap='_navback' style="height: {{ MenuButtonheight }}px;" class="device-pic">
+      <image wx:if='{{navbarData.showCapsule}}' bindtap="" mode="heightFix" src="./../../img/goback.png"></image>
+    </view>
+    <text class="nav-title-class" style="height: {{ MenuButtonheight }}px; line-height: {{ MenuButtonheight }}px;">{{navbarData.title}}</text>
+  </view>
+</view>

pages/components/navbar/navbar.wxss → components/navbar/navbar.wxss


pages/components/toast/toast.js → components/toast/toast.js


pages/components/toast/toast.json → components/toast/toast.json


pages/components/toast/toast.wxml → components/toast/toast.wxml


pages/components/toast/toast.wxss → components/toast/toast.wxss


+ 217 - 109
devices/ble_manager.js

@@ -13,6 +13,8 @@ class bleManager {
     that.doStartScaning = false;
     that.compareList = [];
     that.dissmissDevice = [];
+    that.stateChangeCallback = null;
+    that.isConnecting = false;
   }
 
   ///获取比较的数据
@@ -50,18 +52,20 @@ class bleManager {
         that.dissmissDevice = [];
         getCurrentPages()[0].closeBlueResetOffline(false, true);
       }
-    })
+    });
   }
 
-  ///监听搜索设备列表
+  ///监听搜索设备列表 监听设备列表
   getBluetoothDevices() {
     var that = this;
+    const hexUtil = require('../utils/hexUtil');
     wx.onBluetoothDeviceFound(function (res) {
+      // console.log("蓝牙设备列表", res.length);
       ///第一种情况
       if (res.deviceId) {
         if (that.callBackConnect != null) {
           if (that.connectWillDevice != null && res.name == that.connectWillDevice.clientType) {
-            res.mac = res.advertisData ? that.buf2hex(res.advertisData) : '';
+            res.mac = res.advertisData ? hexUtil.buf2hex(res.advertisData) : '';
             // if (that.callBackConnect != null) {
             console.log("1111", res.mac);
             if (that.callBackConnect != null) {
@@ -98,33 +102,39 @@ class bleManager {
             //   console.log("2222", temp.name);
             // }
             if (that.connectWillDevice != null && temp.name == that.connectWillDevice.clientType) {
-              temp.mac = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
+              temp.mac = temp.advertisData ? hexUtil.buf2hex(temp.advertisData) : '';
               temp.mac2 = that.ab2hex(temp.advertisData ?? "")
-              // if (that.callBackConnect != null) {
-              // console.log("2222:", temp.mac, temp.mac2);
-              if (that.callBackConnect != null) {
-                that.callBackConnect(temp);
-              }
+
+              // if (that.testData(temp)) {
+              //   return
+              // }
+              console.log("2222:", temp.mac, ":", temp.mac2, ":", temp.deviceId, temp, temp.connectable);
+
+              // if ((temp.deviceId.indexOf("1f:de") ) > -1) {
+              //   that.callBackConnect(temp);
+              // }
+              that.callBackConnect(temp);
               break;
             }
           }
         } else {
           for (var i = 0; i < res.devices.length; i++) {
-            if (that.compareList.length > 0) {
-              var has = false;
-              for (var j = 0; j < that.compareList.length; j++) {
-                if (res.devices[i].name != "") {
+            if (res.devices[i].name != "") {
+
+              if (that.compareList.length > 0) {
+                var has = false;
+                for (var j = 0; j < that.compareList.length; j++) {
                   if (res.devices[i].deviceId == that.compareList[j].deviceId) {
                     has = true;
                     break;
                   }
                 }
-              }
-              if (!has) {
+                if (!has) {
+                  that.compareList.push(res.devices[i]);
+                }
+              } else {
                 that.compareList.push(res.devices[i]);
               }
-            } else {
-              that.compareList.push(res.devices[i]);
             }
           }
         }
@@ -133,12 +143,10 @@ class bleManager {
       else if (res[0]) {
         if (that.callBackConnect != null) {
           if (that.connectWillDevice != null && res[0].name == that.connectWillDevice.clientType) {
-            res[0].mac = res[0].advertisData ? that.buf2hex(res[0].advertisData) : '';
+            res[0].mac = res[0].advertisData ? hexUtil.buf2hex(res[0].advertisData) : '';
             // if (that.callBackConnect != null) {
             console.log("3333", res.mac);
-
             if (that.callBackConnect != null) {
-
               that.callBackConnect(res[0]);
             }
           }
@@ -162,9 +170,11 @@ class bleManager {
         }
       }
     });
-
-    ///监听已连接或没有连接
+  }
+  onBLEConnectionStateChange() {
+    ///监听已连接或没有连接 连接和断开的时候会回调
     // {"deviceId":"E4:9F:80:09:40:EC","connected":false}
+    let that = this;
     wx.onBLEConnectionStateChange((result) => {
       if (result.connected) {
         for (var i = 0; i < that.dissmissDevice.length; i++) {
@@ -184,7 +194,17 @@ class bleManager {
         if (!has) {
           that.dissmissDevice.push(result);
         }
+
       }
+      // that.disconnect(result)
+      //断开连接是失败的。
+      console.log("监听到设备状态变化0:", result.deviceId, JSON.stringify(result));
+      that.errorDisconnect({
+        "deviceId": result.deviceId,
+        "state": result.connected ? "online" : "offline"
+      });
+
+
 
       // ///是否已配对
       // wx.isBluetoothDevicePaired({
@@ -201,23 +221,51 @@ class bleManager {
   ///获取 所有搜索到的蓝牙设备
   getConnectedDevices() {
     var that = this;
+    const hexUtil = require('../utils/hexUtil');
+
+    // wx.getConnectedBluetoothDevices({
+    //   // services: ['ab00'],
+    //   search: ['ab00', 'ab01', 'ab02', '0000AB00-0000-1000-8000-00805F9B34FB', '0000AB01-0000-1000-8000-00805F9B34FB', '0000AB02-0000-1000-8000-00805F9B34FB'],
+    //   success: (res) => {
+    //     // ble连接上,才会有这个返回
+    //     console.log('根据主服务 UUID 获取已连接的蓝牙设备:', res.devices);
+    //     if (res.devices.length > 0) {
+    //       for (var i = 0; i < res.devices.length; i++) {
+    //         var device = res.devices[i];
+    //         if (device.name != "") {
+    //           that.callBackConnect(device);
+    //         }
+    //       }
+    //     }
+    //   }
+    // })
+
     wx.getBluetoothDevices({
       success: (res) => {
+        console.log("搜索到的:" + res.length);
+
         if (that.callBackConnect != null) {
           for (var i = 0; i < res.devices.length; i++) {
             var temp = res.devices[i];
             if (that.connectWillDevice != null && temp.name == that.connectWillDevice.clientType) {
-              temp.mac = temp.advertisData ? that.buf2hex(temp.advertisData) : '';
+              temp.mac = temp.advertisData ? hexUtil.buf2hex(temp.advertisData) : '';
               if (temp.mac) {
                 console.log("搜索到的" + JSON.stringify(temp));
               }
               // if (that.callBackConnect != null) {
-              if (that.callBackConnect != null) {
-                // if (that.callBackConnect != null && temp.mac.includes("CF:CA")) {
-                that.callBackConnect(temp);
+              if (that.testData(temp)) {
+                return
               }
-              break;
+              console.log("444:" + JSON.stringify(temp));
+
+              // if ((temp.deviceId === "07:F6:F4:66:FB:FA")) {
+              //   that.callBackConnect(temp);
+              // }
+              that.callBackConnect(temp);
+
             }
+            break;
+
           }
         } else {
           for (var i = 0; i < res.devices.length; i++) {
@@ -249,22 +297,13 @@ class bleManager {
     });
   }
 
-  ///获取数据
-  buf2hex(buffer) {
-    return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');
-  }
-
-  ///获取毫秒
-  getCurrentMills() {
-    var currentDate = new Date();
-    var currentTimeMillis = currentDate.getTime();
-    // return Math.floor(currentTimeMillis / 1000);
-    return currentTimeMillis;
-  }
-
-  // 等待多少秒
-  delay(ms) {
-    return new Promise(resolve => setTimeout(resolve, ms));
+  testData(temp) {
+    if ((temp.deviceId === "1A:B4:E0:40:22:8B" ||
+        temp.deviceId === "F3:55:1F:8D:26:A0" ||
+        temp.deviceId === "3F2F112F-ACB5-3EB3-30DA-93DE6A86228A")) {
+      return true
+    }
+    return false
   }
 
   // 开始搜索蓝牙设备
@@ -272,38 +311,64 @@ class bleManager {
     var that = this;
 
     ///限制搜索没有打开蓝牙一直询问打开蓝牙
-    var isAvailable = that.isAvailable;
-    if (!isAvailable && callBackConnect == null) {
-      return;
+    const time_util = require('../utils/timeUtil');
+    if (!that.isAvailable) {
+      if (callBackConnect == null) {
+        return;
+      }
+
+      ///做搜索蓝牙适配器权限
+      const permissionUtil = require('../utils/permissionUtil');
+      // var location = await permission_util.getSetting()
+      // if (!location) {
+      //   if (boolean != null) {
+      //     boolean(false);
+      //     console.log("没有定位权限")
+      //   }
+      //   return
+      // }
+      var available = await permissionUtil.openBluetoothAdapter();
+      that.isAvailable = available;
+      if (!available) {
+        that.doStartScaning = false;
+        that.requestBlueTime = time_util.getCurrentMills();
+        if (boolean != null) {
+          boolean(false);
+        }
+        return;
+      }
     }
 
-    const route_util = require('../utils/route_util');
-    const route_constant = require('../utils/route_constant');
-    const indexRoot = route_constant.indexRoot;
-    const connectBleRoot = route_constant.connectBleRoot;
-    var lastPageRoute = route_util.getLastPageRoute();
-    if (lastPageRoute != indexRoot && lastPageRoute != connectBleRoot) {
+    const routeUtil = require('../utils/routeUtil');
+    const routeRoot = require('../utils/routeRoot');
+
+    const index = routeRoot.index;
+    const connectBleRoot = routeRoot.connectBle;
+    var lastPageRoute = routeUtil.getLastPageRoute();
+    if (lastPageRoute != index && lastPageRoute != connectBleRoot) {
+      console.log("搜索蓝牙设备失败,请返回首页0");
       return;
     }
 
     ///蓝牙连接 做限制
-    if (lastPageRoute == indexRoot) {
+    if (lastPageRoute == index) {
       if (that.doStartScaning == true) {
+        console.log("搜索蓝牙设备失败,请返回首页1");
         return;
       }
     }
 
     that.doStartScaning = true;
-    var currentMill = that.getCurrentMills();
+    var currentMill = time_util.getCurrentMills();
     var waitMills = 0;
     var reduce = currentMill - that.requestBlueTime;
-    const delayMiliis = 6 * 1000;
-    if (reduce > 0 && reduce < delayMiliis) {
-      waitMills = delayMiliis - reduce;
+    const dMiliis = 6 * 1000;
+    if (reduce > 0 && reduce < dMiliis) {
+      waitMills = dMiliis - reduce;
     }
 
     if (waitMills > 0) {
-      await that.delay(waitMills);
+      await time_util.delayMills(waitMills);
     }
 
     if (callBackConnect == null && lastPageRoute == connectBleRoot) {
@@ -311,46 +376,31 @@ class bleManager {
       return;
     }
 
-    wx.openBluetoothAdapter({
-      success: function (res) {
-        wx.stopBluetoothDevicesDiscovery({
-          success: (res) => {
-            that.search(connectWillDevice, boolean, callBackConnect);
-          },
-          fail: (err) => {
-            that.doStartScaning = false;
-            that.requestBlueTime = that.getCurrentMills();
-            if (boolean != null) {
-              boolean(false);
-            }
-          }
-        });
+    wx.stopBluetoothDevicesDiscovery({
+      success: (res) => {
+        that.search(connectWillDevice, boolean, callBackConnect);
       },
-      fail: function (res) {
-        // wx.showModal({
-        //   title: '提示',
-        //   content: '请检查手机蓝牙是否打开',
-        //   showCancel: false,
-        //   success: function (res) {}
-        // });
+      fail: (err) => {
         that.doStartScaning = false;
-        that.requestBlueTime = that.getCurrentMills();
+        that.requestBlueTime = time_util.getCurrentMills();
         if (boolean != null) {
           boolean(false);
         }
       }
-    })
+    });
   }
 
   search(connectWillDevice, boolean, callBackConnect) {
     var that = this;
+    const timeUtil = require('../utils/timeUtil');
     wx.startBluetoothDevicesDiscovery({
       allowDuplicatesKey: true,
       success: function (res) {
+        console.log("开始搜索设备", res);
         that.getConnectedDevices();
 
         that.doStartScaning = false;
-        that.requestBlueTime = that.getCurrentMills();
+        that.requestBlueTime = timeUtil.getCurrentMills();
         if (boolean != null) {
           boolean(true);
         }
@@ -359,8 +409,14 @@ class bleManager {
         that.compareList = [];
       },
       fail(err) {
+        console.log("开始搜索设备失败", err);
         that.doStartScaning = false;
-        that.requestBlueTime = that.getCurrentMills();
+        that.requestBlueTime = timeUtil.getCurrentMills();
+        if (err.errMsg.indexOf("location") >= 0) {
+          wx.showToast({
+            title: '搜索失败,请检查下手机设置的微信定位权限是否开启',
+          })
+        }
         if (boolean != null) {
           boolean(false);
         }
@@ -394,7 +450,8 @@ class bleManager {
   disconnect(mDevice) {
     var that = this;
     const strings = require('../utils/strings');
-    let device = that.publicDevice;
+    // 没有参数就默认断开现在连接的
+    let device = mDevice;
     if (mDevice != null) {
       device = mDevice;
     }
@@ -406,27 +463,21 @@ class bleManager {
     if (strings.isEmpty(deviceId)) {
       return;
     }
-    console.log('断开连接', device);
+    console.log('开始断开连接', device);
 
     return new Promise((resolve, reject) => {
-      wx.getConnectedBluetoothDevices({
+      wx.closeBLEConnection({
+        deviceId: deviceId,
         success: (res) => {
-          if (res.devices.length > 0) {
-            wx.closeBLEConnection({
-              deviceId: deviceId,
-              success: (res) => {
-                that.publicDevice = null;
-                resolve(res);
-              },
-              fail: (err) => {
-                resolve(err);
-              }
-            });
-          } else {
-            resolve("暂无连接设备");
+          let publicDevice = that.publicDevice ?? {}
+          if (deviceId == publicDevice.deviceId) {
+            console.log('成功断开连接', res, deviceId);
+            that.publicDevice = null;
           }
+          resolve(res);
         },
         fail: (err) => {
+          console.log('断开连接失败', err);
           resolve(err);
         }
       });
@@ -436,6 +487,11 @@ class bleManager {
   // 连接到指定设备
   async connectToDevice(device) {
     var that = this;
+    if (that.isConnecting) {
+      // 防止多次进入连接
+      return;
+    }
+    that.isConnecting = true
     return new Promise((resolve, reject) => {
       console.log("开始连接蓝牙:", device.deviceId)
       wx.createBLEConnection({
@@ -443,10 +499,37 @@ class bleManager {
         success: (res) => {
           that.publicDevice = device
           console.log('连接成功:', res);
+          that.isConnecting = false;
+          wx.setBLEMTU({
+            deviceId: device.deviceId,
+            mtu: 128,
+            success: (mtuRes) => {
+              console.log("设置mtu成功")
+            },
+            fail: (mtuErr) => {
+              console.log("设置mtu失败:", mtuErr)
+            }
+          })
           resolve(true);
         },
         fail: (err) => {
-          that.publicDevice = null
+          // {errno: 1509007, errCode: -1, errMsg: "createBLEConnection:fail:already connect"}
+          if (err.errno == 1509007) {
+            that.disconnect({
+              "deviceId": device.deviceId
+            })
+          } else {
+            that.isConnecting = false;
+            console.log("监听到设备状态变化3:", err);
+            that.errorDisconnect({
+              "deviceId": device.deviceId,
+              "state": "offline"
+            })
+            let publicDevice = that.publicDevice ?? {}
+            if (device.deviceId == publicDevice.deviceId) {
+              that.publicDevice = null;
+            }
+          }
           console.error('连接失败:', err);
           resolve(false);
         }
@@ -457,6 +540,10 @@ class bleManager {
   // 发送数据到指定设备
   async sendData(data, callback) {
     var that = this
+    if (that.publicDevice == null) {
+      console.log("没有连接设备");
+      return;
+    }
     return new Promise((resolve, reject) => {
       var buffer = null;
       // todo 判断是否是buffer
@@ -470,14 +557,15 @@ class bleManager {
         dataView.setUint8(index, value); // 将每个16进制数值写入到 buffer 中
       });
       // }
-
-      // console.log('开始发送数据:', data);
+      // let logData = new Uint8Array(buffer);
+      // console.log('开始发送数据:', buffer);
       wx.writeBLECharacteristicValue({
         deviceId: that.publicDevice.deviceId,
         serviceId: that.publicDevice.serviceId,
         characteristicId: that.publicDevice.characteristicId,
         value: buffer,
         success: (res) => {
+          console.log('发送数据成功:', dataView);
           if (callback) {
             callback(true)
           }
@@ -487,7 +575,11 @@ class bleManager {
           if (callback) {
             callback(false)
           }
-          console.log('数据发送失败:', err);
+          console.log('监听到设备状态变化4:', err);
+          that.errorDisconnect({
+            "deviceId": that.publicDevice.deviceId,
+            "state": "offline"
+          })
           resolve(false);
         }
       });
@@ -570,14 +662,18 @@ class bleManager {
             service_id = res.services[i].uuid;
 
           }
-          that.publicDevice.serviceId = service_id;
-          console.log('发现服务2:', service_id);
+          if (that.publicDevice) {
+            that.publicDevice.serviceId = service_id;
+            console.log('发现服务2:', that.publicDevice.service_id);
+          }
 
           resolve(service_id);
           // resolve(res.services);
         },
         fail: (err) => {
-          that.publicDevice.serviceId = null;
+          if (that.publicDevice) {
+            that.publicDevice.serviceId = null;
+          }
 
           console.error('发现服务失败:', err);
           reject([]);
@@ -586,7 +682,7 @@ class bleManager {
     });
   }
 
-  connect() { }
+  connect() {}
 
   // 发现特征值 read / write
   discoverCharacteristics(deviceId, serviceId) {
@@ -607,7 +703,9 @@ class bleManager {
           resolve(res.characteristics);
         },
         fail: (err) => {
-          that.publicDevice.characteristics = null;
+          if (that.publicDevice) {
+            that.publicDevice.characteristics = null;
+          }
           console.error('发现特征值失败:', err);
           reject("");
         }
@@ -682,8 +780,18 @@ class bleManager {
     // that.publicDevice .wirte = wirte
     that.publicDevice.characteristicId = characteristicId;
   }
+  setStateChangeCallback(callback) {
+    this.stateChangeCallback = callback;
+  }
+  errorDisconnect(result) {
+    // this.disconnect();
+    console.log("监听到设备状态变化1:", result.deviceId, result.state, this.stateChangeCallback);
+    if (this.stateChangeCallback && result.deviceId) {
+      this.stateChangeCallback(result);
+    }
+  }
 }
 // const ble = new bleManager();
 
 // 导出 bleManager 类
-module.exports = bleManager;
+module.exports = bleManager;

+ 105 - 51
devices/bluetooth/bt_cmd.js

@@ -180,13 +180,28 @@ class BtCmd {
         return this._build(CmdRgb.query, [0x00]);
     }
 
-    static stringToUint8Array(str) {
-        // 54 44 44 48 01 11 28 09 73 6d6172745f413246
-        // const encoder = new TextEncoder();
-        // const uint8Array = encoder.encode(str);
-        // return uint8Array;
+    static stringToUint8Array(text) {
         // return [0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x41, 0x32, 0x46]
-        return [115, 109, 97, 114, 116, 95, 65, 50, 70]
+        // return [115, 109, 97, 114, 116, 95, 65, 50, 70]
+        // return [115, 109, 97, 114, 116, 95, 65, 50, 70]
+        // 73 6D 61 72 74 5F 41 32 46
+        if (!text) {
+            return []
+        }
+        console.log("stringToUint8Array", text)
+        let code = Array.from(text).map(char => char.charCodeAt(0));
+        console.log("stringToUint8Array", code)
+        return code
+    }
+    static listInt2String(data) {
+        return String.fromCharCode(...data);
+    }
+    static intToHex(num) {
+        let value = num ?? 0;
+        let hexStr = value.toString(16).toUpperCase();
+        hexStr = hexStr.padStart(2, '0');
+        let hexNum = parseInt(hexStr, 16);
+        return hexNum;
     }
 
     // 校验设备
@@ -238,20 +253,79 @@ class BtCmd {
         return 0x01;
     }
 
+    // wifi ,md5都用这个
+    static sendWiFiInfo(wifiName, pwd) {
+        // [0x22, (wifiList.length + pwdList.length + 6), 0x33, (wifiList.length), (wifiList), 0x44, (pwdList)];
+
+        if (!wifiName) {
+            return;
+        }
+
+        let result = [];
+
+        // 字母*6 +
+        let wifiList = BtCmd.stringToUint8Array(wifiName);
+
+        // 数字*3 +
+        var pwdList = [];
+        if (pwd) {
+            pwdList = BtCmd.stringToUint8Array(pwd);
+        }
+        console.log("wifiList", wifiList, "pwdList", pwdList)
+
+        // 16进制
+        result.push(0x22);
+
+        result.push(BtCmd.intToHex(wifiList.length + pwdList.length + 6));
+
+        // 账号
+        result.push(0x33);
+        result.push(BtCmd.intToHex(wifiList.length));
+
+        let p = result[3] + 4;
+        let j = 0;
+        for (let i = 4; i < p; i++) {
+            result.splice(i, 0, wifiList[j++]);
+        }
+
+        result.splice(p, 0, 0x44);
+        // 有密码
+        if (pwdList.length > 0) {
+            result.splice(++p, 0, BtCmd.intToHex(pwdList.length));
+            p++;
+            j = 0;
+            for (let i = p; i < p + pwdList.length; i++) {
+                result.splice(i, 0, pwdList[j++]);
+            }
+        } else {
+            result.splice(++p, 0, BtCmd.intToHex(pwdList.length));
+        }
+
+        console.log("发送转换拼接数据:", result.toString());
+        return result;
+    }
+
     /* 黑胶音箱的指令 */
     // 壁纸指令 1开始, 0结束
     static wallPaper(value) {
-        return this._build(CmdBase.wallPaper, [value]);
+        let cmd = this._build(CmdBase.wallPaper, [value]);
+        console.log("图片上传:", cmd);
+        return cmd;
+    }
+    static wallPaperMD5(value) {
+        let cmd = this._build(CmdBase.wallPaperMD5, value, true, false);
+        console.log("图片上传MD5:", cmd);
+        return cmd;
     }
     // 壁纸指令 
     static wallPaperData(value) {
         let uint8Array = new Uint8Array(value);
-        let cmd = this._build(CmdBase.wallPaperData, uint8Array);
+        let cmd = this._build(CmdBase.wallPaperData, uint8Array, true, false);
         return cmd;
     }
-    // 背景图指令 1开始, 0结束
-    static backgroudImg(value) {
-        return this._build(CmdBase.heijiaoBackImg, [value]);
+    // 设置wifi
+    static otaSetWifi(value) {
+        return this._build(CmdBase.heijiaoBackImg, value, true, false);
     }   // 背景图指令
     static backgroudImgData(value) {
         return this._build(CmdBase.heijiaoBackImgData, [value]);
@@ -259,8 +333,14 @@ class BtCmd {
     // OTA指令 1开始, 0结束
     static otaCmd(value) {
         return this._build(CmdBase.heiJiaoOta, [value]);
-    } static otaData(value) {
-        return this._build(CmdBase.heiJiaoOtaData, [value]);
+    }
+    // 发送OTA的URL
+    static otaUrl(value) {
+        return this._build(CmdBase.heiJiaoOtaData, value, true, false);
+    }
+    //暂时没用了
+    static otaData(value) {
+        return this._build(CmdBase.heiJiaoOta, [value], true, false);
     }
     /// 获取设备型号指令
     static getClientType() {
@@ -274,39 +354,9 @@ class BtCmd {
         return this._build(0x36, [0x00]);
     }
 
-    static _buildOther(data) {
-        const cmd = [];
-
-        // 固定头部
-        cmd.push(...this._header);
 
-        // 版本号
-        cmd.push(this._version);
-
-        // 命令类型
-        cmd.push(cmdType);
-
-        if (isWriteChildCmdLength) {
-            // 子命令长度
-            const childLength = this._int2Hex(otherCmd.length);
-            cmd.push(childLength);
-        }
-
-        // 其他命令
-        if (otherCmd.length > 0) {
-            for (const element of otherCmd) {
-                cmd.push(this._int2Hex(element));
-            }
-        }
-
-        // 命令长度(位置在版本号之后)
-        const length = cmd.length + 1;
-        const l = this._int2Hex(length);
-        cmd.splice(5, 0, l);
-        return cmd;
-    }
     // 生成命令(固定头部+版本号+命令总长度+命令类型+)
-    static _build(cmdType, otherCmd = [], isWriteChildCmdLength = true) {
+    static _build(cmdType, otherCmd = [], isWriteChildCmdLength = true, isChangeHex = true) {
         const cmd = [];
 
         // 固定头部
@@ -326,8 +376,12 @@ class BtCmd {
 
         // 其他命令
         if (otherCmd.length > 0) {
-            for (const element of otherCmd) {
-                cmd.push(this._int2Hex(element));
+            if (isChangeHex) {
+                for (const element of otherCmd) {
+                    cmd.push(this._int2Hex(element));
+                }
+            } else {
+                cmd.push(...otherCmd);
             }
         }
 
@@ -335,6 +389,7 @@ class BtCmd {
         const length = cmd.length + 1;
         const l = this._int2Hex(length);
         cmd.splice(5, 0, l);
+        // console.log(`打印cmd:${cmd}`);
         return cmd;
     }
 
@@ -347,14 +402,12 @@ class BtCmd {
         }
 
         for (let i = 0; i < cmd.length; i++) {
-            var cmdStr = `${this._int2HexString(cmd[i])}`.padStart(2, "0");
-            cmdStr += ":"
-            result += cmdStr;
+            result += (`${this._int2HexString(cmd[i])}`.padStart(2, "0") + ":");
         }
         if (isSend) {
             mqttAddDebugCmd(`发送蓝牙指令:${cmd} \n ${result}`);
         }
-        console.log(`${key}解析- [${result}]`);
+        console.log(`${key}解析- [${result}],原始数据:${cmd}`);
     }
 
     static _int2Hex(num) {
@@ -383,9 +436,10 @@ const CmdBase = {
     queryVolume: 0x32,
     setVolume: 0x33,
     wallPaper: 0x78,
+    wallPaperMD5: 0x80,
     wallPaperData: 0x79,
     heiJiaoOta: 0x074,
-    heiJiaoOtaData: 0x075,
+    heiJiaoOtaData: 0x75,
     heijiaoBackImg: 0x76,
     heijiaoBackImgData: 0x77,
     // 获取设备型号指令

Fichier diff supprimé car celui-ci est trop grand
+ 573 - 511
devices/bluetooth/bt_parse.js


+ 33 - 24
devices/bt_helper.js

@@ -14,13 +14,14 @@ const {
 } = require('./../devices/cmd_key_event');
 const {
   addNotification
-} = require('./../utils/event_bus');
+} = require('../utils/eventBus');
 const BtParse = require('./../devices/bluetooth/bt_parse');
 // const VolumeUtil = require('./VolumeUtil');
 // const EventManager = require('./EventManager');
 // const CmdBase = require('./../devices/bluetooth/bt_cmd');
 const bleManager = require('./ble_manager');
 const QueueManager = require('./QueueManager');
+const eventBus = require('../utils/eventBus');
 
 // const EnumConnectStatus = require('./EnumConnectStatus');
 // const EnumOpen = require('./EnumOpen');
@@ -90,6 +91,10 @@ class BtHelper {
   initBluetoothAdapter() {
     var that = this;
     that.bleManager.initBluetoothAdapter();
+    that.bleManager.onBLEConnectionStateChange();
+    that.bleManager.setStateChangeCallback(function (e) {
+      eventBus.fire(CmdEvent.onoffline({ deviceId: e.deviceId, state: e.state == "online" ? "online" : "offline" }));
+    });
   }
 
   ///获取蓝牙设备 connect:true,去连接,false,去对比
@@ -108,12 +113,6 @@ class BtHelper {
     );
   }
 
-  ///停止搜索蓝牙设备
-  async stopSearch() {
-    var that = this;
-    await that.bleManager.stopSearch();
-  }
-
   ///获取蓝牙权限
   async getBluetoothPermission() {
     var that = this;
@@ -357,6 +356,7 @@ class BtHelper {
   }
 
   async stopSearch() {
+    console.log("停止搜索0");
     clearTimeout(this.timer);
     this.timer = null;
     await this.bleManager.stopSearch();
@@ -367,25 +367,30 @@ class BtHelper {
     this.getDeviceInfo()
   }
 
-  async connect(device, onChanged) {
+  async connect(device, onChanged, disPreDev) {
     var that = this;
-    await that.disconnect(device);
+    // todo 暂时不掉线
+    await that.disconnect(disPreDev ? null : device);
     clearTimeout(that.timer);
     that.timer = null;
     that.bleManager.stopSearch()
+    console.log("停止搜索1",);
+
     var res = await that.bleManager.connectToDevice(device);
-    if (res === false) {
-      console.log("连接失败")
-      that.disconnect(device)
+    if (res != true) {
+      console.log("连接失败了,")
+      // 失败应该不用断开连接
+      // that.disconnect(device)
       if (onChanged) {
         onChanged(false, device)
       }
       return
     }
 
+    console.log("连接成功了", res)
     const serviceId = await that.bleManager.discoverServices(device.deviceId);
     if (serviceId == "") {
-      console.log("连接失败")
+      console.log("服务连接失败")
       that.disconnect(device)
       if (onChanged) {
         onChanged(false, device)
@@ -403,7 +408,6 @@ class BtHelper {
       }
       return
     }
-    console.log('device特征值:', characteristics)
     let uuids = ["AB01", "FFC1"];
     for (let i = 0; i < characteristics.length; i++) {
       let charc = characteristics[i];
@@ -501,8 +505,8 @@ class BtHelper {
     var that = this;
     // console.log("校验设备:", BtCmd); // 输出: EarPhone Info
     that.sendNow(BtCmd.checkDevice());
-    //2.0有发这个,不知道是啥
-    that.send([0x54, 0x44, 0x44, 0x48, 0x01, 0x09, 0x26, 0x01, 0x01]);
+    //低电量提示语
+    // that.send([0x54, 0x44, 0x44, 0x48, 0x01, 0x09, 0x26, 0x01, 0x01]);
   }
 
   async getVersion() {
@@ -526,16 +530,16 @@ class BtHelper {
     // that.send(BtCmd.setDevTime());
 
     // that.send(BtCmd.queryKwh());
-    that.getSleep();
+    // that.getSleep();
     // that.getAlert();
     // that.send(BtCmd.queryRGB());
     // that.getVolume();
     // that.setVolume(8)
-    that.getPauseSleep();
+    // that.getPauseSleep();
 
     // that.send(BtCmd.getClientType());
-    that.send(BtCmd.getIsConnect());
-    // that.send(BtCmd.getMac());
+    // that.send(BtCmd.getIsConnect());
+    that.send(BtCmd.getMac());
 
     // }
   }
@@ -738,7 +742,7 @@ class BtHelper {
   }
 
   /* 黑胶音箱的指令 */
-  // 壁纸指令 1开始, 0结束
+  // 壁纸指令 1开始, 0结束, 2异常
   wallPaper(value) {
     var that = this;
     that.send(BtCmd.wallPaper(value));
@@ -757,10 +761,10 @@ class BtHelper {
 
   }
 
-  // 背景图指令
-  backgroudImg(value) {
+  // wifi指令
+  otaSetWifi(value) {
     var that = this;
-    that.send(BtCmd.backgroudImg(value));
+    that.send(BtCmd.otaSetWifi(value));
   } // 背景图指令
   backgroudImgData(value) {
     var that = this;
@@ -770,6 +774,10 @@ class BtHelper {
   otaCmd(value) {
     this.send(BtCmd.otaCmd(value));
   }
+  // OTA的URL
+  otaUrl(value) {
+    this.send(BtCmd.otaUrl(value));
+  }
   otaData(value, callback) {
     BtHelper.sendCallBack(BtCmd.otaData(value), callback);
   }
@@ -777,6 +785,7 @@ class BtHelper {
   async closeBle() {
     var that = this;
     that.bleManager.closeBle();
+    console.log("停止搜索3");
     await that.bleManager.stopSearch();
   }
 

+ 41 - 1
devices/cmd_key_event.js

@@ -47,7 +47,12 @@ const EnumCmdEvent = {
     authSleepStatus: 'authSleepStatus',
     btMac: 'btMac',
     otaCmd: 'otaCmd',
-    wallpaper: 'wallpaper'
+    otaUrl: 'otaUrl',
+    otaWifi: 'otaWifi',
+    wallpaper: 'wallpaper',
+    wallPaperData: 'wallPaperData',
+    wallPaperMD5: 'wallPaperMD5',
+    onoffline: 'onoffline',
 };
 
 // 枚举定义
@@ -124,8 +129,11 @@ class CmdEvent {
         this.btMac = null;
         this.deviceMode = null;
         this.otaCmd = null;
+        this.otaUrl = null;
         this.heiJiaoKind = null;
         this.wallpaper = null;
+        this.deviceId = null;
+        this.commonValue = null;
     }
 
     static eventName = "cmdEventNotification"
@@ -338,6 +346,18 @@ class CmdEvent {
         event.heiJiaoKind = kind;
         return event;
     }
+    static otaUrl({ value, kind }) {
+        const event = new CmdEvent({ cmdEvent: EnumCmdEvent.otaUrl });
+        event.otaCmd = value;
+        event.heiJiaoKind = kind;
+        return event;
+    }
+    static otaWifi({ value, kind }) {
+        const event = new CmdEvent({ cmdEvent: EnumCmdEvent.otaWifi });
+        event.otaCmd = value;
+        event.heiJiaoKind = kind;
+        return event;
+    }
     static wallpaper({ value, kind }) {
         const event = new CmdEvent({ cmdEvent: EnumCmdEvent.wallpaper });
         console.log("wallpaper:", value, kind)
@@ -345,6 +365,20 @@ class CmdEvent {
         event.heiJiaoKind = kind;
         return event;
     }
+    static wallPaperData({ value, kind }) {
+        const event = new CmdEvent({ cmdEvent: EnumCmdEvent.wallPaperData });
+        // console.log("wallPaperData", value, kind)
+        event.wallpaper = value;
+        event.heiJiaoKind = kind;
+        return event;
+    }
+    static wallPaperMD5({ value, kind }) {
+        const event = new CmdEvent({ cmdEvent: EnumCmdEvent.wallPaperMD5 });
+        console.log("wallPaperMD5", value, kind)
+        event.wallpaper = value;
+        event.heiJiaoKind = kind;
+        return event;
+    }
 
     static netModeAuto({ netModeAuto }) {
         const event = new CmdEvent({ cmdEvent: EnumCmdEvent.netModeAuto });
@@ -370,6 +404,12 @@ class CmdEvent {
         event.audioInfoId = audioInfoId;
         return event;
     }
+    static onoffline({ deviceId, state }) {
+        const event = new CmdEvent({ cmdEvent: EnumCmdEvent.onoffline });
+        event.commonValue = state;
+        event.deviceId = deviceId;
+        return event;
+    }
 
     static playStatus({ playStatus }) {
         const event = new CmdEvent({ cmdEvent: EnumCmdEvent.playStatus });

BIN
images/common/item_wifi.png


BIN
images/common/lock.png


BIN
images/common/wifi.png


BIN
images/common/wifi_icon.png


BIN
images/device/mode_bg.png


BIN
img/BG@2x.png


BIN
img/e1.png


BIN
img/g0.png


BIN
img/g1.png


BIN
img/jj.png


BIN
img/jx.png


BIN
img/login_agree_nor.png


BIN
img/login_agree_sel.png


BIN
img/min.png


BIN
img/nz.png


BIN
img/sj.png


BIN
img/sx.png


BIN
img/u.png


BIN
img/v.png


BIN
img/x.png


BIN
img/yy.png


+ 0 - 73
pages/about/about.js

@@ -1,73 +0,0 @@
-// pages/about/about.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    nvabarData: {
-      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
-      title: '关于我们', //导航栏 中间的标题
-    },
-  },
-  go(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
-})

+ 0 - 5
pages/about/about.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/aboutInfo/aboutInfo.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/channelDetails/channelDetails.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 8
pages/components/navbar/navbar.wxml

@@ -1,8 +0,0 @@
-<view class='nav-wrap nav-bgc-class' style='height: calc({{navBarHeight}}px - {{MenuButtonTop}}px); padding-top: {{MenuButtonTop}}px;'>
-     <view class="nav-info" style="height: {{ MenuButtonheight }}px;">
-        <view  bindtap='_navback' style="height: {{ MenuButtonheight }}px;" class="device-pic">
-          <image wx:if='{{navbarData.showCapsule}}' bindtap=""  mode="heightFix"  src="./../../../img/goback.png"></image>
-        </view>
-        <text class="nav-title-class" style="height: {{ MenuButtonheight }}px; line-height: {{ MenuButtonheight }}px;">{{navbarData.title}}</text>
-     </view>
-  </view>

+ 0 - 5
pages/connectBle/connectBle.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 4
pages/deviceConMode/index.json

@@ -1,4 +0,0 @@
-{
-  "usingComponents": {    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/deviceConnect0/deviceConnect0.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/deviceConnect1/deviceConnect1.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 32
pages/deviceConnect1/deviceConnect1.wxml

@@ -1,32 +0,0 @@
-<!--pages/deviceRoter1/deviceRoter1.wxml-->
-<!--pages/deviceRoter0/deviceRoter0.wxml-->
-<view class="deviceRoter deviceRoter1">
-  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
-  </nav-bar>
-  <view class="roterps">
-    <view class="devicePic">
-      <image mode="widthFix" src="./../../img/e.png"></image>
-    </view>
-  </view>
-  <view class="wifiInfo">
-    <view class="ssid">
-      <input placeholder="请输入WIFI名称" bindinput="setSsid" type="text" value="{{ssid}}" maxlength="30" />
-    </view>
-    <view class="ssid pwd" maxlength="30">
-      <input wx:if="{{!isShowPwd}}" class="notShow" bindinput="setPwd" password="true" placeholder="请输入WiFi密码" value="{{pwdData}}" />
-      <input wx:else class="isShow" bindinput="setPwd" placeholder="请输入WiFi密码" value="{{pwdData}}" />
-      <view class="yz" bindtap="showPwd">
-        <image mode="widthFix" src="./../../img/yj{{isShowPwd ? '1' : '0'}}.png"></image>
-      </view>
-    </view>
-    <view class="ps" wx:if="{{is5GWifi}}">
-      <image mode="widthFix" class="" src="./../../img/d.png"></image>
-      <text>该WiFi可能为5GHz WiFi,设备无法连接,请切换其他WiFi</text>
-    </view>
-  </view>
-  <view class="subBtn">
-    <view class="btn" bindtap="next">
-      下一步
-    </view>
-  </view>
-</view>

+ 0 - 5
pages/deviceConnect2/deviceConnect2.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/deviceConnect3/deviceConnect3.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 5
pages/deviceDetail/detail.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 29
pages/deviceDetail/detail.wxml

@@ -1,29 +0,0 @@
-<!-- pages/deviceDetail/detail.wxml -->
-<view class="container">
-    <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
-    <view class="img_section">
-        <image src="{{device.img}}" class="avatar"></image>
-        <!-- <image src="https://music-play.oss-cn-shenzhen.aliyuncs.com/device/20220909100711728016597.png" class="avatar"></image> -->
-    </view>
-    <view class="section">
-        <view wx:if="{{isShowWallpaper}}" class="item" bindtap="goToWallpaper">
-            <text class="label">壁纸设置</text>
-            <!-- <text class="arrow">></text> -->
-            <image class="arrow" src="../../images/common/icon_arrow.png"></image>
-        </view>
-        <view class="item" bindtap="goToAccountSecurity">
-            <view class="left-content">
-                <text class="label">省电模式</text>
-                <image class="question" bind:tap="questionTap" src="../../images/common/icon_question.png"></image>
-            </view>
-            <switch class="switch" color="#6546A3" checked="{{powerOpen}}" bindchange="powerTap" />
-        </view>
-        <view class="item" bindtap="goToOta">
-            <view class="left-content">
-                <text class="label">固件信息</text>
-                <view wx:if="{{updateData.hasNewVersion}}" class="red"></view>
-            </view>
-            <image class="arrow" src="../../images/common/icon_arrow.png"></image>
-        </view>
-    </view>
-</view>

+ 0 - 74
pages/deviceDetail/detail.wxss

@@ -1,74 +0,0 @@
-/* pages/deviceDetail/detail.wxss */
-.container {}
-
-.img_section {
-    width: 100%;
-    height: 648rpx;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-}
-
-.avatar {
-    width: 470rpx;
-    height: 432rpx;
-    background: #F2F5F7;
-    border-radius: 24rpx;
-}
-
-.section {
-    margin-bottom: 20px;
-}
-
-.title {
-    font-size: 16px;
-    font-weight: bold;
-    margin-bottom: 10px;
-}
-
-.item {
-    display: flex;
-    align-items: center;
-    border-bottom: 1px solid #e0e0e0;
-    justify-content: space-between;
-    margin-inline: 32rpx;
-    height: 120rpx;
-}
-
-.left-content {
-    display: flex;
-    align-items: center;
-}
-
-.label {
-    font-size: 16px;
-    color: #333333;
-    margin-left: 32rpx;
-}
-
-.arrow {
-    width: 20px;
-    height: 20px;
-    margin-right: 16rpx;
-}
-
-.switch {
-    width: 88rpx;
-    height: 44rpx;
-    margin-right: 16rpx;
-}
-
-.red {
-    width: 10rpx;
-    height: 10rpx;
-    margin-top: -14rpx;
-    background-color: #6546A3;
-    border-radius: 50%;
-    margin-left: 12rpx;
-}
-
-.question {
-    margin-left: 8rpx;
-    width: 40rpx;
-    height: 40rpx;
-}

+ 0 - 6
pages/deviceList/deviceList.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-
-  }
-}

+ 0 - 6
pages/deviceWake/deviceWake.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar",
-    "Toast": "./../components/toast/toast"
-  }
-}

+ 0 - 5
pages/download/download.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

Fichier diff supprimé car celui-ci est trop grand
+ 515 - 282
pages/index/index.js


+ 1 - 1
pages/index/index.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
+    "nav-bar": "./../../components/navbar/navbar"
   }
 }

+ 29 - 30
pages/index/index.wxml

@@ -1,4 +1,3 @@
-<!-- index.wxml -->
 <view class="container" style="flex-direction: column; display: flex;">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
 
@@ -7,10 +6,9 @@
     <view wx:if="{{indexPage==0}}" class="mair" style="flex-direction: column; display: flex; height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px);">
       <view style="font-size: 32rpx; color: #333333; margin-top: 14rpx;">{{greeting}}</view>
 
-      <!-- banner -->
       <view wx:if="{{bannerList.length>0}}" class="banner_container">
         <swiper class="swiper" indicator-dots="{{bannerList.length>1}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" indicator-active-color="#FFFFFF" indicator-color="#999999">
-          <block wx:for="{{bannerList}}" wx:key="index">
+          <block wx:for="{{bannerList}}" wx:key="key">
             <swiper-item>
               <image mode="widthFix" class="swiper_image" src="{{item.pic}}" data-item="{{item}}" bind:tap="onTapBanner" />
             </swiper-item>
@@ -18,26 +16,15 @@
         </swiper>
       </view>
 
-      <!-- banner -->
-      <!-- <view wx:if="{{bannerList.length>0}}" class="banner_container" style="width: calc(100vw - 64rpx);   border-radius: 16rpx;">
-        <swiper style="width: calc(100vw - 64rpx);   border-radius: 16rpx;" indicator-dots="{{bannerList.length>1}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" indicator-active-color="#FFFFFF" indicator-color="#999999">
-          <block wx:for="{{bannerList}}" wx:key="index">
-            <swiper-item style="width: calc(100vw - 64rpx); border-radius: 16rpx;">
-              <image class="banner_item" style="width: calc(100vw - 64rpx); border-radius: 16px;" src="{{item.pic}}" mode="aspectFill" bindtap="onTapBanner" data-item="{{item}}" lazy-load="true"></image>
-            </swiper-item>
-          </block>
-        </swiper>
-      </view> -->
-
       <view class="add_device_public" bind:tap="jumpToAddDevice">
         <image mode="heightFix" src="./../../img/add_device.png" style="width: 48rpx;height: 48rpx;"></image>
         <view style="color: white; margin-left: 8rpx; font-size: 32rpx;">添加设备</view>
       </view>
 
-      <scroll-view scroll-y="true" style="height: calc(100vh - 152rpx - 296rpx - 46rpx - 105rpx - {{safeBottomHeight}}rpx - 5rpx - {{navBarHeight}}px); padding-top: 10rpx; padding-bottom: 10rpx;">
-        <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
+      <scroll-view scroll-y="true" style="height: calc(100vh - 152rpx - 296rpx - 46rpx - 105rpx - {{safeBottomHeight}}rpx - 5rpx - {{navBarHeight}}px);">
+        <block wx:for="{{deviceList}}" wx:key="key" wx:for-item="item" wx:for-index="index">
 
-          <view class="item_public" style="border: {{item.state && item.state === 'online'&&deviceListSelect === index  ? '6rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}};  flex-direction: row; display: flex;" data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
+          <view class="item_public" style="border: {{item.state && item.state === 'online'&&deviceListSelect === index  ? '6rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}};  flex-direction: row; display: flex; margin-top: 10rpx; margin-bottom: {{index==0?deviceList.length-1:0}}rpx; " data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
 
             <view style="width: 264rpx; height: 200rpx;">
               <image class="item_public_image" src="{{item.imageUrl}}" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};" mode="aspectFit" lazy-load="true" webp="true"></image>
@@ -59,15 +46,23 @@
 
                   </view>
 
-                  <view style="color: #666666; font-size: 24rpx;display: flex; flex-direction: row; align-items: center;">
-                    <image mode="heightFix" src="{{item.connectType==3?'./../../images/device/wifi_black.png':'./../../images/device/blue_black.png'}}" style="width: 28rpx;height: 28rpx; padding-right: 10rpx; opacity: {{item.state && item.state === 'online' ? '1' : '0.7'}};"></image>
-                    <view style="white-space: nowrap;"> {{item.state && item.state === "online" ? (item.connectType==3?"Wifi在线":"蓝牙在线") : "离线"}} </view>
-                  </view>
+                  <view style="display: flex; flex-direction: row;">
+                    <view style="color: #666666; font-size: 24rpx;display: flex; flex-direction: row; align-items: center;">
+                      <image mode="heightFix" src="{{item.connectType==3?'./../../images/device/wifi_black.png':'./../../images/device/blue_black.png'}}" style="width: 28rpx;height: 28rpx; padding-right: 10rpx; opacity: {{item.state && item.state === 'online' ? '1' : '0.7'}};"></image>
+                      <view style="white-space: nowrap;"> {{item.state && item.state === "online" ? (item.connectType==3?"Wifi在线":"蓝牙在线") : "离线"}} </view>
+                    </view>
 
+                    <!-- <view wx:if="{{item.ProdModel=='MW-2AXD'||item.ProdModel=='MW-2XD(COZE)'}}" style="margin-left: 20rpx; padding-left: 20rpx;padding-right: 20rpx; padding-top: 5rpx; padding-bottom: 5rpx; align-items: center; justify-content: center; vertical-align: middle;background-color: #F2F5F7;  border-radius: 52rpx; text-align: center; justify-content: center;  display: flex;" data-item="{{item}}" data-index="{{index}}" catchtap="toRecharge">
+                      <view style="color: #666666; font-size: 24rpx; ">充值会员内容</view>
+                    </view> -->
+
+                  </view>
                 </view>
+
                 <view style="align-items: center; justify-content: center; vertical-align: middle;width: 280rpx;height: 64rpx;background-color: #F2F5F7;  border-radius: 52rpx; text-align: center; justify-content: center;  display: flex;" data-index="{{index}}" catchtap="deleteDevice">
                   <view style="color: #666666; font-size: 28rpx; ">删除</view>
                 </view>
+
               </view>
             </view>
           </view>
@@ -122,7 +117,6 @@
                   </view>
                 </view>
               </view>
-              <!-- <image src="./../../svg/audio.svg"></image> -->
             </view>
           </scroll-view>
           <!-- 登录启用以下版本 -->
@@ -153,11 +147,13 @@
         </view>
 
         <!-- 我的 -->
-        <view wx:elif="{{indexPage==2}}" class="me" style="height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px);">
-          <view class="head-logo">
+        <view wx:elif="{{indexPage==2}}" class="me" style="height: calc(100vh - 105rpx - {{safeBottomHeight}}rpx - 22rpx - {{navBarHeight}}px); display: flex; flex-direction: column;">
+
+          <view class="head-logo" bind:tap="{{isLogin?'':'onTapLogin'}}">
             <image mode="scaleToFill" src="{{userPic}}"></image>
             <text class="nick_name" wx:if="{{nickName}}">{{nickName}}</text>
           </view>
+
           <view class="br"></view>
           <view class="list">
             <view class="li">
@@ -165,8 +161,10 @@
                 <image mode="widthFix" style="width: 40rpx; height: 40rpx;" src="./../../img/o.png"></image>
               </view>
               <view class="button">
-                <button open-type="feedback">建议与反馈</button>
-                <image class="j" src="./../../img/b.png"></image>
+                <button class="between_text" open-type="feedback">建议与反馈</button>
+                <button class="between_image" open-type="feedback">
+                  <image class="j" src="./../../img/b.png"></image>
+                </button>
               </view>
             </view>
             <view class="li">
@@ -179,14 +177,15 @@
               </view>
             </view>
           </view>
-          <view wx:if="{{isLogin}}" class="login">
-            <view bindtap="onTapLogin" class="{{!isLogin ? 'action' : ''}}">
-              {{isLogin ? '退出登录' : "登录"}}
+          <view wx:if="{{isLogin}}" style="flex: 1;display: flex;">
+            <view class="login">
+              <view bindtap="onTapLogin" class="{{!isLogin ? 'action' : ''}}">
+                {{isLogin ? '退出登录' : "登录"}}
+              </view>
             </view>
           </view>
         </view>
       </view>
-
     </view>
 
     <view style="height: calc(105rpx + {{safeBottomHeight}}rpx); flex-direction: column; display: flex;background-color: white;">

+ 21 - 3
pages/index/index.wxss

@@ -665,6 +665,23 @@
   align-items: center;
 }
 
+
+.between_text {
+  height: 105rpx;
+  display: flex;
+  align-items: center;
+  font-size: 30rpx;
+  background-color: transparent;
+}
+
+.between_image {
+  height: 105rpx;
+  display: flex;
+  align-items: center;
+  background-color: transparent;
+  justify-content: flex-end;
+}
+
 .me .list .li .button button,
 .me .list .li .button text {
   margin: 0;
@@ -685,11 +702,12 @@
   right: 0rpx;
 }
 
+/* position: fixed; display: flex; */
 .login {
-  position: fixed;
-  bottom: 184rpx;
-  width: 100vw;
   display: flex;
+  width: 100vw;
+  align-items: flex-end;
+  margin-bottom: 50rpx;
   justify-content: center;
 }
 

+ 0 - 5
pages/login/login.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 18
pages/login/login.wxml

@@ -1,18 +0,0 @@
-<!--pages/login/login.wxml-->
-<view class="login">
-  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
-  </nav-bar>
-  <view class="mair">
-    <image mode="widthFix" src="./../../img/k.png"></image>
-    <view class="loginbut">
-      <view class="mode" wx:if="{{!isAgree}}" catchtap="notlogin"></view>
-      <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快速登录</button>
-    </view>
-    <view class="ys">
-      <image bindtap="egree" mode="aspectFill" src="./../../img/{{isAgree ? 'h' : 'j'}}.png"></image>
-      <view>我已阅读并同意<text data-index="0"  bindtap="goabout">《猫王妙播用户服务协议》</text>
-        <text data-index="1"  bindtap="goabout">《猫王妙播用户隐私协议》</text></view>
-    </view>
-  </view>
-  <!-- <view wx:if="{{isYs}}"><web-view src="https://ohplay.radio1964.net/privacy/protocol"></web-view></view> -->
-</view>

+ 0 - 358
pages/ota/ota.js

@@ -1,358 +0,0 @@
-const { BtHelper } = require("../../devices/bt_helper");
-import { EnumCmdEvent, CmdEvent } from '../../devices/cmd_key_event';
-import EventManager from '../../utils/event_bus'
-// pages/OTA/ota.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    navbarData: {
-      showCapsule: 1, //
-      title: '固件信息',
-    },
-    device: {},
-    otaData: {},
-    btHelper: null,
-    progress: 0, // 进度条初始值
-    otaStatus: 0,
-    buttonTips: "固件更新",
-    _chunks: [],
-    progressPercent: 0,
-    progress: 0,
-    progressTextLeft: "0%",
-    _timer: null,
-  },
-  setOtaStatus(status) {
-    switch (status) {
-      case 0:
-        this.setData({
-          otaStatus: 0,
-          buttonTips: "固件更新"
-        });
-        break;
-      case 1:
-        this.setData({
-          otaStatus: 1,
-          buttonTips: "下载升级包"
-        });
-        break;
-      case 2:
-        this.setData({
-          otaStatus: 2,
-          buttonTips: "开始更新"
-        });
-        break;
-      case 3:
-        this.setData({
-          otaStatus: 3,
-          buttonTips: "更新中..."
-        });
-        break;
-
-      case 4:
-        this.setData({
-          otaStatus: 4,
-          buttonTips: "更新失败,再试一次"
-        });
-        break;
-      default:
-        break;
-    }
-
-  },
-  startOtaTap() {
-    let online = this.data.device.state === "online"
-    if (!online) {
-      wx.showToast({
-        title: '设备已经掉线了',
-      })
-      return;
-    }
-
-    let hasNewVersion = this.data.otaData.hasNewVersion ?? false
-    if (!hasNewVersion) {
-      wx.showToast({
-        title: '没有可升级的固件',
-      })
-      return;
-    }
-
-    let _this = this
-    wx.showModal({
-      title: '有新固件可升级',
-      content: _this.data.otaData.content ?? '提升体验,操作更流畅',
-      cancelText: '以后再说',
-      confirmText: '升级',
-      complete: (res) => {
-        if (res.cancel) {
-
-        }
-
-        if (res.confirm) {
-          _this.startDownloadFile()
-          // _this.downloadOtaFile(_this.data.otaData.url ?? "")
-        }
-      }
-    })
-    // const btHelper = BtHelper.getInstance();
-    // btHelper.ota(this.data.otaData.file_url)
-
-  },
-  startDownloadFile() {
-
-    var urlPath = this.data.otaData.url ?? "";
-
-    var list = urlPath.split("/");
-    // let cachePath = await PathUtil.getDownloadPath(fileName: list.last ?? 'OTAUpgrade.OTA');
-    const fs = wx.getFileSystemManager();
-
-    // 构建本地文件路径
-    var localFilePath = list[list.length - 1];
-    console.log(list, localFilePath)
-
-    let _this = this;
-    let localPath = `${wx.env.USER_DATA_PATH}/` + localFilePath
-    // 判断文件是否存在
-    fs.access({
-      path: localPath,
-      success(res) {
-        console.log('文件已存在:', res);
-
-        if (res) {
-          // 有文件
-          _this.readFile(localPath);
-
-        } else {
-
-        }
-      }, fail(err) {
-        // 文件不存在或其他错误
-        console.log(err)
-        // 文件不存在,开始下载
-        _this.downloadOtaFile(urlPath, localPath)
-      }
-    }
-    );
-  },
-  downloadOtaFile(urlPath, localPath) {
-    let _this = this;
-    // const fs = wx.getFileSystemManager();
-
-    wx.downloadFile({
-      url: urlPath, // 下载资源的URL
-      success: (res) => {
-        console.log('文件下载成功2', res);
-
-        if (res.statusCode === 200) {
-          // 下载成功,保存文件路径
-          const filePath = res.tempFilePath;
-          // _this.readFile(filePath);
-          _this.readFile(filePath);
-
-          // 将下载的文件移动到本地路径
-          // fs.rename({
-          //   oldPath: filePath,
-          //   newPath: localPath,
-          //   success: () => {
-
-          //     // this.setData({
-          //     //   localFilePath: localFilePath
-          //     // });
-
-          //     // 调用 OTA 更新方法
-          //     // const btHelper = BtHelper.getInstance();
-          //     // btHelper.ota(localFilePath);
-
-          //     wx.showToast({
-          //       title: '文件下载成功',
-          //     });
-          //     _this.readFile(localPath);
-          //   },
-          //   fail: (err) => {
-          //     wx.showToast({
-          //       title: '下载文件失败,检查下手机内存吧',
-          //     });
-          //     console.error('文件移动失败:', err);
-          //   }
-          // });
-        } else {
-          wx.showToast({
-            title: '文件下载失败',
-          });
-        }
-      },
-      fail: (err) => {
-        wx.showToast({
-          title: '文件下载失败',
-        });
-        console.error('下载文件失败:', err);
-      }
-    });
-  },
-  readFile(localFilePath) {
-
-    if (!localFilePath) {
-      wx.showToast({
-        title: '下载文件为空',
-      });
-      return;
-    }
-    wx.showLoading({
-      title: '开始传输文件',
-    })
-    this.setOtaStatus(2);
-    const fs = wx.getFileSystemManager();
-
-    let _this = this;
-    fs.readFile({
-      filePath: localFilePath,
-      encoding: 'base64', // 可以选择 'utf8' 或 'base64'
-      success: (res) => {
-
-        // const btHelper = BtHelper.getInstance();
-        //   btHelper.ota(localFilePath);
-
-        console.log('文件内容:', res.data.length);
-
-        _this.startSend(res.data);
-      },
-      fail: (err) => {
-        wx.showToast({
-          title: 'OTA文件下载失败',
-        });
-        console.error('文件读取失败:', err);
-      }
-    });
-  },
-  startSend(data) {
-    const chunkSize = 20; // 每次发送的数据块大小
-    const chunks = [];
-    for (let i = 0; i < data.length; i += chunkSize) {
-      chunks.push(data.slice(i, i + chunkSize));
-    }
-
-    this.data._chunks = chunks;
-    this.endOta(1)
-    // this.startSendOtaData()
-  },
-
-  startSendOtaData() {
-    let _this = this
-    let length = this.data._chunks.length
-
-    if (length === 0) {
-      wx.showToast({
-        title: '图片裁剪失败',
-        icon: 'none'
-      })
-      _this.endOta(2)
-      return;
-    }
-    _this.sendOtaData(this.data._chunks, 0)
-    // }
-  }, sendOtaData(imageBuffer, index) {
-    let _this = this
-
-    if (index >= imageBuffer.length) {
-      _this.endOta(0)
-      return;
-    }
-    let chunkSize = 20;
-
-
-    let total = imageBuffer.length
-    let next = index + chunkSize;
-    const chunk = imageBuffer.slice(index, next);
-    BtHelper.getInstance().wallPaperData(chunk, function (res) {
-      console.log("发送OTA数据:", next)
-      if (res) {
-        _this.updateProgress(next, total);
-
-        _this.sendOtaData(imageBuffer)
-      } else {
-        wx.showModal({
-          title: 'OTA升级失败了',
-          showCancel: false
-        })
-      }
-    })
-
-  },
-  endOta(value) {
-    BtHelper.getInstance().otaCmd(value)
-  },
-
-  startProgress() {
-    this.setData({
-      progress: 0,
-      showProgress: true
-    })
-  },
-  updateProgress(chunk, total) {
-    let progress = chunk / total * 100;
-    let _this = this
-    if (progress >= 100) {
-      _this.setData({
-        progress: 0,
-        showProgress: false,
-        // showCropImg: false
-      });
-      wx.showToast({
-        title: '图片上传成功',
-      })
-    } else {
-      _this.setData({
-        progress: progress,
-      });
-    }
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-    let param = JSON.parse(options.param)
-    console.log("OTA界面:", param)
-    let otaData = param.otaData
-    let device = param.device
-    this.setData({
-      otaData: otaData,
-      device: device,
-      isShowOta: device.clientType === 'MW-S2(BLE)' || device.clientType === 'MW-S2'
-    })
-
-    let _this = this;
-    EventManager.addNotification(CmdEvent.eventName, function (event) {
-      let name = event.cmdEvent;
-      console.log("OTA页0:", name, EnumCmdEvent.otaCmd, EnumCmdEvent.otaCmd === name)
-
-      switch (name) {
-        case EnumCmdEvent.otaCmd:
-          let otaCmd = event.otaCmd;
-          let kind = event.heiJiaoKind;
-          console.log("OTA页:", otaCmd, kind)
-
-          if (otaCmd === 1 && kind == 1) {
-            wx.hideLoading();
-            // 开始发送
-            _this.startSendOtaData()
-          } else if (otaCmd === 0 && kind == 1) {
-            // 发送结束
-            _this.endOta(0)
-          } else if (kind == 0) {
-            wx.hideLoading()
-            wx.showModal({
-              title: 'OTA升级失败了',
-              showCancel: false
-            })
-          }
-          break;
-      }
-    }, this)
-  },
-  onUnload() {
-    EventManager.removeNotification(CmdEvent.eventName, this)
-  },
-
-})

+ 0 - 5
pages/ota/ota.json

@@ -1,5 +0,0 @@
-{
-  "usingComponents": {
-    "nav-bar": "./../components/navbar/navbar"
-  }
-}

+ 0 - 33
pages/ota/ota.wxml

@@ -1,33 +0,0 @@
-<!-- pages/OTA/ota.wxml -->
-<view class="section">
-    <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{navbarData}}'></nav-bar>
-    <view style="height: 32rpx;"></view>
-    <view class="item">
-        <text class="label">制造商</text>
-        <text class="arrow">AirSmart</text>
-    </view>
-    <view class="item">
-        <text class="label">产品型号</text>
-        <text class="arrow">{{device.clientType}}</text>
-    </view>
-    <view class="item">
-        <text class="label">MAC地址</text>
-        <text class="arrow">{{device.mac}}</text>
-    </view>
-    <view wx:if="{{isShowOta}}" class="button main_color" bind:tap="startOtaTap">
-        {{buttonTips}}
-    </view>
-</view>
-<view wx:if="{{otaStatus === 3}}" class="background">
-    <view class="content">
-        <view class="pro_title">正在升级</view>
-        <view class="progress-container">
-            <progress class="progress" border-radius="16rpx" stroke-width="32rpx" percent="{{progress}}" activeColor="rgba(101, 70, 163, 1)" backgroundColor="rgba(101,70,163,0.16)" stroke-width="26" border-radius="13" />
-            <view class="progress-text" style="left: {{progressTextLeft}};">
-                {{progressPercent}}%
-            </view>
-        </view>
-        <view class="pro_tips">升级过程中请勿离开当前页面
-建议保持设备电量20%已上进行升级操作</view>
-    </view>
-</view>

+ 0 - 100
pages/ota/ota.wxss

@@ -1,100 +0,0 @@
-/* pages/OTA/ota.wxss */
-
-
-
-
-.item {
-	display: flex;
-	align-items: center;
-	border-bottom: 1px solid #e0e0e0;
-	justify-content: space-between;
-	margin-inline: 32rpx;
-	height: 120rpx;
-}
-
-
-.label {
-	font-size: 16px;
-	color: #333333;
-	margin-left: 32rpx;
-}
-
-.arrow {
-	margin-right: 16rpx;
-}
-
-.button {
-	margin-top: 128rpx;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	margin-inline: 64rpx;
-	font-size: 32rpx;
-	font-weight: Medium;
-	color: white;
-	text-align: center;
-	border-radius: 44rpx;
-	height: 88rpx;
-}
-
-
-.background {
-	position: fixed;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	background-color: rgba(0, 0, 0, 0.7);
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	z-index: 1000;
-}
-
-.content {
-	background-color: white;
-	padding-inline: 20px;
-	border-radius: 10px;
-	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
-	width: 558rpx;
-	height: 404rpx;
-}
-
-.pro_title {
-	font-weight: 500;
-	font-size: 32rpx;
-	color: #333333;
-	text-align: center;
-	font-style: normal;
-	margin-top: 64rpx;
-}
-
-.progress-container {
-	position: relative;
-	margin-inline: 32rpx;
-	margin-top: 46rpx;
-	/* 根据需要调整 */
-}
-
-.progress {
-	width: 100%;
-}
-
-.progress-text {
-	position: absolute;
-	top: 50%;
-	transform: translateY(-50%);
-	color: white;
-	font-size: 16px;
-	z-index: 1;
-	white-space: nowrap;
-}
-
-.pro_tips {
-	margin-top: 48rpx;
-	margin-inline: 34rpx;
-	font-size: 28rpx;
-	color: #666666;
-	text-align: center;
-	font-style: normal;
-}

Fichier diff supprimé car celui-ci est trop grand
+ 16 - 21
pages/deviceList/deviceList.js


+ 5 - 0
pages/pageA/deviceList/deviceList.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

pages/deviceList/deviceList.wxml → pages/pageA/deviceList/deviceList.wxml


pages/deviceList/deviceList.wxss → pages/pageA/deviceList/deviceList.wxss


+ 18 - 13
pages/login/login.js

@@ -1,10 +1,4 @@
-const {
-  login,
-  register
-} = require('./../../utils/api.js')
-
-import route_constant from '../../utils/route_constant.js';
-import route_util from '../../utils/route_util.js';
+const constant = require('../../../utils/constant.js');
 
 Page({
 
@@ -15,6 +9,13 @@ Page({
     },
     isYs: false,
     isAgree: false,
+    toDeviceList: false,
+  },
+
+  onLoad(options) {
+    var that = this;
+    var toDeviceList = options.toDeviceList;
+    that.data.toDeviceList = toDeviceList;
   },
 
   egree() {
@@ -24,12 +25,12 @@ Page({
   },
 
   goabout(e) {
-    wx.navigateTo({
-      url: './../aboutInfo/aboutInfo?type=' + e.currentTarget.dataset.index,
-    })
+    var param = '?type=' + e.currentTarget.dataset.index;
+    constant.routeUtil.jumpParam(constant.routePath.aboutInfo, param);
   },
 
   getPhoneNumber(e) {
+    var that = this;
     if (e.detail.errMsg != "getPhoneNumber:ok") {
       wx.showToast({
         title: "获取手机号失败",
@@ -47,11 +48,11 @@ Page({
             title: '加载中',
           });
           // {"openid":"oZHPJ5JcNem2och3ToaocggmUENw","unionid":null,"userId":null,"deviceUid":null,"accessToken":null,"phone":null,"headUrl":"","nickname":"","isNewUser":true}
-          login({
+          constant.apiUtil.login({
             code: res1.code,
             unShowLoad: true,
           }).then((res2) => {
-            register({
+            constant.apiUtil.register({
               openid: res2.openid,
               code: phoneCode,
               unShowLoad: true,
@@ -65,7 +66,11 @@ Page({
                 });
               }, function () {
                 setTimeout(() => {
-                  route_util.redirectTo(route_constant.deviceList);
+                  if (that.data.toDeviceList) {
+                    constant.routeUtil.redirectTo(constant.routePath.deviceList);
+                  } else {
+                    constant.routeUtil.goBack(1);
+                  }
                 }, 2000);
               }, function () {
                 wx.hideLoading();

+ 5 - 0
pages/pageA/login/login.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 17 - 0
pages/pageA/login/login.wxml

@@ -0,0 +1,17 @@
+<view class="login">
+  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
+  </nav-bar>
+  <view class="mair">
+    <image mode="widthFix" src="./../../../img/k.png"></image>
+    <view class="loginbut">
+      <view class="mode" wx:if="{{!isAgree}}" catchtap="notlogin"></view>
+      <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快速登录</button>
+    </view>
+    <view class="ys">
+      <image style="margin-top: 5rpx;" bindtap="egree" mode="aspectFill" src="./../../../img/login_agree_{{isAgree ? 'sel' : 'nor'}}.png"></image>
+      <view>我已阅读并同意<text data-index="0" style="color: #A4D099;" bindtap="goabout">《猫王妙播用户服务协议》</text>
+        <text data-index="1" style="color: #A4D099;" bindtap="goabout">《猫王妙播用户隐私协议》</text>
+      </view>
+    </view>
+  </view>
+</view>

+ 0 - 1
pages/login/login.wxss

@@ -1,4 +1,3 @@
-/* pages/login/login.wxss */
 .login{
   width: 100vw;
   height: 100vh;

+ 26 - 20
pages/connectBle/connectBle.js

@@ -1,9 +1,9 @@
 const {
   BtHelper
-} = require('../../devices/bt_helper');
+} = require('../../../devices/bt_helper');
+
+const constant = require('../../../utils/constant.js');
 
-import route_constant from '../../utils/route_constant.js'
-import route_util from '../../utils/route_util.js';
 Page({
   data: {
     connectDevice: {},
@@ -21,14 +21,18 @@ Page({
   onLoad(options) {
     var that = this;
     var json = JSON.parse(options.param)
-    console.log("要连接设备:", json)
 
     BtHelper.getInstance().initBluetoothAdapter();
     BtHelper.getInstance().getBluetoothDevices();
 
-    that.setData({
-      connectDevice: json
-    });
+
+    if (json) {
+      that.data.connectDevice = json;
+      that.setData({
+        connectDevice: json
+      });
+    }
+
     that.startSearch();
   },
 
@@ -37,19 +41,21 @@ Page({
     var that = this;
     that.setStatus(0);
     var connectDevice = that.data.connectDevice;
+    console.log("要连接设备:", connectDevice)
     BtHelper.getInstance().startScan(connectDevice,
       async function (b) {
-        if (!b) {
-          that.setStatus(1);
+          if (!b) {
+            that.setStatus(1);
+          }
+        },
+        async function (res) {
+          await BtHelper.getInstance().stopSearch();
+          console.log("搜索到设备11:", res);
+          that.setStatus(2);
+          that.data.connectDevice.deviceId = res.deviceId;
+          that.data.connectDevice.connectable = res.connectable;
+          that.data.connectDevice.mac = res.mac;
         }
-      },
-      async function (res) {
-        await BtHelper.getInstance().stopSearch();
-        that.setStatus(2);
-        that.data.connectDevice.deviceId = res.deviceId;
-        that.data.connectDevice.connectable = res.connectable;
-        that.data.connectDevice.mac = res.mac;
-      }
     );
   },
 
@@ -59,7 +65,7 @@ Page({
     var connectDevice = that.data.connectDevice;
     var isTheSame = getCurrentPages()[0].isTheSameBlue(connectDevice);
     if (isTheSame) {
-      route_util.goBackRoute(route_constant.indexRoot);
+      constant.routeUtil.goBackRoute(constant.routeRoot.index);
       return;
     }
 
@@ -76,9 +82,9 @@ Page({
         device.state = 'online';
         device.imageUrl = device.img;
         getCurrentPages()[0].addBlueDevice(device);
-        route_util.goBackRoute(route_constant.indexRoot);
+        constant.routeUtil.goBackRoute(constant.routeRoot.index);
       }
-    });
+    }, true);
   },
 
   ///连接设备按钮

+ 5 - 0
pages/pageB/connectBle/connectBle.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 0 - 1
pages/connectBle/connectBle.wxml

@@ -1,4 +1,3 @@
-<!-- pages/connectBle/connectBle.wxml -->
 <view class="container">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
   <image class="device_pic" src="{{deviceImg}}" mode="aspectFill" />

+ 0 - 1
pages/connectBle/connectBle.wxss

@@ -1,4 +1,3 @@
-/* pages/connectBle/connectBle.wxss */
 .container {
 	position: relative;
 	height: 100vh;

+ 11 - 14
pages/deviceConnect0/deviceConnect0.js

@@ -1,7 +1,4 @@
-const app = getApp();
-import strings from '../../utils/strings.js';
-import route_util from '../../utils/route_util.js';
-import route_constant from '../../utils/route_constant.js'
+const constant = require('../../../utils/constant.js');
 
 Page({
   data: {
@@ -13,7 +10,7 @@ Page({
     userFuzzyLocation: true,
     isNotruter: false,
     connectDevice: {},
-    imageUrl: "./../../img/c.png",
+    imageUrl: "./../../../img/c.png",
   },
 
   ///定位,蓝牙权限,蓝牙适配器
@@ -22,13 +19,13 @@ Page({
   onLoad(options) {
     var that = this;
     var param = options.param;
-    if (!strings.isEmpty(param)) {
+    if (!constant.strings.isEmpty(param)) {
       param = JSON.parse(param);
       that.data.connectDevice = param;
-      if (!strings.isEmpty(param.typeList)) {
+      if (!constant.strings.isEmpty(param.typeList)) {
         var typeList = param.typeList;
         typeList = typeList.filter((v) => v.connectType == 3);
-        if (!strings.isEmpty(typeList)) {
+        if (!constant.strings.isEmpty(typeList)) {
           that.setData({
             imageUrl: typeList[0].deviceLinkResp.icon1,
           });
@@ -46,7 +43,7 @@ Page({
           showCapsule: 1,
           title: '连接配网',
           callback: () => {
-            route_util.goBackRoute(route_constant.indexRoot);
+            constant.routeUtil.goBackRoute(constant.routeRoot.index);
           }
         },
       })
@@ -59,7 +56,7 @@ Page({
     wx.getSetting({
       success(res) {
         if (res.authSetting["scope.userFuzzyLocation"]) {
-          app.getBluetoothStatus();
+          constant.app.getBluetoothStatus();
           that.setData({
             userFuzzyLocation: true,
           });
@@ -107,8 +104,8 @@ Page({
     wx.openBluetoothAdapter({
       success(res) {
         if (that.data.scopeBluetooth && that.data.userFuzzyLocation) {
-          var param = JSON.stringify(that.data.connectDevice);
-          route_util.jumpParam(route_constant.deviceConnect1, param);
+          var param = "?param=" + JSON.stringify(that.data.connectDevice);
+          constant.routeUtil.jumpParam(constant.routePath.deviceConnect1, param);
         }
       },
       fail(res) {
@@ -137,14 +134,14 @@ Page({
   setBluetooth() {
     wx.openSetting({
       complete() {
-        // app.getBluetoothStatus();
+        //constant.app.getBluetoothStatus();
       }
     })
   },
 
   ///返回到首页
   notRoter() {
-    route_util.goBackRoute(route_constant.indexRoot);
+    constant.routeUtil.goBackRoute(constant.routeRoot.index);
   },
 
   onUnload() {

+ 5 - 0
pages/pageB/deviceConnect0/deviceConnect0.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 3 - 4
pages/deviceConnect0/deviceConnect0.wxml

@@ -1,4 +1,3 @@
-<!--pages/deviceRoter0/deviceRoter0.wxml-->
 <view class="deviceRoter deviceRoter0">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
   </nav-bar>
@@ -10,11 +9,11 @@
       起后,即可进入下一步</text>
     <view wx:if="{{!scopeBluetooth && userFuzzyLocation}}" class="qx">
       <text bindtap="setBluetooth">开启蓝牙权限</text>
-      <image mode="heightFix" src="./../../img/a.png"></image>
+      <image src="./../../../img/a.png" style="width: 16rpx;height: 28rpx;"></image>
     </view>
     <view wx:if="{{!userFuzzyLocation}}" class="qx">
       <text bindtap="setUserFuzzyLocation">开启定位权限</text>
-      <image mode="heightFix" src="./../../img/a.png"></image>
+      <image src="./../../../img/a.png" style="width: 16rpx;height: 28rpx;"></image>
     </view>
   </view>
   <view class="subBtn">
@@ -23,7 +22,7 @@
     </view>
     <view class="notRoter" wx:if="{{isNotruter}}">
       <text bindtap="notRoter">暂不链接</text>
-      <image mode="heightFix" src="./../../img/b.png"></image>
+      <image mode="heightFix" src="./../../../img/b.png"></image>
     </view>
   </view>
 </view>

pages/deviceConnect0/deviceConnect0.wxss → pages/pageB/deviceConnect0/deviceConnect0.wxss


+ 50 - 14
pages/deviceConnect1/deviceConnect1.js

@@ -1,6 +1,4 @@
-const app = getApp();
-import route_util from '../../utils/route_util.js';
-import route_constant from '../../utils/route_constant.js'
+const constant = require('../../../utils/constant.js');
 
 Page({
   data: {
@@ -8,19 +6,43 @@ Page({
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
       title: '设置网络', //导航栏 中间的标题
     },
-    scopeBluetooth: app.globalData.scopeBluetooth,
+    scopeBluetooth: constant.app.globalData.scopeBluetooth,
     isShowPwd: false,
     is5GWifi: false,
+    isIOS: false,
     ssid: "",
     pwdData: "",
-    pwdData1: "",
     connectDevice: "",
+    is5gDevice: false,
   },
 
   onLoad(options) {
     var that = this;
     var param = options.param;
     that.data.connectDevice = param;
+
+    var device = JSON.parse(param);
+    var typeList = device.typeList;
+    if (!constant.strings.isEmpty(typeList)) {
+      var targetList = typeList.filter((v) => v.connectType == 3);
+      if (!constant.strings.isEmpty(targetList)) {
+        /// 字段,含义为是否支持5G:1-是 0-否;
+        var is5g = targetList[0].is5g;
+        if (is5g == 1) {
+          that.setData({
+            is5gDevice: true,
+          });
+        }
+      }
+    }
+
+    const res = wx.getSystemInfoSync(); // 获取系统信息
+    /// android ios
+    const platform = res.platform; // 获取平台类型
+    this.setData({
+      isIOS: platform === 'ios',
+      isShowPwd: true,
+    });
   },
 
   onShow() {
@@ -29,7 +51,7 @@ Page({
   },
 
   getBluetoothStatus() {
-    app.getBluetoothStatus();
+    constant.app.getBluetoothStatus();
   },
 
   ///Wifi名称
@@ -45,10 +67,17 @@ Page({
     });
   },
 
+  onFocus(event) {
+    console.log("onFocus:", event)
+    if (event.detail.value !== this.data.pwdData) {
+      this.setPwd(event);
+    }
+  },
+
   ///Wifi名称
   setPwd: function (e) {
+    console.log("设置密码:", e.detail.value)
     var that = this;
-    app.globalData.pwdData = e.detail.value;
     that.setData({
       pwdData: e.detail.value,
     });
@@ -79,14 +108,16 @@ Page({
                     });
                   };
 
-                  app.globalData.ssid = ssid;
+                  constant.app.globalData.ssid = ssid;
                   wx.getStorage({
                     key: 'wifiInfo',
-                    success(wifiInfo) {
-                      const resData = JSON.parse(wifiInfo.data);
+                    success(wifiRes) {
+                      console.log("wifiInfo:", wifiRes)
+                      const resData = JSON.parse(wifiRes.data ?? "{}") ?? {};
+                      console.log("wifiInfo2:", resData)
                       if (resData.ssid === res.wifi.SSID) {
                         that.setData({
-                          pwdData: resData.password,
+                          pwdData: resData.password ?? "",
                         });
                       }
                     }
@@ -121,10 +152,11 @@ Page({
       return;
     };
 
-    app.globalData.ssid = that.data.ssid;
-    app.globalData.pwdData = that.data.pwdData;
-    route_util.jumpParam(route_constant.deviceConnect2, that.data.connectDevice);
+    constant.app.globalData.ssid = that.data.ssid;
+    constant.app.globalData.pwdData = that.data.pwdData;
 
+    var param = "?param=" + that.data.connectDevice;
+    constant.routeUtil.jumpParam(constant.routePath.deviceConnect2, param);
   },
 
   notRoter() {
@@ -140,4 +172,8 @@ Page({
     })
   },
 
+  onUnload: function () {
+    var that = this;
+  },
+
 })

+ 5 - 0
pages/pageB/deviceConnect1/deviceConnect1.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 27 - 0
pages/pageB/deviceConnect1/deviceConnect1.wxml

@@ -0,0 +1,27 @@
+<view class="deviceRoter deviceRoter1">
+  <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
+  <view class="roterps">
+    <view class="devicePic">
+      <image mode="widthFix" src="{{is5gDevice?'./../../../img/e1.png':'./../../../img/e.png'}}"></image>
+    </view>
+  </view>
+  <view class="wifiInfo">
+    <view class="ssid">
+      <input placeholder="请输入WIFI名称" bindinput="setSsid" type="text" value="{{ssid}}" maxlength="30" focus="false" />
+    </view>
+    <view class="ssid pwd" maxlength="30">
+      <input wx:if="{{!isShowPwd}}" id="passwordInput" class="notShow" bindinput="setPwd" bindfocus="onFocus" bindblur="onBlur" password="true" placeholder="请输入WiFi密码" value="{{pwdData}}" />
+      <input wx:else class="isShow" id="nopasswordInput" bindinput="setPwd" type="text" placeholder="请输入WiFi密码" value="{{pwdData}}" />
+      <view class="yz" bindtap="showPwd">
+        <image wx:if="{{!isIOS}}" mode="widthFix" src="./../../../img/yj{{isShowPwd ? '1' : '0'}}.png"></image>
+      </view>
+    </view>
+    <view class="ps" wx:if="{{is5GWifi}}">
+      <image mode="widthFix" class="" src="./../../../img/d.png"></image>
+      <text>该WiFi可能为5GHz WiFi,设备无法连接,请切换其他WiFi</text>
+    </view>
+  </view>
+  <view class="subBtn">
+    <view class="btn" bindtap="next">下一步</view>
+  </view>
+</view>

+ 8 - 3
pages/deviceConnect1/deviceConnect1.wxss

@@ -3,7 +3,12 @@
   padding: 0 66rpx;
 }
 
-.deviceRoter1 .wifiInfo > view.ssid {
+.fake-password {
+  /* 自定义密文样式 */
+  -webkit-text-security: disc;
+}
+
+.deviceRoter1 .wifiInfo>view.ssid {
   width: calc(100vw - 136rpx);
   height: 96rpx;
   border-radius: 48rpx;
@@ -14,7 +19,7 @@
   justify-content: center;
 }
 
-.deviceRoter1 .wifiInfo > view.ssid input {
+.deviceRoter1 .wifiInfo>view.ssid input {
   width: calc(100% - 104rpx);
   height: 98rpx;
   line-height: 98rpx;
@@ -59,4 +64,4 @@
   line-height: 48rpx;
   color: #FA5151;
   width: calc(100% - 68rpx);
-}
+}

+ 80 - 51
pages/deviceConnect2/deviceConnect2.js

@@ -1,7 +1,11 @@
 const app = getApp();
-let xBlufi = require("../../utils/blufi/xBlufi.js");
-import strings from '../../utils/strings.js';
-import lexin_devices from '../../utils/lexin/devices';
+let xBlufi = require("../../../utils/blufi/xBlufi.js");
+import strings from '../../../utils/strings.js';
+import lexin_devices from '../../../utils/lexin/devices';
+import junzhengUtil from '../../../utils/junzheng/util';
+import routeUtil from '../../../utils/routeUtil.js';
+import routePath from '../../../utils/routePath.js';
+
 Page({
 
   data: {
@@ -18,15 +22,14 @@ Page({
     deviceInfo: null,
     isInitOK: false,
     customData: '',
-    isOne: true,
     isSubmit: false,
     islanya: false,
-    isOnBluetooth: false,
-    imageUrl: "./../../img/f.png",
+    imageUrl: "./../../../img/f.png",
     connectDevice: {},
   },
 
   onLoad(options) {
+    console.log("开始搜索")
     const that = this;
     var param = options.param;
     if (!strings.isEmpty(param)) {
@@ -43,33 +46,25 @@ Page({
       }
     }
 
-    const isOne = setTimeout(() => {
-      clearTimeout(isOne);
-      if (that.data.isOne) {
-        that.setData({
-          isOne: false,
-        });
-      }
-    }, 2000);
-
     if (app.globalData.oneInitBluetooth) {
       app.globalData.oneInitBluetooth = false;
       xBlufi.initXBlufi(1);
     };
 
     xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
-    that.Search();
+    that.search();
   },
 
-  onShow() {
-    var that = this;
-    if (!that.data.isOne) {
-      that.Search();
-    }
+
+  ///停止搜索
+  stopSearch: function () {
+    xBlufi.notifyStartDiscoverBle({
+      'isStart': false,
+    });
   },
 
   ///开始或结束,也可以过滤名称
-  Search: function () {
+  search: function () {
     xBlufi.notifyStartDiscoverBle({
       'isStart': true,
     });
@@ -79,7 +74,7 @@ Page({
   // {"type":"1","result":true,"data":[{"deviceId":"57:F6:7D:62:D6:C0","name":"","RSSI":-97,"connectable":true,"advertisData":"4c0010072a1fbee24315680100100000000000000000000000000000","advertisServiceUUIDs":[],"localName":"","serviceData":{}}]}
   // {"type":"1","result":true,"data":[{"deviceId":"57:F6:7D:62:D6:C0","name":"","RSSI":-97,"connectable":true,"advertisData":"4c0010072a1fbee24315680100100000000000000000000000000000","advertisServiceUUIDs":[],"localName":"","serviceData":{}},{"deviceId":"42:E0:22:C2:6E:25","name":"","RSSI":-92,"connectable":true,"advertisData":"4c001007221fa8d7a84ba8","advertisServiceUUIDs":[],"localName":"","serviceData":{}}]}
   funListenDeviceMsgEvent: function (options) {
-    const that = this;
+    var that = this;
     switch (options.type) {
       //发现设备列表回调开始
       case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
@@ -100,13 +95,31 @@ Page({
         // [{"deviceId":"7C:DF:A1:FD:3A:F2","name":"BLUFI_7cdfa1fd3af0","RSSI":-62,"connectable":true,"advertisData":"","advertisServiceUUIDs":["0000FFFF-0000-1000-8000-00805F9B34FB"],"localName":"BLUFI_7cdfa1fd3af0","serviceData":{}}]
         ///发现设备列表回调
       case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
+
         // 搜索到蓝牙
         if (options.result) {
           var devicesList = options.data.filter((v) => {
-            return v.name.indexOf(lexin_devices.leXin) !== -1;
+            var name = v.name;
+            var isLexin = name.indexOf(lexin_devices.leXin) !== -1;
+            var isJungzheng1 = junzhengUtil.isJungzheng1(name);
+            var isJungzheng2 = junzhengUtil.isJungzheng2(name);
+
+            return isLexin || isJungzheng1 || isJungzheng2;
+
+            // var localName = v.localName;
+            // var isLexin1 = localName.indexOf(lexin_devices.leXin) !== -1;
+            // var isJungzheng3 = junzhengUtil.isJungzheng1(localName);
+            // var isJungzheng4 = junzhengUtil.isJungzheng2(localName);
+            // return isLexin || isJungzheng1 || isJungzheng2 || isLexin1 || isJungzheng3 || isJungzheng4;
+            ///2AXD
+            // return v.name == "AIrSMArT_d0311004155e";
+            ///X4
+            // return v.name == "AIrSMArT_861210052356337";
           });
 
           if (!strings.isEmpty(devicesList)) {
+            console.log("打印4", JSON.stringify(devicesList))
+
             ///过滤乐鑫设备
             that.setData({
               islanya: true,
@@ -122,26 +135,14 @@ Page({
       case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
         wx.hideLoading();
         if (options.result) {
-          if (that.data.isOnBluetooth) {
-            return;
-          };
-
           that.setData({
-            isOnBluetooth: true,
+            islanya: false,
+            devicesList: [],
           });
 
-          setTimeout(() => {
-            that.setData({
-              isSubmit: false,
-              islanya: false,
-              devicesList: [],
-              isOnBluetooth: false,
-            });
-            var param = JSON.stringify(that.data.connectDevice);
-            wx.navigateTo({
-              url: '../deviceConnect3/deviceConnect3?deviceId=' + options.data.deviceId + '&name=' + options.data.name + "&param=" + param,
-            });
-          }, 200);
+          var p = JSON.stringify(that.data.connectDevice);
+          var param = '?deviceId=' + options.data.deviceId + '&name=' + options.data.name + "&param=" + p;
+          routeUtil.jumpParam(routePath.deviceConnect3, param);
         } else {
           wx.showModal({
             title: '提示',
@@ -180,27 +181,45 @@ Page({
       return;
     };
 
+
     if (that.data.isSubmit) {
       return;
     };
-
-    that.setData({
-      isSubmit: true
-    });
+    that.data.isSubmit = true;
 
     // 停止搜索
-    xBlufi.notifyStartDiscoverBle({
-      'isStart': false,
-    });
+    that.stopSearch();
+
+    var name = devicesList[0].name;
+    var deviceId = devicesList[0].deviceId;
+
+    console.log("获取蓝牙BLE名称和小程序mac地址=" + name + "=====" + deviceId);
+    var isJungzheng1 = junzhengUtil.isJungzheng1(name);
+    var isJungzheng2 = junzhengUtil.isJungzheng2(name);
+
+    if (isJungzheng1 || isJungzheng2) {
+      setTimeout(() => {
+        wx.hideLoading();
+        that.setData({
+          islanya: false,
+          devicesList: [],
+        });
+
+        var param = '?deviceId=' + deviceId + '&name=' + name + "&param=" + JSON.stringify(that.data.connectDevice);
+        routeUtil.jumpParam(routePath.deviceConnect4, param);
+      }, 500);
+      return;
+    }
 
     //开始连接
-    let name = devicesList[0].name;
+    var name = devicesList[0].name;
     // console.log('点击了,蓝牙准备连接的deviceId:' + devicesList[0].deviceId)
     xBlufi.notifyConnectBle({
       isStart: true,
-      deviceId: devicesList[0].deviceId,
-      name
+      name: name,
+      deviceId: deviceId,
     });
+
     wx.showLoading({
       title: '请稍后',
     });
@@ -216,8 +235,18 @@ Page({
     });
   },
 
+  onShow: function () {
+    var that = this;
+    if (that.data.isSubmit) {
+      that.data.isSubmit = false;
+      that.search();
+    }
+  },
+
   onUnload: function () {
     var that = this;
+    // 停止搜索
+    that.stopSearch();
     xBlufi.listenDeviceMsgEvent(false, that.funListenDeviceMsgEvent);
   },
 })

+ 5 - 0
pages/pageB/deviceConnect2/deviceConnect2.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 0 - 2
pages/deviceConnect2/deviceConnect2.wxml

@@ -1,5 +1,3 @@
-<!--pages/deviceRoter1/deviceRoter1.wxml-->
-<!--pages/deviceRoter0/deviceRoter0.wxml-->
 <view class="deviceRoter deviceRoter0">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'>
   </nav-bar>

pages/deviceConnect2/deviceConnect2.wxss → pages/pageB/deviceConnect2/deviceConnect2.wxss


+ 23 - 21
pages/deviceConnect3/deviceConnect3.js

@@ -1,9 +1,9 @@
-// pages/deviceConnect3/deviceConnect3.ts
 const app = getApp();
-let xBlufi = require("../../utils/blufi/xBlufi.js");
-import strings from '../../utils/strings.js';
-import route_util from '../../utils/route_util.js';
-import route_constant from '../../utils/route_constant.js'
+let xBlufi = require("../../../utils/blufi/xBlufi.js");
+import strings from '../../../utils/strings.js';
+import routeUtil from '../../../utils/routeUtil.js';
+import routeRoot from '../../../utils/routeRoot.js'
+
 let percentIn = null;
 let errTi = null;
 
@@ -25,7 +25,7 @@ Page({
     customData: '',
     percent: 0,
     ruterStatus: 0, // 0 连接中 // 1 成功 // 2失败
-    imageUrl: "./../../img/g.png",
+    imageUrl: "./../../../img/g.png",
   },
 
   onLoad: function (options) {
@@ -38,6 +38,7 @@ Page({
       });
     }
 
+    // AIrSMArT_861210052356337===D0:31:10:86:AC:9A
     that.setData({
       name: options.name,
       connectedDeviceId: options.deviceId,
@@ -112,7 +113,6 @@ Page({
               deviceId: deviceId,
               mac: deviceId,
               imageUrl: that.data.imageUrl,
-              // imageUrl: "./../../img/min.png",
             }
             getCurrentPages()[0].addWifiDevice(device);
             // [{"deviceId":"BLUFI_7cdfa1fcbb24","name":"BLUFI_7cdfa1fcbb24","state":"online"}]
@@ -126,12 +126,14 @@ Page({
             });
 
             setTimeout(() => {
-              clearTimeout(errTi);
-              clearInterval(percentIn);
-              that.setData({
-                percent: 100,
-                ruterStatus: 1,
-              });
+              if (percentIn != null) {
+                clearTimeout(errTi);
+                clearInterval(percentIn);
+                that.setData({
+                  percent: 100,
+                  ruterStatus: 1,
+                });
+              }
             }, 500);
           }
         }
@@ -168,13 +170,13 @@ Page({
       return
     }
 
-    if (!app.globalData.pwdData) {
-      wx.showToast({
-        title: '密码不能为空',
-        icon: 'none'
-      })
-      return;
-    }
+    // if (!app.globalData.pwdData) {
+    //   wx.showToast({
+    //     title: '密码不能为空',
+    //     icon: 'none'
+    //   })
+    //   return;
+    // }
 
     xBlufi.notifySendRouterSsidAndPassword({
       ssid: app.globalData.ssid,
@@ -202,7 +204,7 @@ Page({
   },
 
   goIndex() {
-    route_util.goBackRoute(route_constant.indexRoot);
+    routeUtil.goBackRoute(routeRoot.index);
   },
 
   onUnload: function () {

+ 5 - 0
pages/pageB/deviceConnect3/deviceConnect3.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nav-bar": "./../../../components/navbar/navbar"
+  }
+}

+ 2 - 4
pages/deviceConnect3/deviceConnect3.wxml

@@ -1,5 +1,3 @@
-<!-- pages/deviceRoter1/deviceRoter1.wxml -->
-<!-- pages/deviceRoter0/deviceRoter0.wxml -->
 <view class="deviceRoter deviceRoter3">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
   <view class="roterps">
@@ -11,11 +9,11 @@
       <progress color="#6547A3" percent="{{percent}}" show-info stroke-width="3" />
     </view>
     <view class="suRuter" wx:elif="{{ruterStatus === 1}}">
-      <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../img/h.png"></image>
+      <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../../img/h.png"></image>
       <text>连接成功</text>
     </view>
     <view class="suRuter" wx:elif="{{ruterStatus === 2}}">
-      <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../img/i.png"></image>
+      <image style="height:48rpx; width:48rpx;" mode="aspectFit" src="./../../../img/i.png"></image>
       <text>连接失败</text>
     </view>
     <view class="errorPs" wx:if="{{ruterStatus === 2}}">

+ 0 - 0
pages/deviceConnect3/deviceConnect3.wxss


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff