提交 839282b6 编写于 作者: Q qiang

Merge branch 'dev' into alpha

# Conflicts:
#	packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
#	src/core/service/plugins/app/index.js
......@@ -133,7 +133,9 @@ const device = [
'checkIsSoterEnrolledInDevice',
'startSoterAuthentication',
'onThemeChange',
'onUIStyleChange'
'onUIStyleChange',
'getSystemSetting',
'getAppAuthorizeSetting'
]
const keyboard = [
......@@ -267,7 +269,8 @@ const plugin = [
'invokePushCallback',
'getPushClientId',
'onPushMessage',
'offPushMessage',
'offPushMessage',
'createPushMessage'
]
const apis = [
......
const path = require('path')
const {
hasOwn
} = require('./util')
const {
getJson,
......@@ -98,6 +101,24 @@ function getH5Options (manifestJson) {
return h5
}
function isEnableUniPushV1 (manifestJson, platform) {
if (!manifestJson) {
manifestJson = getManifestJson()
}
if (isEnableUniPushV2(manifestJson, platform)) {
return false
}
if (platform === 'app-plus') {
const platformOptions = manifestJson[platform]
const sdkConfigs = platformOptions && platformOptions.distribute && platformOptions.distribute.sdkConfigs
const push = sdkConfigs && sdkConfigs.push
if (push && hasOwn(push, 'unipush')) {
return true
}
}
return false
}
function isEnableUniPushV2 (manifestJson, platform) {
if (!manifestJson) {
manifestJson = getManifestJson()
......@@ -121,14 +142,15 @@ function isUniPushOffline (manifestJson) {
const platformOptions = manifestJson['app-plus']
const sdkConfigs = platformOptions && platformOptions.distribute && platformOptions.distribute.sdkConfigs
const unipush = sdkConfigs && sdkConfigs.push && sdkConfigs.push.unipush
return unipush && unipush.offline === true
return unipush && unipush.offline === true
}
module.exports = {
getManifestJson,
parseManifestJson,
getNetworkTimeout,
getH5Options,
getH5Options,
isEnableUniPushV1,
isEnableUniPushV2,
isUniPushOffline
}
......@@ -168,7 +168,7 @@ module.exports = {
: 'import \'@dcloudio/uni-stat/dist/uni-stat.es.js\';'
},
getPlatformPush () {
if (process.env.UNI_PUSH_V2_OFFLINE) {
if (process.env.UNI_PUSH_V2_OFFLINE || process.env.UNI_PUSH_V1) {
return ';import \'@dcloudio/vue-cli-plugin-uni/packages/uni-push/dist/uni-push.plus.es.js\';'
} else if (process.env.UNI_PUSH_V2) {
return ';import \'@dcloudio/vue-cli-plugin-uni/packages/uni-push/dist/uni-push.es.js\';'
......@@ -199,4 +199,4 @@ module.exports = {
]
}
}
}
}
......@@ -20,7 +20,8 @@ module.exports = {
subPackages: true
},
copyWebpackOptions (platformOptions, vueOptions) {
const copyOptions = ['mycomponents']
const copyOptions = ['mycomponents', 'customize-tab-bar']
global.uniModules.forEach(module => {
copyOptions.push('uni_modules/' + module + '/mycomponents')
})
......
......@@ -12,10 +12,11 @@ module.exports = {
template: '.ttml'
},
subPackages: true,
project: 'project.lark.json'
project: 'project.lark.json',
darkmode: true
},
copyWebpackOptions (platformOptions, vueOptions) {
const copyOptions = ['ttcomponents']
const copyOptions = ['ttcomponents', 'theme.json']
global.uniModules.forEach(module => {
copyOptions.push('uni_modules/' + module + '/ttcomponents')
})
......
......@@ -1494,7 +1494,7 @@ function parse (
if(
(
!onRE.test(attr.name) &&
attr.name.indexOf('v-slot') !== 0
!slotRE.test(attr.name)
) && // fixed by xxxxxx 忽略 v-slot
attr.value === '' &&
(attr.start + attr.name.length) === attr.end
......
......@@ -102,7 +102,8 @@ const isAppComponents = filepath => {
const isCoreComponents = filepath => {
return path.extname(filepath) === '.vue' &&
(filepath.indexOf('/core/view/components/') === 0 || filepath.indexOf('/platforms/' + process.env.UNI_PLATFORM + '/view/components/') === 0)
(filepath.indexOf('/core/view/components/') === 0 || filepath.indexOf('/platforms/' + process.env.UNI_PLATFORM +
'/view/components/') === 0)
}
const isAppMixins = filepath => {
......@@ -149,8 +150,10 @@ function parseDeps (apis, manifest) {
}, {
test: isApiSubscribe,
paths: apiSubscribePaths
}]
for (const name of apis.values()) {
}]
// 固定顺序,避免因顺序的变化导致内容变化,从而生成不同的 hash 文件名
const apiNames = [...apis].sort()
for (const name of apiNames) {
const options = manifest[name]
if (Array.isArray(options)) {
apiPaths[name] = options[0]
......@@ -241,4 +244,4 @@ module.exports = function updateApis (apis = new Set(), userApis = new Set()) {
updateCoreComponents(coreComponentsPaths)
updateAppMixins(appMixinsPaths)
updateSystemRoutes(systemRoutesPaths)
}
}
......@@ -25,7 +25,7 @@ module.exports = function updateComponents (tags) {
autoloadTags.other[tagName].forEach(tag => tags.add(tag))
}
})
tags = [...tags]
tags = [...tags].sort() // 固定顺序,避免因顺序的变化导致内容变化,从而生成不同的 hash 文件名
const importsStr = tags.map(tagName => {
if (platformTags.indexOf(tagName) !== -1) {
return `import ${capitalize(camelize(tagName))} from 'uni-platform/view/components/${tagName}'`
......
......@@ -21,7 +21,8 @@ if (process.env.UNI_INPUT_DIR && process.env.UNI_INPUT_DIR.indexOf('./') === 0)
process.env.UNI_INPUT_DIR = process.env.UNI_INPUT_DIR || path.resolve(process.cwd(), defaultInputDir)
const {
getManifestJson,
getManifestJson,
isEnableUniPushV1,
isEnableUniPushV2,
isUniPushOffline
} = require('@dcloudio/uni-cli-shared/lib/manifest')
......@@ -47,6 +48,8 @@ if (isEnableUniPushV2(manifestJsonObj, process.env.UNI_PLATFORM)) {
if (process.env.UNI_PLATFORM === 'app-plus' && isUniPushOffline(manifestJsonObj)) {
process.env.UNI_PUSH_V2_OFFLINE = true
}
} else if (isEnableUniPushV1(manifestJsonObj, process.env.UNI_PLATFORM)) {
process.env.UNI_PUSH_V1 = true
}
// 初始化全局插件对象
......@@ -558,4 +561,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
module.exports = {
manifestPlatformOptions: platformOptions
}
}
......@@ -22,6 +22,7 @@ const alipayWindowMap = {
}
const alipayTabBarMap = {
customize: 'customize',
textColor: 'color',
selectedColor: 'selectedColor',
backgroundColor: 'backgroundColor',
......@@ -145,4 +146,4 @@ module.exports = {
parseTabBar,
trimMPJson,
NON_APP_JSON_KEYS
}
}
......@@ -556,7 +556,9 @@ export function handleEvent (event) {
}
const handler = handlerCtx[methodName]
if (!isFn(handler)) {
throw new Error(` _vm.${methodName} is not a function`)
const type = this.$vm.mpType === 'page' ? 'Page' : 'Component'
const path = this.route || this.is
throw new Error(`${type} "${path}" does not have a method "${methodName}"`)
}
if (isOnce) {
if (handler.once) {
......
......@@ -35,18 +35,6 @@ export function getEnterOptions () {
return enterOptions
}
export function initEnterOptions ({
path,
query,
referrerInfo
}) {
extend(enterOptions, {
path,
query: query || {},
referrerInfo: referrerInfo || {}
})
}
export function initLaunchOptions ({
path,
query,
......
......@@ -21,7 +21,7 @@
:disabled="disabled"
:type="inputType"
:maxlength="maxlength"
:step="step"
:step="_step"
:enterkeyhint="confirmType"
:pattern="type === 'number' ? '[0-9]*' : null"
class="uni-input-input"
......@@ -44,7 +44,7 @@
:readonly="disabled"
:type="inputType"
:maxlength="maxlength"
:step="step"
:step="_step"
class="uni-input-input"
@focus="($event) => $event.target.blur()"
>
......@@ -102,6 +102,10 @@ export default {
textContentType: {
type: String,
default: ''
},
step: {
type: String,
default: '0.000000000000000001'
}
},
data () {
......@@ -130,9 +134,9 @@ export default {
}
return this.password ? 'password' : type
},
step () {
_step () {
// 处理部分设备中无法输入小数点的问题
return ~NUMBER_TYPES.indexOf(this.type) ? '0.000000000000000001' : ''
return ~NUMBER_TYPES.indexOf(this.type) ? this.step : ''
},
autocomplete () {
const camelizeIndex = AUTOCOMPLETES.indexOf(this.textContentType)
......
export function getAppAuthorizeSetting () {
const { getAppAuthorizeSetting } = weex.requireModule('plus')
let appAuthorizeSetting = getAppAuthorizeSetting()
try {
if (typeof appAuthorizeSetting === 'string') { appAuthorizeSetting = JSON.parse(appAuthorizeSetting) }
} catch (error) { }
return appAuthorizeSetting
}
export function getSystemSetting () {
const { getSystemSetting } = weex.requireModule('plus')
let systemSetting = getSystemSetting()
try {
if (typeof systemSetting === 'string') { systemSetting = JSON.parse(systemSetting) }
} catch (error) { }
return systemSetting
}
......@@ -19,6 +19,8 @@ export * from './device/soter-authentication'
export * from './device/system'
export * from './device/vibrate'
export * from './device/get-window-info'
export * from './device/get-system-setting'
export * from './device/get-app-authorize-setting'
export * from './file/file'
export * from './file/open-document'
......
import {
hasOwn
} from 'uni-shared'
import {
invoke,
publish
} from '../../bridge'
import {
getAppAuthorizeSetting
} from '../device/get-app-authorize-setting'
let onPushing
let isListening = false
......@@ -63,3 +69,24 @@ export function offPush (params) {
errMsg: 'offPush:ok'
}
}
export function createPushMessage (params, callbackId) {
const setting = getAppAuthorizeSetting()
if (!hasOwn(setting, 'notificationAuthorized')) {
return invoke(callbackId, {
errMsg: 'createPushMessage:fail missing push module'
})
}
if (setting.notificationAuthorized !== 'authorized') {
return invoke(callbackId, {
errMsg: 'createPushMessage:fail ' + setting.notificationAuthorized
})
}
const options = Object.assign({}, params)
delete options.content
delete options.payload
plus.push.createMessage(params.content, params.payload, options)
invoke(callbackId, {
errMsg: 'createPushMessage:ok'
})
}
......@@ -17,10 +17,12 @@ export function onWebviewPopGesture (webview) {
setStatusBarStyle(popStartStatusBarStyle)
} else if (e.type === 'end' && e.result) {
const pages = getCurrentPages()
const len = pages.length
const page = pages[pages.length - 1]
page && page.$remove()
setStatusBarStyle()
if (page && isDirectPage(page)) {
// 仅当存在一个页面,且是直达页面时,才 reLaunch 首页
if (page && len === 1 && isDirectPage(page)) {
reLaunchEntryPage()
} else {
UniServiceJSBridge.emit('onAppRoute', {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册