更新
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
"disableSWC": true
|
"disableSWC": true
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "3.6.3",
|
"libVersion": "3.15.2",
|
||||||
"appid": "wx2e6e4000b0ef29d9",
|
"appid": "wx2e6e4000b0ef29d9",
|
||||||
"miniprogramRoot": "dist/",
|
"miniprogramRoot": "dist/",
|
||||||
"projectname": "wechat-miniapp-starter",
|
"projectname": "wechat-miniapp-starter",
|
||||||
@@ -43,4 +43,4 @@
|
|||||||
"condition": {},
|
"condition": {},
|
||||||
"simulatorPluginLibVersion": {},
|
"simulatorPluginLibVersion": {},
|
||||||
"editorSetting": {}
|
"editorSetting": {}
|
||||||
}
|
}
|
||||||
@@ -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;/);
|
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\?:/);
|
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,
|
getStatusTone,
|
||||||
pickReportRecord
|
pickReportRecord
|
||||||
} = require("../../tmp/report-tests/report-utils.js");
|
} = 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) {
|
function run(name, fn) {
|
||||||
try {
|
try {
|
||||||
@@ -43,3 +45,35 @@ run("pickReportRecord falls back to first device record", () => {
|
|||||||
|
|
||||||
assert.equal(record.score, 65);
|
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 {
|
.secondary-page {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 32rpx 24rpx 48rpx;
|
padding: 0 24rpx 48rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: linear-gradient(180deg, #1e2432 0%, #171d29 100%);
|
background: linear-gradient(180deg, #1e2432 0%, #171d29 100%);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
margin-bottom: 28rpx;
|
margin-bottom: 28rpx;
|
||||||
padding: 32rpx 30rpx;
|
padding: 28rpx 30rpx;
|
||||||
border-radius: 28rpx;
|
border-radius: 28rpx;
|
||||||
background: rgba(39, 46, 64, 0.95);
|
background: rgba(39, 46, 64, 0.95);
|
||||||
box-shadow: inset 0 0 0 2rpx rgba(255, 255, 255, 0.03);
|
box-shadow: inset 0 0 0 2rpx rgba(255, 255, 255, 0.03);
|
||||||
@@ -49,16 +49,9 @@
|
|||||||
letter-spacing: 4rpx;
|
letter-spacing: 4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-page__title {
|
|
||||||
display: block;
|
|
||||||
color: #f6f8fb;
|
|
||||||
font-size: 42rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.secondary-page__description {
|
.secondary-page__description {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 14rpx;
|
margin-top: 10rpx;
|
||||||
color: #9aa5bb;
|
color: #9aa5bb;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "我的设备"
|
navigationBarTitleText: "我的设备"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "问题反馈"
|
navigationBarTitleText: "问题反馈"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "关注我们"
|
navigationBarTitleText: "关注我们"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationStyle: "custom",
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "首页"
|
navigationBarTitleText: ""
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "报修详情",
|
navigationBarTitleText: "报修详情",
|
||||||
navigationBarBackgroundColor: "#0B1220",
|
navigationBarBackgroundColor: "#0B1220",
|
||||||
navigationBarTextStyle: "white",
|
navigationBarTextStyle: "white",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "申请报修",
|
navigationBarTitleText: "申请报修",
|
||||||
navigationBarBackgroundColor: "#0B1220",
|
navigationBarBackgroundColor: "#0B1220",
|
||||||
navigationBarTextStyle: "white",
|
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({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "设置"
|
navigationBarTitleText: "设置"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "帮助与客服"
|
navigationBarTitleText: "帮助与客服"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
|
navigationStyle: "custom",
|
||||||
navigationBarTitleText: "教学视频"
|
navigationBarTitleText: "教学视频"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,5 +8,5 @@
|
|||||||
"declaration": false,
|
"declaration": false,
|
||||||
"types": []
|
"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