first add files
This commit is contained in:
27
ProjectLiaisonForm/pages/swiper/cards/index.js
Normal file
27
ProjectLiaisonForm/pages/swiper/cards/index.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const imageCdn = 'https://tdesign.gtimg.com/mobile/demos';
|
||||
const swiperList = [
|
||||
`${imageCdn}/swiper1.png`,
|
||||
`${imageCdn}/swiper2.png`,
|
||||
`${imageCdn}/swiper1.png`,
|
||||
`${imageCdn}/swiper2.png`,
|
||||
`${imageCdn}/swiper1.png`,
|
||||
];
|
||||
|
||||
Component({
|
||||
data: {
|
||||
current: 0,
|
||||
autoplay: false,
|
||||
duration: 500,
|
||||
interval: 5000,
|
||||
swiperList,
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange(e) {
|
||||
const {
|
||||
detail: { current, source },
|
||||
} = e;
|
||||
console.log(current, source);
|
||||
},
|
||||
},
|
||||
});
|
||||
6
ProjectLiaisonForm/pages/swiper/cards/index.json
Normal file
6
ProjectLiaisonForm/pages/swiper/cards/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-swiper": "tdesign-miniprogram/swiper/swiper"
|
||||
}
|
||||
}
|
||||
34
ProjectLiaisonForm/pages/swiper/cards/index.wxml
Normal file
34
ProjectLiaisonForm/pages/swiper/cards/index.wxml
Normal file
@@ -0,0 +1,34 @@
|
||||
<view class="card-theme">
|
||||
<t-swiper
|
||||
current="{{current}}"
|
||||
autoplay="{{autoplay}}"
|
||||
duration="{{duration}}"
|
||||
interval="{{interval}}"
|
||||
bindchange="onChange"
|
||||
navigation="{{ { type: 'dots' } }}"
|
||||
list="{{swiperList}}"
|
||||
image-props="{{ { shape: 'round' } }}"
|
||||
previousMargin="34px"
|
||||
nextMargin="34px"
|
||||
t-class-nav="card-theme-nav"
|
||||
/>
|
||||
|
||||
<view class="box" style="height: 42px" />
|
||||
|
||||
<t-swiper
|
||||
class="scale-card-theme"
|
||||
current="{{current}}"
|
||||
autoplay="{{autoplay}}"
|
||||
duration="{{duration}}"
|
||||
interval="{{interval}}"
|
||||
bindchange="onChange"
|
||||
navigation="{{ { type: 'dots' } }}"
|
||||
list="{{swiperList}}"
|
||||
image-props="{{ { shape: 'round' } }}"
|
||||
previousMargin="34px"
|
||||
nextMargin="34px"
|
||||
t-class-nav="card-theme-nav"
|
||||
t-class-prev-image="scale-candidate"
|
||||
t-class-next-image="scale-candidate"
|
||||
/>
|
||||
</view>
|
||||
16
ProjectLiaisonForm/pages/swiper/cards/index.wxss
Normal file
16
ProjectLiaisonForm/pages/swiper/cards/index.wxss
Normal file
@@ -0,0 +1,16 @@
|
||||
.card-theme {
|
||||
--td-swiper-radius: 0;
|
||||
--td-swiper-item-padding: 0 12rpx;
|
||||
--td-swiper-nav-dot-color: var(--td-bg-color-component, #e7e7e7);
|
||||
--td-swiper-nav-dot-active-color: var(--td-brand-color, #0052d9);
|
||||
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
|
||||
.card-theme .card-theme-nav {
|
||||
bottom: -18px;
|
||||
}
|
||||
|
||||
.scale-candidate {
|
||||
height: 126px !important;
|
||||
}
|
||||
Reference in New Issue
Block a user