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. 在linux环境下安装redis并且搭建自己的redis集群

    此文档主要介绍在linux环境下安装redis并且搭建自己的redis集群 搭建环境: ubuntun 16.04 + redis-3.0.6 本文章分为三个部分:redis安装.搭建redis集群 ...

  2. 20145207 java第二周学习总结

    教材学习内容总结 这部分可能要扒一些课本而上的东西了.在第三章中,知道了Java可区分为基本类型和类类型两大类型系统,其中类类型也称为参考类型.在这一周主要学习了类类型. 对象(Object):存在的 ...

  3. Ruby 配置vimrc

    https://ruby-china.org/topics/19315 mv ~/Downloads/vim-distinguished-develop/colors/*.vim ~/.vim/col ...

  4. [agc004D]Teleporter

    Description 传送门 Solution 依题意我们可以知道,以2-n为出发点的边和1号节点会构成一课树(不然2-n号节点无法都达到首都). 为了让2-n号节点中,离1号节点的距离<k的 ...

  5. QT-2D编程

    QT-[转]2D编程 Qt中提供了强大的2D绘图系统,可以使用相同的API在屏幕上和绘图·设备上进行绘制,主要基于QPainter.QPainterDevice和QPainterEngine这3个类. ...

  6. 【BZOJ3197】[SDOI2013]刺客信条

    [BZOJ3197][SDOI2013]刺客信条 题面 bzoj 洛谷 题解 关于树的同构,有一个非常好的性质: 把树的重心抠出来,那么会出现两种情况: 1.有一个重心,那么我们直接把这个重心作为树的 ...

  7. C#:在AnyCPU模式下使用CefSharp

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 本篇博客讲述如何在AnyCPU模式下使用CefSharp 因为在某些情况下,不得不用AnyCPU,但是CefS ...

  8. MySQL双主复制

    原文发表于cu:2017-06-12 本文简单介绍MySQL双主复制原理及1个简单是双主复制验证. 一.MySQL双主复制原理 1. 双主复制原理 master-master复制的两台服务器,既是ma ...

  9. 152.[LeetCode] Maximum Product Subarray

    Given an integer array nums, find the contiguous subarray within an array (containing at least one n ...

  10. NO.1:自学tensorflow之路------神经网络背景知识

    引言 从本周,我将开始tensorflow的学习.手头只有一本<tensorflow:实战Google深度学习框架>,这本书对于tensorflow的入门有一定帮助.tensorflow中 ...