更新记录
1.1.0(2026-10-14)
更新插件内容,优化插件代码
1.0.7(2026-10-13)
更新完善插件内容
1.0.6(2026-10-13)
更新使用说明教程,并更新插件需要申请的系统权限列表
查看更多平台兼容性
uni-app(5.31)
| Vue2 | Vue2插件版本 | Vue3 | Vue3插件版本 | Chrome | Safari | app-vue | app-vue插件版本 | app-nvue | Android | iOS | 鸿蒙 | 鸿蒙插件版本 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | 1.1.0 | √ | 1.1.0 | × | × | √ | 1.1.0 | √ | × | × | 5.0.1(13) | 1.1.0 |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| × | × | × | × | × | × | × | × | × | × | × | × |
uni-app x(5.31)
| Chrome | Safari | Android | iOS | 鸿蒙 | 鸿蒙插件版本 | 微信小程序 |
|---|---|---|---|---|---|---|
| × | × | × | × | 5.0.1(13) | 1.1.0 | × |
其他
| 多语言 | 暗黑模式 | 宽屏模式 | 蒸汽模式 |
|---|---|---|---|
| × | × | √ | √ |
鸿蒙 阿里百川(旗舰版)登录、授权、唤起手淘-示例
创建应用
阿里百川官网:https://console.baichuan.taobao.com

获取并配置安全图片
阿里百川套件平台,获取安全图片:https://suite.baichuan.taobao.com/suite2.htm#/sdk

- 选择图片版本:使用V6版安全图片 选择系统:Harmony 应用BundleName:输入你的鸿蒙包名
- 下载安全图片后,将安全图片放到根目录下 harmony-configs/entry/src/main/resources/base/media
- 无需改名,根目录下没有harmony-configs,就依次创建文件夹就行
harmony-configs整体目录结构

阿里百川SDK配置
SDK下载地址:alibc-default.tgz
-
SDK存放路径:harmony-configs/libs
-
配置harmony-configs/oh-package.json5
{
"modelVersion": "5.0.0",
"description": "Please describe the basic information.",
"dependencies": {
"@ohos/alibc": "file:./libs/alibc-default.tgz"
},
"overrides": {
"@ohos/alibc": "file:./libs/alibc-default.tgz"
},
"devDependencies": {
"@ohos/hypium": "1.0.18",
"@ohos/hamock": "1.0.0"
},
}
- 配置harmony-configs/entry/oh-package.json5
{
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {
"@ohos/alibc": "file:./libs/alibc-default.tgz"
}
}
配置harmony-configs目录下的module.json5
- 将 abilities.skills.uris.scheme 改成 taobaooauth+自己百川应用的appkey
{
"module": {
"name": "entry",
"type": "entry",
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:layered_image",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:startIcon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
],
"uris": [{
"scheme": "taobaooauth35410025" //换成百川应用的appkey
}],
}
]
}
],
"requestPermissions": [
{
"name": "ohos.permission.INTERNET"
}
],
"metadata": [],
"querySchemes": [
"tbopen",
"tbaccount34692017"
],
}
方法使用说明
引用插件
// #ifdef APP-HARMONY
import * as alibc from '@/uni_modules/hmos-aliBc'
// #endif
1. 初始化
alibc.init({
onSuccess: () => {
console.log('alibcInit onSuccess');
},
onFailure: (error, msg) => {
console.log('alibcInit onFailure:', error, msg);
},
})
2. 登录
alibc.login({
onSuccess: (user) => {
console.log('login onSuccess:', user?.openId)
},
onFailure: (code, msg) => {
console.log('login onFailure:', code, msg)
}
})
3. 打开商品链接
alibc.openByUrl({
url,
showParams: { clientType: 'taobao' },
taokeParams: { pid: "mm_26381042_107400144_109668650092" }, //这里需要换成自己的
needBaichuanLinkConvert: false,
onSuccess: (code, msg) => {
console.log('openByUrl onSuccess:', code, msg)
},
onFailure: (code, msg) => {
console.log('openByUrl onFailure:', code, msg)
},
})
4. 退出登录
alibc.logout({
onComplete: () => {
console.log('openByUrl onComplete')
}
});
5. top授权
alibc.authorize({
appName: '测试Demo',
appLogoSrc: '/static/logo.png',
appKey: alibc.appKey,
onSuccess: (params) => {
console.log('authorize onSuccess:', params)
},
onFailure: (code, msg) => {
console.log('authorize onFailure:', code, msg)
}
});

收藏人数:
购买普通授权版(
试用
使用 HBuilder 导入示例项目
赞赏(0)
下载 4
赞赏 0
下载 12680575
赞赏 1956
赞赏
京公网安备:11010802035340号