更新记录
1.1.3(2025-04-24)
- 修复android配置问题
1.1.2(2025-04-21)
- 修复鸿蒙打包错误问题
1.1.1(2025-02-05)
- 解决分享缓存目录图片失败问题
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | - | - | - | - | 5.0 | 12 | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
uni-app x
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
- | - | 5.0 | 12 | - | - |
UxFrame 微信SDK 1.1.3
特别说明
如果您已经购买了UxFrame 低代码高性能UI框架, 则无需再次购买本插件,请点击上方进入交流群
联系我免费获取离线版插件!
无支付,不与官方微信支付冲突版本 ⬇️
无支付版本 ➡ 点我️(https://ext.dcloud.net.cn/plugin?id=22241)
官方文档
Android注意事项
需在本插件utssdk
-> app-android
-> AndroidManifest.xml
文件中将所有 ${applicationId}
字段替换成您的真实包名
插件注册universalLink
必填, android可为空
wxsdk.register({
appid: '',
universalLink: '',
success: (res) => {
console.log(res)
}
} as UxRegisterOptions)
iOS注意事项
需在本插件utssdk
-> app-ios
-> Info.plist
文件中修改 CFBundleURLSchemes
字段对应的Value为您的微信AppId
插件注册universalLink
必填
wxsdk.register({
appid: '',
universalLink: '', // ios 必填
success: (res) => {
console.log(res)
}
} as UxRegisterOptions)
使用方法
// #ifdef APP
import * as wxsdk from "@/uni_modules/ux-weixin"
import { UxLoginOptions, UxRegisterOptions, UxShareOptions, UxPayOptions, UxMiniProgram } from "@/uni_modules/ux-weixin"
// #endif
// 注册
wxsdk.register({
appid: '您的微信appid',
success: (res) => {
console.log(res)
}
} as UxRegisterOptions)
// 登录
wxsdk.login({
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxLoginOptions)
// 分享图文
wxsdk.share({
type: 0,
title: 'UxFrame低代码高性能UI框架',
summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
href: 'https://www.uxframe.cn',
imageUrl: 'https://www.uxframe.cn/logo/logo.png',
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 分享文本
wxsdk.share({
type: 1,
title: 'UxFrame低代码高性能UI框架',
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 分享图片
wxsdk.share({
type: 2,
mageUrl: '/static/logo.png', // 仅支持本地路径
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 分享视频
wxsdk.share({
type: 4,
title: 'UxFrame低代码高性能UI框架',
summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
// imageUrl: '/static/logo.png'
imageUrl: 'https://www.uxframe.cn/logo/logo.png',
mediaUrl: 'https://www.uxframe.cn/source/intro/demo.mp4',
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 分享小程序
wxsdk.share({
type: 5,
title: 'UxFrame低代码高性能UI框架',
summary: 'UxFrame是基于UNI-APP-X开发的低代码高性能原生UI框架',
// imageUrl: '/static/logo.png'
imageUrl: 'https://www.uxframe.cn/logo/logo.png',
miniProgram: {
id: '小程序id',
type: 0,
path: '',
webUrl: 'https://www.uxframe.cn'
} as UxMiniProgram,
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 打开小程序
wxsdk.openMiniProgram({
miniProgram: {
id: 'gh_b545368see',
type: 0,
path: '',
} as UxMiniProgram,
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 微信支付
wxsdk.requestPayment({
mchid: '商户号',
prepayId: '预付单',
sign: '签名',
signType: '签名类型',
nonceStr: '随机字符串',
timeStamp: '时间戳',
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxPayOptions)
// 联系微信企业客服
wxsdk.share({
openCustomerServiceChat: true,
corpid: '企业id',
customerUrl: 'https://work.weixin.qq.com/kfid/kfc********',
success: (res) => {
console.log(res);
},
fail: (err) => {
console.log(err);
}
} as UxShareOptions)
// 打开微信
wxsdk.openApp()
// 检测是否安装微信
wxsdk.isInstalled()