真机调试勾选不效验没有 [图片]
真机调试服务器部分功能无法实现?微信开发者工具模拟器可以正常运行(没有校验合法域名等),一到真机调试,服务器部分功能就无法实现。是不是一定要备案,合法域名才能真机调试成功?
04-18const query = wx.createSelectorQuery(); query.select('#myWebView').boundingClientRect(rect => { console.log(rect); }).exec(); wx.createSelectorQuery()这个也不行吗
this.selectComponent("#myWebView")为那么一直为null?#开发模式,已经选择不校验合法域名.调试基础库3.7.12 #wxml就这一句话,小程序中能正常打开页面浏览。 <web-view id="myWebView" src="http://192.168.1.6/pages/addPoint.html" bindload="onWebViewLoad"></web-view> #但在.js文件中 Page({ onReady(){ setTimeout(() => { const webViewComponent = this.selectComponent("#myWebView"); if (!webViewComponent) { console.error("延迟获取仍失败,检查是否有多个同名 id 或标签错误"); } }, 1000); } }) #webViewComponent始终是null
04-18这是哪里的导入
内容插入失败,图片导入失败是什么原因[图片]
04-18不支持呢
小程序分享后的,介绍的子的字体大小能否修改的?[图片]这里的字体大小,能修改吗?
04-18downloadFile要加filePath(指定文件下载后存储的路径),你再试试 const fileName = fileUrl.split('/').pop();//截取文件名+后缀 wx.downloadFile({ url: fileUrl, filePath: wx.env.USER_DATA_PATH + '/' + fileName,//指定文件下载后存储的路径 (本地路径) success(res) { console.log(res, '下载成功'); const filePath = res.filePath; wx.openDocument({ filePath: filePath, fileType: 'pdf', showMenu: true, success: function (res) { wx.showToast({ title: '打开文档成功', icon: 'none' }); }, fail: function (res) { wx.showToast({ title: '打开文档失败', icon: 'none' }); console.error('打开文档失败', res); } }); }, fail(res) { wx.showToast({ title: '下载文件失败', icon: 'none' }); console.error('下载文件失败', res); } });
原生微信小程序,安卓机型打开pdf失败,ios可以正常打开?wx.downloadFile({ url: fileUrl, success(res) { console.log(res, '下载成功'); const filePath = res.tempFilePath; wx.openDocument({ filePath: filePath, fileType: 'pdf', showMenu: true, success: function (res) { wx.showToast({ title: '打开文档成功', icon: 'none' }); }, fail: function (res) { wx.showToast({ title: '打开文档失败', icon: 'none' }); console.error('打开文档失败', res); } }); }, fail(res) { wx.showToast({ title: '下载文件失败', icon: 'none' }); console.error('下载文件失败', res); } });
04-17要在隐私协议里面添加下面这个,添加之后会审核中,审核通过就可以用了 [图片] [图片]
第三方小程序使用wx.chooseAddress在发行版本报错 112 ,如何处理?[图片] [图片] 代码和报错如图, 我们是第三方小程序,根据官方文档做了以下处理: 1:因为我们是uniapp开发的,所以在 manifest.json 中添加了 requiredPrivateInfos 声明了 chooseAddress [图片] 2:在 ext.json 中也声明了 requiredPrivateInfos [图片] 3:也通过了接口权限的接通,下面的是官方文档描述 [图片] 但是还是报错 112 ,英文翻译过来说是需要隐私权限,但是看官方文档没有提到过隐私权限,所以这个隐私权限要怎么设置呢? 以下是官方地理位置接口新增与相关流程调整截图: [图片] [图片]
04-17https://developers.weixin.qq.com/s/tOsxXqm57PZI 已解决
双角色tabbar底部导航栏,切换和真机不一样,什么问题?模拟器上显示正常,真机上的问题是,在首页进入论坛角色,点击我的页面中去社区按钮,页面跳转了,tabbar没有切换,当在首页进入社区角色,点击我的页面中去论坛的按钮,页面跳转了,tabbar没有切换,试了无数次,都是这样的问题。这是什么问题,开发工具。1.05版本的
04-15找一个 我这样的背景[图片] [图片]
自定义tabbar中间凸起部分的圆弧怎么做出来?[图片][图片] 自定义的tabbar,中间凸起部分的圆弧怎么做出来?如图二是想要实现的效果,图一中红色框的圆弧要怎么实现? wxml代码 <view class="tab-bar"> <view class="tab-bar-border"></view> <view class="tab-bar-item" wx:for="{{selectList}}" wx:key="index" data-index="{{index}}" data-path="{{item.pagePath}}" data-selected="{{item.selected}}" bindtap="onwidthTap"> <image class="cover-image" src="{{selected === item.selected ? item.selectedIconPath : item.iconPath}}"></image> <view class="cover-view" style="color:{{selected === item.selected ? selectedColor : color}}">{{item.text}}</view> </view> </view> <view class="indicator"> <view class="indicator-border"></view> <view class="indicator-item"> <image class="indicator-image" src="/images/jia.png"></image> </view> <view class="indicator-item-text">发布</view> </view> wxss代码 .tab-bar { position: fixed; bottom: 0; left: 0; right: 0; height: 120rpx; background-color: white; display: flex; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 0 5rpx 0 rgba(0, 0, 0, 0.33); } .tab-bar-item { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; } .cover-image { margin-bottom: 40rpx; width: 44rpx; height: 44rpx; } .tab-bar-item .cover-view { font-size: 34rpx; position: absolute; bottom: 10rpx; color: #7A7E83; } .indicator { height: 70rpx; display: flex; flex-direction: column; align-items: center; } .indicator-border { position: absolute; left: 50%; top: -50rpx; transform: translate(-50%, -50%); border-radius: 50%; width: 80rpx; height: 80rpx; border: 7px solid #fff; box-shadow: 0 0 5rpx 0 rgba(0, 0, 0, 0.33); z-index: -1; } .indicator-item { position: absolute; left: 50%; top: -50rpx; transform: translate(-50%, -50%); background: #ff9f7f; border-radius: 50%; width: 80rpx; height: 80rpx; display: flex; flex-direction: column; justify-content: space-between; align-items: center; border: 7px solid #fff; z-index: 1; } .indicator-image { width: 80rpx; height: 80rpx; border-radius: 50%; } .indicator-item-text { font-size: 34rpx; z-index: 1; color: #7A7E83; position: absolute; bottom: 10rpx; }
04-09用自定义顶部导航栏,可以全局配置或单独需要的页面配置 全局"navigationStyle": "custom" [图片] 按需"navigationStyle": "custom" [图片] [图片]
顶部导航栏增加一个背景图片设置?现在小程序只有设置顶部导航栏的颜色,什么时候能增加一个设置顶部导航栏背景图片就好了,现在通过自定义顶部导航栏来实现,太麻烦
04-03<web-view> 的 ref 无法直接获取
给web-view设置了ref,但是无法获取到ref里面的值?<template> <view> <web-view ref="webDiv" src="https://www.baidu.com"></web-view> <audio ref="audiod" style="text-align: left" src="https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3" controls></audio> <image ref="asda3434333" style="width: 200px; height: 200px; background-color: #eeeeee;" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg"></image> </view> </template> <script> export default { data() { return { title: 'Hello' } }, onLoad() { console.log(this.$refs.audiod) console.log(this) }, mounted() { // 也可以在 mounted 生命周期里获取引用 console.log(this.$refs.audiod) console.log(this) }, methods: { // webview向外部发送消息 handlePostMessage: function(data) { console.log("接收到消息:" + JSON.stringify(data.detail)); }, // 调用 webview 内部逻辑 evalJs: function() { this.$refs.webview.evalJs("document.body.style.background ='#00FF00'"); } } } </script> <style> </style>
03-28