data: {
nums: 1,
start: '',
// change:''
// 上一部记忆数据
mid: ''
},
mytouchmove: function (e) {
var start = this.data.start;
var change = parseInt(e.touches[0].pageX);
let that=this;
var nums = this.data.nums;
if ((change - start) % 2 == 0 && (change - this.data.mid) > 0) {
nums++;
if (nums > 35) {
nums = 1;
}
// console.log(n)
} else if ((change - start) % 2 == 0 && (change - this.data.mid) < 0) {
nums--;
if (nums < 1) {
nums = 35;
}
 
 
}
this.setData({
mid: parseInt(change),
nums: nums
})
},
mytouchstart: function (e) {
var start = this.data.start;
start = e.touches[0].pageX;
this.setData({
start: parseInt(start)
})
},
 
 
 
 
<view class='box'>
<view class='pic'>
<image mode='widthFix' class="{{nums==1?'active':''}}" src='../../img/01.jpg'></image>
<image mode='widthFix' class="{{nums==2?'active':''}}" src='../../img/02.jpg'></image>
<image mode='widthFix' class="{{nums==3?'active':''}}" src='../../img/03.jpg'></image>
<image mode='widthFix' class="{{nums==4?'active':''}}" src='../../img/04.jpg'></image>
<image mode='widthFix' class="{{nums==5?'active':''}}" src='../../img/05.jpg'></image>
<image mode='widthFix' class="{{nums==6?'active':''}}" src='../../img/06.jpg'></image>
<image mode='widthFix' class="{{nums==7?'active':''}}" src='../../img/07.jpg'></image>
<image mode='widthFix' class="{{nums==8?'active':''}}" src='../../img/08.jpg'></image>
<image mode='widthFix' class="{{nums==9?'active':''}}" src='../../img/09.jpg'></image>
<image mode='widthFix' class="{{nums==10?'active':''}}" src='../../img/10.jpg'></image>
<image mode='widthFix' class="{{nums==11?'active':''}}" src='../../img/11.jpg'></image>
<image mode='widthFix' class="{{nums==12?'active':''}}" src='../../img/12.jpg'></image>
<image mode='widthFix' class="{{nums==13?'active':''}}" src='../../img/13.jpg'></image>
<image mode='widthFix' class="{{nums==14?'active':''}}" src='../../img/14.jpg'></image>
<image mode='widthFix' class="{{nums==15?'active':''}}" src='../../img/15.jpg'></image>
<image mode='widthFix' class="{{nums==16?'active':''}}" src='../../img/16.jpg'></image>
<image mode='widthFix' class="{{nums==17?'active':''}}" src='../../img/17.jpg'></image>
<image mode='widthFix' class="{{nums==18?'active':''}}" src='../../img/18.jpg'></image>
<image mode='widthFix' class="{{nums==19?'active':''}}" src='../../img/19.jpg'></image>
<image mode='widthFix' class="{{nums==20?'active':''}}" src='../../img/20.jpg'></image>
<image mode='widthFix' class="{{nums==21?'active':''}}" src='../../img/21.jpg'></image>
<image mode='widthFix' class="{{nums==22?'active':''}}" src='../../img/22.jpg'></image>
<image mode='widthFix' class="{{nums==23?'active':''}}" src='../../img/23.jpg'></image>
<image mode='widthFix' class="{{nums==24?'active':''}}" src='../../img/24.jpg'></image>
<image mode='widthFix' class="{{nums==25?'active':''}}" src='../../img/25.jpg'></image>
<image mode='widthFix' class="{{nums==26?'active':''}}" src='../../img/26.jpg'></image>
<image mode='widthFix' class="{{nums==27?'active':''}}" src='../../img/27.jpg'></image>
<image mode='widthFix' class="{{nums==28?'active':''}}" src='../../img/28.jpg'></image>
<image mode='widthFix' class="{{nums==29?'active':''}}" src='../../img/29.jpg'></image>
<image mode='widthFix' class="{{nums==30?'active':''}}" src='../../img/30.jpg'></image>
<image mode='widthFix' class="{{nums==31?'active':''}}" src='../../img/31.jpg'></image>
<image mode='widthFix' class="{{nums==32?'active':''}}" src='../../img/32.jpg'></image>
<image mode='widthFix' class="{{nums==33?'active':''}}" src='../../img/33.jpg'></image>
<image mode='widthFix' class="{{nums==34?'active':''}}" src='../../img/34.jpg'></image>
<image mode='widthFix' class="{{nums==35?'active':''}}" src='../../img/35.jpg'></image>
</view>
<view class='show' bindtouchstart="mytouchstart" bindtouchmove="mytouchmove" ></view>
</view>

微信小程序组件 360的更多相关文章

  1. 微信小程序组件设计规范

    微信小程序组件设计规范 组件化开发的思想贯穿着我开发设计过程的始终.在过去很长一段时间里,我都受益于这种思想. 组件可复用 - 减少了重复代码量 组件做为抽离的功能单元 - 方便维护 组件作为temp ...

  2. 微信小程序组件学习 -- 注册页面

    微信小程序组件使用手册地址: 1. 百度搜索"微信公众平台",扫码登录之后,点击帮助文档里面的普通小程序. 2. 接着选择"开发"-->"组件& ...

  3. 【腾讯Bugly干货分享】打造“微信小程序”组件化开发框架

    本文来自于腾讯Bugly公众号(weixinBugly),未经作者同意,请勿转载,原文地址:http://mp.weixin.qq.com/s/2nQzsuqq7Avgs8wsRizUhw 作者:Gc ...

  4. 微信小程序(组件demo)以及预览方法:(小程序交流群:604788754)

    1. 获取微信小程序的 AppID 登录 https://mp.weixin.qq.com ,就可以在网站的"设置"-"开发者设置"中,查看到微信小程序的 Ap ...

  5. 详解封装微信小程序组件及小程序坑(附带解决方案)

    一.序 上一篇介绍了如何从零开发微信小程序,博客园审核变智障了,每次代码都不算篇幅,好好滴一篇原创,不到3分钟从首页移出来了.这篇介绍一下组件封装和我的踩坑历程. 二.封装微信小程序可复用组件 首先模 ...

  6. 微信小程序组件通信

    父子通信 在子组件的对应js中 properties:{ prop名字:数据类型, prop名字:{ type:数据类型, value:默认值 } } 在父组件的wxml模板中找到子组件标签 < ...

  7. 微信小程序组件化实践

    Do Not Repeat Yourself 如何提高代码质量,方法有许多:抽象.模块.组件化,我认为它们的中心点都是--Do Not Repeat Yourself. 小程序组件化 我们先看看小程序 ...

  8. 微信小程序——组件(二)

    在上篇文章组件(一)里已经讲解了如何创建一个项目,现在继续...讲解一个页面布局以及各个组件的使用.在学习过程中,发现小程序支持flex布局,这对于学习过react native的人来说太好了,布局方 ...

  9. 微信小程序组件解读和分析:六、progress进度条

    progress进度条组件说明: 进度条,就是表示事情当前完成到什么地步了,可以让用户视觉上感知事情的执行.progress进度条是微信小程序的组件,和HTML5的进度条progress类似. pro ...

随机推荐

  1. 理解 ajax、fetch和axios

    背景 ajax fetch.axios 优缺点 ajax基于jquery,引入时需要引入庞大的jquery库,不符合当下前端框架,于是fetch替代了ajax 由于fetch是比较底层,需要我们再次封 ...

  2. 20155339 2016-2017 2 《Java程序设计》第2周学习总结

    20155339 2016-2017-2 <Java程序设计>第2周学习总结 教材学习内容总结 这周学习了课本的第三章,主要内容是JAVA的基础语法,在这章的学习过程中我发现大部分与c语言 ...

  3. [并发并行]_[线程模型]_[Pthread线程使用模型之二 工作组work crew]

    Pthread线程使用模型之二工作组(Work crew) 场景 1.一些耗时的任务,比如分析多个类型的数据, 是独立的任务, 并不像 pipeline那样有序的依赖关系, 这时候pipeline就显 ...

  4. Nginx入门篇(七)之Nginx+keepalived高可用集群

    一.keepalived介绍 keepalived软件最开始是转为负载均衡软件LVS而设计,用来管理和监控LVS集群系统中各个服务节点的状态,后来又加入了可实现高可用的VRRP功能.所以Keepali ...

  5. 五、Django之路由系统

    1.普通路由匹配 URL配置(URLconf)就像Django 所支撑网站的目录.它的本质是URL模式以及要为该URL模式调用的视图函数之间的映射表:它就是以这种方式告诉Django,用哪个URL调用 ...

  6. 了解ASP.NET Core 依赖注入,看这篇就够了

    DI在.NET Core里面被提到了一个非常重要的位置, 这篇文章主要再给大家普及一下关于依赖注入的概念,身边有工作六七年的同事还个东西搞不清楚.另外再介绍一下.NET  Core的DI实现以及对实例 ...

  7. exe4j 使用记录(二):jar打包exe

    一.环境 exe4j: 6.0.2 jre(32位): 1.8 二.打包过程 1.新建一个文件夹testExe(我的目录位置:D:\testExe)用来存放所需要打成exe的jar包.jdk或者jre ...

  8. 05-Docker架构详解

    Docker 的核心组件包括: Docker 客户端 - Client Docker 服务器 - Docker daemon Docker 镜像 - Image Registry Docker 容器 ...

  9. OpenLDAP搭建部署

    安装环境: linu系统:      centos7.2版本 OenLDAP:/openldap-2.4.44 下载地址:ftp://ftp.openldap.org/pub/OpenLDAP/ope ...

  10. 爬虫2.4-scrapy框架-图片分类下载

    目录 scrapy框架-图片下载 1 传统下载方法: 2 scrapy框架的下载方法 3 分类下载完整代码 scrapy框架-图片下载 python小知识: map函数:将一个可迭代对象的每个值,依次 ...