فهرست منبع

feature: 对ota固件升级进行分包

332777428@qq.com 4 ماه پیش
والد
کامیت
e7a3f23589

+ 1 - 1
app.json

@@ -9,7 +9,6 @@
     "pages/wakeList/wakeList",
     "pages/deviceMode/deviceMode",
     "pages/connectBle/connectBle",
-    "pages/ota/ota",
     "pages/setWifi/setWifi",
     "pages/vipPurchase/vipPurchase",
     "pages/vipRecord/vipRecord",
@@ -36,6 +35,7 @@
     {
       "root": "pages/pageD/",
       "pages": [
+        "ota/ota",
         "webview/webview",
         "download/download"
       ]

+ 0 - 5
pages/ota/ota.json

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

+ 0 - 39
pages/ota/ota.wxml

@@ -1,39 +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 class="item">
-        <text class="label">版本号</text>
-        <text class="arrow">{{device.version}}</text>
-    </view>
-    <view wx:if="{{isShowOta}}" class="button main_color" bind:tap="startOtaTap">
-        <view class="left-content">
-            <text class="button_title">{{buttonTips}}</text>
-            <view wx:if="{{hasNewVersion}}" class="red"></view>
-        </view>
-    </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">升级过程中请勿离开当前页面</view>
-    </view>
-</view>

+ 0 - 116
pages/ota/ota.wxss

@@ -1,116 +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;
-}
-
-.left-content {
-	display: flex;
-	align-items: center;
-}
-
-.red {
-	width: 15rpx;
-	height: 15rpx;
-	margin-top: -14rpx;
-	background-color: red;
-	border-radius: 50%;
-	margin-left: 12rpx;
-}
-
-.button_title {
-	font-size: 32rpx;
-	font-weight: Medium;
-	color: white;
-}
-
-.button {
-	margin-top: 128rpx;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	margin-inline: 64rpx;
-	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;
-}

+ 1 - 1
pages/pageD/download/download.json

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

+ 3 - 3
pages/pageD/download/download.wxml

@@ -1,7 +1,7 @@
 <view class="download">
   <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 style="width: 100vw;" class="logo" mode="widthFix" src="./../../img/s.png"></image>
+  <image style="width: 100vw;" class="logo" mode="widthFix" src="./../../../img/s.png"></image>
   <view class="li">
     <view class="h3">
       方式一
@@ -17,9 +17,9 @@
     <view class="textList">3.下载OhPlay猫王妙播</view>
   </view>
   <view class="code">
-    <image mode="widthFix" 	show-menu-by-longpress src="{{codeUrl}}"></image>
+    <image mode="widthFix" show-menu-by-longpress src="{{codeUrl}}"></image>
   </view>
   <view class="button">
     <text bindtap="saveImageToPhotosAlbum">保存到相册</text>
   </view>
-</view>
+</view>

+ 8 - 9
pages/ota/ota.js

@@ -1,15 +1,14 @@
-const { BtHelper } = require("../../devices/bt_helper");
-import { EnumCmdEvent, CmdEvent } from '../../devices/cmd_key_event';
-import eventBus from '../../utils/eventBus'
-import routeUtil from '../../utils/routeUtil';
-import routePath from '../../utils/routePath.js';
-import { BtCmd } from '../../devices/bluetooth/bt_cmd.js';
-import strings from '../../utils/strings.js';
+const { BtHelper } = require("../../../devices/bt_helper");
+import { EnumCmdEvent, CmdEvent } from '../../../devices/cmd_key_event';
+import eventBus from '../../../utils/eventBus'
+import routeUtil from '../../../utils/routeUtil';
+import routePath from '../../../utils/routePath.js';
+import { BtCmd } from '../../../devices/bluetooth/bt_cmd.js';
+import strings from '../../../utils/strings.js';
 const {
   deviceVersion
-} = require('../../request/deviceListRequest')
+} = require('../../../request/deviceListRequest')
 
-// pages/OTA/ota.js
 Page({
 
   /**

+ 5 - 0
pages/pageD/ota/ota.json

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

+ 38 - 0
pages/pageD/ota/ota.wxml

@@ -0,0 +1,38 @@
+<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 class="item">
+    <text class="label">版本号</text>
+    <text class="arrow">{{device.version}}</text>
+  </view>
+  <view wx:if="{{isShowOta}}" class="button main_color" bind:tap="startOtaTap">
+    <view class="left-content">
+      <text class="button_title">{{buttonTips}}</text>
+      <view wx:if="{{hasNewVersion}}" class="red"></view>
+    </view>
+  </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">升级过程中请勿离开当前页面</view>
+  </view>
+</view>

+ 111 - 0
pages/pageD/ota/ota.wxss

@@ -0,0 +1,111 @@
+.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;
+}
+
+.left-content {
+  display: flex;
+  align-items: center;
+}
+
+.red {
+  width: 15rpx;
+  height: 15rpx;
+  margin-top: -14rpx;
+  background-color: red;
+  border-radius: 50%;
+  margin-left: 12rpx;
+}
+
+.button_title {
+  font-size: 32rpx;
+  font-weight: Medium;
+  color: white;
+}
+
+.button {
+  margin-top: 128rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-inline: 64rpx;
+  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;
+}

+ 1 - 1
pages/piano/deviceDetail/deviceDetail.js

@@ -34,7 +34,7 @@ Page({
       "device": this.data.device,
     }
     var param = "?param=" + JSON.stringify(p);
-    routeUtil.jumpParam('/pages/ota/ota', param);
+    routeUtil.jumpParam(routePath.ota, param);
   },
   powerTap(e) {
     console.log(e)

+ 3 - 1
utils/routePath.js

@@ -17,6 +17,7 @@ const about = "../../pageC/about/about";
 const aboutInfo = "../../pageC/aboutInfo/aboutInfo";
 
 /// pageD
+const ota = "../../pageD/ota/ota";
 const webview = "../../pageD/webview/webview";
 const download = "../../pageC/download/download";
 
@@ -24,11 +25,11 @@ const download = "../../pageC/download/download";
 const cropper = "../../piano/cropper/cropper";
 const wallpaper = "../../piano/wallpaper/wallpaper";
 const deviceDetail = "../../piano/deviceDetail/deviceDetail";
-const setWifi = "../setWifi/setWifi";
 
 /// 抽奖记录
 const connectMode = "../deviceConMode/index";
 const connectBle = "../connectBle/connectBle";
+const setWifi = "../setWifi/setWifi";
 
 module.exports = {
   /// A
@@ -45,6 +46,7 @@ module.exports = {
   about: about,
   aboutInfo: aboutInfo,
   /// D
+  ota: ota,
   webview: webview,
   download: download,