摘要: 设置浮动元素事件,并且可拖动的功能。 data:{ translateX: 0, // 位移x坐标 单位px translateY: 0, // 位移y坐标 单位px distance: 0, // 双指接触点距离 startMove: { // 起始位移距离 x: 0, y: 0, }, star 阅读全文
posted @ 2025-10-13 17:48 微宇宙 阅读(11) 评论(0) 推荐(0)
摘要: 如果使用拷贝和复制粘贴功能,以及使用从微信上传文件的功能,需要在weixin后台完善隐私协议。 wx.setClipboardData({ duration: 2000, title: '成功', data: 'name', icon: 'success', }); 拷贝 错误提示: setClip 阅读全文
posted @ 2025-10-11 14:23 微宇宙 阅读(64) 评论(0) 推荐(0)
摘要: 只能从微信聊天记录里面选择文件如下: wx.chooseMessageFile({ count: 1, // 最多可以选择的文件个数 type: 'file', // file extension: ['pdf'], // 过滤文件类型 success(res) { const filePath = 阅读全文
posted @ 2025-10-09 10:15 微宇宙 阅读(33) 评论(0) 推荐(0)
摘要: 设置多个legend触发隐藏,图型上tooltip不展示的优化。 tooltip: { show: true, trigger: "axis", formatter: function (params) { var str = ''; params.forEach(function (item) { 阅读全文
posted @ 2025-09-05 14:45 微宇宙 阅读(19) 评论(0) 推荐(0)
摘要: 多个内容自动显示排列方式,如果第一列显示不换行,第二列内容换行显示。 .first{ white-space: nowrap; } .second { word-break: break-word } 切换内容围绕边框显示的写法。 justify-content: space-around; fle 阅读全文
posted @ 2025-09-03 14:52 微宇宙 阅读(36) 评论(0) 推荐(0)
摘要: 如果是下拉加载数据的写法。 onPullDownRefresh() { wx.showNavigationBarLoading() //在标题栏中显示加载 this.getDatas(); setTimeout(function () { wx.hideNavigationBarLoading() 阅读全文
posted @ 2025-08-22 10:12 微宇宙 阅读(9) 评论(0) 推荐(0)
摘要: 当表单的 输入框在底部时,手机上要弹出键盘,必须把输入框往上弹,需要设置输入框height高度在键盘的位置。 将inputBoxBottom变量设置给底部输入框外层的view标签: <view class="input-box" style="bottom:{{inputBoxBottom}}px" 阅读全文
posted @ 2025-07-14 16:37 微宇宙 阅读(137) 评论(0) 推荐(0)
摘要: 设置金额带有浮点数的设置。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 微宇宙 阅读(24) 评论(0) 推荐(0)
摘要: 默认在wxml上面tap绑定事件,点击打开地理位置。 validationPosition() { wx.getSetting({ success: (res) => { if (res.authSetting['scope.userLocation']) { // 定位权限已开启 wx.getLo 阅读全文
posted @ 2025-07-14 15:33 微宇宙 阅读(46) 评论(0) 推荐(0)
摘要: <scroll-view class='scroll' scroll-y="true" bindscrolltolower="bindscrolltolower"> 垂直滚动写入js // 滚动事件bindscrolltolower() { if (this.moreData) { this.pag 阅读全文
posted @ 2025-05-09 14:22 微宇宙 阅读(11) 评论(0) 推荐(0)