微信小程序很多小球滑动一直到达终点

微信小程序很多小球滑动一直到达终点,第1张

1 重力加速度:在小球滑动的过程中,受到重力的作用,小球的速度会越来越快,从而滑动到终点

2 摩擦力:小球滑动过程中,受到摩擦力的影响,会在碰到某些障碍物时减速,从而造成小球滑动的规律性的运动,最终也可以到达终点。

3 d力:当小球碰到障碍物时,受到d力的作用,会造成小球向后突然跳跃而滑动起来,最终也可以到达终点。

往左边滑动出现删除按钮, 只对当前滑动的对象 *** 作

<view class="shop-list">

    <view class="check-all-box" bindtap="onCheckAll">

      <view>

        <label class="check-around8"  bindtap="selected" data-lor='1'>

          <radio checked="{{allSelectedtrue:false}}" color="#000"></radio>

          <text class="check-all">{{checkAllText}}全选</text>

        </label> 

      </view>

    </view>

    <view class="item-box  {{itemisTouchMove 'touch-move-active' : ''}}" data-index="{{index}}" bindtouchstart="touchstart" bindtouchmove="touchmove" wx:for="{{list}}" wx:key="{{index}}">

      <view class="item">

        <view class="check-around-box" data-id="{{itemid}}" >

            <label bindtap="selected" data-id="{{itemid}}" data-isSelect="{{itemisSelect}}">

              <radio checked="{{itemisSelect>0true:false}}" color="#000"></radio>

            </label>   

          </view>

        <view class="item-img-box">

          <image class="item-img" src="{{itemthumbUrl}}" />

        </view>

        <view class="item-info-box">

          <text class="item-title">{{itemtitle}}</text>

          <text class="item-spec">{{itemspec}}</text>

          <text class="item-price">¥{{itemprice}}</text>

          <view class="num-box">

            <view class="num-desc" data-id="{{itemid}}" data-total="{{itemtotal}}" bindtap="reduce">-</view>

            <input class="item-input" type="number"disabled="boolean" value="{{itemtotal}}" />

            <view class="num-plus" data-id="{{itemid}}" data-total="{{itemtotal}}" bindtap="plus">+</view>

          </view>

        </view>

      </view>

      <view class="remove" data-id="{{itemid}}" bindtap="remove">{{remove}}删除</view>

    </view>

  </view>

page{

  background-color: #f8f8f8;

}

shop-list {

  display: flex;

  flex-direction: column;

  margin-top: 30rpx;

  padding-bottom:120rpx;

}

check-all-box {

  display: flex;

  align-items: center;

  padding: 30rpx;

  background-color: #fff;

}

check-all-box  check-all {

  margin-left: 20rpx;

  font-size: 30rpx;

}

check-around {

  width: 35rpx;

  height: 35rpx;

  margin-right:20rpx;

  border-radius: 50rpx;

  border: 1rpx solid #f8f8f8;

}

check-active {

  width: 35rpx;

  height: 35rpx;

  border-radius: 50rpx;

  background-color: #999999;

}

item-box {

  margin-bottom: 20rpx;

  position: relative;

  z-index: 99;

  font-size: 14px;

  display: flex;

  justify-content: space-between;

  border-bottom:1px solid #ccc;

  width: 100%;

  overflow: hidden

}

item {

  display: flex;

  align-items: center;

  padding: 30rpx;

  background-color: #fff;

  position: relative;

  z-index: 99;

  width: 100%;

  margin-right:0;

  -webkit-transition: all 04s;

  transition: all 04s;

  -webkit-transform: translateX(90px);

  transform: translateX(90px);

  margin-left: -90px

}

item item-img {

  width: 180rpx;

  height: 180rpx;

  border-radius: 5rpx;

  border: 1rpx solid #eaeaea;

}

item item-info-box {

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  width: 420rpx;

  height: 180rpx;

  margin-left:20rpx;

}

item-info-box item-title {

  font-size: 30rpx;

  white-space: nowrap;

  text-overflow: ellipsis;

  overflow: hidden;

  word-break: break-all;

}

item-info-box item-spec {

  color: #676767;

  margin-top: 15rpx;

  text-overflow: -o-ellipsis-lastline;

  overflow: hidden;

  text-overflow: ellipsis;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  line-clamp: 2;

  -webkit-box-orient: vertical;

}

item-info-box item-price {

  display: flex;

  margin-top: 15rpx;

}

item-info-box num-box {

  display: flex;

  align-items: center;

  justify-content: flex-end;

  font-size: 30rpx;

}

num-box num-desc {

  padding: 0 10rpx;

  color: #999;

  border: 4rpx solid #999;

}

num-box item-input {

  width: 80rpx;

}

item-input {

  text-align: center;

}

num-box num-plus {

  padding: 0 10rpx;

  color: #fff;

  background-color: #000;

  border: 4rpx solid #000;

}

remove {

  background-color: orangered;

  width: 90px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  color: #fff;

  -webkit-transform: translateX(90px);

  transform: translateX(90px);

  -webkit-transition: all 04s;

  transition: all 04s;

}

touch-move-active item,

touch-move-active remove {

  -webkit-transform: translateX(0);

  transform: translateX(0);

}

var app = getApp()

Page({

  data: {

    list: [

      {

        id: '1',

        thumbUrl: '>

二级侧边导航连续滑动设置微信小程序方法如下:

1、打开样式布局(wxml文件),更改js文件和数据文件(sidejs)。

2、页面显示出来了,也可以将side文件写入data里面,或是将文件写入外部,进行模块的导入,两种方法都可以。

div部分

<template>

<view>

<scroll-view scroll-x="true">

<view class="item1">

<view>

dsadsa dsadas

</view>

</view>

<view class="item2">

<view style='color: #fff;font-size: 24rpx;position: relative;left: 20rpx;line-height: 100rpx;height: 100rpx;float: left;' @click='deleteclick(item)'>删除</view>

</view>

</scroll-view>

</view>

</template>

css部分

<style scoped >

scroll-view{

width: 100%;

height: 100rpx;

white-space: nowrap;

}

item1,item2,item3{

display: inline-block;

width: 100%;

height:100rpx;

}

item1{

background-color: #fff;

}

item2{

width: 100rpx;

height: 100rpx;

color: #FFFFFF;

background-color: #CA0000;

position: relative;

top: -20rpx;

}

</style>

以上就是关于微信小程序很多小球滑动一直到达终点全部的内容,包括:微信小程序很多小球滑动一直到达终点、微信小程序购物车 滑动删除效果、二级侧边导航连续滑动怎么设置微信小程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

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

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

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

发表评论

登录后才能评论

评论列表(0条)

    保存