Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_68066342
uni-app
提交
b2e4ba85
U
uni-app
项目概览
m0_68066342
/
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,发现更多精彩内容 >>
提交
b2e4ba85
编写于
12月 11, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build v3
上级
4ba27d67
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
90 addition
and
132 deletion
+90
-132
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+90
-132
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
b2e4ba85
...
...
@@ -219,7 +219,6 @@ var serviceContext = (function () {
'checkSession',
'getUserInfo',
'preLogin',
'onAuthViewOtherLoginButtonClick',
'closeAuthView',
'share',
'shareWithSystem',
...
...
@@ -3424,9 +3423,11 @@ var serviceContext = (function () {
function warpPlusErrorCallback (callbackId, neme, errMsg) {
return function errorCallback (error) {
error = error || {};
const code = error.code || 0;
invoke$1(callbackId, {
errMsg: `${neme}:fail ${error.message || errMsg || ''}`,
errCode: error.code || 0
errCode: code,
code
});
}
}
...
...
@@ -4397,14 +4398,14 @@ var serviceContext = (function () {
function getScreenBrightness () {
return {
errMsg: 'getScreenBrightness:ok',
value: plus.screen.getBrightness()
value: plus.screen.getBrightness(
false
)
}
}
function setScreenBrightness ({
value
} = {}) {
plus.screen.setBrightness(value);
plus.screen.setBrightness(value
, false
);
return {
errMsg: 'setScreenBrightness:ok'
}
...
...
@@ -6255,7 +6256,7 @@ var serviceContext = (function () {
title: item,
color: itemColor
})),
cancel: '
取消
'
cancel: ''
};
if (title) {
options.title = title;
...
...
@@ -6801,7 +6802,7 @@ var serviceContext = (function () {
for (const name in header) {
if (hasOwn(header, name)) {
uploader.setRequestHeader(name,
header[name]
);
uploader.setRequestHeader(name,
String(header[name])
);
}
}
for (const name in formData) {
...
...
@@ -6921,7 +6922,7 @@ var serviceContext = (function () {
providers[service]((err, provider) => {
if (err) {
invoke$1(callbackId, {
errMsg: 'getProvider:fail
:
' + err.message
errMsg: 'getProvider:fail
' + err.message
});
} else {
invoke$1(callbackId, {
...
...
@@ -6933,7 +6934,7 @@ var serviceContext = (function () {
});
} else {
invoke$1(callbackId, {
errMsg: 'getProvider:fail
:
服务[' + service + ']不支持'
errMsg: 'getProvider:fail
服务[' + service + ']不支持'
});
}
}
...
...
@@ -6952,6 +6953,8 @@ var serviceContext = (function () {
*/
function login (params, callbackId) {
const provider = params.provider || 'weixin';
const errorCallback = warpPlusErrorCallback(callbackId, 'login');
getService(provider).then(service => {
function login () {
service.login(res => {
...
...
@@ -6961,12 +6964,7 @@ var serviceContext = (function () {
authResult: authResult,
errMsg: 'login:ok'
});
}, err => {
invoke$1(callbackId, {
code: err.code,
errMsg: 'login:fail:' + err.message
});
}, provider === 'apple' ? { scope: 'email' } : params.univerifyStyle || {});
}, errorCallback, provider === 'apple' ? { scope: 'email' } : params.univerifyStyle || {});
}
// 先注销再登录
// apple登录logout之后无法重新触发获取email,fullname;一键登录无logout
...
...
@@ -6975,12 +6973,7 @@ var serviceContext = (function () {
} else {
service.logout(login, login);
}
}).catch(err => {
invoke$1(callbackId, {
code: err.code || '',
errMsg: 'login:fail:' + err.message
});
});
}).catch(errorCallback);
}
function getUserInfo (params, callbackId) {
...
...
@@ -7061,41 +7054,29 @@ var serviceContext = (function () {
getService(params.provider).then(service => service.preLogin(successCallback, errorCallback)).catch(errorCallback);
}
function onAuthViewOtherLoginButtonClick (callbackId) {
getService('univerify').then(service => service.onOtherLoginButtonClick(() => {
invoke$1(callbackId, {});
}));
}
function closeAuthView () {
getService('univerify').then(service => service.closeAuthView());
}
function requestPayment (params, callbackId) {
const provider = params.provider;
const errorCallback = warpPlusErrorCallback(callbackId, 'requestPayment');
plus.payment.getChannels(services => {
const service = services.find(({
id
}) => id === provider);
if (!service) {
invoke$1(callbackId, {
errMsg: 'requestPayment:fail
:
支付服务[' + provider + ']不存在'
errMsg: 'requestPayment:fail
支付服务[' + provider + ']不存在'
});
} else {
plus.payment.request(service, params.orderInfo, res => {
res.errMsg = 'requestPayment:ok';
invoke$1(callbackId, res);
}, err => {
invoke$1(callbackId, {
errMsg: 'requestPayment:fail:' + err.message
});
});
}, errorCallback);
}
}, err => {
invoke$1(callbackId, {
errMsg: 'requestPayment:fail:' + err.message
});
});
}, errorCallback);
}
let onPushing;
...
...
@@ -7236,19 +7217,13 @@ var serviceContext = (function () {
};
const sendShareMsg = function (service, params, callbackId, method = 'share') {
service.send(
params,
() => {
const errorCallback = warpPlusErrorCallback(callbackId, method);
service.send(params,
() => {
invoke$1(callbackId, {
errMsg: method + ':ok'
});
},
err => {
invoke$1(callbackId, {
errMsg: method + ':fail:' + err.message
});
}
);
}, errorCallback);
};
function shareAppMessageDirectly ({
...
...
@@ -7271,37 +7246,24 @@ var serviceContext = (function () {
'shareAppMessageDirectly'
);
};
const errorCallback = warpPlusErrorCallback(callbackId, 'shareAppMessageDirectly');
if (useDefaultSnapshot) {
const pages = getCurrentPages();
const webview = plus.webview.getWebviewById(pages[pages.length - 1].__wxWebviewId__ + '');
if (webview) {
const bitmap = new plus.nativeObj.Bitmap();
webview.draw(
bitmap,
() => {
webview.draw(bitmap, () => {
const fileName = TEMP_PATH + '/share/snapshot.jpg';
bitmap.save(
fileName, {
overwrite: true,
format: 'jpg'
},
() => {
}, () => {
imageUrl = fileName;
goShare();
},
err => {
invoke$1(callbackId, {
errMsg: 'shareAppMessageDirectly:fail:' + err.message
});
}
);
},
err => {
invoke$1(callbackId, {
errMsg: 'shareAppMessageDirectly:fail:' + err.message
});
}
);
}, errorCallback);
}, errorCallback);
} else {
goShare();
}
...
...
@@ -7312,20 +7274,21 @@ var serviceContext = (function () {
function share (params, callbackId, method = 'share') {
params = parseParams(params);
const errorCallback = warpPlusErrorCallback(callbackId, method);
if (typeof params === 'string') {
return invoke$1(callbackId, {
errMsg: method + ':fail
:
' + params
errMsg: method + ':fail
' + params
})
}
const provider = params.provider;
plus.share.getServices(
services => {
plus.share.getServices(services => {
const service = services.find(({
id
}) => id === provider);
if (!service) {
invoke$1(callbackId, {
errMsg: method + ':fail:
分享服务[' + provider + ']不存在'
errMsg: method + ':fail
分享服务[' + provider + ']不存在'
});
} else {
if (service.authenticated) {
...
...
@@ -7333,21 +7296,11 @@ var serviceContext = (function () {
} else {
service.authorize(
() => sendShareMsg(service, params, callbackId),
err => {
invoke$1(callbackId, {
errMsg: method + ':fail:' + err.message
});
}
errorCallback
);
}
}
},
err => {
invoke$1(callbackId, {
errMsg: method + ':fail:' + err.message
});
}
);
}, errorCallback);
}
function shareWithSystem (params, callbackId, method = 'shareWithSystem') {
...
...
@@ -7359,9 +7312,11 @@ var serviceContext = (function () {
} = params;
type = type || 'text';
const allowedTypes = ['text', 'image'];
const errorCallback = warpPlusErrorCallback(callbackId, method);
if (allowedTypes.indexOf(type) < 0) {
invoke$1(callbackId, {
errMsg: method + ':fail
:分享参数 type 不正确'
errMsg: method + ':fail
分享参数 type 不正确'
});
}
if (typeof imageUrl === 'string' && imageUrl) {
...
...
@@ -7376,11 +7331,7 @@ var serviceContext = (function () {
invoke$1(callbackId, {
errMsg: method + ':ok'
});
}, function (err) {
invoke$1(callbackId, {
errMsg: method + ':fail:' + err.message
});
});
}, errorCallback);
}
function restoreGlobal (
...
...
@@ -8407,7 +8358,7 @@ var serviceContext = (function () {
// 如果页面有subNvues,切使用了webview组件,则返回时子webview会取错,因此需要做id匹配
const childWebview = children.find(webview => webview.id.indexOf(WEBVIEW_ID_PREFIX) === 0) || children[0];
console.log('backWebview -> childWebview', childWebview);
childWebview.canBack(({
canBack
}) => {
...
...
@@ -9931,7 +9882,8 @@ var serviceContext = (function () {
'load',
'close',
'verify',
'error'
'error',
'adClicked'
];
const ERROR_CODE_LIST = [-5001, -5002, -5003, -5004, -5005, -5006];
...
...
@@ -9991,6 +9943,9 @@ var serviceContext = (function () {
this._loadPromiseReject = null;
}
});
rewardAd.onAdClicked((e) => {
this._dispatchEvent('adClicked', {});
});
if (this._preload) {
this._loadAd();
...
...
@@ -10062,7 +10017,8 @@ var serviceContext = (function () {
const eventNames$1 = [
'load',
'close',
'error'
'error',
'adClicked'
];
class FullScreenVideoAd {
...
...
@@ -10111,6 +10067,9 @@ var serviceContext = (function () {
this._loadPromiseReject = null;
}
});
ad.onAdClicked((e) => {
this._dispatchEvent('adClicked', {});
});
}
load () {
...
...
@@ -10268,7 +10227,6 @@ var serviceContext = (function () {
getUserInfo: getUserInfo,
operateWXData: operateWXData,
preLogin: preLogin$1,
onAuthViewOtherLoginButtonClick: onAuthViewOtherLoginButtonClick,
closeAuthView: closeAuthView,
requestPayment: requestPayment,
subscribePush: subscribePush,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录