提交 cdf8cdc8 编写于 作者: Q qiang

Merge branch 'dev' into alpha

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