Commit 733c8a6e by liimin

Merge branch 'feature/rework' of http://192.168.3.233:8090/monorepo/venus into feature/rework

2 parents accb3867 da92007d
......@@ -81,13 +81,18 @@ export default {
@import "./adapt/portrait/1080/account-items.scss";
@import "./adapt/portrait/1920/account-items.scss";
/* 全局默认样式 */
/* 全局默认样式:App 端 view 不支持 font-size,基准字号用 var(--l-font-*) 落在 <text> 上 */
.layout-root {
font-size: 14px;
height: 100%;
min-height: 0;
}
/* #ifdef H5 */
.layout-root {
font-size: 14px;
}
/* #endif */
/* #ifdef H5 */
svg {
display: initial;
......
......@@ -332,9 +332,12 @@ function jumpPersonCenter(): void {
padding-top: 46px; /* toRpx(92) / 2 */
}
/* App 端不支持 cursor,H5 可保留手型 */
/* #ifdef H5 */
.user-box-clickable {
cursor: pointer;
}
/* #endif */
.user-info-row {
flex-direction: row;
......
......@@ -102,7 +102,7 @@ const contactRateMasked = computed((): string => {
.title-text {
color: #333333;
font-size: 14px;
font-size: 28rpx;
font-weight: 500;
}
......@@ -118,7 +118,7 @@ const contactRateMasked = computed((): string => {
}
.funnel-title {
font-size: 12px;
font-size: 24rpx;
font-weight: bold;
color: #475569;
margin-bottom: 24px;
......@@ -164,12 +164,12 @@ const contactRateMasked = computed((): string => {
}
.funnel-text-sm {
font-size: 10px;
font-size: 20rpx;
color: rgba(255, 255, 255, 0.8);
}
.funnel-text-lg {
font-size: 18px;
font-size: 36rpx;
font-weight: bold;
color: #ffffff;
}
......@@ -206,12 +206,12 @@ const contactRateMasked = computed((): string => {
}
.side-text-sm {
font-size: 10px;
font-size: 20rpx;
color: #2563eb;
}
.side-text-lg {
font-size: 14px;
font-size: 28rpx;
font-weight: bold;
color: #2563eb;
}
......
......@@ -1483,20 +1483,20 @@ onUnmounted(() => {
}
.right-tab-text {
font-size: 14px;
font-size: 28rpx;
}
.text-slate-400 { color: #94A3B8; }
.text-blue-600 { color: #2563EB; }
.font-bold { font-weight: bold; }
.font-extrabold { font-weight: bold; }
/* Filter Section:单行展示,窄屏可横向滚动 */
/* Filter Section:单行展示(不用 overflow-x,App ucss 非标准);窄屏依赖子项 min-width + 外层裁剪 */
.filter-section {
flex-direction: row;
flex-wrap: nowrap;
margin-bottom: 16px;
align-items: center;
overflow-x: auto;
overflow: hidden;
}
.filter-group {
......
......@@ -32,7 +32,9 @@
</view>
</view>
</view>
<view class="section-title" style="margin-top: 10px;">功能工具</view>
<view class="section-title-row section-title-row--mt">
<text class="section-title">功能工具</text>
</view>
<view class="dynamic-group">
<view class="action-grid">
<view class="action-item" v-for="(action, idx) in dynamicActions" :key="'dynamic-' + idx">
......@@ -573,15 +575,22 @@ defineExpose({
display: flex;
}
.section-title {
.section-title-row {
display: flex;
flex-direction: row;
width: 100%;
padding: 0 4px;
}
.section-title-row--mt {
margin-top: 10px;
}
.section-title {
font-size: 11px;
font-weight: 600;
font-weight: bold;
letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.45);
padding: 0 4px;
}
.dynamic-group {
......@@ -620,7 +629,6 @@ defineExpose({
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
transition: transform 0.2s ease, opacity 0.2s ease;
width: 100%;
}
......@@ -643,7 +651,17 @@ defineExpose({
overflow: hidden;
flex-shrink: 0;
.btn-icon,
/* image 上禁止 flex 对齐属性,由外层 .icon-box 居中 */
.btn-icon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
z-index: 1;
}
.sprite-icon {
position: absolute;
top: 0;
......@@ -652,6 +670,7 @@ defineExpose({
height: 100%;
border-radius: 50%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
z-index: 1;
......
......@@ -9,44 +9,52 @@
<template #swiperCustom>
<view v-if="logic.loadComplete.value" class="swiper-custom-wrap">
<view v-if="logic.packageList.value.length > 0" class="swiper-custom-content">
<swiper class="package-swiper" :current="logic.currentSwiperIndex.value" @change="logic.onSwiperChange">
<swiper-item v-for="(item, idx) in logic.packageList.value" :key="idx" @tap="toDetail(idx)">
<image
v-if="logic.getPkg(item, 'bannerImg')"
class="swiper-bg"
mode="aspectFill"
:src="logic.getPkg(item, 'bannerImg')"
/>
<view class="package-swiper-stack">
<un-swiper
class="package-swiper"
:list="packageSwiperUrls"
:indicator="false"
:autoplay="false"
:circular="logic.packageList.value.length > 1"
:current="logic.currentSwiperIndex.value"
imgMode="aspectFill"
height="100%"
radius="0"
bgColor="transparent"
@change="onPackageSwiperChange"
@click="onPackageSwiperClick"
/>
<view v-if="currentPackageItem != null" class="package-swiper-overlay">
<view class="swiper-name">
{{ logic.getPkg(item, "name") }}
{{ logic.getPkg(currentPackageItem, "name") }}
</view>
<view class="swiper-content-box">
<view class="price price-1">
<text class="price-label">市场价</text>
<view class="num">
<text class="unit">¥</text>
<text>{{ logic.getPkg(item, "marketPrice") }}</text>
<text>{{ logic.getPkg(currentPackageItem, "marketPrice") }}</text>
</view>
</view>
<view class="price price-2">
{{ logic.getPkg(item, "discountPrice") }}
{{ logic.getPkg(currentPackageItem, "discountPrice") }}
</view>
<view class="price price-3">
<text class="price-label">套餐价</text>
<view class="num">
<text class="unit">¥</text>
<text>{{ logic.getPkg(item, "packagePrice") }}</text>
<text>{{ logic.getPkg(currentPackageItem, "packagePrice") }}</text>
</view>
</view>
<view class="briefIntroduction">
{{ logic.getPkg(item, "briefIntroduction") }}
{{ logic.getPkg(currentPackageItem, "briefIntroduction") }}
</view>
</view>
<view class="swiper-btn">
<view class="swiper-btn" @click="toDetailCurrent">
查看详情
</view>
</swiper-item>
</swiper>
</view>
</view>
<view class="swiper-dots">
<view
v-for="(_, i) in logic.packageList.value"
......@@ -103,7 +111,7 @@
</template>
<script setup lang="uts">
import { ref } from "vue";
import { computed, ref } from "vue";
import CenterPopup from "@/components/CenterPopup.uvue";
import HomeFrame from "@/components/HomeFrame/index.uvue";
......@@ -116,6 +124,80 @@ const props = defineProps<{
const logic = props.logic;
const PKG_BANNER_FALLBACK: UTSJSONObject = {
"1": "/static/images/boutique/package-1.webp",
"2": "/static/images/boutique/package-2.webp"
} as UTSJSONObject;
function bannerUrlForItem(item: any): string {
const u = logic.getPkg(item, "bannerImg") as string;
if (u != null && u !== "") {
return u;
}
const tKey = `${logic.getPkg(item, "type")}`;
const fb = PKG_BANNER_FALLBACK[tKey];
if (fb != null && typeof fb === "string" && fb !== "") {
return fb as string;
}
return "/static/images/boutique/package-1.webp";
}
const packageSwiperUrls = computed((): string[] => {
const list = logic.packageList.value;
const out: string[] = [];
for (let i = 0; i < list.length; i++) {
out.push(bannerUrlForItem(list[i]));
}
return out;
});
const currentPackageItem = computed((): any | null => {
const list = logic.packageList.value;
const idx = logic.currentSwiperIndex.value;
if (idx >= 0 && idx < list.length) {
return list[idx];
}
return null;
});
function parsePackageSwiperIndex(e: any): number {
if (e == null) {
return 0;
}
if (typeof e === "number") {
return e as number;
}
const o = e as UTSJSONObject;
const top = o["current"];
if (typeof top === "number") {
return top as number;
}
const idx = o["index"];
if (typeof idx === "number") {
return idx as number;
}
const detail = o["detail"] as UTSJSONObject | null;
if (detail != null) {
const dc = detail["current"];
if (typeof dc === "number") {
return dc as number;
}
}
return 0;
}
function onPackageSwiperChange(e: any): void {
logic.currentSwiperIndex.value = parsePackageSwiperIndex(e);
}
function onPackageSwiperClick(e: any): void {
toDetail(parsePackageSwiperIndex(e));
}
function toDetailCurrent(): void {
toDetail(logic.currentSwiperIndex.value);
}
const homeRef = ref(null);
const customerTypeRef = ref(null);
const packageRef = ref(null);
......@@ -182,18 +264,32 @@ defineExpose({
flex-direction: column;
}
.package-swiper {
.package-swiper-stack {
flex: 1;
width: 100%;
min-height: 0;
position: relative;
}
.swiper-bg {
position: absolute;
.package-swiper {
width: 100%;
height: 100%;
top: 0;
}
.package-swiper-overlay {
position: absolute;
left: 0;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
pointer-events: none;
display: flex;
flex-direction: column;
}
.package-swiper-overlay .swiper-btn {
pointer-events: auto;
}
.swiper-name {
......@@ -373,196 +469,3 @@ defineExpose({
color: #4673ff;
}
</style>
.swiper-custom-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.package-swiper {
flex: 1;
width: 100%;
}
.swiper-bg {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -1;
}
.swiper-name {
padding-top: var(--l-spacing-lg);
text-indent: 67px;
color: #333;
font-size: var(--l-font-base);
font-weight: 500;
}
.swiper-content-box {
margin: var(--l-spacing-md) var(--l-spacing-xl) 0;
height: 132px;
position: relative;
}
.swiper-content-box .price,
.swiper-content-box .briefIntroduction {
position: absolute;
}
.price-1 {
color: #999;
font-size: 10px;
left: var(--l-spacing-xl);
top: 32px;
width: 97px;
text-align: center;
}
.price-1 .num {
color: #333;
font-size: var(--l-font-base);
font-weight: 700;
display: flex;
flex-direction: row;
justify-content: center;
}
.price-1 .unit {
margin-right: 4px;
}
.price-2 {
left: 129px;
top: 48px;
width: 94px;
color: #ff4747;
font-size: var(--l-font-lg);
font-weight: 700;
display: flex;
flex-direction: row;
justify-content: center;
}
.price-3 {
top: 27px;
left: 228px;
color: #999;
font-size: 14px;
width: 148px;
text-align: center;
}
.price-3 .num {
color: #ff4747;
font-size: 22px;
font-weight: 700;
display: flex;
flex-direction: row;
justify-content: center;
}
.price-3 .unit {
margin-right: 8px;
}
.briefIntroduction {
left: 0;
top: 106px;
color: #666;
font-size: 12px;
width: 100%;
text-align: center;
}
.swiper-btn {
color: #4673ff;
font-size: 13px;
text-align: center;
margin-top: var(--l-spacing-md);
}
.swiper-dots {
display: flex;
flex-direction: row;
justify-content: center;
padding: var(--l-spacing-sm) 0;
}
.dot {
width: 8px;
height: 8px;
border-radius: 4px;
background: #ccc;
margin: 0 4px;
}
.dot.active {
background: #4673ff;
}
.swiper-empty,
.swiper-loading {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: var(--l-font-sm);
color: #999;
}
.detail-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.detail-title {
font-size: var(--l-font-2xl);
color: #333;
}
.package-detail-box {
padding-bottom: 50px;
margin: 0 var(--l-spacing-xl);
}
.package-box {
border-radius: var(--l-radius-xl);
background: #ffffff;
box-shadow: 0 6px 24px rgba(44, 102, 247, 0.15);
margin-bottom: var(--l-spacing-xl);
box-sizing: border-box;
padding: var(--l-spacing-xl);
}
.package-name {
color: #333;
font-size: var(--l-font-xl);
font-weight: 500;
line-height: 28px;
margin-bottom: var(--l-spacing-md);
}
.package-content {
line-height: 22px;
color: #333;
font-size: 14px;
}
.package-detail {
border: 2px solid rgba(70, 115, 255, 0.5);
background: rgba(70, 115, 255, 0.1);
box-shadow: 0 6px 24px rgba(44, 102, 247, 0.15);
}
.package-detail .package-name {
color: #4673ff;
}
......@@ -5,7 +5,7 @@
<view class="nav-bar"
:style="{ 'z-index': backZindex }">
<view class="back"
@click="back">
@tap="back">
<uni-icons color="#000"
:size="20"
type="left">
......@@ -605,7 +605,6 @@ onBackPress((options: OnBackPressOptions) => {
left: 0;
top: 24px;
z-index: 9;
pointer-events: none;
.back {
width: 48px;
height: 100%;
......@@ -613,7 +612,6 @@ onBackPress((options: OnBackPressOptions) => {
flex-direction: row;
align-items: center;
justify-content: center;
pointer-events: auto;
}
}
.pen-box {
......
......@@ -8,28 +8,32 @@
<template #swiperCustom>
<view v-if="loadComplete" class="swiper-custom-wrap">
<view v-if="moduleList.length > 0" class="swiper-custom-content">
<swiper class="equity-swiper"
:current="currentSwiperIndex"
:circular="moduleList.length > 1"
<view class="equity-swiper-stack">
<un-swiper
class="equity-swiper"
:list="equitySwiperUrls"
:indicator="false"
:autoplay="moduleList.length > 1"
:circular="moduleList.length > 1"
:interval="5000"
:duration="400"
@change="onSwiperChange">
<swiper-item v-for="(item, idx) in moduleList" :key="idx" @tap="toPreview(item)">
<view class="swiper-card">
<image v-if="getModuleCover(item) != ''"
class="swiper-bg"
mode="aspectFill"
:src="getModuleCover(item)" />
<text class="swiper-name">
{{ getModuleName(item) }}
</text>
<text class="swiper-desc">
{{ getModuleDesc(item) }}
</text>
</view>
</swiper-item>
</swiper>
:current="currentSwiperIndex"
imgMode="aspectFill"
height="100%"
radius="0"
bgColor="transparent"
@change="onSwiperChange"
@click="onEquitySwiperClick"
/>
<view v-if="equityCurrentModule != null" class="equity-swiper-overlay">
<text class="swiper-name">
{{ getModuleName(equityCurrentModule) }}
</text>
<text class="swiper-desc">
{{ getModuleDesc(equityCurrentModule) }}
</text>
</view>
</view>
<text class="module-title">
{{ getCurrentModuleTitle() }}
</text>
......@@ -59,7 +63,7 @@
</template>
<script setup lang="uts">
import { ComponentPublicInstance, ref } from "vue";
import { ComponentPublicInstance, computed, ref } from "vue";
import { getCarBrandsListApi, getEmployeeListApi, getMerchantCarBrandList } from "@/api/common-api.uts";
import { getMockData, getSoureData } from "@/api/system-api.uts";
......@@ -76,6 +80,27 @@ const toolList = ref<Array<any>>([]);
const mediaId = ref<number | string>("");
const currentSwiperIndex = ref<number>(0);
const EQUITY_SWIPER_PLACEHOLDER = "/static/images/login/nothing.webp";
const equitySwiperUrls = computed((): string[] => {
const list = moduleList.value;
const out: string[] = [];
for (let i = 0; i < list.length; i++) {
const cover = getModuleCover(list[i]);
out.push(cover != "" ? cover : EQUITY_SWIPER_PLACEHOLDER);
}
return out;
});
const equityCurrentModule = computed((): any | null => {
const list = moduleList.value;
const idx = currentSwiperIndex.value;
if (idx >= 0 && idx < list.length) {
return list[idx];
}
return null;
});
function normalizeModuleItem(item: any): UTSJSONObject {
const obj = item as UTSJSONObject;
const detailTitle =
......@@ -338,9 +363,42 @@ function toPreview(item: any): void {
uni.navigateTo({ url: `/pages/equity/detail/index?id=${id}&type=preview` });
}
function onSwiperChange(e: UniSwiperChangeEvent): void {
const currentValue = e.detail.current;
currentSwiperIndex.value = currentValue;
function parseSwiperEventIndex(e: any): number {
if (e == null) {
return 0;
}
if (typeof e === "number") {
return e as number;
}
const o = e as UTSJSONObject;
const top = o["current"];
if (typeof top === "number") {
return top as number;
}
const idx = o["index"];
if (typeof idx === "number") {
return idx as number;
}
const detail = o["detail"] as UTSJSONObject | null;
if (detail != null) {
const dc = detail["current"];
if (typeof dc === "number") {
return dc as number;
}
}
return 0;
}
function onSwiperChange(e: any): void {
currentSwiperIndex.value = parseSwiperEventIndex(e);
}
function onEquitySwiperClick(e: any): void {
const i = parseSwiperEventIndex(e);
const list = moduleList.value;
if (i >= 0 && i < list.length) {
toPreview(list[i]);
}
}
async function getSoure(brandIdList: number[], subBrandIdList: number[]): Promise<void> {
const userInfo = storage.get("userInfo") as UTSJSONObject;
......@@ -515,24 +573,28 @@ onShow(() => {
flex-direction: column;
}
.equity-swiper {
.equity-swiper-stack {
flex: 1;
width: 100%;
min-height: 0;
position: relative;
}
.swiper-card {
position: relative;
.equity-swiper {
width: 100%;
height: 100%;
}
.swiper-bg {
.equity-swiper-overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 1;
pointer-events: none;
display: flex;
flex-direction: column;
}
.swiper-name {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!