提交 cdf8cdc8 编写于 作者: Q qiang

Merge branch 'dev' into alpha

...@@ -64,12 +64,7 @@ class AdBase { ...@@ -64,12 +64,7 @@ class AdBase {
detail: detail detail: detail
} }
if (this._retry && code === -5008) { if (code === -5008 && this._retry && this._retryCount < RETRY_COUNT) {
this._loadAd()
return
}
if (this._retry && this._retryCount < RETRY_COUNT) {
this._retryCount += 1 this._retryCount += 1
this._loadAd() this._loadAd()
return return
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
const UNI_PLUGINS = [{ const UNI_PLUGINS = [{
name: 'uni-ad', name: 'uni-ad',
version: '1.2.1', version: '1.3.0',
provider: 'wxf72d316417b6767f' provider: 'wxf72d316417b6767f'
}, },
{ {
name: 'coral-adv', name: 'coral-adv',
version: '1.0.24', version: '1.0.25',
provider: 'wx0e203209e27b1e66' provider: 'wx0e203209e27b1e66'
} }
] ]
......
import { isPlainObject } from 'uni-shared' import { isPlainObject, normalizeTitleColor } from 'uni-shared'
import { initNavigationBarI18n } from 'uni-helpers/i18n' import { initNavigationBarI18n } from 'uni-helpers/i18n'
...@@ -57,8 +57,7 @@ export function parseTitleNView (id, routeOptions) { ...@@ -57,8 +57,7 @@ export function parseTitleNView (id, routeOptions) {
autoBackButton: !routeOptions.meta.isQuit, autoBackButton: !routeOptions.meta.isQuit,
titleText: titleText:
titleImage === '' ? windowOptions.navigationBarTitleText || '' : '', titleImage === '' ? windowOptions.navigationBarTitleText || '' : '',
titleColor: titleColor: normalizeTitleColor(windowOptions.navigationBarTextStyle),
windowOptions.navigationBarTextStyle === 'white' ? '#ffffff' : '#000000',
type: titleNViewTypeList[transparentTitle], type: titleNViewTypeList[transparentTitle],
backgroundColor: backgroundColor:
/^#[a-z0-9]{6}$/i.test(navigationBarBackgroundColor) || /^#[a-z0-9]{6}$/i.test(navigationBarBackgroundColor) ||
......
import { isPlainObject, isStr } from './util' import { isPlainObject, isString } from './util'
const borderStyles = { const borderStyles = {
black: 'rgba(0,0,0,0.4)', black: 'rgba(0,0,0,0.4)',
...@@ -12,33 +12,54 @@ export function normalizeTabBarStyles (borderStyle) { ...@@ -12,33 +12,54 @@ export function normalizeTabBarStyles (borderStyle) {
return borderStyle return borderStyle
} }
export function normalizeTitleColor (titleColor) {
return titleColor === 'black' ? '#000000' : '#ffffff'
}
function resolveStringStyleItem (modeStyle, styleItem, key) {
if (isString(styleItem) && styleItem.startsWith('@')) {
const _key = styleItem.replace('@', '')
let _styleItem = modeStyle[_key] || styleItem
switch (key) {
case 'titleColor':
_styleItem = normalizeTitleColor(_styleItem)
break
case 'borderStyle':
_styleItem = normalizeTabBarStyles(_styleItem)
break
default:
break
}
return _styleItem
}
return styleItem
}
export function normalizeStyles (pageStyle, themeConfig = {}, mode = 'light') { export function normalizeStyles (pageStyle, themeConfig = {}, mode = 'light') {
const modeStyle = themeConfig[mode] const modeStyle = themeConfig[mode]
const styles = {} const styles = {}
if (!modeStyle) {
return pageStyle if (typeof modeStyle === 'undefined') return pageStyle
}
Object.keys(pageStyle).forEach((key) => { Object.keys(pageStyle).forEach(key => {
const styleItem = pageStyle[key] // Object Array String const styleItem = pageStyle[key] // Object Array String
styles[key] = (() => {
if (isPlainObject(styleItem)) { const parseStyleItem = () => {
return normalizeStyles(styleItem, themeConfig, mode) if (isPlainObject(styleItem)) { return normalizeStyles(styleItem, themeConfig, mode) }
} else if (Array.isArray(styleItem)) {
return styleItem.map((item) => isPlainObject(item) if (Array.isArray(styleItem)) {
? normalizeStyles(item, themeConfig, mode) return styleItem.map(item => {
: item) if (typeof item === 'object') { return normalizeStyles(item, themeConfig, mode) }
} else if (isStr(styleItem) && styleItem.startsWith('@')) { return resolveStringStyleItem(modeStyle, item)
const _key = styleItem.replace('@', '') })
let _styleItem = modeStyle[_key] || styleItem
switch (key) {
case 'borderStyle':
_styleItem = normalizeTabBarStyles(_styleItem)
break
}
return _styleItem
} }
return styleItem
})() return resolveStringStyleItem(modeStyle, styleItem, key)
}
styles[key] = parseStyleItem()
}) })
return styles return styles
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册