更新记录
1.0.2(2025-04-21)
- 修复鸿蒙打包错误问题
1.0.1(2025-02-19)
- 修复bug
1.0.0(2025-02-19)
- UxFrame WeixinSDK(无支付)1.0.0版本正式发布!
- 支持微信授权登录、微信分享、微信企业客服、打开微信APP、检测是否安装微信APP
平台兼容性
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.0.2
特别说明
如果您已经购买了UxFrame 低代码高性能UI框架, 则无需再次购买本插件,请点击上方进入交流群
联系我免费获取离线版插件!
前言介绍
欢迎使用UxFrame WeixinSDK!此插件是基于wechatsdk开发,轻松实现微信授权登录和微信分享等功能!
官方文档
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.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()