Commit c6cb73ae by chenwq1

refactor(components): 统一组件样式和结构,优化用户交互

- 移除不必要的组件嵌套,简化 CarBrands 和 Employee 组件的模板结构
- 为多个组件添加统一的文本样式类,提升可读性和一致性
- 调整 Popup 组件的内容展示方式,使用 scroll-view 替代 view 以支持滚动
- 更新样式布局,修复选择项排列和按钮显示问题
- 优化登录页面输入框样式,增强用户体验
- 移除冗余的 CSS 规则,提升代码整洁性
- 更新 pnpm-lock.yaml,添加 vue-i18n 版本迁移提示
1 parent 9483f61f
Showing 32 changed files with 608 additions and 450 deletions
......@@ -3,7 +3,7 @@
"configurations" : [
{
"customPlaygroundType" : "local",
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
},
{
......
{
"permission": {
"edit": {
"*": "allow"
}
}
}
......@@ -11,7 +11,8 @@ let firstBackTime = 0;
export default {
onLaunch () {
// #ifdef APP
// layoutService.init();
// 必须先 init:未初始化时 currentMode 默认为 pad,会误判手机为平板并先锁横屏
layoutService.init();
const sys = uni.getSystemInfoSync();
console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`);
// pad/大屏锁定横屏,手机锁定竖屏
......@@ -87,10 +88,10 @@ export default {
@import "./adapt/portrait/1920/account-items.scss";
/* 全局默认样式 */
uni-page-body {
.layout-root {
font-size: 14px;
height: 100%;
min-height: 100%;
min-height: 0;
}
/* #ifdef H5 */
......@@ -128,7 +129,7 @@ uni-app uni-page-body, uni-app uni-left-window .uni-left-window, uni-app uni-rig
/* color 属性只能在 text、button、input、textarea 上使用 */
.un-segmented__item {
.un-segmented__item__text {
color: inherit;
color: #1f2937;
}
}
......
......@@ -5,7 +5,7 @@
/* ==================== 布局缩放变量 (Layout) ==================== */
/* 默认值:Pad 1024 基准,LayoutRoot 通过 layout-vars.uts + LayoutService 动态注入覆盖 */
:root {
.layout-root {
--l-spacing-xs: 8px;
--l-spacing-sm: 12px;
--l-spacing-md: 16px;
......@@ -843,54 +843,7 @@
margin-right: 20px;
}
/* Gap (需要在父元素上使用 flex) */
.gap-1 {
gap: 1px;
}
.gap-2 {
gap: 2px;
}
.gap-3 {
gap: 3px;
}
.gap-4 {
gap: 4px;
}
.gap-5 {
gap: 5px;
}
.gap-6 {
gap: 6px;
}
.gap-8 {
gap: 8px;
}
.gap-10 {
gap: 10px;
}
.gap-12 {
gap: 12px;
}
.gap-16 {
gap: 16px;
}
.gap-20 {
gap: 20px;
}
.gap-24 {
gap: 24px;
}
/* Gap 工具类在 uni-app x App 端不可用,改由具体组件显式设置 margin */
/* ==================== 尺寸 ==================== */
.w-full {
......@@ -1665,7 +1618,6 @@
padding: 8px 12px;
font-size: 14px;
font-weight: 500;
outline: none;
border-width: 0;
border-radius: 6px;
}
......@@ -1675,7 +1627,7 @@
background-color: #6366f1;
}
.btn-primary:active {
.btn-primary-active {
background-color: #4f46e5;
}
......@@ -1684,7 +1636,7 @@
background-color: #0ea5e9;
}
.btn-secondary:active {
.btn-secondary-active {
background-color: #0284c7;
}
......@@ -1693,7 +1645,7 @@
background-color: #22c55e;
}
.btn-success:active {
.btn-success-active {
background-color: #16a34a;
}
......@@ -1702,7 +1654,7 @@
background-color: #f97316;
}
.btn-warning:active {
.btn-warning-active {
background-color: #ea580c;
}
......@@ -1711,7 +1663,7 @@
background-color: #ef4444;
}
.btn-danger:active {
.btn-danger-active {
background-color: #dc2626;
}
......@@ -1720,12 +1672,12 @@
background-color: #374151;
}
.btn-dark:active {
.btn-dark-active {
background-color: #111827;
}
/* 按钮禁用状态 */
button:disabled {
.btn-disabled {
background-color: #9ca3af;
opacity: 0.6;
}
......@@ -1757,7 +1709,7 @@ button:disabled {
}
.overflow-auto {
overflow: auto;
overflow: hidden;
}
/* ==================== 显示/隐藏 ==================== */
......@@ -1766,7 +1718,8 @@ button:disabled {
}
.block {
display: block;
display: flex;
flex-direction: column;
}
/* ==================== Flex ==================== */
......@@ -1846,7 +1799,8 @@ button:disabled {
}
.min-h-screen {
min-height: 100%;
height: 100%;
min-height: 0;
}
/* ==================== 其他工具类 ==================== */
......@@ -1854,37 +1808,3 @@ button:disabled {
/* 注意:uni-app x App 端不支持 CSS 渐变 */
/* 如需渐变效果,请在 Web 端使用条件编译 */
/* 按钮激活状态 */
.active\:bg-blue-600:active {
background-color: #2563eb;
}
.active\:bg-indigo-600:active {
background-color: #4f46e5;
}
.active\:bg-pink-600:active {
background-color: #db2777;
}
.active\:bg-red-600:active {
background-color: #dc2626;
}
.active\:bg-green-600:active {
background-color: #16a34a;
}
.active\:bg-gray-800:active {
background-color: #1f2937;
}
/* 禁用状态 */
.disabled\:opacity-60:disabled {
opacity: 0.6;
}
.disabled\:bg-gray-400:disabled {
background-color: #9ca3af;
}
......@@ -24,7 +24,7 @@
<view class="select-item"
:class="[{ checked: selectedBrandIndex == index }]"
@click="selectBrand(item, index)">
{{ (item as UTSJSONObject).name }}
<text class="select-item-text">{{ (item as UTSJSONObject).name }}</text>
</view>
</template>
</view>
......@@ -36,7 +36,7 @@
<view class="select-item"
:class="[{ checked: carModel == (item as UTSJSONObject).name }]"
@click="handleSelect(item)">
{{ (item as UTSJSONObject).name }}
<text class="select-item-text">{{ (item as UTSJSONObject).name }}</text>
</view>
</template>
</view>
......@@ -388,68 +388,41 @@ defineExpose({ open, close, autoSelect });
flex: 1;
.view-content {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
width: 100%;
.select-item {
width: 48%;
margin-right: 2%;
width: 49%;
margin-right: 0;
margin-bottom: 16px;
height: 34px;
opacity: 1;
border: 1px solid #dce0e6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
&:nth-child(4n) {
margin-right: 0;
}
&.checked {
border: 1px solid #292d33;
}
}
}
// 淡入 + 从左滑入动画(品牌列表)
.fade-in-left {
animation: fadeInLeft 0.3s ease-out forwards;
}
// 淡入 + 从右滑入动画(车系列表)
.fade-in-right {
animation: fadeInRight 0.3s ease-out forwards;
}
}
@keyframes fadeInLeft {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes fadeInRight {
from {
opacity: 0;
transform: translateX(20px);
}
to {
opacity: 1;
transform: translateX(0);
}
.select-item-text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
</style>
......@@ -2,7 +2,7 @@
<view v-if="visible"
class="popup-mask"
@tap="close">
<view class="popup-box" @tap.stop="">
<view class="popup-box" :style="popupStyle" @tap.stop="">
<view class="popup-title">
<image class="popup-title-bg-img"
mode="aspectFill"
......@@ -12,7 +12,7 @@
<text class="close-icon">×</text>
</view>
</view>
<view class="popup-content">
<scroll-view class="popup-content" direction="vertical">
<view v-for="(item, index) in list"
:key="index"
class="popup-item"
......@@ -25,7 +25,7 @@
<text class="item-describe">{{ (item as UTSJSONObject).describe ?? '' }}</text>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
......@@ -46,6 +46,17 @@ const emit = defineEmits<{
}>();
const internalVisible = ref(false);
const popupStyle = computed((): UTSJSONObject => {
const info = uni.getWindowInfo();
const winH = info.windowHeight > 0 ? info.windowHeight : 768;
const heightPx = Math.round(winH * 0.8);
const minHeightPx = Math.round(winH * 0.32);
return {
height: `${heightPx}px`,
minHeight: `${minHeightPx}px`
} as UTSJSONObject;
});
const visible = computed((): boolean => {
if (props.visible != null) return props.visible === true;
return internalVisible.value;
......@@ -91,8 +102,6 @@ defineExpose({
.popup-box {
width: 700px;
max-height: 80%;
min-height: 32%;
background: #ffffff;
border-radius: var(--l-radius-xl);
overflow: hidden;
......@@ -151,7 +160,6 @@ defineExpose({
.popup-content {
flex: 1;
overflow: auto;
padding: var(--l-spacing-lg);
display: flex;
flex-direction: column;
......
......@@ -13,7 +13,7 @@
<view class="select-item"
:class="[{ checked: (salesUuid as string) == (item as UTSJSONObject).uuid }]"
@click="handleSelect(item)">
{{ (item as UTSJSONObject).staffName }}
<text class="select-item-text">{{ (item as UTSJSONObject).staffName }}</text>
</view>
</template>
</scroll-view>
......@@ -119,38 +119,35 @@ defineExpose({ open, close });
.select-box {
margin: 20px 0;
display: flex;
flex-direction: row;
flex-wrap: wrap;
overflow-y: scroll;
justify-content: space-between;
max-height: 400px;
padding-bottom: 30px;
flex-direction: row;
.select-item {
width: 48%;
width: 49%;
/* width: 23.5%; */
margin-right: 2%;
margin-right: 0;
margin-bottom: 16px;
height: 34px;
opacity: 1;
border: 1px solid #dce0e6;
border-radius: 4px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
&:nth-child(4n) {
margin-right: 0;
}
&.checked {
border: 1px solid #292d33;
}
}
}
.select-item-text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
</style>
......@@ -13,12 +13,12 @@
<template v-if="step == 1">
<template v-if="!check(true)">
<view v-if="errorTip" class="error-tip">
<text>以下信息不能为空,请完善信息后保存</text>
<text class="error-tip-text">以下信息不能为空,请完善信息后保存</text>
</view>
<view v-else class="pop-tips-wrapper">
<view class="pop-tips">
<uni-icons :size="16" type="info-circle"></uni-icons>
<text>{{ tipsText }}</text>
<text class="pop-tips-text">{{ tipsText }}</text>
</view>
</view>
</template>
......@@ -27,9 +27,9 @@
<view class="form-item">
<view class="label">
<view v-if="i.required == true" class="required">
<text style="color: #ff0000;">*</text>
<text class="required-text">*</text>
</view>
<text>{{ i.label }}</text>
<text class="form-label-text">{{ i.label }}</text>
</view>
<view class="value" :class="[{ error: showError(i.key) && i.required == true }, { disabled: customerType == 0 || i.disabled == true }]">
<template v-if="i.type == 'input'">
......@@ -47,7 +47,7 @@
:class="[{'placeholder': (formData as UTSJSONObject)[i.key] == ''}]"
@click="showSelectPopup(i)">
<view class="select-content">
<text>{{ (formData as UTSJSONObject)[i.key] != '' ? (formData as UTSJSONObject)[i.key] : i.placeholder }}</text>
<text class="select-text" :class="[(formData as UTSJSONObject)[i.key] == '' ? 'select-text-placeholder' : '']">{{ (formData as UTSJSONObject)[i.key] != '' ? (formData as UTSJSONObject)[i.key] : i.placeholder }}</text>
<uni-icons class="arrow"
:size="16"
type="down">
......@@ -64,7 +64,7 @@
<view class="pop-tips-wrapper">
<view class="pop-tips">
<uni-icons :size="16" type="info-circle"></uni-icons>
<text>请完善本次接待结果</text>
<text class="pop-tips-text">请完善本次接待结果</text>
</view>
</view>
<view class="choose-box">
......@@ -74,7 +74,7 @@
@click="chooseResult(item.status)">
<view class="sprite-icon" :class="[`icon-face-${item.status == receptionStatus ? `${item.icon}-active` : item.icon}`]">
</view>
<text>{{ item.text }}</text>
<text class="choose-item-text">{{ item.text }}</text>
</view>
</template>
</view>
......@@ -553,11 +553,11 @@ defineExpose({ open, close });
padding: 0 20px;
max-height: 500px;
flex: 1;
overflow-y: auto;
}
.popup-footer {
display: flex;
flex-direction: row;
padding: 12px 20px;
// border-top: 1px solid #f0f0f0;
gap: 12px;
......@@ -576,12 +576,12 @@ defineExpose({ open, close });
padding: 12px 5px 12px;
/* padding: 12px 40px 12px; */
margin-top: 15px;
}
text {
color: #2c66f7;
font-size: 14px;
text-align: center;
}
.pop-tips-text {
color: #2c66f7;
font-size: 14px;
text-align: center;
}
.error-tip {
......@@ -589,11 +589,11 @@ defineExpose({ open, close });
margin-top: 15px;
text-align: center;
background-color: rgb(254, 237, 234);
}
text {
color: #f45c3d;
font-size: 14px;
}
.error-tip-text {
color: #f45c3d;
font-size: 14px;
}
.pop-tips-wrapper {
......@@ -601,20 +601,21 @@ defineExpose({ open, close });
.pop-tips {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 6px;
padding: 10px 14px;
background: rgba(44, 102, 247, 0.08);
border-radius: 6px;
text {
color: #2c66f7;
font-size: 13px;
}
}
}
.pop-tips-wrapper .pop-tips-text {
color: #2c66f7;
font-size: 13px;
margin-left: 6px;
}
.form {
display: flex;
padding-top: 15px;
......@@ -634,16 +635,8 @@ defineExpose({ open, close });
display: flex;
align-items: center;
text {
color: #6c6c70;
font-size: 15px;
}
.required{
text {
color: #ff0000;
margin-right: 2px;
}
margin-right: 2px;
}
}
......@@ -676,17 +669,6 @@ defineExpose({ open, close });
border-radius: 4px;
box-sizing: border-box;
text {
font-size: 15px;
color: #333333;
}
&.placeholder {
text {
color: #c9c9c9;
}
}
.arrow {
flex-shrink: 0;
margin-left: auto;
......@@ -695,17 +677,12 @@ defineExpose({ open, close });
.select-content {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100%;
text {
flex: 1;
font-size: 15px;
color: #333333;
}
.arrow {
flex-shrink: 0;
margin-left: auto;
......@@ -726,14 +703,11 @@ defineExpose({ open, close });
border: 1px solid #e8e8e8;
border-radius: 8px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-top: 12px;
text {
/* 选择按钮内的文字样式 */
}
.sprite-icon {
margin-right: 8px;
}
......@@ -749,4 +723,28 @@ defineExpose({ open, close });
border-color: #f247241a;
}
}
.form-label-text {
color: #6c6c70;
font-size: 15px;
}
.required-text {
color: #ff0000;
}
.select-text {
flex: 1;
font-size: 15px;
color: #333333;
}
.select-text-placeholder {
color: #c9c9c9;
}
.choose-item-text {
font-size: 15px;
color: #333333;
}
</style>
......@@ -38,23 +38,36 @@
@update:visible="onSettingVisible" />
</view>
<!-- 竖屏手机:底部 TabBar,仅保留场景 Tab,不显示头像和底部两个按钮 -->
<!-- 竖屏手机:uView 底部 TabBar,图标沿用 static/images/tabbar -->
<view v-else
class="left-side left-side-portrait">
<view class="portrait-tabs-row">
<view v-for="(item, index) in tabs"
:key="index"
class="tab-item tab-item-inline"
:class="[currentTabIndex === index ? 'tabActive' : '']"
@click="onChangeTab(index)">
<view class="tab-icon-wrap">
<image class="tab-icon"
<un-tabbar :model-value="currentTabIndex"
class="portrait-un-tabbar"
:fixed="false"
:placeholder="false"
:safe-area-inset-bottom="true"
active-color="#3773f8"
inactive-color="#8a98b5"
bg-color="#ffffff"
height="56"
@change="onPortraitTabChange(($event as string | number))">
<un-tabbar-item v-for="(item, index) in tabs"
:key="index"
:name="index"
:text="item.label"
icon-size="24">
<template #icon="{ active }">
<image v-if="active === true"
class="tabbar-icon-img"
mode="aspectFit"
:src="getTabIconSrc(item.icon, currentTabIndex === index)" />
</view>
<text class="tab-label">{{ item.label }}</text>
</view>
</view>
:src="getTabIconSrc(item.icon, true)" />
<image v-else
class="tabbar-icon-img"
mode="aspectFit"
:src="getTabIconSrc(item.icon, false)" />
</template>
</un-tabbar-item>
</un-tabbar>
</view>
</template>
......@@ -196,6 +209,11 @@ function onChangeTab(index: number): void {
emit("changeTab", index);
}
function onPortraitTabChange(name: string | number): void {
const idx = name as number;
emit("changeTab", idx);
}
function onScenePopupVisible(v: boolean): void {
showScenePopup.value = v;
}
......@@ -274,12 +292,20 @@ function jumpPersonCenter(): void {
.left-side-portrait {
width: 100%;
flex-direction: row;
align-items: center;
padding: var(--l-spacing-sm) var(--l-spacing-md);
min-height: 56px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
justify-content: center;
flex-shrink: 0;
flex-direction: column;
align-items: stretch;
padding: 0;
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}
.portrait-un-tabbar {
width: 100%;
}
.tabbar-icon-img {
width: 24px;
height: 24px;
}
.portrait-top-row {
......@@ -295,37 +321,6 @@ function jumpPersonCenter(): void {
flex-shrink: 0;
}
.portrait-tabs-row {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 var(--l-spacing-sm);
justify-content: center;
}
.portrait-tabs-row .tab-item-inline {
margin-right: var(--l-spacing-md);
padding: var(--l-spacing-xs) var(--l-spacing-sm);
}
.portrait-tabs-row .tabActive .tab-label {
color: #3773f8;
}
.tab-icon-wrap {
width: 24px;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.tab-icon {
width: 24px;
height: 24px;
}
.portrait-action {
flex-shrink: 0;
}
......@@ -446,10 +441,4 @@ function jumpPersonCenter(): void {
margin: var(--l-spacing-sm) auto 0;
}
.tab-item-inline {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
......@@ -449,7 +449,6 @@
/* 高度由 tagScrollStyle 内联 px 指定 */
.tag-list-view {
width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
......
......@@ -409,7 +409,6 @@ function handleClose(): void {
.form-detail-scroll {
width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
......@@ -478,7 +477,7 @@ function handleClose(): void {
flex-grow: 0;
flex-shrink: 0;
height: auto;
min-height: auto;
min-height: 0;
/* 勿用大 padding-bottom;底部留白交给 .form-detail-scroll */
padding-bottom: 0;
}
......@@ -580,7 +579,6 @@ function handleClose(): void {
.goods-card--half {
flex: 0 0 48%;
width: 48%;
max-width: 48%;
}
.goods-image-wrap {
......@@ -590,7 +588,6 @@ function handleClose(): void {
.goods-image {
width: 100%;
display: block;
}
.goods-info {
......
......@@ -248,7 +248,6 @@
.tag-list-view {
width: 100%;
max-width: 100%;
align-self: stretch;
box-sizing: border-box;
flex-shrink: 0;
......
......@@ -947,7 +947,7 @@ defineExpose({
.score-wrap {
display: flex;
flex-direction: row;
align-items: baseline;
align-items: flex-end;
}
.score-num {
......@@ -1578,7 +1578,6 @@ defineExpose({
}
.bubble-time {
display: block;
font-size: 10px;
color: #9CA3AF;
margin-top: 4px;
......
......@@ -22,7 +22,7 @@
<un-icon name="arrow-left" size="20"></un-icon>
</view>
</template>
{{ title }}
<text class="tips-title-text">{{ title }}</text>
</view>
<text v-if="content"
class="tips-text">
......@@ -36,15 +36,11 @@
<view v-if="showCancelBtn"
class="tips-btn close"
@click="cancel">
{{
cancelBtnText
}}
<text class="tips-btn-text tips-btn-text-close">{{ cancelBtnText }}</text>
</view>
<view class="tips-btn preview"
@click="confirm">
{{
confirmBtnText
}}
<text class="tips-btn-text tips-btn-text-preview">{{ confirmBtnText }}</text>
</view>
</view>
<template v-else>
......@@ -188,16 +184,10 @@ defineExpose({ open, close, hide });
position: relative;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text {
font-weight: 500;
font-size: 18px;
color: #292d33;
text-align: center;
}
.icon-back {
position: absolute;
left: 0;
......@@ -208,17 +198,12 @@ defineExpose({ open, close, hide });
}
.tips-text {
display: block;
font-size: 15px;
color: #5a5e66;
letter-spacing: 0.5px;
line-height: 20px;
text-align: center;
margin-top: 24px;
text {
font-size: 15px;
color: #5a5e66;
letter-spacing: 0.5px;
line-height: 20px;
text-align: center;
}
}
.tips-footer {
......@@ -230,33 +215,38 @@ defineExpose({ open, close, hide });
border-top: 1px solid #e8e8e8;
flex-direction: row;
.close {
text {
color: #6c6c70;
}
}
.preview {
text {
color: #2c66f7;
}
}
}
.tips-btn {
width: 50%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
text {
text-align: center;
font-size: 16px;
line-height: 22px;
font-weight: 500;
}
}
}
.tips-title-text {
font-weight: 500;
font-size: 18px;
color: #292d33;
text-align: center;
}
.tips-btn-text {
text-align: center;
font-size: 16px;
line-height: 22px;
font-weight: 500;
}
.tips-btn-text-close {
color: #6c6c70;
}
.tips-btn-text-preview {
color: #2c66f7;
}
.radius{
border-radius: 10px;
......
......@@ -25,7 +25,8 @@
<view class="fab-item"
@click="selectItem(item)">
<view class="icon-box">
<image class="btn-icon"
<image v-if="item.shortTitleUrl != null && item.shortTitleUrl !== ''"
class="btn-icon"
mode="aspectFill"
:src="item.shortTitleUrl" />
<text class="item-text">{{ item.shortTitle }}</text>
......
......@@ -167,29 +167,6 @@ const tabClick = (index: number, item: any) => {
color: #292d33;
}
.tab-item .text.active::before {
content: '';
position: absolute;
top: 0;
left: 32px;
right: 32px;
height: 100%;
background-color: #fff;
z-index: -1;
}
.tab-item .text.active::after {
content: '';
position: absolute;
bottom: 8px;
left: 50%;
transform: translateX(-50%);
width: 20px;
height: 3px;
background-color: #3b73ff;
border-radius: 8px;
}
.flex {
display: flex;
}
......
......@@ -41,6 +41,7 @@
}
},
"orientation": [
"portrait-primary",
"landscape-primary"
]
}
......@@ -68,6 +69,7 @@
"default": {}
},
"orientation": [
"portrait-primary",
"landscape-primary"
],
"permissions": [
......@@ -95,6 +97,7 @@
"icons": {},
"splashScreens": {},
"orientation": [
"portrait-primary",
"landscape-primary"
]
}
......
<template>
<view v-if="visible" class="popup-mask" @tap="close">
<view class="popup-box" @tap.stop="">
<view class="popup-box" :style="popupStyle" @tap.stop="">
<view class="popup-title">
<text class="popup-title-text">套餐详情</text>
<view class="popup-close" @tap="close">
<text class="close-icon">×</text>
</view>
</view>
<view class="popup-content">
<scroll-view class="popup-content" direction="vertical">
<slot></slot>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup lang="uts">
import { ref, defineExpose } from 'vue'
import { ref, defineExpose, computed } from 'vue'
const emit = defineEmits<{
close: []
}>()
const visible = ref(false)
const popupStyle = computed((): UTSJSONObject => {
const info = uni.getWindowInfo()
const winH = info.windowHeight > 0 ? info.windowHeight : 768
const heightPx = Math.round(winH * 0.8)
const minHeightPx = Math.round(winH * 0.32)
return {
height: `${heightPx}px`,
minHeight: `${minHeightPx}px`
} as UTSJSONObject
})
function open(): void {
visible.value = true
......@@ -54,8 +64,6 @@ defineExpose({
.popup-box {
width: 700px;
max-height: 80%;
min-height: 32%;
background: #ffffff;
border-radius: var(--l-radius-xl);
overflow: hidden;
......@@ -97,7 +105,6 @@ defineExpose({
.popup-content {
flex: 1;
overflow: auto;
padding: var(--l-spacing-lg);
}
</style>
......@@ -40,11 +40,11 @@
class="input"
:class="[searchValue != '' ? '' : 'placeholder']"
@click="open">
<text v-if="searchValue != ''">{{ searchValue }}</text>
<text v-else class="placeholder">
请输入门店名称/商户号搜索
<text v-if="searchValue != ''" class="search-input-text">{{ searchValue }}</text>
<view v-else class="placeholder">
<text class="search-placeholder-text">请输入门店名称/商户号搜索</text>
<view class="sprite-icon icon-search"></view>
</text>
</view>
</view>
<input v-else
v-model="searchValue"
......@@ -178,18 +178,17 @@ const chooseMerchant = (userInfo: any): void => {
height: 100%;
position: relative;
.bg {
.bg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
.bg-image {
width: 100%;
height: 100%;
display: block;
}
.bg-image {
width: 100%;
height: 100%;
}
}
.layout {
......@@ -315,8 +314,9 @@ const chooseMerchant = (userInfo: any): void => {
align-items: center;
height: 100%;
width: 100%;
text {
justify-content: center;
.search-input-text {
font-size: 14px;
text-align: center;
}
......@@ -327,7 +327,12 @@ const chooseMerchant = (userInfo: any): void => {
}
.placeholder {
text {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.search-placeholder-text {
font-size: 14px;
color: #999999;
text-align: center;
......
......@@ -20,7 +20,6 @@
width: 338px;
height: 281px;
margin: 191px auto 6px;
display: block;
}
}
</style>
......@@ -9,6 +9,7 @@
<view class="input">
<input v-model="mobile"
class="input-control"
auto-blur
maxlength="11"
placeholder="请输入手机号"
......@@ -25,6 +26,7 @@
<view class="input">
<input v-model="code"
class="input-control"
auto-blur
maxlength="4"
placeholder="请输入验证码"
......@@ -40,7 +42,7 @@
<view class="code-btn"
:class="[count > 0 ? 'code-disabled' : '']"
@click="getSmsCode">
{{ count > 0 ? `重新发送(${count}s)` : '获取验证码' }}
<text class="code-btn-text">{{ count > 0 ? `重新发送(${count}s)` : '获取验证码' }}</text>
</view>
</view>
......@@ -55,8 +57,8 @@
color="#2C66F7"
@click="toggleReadingStatus">
</radio>
<text @click="toggleReadingStatus">我已阅读并同意</text>
<text @click.stop="openPrivacy">《隐私协议》</text>
<text class="auto-login-text" @click="toggleReadingStatus">我已阅读并同意</text>
<text class="auto-login-text" @click.stop="openPrivacy">《隐私协议》</text>
</view>
<view class="autoLogin">
......@@ -64,13 +66,13 @@
color="#2C66F7"
@click="toggleNoSignIn">
</radio>
<text @click="toggleNoSignIn">30天内免登录</text>
<text class="auto-login-text" @click="toggleNoSignIn">30天内免登录</text>
</view>
</view>
</view>
<view class="app-code flex">
APP编码:{{ deviceId }}
<text class="app-code-text">APP编码:{{ deviceId }}</text>
<view class="sprite-icon icon-clone"
@click="copyDeviceId">
</view>
......@@ -369,10 +371,9 @@ function toggleNoSignIn(): void {
border-radius: 5px;
z-index: 999;
text {
.test-entry-text {
color: #fff;
font-size: 14px;
}
}
</style>
......@@ -11,8 +11,7 @@
left: 0;
width: 100%;
height: 100%;
background-image: url('@/assets/activeityCenterBg.png');
background-size: 100% 100%;
background-image: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
}
.login {
......@@ -47,7 +46,7 @@
background: #f7f8fa;
border-radius: 28px;
input {
.input-control {
flex: 1;
height: 100%;
font-size: 16px;
......@@ -67,7 +66,7 @@
margin-right: 20px;
border: none;
text {
.code-btn-text {
font-size: 16px;
font-weight: 500;
color: #2c66f7;
......@@ -92,8 +91,7 @@
border-radius: 28px;
}
.btn[disabled]:not([type]),
.btn[disabled][type='default'] {
.btn-disabled {
background: #c9c9c9 !important;
}
......@@ -114,7 +112,7 @@
margin-right: 4px;
}
text {
.auto-login-text {
color: #2c66f7;
}
}
......@@ -127,7 +125,7 @@
left: 50%;
transform: translate(-50%);
text {
.app-code-text {
font-size: 12px;
line-height: 20px;
color: #999;
......
<template>
<view class="swipe-stack-root">
<template v-for="(item, index) in items"
:key="index">
<view class="swipe-stack-view"
:class="{ 'swipe-stack-show': isActive(item) }"
@touchstart.stop="touchStart"
@touchmove.stop="touchMove"
@touchend.stop="touchEnd">
<!-- uview-unix:与 uView Transition 文档一致的 mode(slide-left / slide-right) -->
<un-transition :show="isActive(item)"
:mode="enterModeSnap"
:duration="enterDurSnap"
timing-function="cubic-bezier(0.25, 1, 0.5, 1)"
class="swipe-stack-transition">
<slot :active="isActive(item)"
:index="index"
:item="item"
name="item"></slot>
</un-transition>
</view>
</template>
</view>
</template>
<script setup lang="uts">
import { watch } from "vue";
type SwipeNextResult = {
nextId: string
modeName: string
title: string
}
const props = defineProps({
items: {
type: Array,
default: (): Array<any> => []
},
toolItems: {
type: Array,
default: (): Array<any> => []
},
currentId: {
type: String,
default: ""
},
drawStatus: {
type: Boolean,
default: false
},
productModelStatus: {
type: Boolean,
default: false
},
scaleValueObject: {
type: UTSJSONObject,
default: (): UTSJSONObject => ({} as UTSJSONObject)
}
});
const emit = defineEmits(["update:currentId"]);
const modeName = ref<string>("");
/** 与当前次切换绑定,避免 modeName 清空后 un-transition 因 mode 变化再次播放入场 */
const enterModeSnap = ref<string>("fade");
const enterDurSnap = ref<number>(300);
const isTouching = ref<boolean>(false);
const touchDiffX = ref<number>(0);
const touchMoveTimerId = ref<number | null>(null);
const startX = ref<number>(0);
const startY = ref<number>(0);
const screenWidth = ref<number>(0);
function isActive(item: any | null): boolean {
if (item == null) {
return false;
}
const sid = (item as UTSJSONObject)["id"];
return sid == props.currentId;
}
onMounted(() => {
const systemInfo = uni.getSystemInfoSync();
screenWidth.value = systemInfo.screenWidth;
});
/** 与 gl_tape 一致:500ms 后清 modeName(仅用于内部方向状态,动效由 un-transition 承担) */
const MODE_CLEAR_MS = 500;
function applyTransitionSnapFromModeName(): void {
const m = modeName.value;
if (m === "to-right") {
enterModeSnap.value = "slide-right";
enterDurSnap.value = 400;
} else if (m === "to-left") {
enterModeSnap.value = "slide-left";
enterDurSnap.value = 400;
} else {
enterModeSnap.value = "fade";
enterDurSnap.value = 300;
}
}
function indexForCurrentId(cid: string): number {
const list = props.toolItems as Array<any>;
for (let i = 0; i < list.length; i++) {
const row = list[i] as UTSJSONObject;
const rid = row["id"];
if (rid != null && `${rid}` === `${cid}`) {
return i;
}
}
return -1;
}
function directionForIndexChange(oldIdx: number, newIdx: number, len: number): string {
if (len < 2 || oldIdx < 0 || newIdx < 0) {
return "";
}
let delta = newIdx - oldIdx;
if (delta > len / 2) {
delta -= len;
}
if (delta < -len / 2) {
delta += len;
}
if (delta > 0) {
return "to-right";
}
if (delta < 0) {
return "to-left";
}
return "";
}
/** Tab 等外部改 currentId 时补方向;滑动切换已在 touchEnd 里设置 modeName */
watch((): string => props.currentId, (newId: string, oldId: string): void => {
if (props.toolItems.length < 2) {
return;
}
if (oldId == null || `${oldId}` === "" || newId === oldId) {
return;
}
if (modeName.value === "") {
const oi = indexForCurrentId(`${oldId}`);
const ni = indexForCurrentId(`${newId}`);
const dir = directionForIndexChange(oi, ni, props.toolItems.length);
if (dir !== "") {
modeName.value = dir;
setTimeout((): void => {
modeName.value = "";
}, MODE_CLEAR_MS);
}
}
applyTransitionSnapFromModeName();
});
function touchStart(e: UniTouchEvent) {
if (props.drawStatus === true) return;
const touches = e.touches;
if (touches.length === 0) return;
const first = touches[0] as UniTouch;
startX.value = first.clientX != null ? first.clientX : 0;
startY.value = first.clientY != null ? first.clientY : 0;
isTouching.value = true;
touchDiffX.value = 0;
}
function touchMove(e: UniTouchEvent) {
if (!isTouching.value || props.drawStatus === true) return;
if (touchMoveTimerId.value != null) return;
touchMoveTimerId.value = setTimeout((): void => {
const touches = e.touches;
if (touches.length === 0) {
touchMoveTimerId.value = null;
return;
}
const t0 = touches[0] as UniTouch;
const moveX = t0.clientX != null ? t0.clientX : 0;
const moveY = t0.clientY != null ? t0.clientY : 0;
if (Math.abs(moveY - startY.value) > Math.abs(moveX - startX.value)) {
touchMoveTimerId.value = null;
return;
}
touchDiffX.value = moveX - startX.value;
touchMoveTimerId.value = null;
}, 1000 / 60) as number;
}
function getNextId(index: number, toolList: Array<any>, diffX: number): SwipeNextResult {
let nextItem: UTSJSONObject;
let swipeModeName = "";
if (diffX < 0) {
nextItem = index === toolList.length - 1 ? toolList[0] as UTSJSONObject : toolList[index + 1] as UTSJSONObject;
swipeModeName = "to-right";
} else {
nextItem = index === 0 ? toolList[toolList.length - 1] as UTSJSONObject : toolList[index - 1] as UTSJSONObject;
swipeModeName = "to-left";
}
const rawId = nextItem["id"];
const nextIdStr = rawId != null ? `${rawId}` : "";
let titleStr = "";
const tTitle = nextItem["title"];
if (tTitle != null) {
titleStr = `${tTitle}`;
}
if (titleStr === "") {
const tShort = nextItem["shortTitle"];
if (tShort != null) {
titleStr = `${tShort}`;
}
}
return {
nextId: nextIdStr,
modeName: swipeModeName,
title: titleStr
};
}
function touchEnd(e: UniTouchEvent) {
isTouching.value = false;
const pendingMoveTimer = touchMoveTimerId.value;
if (pendingMoveTimer != null) {
clearTimeout(pendingMoveTimer);
touchMoveTimerId.value = null;
}
if (modeName.value != null && modeName.value !== "") return;
try {
if (props.drawStatus === true || props.toolItems.length === 0) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const changed = e.changedTouches;
if (changed.length === 0) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const touch = changed[0] as UniTouch;
const endX = touch.clientX != null ? touch.clientX : 0;
const endY = touch.clientY != null ? touch.clientY : 0;
const diffX = endX - startX.value;
if (Math.abs(startY.value - endY) > 100) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const sw = screenWidth.value;
const isDistanceSignificant = Math.abs(diffX) > sw / 8;
let index = -1;
for (let i = 0; i < props.toolItems.length; i++) {
const row = props.toolItems[i] as UTSJSONObject;
const itemIdVal = row["id"];
if (itemIdVal == props.currentId) {
index = i;
break;
}
}
const scaleKey = props.currentId != null ? props.currentId : "";
if (scaleKey !== "" && props.scaleValueObject[scaleKey] == null) {
props.scaleValueObject[scaleKey] = 1;
}
const scaleOk = scaleKey === "" ? true : props.scaleValueObject[scaleKey] == 1;
if (isDistanceSignificant === true && index != -1 && scaleOk === true && props.productModelStatus === false) {
const toolListResolved = props.toolItems as Array<any>;
const result = getNextId(index, toolListResolved, diffX);
modeName.value = result.modeName;
applyTransitionSnapFromModeName();
emit("update:currentId", result.nextId);
touchDiffX.value = 0;
setTimeout(() => {
modeName.value = "";
}, MODE_CLEAR_MS);
} else {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
}
} catch (error: any) {
const errText = error != null ? `${error}` : "unknown";
console.log(`ModuleSwipeStack touchEnd: ${errText}`);
touchDiffX.value = 0;
}
}
</script>
<style lang="scss">
.swipe-stack-root {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.swipe-stack-view {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
top: 0;
left: 0;
visibility: hidden;
will-change: transform;
}
.swipe-stack-show {
position: absolute;
z-index: 1;
visibility: visible;
}
.swipe-stack-transition {
width: 100%;
height: 100%;
}
</style>
<template>
<view class="reception">
<image :src="(props.views as UTSJSONObject).detailUrl" class="reception-image">
</image>
<scroll-view class="reception-scroll"
:scroll-y="true">
<image :src="(props.views as UTSJSONObject).detailUrl"
class="reception-image"
mode="widthFix">
</image>
</scroll-view>
</view>
</template>
<script setup lang="uts">
const props = defineProps({
views: UTSJSONObject,
title: String,
show: Boolean
})
const props = defineProps({
views: {
type: UTSJSONObject,
default: (): UTSJSONObject => ({} as UTSJSONObject)
},
title: String,
show: Boolean
});
</script>
<style lang="scss">
.reception {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
.reception-image {
width: 100%;
height: 100%;
}
}
.reception-scroll {
flex: 1;
width: 100%;
height: 0;
min-height: 0;
}
.reception-image {
width: 100%;
display: block;
}
</style>
......@@ -98,13 +98,13 @@ export function getResponsiveImage(img: ResponsiveImage): string {
// 高倍率屏优先使用高清图
if (pr >= 3) {
if (img.x3) return img.x3;
if (img.x2) return img.x2;
if (img.x3 !== null) return img.x3;
if (img.x2 !== null) return img.x2;
return img.x1;
}
if (pr >= 2) {
if (img.x2) return img.x2;
if (img.x3) return img.x3;
if (img.x2 !== null) return img.x2;
if (img.x3 !== null) return img.x3;
return img.x1;
}
......
......@@ -84,7 +84,7 @@ $uni-font-size-paragraph: 15px;
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-flex;
display: flex;
max-height: 48px; /* 根据 font-size * line-height * 2 计算 */
}
......@@ -105,31 +105,6 @@ $uni-font-size-paragraph: 15px;
align-items: center;
padding-left: 48rpx;
/* color/font-size/font-weight only on <text> in uni-app-x; use .title-text inside */
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
z-index: -2;
width: 100%;
height: 100%;
background: linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%);
opacity: 0.15;
}
&::before {
content: "";
position: absolute;
left: -20rpx;
top: -28rpx;
z-index: -1;
width: 136rpx;
height: 136rpx;
opacity: 0.6;
background: linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%);
filter: blur(24rpx);
}
}
.bg-title {
position: absolute;
......@@ -143,29 +118,4 @@ $uni-font-size-paragraph: 15px;
color: #333333;
font-size: 34rpx;
font-weight: 500;
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
z-index: -2;
width: 100%;
height: 100%;
background: linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%);
opacity: 0.15;
}
&::before {
content: "";
position: absolute;
left: -20rpx;
top: -28rpx;
z-index: -1;
width: 136rpx;
height: 136rpx;
opacity: 0.6;
background: linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%);
filter: blur(24rpx);
}
}
......@@ -15,6 +15,9 @@ var retryTimer: number = 0
export function applyScreenOrientationLock(): void {
// #ifdef APP
if (!layoutService.isInitialized()) {
layoutService.init()
}
if (layoutService.isMode('pad') || layoutService.isMode('desktop')) {
lockOrientation('landscape-primary')
// 某些机型/框架在页面切换后会把方向“抖回去”,这里再补一次锁定
......
......@@ -747,8 +747,6 @@ importers:
apps/uniappX/uniapp-x-tape/uni_modules/uni-logger: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-popup: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-recorder-x: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-scss: {}
......@@ -759,7 +757,7 @@ importers:
apps/uniappX/uniapp-x-tape/uni_modules/uts-openSchema: {}
apps/uniappX/uniapp-x-tape/uni_modules/uts-recorder: {}
apps/uniappX/uniapp-x-tape/uni_modules/uview-unix: {}
apps/uniappX/uniapp-x-tape/uni_modules/z-paging-x: {}
......@@ -10679,6 +10677,7 @@ packages:
vue-i18n@9.14.5:
resolution: {integrity: sha512-0jQ9Em3ymWngyiIkj0+c/k7WgaPO+TNzjKSNq9BvBQaKJECqn9cd9fL4tkDhB5G1QBskGl9YxxbDAhgbFtpe2g==}
engines: {node: '>= 16'}
deprecated: v9 and v10 no longer supported. please migrate to v11. about maintenance status, see https://vue-i18n.intlify.dev/guide/maintenance.html
peerDependencies:
vue: ^3.5.17
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!