Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wychl
uni-app
提交
a93896bb
U
uni-app
项目概览
wychl
/
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,发现更多精彩内容 >>
提交
a93896bb
编写于
4月 14, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build: v3
上级
ed79d586
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
156 addition
and
24 deletion
+156
-24
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+156
-24
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
a93896bb
...
...
@@ -251,7 +251,8 @@ var serviceContext = (function () {
const ad = [
'createRewardedVideoAd',
'createFullScreenVideoAd'
'createFullScreenVideoAd',
'createInterstitialAd'
];
const apis = [
...
...
@@ -2246,7 +2247,7 @@ var serviceContext = (function () {
type: String,
validator (value, params) {
if (value) {
params.
type
= getRealPath(value);
params.
filePath
= getRealPath(value);
}
}
},
...
...
@@ -6063,7 +6064,7 @@ var serviceContext = (function () {
windowHeight,
statusBarHeight,
language: plus.os.language,
system:
plus.os.version
,
system:
`${platform} ${plus.os.version}`
,
version: plus.runtime.innerVersion,
fontSizeSetting: '',
platform,
...
...
@@ -10004,7 +10005,7 @@ var serviceContext = (function () {
let currentSize = 0;
for (let index = 0; index < length; index++) {
const key = plus.storage.key(index);
if (key !== STORAGE_KEYS &&
key.indexOf(STORAGE_DATA_TYPE) + STORAGE_DATA_TYPE.length !== key.length
) {
if (key !== STORAGE_KEYS &&
(key.indexOf(STORAGE_DATA_TYPE) < 0 || key.indexOf(STORAGE_DATA_TYPE) + STORAGE_DATA_TYPE.length !== key.length)
) {
const value = plus.storage.getItem(key);
currentSize += key.length + value.length;
keys.push(key);
...
...
@@ -10553,8 +10554,7 @@ var serviceContext = (function () {
callbackId,
data
}, pageId) => {
const { adpid, width, count } = data;
getAdData(adpid, width, count, (res) => {
getAdData(data, (res) => {
operateAdView(pageId, callbackId, 'success', res);
}, (err) => {
operateAdView(pageId, callbackId, 'fail', err);
...
...
@@ -10563,7 +10563,8 @@ var serviceContext = (function () {
const _adDataCache = {};
function getAdData (adpid, width, count, onsuccess, onerror) {
function getAdData (data, onsuccess, onerror) {
const { adpid, width } = data;
const key = adpid + '-' + width;
const adDataList = _adDataCache[key];
if (adDataList && adDataList.length > 0) {
...
...
@@ -10572,11 +10573,7 @@ var serviceContext = (function () {
}
plus.ad.getAds(
{
adpid,
count,
width
},
data,
(res) => {
const list = res.ads;
onsuccess(list.splice(0, 1)[0]);
...
...
@@ -10617,6 +10614,7 @@ var serviceContext = (function () {
this._preload = options.preload !== undefined ? options.preload : true;
this._isLoad = false;
this._isLoading = false;
this._adError = '';
this._loadPromiseResolve = null;
this._loadPromiseReject = null;
...
...
@@ -10625,6 +10623,7 @@ var serviceContext = (function () {
const rewardAd = this._rewardAd = plus.ad.createRewardedVideoAd(options);
rewardAd.onLoad((e) => {
this._isLoad = true;
this._isLoading = false;
this._lastLoadTime = Date.now();
this._dispatchEvent('load', {});
...
...
@@ -10634,6 +10633,8 @@ var serviceContext = (function () {
}
});
rewardAd.onClose((e) => {
this._isLoad = false;
this._isLoading = false;
if (this._preload) {
this._loadAd();
}
...
...
@@ -10643,6 +10644,7 @@ var serviceContext = (function () {
this._dispatchEvent('verify', { isValid: e.isValid });
});
rewardAd.onError((e) => {
this._isLoading = false;
const { code, message } = e;
const data = { code: code, errMsg: message };
this._adError = message;
...
...
@@ -10671,18 +10673,25 @@ var serviceContext = (function () {
load () {
return new Promise((resolve, reject) => {
this._loadPromiseResolve = resolve;
this._loadPromiseReject = reject;
if (this._isLoading) {
return
}
if (this._isLoad) {
resolve();
return
}
this._loadPromiseResolve = resolve;
this._loadPromiseReject = reject;
this._loadAd();
})
}
show () {
return new Promise((resolve, reject) => {
if (this._isLoading) {
return
}
const provider = this.getProvider();
if (provider === ProviderType.CSJ && this.isExpired) {
this._isLoad = false;
...
...
@@ -10711,6 +10720,7 @@ var serviceContext = (function () {
_loadAd () {
this._isLoad = false;
this._isLoading = true;
this._rewardAd.load();
}
...
...
@@ -10834,6 +10844,122 @@ var serviceContext = (function () {
return new FullScreenVideoAd(options)
}
const eventNames$2 = [
'load',
'close',
'error',
'adClicked'
];
class InterstitialAd {
constructor (options = {}) {
const _callbacks = this._callbacks = {};
eventNames$2.forEach(item => {
_callbacks[item] = [];
const name = item[0].toUpperCase() + item.substr(1);
this[`on${name}`] = function (callback) {
_callbacks[item].push(callback);
};
});
this._isLoad = false;
this._isLoading = false;
this._adError = '';
this._loadPromiseResolve = null;
this._loadPromiseReject = null;
const ad = this._ad = plus.ad.createInterstitialAd(options);
ad.onLoad((e) => {
this._isLoad = true;
this._isLoading = false;
this._dispatchEvent('load', {});
if (this._loadPromiseResolve != null) {
this._loadPromiseResolve();
this._loadPromiseResolve = null;
}
});
ad.onClose((e) => {
this._isLoad = false;
this._isLoading = false;
this._dispatchEvent('close', {});
});
ad.onError((e) => {
this._isLoading = false;
const { code, message } = e;
const data = { code: code, errMsg: message };
this._adError = message;
this._dispatchEvent('error', data);
if (this._loadPromiseReject != null) {
this._loadPromiseReject(data);
this._loadPromiseReject = null;
}
});
ad.onAdClicked((e) => {
this._dispatchEvent('adClicked', {});
});
}
load () {
return new Promise((resolve, reject) => {
this._loadPromiseResolve = resolve;
this._loadPromiseReject = reject;
if (this._isLoading) {
return
}
if (this._isLoad) {
resolve();
return
}
this._loadAd();
})
}
show () {
return new Promise((resolve, reject) => {
if (this._isLoading) {
return
}
if (this._isLoad) {
this._ad.show();
resolve();
} else {
reject(new Error(this._adError));
}
})
}
getProvider () {
return this._ad.getProvider()
}
destroy () {
this._ad.destroy();
}
_loadAd () {
this._isLoad = false;
this._isLoading = true;
this._ad.load();
}
_dispatchEvent (name, data) {
this._callbacks[name].forEach(callback => {
if (typeof callback === 'function') {
callback(data || {});
}
});
}
}
function createInterstitialAd (options) {
return new InterstitialAd(options)
}
var api = /*#__PURE__*/Object.freeze({
__proto__: null,
startPullDownRefresh: startPullDownRefresh,
...
...
@@ -10995,7 +11121,8 @@ var serviceContext = (function () {
showTabBar: showTabBar$2,
requestComponentInfo: requestComponentInfo$2,
createRewardedVideoAd: createRewardedVideoAd,
createFullScreenVideoAd: createFullScreenVideoAd
createFullScreenVideoAd: createFullScreenVideoAd,
createInterstitialAd: createInterstitialAd
});
var platformApi = Object.assign(Object.create(null), api, eventApis);
...
...
@@ -11031,7 +11158,7 @@ var serviceContext = (function () {
return page && page.$page.id
}
const eventNames$
2
= [
const eventNames$
3
= [
'canplay',
'play',
'pause',
...
...
@@ -11044,7 +11171,7 @@ var serviceContext = (function () {
'waiting'
];
const callbacks$5 = {};
eventNames$
2
.forEach(name => {
eventNames$
3
.forEach(name => {
callbacks$5[name] = [];
});
...
...
@@ -11163,7 +11290,7 @@ var serviceContext = (function () {
}
}
eventNames$
2
.forEach(item => {
eventNames$
3
.forEach(item => {
const name = item[0].toUpperCase() + item.substr(1);
BackgroundAudioManager.prototype[`on${name}`] = function (callback) {
callbacks$5[item].push(callback);
...
...
@@ -19064,7 +19191,7 @@ var serviceContext = (function () {
EditorContext: EditorContext
});
const eventNames$
3
= [
const eventNames$
4
= [
'canplay',
'play',
'pause',
...
...
@@ -19129,7 +19256,7 @@ var serviceContext = (function () {
this.id = id;
this._callbacks = {};
this._options = {};
eventNames$
3
.forEach(name => {
eventNames$
4
.forEach(name => {
this._callbacks[name.toLowerCase()] = [];
});
props$1.forEach(item => {
...
...
@@ -19189,7 +19316,7 @@ var serviceContext = (function () {
}
}
eventNames$
3
.forEach(item => {
eventNames$
4
.forEach(item => {
const name = item[0].toUpperCase() + item.substr(1);
item = item.toLowerCase();
InnerAudioContext.prototype[`on${name}`] = function (callback) {
...
...
@@ -20992,10 +21119,15 @@ var serviceContext = (function () {
});
});
let keyboardHeightChange = 0;
plus.globalEvent.addEventListener('KeyboardHeightChange', function (event) {
// 安卓设备首次获取高度为 0
if (keyboardHeightChange !== event.height) {
keyboardHeightChange = event.height;
publish('onKeyboardHeightChange', {
height: event.height
height: keyboardHeightChange
});
}
});
globalEvent.addEventListener('uistylechange', function (event) {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录