微信云开发官网
[图片] [图片] [图片] [图片]
import * as wxopensdk from '@tencent/wechat_open_sdk'; // WXApi 是第三方app和微信通信的openApi接口,其实例通过WXAPIFactory获取,需要传入应用申请到的AppID export const WXApi = wxopensdk.WXAPIFactory.createWXAPI(APP_ID) // WXApiEventHandler为微信数据的回调 class WXApiEventHandlerImpl implements wxopensdk.WXApiEventHandler { private onReqCallbacks: Map<OnWXReq, OnWXReq> = new Map private onRespCallbacks: Map<OnWXResp, OnWXResp> = new Map registerOnWXReqCallback(on: OnWXReq) { this.onReqCallbacks.set(on, on) } unregisterOnWXReqCallback(on: OnWXReq) { this.onReqCallbacks.delete(on) } registerOnWXRespCallback(on: OnWXResp) { this.onRespCallbacks.set(on, on) } unregisterOnWXRespCallback(on: OnWXResp) { this.onRespCallbacks.delete(on) } onReq(req: wxopensdk.BaseReq): void { Log.i(kTag, "onReq:%s", JSON.stringify(req)) this.onReqCallbacks.forEach((on) => { on(req) }) } onResp(resp: wxopensdk.BaseResp): void { Log.i(kTag, "onResp:%s", JSON.stringify(resp)) this.onRespCallbacks.forEach((on) => { on(resp) }) } } export const WXEventHandler = new WXApiEventHandlerImpl let req = new wxopensdk.SendAuthReq req.isOption1 = false req.nonAutomatic = true req.scope = 'snsapi_userinfo' req.state = 'none' req.transaction = 'test123' // 向微信发送登录请求: // context为ohos内置类,app间跳转需依赖该类,开发者可在Component中获取 // finished为跳转微信的结果:true表示跳转成功;false表示跳转失败,可能是因为微信未安装 let finished = await this.wxApi.sendReq(context: common.UIAbilityContext, req) // 在EntryAbility中响应来自微信的回调 export default class EntryAbility extends UIAbility { onCreate(want: Want, _launchParam: AbilityConstant.LaunchParam): void { this.handleWeChatCallIfNeed(want) } onNewWant(want: Want, _launchParam: AbilityConstant.LaunchParam): void { this.handleWeChatCallIfNeed(want) } private handleWeChatCallIfNeed(want: Want) { WXApi.handleWant(want, WXEventHandler) } } 上述代码是鸿蒙接入微信支付指南,但是在鸿蒙app中要实现微信支付与微信小程序支付两种支付方式,微信支付需要的的APP_ID为"wx12345678",微信小程序的APP_ID为"wx8888298",在EntryAbility.ets该文件中初始化微信支付时,WXApi引用了WXApiWrap.ets中的WXApi,代码为export const WXApi = wxopensdk.WXAPIFactory.createWXAPI(APP_ID),请问初始化微信支付需要区分微信支付的APP_ID和微信小程序的APP_ID吗,如果想要实现微信支付与微信小程序支付两种支付方式,如何初始化呢
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/getting-started.html 希望增加预先需要配置工程文件夹miniprogram下的config.js的云开发环境 ID( envId)的表述
w11系统
[图片]
到期时间不是2026.1月吗 [图片]
购买的是19.9的基础基础套餐,要更换去哪里选择
[图片]
使用微搭搭建的小程序,测试发现,长按无法正常弹出识别赞赏码。
[图片]
https://developers.weixin.qq.com/miniprogram/dev/framework/ <button class="username" open-type="getUserProfile" bind:getuserprofile="handleUserProfile1" type="default" >获取信息</button> handleUserProfile1(e) { console.log('当前基础库版本:', wx.getSystemInfoSync().SDKVersion); console.log(e) if (e.detail.errMsg.includes('deny')) { wx.showModal({ title: '提示', content: '需要授权才能继续操作', success: (res) => { if (res.confirm) wx.openSetting() } }) } else if (e.detail.errMsg === 'getUserProfile:ok') { const { avatarUrl, nickName } = e.detail.userInfo this.setData({ avatar: avatarUrl }) // 更新头像显示 } else { console.error('授权失败:', e.detail.errMsg) } },
[图片]
有谁能成功用web端访问读取云数据库吗?一直访问匿名权限都放开了也不行,密钥也用了。具体各位具体各位是如何操作的
请问怎么找回微信云开发过期环境的数据 [图片]
[图片]
线上的版本,昨天添加的数据,云数据库内容,都能实时在小程序展示出来,完全没动,结果今天添加的数据,一个都出不来了,怪哉了
[图片]
Windows 环境,配置正式证书,构建失败,提示keychain 中找不到指定签名证书名,请检查 签名证书名 配置 原信息:[miniapp 11:09:08.969 INFO] cloudBuild.ts:main - 50000000 doing Tong yao Zhang (A37BFJU7L2): no identity found 这个签名证书名在哪能看到,填了好几个都不对
[图片]一直是加载中的页面,怎么回事
https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/shopping-order/normal-shopping-detail/uploadShippingInfo.html 这个上传物流信息的接口支持云调用吗,和这个接口的功能是一样的吗?https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E4%B8%80%E3%80%81%E5%8F%91%E8%B4%A7%E4%BF%A1%E6%81%AF%E5%BD%95%E5%85%A5%E6%8E%A5%E5%8F%A3
小程序示例
小程序官方示例Demo,包含云开发示例。
小程序示例
扫码体验
折腾了这么久,还是借助kimi解决的。可能云开发从什么时候限定了,一定要显示增加权限配置才能调用。话说增加了这个限制,官方为啥不更新到文档里呢?
[图片]