Commit 1aaf64b4 by 张立顺

feat 样式优化

1 parent 46aa2104
/* components/DatePicker/DatePicker.wxss */
.fixed-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
perspective: 99999999px;
}
.fixed-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
animation: show-bg .1s forwards .5s;
}
@keyframes show-bg {
0% {
background-color: rgba(0, 0, 0, 0);
}
100% {
background-color: rgba(0, 0, 0, .6);
}
}
.fixed-content {
position: absolute;
left: 50%;
top: 50%;
background: #FFFFFF;
border-radius: var(--fontSize20);
width: var(--fontSize622);
animation: show-modal .5s forwards;
}
@keyframes show-modal {
0% {
opacity: 0;
transform: translate3d(-50%, -50%, -99999999px);
}
100% {
opacity: 1;
transform: translate3d(-50%, -50%, 0);
}
}
.fixed-content .fixed-title {
height: var(--fontSize96);
font-size: var(--fontSize32);
color: #333333;
}
.fixed-date-box .fixed-body {
height: var(--fontSize360);
display: flex;
}
.fixed-date-box .picker {
width: 50%;
height: 100%;
}
.fixed-date-box .picker .view {
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize36);
color: #323233;
}
.fixed-date-box .picker .view.disabled{
opacity: 0.5;
}
.fixed-date-box .indicator {
height: var(--fontSize96);
}
.fixed-date-box .picker .tips {
font-size: var(--fontSize20);
color: rgba(100, 101, 102, .5);
margin-left: var(--fontSize10);
}
.fixed-content .fixed-footer {
height: var(--fontSize96);
display: flex;
align-items: center;
position: relative;
}
.fixed-content .fixed-footer .text-center {
width: 50%;
height: 100%;
font-size: var(--fontSize32);
color: #333333;
}
.fixed-content .fixed-footer .fixed-confirm {
color: #347BFF;
}
.fixed-content .fixed-footer::after {
background-color: #EBEDF0;
width: var(--fontSize1);
height: 100%;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
content: '';
}
.text-center{
display: flex;
justify-content: center;
align-items: center;
}
\ No newline at end of file \ No newline at end of file
@import '../../styles/fixed-picker-common.wxss';
.fixed-date-box .picker {
width: 50%;
height: 100%;
}
.fixed-date-box .picker .view {
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize36);
color: #323233;
}
.fixed-date-box .picker .view.disabled {
opacity: .5;
}
.fixed-date-box .indicator {
height: var(--fontSize96);
}
.fixed-date-box .picker .tips {
font-size: var(--fontSize20);
color: rgba(100, 101, 102, .5);
margin-left: var(--fontSize10);
}
/* components/RemarkPopup/RemarkPopup.wxss */
.fixed-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
perspective: 99999999px;
}
.fixed-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
animation: show-bg .1s forwards .5s;
}
@keyframes show-bg {
0% {
background-color: rgba(0, 0, 0, 0);
}
100% {
background-color: rgba(0, 0, 0, .6);
}
}
.fixed-content {
position: absolute;
left: 50%;
top: 50%;
background: #FFFFFF;
border-radius: var(--fontSize20);
width: var(--fontSize622);
animation: show-modal .5s forwards;
}
@keyframes show-modal {
0% {
opacity: 0;
transform: translate3d(-50%, -50%, -99999999px);
}
100% {
opacity: 1;
transform: translate3d(-50%, -50%, 0);
}
}
.fixed-content .fixed-title {
height: var(--fontSize96);
font-size: var(--fontSize32);
color: #333333;
}
.fixed-date-box .fixed-body {
height: var(--fontSize360);
display: flex;
}
.fixed-content .fixed-footer {
height: var(--fontSize96);
display: flex;
align-items: center;
position: relative;
}
.fixed-content .fixed-footer .text-center {
width: 50%;
height: 100%;
font-size: var(--fontSize32);
color: #333333;
}
.fixed-content .fixed-footer .fixed-confirm {
color: #347BFF;
}
.fixed-content .fixed-footer::after {
background-color: #EBEDF0;
width: var(--fontSize1);
height: 100%;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
content: '';
}
.fixed-remark-box .fixed-body{
padding: var(--fontSize30) 0 var(--fontSize72);
}
.fixed-remark {
background: #F4F5F7;
border: var(--fontSize2) solid #EFF0F2;
border-radius: var(--fontSize12);
width: var(--fontSize552);
height: var(--fontSize260);
box-sizing: border-box;
padding: var(--fontSize24) var(--fontSize46);
animation: show-remark .1s forwards .4s;
opacity: 0;
}
@keyframes show-remark {
0%{
opacity: 0;
}
100%{
opacity: 1;
}
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
@import '../../styles/fixed-picker-common.wxss';
.fixed-remark-box .fixed-body {
padding: var(--fontSize30) 0 var(--fontSize72);
}
.fixed-remark {
background: #f4f5f7;
border: var(--fontSize2) solid #eff0f2;
border-radius: var(--fontSize12);
width: var(--fontSize552);
height: var(--fontSize260);
box-sizing: border-box;
padding: var(--fontSize24) var(--fontSize46);
animation: show-remark .1s forwards .4s;
opacity: 0;
}
@keyframes show-remark {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
...@@ -76,7 +76,8 @@ ...@@ -76,7 +76,8 @@
border-radius: var(--fontSize16); border-radius: var(--fontSize16);
height: var(--fontSize176); height: var(--fontSize176);
} }
.search-box .select_box .option_box::after{ .search-box .select_box .option_box::after,
.search-box .select_box .option_box::before {
height: 0; height: 0;
width: 0; width: 0;
content: ''; content: '';
...@@ -88,18 +89,6 @@ ...@@ -88,18 +89,6 @@
z-index:-1; z-index:-1;
transform: rotate(90deg); transform: rotate(90deg);
} }
.search-box .select_box .option_box::before{
height: 0;
width: 0;
content: '';
position: absolute;
border: var(--fontSize14) solid transparent;
border-right: var(--fontSize14) solid #FFFFFF;
top: calc(-1 * var(--fontSize24));
left: var(--fontSize88);
z-index:-1;
transform: rotate(90deg);
}
.search-box .select_box .option_box .option{ .search-box .select_box .option_box .option{
display: block; display: block;
height: var(--fontSize88); height: var(--fontSize88);
...@@ -288,8 +277,9 @@ ...@@ -288,8 +277,9 @@
font-weight: 600; font-weight: 600;
} }
/* 待跟进 */ /* 待跟进、待支付 */
.wrapper .custom_element .text_box .status_text_0{ .wrapper .custom_element .text_box .status_text_0,
.wrapper .custom_element .text_box .status_text_3 {
background: #FFF5E6; background: #FFF5E6;
color: #FF9D0A; color: #FF9D0A;
} }
...@@ -303,12 +293,6 @@ ...@@ -303,12 +293,6 @@
background: #FDECE9; background: #FDECE9;
color: #F24724; color: #F24724;
} }
/* 待支付 */
.wrapper .custom_element .text_box .status_text_3{
background: #FFF5E6;
color: #FF9D0A;
}
.wrapper .element .text_box .label{ .wrapper .element .text_box .label{
font-weight: 500; font-weight: 500;
font-size: var(--fontSize30); font-size: var(--fontSize30);
...@@ -428,4 +412,4 @@ ...@@ -428,4 +412,4 @@
.wrapper .element .text_box .label_no{ .wrapper .element .text_box .label_no{
font-size: var(--fontSize20); font-size: var(--fontSize20);
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -35,10 +35,11 @@ ...@@ -35,10 +35,11 @@
text-align: center; text-align: center;
} }
.back-box { .back-box,
width: var(--fontSize160); .menu-box {
height: 100%; width: var(--fontSize160);
position: absolute; height: 100%;
position: absolute;
left: 0; left: 0;
top: 0; top: 0;
} }
...@@ -52,15 +53,7 @@ ...@@ -52,15 +53,7 @@
height: var(--fontSize36); height: var(--fontSize36);
} }
.menu-box { .menu-box .menu-class {
width: var(--fontSize160);
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.menu-box .menu-class {
position: absolute; position: absolute;
left: var(--fontSize20); left: var(--fontSize20);
top: 50%; top: 50%;
...@@ -87,4 +80,4 @@ ...@@ -87,4 +80,4 @@
width: var(--fontSize40); width: var(--fontSize40);
height: var(--fontSize40); height: var(--fontSize40);
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
## 规模 ## 规模
- 节点:10684 - 节点:10687
- 关系:24185 - 关系:24192
- 未解析:182 - 未解析:182
## 节点类型 ## 节点类型
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
| domain | 16 | | domain | 16 |
| endpoint | 399 | | endpoint | 399 |
| globalState | 39 | | globalState | 39 |
| method | 7701 | | method | 7702 |
| module | 953 | | module | 954 |
| page | 165 | | page | 165 |
| test | 251 | | test | 252 |
## 关系类型 ## 关系类型
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
| calls | 2633 | | calls | 2633 |
| callsApi | 774 | | callsApi | 774 |
| callsEndpoint | 491 | | callsEndpoint | 491 |
| contains | 1994 | | contains | 1996 |
| coveredBy | 484 | | coveredBy | 485 |
| declares | 7710 | | declares | 7711 |
| definesApi | 709 | | definesApi | 709 |
| documentedBy | 539 | | documentedBy | 539 |
| imports | 2177 | | imports | 2180 |
| navigatesTo | 250 | | navigatesTo | 250 |
| readsState | 2834 | | readsState | 2834 |
| usesComponent | 888 | | usesComponent | 888 |
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
| component | 24 | | component | 24 |
| apiOperation | 115 | | apiOperation | 115 |
| globalState | 5 | | globalState | 5 |
| test | 12 | | test | 13 |
| document | 2 | | document | 2 |
## 可定位实体 ## 可定位实体
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
| test | `tests/actualDeliveryDate.helpers.test.mjs` | | test | `tests/actualDeliveryDate.helpers.test.mjs` |
| test | `tests/calendarMonthMode.test.mjs` | | test | `tests/calendarMonthMode.test.mjs` |
| test | `tests/loginEnvironmentCheck.test.mjs` | | test | `tests/loginEnvironmentCheck.test.mjs` |
| test | `tests/main-package-slimming/mainPackageStyles.test.mjs` |
| test | `tests/marketingFlag.test.mjs` | | test | `tests/marketingFlag.test.mjs` |
| test | `tests/menuApiCache.test.mjs` | | test | `tests/menuApiCache.test.mjs` |
| test | `tests/popupBehavior.test.mjs` | | test | `tests/popupBehavior.test.mjs` |
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
- 组件关联测试:40/40 通过;权益测试:229/229 通过;`createOrder` 回归通过。 - 组件关联测试:40/40 通过;权益测试:229/229 通过;`createOrder` 回归通过。
- 完整 `npm test`:通过。 - 完整 `npm test`:通过。
- 微信开发者工具 CLI 预览:编译成功;总包 6,897,568 B,主包 1,073,971 B,最大分包 `tabWorkOrder` 1,483,339 B。 - 微信开发者工具 CLI 预览:编译成功;总包 6,897,568 B,主包 1,073,971 B,最大分包 `tabWorkOrder` 1,483,339 B。
- CSS/Sass 按优先级继续收敛后,CLI 预览再次编译成功:总包 6,698,814 B,主包 920,534 B;相较上一记录分别减少 198,754 B 和 153,437 B,主包下降约 14.29%。
- 全局响应式字号变量已改为按静态引用生成;主包重复页面、筛选面板、弹窗和授权提示样式改为作用域内共享 WXSS,未扩大为全局样式。
- 新增样式维护契约 5/5 通过,主包减重相关契约 18/18 通过,组件关联测试 40/40 通过,完整 `npm test` 通过。
- 权益包原始源码门禁:1,952,735 / 2,010,000 B;对应 CLI 实际分包为 1,357,316 B。 - 权益包原始源码门禁:1,952,735 / 2,010,000 B;对应 CLI 实际分包为 1,357,316 B。
- 断引扫描中本次迁移新增问题为 0;扫描仍报告 2 个 critical 与 23 个 other 历史基线,不在本次范围内。 - 断引扫描中本次迁移新增问题为 0;扫描仍报告 2 个 critical 与 23 个 other 历史基线,不在本次范围内。
......
...@@ -121,18 +121,12 @@ ...@@ -121,18 +121,12 @@
/* border: var(--fontSize2) solid #347BFF; */ /* border: var(--fontSize2) solid #347BFF; */
background-color: #347bff1a; background-color: #347bff1a;
} }
/* 驻店负责人 */ /* 驻店负责人、员工号 */
.items .right .midle_4{ .items .right .midle_4,
color: #35C376; .items .right .midle_5 {
/* border: var(--fontSize2) solid #35C376; */ color: #35C376;
background-color: #35c3761a; /* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
}
/* 员工号 */
.items .right .midle_5{
color: #35C376;
/* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
} }
.items .right .midle_6{ .items .right .midle_6{
color: #7F80FE; color: #7F80FE;
...@@ -174,4 +168,4 @@ ...@@ -174,4 +168,4 @@
} }
.list-not{ .list-not{
font-size: var(--fontSize40); font-size: var(--fontSize40);
}
\ No newline at end of file \ No newline at end of file
}
/* pages/sceneIndex/sceneIndex.wxss */ @import '../../styles/scene-selection-common.wxss';
page {
background-color: #F7F8FA;
height: 100vh;
}
.user-box {
padding: 16px;
font-size: var(--fontSize28);
color: #333333;
}
.user-info {
display: flex;
align-items: center;
}
.user-avatar {
width: var(--fontSize96);
height: var(--fontSize96);
overflow: hidden;
border-radius: 100%;
margin-right: var(--fontSize24);
}
.user-info .right{
display: flex;
flex: 1;
justify-content: space-between;
align-items: center;
}
.user-text .item {
font-size: var(--fontSize36);
font-weight: 600;
color: #333333;
}
.user-text .merchant-name{
font-size: var(--fontSize26);
font-weight: 400;
color: #6E6E7A;
}
.scene-box{ .scene-box {
padding: var(--fontSize32); padding: var(--fontSize32);
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
} }
.scene-box .scene-item{ .scene-box .scene-item {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
height: var(--fontSize160); height: var(--fontSize160);
background: #FFFFFF; background: #fff;
/* box-shadow: 0 var(--fontSize48) var(--fontSize20) calc(-1 * var(--fontSize40)) #D8D9E6; */
border-radius: var(--fontSize24); border-radius: var(--fontSize24);
padding: var(--fontSize32); padding: var(--fontSize32);
margin: var(--fontSize24) 0; margin: var(--fontSize24) 0;
position: relative; position: relative;
} }
.scene-box .scene-item:first-child{
margin-top: 0;
}
.scene-item .left{
display: flex;
align-items: center;
}
.scene-item .left .scene-icon{
width: var(--fontSize96);
height: var(--fontSize96);
border-radius: var(--fontSize8);
margin-right: var(--fontSize30);
}
.scene-item .left .item-text{
padding: var(--fontSize16) 0;
}
.scene-item .left .item-text .name{
color: #333333;
font-size: var(--fontSize32);
font-weight: 600;
}
.scene-item .left .item-text .desc{
color: #9B9B9E;
font-size: var(--fontSize24);
font-weight: 400;
margin-top: var(--fontSize10);
}
.scene-item .right image{
width: var(--fontSize14);
height: var(--fontSize24);
}
.scene-item .right .selected-class{
position: absolute;
top: 0;
right: 0;
width: var(--fontSize128);
height: var(--fontSize48);
background: rgba(53, 130, 238, .1);
border-radius: 0 var(--fontSize24) 0 var(--fontSize24);
color: #347BFF;
font-size: var(--fontSize24);
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
}
.change-btn{
width: var(--fontSize156);
height: var(--fontSize56);
border: var(--fontSize2) solid #9B9B9E;
border-radius: var(--fontSize32);
line-height: var(--fontSize56);
text-align: center;
color: #6C6C70;
font-size: var(--fontSize26);
font-weight: 400;
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: var(--fontSize140);
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
background-color: #fff;
font-size: var(--fontSize32);
color: #fff;
letter-spacing: var(--fontSize13);
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.logout {
width: calc(100% - var(--fontSize80));
height: var(--fontSize80);
line-height: var(--fontSize80);
text-align: center;
background-color: #347BFF;
border-radius: var(--fontSize16);
}
/* components/authSetting/authSetting.wxss */
.tips {
/* position: fixed; */
width: 100%;
/* left: 0;
bottom: var(--fontSize60); */
font-size: var(--fontSize24);
color: #8F959E;
letter-spacing: var(--fontSize2);
/* padding-left: var(--fontSize28); */
box-sizing: border-box;
display: flex;
align-items: center;
/* padding-left: var(--fontSize90); */
}
/* .tips text {
color: #5092FF;
} */
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: var(--fontSize28);
height: var(--fontSize28);
border-radius: 50%;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: var(--fontSize50);
height: var(--fontSize50);
position: relative;
z-index: 10;
}
\ No newline at end of file \ No newline at end of file
@import '../../../styles/auth-tips-common.wxss';
/* components/authSetting/authSetting.wxss */
.tips {
/* position: fixed; */
width: 100%;
left: 0;
bottom: var(--fontSize60);
font-size: var(--fontSize24);
color: #8F959E;
letter-spacing: var(--fontSize2);
box-sizing: border-box;
display: flex;
align-items: center;
/* padding-left: var(--fontSize90); */
}
.tips text {
color: #5092FF;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: var(--fontSize28);
height: var(--fontSize28);
border-radius: 50%;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: var(--fontSize50);
height: var(--fontSize50);
position: relative;
z-index: 10;
}
\ No newline at end of file \ No newline at end of file
@import '../../../styles/auth-tips-common.wxss';
.tips {
left: 0;
bottom: var(--fontSize60);
}
.tips text {
color: #5092ff;
}
...@@ -332,8 +332,9 @@ color: #999999; ...@@ -332,8 +332,9 @@ color: #999999;
font-size: var(--fontSize20); font-size: var(--fontSize20);
font-weight: 600; font-weight: 600;
} }
/* 待跟进 */ /* 待跟进、待支付 */
.custom_items .text_box .status_text_0{ .custom_items .text_box .status_text_0,
.custom_items .text_box .status_text_3 {
background: #FF9D0A10; background: #FF9D0A10;
color: #FF9D0A; color: #FF9D0A;
} }
...@@ -347,11 +348,6 @@ color: #999999; ...@@ -347,11 +348,6 @@ color: #999999;
background: #F2472410; background: #F2472410;
color: #F24724; color: #F24724;
} }
/* 待支付 */
.custom_items .text_box .status_text_3{
background: #FF9D0A10;
color: #FF9D0A;
}
.items .left .text_box .name{ .items .left .text_box .name{
font-weight: 500; font-weight: 500;
overflow: hidden; overflow: hidden;
...@@ -451,4 +447,4 @@ color: #999999; ...@@ -451,4 +447,4 @@ color: #999999;
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #BEC1C7; color: #BEC1C7;
margin-top: var(--fontSize24); margin-top: var(--fontSize24);
}
\ No newline at end of file \ No newline at end of file
}
/* pages/sceneIndex/sceneIndex.wxss */ @import '../../styles/scene-selection-common.wxss';
page {
background-color: #F7F8FA;
height: 100vh;
}
.layout{
padding-top: var(--fontSize32);
}
.user-box {
padding: 16px;
font-size: var(--fontSize28);
color: #333333;
}
.user-info { .layout {
display: flex; padding-top: var(--fontSize32);
align-items: center;
}
.user-avatar {
width: var(--fontSize96);
height: var(--fontSize96);
overflow: hidden;
border-radius: 100%;
margin-right: var(--fontSize24);
}
.user-info .right{
display: flex;
flex: 1;
justify-content: space-between;
align-items: center;
}
.user-text .item {
font-size: var(--fontSize36);
font-weight: 600;
color: #333333;
}
.user-text .merchant-name{
font-size: var(--fontSize26);
font-weight: 400;
color: #6E6E7A;
} }
.scene-box{ .scene-box {
/* padding: var(--fontSize32); */
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
height: calc(100vh - var(--fontSize140) - var(--constantSafeAreaInsetBottom)); height: calc(100vh - var(--fontSize140) - var(--constantSafeAreaInsetBottom));
height: calc(100vh - var(--fontSize140) - var(--envSafeAreaInsetBottom)); height: calc(100vh - var(--fontSize140) - var(--envSafeAreaInsetBottom));
} }
.scene-box .businessSchoolTitle{ .scene-box .businessSchoolTitle {
margin: var(--fontSize24) var(--fontSize32); margin: var(--fontSize24) var(--fontSize32);
} }
.scene-box .scene-item{ .scene-box .scene-item {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
height: var(--fontSize160); height: var(--fontSize160);
background: #FFFFFF; background: #fff;
/* box-shadow: 0 var(--fontSize48) var(--fontSize20) calc(-1 * var(--fontSize40)) #D8D9E6; */
border-radius: var(--fontSize24); border-radius: var(--fontSize24);
padding: var(--fontSize32); padding: var(--fontSize32);
margin: var(--fontSize24) var(--fontSize32); margin: var(--fontSize24) var(--fontSize32);
position: relative; position: relative;
} }
.scene-box .scene-item.active{ .scene-box .scene-item.active {
border: var(--fontSize4) solid #347BFF; border: var(--fontSize4) solid #347bff;
}
.scene-box .scene-item:first-child{
margin-top: 0;
}
.scene-item .left{
display: flex;
align-items: center;
}
.scene-item .left .scene-icon{
width: var(--fontSize96);
height: var(--fontSize96);
border-radius: var(--fontSize8);
margin-right: var(--fontSize30);
}
.scene-item .left .item-text{
padding: var(--fontSize16) 0;
}
.scene-item .left .item-text .name{
color: #333333;
font-size: var(--fontSize32);
font-weight: 600;
}
.scene-item .left .item-text .desc{
color: #9B9B9E;
font-size: var(--fontSize24);
font-weight: 400;
margin-top: var(--fontSize10);
}
.scene-item .right image{
width: var(--fontSize14);
height: var(--fontSize24);
}
.scene-item .right .selected-class{
position: absolute;
top: 0;
right: 0;
width: var(--fontSize128);
height: var(--fontSize48);
background: rgba(53, 130, 238, .1);
border-radius: 0 var(--fontSize24) 0 var(--fontSize24);
color: #347BFF;
font-size: var(--fontSize24);
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
}
.change-btn{
width: var(--fontSize156);
height: var(--fontSize56);
border: var(--fontSize2) solid #9B9B9E;
border-radius: var(--fontSize32);
line-height: var(--fontSize56);
text-align: center;
color: #6C6C70;
font-size: var(--fontSize26);
font-weight: 400;
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: var(--fontSize140);
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
background-color: #fff;
font-size: var(--fontSize32);
color: #fff;
letter-spacing: var(--fontSize13);
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.logout {
width: calc(100% - var(--fontSize80));
height: var(--fontSize80);
line-height: var(--fontSize80);
text-align: center;
background-color: #347BFF;
border-radius: var(--fontSize16);
} }
/* pages/tabDateIndex/components/DateScreen/DateScreen.wxss */ @import '../../../../styles/screen-panel-common.wxss';
.confirm-box {
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #fff;
animation: show-confirm-box .5s forwards;
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
.box {
margin: 0 var(--fontSize32);
}
.box .title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
color: #292D33;
padding: var(--fontSize34) 0 var(--fontSize30);
position: sticky;
left: 0;
top: 0;
background: #fff;
z-index: 2;
}
.box .title .title-left{
display: flex;
align-items: flex-end;
}
.box .title .title-tips{
font-size: var(--fontSize22);
font-weight: 400;
color: #757980;
margin-left: var(--fontSize8);
}
.box .title .collapse-btn{
width: var(--fontSize48);
height: var(--fontSize48);
}
.box .title .collapse-btn.rotate-180{
transform: rotate(180deg);
}
.box .list-box {
display: flex;
border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3);
flex-wrap: wrap;
padding-bottom: var(--fontSize20);
}
.box .list-box .item {
/* width: var(--fontSize214); */
width: calc(234 / 750 * 100%);
min-height: var(--fontSize68);
border-radius: var(--fontSize4);
box-sizing: border-box;
border: var(--fontSize2) solid transparent;
padding: var(--fontSize16) var(--fontSize33);
margin-bottom: var(--fontSize20);
flex-wrap: wrap;
font-size: var(--fontSize24);
text-align: center;
background-color: #F7F8FA;
color: #292D33;
transition: all .2s;
margin: 0 calc(20 / 750 * 100%) calc(20 / 750 *100%) 0;
}
.box .list-box .item .text-item{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.box .list-box .item.flex-1{
width: 100%;
text-align: left;
margin-right: 0;
line-height: 100%;
display: flex;
align-items: center;
}
.box .list-box .item.grey{
color: #999EA8;
}
.box .list-box .item.custom-time{
/* width: var(--fontSize316); */
width: calc(316 / 750 * 100%);
margin-bottom: 0;
}
.box .list-box .item.custom-time:last-child{
margin-right: 0;
margin-left: var(--fontSize20);
}
.box .list-box .item:nth-of-type(3n+3) {
margin-right: 0;
}
.box .list-box .calendar .item {
margin-right: 0;
}
.box .list-box .item.active {
background: rgba(53, 130, 238, 0.08);
border: var(--fontSize2) solid #347BFF;
color: #347BFF;
}
.box .list-box .item.disabled {
opacity: .4;
}
.box .list-box .item .inline-block{
display: inline-block;
}
.box .list-box .item .merchant-name{
max-width: calc(100% - var(--fontSize140));
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-box {
position: sticky;
padding: var(--fontSize10) var(--fontSize32);
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize28);
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
background-color: #fff;
}
.btn-box .btn {
border-radius: var(--fontSize12);
border: var(--fontSize2) solid #0075F9;
box-sizing: border-box;
height: var(--fontSize80);
display: flex;
align-items: center;
justify-content: center;
}
.btn-box .btn.clear {
border: var(--fontSize2) solid #DEE0E3;
width: var(--fontSize186);
color: #292D33;
}
.btn-box .btn.done {
background: #347BFF;
color: #fff;
width: var(--fontSize480);
}
.isFullSucreen-btn {
padding-bottom: var(--fontSize68);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* tabWorkOrder/pages/index/index.wxss */ @import '../../../styles/main-list-common.wxss';
page {
background-color: #FFFFFF;
}
.to-box {
position: sticky;
left: 0;
z-index: 2;
/* box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 rgba(0, 0, 0, 0.10); */
}
.search-box {
width: 100%;
// height: var(--fontSize104);
padding-left: var(--fontSize32);
padding-top: var(--fontSize16);
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #F7F8FA;
border-radius: var(--fontSize38);
width: calc(100% - var(--fontSize144));
height: var(--fontSize72);
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-box .search-input .search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.search-box .search-input .input {
font-size: var(--fontSize28);
width: calc(100% - var(--fontSize136));
height: var(--fontSize38);
line-height: var(--fontSize38);
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 var(--fontSize24);
}
.search-box .search .text-center {
font-size: var(--fontSize28);
/* background-color: #f7f7f7; */
border-radius: var(--fontSize12);
width: 100%;
height: var(--fontSize50);
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: var(--fontSize6);
width: var(--fontSize24);
height: var(--fontSize24);
}
.list { .list {
box-sizing: border-box; box-sizing: border-box;
...@@ -565,12 +484,8 @@ page { ...@@ -565,12 +484,8 @@ page {
background: #DEE0E3; background: #DEE0E3;
} }
.date-icon {
width: var(--fontSize48);
height: var(--fontSize48);
}
.phone-icon {
width: var(--fontSize48);
height: var(--fontSize48);
}
\ No newline at end of file \ No newline at end of file
.date-icon,
.phone-icon {
width: var(--fontSize48);
height: var(--fontSize48);
}
/* components/OrderScreen/OrderScreen.wxss */ @import '../../../../styles/screen-panel-common.wxss';
.confirm-box {
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #fff;
animation: show-confirm-box .5s forwards;
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
.box {
margin: 0 var(--fontSize32);
}
.box .title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
color: #292D33;
padding: var(--fontSize34) 0 var(--fontSize30);
position: sticky;
left: 0;
top: 0;
background: #fff;
z-index: 2;
}
.box .title .title-left{
display: flex;
align-items: flex-end;
}
.box .title .title-tips{
font-size: var(--fontSize22);
font-weight: 400;
color: #757980;
margin-left: var(--fontSize8);
}
.box .title .collapse-btn{
width: var(--fontSize48);
height: var(--fontSize48);
}
.box .title .collapse-btn.rotate-180{
transform: rotate(180deg);
}
.box .list-box {
display: flex;
border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3);
flex-wrap: wrap;
padding-bottom: var(--fontSize20);
}
.box .list-box .item {
/* width: var(--fontSize214); */
width: calc(234 / 750 * 100%);
min-height: var(--fontSize68);
border-radius: var(--fontSize4);
box-sizing: border-box;
border: var(--fontSize2) solid transparent;
padding: var(--fontSize16) var(--fontSize33);
flex-wrap: wrap;
font-size: var(--fontSize24);
text-align: center;
background-color: #F7F8FA;
color: #292D33;
transition: all .2s;
margin: 0 calc(20 / 750 * 100%) calc(20 / 750 * 100%) 0;
}
.box .list-box .item .text-item{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.box .list-box .item.flex-1{
width: 100%;
text-align: left;
margin-right: 0;
line-height: 100%;
display: flex;
align-items: center;
}
.box .list-box .item.grey{
color: #999EA8;
}
.box .list-box .item.custom-time{
/* width: var(--fontSize316); */
width: calc(316 / 750 * 100%);
margin-bottom: 0;
}
.box .list-box .item.custom-time:last-child{
margin-right: 0;
margin-left: var(--fontSize20);
}
.box .list-box .item:nth-of-type(3n+3) {
margin-right: 0;
}
.box .list-box .calendar .item {
margin-right: 0;
}
.box .list-box .item.active {
background: rgba(53, 130, 238, 0.08);
border: var(--fontSize2) solid #347BFF;
color: #347BFF;
}
.box .list-box .item.disabled {
opacity: .4;
}
.box .list-box .item .inline-block{
display: inline-block;
}
.box .list-box .item .merchant-name{
max-width: calc(100% - var(--fontSize140));
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-box {
position: sticky;
padding: var(--fontSize10) var(--fontSize32);
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize28);
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
background-color: #fff;
}
.btn-box .btn {
border-radius: var(--fontSize12);
border: var(--fontSize2) solid #0075F9;
box-sizing: border-box;
height: var(--fontSize80);
display: flex;
align-items: center;
justify-content: center;
}
.btn-box .btn.clear {
border: var(--fontSize2) solid #DEE0E3;
width: var(--fontSize186);
color: #292D33;
}
.btn-box .btn.done {
background: #347BFF;
color: #fff;
width: var(--fontSize480);
}
.isFullSucreen-btn {
padding-bottom: var(--fontSize68);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* tabWorkOrder/pages/index/index.wxss */ @import '../../../../styles/main-list-common.wxss';
page {
background-color: #FFFFFF;
}
.to-box {
position: sticky;
left: 0;
z-index: 2;
}
.search-box {
width: 100%;
/* height: var(--fontSize104); */
padding-left: var(--fontSize32);
padding-top: var(--fontSize16);
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #F7F8FA;
border-radius: var(--fontSize38);
width: calc(100% - var(--fontSize144));
height: var(--fontSize72);
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-box .search-input .search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.search-box .search-input .input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 var(--fontSize24);
}
.search-box .search .text-center {
font-size: var(--fontSize28);
/* background-color: #f7f7f7; */
border-radius: var(--fontSize12);
width: 100%;
height: var(--fontSize50);
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: var(--fontSize6);
width: var(--fontSize24);
height: var(--fontSize24);
}
.list { .list {
box-sizing: border-box; box-sizing: border-box;
...@@ -752,4 +672,4 @@ page { ...@@ -752,4 +672,4 @@ page {
margin-left: 9rpx; margin-left: 9rpx;
// margin-right: 6rpx; // margin-right: 6rpx;
margin-top: 3rpx; margin-top: 3rpx;
}
\ No newline at end of file \ No newline at end of file
}
.tips {
width: 100%;
font-size: var(--fontSize24);
color: #8f959e;
letter-spacing: var(--fontSize2);
box-sizing: border-box;
display: flex;
align-items: center;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: var(--fontSize28);
height: var(--fontSize28);
border-radius: 50%;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: var(--fontSize50);
height: var(--fontSize50);
position: relative;
z-index: 10;
}
.fixed-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
perspective: 99999999px;
}
.fixed-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
animation: show-bg .1s forwards .5s;
}
@keyframes show-bg {
0% {
background-color: rgba(0, 0, 0, 0);
}
100% {
background-color: rgba(0, 0, 0, .6);
}
}
.fixed-content {
position: absolute;
left: 50%;
top: 50%;
background: #fff;
border-radius: var(--fontSize20);
width: var(--fontSize622);
animation: show-modal .5s forwards;
}
@keyframes show-modal {
0% {
opacity: 0;
transform: translate3d(-50%, -50%, -99999999px);
}
100% {
opacity: 1;
transform: translate3d(-50%, -50%, 0);
}
}
.fixed-content .fixed-title {
height: var(--fontSize96);
font-size: var(--fontSize32);
color: #333;
}
.fixed-date-box .fixed-body {
height: var(--fontSize360);
display: flex;
}
.fixed-content .fixed-footer {
height: var(--fontSize96);
display: flex;
align-items: center;
position: relative;
}
.fixed-content .fixed-footer .text-center {
width: 50%;
height: 100%;
font-size: var(--fontSize32);
color: #333;
}
.fixed-content .fixed-footer .fixed-confirm {
color: #347bff;
}
.fixed-content .fixed-footer::after {
background-color: #ebedf0;
width: var(--fontSize1);
height: 100%;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
content: '';
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
page {
background-color: #fff;
}
.to-box {
position: sticky;
left: 0;
z-index: 2;
}
.search-box {
width: 100%;
padding-left: var(--fontSize32);
padding-top: var(--fontSize16);
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
}
.search-box .search-input {
background: #f7f8fa;
border-radius: var(--fontSize38);
width: calc(100% - var(--fontSize144));
height: var(--fontSize72);
display: flex;
align-items: center;
}
.search-box .search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-box .search-input .search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.search-box .search-input .input {
font-size: var(--fontSize28);
width: calc(100% - var(--fontSize136));
height: var(--fontSize38);
line-height: var(--fontSize38);
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-box .search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 var(--fontSize24);
}
.search-box .search .text-center {
font-size: var(--fontSize28);
border-radius: var(--fontSize12);
width: 100%;
height: var(--fontSize50);
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: var(--fontSize6);
width: var(--fontSize24);
height: var(--fontSize24);
}
page {
background-color: #f7f8fa;
height: 100vh;
}
.user-box {
padding: 16px;
font-size: var(--fontSize28);
color: #333;
}
.user-info {
display: flex;
align-items: center;
}
.user-avatar {
width: var(--fontSize96);
height: var(--fontSize96);
overflow: hidden;
border-radius: 100%;
margin-right: var(--fontSize24);
}
.user-info .right {
display: flex;
flex: 1;
justify-content: space-between;
align-items: center;
}
.user-text .item {
font-size: var(--fontSize36);
font-weight: 600;
color: #333;
}
.user-text .merchant-name {
font-size: var(--fontSize26);
font-weight: 400;
color: #6e6e7a;
}
.scene-box .scene-item:first-child {
margin-top: 0;
}
.scene-item .left {
display: flex;
align-items: center;
}
.scene-item .left .scene-icon {
width: var(--fontSize96);
height: var(--fontSize96);
border-radius: var(--fontSize8);
margin-right: var(--fontSize30);
}
.scene-item .left .item-text {
padding: var(--fontSize16) 0;
}
.scene-item .left .item-text .name {
color: #333;
font-size: var(--fontSize32);
font-weight: 600;
}
.scene-item .left .item-text .desc {
color: #9b9b9e;
font-size: var(--fontSize24);
font-weight: 400;
margin-top: var(--fontSize10);
}
.scene-item .right image {
width: var(--fontSize14);
height: var(--fontSize24);
}
.scene-item .right .selected-class {
position: absolute;
top: 0;
right: 0;
width: var(--fontSize128);
height: var(--fontSize48);
background: rgba(53, 130, 238, .1);
border-radius: 0 var(--fontSize24) 0 var(--fontSize24);
color: #347bff;
font-size: var(--fontSize24);
font-weight: 600;
display: flex;
justify-content: center;
align-items: center;
}
.change-btn {
width: var(--fontSize156);
height: var(--fontSize56);
border: var(--fontSize2) solid #9b9b9e;
border-radius: var(--fontSize32);
line-height: var(--fontSize56);
text-align: center;
color: #6c6c70;
font-size: var(--fontSize26);
font-weight: 400;
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: var(--fontSize140);
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
background-color: #fff;
font-size: var(--fontSize32);
color: #fff;
letter-spacing: var(--fontSize13);
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.logout {
width: calc(100% - var(--fontSize80));
height: var(--fontSize80);
line-height: var(--fontSize80);
text-align: center;
background-color: #347bff;
border-radius: var(--fontSize16);
}
.confirm-box {
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #fff;
animation: show-confirm-box .5s forwards;
}
@keyframes show-confirm-box {
0% {
right: -100%;
}
100% {
right: 0;
}
}
.box {
margin: 0 var(--fontSize32);
}
.box .title {
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
color: #292d33;
padding: var(--fontSize34) 0 var(--fontSize30);
position: sticky;
left: 0;
top: 0;
background: #fff;
z-index: 2;
}
.box .title .title-left {
display: flex;
align-items: flex-end;
}
.box .title .title-tips {
font-size: var(--fontSize22);
font-weight: 400;
color: #757980;
margin-left: var(--fontSize8);
}
.box .title .collapse-btn {
width: var(--fontSize48);
height: var(--fontSize48);
}
.box .title .collapse-btn.rotate-180 {
transform: rotate(180deg);
}
.box .list-box {
display: flex;
border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3);
flex-wrap: wrap;
padding-bottom: var(--fontSize20);
}
.box .list-box .item {
width: calc(234 / 750 * 100%);
min-height: var(--fontSize68);
border-radius: var(--fontSize4);
box-sizing: border-box;
border: var(--fontSize2) solid transparent;
padding: var(--fontSize16) var(--fontSize33);
flex-wrap: wrap;
font-size: var(--fontSize24);
text-align: center;
background-color: #f7f8fa;
color: #292d33;
transition: all .2s;
margin: 0 calc(20 / 750 * 100%) calc(20 / 750 * 100%) 0;
}
.box .list-box .item .text-item {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.box .list-box .item.flex-1 {
width: 100%;
text-align: left;
margin-right: 0;
line-height: 100%;
display: flex;
align-items: center;
}
.box .list-box .item.grey {
color: #999ea8;
}
.box .list-box .item.custom-time {
width: calc(316 / 750 * 100%);
margin-bottom: 0;
}
.box .list-box .item.custom-time:last-child {
margin-right: 0;
margin-left: var(--fontSize20);
}
.box .list-box .item:nth-of-type(3n+3) {
margin-right: 0;
}
.box .list-box .calendar .item {
margin-right: 0;
}
.box .list-box .item.active {
background: rgba(53, 130, 238, .08);
border: var(--fontSize2) solid #347bff;
color: #347bff;
}
.box .list-box .item.disabled {
opacity: .4;
}
.box .list-box .item .inline-block {
display: inline-block;
}
.box .list-box .item .merchant-name {
max-width: calc(100% - var(--fontSize140));
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-box {
position: sticky;
padding: var(--fontSize10) var(--fontSize32);
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize28);
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
background-color: #fff;
}
.btn-box .btn {
border-radius: var(--fontSize12);
border: var(--fontSize2) solid #0075f9;
box-sizing: border-box;
height: var(--fontSize80);
display: flex;
align-items: center;
justify-content: center;
}
.btn-box .btn.clear {
border: var(--fontSize2) solid #dee0e3;
width: var(--fontSize186);
color: #292d33;
}
.btn-box .btn.done {
background: #347bff;
color: #fff;
width: var(--fontSize480);
}
.isFullSucreen-btn {
padding-bottom: var(--fontSize68);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
...@@ -2,7 +2,8 @@ import assert from 'node:assert/strict' ...@@ -2,7 +2,8 @@ import assert from 'node:assert/strict'
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs' import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
import path from 'node:path' import path from 'node:path'
import test from 'node:test' import test from 'node:test'
import { fileURLToPath, pathToFileURL } from 'node:url' import { fileURLToPath } from 'node:url'
import { formatResponsiveFontSize } from '../../utils/responsiveFontSize.js'
const projectRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..') const projectRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..')
const STYLE_REFERENCE_EXTENSIONS = new Set([ const STYLE_REFERENCE_EXTENSIONS = new Set([
...@@ -26,6 +27,7 @@ const SCAN_ROOTS = [ ...@@ -26,6 +27,7 @@ const SCAN_ROOTS = [
'packageStudyCenter', 'packageStudyCenter',
'packageUsedCar', 'packageUsedCar',
'pages', 'pages',
'styles',
'subvehicleConversion', 'subvehicleConversion',
'tabDate', 'tabDate',
'tabIndex', 'tabIndex',
...@@ -82,6 +84,72 @@ function readSassNumberList(source, variableName) { ...@@ -82,6 +84,72 @@ function readSassNumberList(source, variableName) {
} }
/** /**
* Resolves every WXSS import declared by a stylesheet.
* @param {string} relativePath Project-relative stylesheet path.
* @returns {string[]} Absolute imported stylesheet paths.
*/
function resolveStyleImports(relativePath) {
const sourcePath = path.join(projectRoot, relativePath)
const source = readFileSync(sourcePath, 'utf8')
return [...source.matchAll(/@import\s+['"]([^'"]+)['"]\s*;/g)]
.map(match => path.resolve(path.dirname(sourcePath), match[1]))
}
/**
* Asserts that a group of stylesheets delegates duplicated rules to one file.
* @param {string[]} consumerPaths Project-relative consumer paths.
* @param {string} sharedPath Project-relative shared stylesheet path.
* @param {string[]} movedSelectors Selectors that must live only in the shared file.
* @returns {void}
*/
function assertSharedStyle(consumerPaths, sharedPath, movedSelectors) {
const absoluteSharedPath = path.join(projectRoot, sharedPath)
assert.ok(existsSync(absoluteSharedPath), `${sharedPath} must exist`)
const sharedSource = stripComments(readFileSync(absoluteSharedPath, 'utf8'))
for (const relativePath of consumerPaths) {
const imports = resolveStyleImports(relativePath)
assert.ok(
imports.includes(absoluteSharedPath),
`${relativePath} must import ${sharedPath}`
)
const consumerSource = stripComments(readFileSync(path.join(projectRoot, relativePath), 'utf8'))
for (const selector of movedSelectors) {
const selectorPattern = new RegExp(`${selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*\\{`)
assert.match(sharedSource, selectorPattern, `${selector} must be declared by ${sharedPath}`)
assert.doesNotMatch(
consumerSource,
selectorPattern,
`${selector} must not be duplicated in ${relativePath}`
)
}
}
}
/**
* Asserts that selectors with identical declarations use one grouped rule.
* @param {string} relativePath Project-relative stylesheet path.
* @param {string[][]} selectorGroups Ordered selector groups.
* @returns {void}
*/
function assertGroupedSelectors(relativePath, selectorGroups) {
const source = stripComments(readFileSync(path.join(projectRoot, relativePath), 'utf8'))
for (const selectors of selectorGroups) {
const escapedSelectors = selectors.map(selector =>
selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
const groupedRulePattern = new RegExp(`${escapedSelectors.join('\\s*,\\s*')}\\s*\\{`)
assert.match(
source,
groupedRulePattern,
`${relativePath} must group ${selectors.join(', ')}`
)
}
}
/**
* Collects numeric custom-property references from runtime source. * Collects numeric custom-property references from runtime source.
* @returns {{ base: number[], content: number[], dynamicPaths: string[] }} References. * @returns {{ base: number[], content: number[], dynamicPaths: string[] }} References.
*/ */
...@@ -108,11 +176,7 @@ function collectFontSizeReferences() { ...@@ -108,11 +176,7 @@ function collectFontSizeReferences() {
} }
} }
test('responsive font-size formatter preserves phone and large-screen scaling', async () => { test('responsive font-size formatter preserves phone and large-screen scaling', () => {
const modulePath = path.join(projectRoot, 'utils/responsiveFontSize.js')
assert.ok(existsSync(modulePath), 'responsiveFontSize helper must exist')
const { formatResponsiveFontSize } = await import(pathToFileURL(modulePath).href)
assert.equal(formatResponsiveFontSize(28, 767), 'calc(28vmin / 7.5)') assert.equal(formatResponsiveFontSize(28, 767), 'calc(28vmin / 7.5)')
assert.equal(formatResponsiveFontSize(28, 768), 'calc(28vmin / 8.5)') assert.equal(formatResponsiveFontSize(28, 768), 'calc(28vmin / 8.5)')
assert.equal(formatResponsiveFontSize(1114, 375), 'calc(1114vmin / 7.5)') assert.equal(formatResponsiveFontSize(1114, 375), 'calc(1114vmin / 7.5)')
...@@ -136,3 +200,71 @@ test('app Sass emits exactly the statically referenced font-size variables', () ...@@ -136,3 +200,71 @@ test('app Sass emits exactly the statically referenced font-size variables', ()
assert.ok(declaredBase.length < 400, 'font-size declarations must stay usage-driven') assert.ok(declaredBase.length < 400, 'font-size declarations must stay usage-driven')
assert.ok(declaredContent.length < 50, 'content font-size declarations must stay usage-driven') assert.ok(declaredContent.length < 50, 'content font-size declarations must stay usage-driven')
}) })
test('main-package page clones share scoped WXSS rules', () => {
assertSharedStyle(
[
'pages/tabWorkOrder/pages/index/index.sass',
'pages/tabDateIndex/pages/tabDateIndex.sass'
],
'styles/main-list-common.wxss',
['page', '.to-box', '.search-box', '.search-box .search-input', '.input-placeholder']
)
assertSharedStyle(
['pages/sceneIndex/sceneIndex.wxss', 'pages/changeScene/changeScene.wxss'],
'styles/scene-selection-common.wxss',
['page', '.user-box', '.scene-item .left', '.change-btn', '.logout']
)
})
test('main-package component clones share scoped WXSS rules', () => {
assertSharedStyle(
[
'pages/tabWorkOrder/components/OrderScreen/OrderScreen.wxss',
'pages/tabDateIndex/components/DateScreen/DateScreen.wxss'
],
'styles/screen-panel-common.wxss',
['.confirm-box', '.box .title', '.box .list-box .item', '.btn-box', '.text-hide']
)
assertSharedStyle(
['components/DatePicker/DatePicker.wxss', 'components/RemarkPopup/RemarkPopup.wxss'],
'styles/fixed-picker-common.wxss',
['.fixed-box', '.fixed-content', '.fixed-content .fixed-footer', '.text-center']
)
assertSharedStyle(
['pages/components/authSetting/authSetting.wxss', 'pages/components/authNoLogin/authNoLogin.wxss'],
'styles/auth-tips-common.wxss',
['.tips .icon', '.tips .icon .check-img', '.tips .choose-box']
)
})
test('identical declarations in main-package styles use grouped selectors', () => {
assertGroupedSelectors('components/navigationBar/navigationBar.wxss', [
['.back-box', '.menu-box']
])
assertGroupedSelectors('pages/tabDateIndex/pages/tabDateIndex.sass', [
['.date-icon', '.phone-icon']
])
assertGroupedSelectors('pages/accountItems/accountItems.wxss', [
['.items .right .midle_4', '.items .right .midle_5']
])
assertGroupedSelectors('pages/merchantList/merchantList.wxss', [
[
'.custom_items .text_box .status_text_0',
'.custom_items .text_box .status_text_3'
]
])
assertGroupedSelectors('components/SideSelectPopup/SideSelectPopup.wxss', [
[
'.search-box .select_box .option_box::after',
'.search-box .select_box .option_box::before'
],
[
'.wrapper .custom_element .text_box .status_text_0',
'.wrapper .custom_element .text_box .status_text_3'
]
])
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!