提交 b20b1709 编写于 作者: fxy060608's avatar fxy060608

Merge branch 'dev' of https://github.com/dcloudio/uni-app into dev-quickapp

...@@ -4037,7 +4037,6 @@ var serviceContext = (function () { ...@@ -4037,7 +4037,6 @@ var serviceContext = (function () {
var onBluetoothAdapterStateChange; var onBluetoothAdapterStateChange;
var onBluetoothDeviceFound; var onBluetoothDeviceFound;
var onBLEConnectionStateChange; var onBLEConnectionStateChange;
var onBLEConnectionStateChanged;
var onBLECharacteristicValueChange; var onBLECharacteristicValueChange;
function openBluetoothAdapter (data, callbackId) { function openBluetoothAdapter (data, callbackId) {
...@@ -4072,7 +4071,6 @@ var serviceContext = (function () { ...@@ -4072,7 +4071,6 @@ var serviceContext = (function () {
function createBLEConnection (data, callbackId) { function createBLEConnection (data, callbackId) {
onBLEConnectionStateChange = onBLEConnectionStateChange || bluetoothOn('onBLEConnectionStateChange'); onBLEConnectionStateChange = onBLEConnectionStateChange || bluetoothOn('onBLEConnectionStateChange');
onBLEConnectionStateChanged = onBLEConnectionStateChanged || bluetoothOn('onBLEConnectionStateChanged');
bluetoothExec('createBLEConnection', callbackId, data); bluetoothExec('createBLEConnection', callbackId, data);
} }
...@@ -5925,7 +5923,8 @@ var serviceContext = (function () { ...@@ -5925,7 +5923,8 @@ var serviceContext = (function () {
const camera = plus.camera.getCamera(); const camera = plus.camera.getCamera();
camera.captureImage(e => invokeChooseImage(callbackId, 'ok', sizeType, [e]), camera.captureImage(e => invokeChooseImage(callbackId, 'ok', sizeType, [e]),
e => invokeChooseImage(callbackId, 'fail', 1), { e => invokeChooseImage(callbackId, 'fail', 1), {
filename: TEMP_PATH + '/camera/' filename: TEMP_PATH + '/camera/',
resolution: 'high'
}); });
}; };
const openAlbum = function (callbackId, sizeType, count) { const openAlbum = function (callbackId, sizeType, count) {
...@@ -13016,6 +13015,17 @@ var serviceContext = (function () { ...@@ -13016,6 +13015,17 @@ var serviceContext = (function () {
}; };
} }
/**
* mpvue event
*/
function wrapperMPEvent (event) {
event.mp = Object.assign({
'@warning': 'mp is deprecated'
}, event);
event._processed = true;
return event
}
const isAndroid = plus.os.name.toLowerCase() === 'android'; const isAndroid = plus.os.name.toLowerCase() === 'android';
const FOCUS_TIMEOUT = isAndroid ? 300 : 700; const FOCUS_TIMEOUT = isAndroid ? 300 : 700;
const HIDE_TIMEOUT = isAndroid ? 800 : 300; const HIDE_TIMEOUT = isAndroid ? 800 : 300;
...@@ -13105,10 +13115,7 @@ var serviceContext = (function () { ...@@ -13105,10 +13115,7 @@ var serviceContext = (function () {
parseTargets(event); parseTargets(event);
event.preventDefault = noop; event.preventDefault = noop;
event.stopPropagation = noop; event.stopPropagation = noop;
event.mp = event; return wrapperMPEvent(event)
return Object.assign({
mp: event // mpvue
}, event)
} }
const handleVdData = { const handleVdData = {
......
...@@ -22,7 +22,7 @@ const { ...@@ -22,7 +22,7 @@ const {
} = require('./pages') } = require('./pages')
const { const {
md5, md5,
hasOwn, hasOwn,
hasModule, hasModule,
hashify, hashify,
...@@ -56,12 +56,13 @@ const { ...@@ -56,12 +56,13 @@ const {
htmlPreprocessOptions, htmlPreprocessOptions,
nvueJsPreprocessOptions, nvueJsPreprocessOptions,
nvueCssPreprocessOptions, nvueCssPreprocessOptions,
nvueHtmlPreprocessOptions nvueHtmlPreprocessOptions,
getPlatformGlobal
} = require('./platform') } = require('./platform')
module.exports = { module.exports = {
md5, md5,
tags, tags,
hasOwn, hasOwn,
getJson, getJson,
parseJson, parseJson,
...@@ -104,5 +105,6 @@ module.exports = { ...@@ -104,5 +105,6 @@ module.exports = {
htmlPreprocessOptions, htmlPreprocessOptions,
nvueJsPreprocessOptions, nvueJsPreprocessOptions,
nvueCssPreprocessOptions, nvueCssPreprocessOptions,
nvueHtmlPreprocessOptions nvueHtmlPreprocessOptions,
getPlatformGlobal
} }
此差异已折叠。
...@@ -6,10 +6,11 @@ import { ...@@ -6,10 +6,11 @@ import {
* mpvue event * mpvue event
*/ */
export function wrapperMPEvent (event) { export function wrapperMPEvent (event) {
return Object.assign({ event.mp = Object.assign({
mp: event, '@warning': 'mp is deprecated'
_processed: true
}, event) }, event)
event._processed = true
return event
} }
/** /**
* app-plus titleNView * app-plus titleNView
...@@ -48,4 +49,4 @@ export function mergeTitleNView (navigationBar, titleNView) { ...@@ -48,4 +49,4 @@ export function mergeTitleNView (navigationBar, titleNView) {
} }
} }
return navigationBar return navigationBar
} }
...@@ -291,6 +291,10 @@ function wrapper (event) { ...@@ -291,6 +291,10 @@ function wrapper (event) {
event.detail = {} event.detail = {}
} }
if (!('markerId' in event.detail) && 'markerId' in event) {
event.detail.markerId = event.markerId
}
if (__PLATFORM__ === 'mp-baidu') { // mp-baidu,checked=>value if (__PLATFORM__ === 'mp-baidu') { // mp-baidu,checked=>value
if ( if (
isPlainObject(event.detail) && isPlainObject(event.detail) &&
...@@ -485,18 +489,18 @@ export function handleEvent (event) { ...@@ -485,18 +489,18 @@ export function handleEvent (event) {
handlerCtx.$parent.$parent handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent handlerCtx = handlerCtx.$parent.$parent
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
processEventArgs( processEventArgs(
this.$vm, this.$vm,
event, event,
eventArray[1], eventArray[1],
eventArray[2], eventArray[2],
isCustom, isCustom,
methodName methodName
)) ))
return return
} }
const handler = handlerCtx[methodName] const handler = handlerCtx[methodName]
if (!isFn(handler)) { if (!isFn(handler)) {
...@@ -528,4 +532,4 @@ export function handleEvent (event) { ...@@ -528,4 +532,4 @@ export function handleEvent (event) {
) { ) {
return ret[0] return ret[0]
} }
} }
...@@ -54,7 +54,6 @@ function bluetoothOn (method, beforeSuccess) { ...@@ -54,7 +54,6 @@ function bluetoothOn (method, beforeSuccess) {
var onBluetoothAdapterStateChange var onBluetoothAdapterStateChange
var onBluetoothDeviceFound var onBluetoothDeviceFound
var onBLEConnectionStateChange var onBLEConnectionStateChange
var onBLEConnectionStateChanged
var onBLECharacteristicValueChange var onBLECharacteristicValueChange
export function openBluetoothAdapter (data, callbackId) { export function openBluetoothAdapter (data, callbackId) {
...@@ -89,7 +88,6 @@ export function getConnectedBluetoothDevices (data, callbackId) { ...@@ -89,7 +88,6 @@ export function getConnectedBluetoothDevices (data, callbackId) {
export function createBLEConnection (data, callbackId) { export function createBLEConnection (data, callbackId) {
onBLEConnectionStateChange = onBLEConnectionStateChange || bluetoothOn('onBLEConnectionStateChange') onBLEConnectionStateChange = onBLEConnectionStateChange || bluetoothOn('onBLEConnectionStateChange')
onBLEConnectionStateChanged = onBLEConnectionStateChanged || bluetoothOn('onBLEConnectionStateChanged')
bluetoothExec('createBLEConnection', callbackId, data) bluetoothExec('createBLEConnection', callbackId, data)
} }
......
...@@ -97,7 +97,8 @@ const openCamera = function (callbackId, sizeType) { ...@@ -97,7 +97,8 @@ const openCamera = function (callbackId, sizeType) {
const camera = plus.camera.getCamera() const camera = plus.camera.getCamera()
camera.captureImage(e => invokeChooseImage(callbackId, 'ok', sizeType, [e]), camera.captureImage(e => invokeChooseImage(callbackId, 'ok', sizeType, [e]),
e => invokeChooseImage(callbackId, 'fail', 1), { e => invokeChooseImage(callbackId, 'fail', 1), {
filename: TEMP_PATH + '/camera/' filename: TEMP_PATH + '/camera/',
resolution: 'high'
}) })
} }
const openAlbum = function (callbackId, sizeType, count) { const openAlbum = function (callbackId, sizeType, count) {
......
...@@ -3,6 +3,10 @@ import { ...@@ -3,6 +3,10 @@ import {
noop noop
} from 'uni-shared' } from 'uni-shared'
import {
wrapperMPEvent
} from 'uni-helpers/patch'
import { import {
VD_SYNC, VD_SYNC,
UI_EVENT, UI_EVENT,
...@@ -55,10 +59,7 @@ function wrapperEvent (event) { ...@@ -55,10 +59,7 @@ function wrapperEvent (event) {
parseTargets(event) parseTargets(event)
event.preventDefault = noop event.preventDefault = noop
event.stopPropagation = noop event.stopPropagation = noop
event.mp = event return wrapperMPEvent(event)
return Object.assign({
mp: event // mpvue
}, event)
} }
const handleVdData = { const handleVdData = {
......
import { import {
isFn, isFn,
cached, cached,
camelize camelize,
hasOwn
} from 'uni-shared' } from 'uni-shared'
import { import {
...@@ -58,6 +59,12 @@ export function initSpecialMethods (mpInstance) { ...@@ -58,6 +59,12 @@ export function initSpecialMethods (mpInstance) {
specialMethods.forEach(method => { specialMethods.forEach(method => {
if (isFn(mpInstance.$vm[method])) { if (isFn(mpInstance.$vm[method])) {
mpInstance[method] = function (event) { mpInstance[method] = function (event) {
if (!hasOwn(event, 'detail')) {
event.detail = {}
}
if (!('markerId' in event.detail) && 'markerId' in event) {
event.detail.markerId = event.markerId
}
// TODO normalizeEvent // TODO normalizeEvent
mpInstance.$vm[method](event) mpInstance.$vm[method](event)
} }
...@@ -179,4 +186,4 @@ export const handleLink = (function () { ...@@ -179,4 +186,4 @@ export const handleLink = (function () {
// 支付宝通过 didMount 来实现,先子后父,故等父 ready 之后,统一初始化 // 支付宝通过 didMount 来实现,先子后父,故等父 ready 之后,统一初始化
(this._$childVues || (this._$childVues = [])).unshift(detail) (this._$childVues || (this._$childVues = [])).unshift(detail)
} }
})() })()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册