提交 0c62e3a8 编写于 作者: Q qiang

build: v3

上级 4f4f2605
...@@ -7687,7 +7687,7 @@ var serviceContext = (function () { ...@@ -7687,7 +7687,7 @@ var serviceContext = (function () {
authResult: authResult, authResult: authResult,
errMsg: 'login:ok' errMsg: 'login:ok'
}); });
}, errorCallback, provider === 'apple' ? { scope: 'email' } : { univerifyStyle: params.univerifyStyle } || {}); }, errorCallback, provider === 'apple' ? { scope: 'email' } : { univerifyStyle: univerifyButtonsClickHandling(params.univerifyStyle, errorCallback) } || {});
} }
// 先注销再登录 // 先注销再登录
// apple登录logout之后无法重新触发获取email,fullname;一键登录无logout // apple登录logout之后无法重新触发获取email,fullname;一键登录无logout
...@@ -7784,7 +7784,30 @@ var serviceContext = (function () { ...@@ -7784,7 +7784,30 @@ var serviceContext = (function () {
} }
function closeAuthView () { function closeAuthView () {
getService('univerify').then(service => service.closeAuthView()); return getService('univerify').then(service => service.closeAuthView())
}
/**
* 一键登录自定义登陆按钮点击处理
*/
function univerifyButtonsClickHandling (univerifyStyle, errorCallback) {
if (univerifyStyle.buttons &&
Object.prototype.toString.call(univerifyStyle.buttons.list) === '[object Array]' &&
univerifyStyle.buttons.list.length > 0
) {
univerifyStyle.buttons.list.forEach((button, index) => {
univerifyStyle.buttons.list[index].onclick = function () {
closeAuthView().then(() => {
errorCallback({
code: '30008',
message: '用户点击了自定义按钮',
index
});
});
};
});
}
return univerifyStyle
} }
function requestPayment (params, callbackId) { function requestPayment (params, callbackId) {
...@@ -11059,6 +11082,7 @@ var serviceContext = (function () { ...@@ -11059,6 +11082,7 @@ var serviceContext = (function () {
this._adError = ''; this._adError = '';
this._adpid = options.adpid; this._adpid = options.adpid;
this._provider = options.provider; this._provider = options.provider;
this._userData = options.userData;
this._isLoaded = false; this._isLoaded = false;
this._isLoading = false; this._isLoading = false;
this._loadPromiseResolve = null; this._loadPromiseResolve = null;
...@@ -11077,6 +11101,9 @@ var serviceContext = (function () { ...@@ -11077,6 +11101,9 @@ var serviceContext = (function () {
provider: this._provider, provider: this._provider,
success: (res) => { success: (res) => {
this._ad = res; this._ad = res;
if (this._userData) {
this.bindUserData(this._userData);
}
this._loadAd(); this._loadAd();
}, },
fail: (err) => { fail: (err) => {
...@@ -11142,6 +11169,12 @@ var serviceContext = (function () { ...@@ -11142,6 +11169,12 @@ var serviceContext = (function () {
} }
} }
bindUserData (data) {
if (this._ad !== null) {
this._ad.bindUserData(data);
}
}
_loadAd () { _loadAd () {
if (this._ad !== null) { if (this._ad !== null) {
if (this._isLoading === true) { if (this._isLoading === true) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册