Compare commits
4 Commits
42fde98037
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afd86d9a56 | ||
|
|
89a1cebea8 | ||
|
|
26a7411504 | ||
|
|
f8238694ae |
BIN
.gitignore
vendored
BIN
.gitignore
vendored
Binary file not shown.
0
.idea/.gitignore
generated
vendored
Normal file
0
.idea/.gitignore
generated
vendored
Normal file
9
.idea/New project 3.iml
generated
Normal file
9
.idea/New project 3.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/New project 3.iml" filepath="$PROJECT_DIR$/.idea/New project 3.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
71
.idea/workspace.xml
generated
Normal file
71
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="a812a826-f373-4202-9fd1-557f469f1478" name="更改" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/project.config.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/scripts/tests/app-bar-source.test.cjs" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/tests/app-bar-source.test.cjs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/scripts/tests/report-utils.test.cjs" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/tests/report-utils.test.cjs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/components/secondary-page/index.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/secondary-page/index.scss" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/devices/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/devices/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/feedback/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/feedback/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/follow-us/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/follow-us/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/index/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/index/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/repair-detail/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/repair-detail/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/repair/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/repair/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/settings/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/settings/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/support/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/support/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/pages/videos/index.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/videos/index.config.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/tsconfig.report-tests.json" beforeDir="false" afterPath="$PROJECT_DIR$/tsconfig.report-tests.json" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectId" id="3DTzLiED7L7Nx6z6Fi1yC0zRw9x" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"last_opened_file_path": "C:/Users/a/Documents/New project 3",
|
||||
"nodejs_package_manager_path": "npm"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="默认任务">
|
||||
<changelist id="a812a826-f373-4202-9fd1-557f469f1478" name="更改" comment="" />
|
||||
<created>1778320793548</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1778320793548</updated>
|
||||
<workItem from="1778320795766" duration="654000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -35,7 +35,7 @@
|
||||
"disableSWC": true
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.6.3",
|
||||
"libVersion": "3.15.2",
|
||||
"appid": "wx2e6e4000b0ef29d9",
|
||||
"miniprogramRoot": "dist/",
|
||||
"projectname": "wechat-miniapp-starter",
|
||||
|
||||
@@ -35,6 +35,16 @@ run("AppBar back icon uses a fixed mini-program sized constraint", () => {
|
||||
assert.match(appBarStyles, /\.app-bar__back-icon\s*\{[\s\S]*height:\s*32rpx;/);
|
||||
});
|
||||
|
||||
run("AppBar props stay focused on title and back navigation only", () => {
|
||||
run("AppBar exposes fixed layout modes instead of scattered slot props", () => {
|
||||
assert.match(appBarSource, /type AppBarMode = "spacer" \| "back-title" \| "back-title-actions-below" \| "title-actions-below"/);
|
||||
assert.match(appBarSource, /mode\?: AppBarMode/);
|
||||
assert.match(appBarSource, /actions\?: ReactNode/);
|
||||
assert.doesNotMatch(appBarSource, /subtitle\?:|eyebrow\?:|align\?:|rightText\?:|onRightAction\?:|leftSlot\?:|rightSlot\?:|bottomSlot\?:/);
|
||||
});
|
||||
|
||||
run("AppBar includes dedicated rows for title and below-line actions", () => {
|
||||
assert.match(appBarSource, /app-bar__title-row/);
|
||||
assert.match(appBarSource, /app-bar__actions-row/);
|
||||
assert.match(appBarStyles, /\.app-bar__actions-row\s*\{/);
|
||||
assert.match(appBarStyles, /\.app-bar__title-row\s*\{/);
|
||||
});
|
||||
|
||||
@@ -4,6 +4,8 @@ const {
|
||||
getStatusTone,
|
||||
pickReportRecord
|
||||
} = require("../../tmp/report-tests/report-utils.js");
|
||||
const { resolveReportBackAction } = require("../../tmp/report-tests/navigation.js");
|
||||
const { computeAppBarMetrics, resolveBackNavigation } = require("../../tmp/report-tests/utils/app-bar-metrics.js");
|
||||
|
||||
function run(name, fn) {
|
||||
try {
|
||||
@@ -43,3 +45,35 @@ run("pickReportRecord falls back to first device record", () => {
|
||||
|
||||
assert.equal(record.score, 65);
|
||||
});
|
||||
|
||||
run("resolveReportBackAction returns navigateBack when there is history", () => {
|
||||
assert.equal(resolveReportBackAction(2), "navigateBack");
|
||||
});
|
||||
|
||||
run("resolveReportBackAction falls back to home when report page has no history", () => {
|
||||
assert.equal(resolveReportBackAction(1), "redirectHome");
|
||||
});
|
||||
|
||||
run("computeAppBarMetrics uses menu button metrics when available", () => {
|
||||
assert.deepEqual(
|
||||
computeAppBarMetrics({
|
||||
statusBarHeight: 24,
|
||||
windowWidth: 390,
|
||||
menuButtonRect: {
|
||||
top: 30,
|
||||
left: 300,
|
||||
height: 32
|
||||
}
|
||||
}),
|
||||
{
|
||||
topInset: 24,
|
||||
menuTop: 30,
|
||||
menuHeight: 32,
|
||||
capsuleSafeWidth: 96
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
run("resolveBackNavigation falls back when stack has no previous page", () => {
|
||||
assert.equal(resolveBackNavigation(1), "redirectHome");
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.secondary-page {
|
||||
position: relative;
|
||||
min-height: 100vh;
|
||||
padding: 32rpx 24rpx 48rpx;
|
||||
padding: 0 24rpx 48rpx;
|
||||
box-sizing: border-box;
|
||||
background: linear-gradient(180deg, #1e2432 0%, #171d29 100%);
|
||||
overflow: hidden;
|
||||
@@ -35,7 +35,7 @@
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: 28rpx;
|
||||
padding: 32rpx 30rpx;
|
||||
padding: 28rpx 30rpx;
|
||||
border-radius: 28rpx;
|
||||
background: rgba(39, 46, 64, 0.95);
|
||||
box-shadow: inset 0 0 0 2rpx rgba(255, 255, 255, 0.03);
|
||||
@@ -49,16 +49,9 @@
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.secondary-page__title {
|
||||
display: block;
|
||||
color: #f6f8fb;
|
||||
font-size: 42rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.secondary-page__description {
|
||||
display: block;
|
||||
margin-top: 14rpx;
|
||||
margin-top: 10rpx;
|
||||
color: #9aa5bb;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "我的设备"
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "问题反馈"
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "关注我们"
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "首页"
|
||||
navigationBarTitleText: ""
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "报修详情",
|
||||
navigationBarBackgroundColor: "#0B1220",
|
||||
navigationBarTextStyle: "white",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "申请报修",
|
||||
navigationBarBackgroundColor: "#0B1220",
|
||||
navigationBarTextStyle: "white",
|
||||
|
||||
3
src/pages/report/navigation.ts
Normal file
3
src/pages/report/navigation.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function resolveReportBackAction(pageStackLength: number) {
|
||||
return pageStackLength > 1 ? "navigateBack" : "redirectHome";
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "设置"
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "帮助与客服"
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "教学视频"
|
||||
});
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
"declaration": false,
|
||||
"types": []
|
||||
},
|
||||
"include": ["src/pages/report/report-utils.ts", "src/pages/repair/repair-utils.ts"]
|
||||
"include": ["src/pages/report/report-utils.ts", "src/pages/report/navigation.ts", "src/pages/repair/repair-utils.ts", "src/utils/app-bar.ts", "src/utils/app-bar-metrics.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user