Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
f3aad6ad
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f3aad6ad
编写于
3月 10, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
4b4e8b1e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
47 addition
and
20 deletion
+47
-20
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+47
-20
未找到文件。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
f3aad6ad
...
...
@@ -13182,7 +13182,10 @@ var serviceContext = (function (vue) {
const SahreOptions = {
formatArgs: {
scene(value, params) {
if (params.provider === 'weixin' && (!value || !SCENE.includes(value))) {
const { provider, openCustomerServiceChat } = params;
if (provider === 'weixin' &&
!openCustomerServiceChat &&
(!value || !SCENE.includes(value))) {
return `分享到微信时,scene必须为以下其中一个:${SCENE.join('、')}`;
}
},
...
...
@@ -13211,6 +13214,16 @@ var serviceContext = (function (vue) {
return '分享小程序时,miniProgram必填';
}
},
corpid(value, params) {
if (params.openCustomerServiceChat && !value) {
return `使用打开客服功能时 corpid 必填`;
}
},
customerUrl(value, params) {
if (params.openCustomerServiceChat && !value) {
return `使用打开客服功能时 customerUrl 必填`;
}
},
},
};
const ShareProtocols = {
...
...
@@ -17012,7 +17025,8 @@ var serviceContext = (function (vue) {
const login = defineAsyncApi(API_LOGIN, (params, { resolve, reject }) => {
const provider = params.provider || 'weixin';
const errorCallback = warpPlusErrorCallback(reject);
const authOptions = provider === 'apple'
const isAppleLogin = provider === 'apple';
const authOptions = isAppleLogin
? { scope: 'email' }
: params.univerifyStyle
? {
...
...
@@ -17033,15 +17047,17 @@ var serviceContext = (function (vue) {
}
service.login((res) => {
const authResult = res.target.authResult;
const appleInfo = res.target.appleInfo;
resolve({
code: authResult.code,
authResult: authResult,
appleInfo,
});
}, errorCallback, authOptions);
}
// 先注销再登录
// apple登录logout之后无法重新触发获取email,fullname;一键登录无logout
if (
provider === 'apple'
|| provider === 'univerify') {
if (
isAppleLogin
|| provider === 'univerify') {
login();
}
else {
...
...
@@ -17174,16 +17190,16 @@ var serviceContext = (function (vue) {
this.eventName = 'api.univerifyButtonsClick';
}
close() {
closeAuthView();
return
closeAuthView();
}
login(options) {
login(this._getOptions(options));
return
login(this._getOptions(options));
}
getCheckBoxState(options) {
getCheckBoxState(options);
return
getCheckBoxState(options);
}
preLogin(options) {
preLogin(this._getOptions(options));
return
preLogin(this._getOptions(options));
}
onButtonsClick(callback) {
UniServiceJSBridge.on(this.eventName, callback);
...
...
@@ -17236,7 +17252,7 @@ var serviceContext = (function (vue) {
};
const parseParams = (args) => {
args.type = args.type || 0;
let { provider, type, title, summary: content, href, imageUrl, mediaUrl: media, scene, miniProgram, } = args;
let { provider, type, title, summary: content, href, imageUrl, mediaUrl: media, scene, miniProgram,
openCustomerServiceChat, corpid, customerUrl: url,
} = args;
if (typeof imageUrl === 'string' && imageUrl) {
imageUrl = getRealPath(imageUrl);
}
...
...
@@ -17255,6 +17271,9 @@ var serviceContext = (function (vue) {
extra: {
scene,
},
openCustomerServiceChat,
corpid,
url,
};
if (provider === 'weixin' && (type === 1 || type === 2)) {
delete sendMsg.thumbs;
...
...
@@ -17265,30 +17284,38 @@ var serviceContext = (function (vue) {
};
const sendShareMsg = function (service, params, resolve, reject, method = 'share') {
const errorCallback = warpPlusErrorCallback(reject);
service.send(params, () => {
resolve();
}, errorCallback);
const serviceMethod = params.openCustomerServiceChat
? 'openCustomerServiceChat'
: 'send';
try {
// @ts-expect-error openCustomerServiceChat
service[serviceMethod](params, () => {
resolve();
}, errorCallback);
}
catch (error) {
errorCallback({
message: `${params.provider} ${serviceMethod} 方法调用失败`,
});
}
};
const share = defineAsyncApi(API_SHREA, (params, { resolve, reject }) => {
const
re
s = parseParams(params);
const
parsedParam
s = parseParams(params);
const errorCallback = warpPlusErrorCallback(reject);
if (typeof res === 'string') {
return reject(res);
}
else {
params = res;
if (typeof parsedParams === 'string') {
return reject(parsedParams);
}
plus.share.getServices((services) => {
const service = services.find(({ id }) => id === params.provider);
const service = services.find(({ id }) => id === par
sedPar
ams.provider);
if (!service) {
reject('service not found');
}
else {
if (service.authenticated) {
sendShareMsg(service, params, resolve, reject);
sendShareMsg(service, par
sedPar
ams, resolve, reject);
}
else {
service.authorize(() => sendShareMsg(service, params, resolve, reject), errorCallback);
service.authorize(() => sendShareMsg(service, par
sedPar
ams, resolve, reject), errorCallback);
}
}
}, errorCallback);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录