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

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

......@@ -6070,7 +6070,7 @@ function createPatchFunction (backend) {
function removeAndInvokeRemoveHook (vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) {
var i;
var i, children;
var listeners = cbs.remove.length + 1;
if (isDef(rm)) {
// we have a recursively passed down rm callback
......@@ -6083,6 +6083,14 @@ function createPatchFunction (backend) {
// recursively invoke hooks on child component root node
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) {
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) {
if (children[i].tag) {
removeAndInvokeRemoveHook(children[i]);
}
}
}
for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm);
......
......@@ -5288,7 +5288,7 @@ function createPatchFunction (backend) {
function removeAndInvokeRemoveHook (vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) {
var i;
var i, children;
var listeners = cbs.remove.length + 1;
if (isDef(rm)) {
// we have a recursively passed down rm callback
......@@ -5301,6 +5301,14 @@ function createPatchFunction (backend) {
// recursively invoke hooks on child component root node
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm);
} else if (isDef(children = vnode.children)) {
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for (i = 0; i < children.length; i++) {
if (children[i].tag) {
removeAndInvokeRemoveHook(children[i]);
}
}
}
for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm);
......
......@@ -2,7 +2,7 @@
* wxs getRegExp
*/
function getRegExp () {
const args = Array.prototype.slice.call(arguments);
var args = Array.prototype.slice.call(arguments);
args.unshift(RegExp);
return new (Function.prototype.bind.apply(RegExp, args))()
}
......@@ -11,7 +11,7 @@ function getRegExp () {
* wxs getDate
*/
function getDate () {
const args = Array.prototype.slice.call(arguments);
var args = Array.prototype.slice.call(arguments);
args.unshift(Date);
return new (Function.prototype.bind.apply(Date, args))()
}
......
......@@ -132,7 +132,7 @@ const v3 = {
return {
devtool,
mode: process.env.NODE_ENV,
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
externals: {
vue: 'Vue'
},
......
......@@ -268,8 +268,8 @@ if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化
const warningMsg =
usingComponentsAbsent
? `该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
: `uni-app于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
? `该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
: `uni-app于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
const needWarning = !platformOptions.usingComponents || usingComponentsAbsent
let hasNVue = false
......
......@@ -104,7 +104,7 @@ module.exports = {
return {
devtool,
mode: process.env.NODE_ENV,
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry () {
return process.UNI_ENTRY
},
......
......@@ -41,7 +41,7 @@ var isReady=false;var onReadyCallbacks=[];
var __uniConfig = ${JSON.stringify(appJson, null)};
var __uniRoutes = ${JSON.stringify(__uniRoutes)};
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes}}}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,window:void 0}}}});
`
}
}
......@@ -2,7 +2,7 @@
* wxs getRegExp
*/
export function getRegExp () {
const args = Array.prototype.slice.call(arguments)
var args = Array.prototype.slice.call(arguments)
args.unshift(RegExp)
return new (Function.prototype.bind.apply(RegExp, args))()
}
......@@ -11,7 +11,7 @@ export function getRegExp () {
* wxs getDate
*/
export function getDate () {
const args = Array.prototype.slice.call(arguments)
var args = Array.prototype.slice.call(arguments)
args.unshift(Date)
return new (Function.prototype.bind.apply(Date, args))()
}
......@@ -121,8 +121,12 @@ export default {
method(data)
}
},
_resize () {
wrapper(this.$refs.canvas)
_resize () {
var canvas = this.$refs.canvas
var context = canvas.getContext('2d')
var imageData = context.getImageData(0, 0, canvas.width, canvas.height)
wrapper(this.$refs.canvas)
context.putImageData(imageData, 0, 0)
},
_touchmove (event) {
event.preventDefault()
......
......@@ -198,12 +198,12 @@ const protocols = { // 需要做转换的 API 列表
returnValue: {
apFilePath: 'tempFilePath'
}
},
chooseVideo: {
// 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
returnValue: {
apFilePath: 'tempFilePath'
}
},
chooseVideo: {
// 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
returnValue: {
apFilePath: 'tempFilePath'
}
},
connectSocket: {
args: {
......@@ -287,22 +287,22 @@ const protocols = { // 需要做转换的 API 列表
},
scanCode: {
name: 'scan',
args (fromArgs) {
if (fromArgs.scanType === 'qrCode') {
fromArgs.type = 'qr'
args (fromArgs) {
if (fromArgs.scanType === 'qrCode') {
fromArgs.type = 'qr'
return {
onlyFromCamera: 'hideAlbum'
}
} else if (fromArgs.scanType === 'barCode') {
fromArgs.type = 'bar'
return {
onlyFromCamera: 'hideAlbum'
}
} else if (fromArgs.scanType === 'barCode') {
fromArgs.type = 'bar'
onlyFromCamera: 'hideAlbum'
}
} else {
return {
onlyFromCamera: 'hideAlbum'
}
} else {
return {
scanType: false,
onlyFromCamera: 'hideAlbum'
}
scanType: false,
onlyFromCamera: 'hideAlbum'
}
}
},
returnValue: {
......@@ -333,8 +333,16 @@ const protocols = { // 需要做转换的 API 列表
}
},
getUserInfo: {
name: 'getAuthUserInfo',
name: my.canIUse('getOpenUserInfo') ? 'getOpenUserInfo' : 'getAuthUserInfo',
returnValue (result) {
if (my.canIUse('getOpenUserInfo')) {
let response = {}
try {
response = JSON.parse(result.response).response
} catch (e) {}
result.nickName = response.nickName
result.avatar = response.avatar
}
result.userInfo = {
nickName: result.nickName,
avatarUrl: result.avatar
......@@ -353,18 +361,18 @@ const protocols = { // 需要做转换的 API 列表
item.uuid = item.serviceId
})
}
},
createBLEConnection: {
name: 'connectBLEDevice',
args: {
timeout: false
}
},
closeBLEConnection: {
name: 'disconnectBLEDevice'
},
onBLEConnectionStateChange: {
name: 'onBLEConnectionStateChanged'
},
createBLEConnection: {
name: 'connectBLEDevice',
args: {
timeout: false
}
},
closeBLEConnection: {
name: 'disconnectBLEDevice'
},
onBLEConnectionStateChange: {
name: 'onBLEConnectionStateChanged'
},
makePhoneCall: {
args: {
......@@ -396,35 +404,35 @@ const protocols = { // 需要做转换的 API 列表
returnValue: {
brightness: 'value'
}
},
showShareMenu: {
name: 'showSharePanel'
},
hideHomeButton: {
name: 'hideBackHome'
},
saveImageToPhotosAlbum: {
name: 'saveImage',
args: {
filePath: 'url'
}
},
saveVideoToPhotosAlbum: {
args: {
filePath: 'src'
}
},
chooseAddress: {
name: 'getAddress',
returnValue (result) {
let info = result.result || {}
result.userName = info.fullname
result.provinceName = info.prov
result.cityName = info.city
result.detailInfo = info.address
result.telNumber = info.mobilePhone
result.errMsg = result.resultStatus
}
},
showShareMenu: {
name: 'showSharePanel'
},
hideHomeButton: {
name: 'hideBackHome'
},
saveImageToPhotosAlbum: {
name: 'saveImage',
args: {
filePath: 'url'
}
},
saveVideoToPhotosAlbum: {
args: {
filePath: 'src'
}
},
chooseAddress: {
name: 'getAddress',
returnValue (result) {
let info = result.result || {}
result.userName = info.fullname
result.provinceName = info.prov
result.cityName = info.city
result.detailInfo = info.address
result.telNumber = info.mobilePhone
result.errMsg = result.resultStatus
}
}
}
......
......@@ -23,10 +23,11 @@ export default function parseBaseComponent (vueComponentOptions, {
const options = {
multipleSlots: true,
addGlobalClass: true
addGlobalClass: true,
...(vueOptions.options || {})
}
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') {
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') {
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) {
Object.assign(options, vueOptions['mp-weixin']['options'])
......@@ -109,4 +110,4 @@ export default function parseBaseComponent (vueComponentOptions, {
return componentOptions
}
return [componentOptions, VueComponent]
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册