摘要: 正常下载的时候,出现下载的时候空白,基本是格式出现问题,或者是文件名出现问题。文件不能是中文 写法 const downloadFile = (interfaceName, fileName, success, params) => { wx.showLoading({ title: '下载中' } 阅读全文
posted @ 2025-10-27 14:41 微宇宙 阅读(40) 评论(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 微宇宙 阅读(5) 评论(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 微宇宙 阅读(15) 评论(0) 推荐(0)
摘要: 默认定义头部导航,打开小程序自适应移动设备。 <page-meta page-style="height:100%"> <navigation-bar title="主页" /> <view>123</view> </page-meta> 阅读全文
posted @ 2025-10-22 11:33 微宇宙 阅读(8) 评论(0) 推荐(0)
摘要: 在小程序展示视频号的卡片,点击查看就会跳转到视频号: <view bindtap="bindtapShipin">查看 </view> bindtapShipin: function (e) { wx.openChannelsUserProfile({ finderUserName: 'sphMv2 阅读全文
posted @ 2025-10-20 17:39 微宇宙 阅读(17) 评论(0) 推荐(0)
摘要: 设置浮动元素事件,并且可拖动的功能。 data:{ translateX: 0, // 位移x坐标 单位px translateY: 0, // 位移y坐标 单位px distance: 0, // 双指接触点距离 startMove: { // 起始位移距离 x: 0, y: 0, }, star 阅读全文
posted @ 2025-10-13 17:48 微宇宙 阅读(6) 评论(0) 推荐(0)
摘要: 如果使用拷贝和复制粘贴功能,以及使用从微信上传文件的功能,需要在weixin后台完善隐私协议。 wx.setClipboardData({ duration: 2000, title: '成功', data: 'name', icon: 'success', }); 拷贝 错误提示: setClip 阅读全文
posted @ 2025-10-11 14:23 微宇宙 阅读(18) 评论(0) 推荐(0)
摘要: 只能从微信聊天记录里面选择文件如下: wx.chooseMessageFile({ count: 1, // 最多可以选择的文件个数 type: 'file', // file extension: ['pdf'], // 过滤文件类型 success(res) { const filePath = 阅读全文
posted @ 2025-10-09 10:15 微宇宙 阅读(20) 评论(0) 推荐(0)
摘要: 设置多个legend触发隐藏,图型上tooltip不展示的优化。 tooltip: { show: true, trigger: "axis", formatter: function (params) { var str = ''; params.forEach(function (item) { 阅读全文
posted @ 2025-09-05 14:45 微宇宙 阅读(16) 评论(0) 推荐(0)
摘要: 多个内容自动显示排列方式,如果第一列显示不换行,第二列内容换行显示。 .first{ white-space: nowrap; } .second { word-break: break-word } 切换内容围绕边框显示的写法。 justify-content: space-around; fle 阅读全文
posted @ 2025-09-03 14:52 微宇宙 阅读(28) 评论(0) 推荐(0)