首頁組件
25
uni_modules/d-swiper-type/changelog.md
Normal file
@@ -0,0 +1,25 @@
|
||||
## 1.0.1(2022-06-14)
|
||||
1.优化代码
|
||||
## 1.0.0(2022-06-03)
|
||||
### 可能为全网最好用的分类插件:侧边导航分类插件【亲测可用:2022-06-02 23:09】
|
||||
|
||||
##### 请直接把代码复制到页面直接使用。
|
||||
````
|
||||
学习方法最重要,仔细看下也好理解,不难。
|
||||
|
||||
|
||||
像这种分类联动 页面,直接把代码里的文件复制出来吧。自定义样式,看看代码你也能看懂
|
||||
有时间改成插件模式
|
||||
|
||||
````
|
||||
|
||||
````
|
||||
此插件功能
|
||||
1.已实现:右边滑动,左边同步滚动到对应位置
|
||||
2.已实现:左边菜单滚动,右边同事滚动到对应位置
|
||||
3.已实现:当右边滑动顶部时,左侧置顶。其他时候始终保持在置顶第二块位置
|
||||
4.左侧一级分类;右侧二级分类 全部都可自定义
|
||||
5.使用2个swiper,卡顿延迟降低到极低
|
||||
6.连续滚动 :跳转下一个分类 几乎无卡顿
|
||||
|
||||
````
|
||||
@@ -0,0 +1,478 @@
|
||||
<template>
|
||||
<view>
|
||||
<view id="headinga">
|
||||
<!-- <view class="fixed">
|
||||
<cu-custom :isBack="true" bgColor=" text-white">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">垂直导航 {{list_data_left.length}}</block>
|
||||
</cu-custom>
|
||||
</view> -->
|
||||
<view
|
||||
style="width: 100%;height: 400rpx;background-color: pink;display: flex;justify-content: center;align-items: center;color: #fff;font-size: 80rpx;">
|
||||
当前高度:{{my_hua_dong_num}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- navScroll -->
|
||||
<!-- navNow -->
|
||||
<view style="background-color: #fff;display: flex;">
|
||||
<view style="width: 20%;background-color: #fff;">
|
||||
<swiper :duration="500"
|
||||
:vertical="true"
|
||||
:display-multiple-items="navCount"
|
||||
:style="'height:'+hh+'px'"
|
||||
:current-item-id="navScroll"
|
||||
>
|
||||
<swiper-item v-for="item,index in navList" :key="index" class=""
|
||||
:item-id="item.navId"
|
||||
>
|
||||
<view class=""
|
||||
:style="navNow==item.navId?'background-color:red;':'background-color: #9bf;'"
|
||||
style="width: 100%;height: 100rpx;margin-top: 20rpx;height: 80rpx;line-height: 80rpx;display: flex;align-items: center;justify-content: center;color: #fff;"
|
||||
@click="onNav(item,item.navId)">
|
||||
<!-- {{navNow}}-{{item.navId}} -->
|
||||
{{item.navId}}
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
|
||||
<scroll-view
|
||||
:scroll-y="true"
|
||||
:scroll-with-animation="true"
|
||||
:enable-back-to-top="true"
|
||||
:style="'height:'+hh+'px'"
|
||||
:scroll-into-view="scrollintoview"
|
||||
@scroll="myonPageScroll"
|
||||
>
|
||||
<view v-for="(item,index) in mainList" :key="index"
|
||||
:id="item.navId"
|
||||
:data-nav-id="item.navId"
|
||||
:data-nav-scroll-id="item.navScrollId"
|
||||
class="trip main-item"
|
||||
style="margin-bottom: 10rpx; border-radius: 0rpx;border: 0rpx solid red;padding: 20rpx 30rpx 0 30rpx;">
|
||||
<view style="width: 100%;;display: flex;flex-wrap: wrap;justify-content: space-between;">
|
||||
<view style="width: 100%;height: 50rpx;;display: flex;align-items: center;" >冰激凌{{item.navId}}</view>
|
||||
<view style="width: 30%;height: 170rpx;background-color: #f2f2f2;margin-top: 20rpx;overflow: hidden;border-radius: 25rpx;position: relative;"
|
||||
v-for="(item_find,index_find) in 9" :key="index_find">
|
||||
<!-- 自定义页面布局start -->
|
||||
<!-- 自定义页面布局start -->
|
||||
<!-- 自定义页面布局start -->
|
||||
|
||||
<!-- <view style="width: 100%;height: 60rpx;line-height: 60rpx;background-color: #ccc;position: absolute;bottom: 0rpx;color: red;
|
||||
display: flex;align-items: center;justify-content: center;z-index: 99;opacity: 0.5;">
|
||||
早餐
|
||||
</view> -->
|
||||
<view style="width: 170rpx;height: 170rpx;background-color: pink;">
|
||||
<image v-if="index%3==0" src="../../static/icon_img/bing.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
<image v-if="index%3==1" src="../../static/icon_img/mangguo.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
<image v-if="index%3==2" src="../../static/icon_img/xigua.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="width: 170rpx;height: 0rpx;margin-bottom: 20rpx;"></view>
|
||||
<view style="width: 170rpx;height: 0rpx;margin-bottom: 20rpx;"></view>
|
||||
<!-- 自定义页面布局end -->
|
||||
<!-- 自定义页面布局end -->
|
||||
<!-- 自定义页面布局end -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- -->
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list_data_right:[],
|
||||
list_data_left:[],
|
||||
list: [],
|
||||
tabCur: 0,
|
||||
mainCur: 0,
|
||||
verticalNavTop: 0,
|
||||
load: true,
|
||||
|
||||
|
||||
heightleft:100,
|
||||
|
||||
|
||||
hh:0,
|
||||
scrolltop:0,
|
||||
scrollintoview:'',
|
||||
|
||||
|
||||
mainList:[],
|
||||
navList:[],
|
||||
|
||||
navCount:0,
|
||||
navNow:0,
|
||||
vue_all_list:[],
|
||||
|
||||
my_hua_dong_num:0,
|
||||
|
||||
|
||||
navScroll:''
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
onLoad() {
|
||||
|
||||
// mainList.push({
|
||||
|
||||
// })
|
||||
|
||||
|
||||
//
|
||||
// this.list_data_right_api()
|
||||
this.list_data_left_api()
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
});
|
||||
let list = [{}];
|
||||
for (let i = 0; i < 26; i++) {
|
||||
list[i] = {};
|
||||
list[i].name = String.fromCharCode(65 + i);
|
||||
list[i].id = i;
|
||||
}
|
||||
this.list = list;
|
||||
this.listCur = list[0];
|
||||
},
|
||||
onReady() {
|
||||
this._onReadyApi()
|
||||
uni.hideLoading()
|
||||
},
|
||||
methods: {
|
||||
myonPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
|
||||
console.log('___________________________________________________start');
|
||||
// console.log('00000000000000000000000000000000');
|
||||
// console.log(e);
|
||||
this.my_hua_dong_num = Math.round(e.detail.scrollTop).toString()
|
||||
// console.log(this.vue_all_list);
|
||||
|
||||
var num = e.currentTarget.offsetTop + e.detail.scrollTop
|
||||
// var num = e.detail.scrollTop
|
||||
|
||||
console.log("滚动距离为:" + num);
|
||||
// console.log("滚动距离为:" + num);
|
||||
|
||||
var ww = this.vue_all_list.find(
|
||||
v => v.top >= num
|
||||
)
|
||||
|
||||
console.log('+++++++++++++++')
|
||||
console.log(this.vue_all_list)
|
||||
console.log('_________ww____________________')
|
||||
console.log(ww)
|
||||
console.log('+++++++++++++++')
|
||||
// console.log(ww)
|
||||
|
||||
if (e.detail.scrollTop<=70) {
|
||||
|
||||
// console.log(this.navList[0].navId)
|
||||
// return
|
||||
this.navNow = this.navList[0].navId
|
||||
} else {
|
||||
this.navNow = ww.id
|
||||
}
|
||||
|
||||
if (ww.dataset.navScrollId) {
|
||||
this.navScroll = ww.dataset.navScrollId
|
||||
} else {
|
||||
this.navScroll = this.navNow
|
||||
}
|
||||
// console.log(ww.dataset.navScrollId)
|
||||
// this.navScroll = ww.dataset.qq
|
||||
|
||||
|
||||
console.log('navNow_____________='+this.navNow)
|
||||
console.log('navScroll_____________='+this.navScroll)
|
||||
|
||||
// this.navScroll =
|
||||
// console.log(ww.id)
|
||||
|
||||
// console.log('+++++++++++++++')
|
||||
// ww.dataset
|
||||
|
||||
// this.scrollStates.mainItems.find(
|
||||
// v => v.top >= top)
|
||||
console.log('___________________________________________________end');
|
||||
|
||||
},
|
||||
TabSelect(e) {
|
||||
this.tabCur = e.currentTarget.dataset.id;
|
||||
this.mainCur = e.currentTarget.dataset.id;
|
||||
this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
|
||||
},
|
||||
VerticalMain(e) {
|
||||
// #ifdef MP-ALIPAY
|
||||
return false //支付宝小程序暂时不支持双向联动
|
||||
// #endif
|
||||
let that = this;
|
||||
let tabHeight = 0;
|
||||
if (this.load) {
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
let view = uni.createSelectorQuery().select("#main-" + this.list[i].id);
|
||||
view.fields({
|
||||
size: true
|
||||
}, data => {
|
||||
this.list[i].top = tabHeight;
|
||||
tabHeight = tabHeight + data.height;
|
||||
this.list[i].bottom = tabHeight;
|
||||
}).exec();
|
||||
}
|
||||
this.load = false
|
||||
}
|
||||
let scrollTop = e.detail.scrollTop + 10;
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
if (scrollTop > this.list[i].top && scrollTop < this.list[i].bottom) {
|
||||
this.verticalNavTop = (this.list[i].id - 1) * 50
|
||||
this.tabCur = this.list[i].id
|
||||
console.log(scrollTop)
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
list_data_left_api() {
|
||||
var that = this
|
||||
//mainList
|
||||
var mainList = []
|
||||
var navList = []
|
||||
// navList
|
||||
var list_data_left = []
|
||||
var navScrollId = ''
|
||||
|
||||
let prevNav = ''
|
||||
|
||||
var i=0
|
||||
for(i ; i<25 ; i++) {
|
||||
const mainId = 'main-'+i
|
||||
const navId = 'nav-'+i
|
||||
const tId = (10000+i).toString()
|
||||
|
||||
if (!prevNav) {
|
||||
prevNav = navId
|
||||
}
|
||||
|
||||
mainList.push({
|
||||
id:mainId,
|
||||
navId:navId,
|
||||
navScrollId:prevNav,
|
||||
data:{
|
||||
id:tId,
|
||||
start:'呵呵',
|
||||
name:tId,
|
||||
}
|
||||
})
|
||||
|
||||
navList.push({
|
||||
navId:navId,
|
||||
mainId:mainId,
|
||||
label:tId
|
||||
})
|
||||
|
||||
prevNav = navId
|
||||
|
||||
// list_data_left.push({
|
||||
// id:(10000+i).toString(),
|
||||
// start:'呵呵',
|
||||
// name:(10000+i).toString(),
|
||||
// })
|
||||
}
|
||||
|
||||
this.mainList = mainList
|
||||
this.navList = navList
|
||||
// this.list_data_left = list_data_left
|
||||
|
||||
console.log(this.navList)
|
||||
console.log(this.mainList)
|
||||
|
||||
this.navNow = this.navList[0].navId
|
||||
|
||||
|
||||
// uni.createSelectorQuery().selectAll('.main-item').fields({
|
||||
// // id:true,
|
||||
// id:true
|
||||
// // dataset:true,
|
||||
// // rect:true,
|
||||
|
||||
// }).exec(res=>{
|
||||
// console.log('---------------------------')
|
||||
// console.log('------------------33---------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log(res)
|
||||
// })
|
||||
|
||||
// return
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
wx.createSelectorQuery().selectAll('.main-item').fields({
|
||||
// id:true,
|
||||
id:true,
|
||||
dataset:true,
|
||||
rect:true,
|
||||
}).exec(res=>{
|
||||
console.log('---------------------------')
|
||||
console.log('---------------------------')
|
||||
|
||||
console.log('---------------------------')
|
||||
console.log('---------------------------')
|
||||
console.log(res[0])
|
||||
|
||||
that.vue_all_list = res[0]
|
||||
|
||||
console.log(that.vue_all_list)
|
||||
console.log('---------------------------vue_all_list_end')
|
||||
})
|
||||
// uni.createSelectorQuery().selectAll('.mmmm').fields({
|
||||
// // id:true,
|
||||
// size:true
|
||||
// // dataset:true,
|
||||
// // rect:true,
|
||||
// }).exec(res=>{
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log(res)
|
||||
// })
|
||||
},300)
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
list_data_right_api() {
|
||||
var list_data_right = []
|
||||
|
||||
var i=0
|
||||
for(i;i<100;i++) {
|
||||
list_data_right.push({
|
||||
id:(10000+i).toString(),
|
||||
start:'呵呵'
|
||||
})
|
||||
}
|
||||
|
||||
this.list_data_right = list_data_right
|
||||
|
||||
console.log(this.list_data_right)
|
||||
|
||||
},
|
||||
onNav(e,kk) {
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
var value = e.navId
|
||||
console.log(e)
|
||||
|
||||
if (e) {
|
||||
this.scrollintoview = value
|
||||
|
||||
this.navNow = kk
|
||||
}
|
||||
|
||||
},
|
||||
_onReadyApi() {
|
||||
console.log('--------------------------------')
|
||||
|
||||
var windowHeight = uni.getSystemInfoSync().windowHeight
|
||||
console.log(windowHeight)
|
||||
var that = this
|
||||
uni.createSelectorQuery().select('#headinga').boundingClientRect((res) => {
|
||||
console.log('+++++++++++++++')
|
||||
console.log('+++++++++++++++')
|
||||
|
||||
|
||||
that.hh = windowHeight - res.height
|
||||
|
||||
that.navCount = Math.round(that.hh/50)
|
||||
// console.log()
|
||||
console.log(that.navCount+'+++++++++++++++'+that.hh)
|
||||
// this.editorCtx = res.context
|
||||
}).exec()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* .aaaa{ */
|
||||
|
||||
/* } */
|
||||
.fixed {
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.VerticalNav.nav {
|
||||
width: 200upx;
|
||||
white-space: initial;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
margin: 0;
|
||||
border: none;
|
||||
height: 50px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item.cur {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item.cur::after {
|
||||
content: "";
|
||||
width: 8upx;
|
||||
height: 30upx;
|
||||
border-radius: 10upx 0 0 10upx;
|
||||
position: absolute;
|
||||
background-color: currentColor;
|
||||
top: 0;
|
||||
right: 0upx;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.VerticalBox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.VerticalMain {
|
||||
background-color: #f1f1f1;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,478 @@
|
||||
<template>
|
||||
<view>
|
||||
<view id="headinga">
|
||||
<!-- <view class="fixed">
|
||||
<cu-custom :isBack="true" bgColor=" text-white">
|
||||
<block slot="backText">返回</block>
|
||||
<block slot="content">垂直导航 {{list_data_left.length}}</block>
|
||||
</cu-custom>
|
||||
</view> -->
|
||||
<view
|
||||
style="width: 100%;height: 400rpx;background-color: pink;display: flex;justify-content: center;align-items: center;color: #fff;font-size: 80rpx;">
|
||||
当前高度:{{my_hua_dong_num}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- navScroll -->
|
||||
<!-- navNow -->
|
||||
<view style="background-color: #fff;display: flex;">
|
||||
<view style="width: 20%;background-color: #fff;">
|
||||
<swiper :duration="500"
|
||||
:vertical="true"
|
||||
:display-multiple-items="navCount"
|
||||
:style="'height:'+hh+'px'"
|
||||
:current-item-id="navScroll"
|
||||
>
|
||||
<swiper-item v-for="item,index in navList" :key="index" class=""
|
||||
:item-id="item.navId"
|
||||
>
|
||||
<view class=""
|
||||
:style="navNow==item.navId?'background-color:red;':'background-color: #9bf;'"
|
||||
style="width: 100%;height: 100rpx;margin-top: 20rpx;height: 80rpx;line-height: 80rpx;display: flex;align-items: center;justify-content: center;color: #fff;"
|
||||
@click="onNav(item,item.navId)">
|
||||
<!-- {{navNow}}-{{item.navId}} -->
|
||||
{{item.navId}}
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
|
||||
<scroll-view
|
||||
:scroll-y="true"
|
||||
:scroll-with-animation="true"
|
||||
:enable-back-to-top="true"
|
||||
:style="'height:'+hh+'px'"
|
||||
:scroll-into-view="scrollintoview"
|
||||
@scroll="myonPageScroll"
|
||||
>
|
||||
<view v-for="(item,index) in mainList" :key="index"
|
||||
:id="item.navId"
|
||||
:data-nav-id="item.navId"
|
||||
:data-nav-scroll-id="item.navScrollId"
|
||||
class="trip main-item"
|
||||
style="margin-bottom: 10rpx; border-radius: 0rpx;border: 0rpx solid red;padding: 20rpx 30rpx 0 30rpx;">
|
||||
<view style="width: 100%;;display: flex;flex-wrap: wrap;justify-content: space-between;">
|
||||
<view style="width: 100%;height: 50rpx;;display: flex;align-items: center;" >冰激凌{{item.navId}}</view>
|
||||
<view style="width: 30%;height: 170rpx;background-color: #f2f2f2;margin-top: 20rpx;overflow: hidden;border-radius: 25rpx;position: relative;"
|
||||
v-for="(item_find,index_find) in 9" :key="index_find">
|
||||
<!-- 自定义页面布局start -->
|
||||
<!-- 自定义页面布局start -->
|
||||
<!-- 自定义页面布局start -->
|
||||
|
||||
<!-- <view style="width: 100%;height: 60rpx;line-height: 60rpx;background-color: #ccc;position: absolute;bottom: 0rpx;color: red;
|
||||
display: flex;align-items: center;justify-content: center;z-index: 99;opacity: 0.5;">
|
||||
早餐
|
||||
</view> -->
|
||||
<view style="width: 170rpx;height: 170rpx;background-color: pink;">
|
||||
<image v-if="index%3==0" src="../../static/icon_img/bing.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
<image v-if="index%3==1" src="../../static/icon_img/mangguo.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
<image v-if="index%3==2" src="../../static/icon_img/xigua.png" style="width: 170rpx;height: 170rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="width: 170rpx;height: 0rpx;margin-bottom: 20rpx;"></view>
|
||||
<view style="width: 170rpx;height: 0rpx;margin-bottom: 20rpx;"></view>
|
||||
<!-- 自定义页面布局end -->
|
||||
<!-- 自定义页面布局end -->
|
||||
<!-- 自定义页面布局end -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- -->
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list_data_right:[],
|
||||
list_data_left:[],
|
||||
list: [],
|
||||
tabCur: 0,
|
||||
mainCur: 0,
|
||||
verticalNavTop: 0,
|
||||
load: true,
|
||||
|
||||
|
||||
heightleft:100,
|
||||
|
||||
|
||||
hh:0,
|
||||
scrolltop:0,
|
||||
scrollintoview:'',
|
||||
|
||||
|
||||
mainList:[],
|
||||
navList:[],
|
||||
|
||||
navCount:0,
|
||||
navNow:0,
|
||||
vue_all_list:[],
|
||||
|
||||
my_hua_dong_num:0,
|
||||
|
||||
|
||||
navScroll:''
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
onLoad() {
|
||||
|
||||
// mainList.push({
|
||||
|
||||
// })
|
||||
|
||||
|
||||
//
|
||||
// this.list_data_right_api()
|
||||
this.list_data_left_api()
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
});
|
||||
let list = [{}];
|
||||
for (let i = 0; i < 26; i++) {
|
||||
list[i] = {};
|
||||
list[i].name = String.fromCharCode(65 + i);
|
||||
list[i].id = i;
|
||||
}
|
||||
this.list = list;
|
||||
this.listCur = list[0];
|
||||
},
|
||||
onReady() {
|
||||
this._onReadyApi()
|
||||
uni.hideLoading()
|
||||
},
|
||||
methods: {
|
||||
myonPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
|
||||
console.log('___________________________________________________start');
|
||||
// console.log('00000000000000000000000000000000');
|
||||
// console.log(e);
|
||||
this.my_hua_dong_num = Math.round(e.detail.scrollTop).toString()
|
||||
// console.log(this.vue_all_list);
|
||||
|
||||
var num = e.currentTarget.offsetTop + e.detail.scrollTop
|
||||
// var num = e.detail.scrollTop
|
||||
|
||||
console.log("滚动距离为:" + num);
|
||||
// console.log("滚动距离为:" + num);
|
||||
|
||||
var ww = this.vue_all_list.find(
|
||||
v => v.top >= num
|
||||
)
|
||||
|
||||
console.log('+++++++++++++++')
|
||||
console.log(this.vue_all_list)
|
||||
console.log('_________ww____________________')
|
||||
console.log(ww)
|
||||
console.log('+++++++++++++++')
|
||||
// console.log(ww)
|
||||
|
||||
if (e.detail.scrollTop<=70) {
|
||||
|
||||
// console.log(this.navList[0].navId)
|
||||
// return
|
||||
this.navNow = this.navList[0].navId
|
||||
} else {
|
||||
this.navNow = ww.id
|
||||
}
|
||||
|
||||
if (ww.dataset.navScrollId) {
|
||||
this.navScroll = ww.dataset.navScrollId
|
||||
} else {
|
||||
this.navScroll = this.navNow
|
||||
}
|
||||
// console.log(ww.dataset.navScrollId)
|
||||
// this.navScroll = ww.dataset.qq
|
||||
|
||||
|
||||
console.log('navNow_____________='+this.navNow)
|
||||
console.log('navScroll_____________='+this.navScroll)
|
||||
|
||||
// this.navScroll =
|
||||
// console.log(ww.id)
|
||||
|
||||
// console.log('+++++++++++++++')
|
||||
// ww.dataset
|
||||
|
||||
// this.scrollStates.mainItems.find(
|
||||
// v => v.top >= top)
|
||||
console.log('___________________________________________________end');
|
||||
|
||||
},
|
||||
TabSelect(e) {
|
||||
this.tabCur = e.currentTarget.dataset.id;
|
||||
this.mainCur = e.currentTarget.dataset.id;
|
||||
this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
|
||||
},
|
||||
VerticalMain(e) {
|
||||
// #ifdef MP-ALIPAY
|
||||
return false //支付宝小程序暂时不支持双向联动
|
||||
// #endif
|
||||
let that = this;
|
||||
let tabHeight = 0;
|
||||
if (this.load) {
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
let view = uni.createSelectorQuery().select("#main-" + this.list[i].id);
|
||||
view.fields({
|
||||
size: true
|
||||
}, data => {
|
||||
this.list[i].top = tabHeight;
|
||||
tabHeight = tabHeight + data.height;
|
||||
this.list[i].bottom = tabHeight;
|
||||
}).exec();
|
||||
}
|
||||
this.load = false
|
||||
}
|
||||
let scrollTop = e.detail.scrollTop + 10;
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
if (scrollTop > this.list[i].top && scrollTop < this.list[i].bottom) {
|
||||
this.verticalNavTop = (this.list[i].id - 1) * 50
|
||||
this.tabCur = this.list[i].id
|
||||
console.log(scrollTop)
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
list_data_left_api() {
|
||||
var that = this
|
||||
//mainList
|
||||
var mainList = []
|
||||
var navList = []
|
||||
// navList
|
||||
var list_data_left = []
|
||||
var navScrollId = ''
|
||||
|
||||
let prevNav = ''
|
||||
|
||||
var i=0
|
||||
for(i ; i<25 ; i++) {
|
||||
const mainId = 'main-'+i
|
||||
const navId = 'nav-'+i
|
||||
const tId = (10000+i).toString()
|
||||
|
||||
if (!prevNav) {
|
||||
prevNav = navId
|
||||
}
|
||||
|
||||
mainList.push({
|
||||
id:mainId,
|
||||
navId:navId,
|
||||
navScrollId:prevNav,
|
||||
data:{
|
||||
id:tId,
|
||||
start:'呵呵',
|
||||
name:tId,
|
||||
}
|
||||
})
|
||||
|
||||
navList.push({
|
||||
navId:navId,
|
||||
mainId:mainId,
|
||||
label:tId
|
||||
})
|
||||
|
||||
prevNav = navId
|
||||
|
||||
// list_data_left.push({
|
||||
// id:(10000+i).toString(),
|
||||
// start:'呵呵',
|
||||
// name:(10000+i).toString(),
|
||||
// })
|
||||
}
|
||||
|
||||
this.mainList = mainList
|
||||
this.navList = navList
|
||||
// this.list_data_left = list_data_left
|
||||
|
||||
console.log(this.navList)
|
||||
console.log(this.mainList)
|
||||
|
||||
this.navNow = this.navList[0].navId
|
||||
|
||||
|
||||
// uni.createSelectorQuery().selectAll('.main-item').fields({
|
||||
// // id:true,
|
||||
// id:true
|
||||
// // dataset:true,
|
||||
// // rect:true,
|
||||
|
||||
// }).exec(res=>{
|
||||
// console.log('---------------------------')
|
||||
// console.log('------------------33---------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log(res)
|
||||
// })
|
||||
|
||||
// return
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
wx.createSelectorQuery().selectAll('.main-item').fields({
|
||||
// id:true,
|
||||
id:true,
|
||||
dataset:true,
|
||||
rect:true,
|
||||
}).exec(res=>{
|
||||
console.log('---------------------------')
|
||||
console.log('---------------------------')
|
||||
|
||||
console.log('---------------------------')
|
||||
console.log('---------------------------')
|
||||
console.log(res[0])
|
||||
|
||||
that.vue_all_list = res[0]
|
||||
|
||||
console.log(that.vue_all_list)
|
||||
console.log('---------------------------vue_all_list_end')
|
||||
})
|
||||
// uni.createSelectorQuery().selectAll('.mmmm').fields({
|
||||
// // id:true,
|
||||
// size:true
|
||||
// // dataset:true,
|
||||
// // rect:true,
|
||||
// }).exec(res=>{
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log('---------------------------')
|
||||
// console.log(res)
|
||||
// })
|
||||
},300)
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
list_data_right_api() {
|
||||
var list_data_right = []
|
||||
|
||||
var i=0
|
||||
for(i;i<100;i++) {
|
||||
list_data_right.push({
|
||||
id:(10000+i).toString(),
|
||||
start:'呵呵'
|
||||
})
|
||||
}
|
||||
|
||||
this.list_data_right = list_data_right
|
||||
|
||||
console.log(this.list_data_right)
|
||||
|
||||
},
|
||||
onNav(e,kk) {
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
console.log('________________onNav___'+kk)
|
||||
var value = e.navId
|
||||
console.log(e)
|
||||
|
||||
if (e) {
|
||||
this.scrollintoview = value
|
||||
|
||||
this.navNow = kk
|
||||
}
|
||||
|
||||
},
|
||||
_onReadyApi() {
|
||||
console.log('--------------------------------')
|
||||
|
||||
var windowHeight = uni.getSystemInfoSync().windowHeight
|
||||
console.log(windowHeight)
|
||||
var that = this
|
||||
uni.createSelectorQuery().select('#headinga').boundingClientRect((res) => {
|
||||
console.log('+++++++++++++++')
|
||||
console.log('+++++++++++++++')
|
||||
|
||||
|
||||
that.hh = windowHeight - res.height
|
||||
|
||||
that.navCount = Math.round(that.hh/50)
|
||||
// console.log()
|
||||
console.log(that.navCount+'+++++++++++++++'+that.hh)
|
||||
// this.editorCtx = res.context
|
||||
}).exec()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* .aaaa{ */
|
||||
|
||||
/* } */
|
||||
.fixed {
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.VerticalNav.nav {
|
||||
width: 200upx;
|
||||
white-space: initial;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
margin: 0;
|
||||
border: none;
|
||||
height: 50px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item.cur {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.VerticalNav.nav .cu-item.cur::after {
|
||||
content: "";
|
||||
width: 8upx;
|
||||
height: 30upx;
|
||||
border-radius: 10upx 0 0 10upx;
|
||||
position: absolute;
|
||||
background-color: currentColor;
|
||||
top: 0;
|
||||
right: 0upx;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.VerticalBox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.VerticalMain {
|
||||
background-color: #f1f1f1;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,10 @@
|
||||
## 【2023-左侧联动分类插件-可能是最好用的插件】-全网唯一几乎无卡顿 [相对来说]
|
||||
## d-swiper-type
|
||||
|
||||
|
||||
````
|
||||
|
||||
直接复制组件代码到页面旧可以,不用使用组件,超简单,超丝滑~
|
||||
|
||||
|
||||
````
|
||||
|
After Width: | Height: | Size: 365 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 765 B |
|
After Width: | Height: | Size: 398 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 626 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
89
uni_modules/d-swiper-type/package.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"id": "d-swiper-type",
|
||||
"displayName": "2023_侧边联动导航滑动分类_【超流畅、超丝滑、全网唯一】国际庄邓",
|
||||
"version": "1.0.1",
|
||||
"description": "2023_侧边联动导航滑动分类_【超流畅、超丝滑、全网唯一】国际庄邓",
|
||||
"keywords": [
|
||||
"uni_modules",
|
||||
"联动侧边栏导航分类",
|
||||
"分类",
|
||||
"侧边",
|
||||
"联动"
|
||||
],
|
||||
"repository": "https://github.com/qq1415551519/uniapp-d-search-log",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.20"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
"前端组件",
|
||||
"通用组件"
|
||||
],
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
},
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y",
|
||||
"钉钉": "y",
|
||||
"快手": "y",
|
||||
"飞书": "y",
|
||||
"京东": "y",
|
||||
"小红书": "y"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "y",
|
||||
"联盟": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
uni_modules/d-swiper-type/readme.md
Normal file
@@ -0,0 +1,30 @@
|
||||
## 【2023-左侧联动分类插件-可能是最好用的插件】-全网唯一几乎无卡顿【超丝滑~】
|
||||
## d-swiper-type
|
||||
|
||||
|
||||
````
|
||||
|
||||
弹框插件: https://ext.dcloud.net.cn/plugin?id=2708
|
||||
|
||||
日历插件: https://ext.dcloud.net.cn/plugin?id=2779
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
||||
````
|
||||
|
||||
1. /pages/home/hometype.vue 为案例文件
|
||||
|
||||
|
||||
|
||||
````
|
||||
|
||||
### 下载插件后直接复制到自己页面使用。【直接复制代码】
|
||||
|
||||
````
|
||||
|
||||
1.文件路径:'@/uni_modules/d-swiper-type/components/d-swiper-type/pages/home/hometype.vue'
|
||||
2.复制图片目录 static/icon_img
|
||||
|
||||
````
|
||||
20
uni_modules/liu-super-slide/changelog.md
Normal file
@@ -0,0 +1,20 @@
|
||||
## 1.0.9(2023-06-08)
|
||||
增加预览二维码
|
||||
## 1.0.8(2023-05-31)
|
||||
增加license
|
||||
## 1.0.7(2023-05-15)
|
||||
增加点击事件
|
||||
## 1.0.6(2023-05-14)
|
||||
优化赋值
|
||||
## 1.0.5(2023-05-13)
|
||||
优化代码
|
||||
## 1.0.4(2023-05-13)
|
||||
优化手动点击逻辑
|
||||
## 1.0.3(2023-05-13)
|
||||
优化手动点击逻辑
|
||||
## 1.0.2(2023-05-12)
|
||||
增加属性
|
||||
## 1.0.1(2023-05-12)
|
||||
增加示例
|
||||
## 1.0.0(2023-05-12)
|
||||
初始发布
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="card-list" v-if="showListArr.length>0">
|
||||
<image v-if="bgUrl" class="swiper-img" :src='bgUrl'></image>
|
||||
<p class="card-info" :class="item.class<5?'card' + item.class:item.class%2==0?'card3':'card2'"
|
||||
v-for="(item, index) in showListArr" :key="index" @click.stop="click(item.class,item,true)">
|
||||
<image class="item-img" :src="item.picUrl"></image>
|
||||
<!-- <view class="item-name">{{item.title}}</view> -->
|
||||
</p>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
//轮播数据源
|
||||
swiperList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
//背景图片
|
||||
bgUrl: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否自动轮播
|
||||
autoplay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
//轮播自动切换时间间隔
|
||||
interval: {
|
||||
type: Number,
|
||||
default: 5000
|
||||
},
|
||||
//点击轮播是否有触感振动(自动轮播不生效)
|
||||
vibrate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timer: null,
|
||||
showListArr: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
swiperList: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(newArr) {
|
||||
let newList = JSON.parse(JSON.stringify(newArr))
|
||||
if (newList.length == 0) return
|
||||
this.$nextTick(() => {
|
||||
newList.forEach((res, index) => {
|
||||
res.class = index
|
||||
})
|
||||
this.showListArr = JSON.parse(JSON.stringify(newList))
|
||||
if (this.autoplay) this.autoPlayFun()
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
autoPlayFun() {
|
||||
this.timer = setInterval(() => {
|
||||
this.getMenu()
|
||||
}, this.interval)
|
||||
},
|
||||
getMenu() {
|
||||
let list = this.showListArr.filter(res => res.class == 1)
|
||||
this.click(1, list[0], false)
|
||||
},
|
||||
click(index, mess, clickState) {
|
||||
if(clickState) this.$emit('click', mess)
|
||||
if (this.autoplay && clickState) return
|
||||
if (clickState && this.vibrate && !this.autoplay) uni.vibrateShort()
|
||||
if (clickState) {
|
||||
this.getMenu()
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < this.showListArr.length; i++) {
|
||||
const item = this.showListArr[i]
|
||||
if (item.class > index) {
|
||||
item.class--
|
||||
} else if (item.class === index) {
|
||||
item.class = 0
|
||||
} else if (item.class === 0) {
|
||||
item.class = this.showListArr.length - 1
|
||||
}
|
||||
}
|
||||
this.$emit('change', mess)
|
||||
},
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.card-list {
|
||||
width: 100%;
|
||||
height: 360rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.swiper-img {
|
||||
position: absolute;
|
||||
width: 94%;
|
||||
height: 250rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
border-radius: 16rpx;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.card-list p {
|
||||
border-radius: 8rpx;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
transition: all 1s cubic-bezier(0.36, 0, 0.64, 1);
|
||||
}
|
||||
|
||||
.card-info {
|
||||
width: 240rpx;
|
||||
height: 180rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.item-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
position: absolute;
|
||||
font-size: 30rpx;
|
||||
line-height: 30rpx;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0px 4rpx 8rpx #000000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.card0 {
|
||||
transform: scale(1.5, 1.5);
|
||||
left: 255rpx;
|
||||
z-index: 9999 !important;
|
||||
}
|
||||
|
||||
.card0 .item-name {
|
||||
width: 100%;
|
||||
top: 75rpx;
|
||||
}
|
||||
|
||||
.card1 {
|
||||
left: 50rpx;
|
||||
}
|
||||
|
||||
.card1 .item-name {
|
||||
width: 40rpx;
|
||||
height: 100%;
|
||||
top: 0rpx;
|
||||
left: 10rpx;
|
||||
}
|
||||
|
||||
.card2 {
|
||||
left: 120rpx;
|
||||
z-index: 999 !important;
|
||||
}
|
||||
|
||||
.card2 .item-name {
|
||||
width: 40rpx;
|
||||
height: 100%;
|
||||
top: 0rpx;
|
||||
left: 10rpx;
|
||||
}
|
||||
|
||||
.card3 {
|
||||
left: 390rpx;
|
||||
z-index: 999 !important;
|
||||
}
|
||||
|
||||
.card3 .item-name {
|
||||
width: 40rpx;
|
||||
height: 100%;
|
||||
top: 0rpx;
|
||||
right: 10rpx;
|
||||
}
|
||||
|
||||
.card4 {
|
||||
left: 460rpx;
|
||||
}
|
||||
|
||||
.card4 .item-name {
|
||||
width: 40rpx;
|
||||
height: 100%;
|
||||
top: 0rpx;
|
||||
right: 10rpx;
|
||||
}
|
||||
</style>
|
||||
6
uni_modules/liu-super-slide/license.md
Normal file
@@ -0,0 +1,6 @@
|
||||
### 1、本插件可免费下载使用;
|
||||
### 2、未经许可,严禁复制本插件派生同类插件上传插件市场;
|
||||
### 3、未经许可,严禁在插件市场恶意复制抄袭本插件进行违规获利;
|
||||
### 4、对本软件的任何使用都必须遵守这些条款,违反这些条款的个人或组织将面临法律追究。
|
||||
|
||||
|
||||
85
uni_modules/liu-super-slide/package.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "liu-super-slide",
|
||||
"displayName": "轮播图、3D轮播、堆叠轮播(很好看)",
|
||||
"version": "1.0.9",
|
||||
"description": "很好看、很好用的3D轮播、堆叠轮播,支持任何图片数量、点击、自动轮播、手动轮播(走过路过千万不要错过)",
|
||||
"keywords": [
|
||||
"3D轮播",
|
||||
"轮播",
|
||||
"堆叠轮播",
|
||||
"轮播图",
|
||||
"图片轮播"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"type": "component-vue",
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "无",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "u"
|
||||
},
|
||||
"App": {
|
||||
"app-vue": "u",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "u",
|
||||
"IE": "u",
|
||||
"Edge": "u",
|
||||
"Firefox": "u",
|
||||
"Safari": "u"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u",
|
||||
"钉钉": "u",
|
||||
"快手": "u",
|
||||
"飞书": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
78
uni_modules/liu-super-slide/readme.md
Normal file
@@ -0,0 +1,78 @@
|
||||
### liu-super-slide适用于uni-app项目的3D轮播、堆叠轮播、轮播图(很好看)组件
|
||||
### 本组件目前兼容微信小程序、H5
|
||||
### 本组件是很好看、好用的3D轮播、堆叠轮播,支持任何图片数量、点击、自动轮播、手动轮播(走过路过千万不要错过)
|
||||
# --- 扫码预览、关注我们 ---
|
||||
|
||||
## 扫码关注公众号,查看更多插件信息,预览插件效果!
|
||||
|
||||

|
||||
|
||||
### 使用方式
|
||||
```
|
||||
<template>
|
||||
<view class="page-main">
|
||||
<liu-super-slide :swiperList="swiperList" :bgUrl="bgUrl" :autoplay="autoplay" :interval="interval"
|
||||
@change="change" @click="click"></liu-super-slide>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
autoplay: true,
|
||||
interval: 3000,
|
||||
bgUrl: "https://cdn.pixabay.com/photo/2020/09/05/19/38/landscape-5547401_1280.png",
|
||||
swiperList: [{
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2020/05/19/13/32/cartoon-5190837_1280.jpg',
|
||||
title: '思考'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2020/05/19/13/35/cartoon-5190860_1280.jpg',
|
||||
title: '雨天'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2021/07/22/11/25/rabbit-6485072_1280.jpg',
|
||||
title: '兔子'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2022/03/31/14/53/camp-7103189_1280.png',
|
||||
title: '日落'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2022/11/29/19/05/boho-7625140_1280.jpg',
|
||||
title: '植物'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2022/08/25/23/06/woman-7411414_1280.png',
|
||||
title: '时尚'
|
||||
}, {
|
||||
picUrl: 'https://cdn.pixabay.com/photo/2023/03/07/12/45/child-7835677_1280.jpg',
|
||||
title: '生活'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change(e) {
|
||||
console.log('当前轮播信息:', e)
|
||||
},
|
||||
//点击轮播
|
||||
click(e) {
|
||||
console.log('点击轮播', e)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
### 属性说明
|
||||
| 名称 | 类型 | 默认值 | 描述 |
|
||||
| ----------------------------|---------------- | ---------------------- | ---------------|
|
||||
| swiperList | Array | [] | 轮播数据源
|
||||
| bgUrl | String | | 背景图片(非必传)
|
||||
| autoplay | Boolean | true | 是否自动轮播
|
||||
| interval | Number | 5000 | 轮播自动切换时间间隔(autoplay为true时生效)
|
||||
| vibrate | Boolean | true | 点击轮播是否有触感振动(自动轮播不生效)
|
||||
| @change | Function | | 轮播回调
|
||||
| @click | Function | | 点击轮播
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||