Files
code-bang/frontend/miniapp/style/global.wxss
T
2026-09-17 16:25:31 +08:00

1003 lines
17 KiB
Plaintext

/**
* 软市 AI — 全局工具类 & 基础样式
* 类名与旧版保持兼容,视觉值统一引用 theme.wxss 设计令牌
*/
/* ============ 语义色 ============ */
.text-primary {
color: var(--brand);
}
.text-success {
color: var(--success);
}
.text-warn {
color: var(--warning);
}
.text-danger {
color: var(--error);
}
.text-title {
color: var(--text-primary);
}
.text-normal {
color: var(--text-secondary);
}
.text-small {
color: var(--text-tertiary);
}
.text-minor {
color: var(--border-level-1);
}
.text-border {
color: var(--border-level-2);
}
.text-white {
color: var(--text-inverse);
}
/* ============ 背景色 ============ */
.bg-primary {
background-color: var(--brand);
color: var(--text-inverse);
}
.bg-success {
background-color: var(--success);
color: var(--text-inverse);
}
.bg-warn {
background-color: var(--warning);
color: var(--text-inverse);
}
.bg-danger {
background-color: var(--error);
color: var(--text-inverse);
}
.bg-title {
background-color: var(--text-primary);
color: var(--text-inverse);
}
.bg-normal {
background-color: var(--text-secondary);
color: var(--text-primary);
}
.bg-small {
background-color: var(--text-tertiary);
color: var(--text-secondary);
}
.bg-minor {
background-color: var(--border-level-1);
color: var(--text-secondary);
}
.bg-border {
background-color: var(--border-level-2);
color: var(--text-secondary);
}
/* ============ 边框色 ============ */
.bd-primary {
color: var(--brand);
}
.bd-success {
color: var(--success);
}
.bd-warn {
color: var(--warning);
}
.bd-danger {
color: var(--error);
}
.bd-title {
color: var(--text-primary);
}
.bd-normal {
color: var(--text-secondary);
}
.bd-small {
color: var(--text-tertiary);
}
.bd-minor {
color: var(--border-level-1);
}
.bd-border {
color: var(--border-level-2);
}
/* ============ 字号层级 ============ */
.ft-super {
font-size: 40rpx;
}
.ft-main {
font-size: 36rpx;
}
.ft-normal {
font-size: 32rpx;
}
.ft-assist {
font-size: 28rpx;
}
.ft-minor {
font-size: 24rpx;
}
.ft-mini {
font-size: 20rpx;
}
/* ============ 字重 ============ */
.fw-super {
font-weight: 800;
}
.fw-main {
font-weight: 600;
}
.fw-normal {
font-weight: 400;
}
.fw-minor {
font-weight: 300;
}
.fw-Light {
font-weight: 300;
}
.fw-Regular {
font-weight: 400;
}
.fw-Medium {
font-weight: 600;
}
.fw-Semibold {
font-weight: 800;
}
/* ============ 1rpx 边框(缩放实现) ============ */
.mo-border-1rpx {
position: relative;
z-index: 0;
}
.mo-border-1rpx::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 200%;
height: 200%;
border-width: 2rpx;
border-style: solid;
transform: scale(0.5);
transform-origin: 0 0;
z-index: -1;
box-sizing: border-box;
}
/* ============ 页面基础 ============ */
page {
height: 100%;
font-size: 28rpx;
background-color: var(--bg-page);
font-weight: 400;
-webkit-font-smoothing: antialiased;
}
view,
image,
icon,
scroll-view,
text,
button,
checkbox,
form,
input,
label,
navigator,
audio,
video,
canvas {
box-sizing: border-box;
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
scroll-view {
height: 100%;
}
form,
image {
display: block;
}
button {
padding: 0;
margin: 0;
border-radius: 0;
height: 100%;
display: block;
line-height: inherit;
font-size: inherit;
color: inherit;
background: none;
-webkit-appearance: none;
border: none;
}
button::after {
content: none;
}
input,
textarea {
font-family: inherit;
font-size: 28rpx;
z-index: 0;
}
/* ============ 价格 ============ */
.price {
color: var(--brand);
font-size: 32rpx;
font-weight: 600;
}
.price-del {
color: var(--text-tertiary);
font-size: 24rpx;
font-weight: 400;
}
.color-price {
color: var(--brand);
}
.page {
background: var(--bg-card);
}
.bg-cart {
background-color: var(--warning);
color: var(--text-inverse);
}
.market-addcart {
color: var(--brand);
font-size: 42rpx;
}
.Original {
font-style: normal;
font-size: 24rpx;
color: var(--text-placeholder);
text-decoration: line-through;
margin-left: 16rpx;
display: inline-block;
}
/* ============ 布局工具类 ============ */
.ovh {
overflow: hidden;
}
.hidden {
display: none;
}
.show {
display: block;
}
.text {
display: inline-block;
}
.inline {
display: inline;
}
.minHeight {
min-height: 101%;
}
.circular {
border-radius: 50%;
}
.imgCover {
width: 100%;
padding-bottom: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
display: block;
position: relative;
}
.imgCover-list {
width: 195rpx;
height: 260rpx;
padding-bottom: 0;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
display: block;
position: relative;
}
.text-line1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
.text-line-1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.text-line2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
}
.text-line3 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
word-break: break-all;
}
.flex,
.box {
display: flex;
display: -webkit-flex;
}
.flex-v-center {
align-items: center;
-webkit-align-items: center;
}
.flex-center {
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
.flex-between {
justify-content: space-between;
-webkit-justify-content: space-between;
}
.flex-v-between {
align-content: space-between;
-webkit-align-content: space-between;
}
.flex-end {
justify-content: flex-end;
-webkit-justify-content: flex-end;
}
.flex-col {
flex-direction: column;
-webkit-flex-direction: column;
}
.flex1 {
flex: 1;
-webkit-flex: 1;
}
.flex0 {
flex: none;
-webkit-flex: none;
}
.flex-start {
justify-content: flex-start;
-webkit-justify-content: flex-start;
}
/* ============ 边框工具类 ============ */
.border-around,
.border-bottom-1px,
.border-left-1px,
.border-right-1px,
.border-top-1px {
position: relative;
border: 1rpx solid var(--border-level-2);
}
.border-top-1px {
border-width: 1rpx 0 0 0;
}
.border-right-1px {
border-width: 0 1rpx 0 0;
}
.border-bottom-1px {
border-width: 0 0 1rpx 0;
}
.border-left-1px {
border-width: 0 0 0 1rpx;
}
.border-t-1px,
.border-r-1px,
.border-b-1px,
.border-l-1px {
position: relative;
}
.border-t-1px::after,
.border-r-1px::after,
.border-b-1px::after,
.border-l-1px::after {
content: '';
position: absolute;
border-width: 2rpx;
border-color: var(--border-level-2);
border-style: solid;
}
.border-t-1px::after {
left: 0;
top: 0;
width: 100%;
transform: scaleY(0.5);
}
.border-b-1px::after {
left: 0;
bottom: 0;
width: 100%;
transform: scaleY(0.5);
}
.border-l-1px::after {
left: 0;
top: 0;
height: 100%;
transform: scaleX(0.5);
}
.border-r-1px::after {
right: 0;
top: 0;
height: 100%;
transform: scaleX(0.5);
}
/* ============ 箭头指示 ============ */
.arrows {
position: relative;
}
.arrows::after {
content: '';
display: inline-block;
width: 6px;
height: 6px;
border: 2px solid var(--text-placeholder);
border-width: 2px 2px 0 0;
position: absolute;
top: 50%;
right: 26rpx;
margin-top: -3px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.arrows-inline::after {
position: relative;
left: auto;
top: auto;
right: auto;
bottom: auto;
margin-top: -4px;
margin-left: 5px;
}
/* ============ 间距 ============ */
.pt-16,
.pt-8 {
padding-top: 16rpx;
}
.pb-16,
.pb-8 {
padding-bottom: 16rpx;
}
.pl-16,
.pl-8 {
padding-left: 16rpx;
}
.pr-16,
.pr-8 {
padding-right: 16rpx;
}
.pl-20,
.pl-10 {
padding-left: 20rpx;
}
.pr-20,
.pr-10 {
padding-right: 20rpx;
}
.pl-30 {
padding-left: 30rpx;
}
.pr-30 {
padding-right: 30rpx;
}
.pl-32,
.pl-15 {
padding-left: 32rpx;
}
.pr-32,
.pr-15 {
padding-right: 32rpx;
}
.pb360 {
padding-bottom: 360rpx;
}
/* ============ 文本色工具类 ============ */
.color1,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
color: var(--text-primary);
margin: 0;
padding: 0;
}
.color-3 {
color: var(--text-primary);
}
.color-6 {
color: var(--text-secondary);
}
.color-9 {
color: var(--text-tertiary);
}
.color-e9 {
color: var(--border-level-1);
}
.color-64 {
color: var(--text-secondary);
}
.color-b4 {
color: var(--text-placeholder);
}
.color-97 {
color: var(--text-tertiary);
}
.color-9b {
color: var(--text-tertiary);
}
.color-white {
color: var(--text-inverse);
}
.color-black {
color: #000;
}
.color-c {
color: var(--text-disabled);
}
.color777 {
color: var(--text-secondary);
}
.bkg-white {
background-color: var(--bg-card);
}
/* ============ 字号工具类 ============ */
.font10 {
font-size: 20rpx;
}
.font11 {
font-size: 22rpx;
}
.font12 {
font-size: 24rpx;
}
.font13 {
font-size: 26rpx;
}
.font14 {
font-size: 28rpx;
}
.font15 {
font-size: 30rpx;
}
.font16 {
font-size: 32rpx;
}
.font17 {
font-size: 34rpx;
}
.font18 {
font-size: 36rpx;
}
.font19 {
font-size: 38rpx;
}
.font20 {
font-size: 20rpx;
}
.font22 {
font-size: 22rpx;
}
.font24 {
font-size: 24rpx;
}
.font26 {
font-size: 26rpx;
}
.font28 {
font-size: 28rpx;
}
.font30 {
font-size: 30rpx;
}
.font32 {
font-size: 32rpx;
}
.font34 {
font-size: 34rpx;
}
.font36 {
font-size: 36rpx;
}
.font38 {
font-size: 38rpx;
}
.font40 {
font-size: 40rpx;
}
.font46 {
font-size: 46rpx;
}
.font50 {
font-size: 50rpx;
}
.font56 {
font-size: 56rpx;
}
.font82 {
font-size: 82rpx;
}
.fontWeight-l {
font-weight: 500;
}
.fontWeight-n {
font-weight: 300;
}
.fontWeight-nor {
font-weight: normal;
}
.line-height1 {
line-height: 1;
}
/* ============ 按钮体系(品牌色统一) ============ */
.btn-active {
width: 40rpx;
display: inline-block;
text-align: center;
height: 40rpx;
background: var(--brand);
border-radius: var(--radius-sm);
color: var(--text-inverse);
line-height: 40rpx;
font-size: 24rpx;
font-weight: normal;
font-style: normal;
overflow: hidden;
}
.btn-auto {
display: inline-block;
font-size: 20rpx;
border: 1px solid var(--brand);
border-radius: var(--radius-sm);
height: 36rpx;
line-height: 36rpx;
color: var(--brand);
padding: 0 12rpx;
margin-right: 16rpx;
}
.btn-lg,
.btn-md,
.btn-sm,
.btn-xs {
text-align: center;
width: 100%;
border-radius: var(--radius-round);
color: var(--text-inverse);
line-height: 88rpx;
font-size: 30rpx;
font-weight: 500;
}
.btn-lg,
.btn-md {
background: var(--brand-gradient);
box-shadow: var(--shadow-brand);
}
.btn-lg:active,
.btn-md:active {
opacity: 0.88;
}
.btn-sm {
border: 1px solid var(--border-level-2);
color: var(--text-secondary);
height: 60rpx;
line-height: 60rpx;
}
.btn-xs {
width: 100%;
height: 68rpx;
line-height: 68rpx;
border: 1px solid var(--border-level-2);
color: var(--text-secondary);
}
.btn-dashed,
.btn-md-dashed {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: var(--brand);
border-radius: var(--radius-round);
border: 1px solid var(--brand);
font-size: 26rpx;
}
.btn-md-dashed {
height: 50rpx;
line-height: 50rpx;
}
.btn-bj1 {
background-color: var(--brand);
}
.btn-bj2 {
background-color: var(--brand-hover);
}
.btn-dis {
background-color: var(--text-disabled);
color: var(--bg-card);
}
.btn-dashed-dis {
border: 1px solid var(--text-disabled);
color: var(--text-disabled);
border-radius: var(--radius-round);
}
/* ============ 标签 & 角标 ============ */
.titleTag {
line-height: 28rpx;
height: 28rpx;
margin-right: 8rpx;
color: var(--text-inverse);
padding: 0 8rpx;
font-size: 18rpx;
border-radius: 4rpx;
font-weight: bold;
display: inline-block;
}
.titleTag.memberTag {
margin-top: 2rpx;
}
.amounts {
font-style: normal;
display: inline-block;
height: 24rpx;
min-width: 24rpx;
padding: 0 6rpx;
border-radius: 24rpx;
background-color: var(--error) !important;
color: var(--text-inverse);
text-align: center;
font-size: 20rpx;
font-weight: 600;
position: absolute;
top: 6rpx;
line-height: 24rpx;
box-sizing: border-box;
}
.amounts:empty,
.titleTag:empty {
display: none;
}
/* ============ 加载 ============ */
.loadMore {
font-size: 26rpx;
color: var(--text-placeholder);
text-align: center;
height: 80rpx;
line-height: 58rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.loadings {
margin-right: 10rpx;
width: 40rpx;
height: 40rpx;
display: inline-block;
vertical-align: sub;
background: url(https://cdn.ghsmpwalmart.com/saas/market/image/loadings.png) no-repeat;
background-size: 240rpx 40rpx;
background-position: 0 0;
animation: circle-loadings 1s steps(6) infinite;
}
@keyframes circle-loadings {
from {
background-position: 0 0;
}
to {
background-position: -240rpx 0;
}
}
.page-loading {
display: inline-block;
width: 72rpx;
height: 75rpx;
background: url('https://cdn.ghsmpwalmart.com/saas/market/image/page-loading-bc.png') no-repeat;
background-position: 0 0;
background-size: 72rpx 75rpx;
}
.page-loading::before {
content: ' ';
display: inline-block;
width: 72rpx;
height: 75rpx;
background: url('https://cdn.ghsmpwalmart.com/saas/market/image/page-loading-spin.png') no-repeat;
background-position: 0 0;
background-size: 720rpx 75rpx;
animation: animate-page-loading 0.4s steps(10) infinite;
}
@keyframes animate-page-loading {
from {
background-position-x: 0rpx;
}
to {
background-position-x: -720rpx;
}
}
.page-loading-wrap {
width: 100%;
height: 1026rpx;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
padding-top: 46vh;
}
/* ============ 通用卡片 ============ */
.grooms {
margin: 0 16rpx;
overflow: hidden;
text-align: center;
height: 52rpx;
}
.grooms label {
display: inline-block;
padding: 0 20rpx;
height: 52rpx;
line-height: 52rpx;
position: relative;
color: var(--text-primary);
font-size: 26rpx;
}
.grooms label > p {
overflow: hidden;
max-width: 400rpx;
min-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
}
.grooms label > p::before {
content: '';
display: inline-block;
position: absolute;
width: 1000rpx;
margin-left: -1000rpx;
height: 0;
left: 0;
top: 50%;
border: 1px solid var(--border-level-1);
border-width: 1px 0 0 0;
}
.grooms label > p::after {
content: '';
display: inline-block;
position: absolute;
width: 1000rpx;
margin-left: -1000rpx;
height: 0;
left: 0;
left: inherit;
top: 50%;
border: 1px solid var(--border-level-1);
border-width: 0 0 1px 0;
right: 0;
margin-right: -1000rpx;
}
/* ============ 导航高度占位 ============ */
.navHeight {
height: 100rpx;
}
/* ============ 遮罩 ============ */
.widget-mask,
.widget_mask {
position: fixed;
left: 0;
top: 0px;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 200;
}
/* ============ 主题快捷类 ============ */
.theme-color {
color: var(--brand);
}
.theme-bgc {
background-color: var(--brand);
}
.theme-bdc {
border-color: var(--brand);
}
.theme-bgcart {
background-color: var(--brand-light-2);
}
/* ============ iPhoneX 安全区适配 ============ */
.IphoneX {
padding-bottom: 68rpx !important;
}
.fixIphonex {
bottom: 68rpx !important;
}
.fixIphonex::after {
content: ' ';
position: fixed;
bottom: 0 !important;
height: 68rpx !important;
width: 100%;
background: var(--bg-card);
left: 0;
}
.iphonexMenus {
bottom: 166rpx !important;
}
.imgCover-oblong-sm .imgCover {
width: 195rpx;
height: 260rpx;
}
.imgCover-oblong-lg .imgCover {
padding-bottom: 133%;
}
.icon-xingouwuche {
font-size: 42rpx;
}
/* ============ 弹窗头 ============ */
.popup-header {
color: var(--text-primary);
font-size: 28rpx;
text-align: center;
height: 100rpx;
line-height: 100rpx;
position: relative;
border-bottom: 1rpx solid var(--border-level-1);
font-weight: 500;
}
.popup-header .wr-close {
position: absolute;
left: 0;
font-size: 26rpx;
color: var(--text-secondary);
width: 60rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
top: 20rpx;
left: 10rpx;
}
/* ============ 通用现代化卡片(新增) ============ */
.app-card {
background: var(--bg-card);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-card);
overflow: hidden;
}
.app-card + .app-card {
margin-top: var(--spacing-md);
}
.app-card__title {
font-size: var(--font-subtitle);
font-weight: 600;
color: var(--text-primary);
}
.app-section-gap {
height: var(--spacing-md);
}