- 小程序 input 组件在 ios 下切换问题
inout 组件在存在两个甚至多个的情况下,在IOS系统下 切换 input聚焦 的时候,键盘会先收起来,然后再弹出来,非常不友好。 类似的问题在这里 https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=d83cc380bcb9791bfecc077c31b76a8a&highline=confirm-hold&token=1779587776
2018-08-01 - 部分朋友想要的飞入购物车效果
//index.js Page({ data: { animationData: {}, animating: '', }, onLoad: function () { }, /* * t: current time(当前时间); * b: beginning value(初始值); * c: change in value(变化量); * d: duration(持续时间)。 */ bounceEaseOut: function (t, b, c, d) {//弹性线 if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; } }, easeOutBack: function (t, b, c, d, s) {//抛物线 if (s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, startAm: function (that, e) { var atime = 0.6//动画持续时间 var etime = 100//动画结束时间 that.setData({ animating: e.target.dataset.goodsid }) setTimeout(() => { that.setData({ animating: '' }) }, etime) var animation = wx.createAnimation({ duration: 100, timingFunction: 'ease', }) that.animation = animation //变化量坐标 var offx = 320 / 2 - e.touches[0].clientX//购物车所在位置x - 加入购物车按钮的位置x var offy = 405- 50 - e.touches[0].clientY//购物车所在位置Y - 加入购物车按钮的位置Y //console.log("变化量坐标", offx, offy, that.bounceEaseOut(1 / 10, 0, offy, 1)) //每1/10秒变化量坐标: //console.log("每1/10秒变化量坐标", offx / 10, that.bounceEaseOut(1 / 10, 0, offy, 1)) animation .translate(1 * offx / 20, that.bounceEaseOut(1 / 20, 0, offy, atime)).step() .translate(2 * offx / 20, that.bounceEaseOut(2 / 20, 0, offy, atime)).step() .translate(3 * offx / 20, that.bounceEaseOut(3 / 20, 0, offy, atime)).step() .translate(4 * offx / 20, that.bounceEaseOut(4 / 20, 0, offy, atime)).step() .translate(5 * offx / 20, that.bounceEaseOut(5 / 20, 0, offy, atime)).step() .translate(6 * offx / 20, that.bounceEaseOut(6 / 20, 0, offy, atime)).step() .translate(7 * offx / 20, that.bounceEaseOut(7 / 20, 0, offy, atime)).step() .translate(8 * offx / 20, that.bounceEaseOut(8 / 20, 0, offy, atime)).step() .translate(9 * offx / 20, that.bounceEaseOut(9 / 20, 0, offy, atime)).step() .translate(10 * offx / 20, that.bounceEaseOut(10 / 20, 0, offy, atime)).step() .translate(11 * offx / 20, that.bounceEaseOut(11 / 20, 0, offy, atime)).step() .translate(12 * offx / 20, that.bounceEaseOut(12 / 20, 0, offy, atime)).step() .translate(13 * offx / 20, that.bounceEaseOut(13 / 20, 0, offy, atime)).step() .translate(14 * offx / 20, that.bounceEaseOut(14 / 20, 0, offy, atime)).step() .translate(15 * offx / 20, that.bounceEaseOut(15 / 20, 0, offy, atime)).step() .translate(16 * offx / 20, that.bounceEaseOut(16 / 20, 0, offy, atime)).step() .translate(17 * offx / 20, that.bounceEaseOut(17 / 20, 0, offy, atime)).step() .translate(18 * offx / 20, that.bounceEaseOut(18 / 20, 0, offy, atime)).step() .translate(19 * offx / 20, that.bounceEaseOut(19 / 20, 0, offy, atime)).step() .translate(20 * offx / 20, that.bounceEaseOut(20 / 20, 0, offy, atime)).step() .opacity(0).step().translate(0, 0).step().opacity(1).step() that.setData({ animationData: animation.export() }) setTimeout(function () { animation.translate(0, 0).step() that.setData({ animationData: animation.export() }) }.bind(this), etime) }, cartPlus: function (e) { var that = this //加入购物车动画 that.startAm(that,e) }, }) <view data-goodsId='' bindtap="cartPlus" animation='{{animating==im.goodsIdStr?animationData:""}}'>加入购物车</view >
2017-11-01 - 安卓手机中input
Android手机中input的placeholder获取焦点后字体样式改变
2018-06-20 - 真机上面input的password改变,内容不能刷新的问题
做了一个登陆界面,密码能显示和隐藏, <input password="{{login_password}}" 点击后面的眼睛按钮,改变这个login_password的值,在工具上面是行的,点击能实现显示和隐藏, 但是在真机上面,点击后输入框内容不能改变状态,需要点一下输入框(输入框获得焦点)才会改变状态 请问一下这个问题怎么解决啊。 [图片] [图片]
2018-06-22 - iOS 上 input 英文输入法下 首字母自动大写
这个问题在 web 上的解决方法一般有两种: 1. 如果是输入的邮箱类型: [代码]<input type="email">[代码] 2. 如果输入普通字段: [代码]<input type="text" autocapitalize="none">[代码] 但是小程序的 input 既不支持 email 类型,又不支持 autocapitalize。 如果强行用 js 转换成小写,又会与有的用户是有意输入大写的情况冲突。 不知道有什么好的解决方式,或者官方有没有计划考虑支持这两种使用方式。 谢谢。
2018-07-16