New Huajishe Check ChaoXing

This commit is contained in:
e2hang
2025-10-01 10:01:52 +08:00
parent 240b884eac
commit 80be8ae3cf
1094 changed files with 61709 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
export * from './type';
export * from './props';
export * from './swiper-nav';

View File

@@ -0,0 +1,3 @@
export * from './type';
export * from './props';
export * from './swiper-nav';

View File

@@ -0,0 +1,3 @@
import { TdSwiperNavProps } from './type';
declare const props: TdSwiperNavProps;
export default props;

View File

@@ -0,0 +1,31 @@
const props = {
current: {
type: Number,
value: 0,
},
direction: {
type: String,
value: 'horizontal',
},
minShowNum: {
type: Number,
value: 2,
},
paginationPosition: {
type: String,
value: 'bottom',
},
showControls: {
type: Boolean,
value: false,
},
total: {
type: Number,
value: 0,
},
type: {
type: String,
value: 'dots',
},
};
export default props;

View File

@@ -0,0 +1,45 @@
import { SuperComponent, RelationsOptions } from '../common/src/index';
import { TdSwiperNavProps } from './type';
export interface SwiperNavProps extends TdSwiperNavProps {
}
export default class SwiperNav extends SuperComponent {
externalClasses: string[];
properties: {
current: {
type: NumberConstructor;
value: number;
};
total: {
type: NumberConstructor;
value: number;
};
type: {
type: StringConstructor;
value: string;
};
minShowNum: {
type: NumberConstructor;
value: number;
};
showControls: {
type: BooleanConstructor;
value: boolean;
};
direction: {
type: StringConstructor;
value: string;
};
paginationPosition: {
type: StringConstructor;
value: string;
};
};
relations: RelationsOptions;
data: {
prefix: string;
classPrefix: string;
};
methods: {
nav(e: any): void;
};
}

View File

@@ -0,0 +1,70 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
const { prefix } = config;
const name = `${prefix}-swiper-nav`;
let SwiperNav = class SwiperNav extends SuperComponent {
constructor() {
super(...arguments);
this.externalClasses = [`${prefix}-class`];
this.properties = {
current: {
type: Number,
value: 0,
},
total: {
type: Number,
value: 0,
},
type: {
type: String,
value: 'dots',
},
minShowNum: {
type: Number,
value: 2,
},
showControls: {
type: Boolean,
value: false,
},
direction: {
type: String,
value: 'horizontal',
},
paginationPosition: {
type: String,
value: 'bottom',
},
};
this.relations = {
'../swiper/swiper': {
type: 'parent',
},
};
this.data = {
prefix,
classPrefix: name,
};
this.methods = {
nav(e) {
var _a;
const { dir } = e.target.dataset;
const source = 'nav';
this.triggerEvent('nav-btn-change', { dir, source });
if (this.$parent) {
(_a = this.$parent) === null || _a === void 0 ? void 0 : _a.doNavBtnChange(dir, source);
}
},
};
}
};
SwiperNav = __decorate([
wxComponent()
], SwiperNav);
export default SwiperNav;

View File

@@ -0,0 +1,4 @@
{
"component": true,
"styleIsolation": "apply-shared"
}

View File

@@ -0,0 +1,25 @@
<wxs src="../common/utils.wxs" module="_" />
<view
wx:if="{{showControls}}"
class="class {{prefix}}-class {{classPrefix}}__btn"
style="{{_._style([style, customStyle])}}"
>
<view class="{{classPrefix}}__btn--prev" bind:tap="nav" data-dir="prev" aria-role="button" aria-label="上一张" />
<view class="{{classPrefix}}__btn--next" bind:tap="nav" data-dir="next" aria-role="button" aria-label="下一张" />
</view>
<view
wx:if="{{total >= minShowNum}}"
style="{{_._style([style, customStyle])}}"
class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}--{{direction}} {{classPrefix}}__{{type}} {{classPrefix}}--{{paginationPosition}}"
>
<block wx:if="{{ type === 'dots' || type === 'dots-bar'}}">
<view
wx:for="{{total}}"
wx:for-index="idx"
wx:key="idx"
class="{{_.cls(classPrefix + '__' + type + '-item', [['active', current === idx], direction])}}"
/>
</block>
<block wx:if="{{ type === 'fraction'}}"> {{current + 1}}/{{total}} </block>
</view>

View File

@@ -0,0 +1,158 @@
.t-float-left {
float: left;
}
.t-float-right {
float: right;
}
@keyframes tdesign-fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.hotspot-expanded.relative {
position: relative;
}
.hotspot-expanded::after {
content: '';
display: block;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
transform: scale(1.5);
}
.t-swiper-nav__dots,
.t-swiper-nav__dots-bar {
display: flex;
flex-direction: row;
}
.t-swiper-nav__dots-item,
.t-swiper-nav__dots-bar-item {
width: var(--td-swiper-nav-dot-size, 12rpx);
height: var(--td-swiper-nav-dot-size, 12rpx);
background: var(--td-swiper-nav-dot-color, var(--td-font-white-2, rgba(255, 255, 255, 0.55)));
border-radius: 50%;
margin: 0 10rpx;
transition: all 0.4s ease-in;
}
.t-swiper-nav__dots-item--vertical,
.t-swiper-nav__dots-bar-item--vertical {
margin: 10rpx 0;
}
.t-swiper-nav__dots-item--active,
.t-swiper-nav__dots-bar-item--active {
background-color: var(--td-swiper-nav-dot-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
}
.t-swiper-nav__dots-bar-item--vertical.t-swiper-nav__dots-bar-item--active {
width: var(--td-swiper-nav-dot-size, 12rpx);
height: var(--td-swiper-nav-dots-bar-active-width, 40rpx);
}
.t-swiper-nav__dots-bar-item--active {
width: var(--td-swiper-nav-dots-bar-active-width, 40rpx);
border-radius: calc(var(--td-swiper-nav-dot-size, 12rpx) / 2);
background-color: var(--td-swiper-nav-dot-active-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
}
.t-swiper-nav--left {
position: absolute;
left: 24rpx;
top: 50%;
transform: translateY(-50%);
}
.t-swiper-nav--right {
position: absolute;
right: 24rpx;
top: 50%;
transform: translateY(-50%);
}
.t-swiper-nav--top-left {
position: absolute;
top: 24rpx;
left: 24rpx;
}
.t-swiper-nav--top {
position: absolute;
left: 50%;
top: 24rpx;
transform: translateX(-50%);
}
.t-swiper-nav--top-right {
position: absolute;
top: 24rpx;
right: 24rpx;
}
.t-swiper-nav--bottom-left {
position: absolute;
left: 24rpx;
bottom: 24rpx;
}
.t-swiper-nav--bottom {
position: absolute;
left: 50%;
bottom: 24rpx;
transform: translateX(-50%);
}
.t-swiper-nav--bottom-right {
position: absolute;
right: 24rpx;
bottom: 24rpx;
}
.t-swiper-nav--vertical {
flex-direction: column;
}
.t-swiper-nav__fraction {
padding: 0 16rpx;
height: var(--td-swiper-nav-fraction-height, 48rpx);
line-height: var(--td-swiper-nav-fraction-height, 48rpx);
border-radius: calc(var(--td-swiper-nav-fraction-height, 48rpx) / 2);
background: var(--td-swiper-nav-fraction-bg-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
color: var(--td-swiper-nav-fraction-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
font-size: var(--td-swiper-nav-fraction-font-size, 24rpx);
}
.t-swiper-nav__btn {
width: 100%;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.t-swiper-nav__btn--prev,
.t-swiper-nav__btn--next {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: var(--td-swiper-nav-btn-size, 48rpx);
height: var(--td-swiper-nav-btn-size, 48rpx);
border-radius: 50%;
background: var(--td-swiper-nav-btn-bg-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
}
.t-swiper-nav__btn--prev::after,
.t-swiper-nav__btn--next::after {
position: absolute;
left: 50%;
top: 50%;
display: block;
content: '';
width: 12rpx;
height: 12rpx;
border-color: var(--td-swiper-nav-btn-color, var(--td-text-color-anti, var(--td-font-white-1, #ffffff)));
border-style: solid;
}
.t-swiper-nav__btn--prev {
left: 30rpx;
}
.t-swiper-nav__btn--prev::after {
margin-left: 4rpx;
border-width: 2rpx 0 0 2rpx;
transform: translate(-50%, -50%) rotateZ(-45deg);
}
.t-swiper-nav__btn--next {
right: 30rpx;
}
.t-swiper-nav__btn--next::after {
margin-left: -4rpx;
border-width: 2rpx 2rpx 0 0;
transform: translate(-50%, -50%) rotateZ(45deg);
}

View File

@@ -0,0 +1,31 @@
export interface TdSwiperNavProps {
current?: {
type: NumberConstructor;
value?: number;
};
direction?: {
type: StringConstructor;
value?: 'horizontal' | 'vertical';
};
minShowNum?: {
type: NumberConstructor;
value?: number;
};
paginationPosition?: {
type: StringConstructor;
value?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
};
showControls?: {
type: BooleanConstructor;
value?: boolean;
};
total?: {
type: NumberConstructor;
value?: number;
};
type?: {
type: StringConstructor;
value?: SwiperNavigationType;
};
}
export declare type SwiperNavigationType = 'dots' | 'dots-bar' | 'fraction';

View File

@@ -0,0 +1 @@
export {};