Compare commits
21
Commits
a81494973c
..
test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9699f1356f | ||
|
|
899a222e3f | ||
|
|
ca727ec1f7 | ||
|
|
aa33a931b1 | ||
|
|
bac84536c7 | ||
|
|
f044a95872 | ||
|
|
318b952a9b | ||
|
|
14437bb5a7 | ||
|
|
f16b486a89 | ||
|
|
6c69e14630 | ||
|
|
34118d59d3 | ||
|
|
b82474913a | ||
|
|
9d9f005ca3 | ||
|
|
605a0b2d91 | ||
|
|
c9bfa6792b | ||
|
|
b0ddf147aa | ||
|
|
3caa53d4be | ||
|
|
f4f63954eb | ||
|
|
b89744802a | ||
|
|
fd6be25ba5 | ||
|
|
bad3c8ff9a |
+4
-8
@@ -4,6 +4,10 @@
|
|||||||
"libVersion": "3.7.7",
|
"libVersion": "3.7.7",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
{
|
||||||
|
"type": "folder",
|
||||||
|
"value": "static/coin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"value": "static/common/dialog-light.png"
|
"value": "static/common/dialog-light.png"
|
||||||
@@ -243,14 +247,6 @@
|
|||||||
{
|
{
|
||||||
"type": "folder",
|
"type": "folder",
|
||||||
"value": "static/training-difficulty-design"
|
"value": "static/training-difficulty-design"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "folder",
|
|
||||||
"value": "static/coin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "folder",
|
|
||||||
"value": "static/home-device"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"include": []
|
"include": []
|
||||||
|
|||||||
+4
-8
@@ -55,6 +55,10 @@
|
|||||||
"appid" : "wxa8f5989dcd45cc23",
|
"appid" : "wxa8f5989dcd45cc23",
|
||||||
"packOptions" : {
|
"packOptions" : {
|
||||||
"ignore" : [
|
"ignore" : [
|
||||||
|
{
|
||||||
|
"type" : "folder",
|
||||||
|
"value" : "static/coin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type" : "file",
|
"type" : "file",
|
||||||
"value" : "static/common/dialog-light.png"
|
"value" : "static/common/dialog-light.png"
|
||||||
@@ -294,14 +298,6 @@
|
|||||||
{
|
{
|
||||||
"type" : "folder",
|
"type" : "folder",
|
||||||
"value" : "static/training-difficulty-design"
|
"value" : "static/training-difficulty-design"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type" : "folder",
|
|
||||||
"value" : "static/coin"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type" : "folder",
|
|
||||||
"value" : "static/home-device"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/audio-test"
|
"path": "pages/audio-test"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/calibration"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/about-us"
|
"path": "pages/about-us"
|
||||||
},
|
},
|
||||||
@@ -60,12 +57,6 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/match-page"
|
"path": "pages/match-page"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/my-device"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/device-intro"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/user"
|
"path": "pages/user"
|
||||||
},
|
},
|
||||||
@@ -107,12 +98,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/mine-bow-data"
|
"path": "pages/mine-bow-data"
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/ota-wifi",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -874,8 +874,8 @@ onShow(async () => {
|
|||||||
|
|
||||||
.product-link {
|
.product-link {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 104rpx;
|
bottom: 208rpx;
|
||||||
bottom: calc(env(safe-area-inset-bottom) + 104rpx);
|
/* bottom: calc(env(safe-area-inset-bottom) + 104rpx); */
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ const connectMode = ref("secure"); // secure | open | manual
|
|||||||
const connectError = ref("");
|
const connectError = ref("");
|
||||||
const connectStatusText = ref("");
|
const connectStatusText = ref("");
|
||||||
const isSubmittingWifi = ref(false);
|
const isSubmittingWifi = ref(false);
|
||||||
|
const wifiSuccessVisible = ref(false);
|
||||||
const keyboardHeight = ref(0);
|
const keyboardHeight = ref(0);
|
||||||
// 控制密码输入框是否显示明文
|
// 控制密码输入框是否显示明文
|
||||||
const showPassword = ref(false);
|
const showPassword = ref(false);
|
||||||
@@ -364,10 +365,13 @@ const submitDeviceWifiConfig = async ({ ssid, password }) => {
|
|||||||
secure: connectMode.value === "secure" || !!password,
|
secure: connectMode.value === "secure" || !!password,
|
||||||
};
|
};
|
||||||
connectError.value = "";
|
connectError.value = "";
|
||||||
currentState.value = STATES.CONNECTED;
|
|
||||||
void refreshConnectedWifiName();
|
void refreshConnectedWifiName();
|
||||||
if (fromFirmwareUpdate.value) {
|
if (fromFirmwareUpdate.value) {
|
||||||
|
currentState.value = STATES.CONNECTED;
|
||||||
openFirmwareCountdown();
|
openFirmwareCountdown();
|
||||||
|
} else {
|
||||||
|
// 保留配网输入界面,避免成功提示出现前先露出 WiFi 列表。
|
||||||
|
wifiSuccessVisible.value = true;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (requestId === wifiConnectRequestId) {
|
if (requestId === wifiConnectRequestId) {
|
||||||
@@ -382,6 +386,13 @@ const submitDeviceWifiConfig = async ({ ssid, password }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 普通配网成功后,确认并收起输入界面,停留在当前 WiFi 页面。
|
||||||
|
const confirmWifiSuccess = () => {
|
||||||
|
if (!wifiSuccessVisible.value) return;
|
||||||
|
wifiSuccessVisible.value = false;
|
||||||
|
currentState.value = STATES.CONNECTED;
|
||||||
|
};
|
||||||
|
|
||||||
// 校验用户输入并提交 WiFi 配置,不再把手机连接结果当作设备连接成功。
|
// 校验用户输入并提交 WiFi 配置,不再把手机连接结果当作设备连接成功。
|
||||||
const joinNetwork = () => {
|
const joinNetwork = () => {
|
||||||
if (joinDisabled.value) return;
|
if (joinDisabled.value) return;
|
||||||
@@ -755,6 +766,14 @@ onUnmounted(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<ModalDialog
|
||||||
|
:show="wifiSuccessVisible"
|
||||||
|
content="WIFI连接成功"
|
||||||
|
confirmText="确定"
|
||||||
|
:showCancel="false"
|
||||||
|
:onConfirm="confirmWifiSuccess"
|
||||||
|
></ModalDialog>
|
||||||
|
|
||||||
<ModalDialog
|
<ModalDialog
|
||||||
:show="countdownVisible"
|
:show="countdownVisible"
|
||||||
title="WiFi连接成功"
|
title="WiFi连接成功"
|
||||||
|
|||||||
+16
-9
@@ -93,30 +93,36 @@ function createWebSocket(token, onMessage) {
|
|||||||
"/addons/shoot/otaResult",
|
"/addons/shoot/otaResult",
|
||||||
];
|
];
|
||||||
if (passthroughEvents.includes(event)) {
|
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 });
|
onMessage({ event, data, code, timestamp });
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data?.type) {
|
if (!data || typeof data !== "object") return;
|
||||||
|
if (data.type) {
|
||||||
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
||||||
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
|
console.log("收到 WebSocket 消息", getMessageTypeName(data.type));
|
||||||
}
|
}
|
||||||
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const updates = Array.isArray(data?.updates) ? data.updates : [];
|
if (!Array.isArray(data.updates)) return;
|
||||||
if (!updates.length) return;
|
if (onMessage) onMessage(data.updates);
|
||||||
if (onMessage) onMessage(updates);
|
const firstMessage = data.updates[0];
|
||||||
const msg = updates[0];
|
if (firstMessage && ENABLE_REALTIME_MESSAGE_LOG) {
|
||||||
if (msg) {
|
|
||||||
if (ENABLE_REALTIME_MESSAGE_LOG) {
|
|
||||||
console.log(
|
console.log(
|
||||||
"收到 WebSocket 更新",
|
"收到 WebSocket 更新",
|
||||||
getMessageTypeName(msg.constructor),
|
getMessageTypeName(firstMessage.constructor),
|
||||||
{ updateCount: data.updates.length }
|
{ updateCount: data.updates.length }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
data.updates.forEach((msg) => {
|
||||||
|
if (msg) {
|
||||||
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||||
uni.setStorageSync("latestRank", msg.lvl);
|
uni.setStorageSync("latestRank", msg.lvl);
|
||||||
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
||||||
@@ -130,6 +136,7 @@ function createWebSocket(token, onMessage) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
socketTask.onError((err) => {
|
socketTask.onError((err) => {
|
||||||
if (socket !== socketTask) return;
|
if (socket !== socketTask) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user