建议断点或者直接打印res就能知道问题所在了
wx.chooseMedia示例打印错误?wx.chooseMedia({ count: 9, mediaType: ['image','video'], sourceType: ['album', 'camera'], maxDuration: 30, camera: 'back', success(res) { console.log(res.tempFiles.tempFilePath) // 这个是错误,返回的数组 console.log(res.tempFiles.size) // 这个是错误,返回的数组 } })
2023-01-30床
有奖调研|小程序渲染很难很复杂?告诉我们来优化!听说用户都喜欢流畅的交互体验?但是开发实现很困难 听说产品都想要复杂的交互动画?但是实现效果很一般 听说小程序渲染框架更新新能力?但是不清楚怎么使用 …… 渲染流程是前端开发中的重要环节,如何实现复杂的交互效果、如何实现性能与交互的平衡、如何兼容新旧版本的特性往往困扰着不少前端开发者。 为了进一步优化小程序性能,提供更接近原生的用户体验,小程序团队一直致力于优化 小程序渲染框架,提升开发效率,优化小程序的用户体验。例如利用新版 scroll-view 组件实现 更丝滑的滚动方式、更多元的布局方式 等。 现邀请各位开发者参与「小程序渲染框架有奖调研」,畅所欲言,让我们更了解你的需求和建议。 [图片] 2023 年 2 月 8 日停止收集问卷后,微信团队将从有效问卷中随机抽取 5 位参与者,各送出微信官方周边礼物 1 份,快来分享你的开发体验吧! [图片] * 获奖名单将于「微信开发者」公众号以及本话题下方评论区进行公示
2023-01-30额...
近期准备做小程序,但是注册昵称的时候发现昵称重复这怎么搞?[图片] 第一个是公众号的昵称,跟小程序都是同一主体。 第二个不显示昵称只有id:gh_960a435b622a 有办法稀释掉吗?在公众号里面搜索也搜索不到。
2023-01-30不一定
wx.chooseLocation、wx.getLocation接口申请需要多长时间通过?之前小程序发布没问题,今天修改一个bug,然后上传就提示接口调用需要申请。已提交申请,请问wx.chooseLocation、wx.getLocation接口申请需要多长时间通过?
2023-01-30保存跟删除都改成同步接口呢 setStorageSyncgetStorageSync
removeStorage无法生效?api: removeStorage // 本地存储 save() { // wx.setStorageSync('pop', {id:1,name:'zzz'}) wx.setStorage({ key: 'pop', data: { id: 1, name: 'zzz' }, success(res) { console.log(res) } }) }, get() { // console.log(wx.getStorageSync('pop')); wx.getStorage({ key: 'pop', success(res) { console.log(res) } }) }, del() { // wx.removeStorageSync("pop"); wx.removeStorage({ key: 'pop', success(e) { console.log(e) } }) }, clear(){ wx.clearStorageSync() wx.clearStorage() } <!-- 本地存储 --> <button type="primary" size="mini" bindtap="save">本地存储==存</button> <button type="primary" size="mini" bindtap="get">本地存储==取</button> <button type="primary" size="mini" bindtap="del">本地存储==删</button> <button type="primary" size="mini" bindtap="clear">本地存储==清空</button> [图片] 存取删正常 存取立即删除再取 也会发现pop的值已经没了,不会输出取的值 但是 storage一直存在pop这个值 无论怎么删除 清空都会存在 基础库也换了好几个, 微信开发工具也换了几个 [图片]
2023-01-30看不到
公众号推文中插入小程序,可以看到从该篇文章给小程序带来的点击量吗?有没有办法了解到某篇文章里,通过该文章点击进入小程序的点击量。
2023-01-30wx:key是得item里面的某一个属性名字,不能是动态的, 比如遍历的数组是 list=[{id:"1",name:"小红"},{id:"2",name:"小明"}] 那么wx:key="id"或者wx:key="name"
利用模板来做小程序,我是小白,求大哥来解救下面出了什么问题?VM189:22 WXMLRT_$gwx:./common/template/list.wxml:view:2:4: wx:key="{{index}}" does not look like a valid key name (did you mean wx:key="index" ?) _wp @ VM189:22 d_.<computed>.list @ VM189:1280 m8 @ VM189:1396 (anonymous) @ VM189:1613 y @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 u.create @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 O.prepare @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 xt @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 It @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 u @ asdebug.js:10 (anonymous) @ asdebug.js:1 f @ asdebug.js:1 g @ asdebug.js:1 (anonymous) @ asdebug.js:1 _ws.onmessage @ asdebug.js:1 [WXML Runtime warning] ./pages/register/register.wxml wx:key="{{item.id}}" does not look like a valid key name (did you mean wx:key="id" ?) 42 | <view class="text"> 43 | <radio-group class="radio-group"> > 44 | <label wx:for="{{sex}}" wx:for-item="item" wx:key="{{item.id}}"> | ^ 45 | <radio value="{{item.value}}" checked="{{item.checked}}" /> {{item.name}} 46 | </label> 47 | </radio-group> [WXML Runtime warning] ./pages/register/register.wxml wx:key="{{index}}" does not look like a valid key name (did you mean wx:key="index" ?) 148 | </view> 149 | <view class="study-wrap"> > 150 | <view class="addstudy delestudy" bind:tap="goAdd" wx:for="{{studyInfo}}" wx:key="{{index}}"> | ^ 151 | <text class="add delete" catch:tap="deleAdd" data-index="{{index}}">x</text> 152 | <text class="school">{{item.school}}</text> 153 | <text class="zye">{{item.zye}}</text> [WXML Runtime warning] ./pages/register/register.wxml wx:key="{{index}}" does not look like a valid key name (did you mean wx:key="index" ?) 165 | </view> 166 | <view class="study-wrap"> > 167 | <view class="addstudy delestudy" bind:tap="goAddwork" wx:for="{{workInfo}}" wx:key="{{index}}"> | ^ 168 | <text class="add delete" catch:tap="deleAddwork" data-index="{{index}}">x</text> 169 | <text class="school">{{item.name}}</text> 170 | <text class="zye">{{item.zwei}}</text> register.js? [sm]:101 {type: "tap", timeStamp: 107257, target: {…}, currentTarget: {…}, detail: {…}, …} register.js? [sm]:101 {type: "tap", timeStamp: 108054, target: {…}, currentTarget: {…}, detail: {…}, …} register.js? [sm]:116 {type: "tap", timeStamp: 109601, target: {…}, currentTarget: {…}, detail: {…}, …} register.js? [sm]:116 {type: "tap", timeStamp: 110188, target: {…}, currentTarget: {…}, detail: {…}, …} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} DevTools: CPU profile parser is fixing 4 missing samples. register.js? [sm]:95 {type: "tap", timeStamp: 218265, target: {…}, currentTarget: {…}, detail: {…}, …} register.js? [sm]:88 picker发送选择改变,携带值为 1980-07-05 register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} register.js? [sm]:131 form发生了submit事件,携带数据为: {} [WXML Runtime warning] ./common/template/list.wxml wx:key="{{index}}" does not look like a valid key name (did you mean wx:key="index" ?) 1 | <template name="list"> > 2 | <view class="list" wx:for="{{list}}" wx:key="{{index}}" > | ^ 3 | <view class="check-box" wx:if="{{isDelete}}"> 4 | <checkbox-group bind:change="checkboxChange" data-id="{{item.ID}}"> 5 | <label class="checkbox"> asdebug.js:10 POST http://127.0.0.1wx/index/init net::ERR_NAME_NOT_RESOLVED(env: Windows,mp,1.06.2301040; lib: 2.6.0) v @ asdebug.js:10 createRequestTask @ asdebug.js:10 invoke @ asdebug.js:10 r @ asdebug.js:10 invoke @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 X @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 ji @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 i @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 t @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 value @ apihook.js?t=wechat&s=1675004718479&v=0cffbba9918afb1342c18e2fdfb25ef5:1 getAtrList @ index.js? [sm]:235 onLoad @ index.js? [sm]:65 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 p.__callPageLifeTime__ @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Ct @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 It @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 u @ asdebug.js:10 (anonymous) @ asdebug.js:1 f @ asdebug.js:1 g @ asdebug.js:1 (anonymous) @ asdebug.js:1 _ws.onmessage @ asdebug.js:1 Show 7 more frames asdebug.js:10 POST http://127.0.0.1wx/hits/add net::ERR_NAME_NOT_RESOLVED(env: Windows,mp,1.06.2301040; lib: 2.6.0) v @ asdebug.js:10 createRequestTask @ asdebug.js:10 invoke @ asdebug.js:10 r @ asdebug.js:10 invoke @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 X @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 ji @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 i @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 t @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 value @ apihook.js?t=wechat&s=1675004718479&v=0cffbba9918afb1342c18e2fdfb25ef5:1 addhits @ util.js? [sm]:101 onLoad @ index.js? [sm]:66 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 p.__callPageLifeTime__ @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Ct @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 It @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 u @ asdebug.js:10 (anonymous) @ asdebug.js:1 f @ asdebug.js:1 g @ asdebug.js:1 (anonymous) @ asdebug.js:1 _ws.onmessage @ asdebug.js:1 Show 7 more frames WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 request:fail (env: Windows,mp,1.06.2301040; lib: 2.6.0) Xe @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Wi @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 (anonymous) @ asdebug.js:10 a.emit @ asdebug.js:1 callback @ asdebug.js:10 (anonymous) @ asdebug.js:10 setTimeout (async) h @ asdebug.js:10 O.onerror @ asdebug.js:10 error (async) v @ asdebug.js:10 createRequestTask @ asdebug.js:10 invoke @ asdebug.js:10 r @ asdebug.js:10 invoke @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 X @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 ji @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 i @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 t @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 value @ apihook.js?t=wechat&s=1675004718479&v=0cffbba9918afb1342c18e2fdfb25ef5:1 getAtrList @ index.js? [sm]:235 onLoad @ index.js? [sm]:65 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 p.__callPageLifeTime__ @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Ct @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 It @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 u @ asdebug.js:10 (anonymous) @ asdebug.js:1 f @ asdebug.js:1 g @ asdebug.js:1 (anonymous) @ asdebug.js:1 _ws.onmessage @ asdebug.js:1 Show 20 more frames WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 request:fail (env: Windows,mp,1.06.2301040; lib: 2.6.0) Xe @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Wi @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 (anonymous) @ asdebug.js:10 a.emit @ asdebug.js:1 callback @ asdebug.js:10 (anonymous) @ asdebug.js:10 setTimeout (async) h @ asdebug.js:10 O.onerror @ asdebug.js:10 error (async) v @ asdebug.js:10 createRequestTask @ asdebug.js:10 invoke @ asdebug.js:10 r @ asdebug.js:10 invoke @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 X @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 ji @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 i @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 t @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 value @ apihook.js?t=wechat&s=1675004718479&v=0cffbba9918afb1342c18e2fdfb25ef5:1 addhits @ util.js? [sm]:101 onLoad @ index.js? [sm]:66 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 p.__callPageLifeTime__ @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Ct @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 It @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 Nt.emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 emit @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 (anonymous) @ WAService.js?t=wechat&s=1675004718479&v=2.6.0:1 c @ asdebug.js:10 u @ asdebug.js:10 (anonymous) @ asdebug.js:1 f @ asdebug.js:1 g @ asdebug.js:1 (anonymous) @ asdebug.js:1 _ws.onmessage @ asdebug.js:1 Show 20 more frames
2023-01-30理论上是可以写一个自动化脚本一直刷消耗云开发的调用次数,还有一个是云函数如果有对外暴露http访问的话也是有一定风险。其他的就比较难了吧
云开发存在被恶意刷调用的情况吗?不懂就问,云开发会存在恶意刷调用次数的情况发生吗?就是一直瞄着你的一个请求拿个脚本一直刷,然后调用次数咔咔涨这样?如果存在这种情况怎么避免呢?
2023-01-29结果集的格式是list [图片]
小程序联表查询 结果如何正确显示在屏幕上?我使用了联表查询,读取出了1个想要的数据,相关代码如代码1所示。然后我借用变量i想要让它显示在屏幕上,相关代码如代码2所示。 但是尽管我已经把读取的数据量降低到了1个,在屏幕上显示的还是i的位置显示的是[object Object],我想知道正确的显示方法是什么呢? 代码2: queryData:function(){ wx.cloud.callFunction({ name: "connect", }).then(res=>{ console.log(res) this.setData({ i: res }) }) 代码1: // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境 const db = cloud.database() const _ = db.command const $ = _.aggregate // 云函数入口函数 exports.main = async (event, context) => { return await db.collection('books').aggregate() .lookup({ from:"author", // localField: 'authorid', // foreignField: 'number', // as: 'newlist' }) .match({ name: "《小王子》" }) .replaceRoot({ newRoot: $.mergeObjects([$.arrayElemAt(['$newlist', 0]), '$$ROOT']) }) .project({ _id:0, authorname:1, }) .end() // return db.collection("books").aggregate() // // .lookup({ // from:"author", // // localField: 'author', // // foreignField: 'number', // // as: 'newlist' // // }).end({ // success:function(res){ // return res.data.name; // }, // fail(error) { // return error; // } // }) }
2023-01-29建议不要删,如果有用到NG,可以在NG配置文件里面配置一个location即可,类似这样,其实放那边也不碍事 location /MP_verify_bgzRx2MQxTNGCEVE { default_type text/html; return 200 'bgzRx2MQxTNGCEVE'; }
配置业务域名的校验文件,校验通过以后是否可以删除?配置业务域名的校验文件,校验通过以后是否可以删除?
2023-01-29