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

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

......@@ -100,7 +100,7 @@ const plugins = [
new WebpackAppPlusNVuePlugin()
]
const excludeModuleReg = /node_modules(?!(\/|\\).*(weex).*)/
// const excludeModuleReg = /node_modules(?!(\/|\\).*(weex).*)/
const rules = [{
test: path.resolve(process.env.UNI_INPUT_DIR, 'pages.json'),
......@@ -122,10 +122,10 @@ const rules = [{
}
},
jsPreprocessorLoader
],
exclude (modulePath) {
return excludeModuleReg.test(modulePath) && modulePath.indexOf('@dcloudio') === -1
}
]
// exclude (modulePath) { // nvue js均提供babel,否则还得提供transpileDependencies配置
// return excludeModuleReg.test(modulePath) && modulePath.indexOf('@dcloudio') === -1
// }
},
{
test: [/\.nvue(\?[^?]+)?$/, /\.vue(\?[^?]+)?$/],
......
......@@ -5,6 +5,14 @@ const {
sassLoaderVersion
} = require('@dcloudio/uni-cli-shared/lib/scss')
const isWin = /^win/.test(process.platform)
function genTranspileDepRegex (depPath) {
return new RegExp(isWin
? depPath.replace(/\\/g, '\\\\') // double escape for windows style path
: depPath)
}
module.exports = function initOptions (options) {
const {
getPlatformScss,
......@@ -16,17 +24,11 @@ module.exports = function initOptions (options) {
}
// 增加 src/node_modules 解析
options.transpileDependencies.push(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules'))
options.transpileDependencies.push(genTranspileDepRegex(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules')))
options.transpileDependencies.push('@dcloudio/uni-' + process.env.UNI_PLATFORM)
options.transpileDependencies.push('@dcloudio/uni-stat')
// mp runtime
options.transpileDependencies.push('@dcloudio/uni-mp-weixin/dist/mp.js')
// wxs
options.transpileDependencies.push('@dcloudio/uni-mp-weixin/dist/wxs.js')
if (process.env.UNI_PLATFORM === 'app-plus') {
options.transpileDependencies.push('format-log.js')
}
if (process.env.UNI_PLATFORM === 'h5') { // h5 dev 用到了这两个,需要 babel
options.transpileDependencies.push('ansi-regex')
......
......@@ -18,17 +18,13 @@ UniServiceJSBridge.subscribe('onMapMethodCallback', ({
callback.invoke(callbackId, data)
})
const methods = ['getCenterLocation', 'getScale', 'getRegion', 'includePoints', 'translateMarker']
const methods = ['getCenterLocation', 'moveToLocation', 'getScale', 'getRegion', 'includePoints', 'translateMarker']
export class MapContext {
constructor (id, pageVm) {
this.id = id
this.pageVm = pageVm
}
moveToLocation () {
operateMapPlayer(this.id, this.pageVm, 'moveToLocation')
}
}
MapContext.prototype.$getAppMap = function () {
......
......@@ -8,11 +8,7 @@ const eventNames = [
const ERROR_CODE_LIST = [-5001, -5002, -5003, -5004, -5005, -5006]
class RewardedVideoAd {
constructor (adpid) {
this._options = {
adpid: adpid
}
constructor (options = {}) {
const _callbacks = this._callbacks = {}
eventNames.forEach(item => {
_callbacks[item] = []
......@@ -26,7 +22,7 @@ class RewardedVideoAd {
this._adError = ''
this._loadPromiseResolve = null
this._loadPromiseReject = null
const rewardAd = this._rewardAd = plus.ad.createRewardedVideoAd(this._options)
const rewardAd = this._rewardAd = plus.ad.createRewardedVideoAd(options)
rewardAd.onLoad((e) => {
this._isLoad = true
this._dispatchEvent('load', {})
......@@ -85,8 +81,6 @@ class RewardedVideoAd {
}
}
export function createRewardedVideoAd ({
adpid = ''
} = {}) {
return new RewardedVideoAd(adpid)
export function createRewardedVideoAd (options) {
return new RewardedVideoAd(options)
}
......@@ -229,8 +229,11 @@ export default {
}
this.map && this[type](data)
},
moveToLocation (data) {
this.map.setCenter(new plus.maps.Point(this.longitude, this.latitude))
moveToLocation ({ callbackId, longitude, latitude }) {
this.map.setCenter(new plus.maps.Point(longitude || this.longitude, latitude || this.latitude))
this._publishHandler(callbackId, {
errMsg: 'moveToLocation:ok'
})
},
getCenterLocation ({ callbackId }) {
const center = this.map.getCenter()
......
......@@ -178,8 +178,8 @@ export default {
}
})
events.forEach(key => {
video.addEventListener(key, (data = {}) => {
this.$trigger(key, {}, data)
video.addEventListener(key, (e) => {
this.$trigger(key, {}, { ...e.detail })
})
})
},
......
......@@ -348,10 +348,12 @@ export default {
})
})
break
case 'moveToLocation':
var locationPosition = this._locationPosition
case 'moveToLocation':
const { latitude, longitude } = data
var locationPosition = (latitude && longitude) ? new maps.LatLng(latitude, longitude) : this._locationPosition
if (locationPosition) {
this._map.setCenter(locationPosition)
this._map.setCenter(locationPosition)
callback({})
}
break
case 'translateMarker':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册