摘要: 如何调用微信 小程序 自动拨打电话功能 bindtapCall: function (e) { let phoneNumber = this.data.telephone; if (phoneNumber) { wx.makePhoneCall({ phoneNumber, }); } }, 阅读全文
posted @ 2025-11-24 11:28 微宇宙 阅读(10) 评论(0) 推荐(0)
摘要: 页面代码: <picker mode="date" fields="month" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange"> <view class="picker"> 当前选择: 阅读全文
posted @ 2025-11-20 16:58 微宇宙 阅读(35) 评论(0) 推荐(0)
摘要: 设置输入框不支持表情的输入,防止用户输入表情,后端报错提示。 let reg = /[\uD83C[\uDF88-\uDFFF]|\uD83D[\uDC00-\uDE4F]/gi; if (reg.test('str')) { title = '事由不能包含特殊符号'; } 阅读全文
posted @ 2025-11-17 14:57 微宇宙 阅读(14) 评论(0) 推荐(0)
摘要: 默认触发绑定事件 bind:tap 方法处理dom事件。 bindtap="bindEvent" 如果是组件之间触发事件 triggerEvent 触发响应事件。 this.triggerEvent('triggerList', 999) 父组件监听子组件的事件 bind:triggerList 捕 阅读全文
posted @ 2025-11-07 10:11 微宇宙 阅读(10) 评论(0) 推荐(0)
摘要: 从小程序跳转到公众号的方法 最简单的方式,可能会出现偶现的情况 <official-account></official-account> 建议用下面 wx.openOfficialAccountProfile({ username: 'gh_123123', // 此处填写公众号的原始 ID su 阅读全文
posted @ 2025-10-27 15:40 微宇宙 阅读(87) 评论(0) 推荐(0)
摘要: 正常下载的时候,出现下载的时候空白,基本是格式出现问题,或者是文件名出现问题。文件不能是中文 写法 const downloadFile = (interfaceName, fileName, success, params) => { wx.showLoading({ title: '下载中' } 阅读全文
posted @ 2025-10-27 14:41 微宇宙 阅读(49) 评论(0) 推荐(0)
摘要: // wxml文件 <web-view src="https://www.baidu.com" bindload="bindload" binderror="binderror"></web-view> // js文件 // 网页加载成功时触发此事件 bindload(res) { console. 阅读全文
posted @ 2025-10-24 18:26 微宇宙 阅读(9) 评论(0) 推荐(0)
摘要: 基于image图片的放大缩小 <image src="{{imgList[0]}}" bindtap="preview" data-src="{{imgList[0]}}"></image> 对于的方法设置 Page({ data: { imgList: [ "https://example.com 阅读全文
posted @ 2025-10-24 11:21 微宇宙 阅读(18) 评论(0) 推荐(0)
摘要: 默认定义头部导航,打开小程序自适应移动设备。 <page-meta page-style="height:100%"> <navigation-bar title="主页" /> <view>123</view> </page-meta> 阅读全文
posted @ 2025-10-22 11:33 微宇宙 阅读(11) 评论(0) 推荐(0)
摘要: 在小程序展示视频号的卡片,点击查看就会跳转到视频号: <view bindtap="bindtapShipin">查看 </view> bindtapShipin: function (e) { wx.openChannelsUserProfile({ finderUserName: 'sphMv2 阅读全文
posted @ 2025-10-20 17:39 微宇宙 阅读(30) 评论(0) 推荐(0)