上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 设置金额带有浮点数的设置。oninput(4.223) oninput(val,limit = 2) { if(val.indexOf(".") == -1){ if(val.length > 17){ val = val.substr(0,17) } } val = val.replace(/[^ 阅读全文
posted @ 2025-07-14 15:35 微宇宙 阅读(39) 评论(0) 推荐(0)
摘要: 默认在wxml上面tap绑定事件,点击打开地理位置。 validationPosition() { wx.getSetting({ success: (res) => { if (res.authSetting['scope.userLocation']) { // 定位权限已开启 wx.getLo 阅读全文
posted @ 2025-07-14 15:33 微宇宙 阅读(97) 评论(0) 推荐(0)
摘要: <scroll-view class='scroll' scroll-y="true" bindscrolltolower="bindscrolltolower"> 垂直滚动写入js // 滚动事件bindscrolltolower() { if (this.moreData) { this.pag 阅读全文
posted @ 2025-05-09 14:22 微宇宙 阅读(16) 评论(0) 推荐(0)
摘要: 在小程序设置布局样式的代码如下: /*checkbox 选项框大小 */ checkbox .wx-checkbox-input { width: 36rpx; height: 36rpx; /* border-radius: 50%; */ /* border-color: #2ea7e0; */ 阅读全文
posted @ 2025-04-21 16:17 微宇宙 阅读(132) 评论(0) 推荐(0)
摘要: 小程序用第三方组件 wechat-miniprogram / weui,需要注意引入 <mp-searchbar ext-class="inputlable" class="search-content" />组件之后,不能在组件的引用类上设置高度,比如给.inputlable 类行高可以设置36p 阅读全文
posted @ 2025-04-17 14:18 微宇宙 阅读(59) 评论(0) 推荐(0)
摘要: 在使用小程序内置的picker组件,设置了bindchange事件,第一次接口通过setdata存数据arr,但是下次切换bindchange事件的时候,中途数据没有改变。 阅读全文
posted @ 2025-04-02 11:16 微宇宙 阅读(35) 评论(0) 推荐(0)
摘要: 在wxml引入过滤方法,创建一个.wxs文件filters.wxs,然后在文件导出方法 var filters = { obj: function (value) { var arr = [1,2,4] return arr.findIndex(value) } }; module.exports 阅读全文
posted @ 2025-03-28 11:18 微宇宙 阅读(47) 评论(0) 推荐(0)
摘要: 小程序登录的操作,先通过 wx.login回调方法,然后通过code在自己的服务器调openId接口获取用户信息和设备信息,然后在自己的服务器调用login登录接口获取sessionId和token。 另一种情况是,先通过 wx.login 获取code,然后调后端接口获取手机号 phone。然后再 阅读全文
posted @ 2025-03-27 10:13 微宇宙 阅读(45) 评论(0) 推荐(0)
摘要: 辅助功能,就是平时需要用到的小功能。icon图标功能,可以调用小程序内置的<icon type="warn">警告</icon> 阅读全文
posted @ 2025-03-26 15:48 微宇宙 阅读(47) 评论(0) 推荐(0)
摘要: 小程序页面返回传参,返回上一页之前先调用上一页的trigPageBack函数方法,通过回调的方式把参数传入。 const options = {}; const index = 2; const pages = getCurrentPages(); const indexTP = pages.len 阅读全文
posted @ 2025-03-26 15:40 微宇宙 阅读(73) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页