更新记录
1.0.0(2025-06-23)
企业微信登录分享
平台兼容性
uni-app
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
√ |
- |
- |
- |
- |
4.4 |
12 |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
uni-app x
Chrome |
Safari |
Android |
iOS |
鸿蒙 |
微信小程序 |
- |
- |
5.0 |
12 |
- |
- |
p-Wecom
<template>
<view>
<text class="iconfont"></text>
<button @click="isAppInstall">是否安装企业微信</button>
<button @click="openWecom">打开企业微信</button>
<button @click="sharetxt">分享文本</button>
<button @click="sharepic">分享图片</button>
<button @click="sharefile">分享文件</button>
<button @click="sharevideo">分享视频</button>
<button @click="sharelink">分享网页类型</button>
<button @click="sharemini">分享小程序</button>
</view>
</template>
<script>
import { PFile } from '../../uni_modules/p-chooseFile';
import {registerApp,login,shareText,shareImage,shareFile,shareVideo, shareLink,shareMiniProgram,isAppInstalled} from "../../uni_modules/p-Wecom"
export default {
data() {
return {
}
},
onLoad() {
let c = registerApp("wwauth29f43354bcb5a85f000003","ww29f43354bcb5a85f","1000003");
console.log(c)
},
methods: {
isAppInstall() {
let status = isAppInstalled()
console.log(status)
},
sharemini() {
uni.chooseImage({
complete: (res) => {
shareMiniProgram({
username:"gh_dde54cb88ce7@app", //必须是应用关联的小程序,注意要有@app后缀
description:"dddddd",
path:"/pages/plugin/index.html?plugid=1cbd3b7c8674e61769436b5e354ddb2f",
title:"xxxx",
pic:plus.io.convertLocalFileSystemURL(res.tempFilePaths[0])
})
}
})
},
sharelink() {
PFile.chooseFile({
complete: (res) => {
var thumbUrl = plus.io.convertLocalFileSystemURL(res);
var webpageUrl = "https://www.baidu.com";
var title = "测试标题";
var description = "测试描述";
shareLink(thumbUrl,webpageUrl,title,description)
}
})
},
sharevideo() {
PFile.chooseFile({
complete: (res) => {
console.log(plus.io.convertLocalFileSystemURL(res))
shareVideo("name1.mp4",plus.io.convertLocalFileSystemURL(res))
}
})
},
sharefile() {
PFile.chooseFile({
complete: (res) => {
console.log(res)
shareFile("name.mp4",plus.io.convertLocalFileSystemURL(res))
}
})
},
sharepic() {
PFile.chooseFile({
complete: (res) => {
console.log(plus.io.convertLocalFileSystemURL(res))
shareImage("nam1111e",plus.io.convertLocalFileSystemURL(res))
}
})
},
sharetxt() {
shareText("你好")
},
打开文件选择() {
},
openWecom() {
login({
complete: (res) => {
console.log(res)
}
});
}
}
}
</script>