组件需要 template 属性啊 你都注释了就报错了
wx-open-subscribe组件一直报的template can't be empty的问题?基于vue2开发,一直报:VM1023:4 [WXTAG] [JSCORE] template can't be empty <template> <div class="app-container"> <wx-open-subscribe v-if="isWechatReady" id="wx-open-subscribe" template-id="Q_J-LrD3F4qW6fFmbNg3GMEnoWXdtCvzUsW6fnFdqYQ"> <script type="text/wxtag-template"> <div style="background: #287AED;width: 325px;height: 40px;border-radius: 20px;font-size: 16px;color: #FFFFFF;display:flex;align-items:center;justify-content:center;"> 订阅 </div> </script> <!-- <template v-slot:default> <button class="subscribe-btn">订阅消息</button> </template> --> </wx-open-subscribe> </div> </template> <script> import { jsapi } from "@/api/test/send"; export default { name: "test", data() { return { appId: 'wx470fbb322efc3e8a', timestamp: '', nonceStr: '', signature: '', isWechatReady: false, }; }, mounted() { let that = this; this.$nextTick(() => { that.getWxConfig(); }); }, methods: { getWxConfig() { let url = window.location.href.split('#')[0]; jsapi({url:url}).then(res=>{ console.log(JSON.stringify(res)) this.timestamp = res.data.timestamp; this.nonceStr = res.data.nonceStr; this.signature = res.data.signature; this.initWxConfig(); }); }, initWxConfig() { wx.config({ debug: false, appId: this.appId, timestamp: this.timestamp, nonceStr: this.nonceStr, signature: this.signature, jsApiList: ['checkJsApi'], openTagList: ['wx-open-subscribe','wx-open-subscribe-dialog'] }); wx.ready(() => { console.log('微信 JS - SDK 初始化成功'); this.isWechatReady = true; //this.bindSubscribeEvent(); }); wx.error((res) => { console.error('微信 JS - SDK 初始化失败', res); }); }, bindSubscribeEvent() { const subscribeBtn = document.getElementById('wx-open-subscribe'); if (subscribeBtn) { subscribeBtn.addEventListener('change', (event) => { const { detail } = event; if (detail.errMsg ==='subscribe:ok') { console.log('订阅成功'); } else { console.log('订阅失败', detail.errMsg); } }); } }, subscribeSuccess(res) { console.log('订阅成功', res); // 可以在这里添加订阅成功后的逻辑,比如提示用户等 }, subscribeError(err) { console.error('订阅失败', err); // 可以在这里添加订阅失败后的逻辑,比如提示用户重试等 } } }; </script> <style scoped> .subscribe-btn { padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; } .subscribe-btn:hover { background-color: #0056b3; } </style>
04-25看看APP是不是自动加了底部安全距离
自定义tabbar,打包到app底部有层高度,h5和小程序打包都是正常的,怎么解决?h5和小程序打包都是正常的,只有app打包出来有问题[图片] [图片]
04-24pdf要看浏览器有没有内置解析器,有些浏览器没就会加载不出来,安全起见自己用插件
使用webview组件,业务域名已配置,ios可以访问,安卓不行,这是为什么?如题,求大佬解决
04-24要有主体才能有unionId啊
个人开发者开发测试关于unionId和授权手机号权限真的是无解之局?测试号获取不到unionId,改用通过资质审核的个人小程序又无法授权获取手机号的权限,当即需要unionId又需要获取手机号权限时,个人开发者真的是无解之局吗?有没有其他的什么办法呢?
04-24建议swiper只存在一个video,非当前current用封面替代,小程序多个video会有很多bug
使用swiper嵌套video组件,打开全屏能正常显示,退出全屏导致下一个swiper的vide错位swiper组件嵌套video组件滑动展示,页面开启了"pageOrientation": "auto"允许屏幕旋转; 正常旋转没问题,旋转了之后切换swpier也没问题; 但是在竖屏状态点击某一个video全屏横屏展示之后,再保持横屏状态切换swpier组件,下一个video会错位; 没有响应"pageOrientation": "auto"屏幕旋转,或者响应异常? 最小复现demo index.wxml <view class="page-body"> <view class="page-section tc"> <swiper class="swiper-container"> <swiper-item wx:key="1" class="swiper-item"> <video id="myVideo" src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" binderror="videoErrorCallback" danmu-list="{{danmuList}}" enable-danmu danmu-btn controls></video> </swiper-item> <swiper-item wx:key="2"> <video id="myVideo2" src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" binderror="videoErrorCallback" danmu-list="{{danmuList}}" enable-danmu danmu-btn controls></video> </swiper-item> </swiper> <!-- <view class="weui-cells"> <view class="weui-cell weui-cell_input"> <view class="weui-cell__hd"> <view class="weui-label">弹幕内容</view> </view> <view class="weui-cell__bd"> <input bindblur="bindInputBlur" class="weui-input" type="text" placeholder="在此处输入弹幕内容" /> </view> </view> </view> --> <view class="btn-area"> <!-- <button bindtap="bindSendDanmu" class="page-body-button" type="primary" formType="submit">发送弹幕</button> <button bindtap="bindPlay" class="page-body-button" type="primary">播放</button> <button bindtap="bindPause" class="page-body-button" type="primary">暂停</button> --> <button bindtap="fullscreen" class="page-body-button" type="primary">全屏</button> </view> </view> </view> index.wxss @import "../lib/weui.wxss"; .weui-cells { margin-top: 80rpx; text-align: left; } .weui-label { width: 5em; } .page-body-button { margin-bottom: 30rpx; } .page-section { /* position: fixed; left: 0; right: 0; top: 0; bottom: 0; */ width: 100vw; height: 100vh; } .swiper-container { width: 100%; height: 100%; } .swiper-item { } .page-section video { width: 100vw; height: 100vh; } .btn-area { position: fixed; bottom: 0; left: 0; right: 0; z-index: 999; } index.json { "pageOrientation": "auto", "navigationStyle": "custom" } index.js function getRandomColor () { const rgb = [] for (let i = 0 ; i < 3; ++i){ let color = Math.floor(Math.random() * 256).toString(16) color = color.length == 1 ? '0' + color : color rgb.push(color) } return '#' + rgb.join('') } Page({ onReady: function (res) { this.videoContext = wx.createVideoContext('myVideo') }, inputValue: '', data: { src: '', danmuList: [{ text: '第 1s 出现的弹幕', color: '#ff0000', time: 1 }, { text: '第 3s 出现的弹幕', color: '#ff00ff', time: 3 }] }, bindInputBlur: function(e) { this.inputValue = e.detail.value }, bindSendDanmu: function () { this.videoContext.sendDanmu({ text: this.inputValue, color: getRandomColor() }) }, bindPlay: function() { this.videoContext.play() }, bindPause: function() { this.videoContext.pause() }, fullscreen: function() { console.log('fullscreen') this.videoContext.requestFullScreen({direction: 90}) }, videoErrorCallback: function(e) { console.log('视频错误信息:') console.log(e.detail.errMsg) } })
04-24Framework TypeError: 不用管,工具的问题
Cannot read property 'split' of undefined 怎么解决?[渲染层错误] Framework TypeError: LifeCycle.start fail: Cannot read property 'split' of undefined(env: Windows,mp,1.06.2504212; lib: 3.8.1) [渲染层错误] TypeError: SystemError (webviewSDKScriptError) LifeCycle.start fail: Cannot read property 'split' of undefined(env: Windows,mp,1.06.2504212; lib: 3.8.1)
04-24需要在配置手动开启具名插槽 [图片] 参考这里:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#%E7%BB%84%E4%BB%B6%20wxml%20%E7%9A%84%20slot
微信小程序不能使用动态具名插槽吗?<slot :name="item.field" :record="item" :errorStyle="errorStyle(!!errors[item.field])" ></slot> 微信小程序为啥不能动态设置具名插槽,设置了不显示,h5是没有问题的
04-18小程序appid给对了吗,或者是urlschemem生成有什么问题
wx-open-launch-app H5公众号页面 打开 iOS app 为什么会报这个错误[图片]
04-18这种势必要接入AI审核的,不可能说涉及毒品两个字就给你禁了,万一是禁毒宣传呢
这内容安全检测尺度这么开吗,这内容都没问题吗,那安全检测的意义在哪?https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/sec-center/sec-check/msgSecCheck.html;20006 违法犯罪;标签枚举值,100 正常;1000 [图片]
04-18官方都不理会吗
安卓下getMenuButtonBoundingClientRect首次打开小程序宽度为屏幕宽度?getMenuButtonBoundingClientRect在安卓(目前是鸿蒙系统),首次打开小程序(之前没有加载过该小程序代码)调用 getMenuButtonBoundingClientRect 返回的width是屏幕宽度,导致自定义的navbar布局错乱!
04-18