From 0c62e3a85ad6613bb6c1dffb6bcd2d55fcb3b721 Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 17 May 2021 13:04:19 +0800 Subject: [PATCH] build: v3 --- packages/uni-app-plus/dist/index.v3.js | 37 ++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/uni-app-plus/dist/index.v3.js b/packages/uni-app-plus/dist/index.v3.js index 0a98705ec..1a69dd5bd 100644 --- a/packages/uni-app-plus/dist/index.v3.js +++ b/packages/uni-app-plus/dist/index.v3.js @@ -7687,7 +7687,7 @@ var serviceContext = (function () { authResult: authResult, 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 @@ -7784,7 +7784,30 @@ var serviceContext = (function () { } 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) { @@ -11059,6 +11082,7 @@ var serviceContext = (function () { this._adError = ''; this._adpid = options.adpid; this._provider = options.provider; + this._userData = options.userData; this._isLoaded = false; this._isLoading = false; this._loadPromiseResolve = null; @@ -11077,6 +11101,9 @@ var serviceContext = (function () { provider: this._provider, success: (res) => { this._ad = res; + if (this._userData) { + this.bindUserData(this._userData); + } this._loadAd(); }, fail: (err) => { @@ -11142,6 +11169,12 @@ var serviceContext = (function () { } } + bindUserData (data) { + if (this._ad !== null) { + this._ad.bindUserData(data); + } + } + _loadAd () { if (this._ad !== null) { if (this._isLoading === true) { -- GitLab