微信小程序
shua_1990
一个菜鸟前端
展开
-
小程序手机号码中间四位隐藏
var phone=13900005566; //如果是后台返回的数据 写个判断手机号码是否存在 if (phone) { //js var hidePhone = phone.substring(0, 3) + '****' + phone.substring(7); } if (phone) { //使用正则 var hidePhone=phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); } ...原创 2020-07-02 10:48:44 · 2187 阅读 · 0 评论 -
小程序触底加载数据
Page({ data: { page: 0, //当前y页数 默认是0 evaluation: [],//对应数据 }, onLoad: function(e) { this.getStaffComment(this.data.page); }, //获取列表 getStaffComment: function(page) { wx.showLoading({ tit.原创 2020-06-23 16:15:47 · 1298 阅读 · 0 评论 -
列表点赞功能
/**wxml*/ <view class="heart" bindtap="favorclick" data-id="{{item.id}}"> <text class="icon-heart" style="{{item.redHeart?'color:'+skincolor+'!important;':''}}"> </text> <text>{{item.likecount}}</text> <.原创 2020-06-16 20:11:52 · 695 阅读 · 0 评论