小程序
目前小程序中有加入自定义埋点时间,上报公司内部服务端,在统计过程中无法识别未登录的用户; 比如在统计【日活量】时,只能通过埋点记录对已登录的用户的openid去重,未登录用户当前只给了一个not login的标识,这部分用户无法准确统计在日活量内 有没有可以静默获取openid的方式,这样在统计数据可以剥离登录逻辑,精准识别用户身份
[图片]严重的影响了业务开展了,天天被领导催,被销售鄙视,多久能恢复啊,申述后没过两天就又打不开了,域名和小程序都是备案过了的,这个也是医院系统,有等保证书。麻烦尽快恢复下,域名:cqmytyy.com
已申请SSL证书,已备案,但是微信中扫码跳转时提示:无法确认该网页的安全性,请谨慎访问。 自查链接的内容没有违反《微信外部链接内容管理规范》,如果违反了某些规范,麻烦给出具体提示,我们配合整改;如果没有违反规范,麻烦核实后解除限制。 [图片] [图片] [图片]
iOS左滑返回上一页。使用自定义头部 back 返回,左滑手势不会触发吗
复现操作路径 点击公众号,选择标签 [图片] 第二次点击其中的链接,就会出现链接反复被选中的问题 [图片] 预期表现 点击链接的时候应该和第一次点击的效果一样不产生闪烁的效果吧 出错截图 [图片] 微信PC端版本是4.1.0.30
[图片][图片] 以下是代码片段,但是整体运行后,图片加载不出来,同时也没有相应的banner显示等,请大神赐教 // index?.js Component({ data: { // 用户授权状态 hasUserInfo: false, userInfo: {}, showAuthButton: true, // 是否显示授权按钮(兼容旧版本) appInfo: {}, // 应用信息 // 轮播图数据 bannerList: [ { id: 1, image: '/images/banner1.jpg', title: '广告1' }, { id: 2, image: '/images/banner2.jpg', title: '广告2' }, { id: 3, image: '/images/banner3.jpg', title: '广告3' }, { id: 4, image: '/images/banner4.jpg', title: '广告4' } ], currentBanner: 0, // 消息通知数据 noticeList: [ { id: 1, content: '欢迎使用我们的小程序!' }, { id: 2, content: '新品上线,限时优惠中...' }, { id: 3, content: '感谢您的支持与信任!' } ], currentNotice: 0, // 产品展示数据 productList: [ { id: 1, name: '产品1', price: 99, image: '/images/product1.jpg', desc: '优质产品,值得拥有' }, { id: 2, name: '产品2', price: 199, image: '/images/product2.jpg', desc: '精心设计,品质保证' }, { id: 3, name: '产品3', price: 299, image: '/images/product3.jpg', desc: '热销商品,限时特价' }, { id: 4, name: '产品4', price: 399, image: '/images/product4.jpg', desc: '新品上市,抢先体验' } ], // 评论数据 commentList: [ { id: 1, user: '用户A', content: '产品质量很好,推荐购买!', time: '2025-01-20' }, { id: 2, user: '用户B', content: '服务态度不错,物流很快。', time: '2025-01-19' }, { id: 3, user: '用户C', content: '性价比很高,会再次购买。', time: '2025-01-18' } ], // 底部导航状态 tabBarList: [ { id: 1, text: '首页', icon: 'home', active: true }, { id: 2, text: '分类', icon: 'category', active: false }, { id: 3, text: '购物车', icon: 'cart', active: false }, { id: 4, text: '我的', icon: 'user', active: false } ] }, lifetimes: { attached() { this.checkUserAuth() this.initBannerTimer() this.initNoticeTimer() this.checkBaseLibVersion() }, detached() { this.clearTimers() } }, methods: { // 检查用户授权状态 checkUserAuth() { const userInfo = wx.getStorageSync('userInfo') if (userInfo) { this.setData({ hasUserInfo: true, userInfo: userInfo }) } else { this.requestUserAuth() } }, // 检查基础库版本 (2.10.4以上版本优化) checkBaseLibVersion() { const systemInfo = wx.getSystemInfoSync() const SDKVersion = systemInfo.SDKVersion console.log('当前基础库版本:', SDKVersion) // 检查关键API支持情况 const apiSupport = { getUserProfile: wx.canIUse('getUserProfile'), // 2.10.4+ getSystemInfoSync: wx.canIUse('getSystemInfoSync'), setStorageSync: wx.canIUse('setStorageSync'), showToast: wx.canIUse('showToast'), showModal: wx.canIUse('showModal'), onMemoryWarning: wx.canIUse('onMemoryWarning'), // 2.9.0+ getAccountInfoSync: wx.canIUse('getAccountInfoSync'), // 2.2.2+ getUpdateManager: wx.canIUse('getUpdateManager'), // 2.1.0+ nextTick: wx.canIUse('nextTick'), // 2.2.3+ createIntersectionObserver: wx.canIUse('createIntersectionObserver') // 2.0.0+ } console.log('API支持情况:', apiSupport) // 版本兼容性处理 this.initVersionFeatures(apiSupport) }, // 初始化版本特性 initVersionFeatures(apiSupport) { // 启用更新管理器 (2.1.0+) if (apiSupport.getUpdateManager) { this.initUpdateManager() } // 启用内存警告监听 (2.9.0+) if (apiSupport.onMemoryWarning) { this.initMemoryWarning() } // 获取账户信息 (2.2.2+) if (apiSupport.getAccountInfoSync) { this.getAccountInfo() } }, // 更新管理器 initUpdateManager() { const updateManager = wx.getUpdateManager() updateManager.onCheckForUpdate((res) => { console.log('检查更新结果:', res.hasUpdate) }) updateManager.onUpdateReady(() => { wx.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', success: (res) => { if (res.confirm) { updateManager.applyUpdate() } } }) }) updateManager.onUpdateFailed(() => { console.error('更新失败') }) }, // 内存警告处理 initMemoryWarning() { wx.onMemoryWarning(() => { console.warn('内存不足警告') // 清理不必要的数据 this.clearTimers() // 可以在这里添加更多内存优化逻辑 }) }, // 获取账户信息 getAccountInfo() { try { const accountInfo = wx.getAccountInfoSync() console.log('账户信息:', accountInfo) this.setData({ appInfo: { appId: accountInfo.miniProgram.appId, envVersion: accountInfo.miniProgram.envVersion } }) } catch (error) { console.error('获取账户信息失败:', error) } }, // 请求用户授权 (基础库2.10.4+优化) requestUserAuth() { // 优先使用getUserProfile API (2.10.4+) if (wx.canIUse('getUserProfile')) { wx.showModal({ title: '用户授权', content: '为了给您提供更好的服务,需要获取您的微信用户信息', confirmText: '授权', cancelText: '取消', success: (res) => { if (res.confirm) { this.getUserProfile() } else { wx.showToast({ title: '取消授权可能影响部分功能使用', icon: 'none', duration: 2000 }) } } }) } else { // 降级处理:使用button组件的open-type="getUserInfo" wx.showModal({ title: '用户授权', content: '当前版本需要通过按钮获取用户信息,请点击页面中的授权按钮', confirmText: '确定', success: () => { this.setData({ showAuthButton: true }) } }) } }, // 获取用户信息 (基础库2.10.4+) getUserProfile() { wx.getUserProfile({ desc: '用于完善用户资料', success: (res) => { const userInfo = res.userInfo this.setData({ hasUserInfo: true, userInfo: userInfo, showAuthButton: false }) // 存储用户信息 wx.setStorageSync('userInfo', userInfo) // 使用nextTick确保数据更新完成 if (wx.canIUse('nextTick')) { wx.nextTick(() => { wx.showToast({ title: '授权成功', icon: 'success' }) }) } else { wx.showToast({ title: '授权成功', icon: 'success' }) } }, fail: () => { wx.showToast({ title: '授权失败', icon: 'none' }) } }) }, // 兼容旧版本的getUserInfo方法 onGetUserInfo(e) { if (e.detail.userInfo) { const userInfo = e.detail.userInfo this.setData({ hasUserInfo: true, userInfo: userInfo, showAuthButton: false }) wx.setStorageSync('userInfo', userInfo) wx.showToast({ title: '授权成功', icon: 'success' }) } else { wx.showToast({ title: '授权失败', icon: 'none' }) } }, // 初始化轮播图定时器 (基础库2.10.4+优化) initBannerTimer() { // 确保组件未被销毁 if (this.data) { this.bannerTimer = setInterval(() => { if (this.data) { // 双重检查避免内存泄漏 const { currentBanner, bannerList } = this.data const nextBanner = (currentBanner + 1) % bannerList.length // 使用nextTick优化渲染性能 if (wx.canIUse('nextTick')) { wx.nextTick(() => { this.setData({ currentBanner: nextBanner }) }) } else { this.setData({ currentBanner: nextBanner }) } } }, 3000) } }, // 初始化消息通知定时器 (基础库2.10.4+优化) initNoticeTimer() { // 确保组件未被销毁 if (this.data) { this.noticeTimer = setInterval(() => { if (this.data) { // 双重检查避免内存泄漏 const { currentNotice, noticeList } = this.data const nextNotice = (currentNotice + 1) % noticeList.length // 使用nextTick优化渲染性能 if (wx.canIUse('nextTick')) { wx.nextTick(() => { this.setData({ currentNotice: nextNotice }) }) } else { this.setData({ currentNotice: nextNotice }) } } }, 2000) } }, // 清除定时器 clearTimers() { if (this.bannerTimer) { clearInterval(this.bannerTimer) this.bannerTimer = null } if (this.noticeTimer) { clearInterval(this.noticeTimer) this.noticeTimer = null } }, // 轮播图点击事件 onBannerTap(e) { const { index } = e.currentTarget.dataset console.log('点击了轮播图:', this.data.bannerList[index]) // 可以在这里处理广告点击逻辑 }, // 产品点击事件 (基础库2.10.4兼容) onProductTap(e) { const { product } = e.currentTarget.dataset console.log('点击了产品:', product) // 检查是否支持模板字符串,进行兼容处理 const url = '/pages/product/detail?id=' + product.id wx.navigateTo({ url: url, success: () => { console.log('跳转成功') }, fail: (err) => { console.error('跳转失败:', err) wx.showToast({ title: '页面跳转失败', icon: 'none' }) } }) }, // 底部导航点击事件 (基础库2.10.4兼容) onTabBarTap(e) { const { index, tab } = e.currentTarget.dataset // 更新选中状态 (兼容不支持展开运算符的情况) const tabBarList = this.data.tabBarList.map(function(item, i) { return { id: item.id, text: item.text, icon: item.icon, active: i === index } }) this.setData({ tabBarList: tabBarList }) // 根据选中的tab进行页面跳转 var navigateUrl = '' switch(tab.text) { case '首页': // 当前页面,不需要跳转 return case '分类': navigateUrl = '/pages/category/index' break case '购物车': navigateUrl = '/pages/cart/index' break case '我的': navigateUrl = '/pages/user/index' break default: return } if (navigateUrl) { // 使用switchTab跳转到tabBar页面 wx.switchTab({ url: navigateUrl, fail: function(err) { console.error('导航失败:', err) wx.showToast({ title: '页面跳转失败', icon: 'none' }) } }) } }, // 评论区相关方法 (基础库2.10.4兼容) onCommentMore() { wx.navigateTo({ url: '/pages/comment/index', fail: function(err) { console.error('跳转评论页失败:', err) wx.showToast({ title: '页面跳转失败', icon: 'none' }) } }) }, // 手动刷新页面数据 (基础库2.10.4+优化) onRefresh() { wx.showToast({ title: '刷新中...', icon: 'loading' }) // 模拟数据刷新,使用Promise优化异步处理 const refreshPromise = new Promise((resolve) => { setTimeout(() => { resolve() }, 1000) }) refreshPromise.then(() => { wx.hideToast() // 使用nextTick确保UI更新 if (wx.canIUse('nextTick')) { wx.nextTick(() => { wx.showToast({ title: '刷新成功', icon: 'success' }) }) } else { wx.showToast({ title: '刷新成功', icon: 'success' }) } }).catch((error) => { console.error('刷新失败:', error) wx.showToast({ title: '刷新失败', icon: 'none' }) }) }, // 页面性能优化 onOptimizePerformance() { // 使用Intersection Observer优化长列表性能 if (wx.canIUse('createIntersectionObserver')) { const observer = this.createIntersectionObserver() observer.relativeToViewport().observe('.product-item', (res) => { if (res.intersectionRatio > 0) { console.log('产品进入可视区域:', res.dataset) } }) } } } })
我单位在注册服务号时发现单位名称被一个赞赏账户占用,导致无法申请服务号![图片][图片]
企业在操作小程序与视频号关联时遇阻(关联后实现小程序中能够直接播放视频号的视频内容),该问题直接影响正常运营: 一、基础信息与核心问题 1、关联账号信息:需关联的小程序为【充电丁停车】、视频号为【木鱼带你看世界】,二者均已完成企业认证,认证主体实质均为 “丁丁同行互联科技(南京)有限公司”。 2、主体一致性证明:我方营业执照、开户许可证中,公司名称明确为 “丁丁同行互联科技(南京)有限公司”(括号为中文 “()”),可提供证件扫描件佐证,确保主体合法唯一。 3、关联阻碍原因:小程序认证系统强制括号为英文 “()”,导致其主体显示为 “丁丁同行互联科技 (南京) 有限公司”;视频号按证件格式显示为中文括号,系统因 “括号格式不同” 判定主体不一致,关联功能无法使用。 3、小程序内部格式矛盾:我方发现,小程序 “变更备案页面” 显示主体括号为中文,“主体信息详情页” 却为英文,同一账号内格式不统一,进一步加剧关联阻碍。 二、核心诉求 恳请明确告知:针对 “主体名称实质一致、仅括号格式因系统规则差异不同” 的情况,是否有后台人工介入审核并完成关联的通道? 若有该通道,需提供具体申请路径、所需材料清单(如营业执照、开户许可证扫描件等)及预计处理时效;若暂无对应方案,恳请协调技术 / 认证审核团队,给出可确保关联成功的解决方案。
[图片][图片]
我在看Skyline 渲染引擎 /增强特性 /滚动容器及其应用场景 文档 【完全的按需渲染】部分讲解时,使用微信开发者工具下载了示例代码。 示例代码地址:https://developers.weixin.qq.com/s/z25kA6mv7gPx this.spliceArrayDataOnPath(['preList'], 2, 0, [{ wxKey: `pre-key-insert-${seed}`, height: (Math.floor(Math.random() * 4) + 1) * 100, color: colors[seed % 5] }]); this.applyDataUpdates() 在代码中 index2/index2.js中看到这块代码块。发现了 spliceArrayDataOnPath 和 applyDataUpdates 方法,在微信小程序的开发文档中,没有找到此方法。请问一下这两个方法的相关介绍在哪里可以找到呢?
我们没有涉及色情相关,申诉没回,影响业务运营,麻烦看下,感谢。
一直用有赞后台编辑服务号自定义菜单,想试试服务号自己的自定义菜单编辑,又怕改不回来
目前通过wx.request调用GET请求,会默认添加Content-Type为application/json 安全扫描,对于GET类型请求,不希望有Content-Type这个Key 通过设置null或空字符都无法删除该Key
[图片]
仅调用了login接口获取code,然后获取openid区别用户。 但是小程序界面会让用户输入学校,班级,姓名,身份证号信息;这样需要声明隐私保护指引吗?
invokeWMPFApi: 拨打电话 com.tencent.wmpf.cli.api.WMPFApiException: errType: 2, errCode: 10013, errMsg: request timeout
接口 https://api.weixin.qq.com/wxa/get_latest_auditstatus 请求时返回{"errcode":-1,"errmsg":"system error rid: 68d10c55-561056e5-087d72ad"} appId:wx9e9c97dd9daa66fa
[图片][图片]
现在我有一个需求,想要统计今天文章每篇文章的平均阅读次数,最高阅读次数,最低阅读次数,以及最高和最低文章的标题,以及某一个时间段内的阅读次数。但是需要获取今年所有的文章标题和阅读次数,该如何获取?嗯,主要为获取今年所有发表的文章的标题和阅读次数,统计我可以自己分析。
公众号图文消息,插入的是原创视频,没有文字内容,下方的原创按钮是否可以点击? [图片]