微信小程序首字母排序怎么实现?
微信小程序首字母排序怎么实现?各位微信小程序开发者,你知道在开发微信小程序的时候,怎么去实现微信小程序首字母排序吗?今天小编我来为大家介绍微信小程序首字母排序怎么实现。
微信小程序首字母排序怎么实现?
wxSortPickerView
wxSortPickerView-微信小程序首字母排序选择表
wxSortPickerView信息
解决问题:wxSortPickerView-微信小程序首字母排序选择表
特*:
目前为版本0.1,功能单一,但可扩展场景比较多。相关场景会在0.2中加入.
微信字符串数组首字母排序
左侧点击abc跳转
点击item返回数据
扩展:
姓名排序选择
地址排序选择
功能预览
使用方式:
1.引入相关文件
2.初始化
其他插件
wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析
wxSearch-微信小程序优雅的搜索框
WxNotificationCenter - 微信小程序通知广播模式类,降低小程序之间的耦合度
微信小程序首字母排序实现需要的微信代码如下:
{{item.content}}
index.js
//index.js//获取应用实例var app = getApp();var x,y,x1,y1,x2,y2,index,currindex,n,yy;var arr1 = [{content:11,id:1},{content:22,id:2},{content:33,id:3},{content:44,id:4},{content:55,id:5}];Page({ data: { mainx:0, content:[{content:11,id:1},{content:22,id:2},{content:33,id:3},{content:44,id:4},{content:55,id:5}], start:{x:0,y:0} }, movestart:function(e){ currindex = e.target.dataset.index; x = e.touches[0].clientX; y = e.touches[0].clientY; x1 = e.currentTarget.offsetLeft; y1 = e.currentTarget.offsetTop; }, move:function(e){ yy = e.currentTarget.offsetTop; x2 = e.touches[0].clientX-x+x1; y2 = e.touches[0].clientY-y+y1; this.setData({ mainx:currindex, opacity:0.7, start:{x:x2,y:y2} }) }, moveend:function(){ if(y2 != 0){ var arr = []; for(var i=0; i(52*(k-1)+k*2-26)){ n=k; } } if(y2>(52*(nx-1)+nx*2-26)){ n = nx; } console.log(arr); console.log(arr1) arr.splice((currindex-1),1); arr.splice((n-1),0,arr1[currindex-1]); arr1 = []; for(var m=0; m
index.wxss
container { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 200rpx 0; box-sizing: border-box;} .box{width:300px; position: relative}.main{width: 90%; height:50px; background: #eee; border: 1px solid #ccc; margin:2px auto; text-align: center; line-height: 50px;}.mainmove{position: absolute; opacity: 0.7}.maind{background: #fff; border:1px dashed #efefef;}.mainend{position: static; opacity: 1;}
感谢各位亲们的观看,以上就是微信小程序首字母排序怎么实现的方法了哦,各位微信小程序开发者们,如果你要实现微信小程序首字母排序的话,参考以上的内容哦,大家请多多关注微微风哦。
推荐阅读:
单页类型小程序是什么样的?单页类型小程序怎么制作
微信小程序输入框样式怎么制作
微信小程序游戏开发可以吗?
上一篇:微信小程序流量数据入口有哪些?
下一篇:微信小程序列表排序怎么实现?