Compare commits
6
Commits
test
..
cc8f997600
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc8f997600 | ||
|
|
a81494973c | ||
|
|
f3fab17687 | ||
|
|
d22d958215 | ||
|
|
b4ed13d2b5 | ||
|
|
b8b0ab4005 |
+8
-4
@@ -4,10 +4,6 @@
|
||||
"libVersion": "3.7.7",
|
||||
"packOptions": {
|
||||
"ignore": [
|
||||
{
|
||||
"type": "folder",
|
||||
"value": "static/coin"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"value": "static/common/dialog-light.png"
|
||||
@@ -247,6 +243,14 @@
|
||||
{
|
||||
"type": "folder",
|
||||
"value": "static/training-difficulty-design"
|
||||
},
|
||||
{
|
||||
"type": "folder",
|
||||
"value": "static/coin"
|
||||
},
|
||||
{
|
||||
"type": "folder",
|
||||
"value": "static/home-device"
|
||||
}
|
||||
],
|
||||
"include": []
|
||||
|
||||
+8
-4
@@ -55,10 +55,6 @@
|
||||
"appid" : "wxa8f5989dcd45cc23",
|
||||
"packOptions" : {
|
||||
"ignore" : [
|
||||
{
|
||||
"type" : "folder",
|
||||
"value" : "static/coin"
|
||||
},
|
||||
{
|
||||
"type" : "file",
|
||||
"value" : "static/common/dialog-light.png"
|
||||
@@ -298,6 +294,14 @@
|
||||
{
|
||||
"type" : "folder",
|
||||
"value" : "static/training-difficulty-design"
|
||||
},
|
||||
{
|
||||
"type" : "folder",
|
||||
"value" : "static/coin"
|
||||
},
|
||||
{
|
||||
"type" : "folder",
|
||||
"value" : "static/home-device"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
{
|
||||
"path": "pages/audio-test"
|
||||
},
|
||||
{
|
||||
"path": "pages/calibration"
|
||||
},
|
||||
{
|
||||
"path": "pages/about-us"
|
||||
},
|
||||
@@ -57,6 +60,12 @@
|
||||
{
|
||||
"path": "pages/match-page"
|
||||
},
|
||||
{
|
||||
"path": "pages/my-device"
|
||||
},
|
||||
{
|
||||
"path": "pages/device-intro"
|
||||
},
|
||||
{
|
||||
"path": "pages/user"
|
||||
},
|
||||
@@ -98,6 +107,12 @@
|
||||
},
|
||||
{
|
||||
"path": "pages/mine-bow-data"
|
||||
},
|
||||
{
|
||||
"path": "pages/ota-wifi",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
@@ -39,7 +39,6 @@ const connectMode = ref("secure"); // secure | open | manual
|
||||
const connectError = ref("");
|
||||
const connectStatusText = ref("");
|
||||
const isSubmittingWifi = ref(false);
|
||||
const wifiSuccessVisible = ref(false);
|
||||
const keyboardHeight = ref(0);
|
||||
// 控制密码输入框是否显示明文
|
||||
const showPassword = ref(false);
|
||||
@@ -365,13 +364,10 @@ const submitDeviceWifiConfig = async ({ ssid, password }) => {
|
||||
secure: connectMode.value === "secure" || !!password,
|
||||
};
|
||||
connectError.value = "";
|
||||
currentState.value = STATES.CONNECTED;
|
||||
void refreshConnectedWifiName();
|
||||
if (fromFirmwareUpdate.value) {
|
||||
currentState.value = STATES.CONNECTED;
|
||||
openFirmwareCountdown();
|
||||
} else {
|
||||
// 保留配网输入界面,避免成功提示出现前先露出 WiFi 列表。
|
||||
wifiSuccessVisible.value = true;
|
||||
}
|
||||
} catch (err) {
|
||||
if (requestId === wifiConnectRequestId) {
|
||||
@@ -386,13 +382,6 @@ const submitDeviceWifiConfig = async ({ ssid, password }) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 普通配网成功后,确认并收起输入界面,停留在当前 WiFi 页面。
|
||||
const confirmWifiSuccess = () => {
|
||||
if (!wifiSuccessVisible.value) return;
|
||||
wifiSuccessVisible.value = false;
|
||||
currentState.value = STATES.CONNECTED;
|
||||
};
|
||||
|
||||
// 校验用户输入并提交 WiFi 配置,不再把手机连接结果当作设备连接成功。
|
||||
const joinNetwork = () => {
|
||||
if (joinDisabled.value) return;
|
||||
@@ -766,14 +755,6 @@ onUnmounted(() => {
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ModalDialog
|
||||
:show="wifiSuccessVisible"
|
||||
content="WIFI连接成功"
|
||||
confirmText="确定"
|
||||
:showCancel="false"
|
||||
:onConfirm="confirmWifiSuccess"
|
||||
></ModalDialog>
|
||||
|
||||
<ModalDialog
|
||||
:show="countdownVisible"
|
||||
title="WiFi连接成功"
|
||||
|
||||
+25
-32
@@ -93,49 +93,42 @@ function createWebSocket(token, onMessage) {
|
||||
"/addons/shoot/otaResult",
|
||||
];
|
||||
if (passthroughEvents.includes(event)) {
|
||||
if (
|
||||
(code == null || Number(code) === 0) &&
|
||||
onMessage &&
|
||||
data &&
|
||||
typeof data === "object"
|
||||
) {
|
||||
if ((code == null || Number(code) === 0) && onMessage && data && typeof data === "object") {
|
||||
onMessage({ event, data, code, timestamp });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!data || typeof data !== "object") return;
|
||||
if (data.type) {
|
||||
if (data?.type) {
|
||||
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
||||
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
|
||||
}
|
||||
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
||||
return;
|
||||
}
|
||||
if (!Array.isArray(data.updates)) return;
|
||||
if (onMessage) onMessage(data.updates);
|
||||
const firstMessage = data.updates[0];
|
||||
if (firstMessage && ENABLE_REALTIME_MESSAGE_LOG) {
|
||||
console.log(
|
||||
"收到 WebSocket 更新",
|
||||
getMessageTypeName(firstMessage.constructor),
|
||||
{ updateCount: data.updates.length }
|
||||
);
|
||||
}
|
||||
data.updates.forEach((msg) => {
|
||||
if (msg) {
|
||||
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||
uni.setStorageSync("latestRank", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
||||
uni.setStorageSync("latestLvl", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceOnline) {
|
||||
uni.$emit("update-online", true);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceOffline) {
|
||||
uni.$emit("update-online", false);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceCharging) {
|
||||
uni.$emit("device-charging");
|
||||
}
|
||||
const updates = Array.isArray(data?.updates) ? data.updates : [];
|
||||
if (!updates.length) return;
|
||||
if (onMessage) onMessage(updates);
|
||||
const msg = updates[0];
|
||||
if (msg) {
|
||||
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
||||
console.log(
|
||||
"收到 WebSocket 更新",
|
||||
getMessageTypeName(msg.constructor),
|
||||
{ updateCount: data.updates.length }
|
||||
);
|
||||
}
|
||||
});
|
||||
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||
uni.setStorageSync("latestRank", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
||||
uni.setStorageSync("latestLvl", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceOnline) {
|
||||
uni.$emit("update-online", true);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceOffline) {
|
||||
uni.$emit("update-online", false);
|
||||
} else if (msg.constructor === MESSAGETYPES.DeviceCharging) {
|
||||
uni.$emit("device-charging");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socketTask.onError((err) => {
|
||||
|
||||
Reference in New Issue
Block a user