支付宝小程序Swiper 滚动图 带圆点和跳转方式

支付宝小程序Swiper 滚动图 带圆点和跳转方式,第1张

```

<!-- 滚动图 -->

<view class="swiper" style="position:relative">

<swiper autoplay="{{true}}" circular="{{true}}" onChange="currentHandle">

        <block a:for="{{swiperList}}">

          <swiper-item class="swiper-box">

            <view class="swiper-item" style="width:100%;height:300rpx">

                <!-- lazy-load根据需要 onTap可以点击跳转 data-url绑定到跳转的链接-->

              <image lazy-load="{{true}}" mode="scaleToFill" src="{{itemimage}}" style="display:flex;width:100%;height:300rpx"

                onTap="swiper" data-url="{{itemurl}}" data-index='{{index}}' />

            </view>

          </swiper-item>

        </block>

      </swiper>

    <!-- 圆点 -->

      <view class="swiper_dot">

        <view class="trans MR10 {{current === index 'active': ''}}" a:for="{{swiperList}}" a:key="{{index}}"></view>

      </view>

</view>

```

```

data(){

    swiperList:[

        {

            image:'',//的路径

            url:""//要跳转的路径

        },

                {

            image:'',

            url:""

        }

    ],

    current: 0,//初始化dot

},

//监听current

currentHandle(e) {

consolelog(e)

    //改变current的值

    let { current } = edetail

    thissetData({

      current

    })

},

```

```

swiper-box {

  padding: 0 30rpx;

}

swiper-item {

  border-radius: 10rpx;

  overflow: hidden;

}

swiper_dot {

  display: flex;

  flex: 1;

  justify-content: center;

  position: absolute;

  bottom: 16rpx;

  left: 42%;//通过绝对定位 在滚动图的正下方 具体看自己

}

MR10 {

  margin-right: 10rpx;

}

trans {

  width: 23rpx;

  height: 8rpx;

  background-color: #ffffff70;

  border-radius: 35rpx;

  transition: width 05s linear;

}

active {

  background-color: #ffffffd7;

  width: 67rpx;

  transition: width 05s linear;

}

```

---转自我的自个的

支付宝小程序Swiper 滚动图 带圆点和跳转方式_多甘范科夫斯基的博客-CSDN博客

flex是d性布局,下边的这个是用position中的绝对定位完成的,将这个div设置成绝对定位,然后将bottom的值设置为0,margin:auto再把这个div的背景设置为透明,有很多方法

微信小程序有三大优势:

1、小程序定位精准

微信团队规定,小程序不得超出1M,为此,小程序承载的功能有限,若超出这个范围规定,就容易导致用户体验不佳。因此,小程序需

向用户呈现其核心功能,满足用户的特定需求,即准确定位其功能如此一来,用户的核心需求得到满足后,即可退出小程序。随着技

术的发展,腾讯可能会放宽对小程序体量的限制,届时,小程序会在原有基础上添加新功能,当市场发展趋于完善时,微信团队也会做出相应的调整。

2、对接低频长尾需求

很多企业会针对用户的高频需求推出相应的APP,并通过增添新功能来引导用户需求。但由于低频需求分布零散,无法使企业获得长足发展,很少会得到经营者的关注。微信小程序则能够实现成本控制,给创业者带来更多的发展机遇,因而,开发者会聚焦于推出提供长尾服务的小程序,满足用户的多元化需求,并提升其产品体验。

3、对原生APP的补充

很多实力型企业推出的APP,在长期发展过程中积累了自己的长期用户,其推出小程序的目的是吸引长尾用户,因此,不少APP运营方推出提供核心服务的微信小程序,但对一部用户而言,小程序无法替代原生APP来满足其多方需求。因此,对高频刚需APP而言,小程序可作为其补充,来获取长尾用户。

先前看到网上不少大神写的demo,其菜单栏主要以 A,B,C,D等字母为主,即A,B,C,D等字母为对应该项携带的 id(id不能为汉字或纯数字)。而笔者现在写的项目菜单栏为汉字,所以需要改变数据格式,进而需要改变 wxml 中的循环嵌套和获取。以下为成型后效果,希望对读者有帮助。

实现该功能的思路:通过点击左侧滑栏的某一项,获取到该元素携带的 id ,然后动态传给右侧滑栏的 scroll-into-view ,从而实现右侧滑栏对应的该元素运动置顶。

以下为完整数据

数据格式:

/ pages/listers/listerswxss /

/ pages/list-1/list-1wxss /

/ 总体主盒子 /

container {

position: relative;

width: 100%;

height: 1220rpx;

background-color: #f0f4f7;

color: #939393;

}

/ 左侧栏主盒子 /

nav_left{

/ 设置行内块级元素(没使用定位) /

display: inline-block;

width: 100%;

height: 100%;

/ 主盒子设置背景色为灰色 /

background: #fff;

text-align: center;

/ position: fixed; /

left: 0;

top: 0;

border-top: 1rpx solid #dedede;

}

/ 左侧栏list的item /

nav_left nav_left_items{

background: #fff;

/ 每个高30px /

height: 80rpx;

/ 垂直居中 /

line-height: 80rpx;

/ 再设上下padding增加高度,总高42px /

padding: 15rpx 0;

/ 只设下边线 /

border-bottom: 1px solid #dedede;

/ 文字14px /

font-size: 29rpx;

color: #101010;

font-weight:

}

/ 左侧栏list的item被选中时 /

nav_left nav_left_itemsactive{

/ 背景色变成白色/

background: #f0f4f7;

color: #ed1000;

}

/ 右侧栏主盒子 /

scroll_right{

/ 右侧盒子使用了绝对定位 /

position: fixed;

top: 0;

right: 0;

overflow: auto;

flex: 1;

/ 宽度75%,高度占满,并使用百分比布局 /

width: 75%;

height: 100%;

padding: 20rpx;

box-sizing: border-box;

background-color: #f0f4f7;

border-top: 1rpx solid #dedede;

}

mink::after{

display:block;content:'';clear:both;

}

jiul,jiul image{

width: 100%;

height: 170rpx;

}

minl{

font-size: 29rpx;

color: #777;

text-align: left;

line-height: 60rpx;

float: left;

background: #f0f4f7;

width: 100%;

/ height: 50rpx; /

}

mink{

width: 100%;

background: #fff;

height: 100%;

}

/ 右侧栏list的item /

nav_right_items{

/ 浮动向左 /

float: left;

/ 每个item设置宽度是3333% /

width: 50%;

/ height: 160rpx; /

text-align: center;

color: #4a4a4a;

background: #fff;

}

nav_right_items image{

/ 被设置宽高 /

width: 60px;

height: 50px;

margin-top: 15rpx;

}

nav_right_items text{

/ 给text设成块级元素 /

display: block;

margin-top: 5rpx;

margin-bottom: 10rpx;

font-size: 26rpx;

/ 设置文字溢出部分为 /

overflow: hidden;

white-space: nowrap;

text-overflow: ellipsis;

}

/ 自定义其他点击态样式类 /

other-navigator-hover{

background:#fff;

}

scroll_left{

width:25%;

height:100%;

background:#fff;

text-align:center;

position: fixed;

left: 0;top: 0

}

DRVA是绝对定位指令(从原点开始的移动距离),举个例子:DRVA K5000 K1000 Y0 Y2,其中K5000脉冲数(决定轴可以走多远),K1000是脉冲频率(决定轴可以走多快),Y0脉冲输出地址,Y2输出方向。

三菱PLC是三菱电机在大连生产的主力产品。 它采用一类可编程的存储器,用于其内部存储程序,执行逻辑运算、顺序控制、定时、计数与算术 *** 作等面向用户的指令,并通过数字或模拟式输入/输出控制各种类型的机械或生产过程。

相关信息

三菱FXPLC是小型化,高速度,高性能和所有方面都是相当FX系列中最高档次的超小程序装置,除输入出16~25点的独立用途外,还可以适用于多个基本组件间的连接,模拟控制,定位控制等特殊用途,是一套可以满足多样化广泛需要的PLC。

FX系列PLC拥有无以匹及的速度,高级的功能逻辑选件以及定位控制等特点; FX2N是从16路到256路输入/输出的多种应用的选择方案;FX2N系列是小型化,高速度,高性能和所有方便都是相当于FX系列中最高档次的超小型程序装置。

以上就是关于支付宝小程序Swiper 滚动图 带圆点和跳转方式全部的内容,包括:支付宝小程序Swiper 滚动图 带圆点和跳转方式、请问携程小程序底部的筛选栏是如何实现的,如图、微信小程序有什么优势等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/9969300.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-03
下一篇2023-05-03

发表评论

登录后才能评论

评论列表(0条)

    保存