@dcloudio/uni-cli-shared 2.0.0 → 2.0.1-alpha-32920211110001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,10 +25,16 @@ const pageMode = {
25
25
  add: 'add',
26
26
  replace: 'replace'
27
27
  }
28
+ const loadMode = {
29
+ auto: 'auto',
30
+ onready: 'onready',
31
+ manual: 'manual'
32
+ }
28
33
 
29
34
  const attrs = [
30
35
  'pageCurrent',
31
36
  'pageSize',
37
+ 'spaceInfo',
32
38
  'collection',
33
39
  'action',
34
40
  'field',
@@ -49,8 +55,14 @@ export default {
49
55
  return {}
50
56
  }
51
57
  },
58
+ spaceInfo: {
59
+ type: Object,
60
+ default () {
61
+ return {}
62
+ }
63
+ },
52
64
  collection: {
53
- type: String,
65
+ type: [String, Array],
54
66
  default: ''
55
67
  },
56
68
  action: {
@@ -90,7 +102,7 @@ export default {
90
102
  default: false
91
103
  },
92
104
  gettree: {
93
- type: [Boolean, String],
105
+ type: [Boolean, String, Object],
94
106
  default: false
95
107
  },
96
108
  gettreepath: {
@@ -117,6 +129,18 @@ export default {
117
129
  type: [Boolean, String],
118
130
  default: false
119
131
  },
132
+ pageIndistinct: {
133
+ type: [Boolean, String],
134
+ default: false
135
+ },
136
+ foreignKey: {
137
+ type: String,
138
+ default: ''
139
+ },
140
+ loadtime: {
141
+ type: String,
142
+ default: 'auto'
143
+ },
120
144
  manual: {
121
145
  type: Boolean,
122
146
  default: false
@@ -131,6 +155,21 @@ export default {
131
155
  errorMessage: ''
132
156
  }
133
157
  },
158
+ computed: {
159
+ collectionArgs () {
160
+ return Array.isArray(this.collection) ? this.collection : [this.collection]
161
+ },
162
+ isLookup () {
163
+ return (Array.isArray(this.collection) && this.collection.length > 1) || (typeof this.collection === 'string' && this.collection.indexOf(',') > -1)
164
+ },
165
+ mainCollection () {
166
+ if (typeof this.collection === 'string') {
167
+ return this.collection.split(',')[0]
168
+ }
169
+ const mainQuery = JSON.parse(JSON.stringify(this.collection[0]))
170
+ return mainQuery.$db[0].$param[0]
171
+ }
172
+ },
134
173
  created () {
135
174
  this._isEnded = false
136
175
  this.paginationInternal = {
@@ -147,6 +186,12 @@ export default {
147
186
  return al
148
187
  }, (newValue, oldValue) => {
149
188
  this.paginationInternal.size = this.pageSize
189
+ if (newValue[0] !== oldValue[0]) {
190
+ this.paginationInternal.current = this.pageCurrent
191
+ }
192
+ if (this.loadtime === loadMode.manual) {
193
+ return
194
+ }
150
195
 
151
196
  let needReset = false
152
197
  for (let i = 2; i < newValue.length; i++) {
@@ -159,9 +204,6 @@ export default {
159
204
  this.clear()
160
205
  this.reset()
161
206
  }
162
- if (newValue[0] !== oldValue[0]) {
163
- this.paginationInternal.current = this.pageCurrent
164
- }
165
207
 
166
208
  this._execLoadData()
167
209
  })
@@ -182,7 +224,7 @@ export default {
182
224
 
183
225
  // #ifdef MP-TOUTIAO
184
226
  let changeName
185
- const events = this.$scope.dataset.eventOpts
227
+ const events = this.$scope.dataset.eventOpts || []
186
228
  for (var i = 0; i < events.length; i++) {
187
229
  const event = events[i]
188
230
  if (event[0].includes('^load')) {
@@ -206,7 +248,7 @@ export default {
206
248
  }
207
249
  // #endif
208
250
 
209
- if (!this.manual) {
251
+ if (!this.manual && this.loadtime === loadMode.auto) {
210
252
  this.loadData()
211
253
  }
212
254
  },
@@ -288,12 +330,12 @@ export default {
288
330
  })
289
331
  }
290
332
  /* eslint-disable no-undef */
291
- let db = uniCloud.database()
333
+ let db = uniCloud.database(this.spaceInfo)
292
334
  if (action) {
293
335
  db = db.action(action)
294
336
  }
295
337
 
296
- db.collection(this.collection).add(value).then((res) => {
338
+ db.collection(this.mainCollection).add(value).then((res) => {
297
339
  success && success(res)
298
340
  if (showToast) {
299
341
  uni.showToast({
@@ -362,12 +404,12 @@ export default {
362
404
  })
363
405
  }
364
406
  /* eslint-disable no-undef */
365
- let db = uniCloud.database()
407
+ let db = uniCloud.database(this.spaceInfo)
366
408
  if (action) {
367
409
  db = db.action(action)
368
410
  }
369
411
 
370
- return db.collection(this.collection).doc(id).update(value).then((res) => {
412
+ return db.collection(this.mainCollection).doc(id).update(value).then((res) => {
371
413
  success && success(res)
372
414
  if (showToast) {
373
415
  uni.showToast({
@@ -389,71 +431,15 @@ export default {
389
431
  complete && complete()
390
432
  })
391
433
  },
392
- _execLoadData (callback, clear) {
393
- if (this.loading) {
394
- return
395
- }
396
- this.loading = true
397
- this.errorMessage = ''
398
-
399
- this._getExec().then((res) => {
400
- this.loading = false
401
- const {
402
- data,
403
- count
404
- } = res.result
405
- this._isEnded = data.length < this.pageSize
406
- this.hasMore = !this._isEnded
407
-
408
- const data2 = this.getone ? (data.length ? data[0] : undefined) : data
409
-
410
- if (this.getcount) {
411
- this.paginationInternal.count = count
412
- }
413
-
414
- callback && callback(data2, this._isEnded, this.paginationInternal)
415
- this._dispatchEvent(events.load, data2)
416
-
417
- if (this.getone || this.pageData === pageMode.replace) {
418
- this.dataList = data2
419
- } else {
420
- if (clear) {
421
- this.dataList = data2
422
- } else {
423
- this.dataList.push(...data2)
424
- }
425
- }
426
-
427
- // #ifdef H5
428
- if (process.env.NODE_ENV === 'development') {
429
- this._debugDataList.length = 0
430
- const formatData = JSON.parse(JSON.stringify(this.dataList))
431
- if (Array.isArray(this.dataList)) {
432
- this._debugDataList.push(...formatData)
433
- } else {
434
- this._debugDataList.push(formatData)
435
- }
436
- }
437
- // #endif
438
- }).catch((err) => {
439
- this.loading = false
440
- this.errorMessage = err
441
- callback && callback()
442
- this.$emit(events.error, err)
443
- if (process.env.NODE_ENV === 'development') {
444
- console.error(err)
445
- }
446
- })
447
- },
448
- _getExec () {
434
+ getTemp (isTemp = true) {
449
435
  /* eslint-disable no-undef */
450
- let db = uniCloud.database()
436
+ let db = uniCloud.database(this.spaceInfo)
451
437
 
452
438
  if (this.action) {
453
439
  db = db.action(this.action)
454
440
  }
455
441
 
456
- db = db.collection(this.collection)
442
+ db = db.collection(...this.collectionArgs)
457
443
 
458
444
  if (!(!this.where || !Object.keys(this.where).length)) {
459
445
  db = db.where(this.where)
@@ -461,6 +447,9 @@ export default {
461
447
  if (this.field) {
462
448
  db = db.field(this.field)
463
449
  }
450
+ if (this.foreignKey) {
451
+ db = db.foreignKey(this.foreignKey)
452
+ }
464
453
  if (this.groupby) {
465
454
  db = db.groupBy(this.groupby)
466
455
  }
@@ -492,10 +481,89 @@ export default {
492
481
  if (this.gettreepath) {
493
482
  getOptions.getTreePath = treeOptions
494
483
  }
495
- db = db.skip(size * (current - 1)).limit(size).get(getOptions)
484
+ db = db.skip(size * (current - 1)).limit(size)
485
+
486
+ if (isTemp) {
487
+ db = db.getTemp(getOptions)
488
+ db.udb = this
489
+ } else {
490
+ db = db.get(getOptions)
491
+ }
496
492
 
497
493
  return db
498
494
  },
495
+ setResult (result) {
496
+ if (result.code === 0) {
497
+ this._execLoadDataSuccess(result)
498
+ } else {
499
+ this._execLoadDataFail(new Error(result.message))
500
+ }
501
+ },
502
+ _execLoadData (callback, clear) {
503
+ if (this.loading) {
504
+ return
505
+ }
506
+ this.loading = true
507
+ this.errorMessage = ''
508
+
509
+ this._getExec().then((res) => {
510
+ this.loading = false
511
+ this._execLoadDataSuccess(res.result, callback, clear)
512
+
513
+ // #ifdef H5
514
+ if (process.env.NODE_ENV === 'development') {
515
+ this._debugDataList.length = 0
516
+ const formatData = JSON.parse(JSON.stringify(this.dataList))
517
+ if (Array.isArray(this.dataList)) {
518
+ this._debugDataList.push(...formatData)
519
+ } else {
520
+ this._debugDataList.push(formatData)
521
+ }
522
+ }
523
+ // #endif
524
+ }).catch((err) => {
525
+ this.loading = false
526
+ this._execLoadDataFail(err, callback)
527
+ })
528
+ },
529
+ _execLoadDataSuccess (result, callback, clear) {
530
+ const {
531
+ data,
532
+ count
533
+ } = result
534
+ this._isEnded = count !== undefined ? (this.paginationInternal.current * this.paginationInternal.size >= count) : (data.length < this.pageSize)
535
+ this.hasMore = !this._isEnded
536
+
537
+ const data2 = this.getone ? (data.length ? data[0] : undefined) : data
538
+
539
+ if (this.getcount) {
540
+ this.paginationInternal.count = count
541
+ }
542
+
543
+ callback && callback(data2, this._isEnded, this.paginationInternal)
544
+ this._dispatchEvent(events.load, data2)
545
+
546
+ if (this.getone || this.pageData === pageMode.replace) {
547
+ this.dataList = data2
548
+ } else {
549
+ if (clear) {
550
+ this.dataList = data2
551
+ } else {
552
+ this.dataList.push(...data2)
553
+ }
554
+ }
555
+ },
556
+ _execLoadDataFail (err, callback) {
557
+ this.errorMessage = err
558
+ callback && callback()
559
+ this.$emit(events.error, err)
560
+ if (process.env.NODE_ENV === 'development') {
561
+ console.error(err)
562
+ }
563
+ },
564
+ _getExec () {
565
+ return this.getTemp(false)
566
+ },
499
567
  _execRemove (id, action, success, fail, complete, needConfirm, needLoading, loadingTitle) {
500
568
  if (!this.collection || !id) {
501
569
  return
@@ -514,7 +582,7 @@ export default {
514
582
  }
515
583
 
516
584
  /* eslint-disable no-undef */
517
- const db = uniCloud.database()
585
+ const db = uniCloud.database(this.spaceInfo)
518
586
  const dbCmd = db.command
519
587
 
520
588
  let exec = db
@@ -522,7 +590,7 @@ export default {
522
590
  exec = exec.action(action)
523
591
  }
524
592
 
525
- exec.collection(this.collection).where({
593
+ exec.collection(this.mainCollection).where({
526
594
  _id: dbCmd.in(ids)
527
595
  }).remove().then((res) => {
528
596
  success && success(res.result)
@@ -0,0 +1,17 @@
1
+ const path = require('path')
2
+
3
+ const isWin = /^win/.test(process.platform)
4
+
5
+ const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
6
+
7
+ module.exports = {
8
+ loader: 'file-loader',
9
+ options: {
10
+ publicPath (url, resourcePath, context) {
11
+ return '/' + normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
12
+ },
13
+ outputPath (url, resourcePath, context) {
14
+ return normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
15
+ }
16
+ }
17
+ }
package/lib/i18n.js ADDED
@@ -0,0 +1,99 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const {
4
+ parseJson
5
+ } = require('./json')
6
+ const {
7
+ getManifestJson
8
+ } = require('./manifest')
9
+
10
+ const delimiters = ['%', '%']
11
+
12
+ function initI18nOptions (
13
+ platform,
14
+ inputDir,
15
+ warning = false,
16
+ withMessages = true
17
+ ) {
18
+ const locales = initLocales(path.resolve(inputDir, 'locale'), withMessages)
19
+ if (!Object.keys(locales).length) {
20
+ return
21
+ }
22
+ const manifestJson = getManifestJson()
23
+ const fallbackLocale = manifestJson.fallbackLocale || manifestJson.locale
24
+ const locale = resolveI18nLocale(
25
+ platform,
26
+ Object.keys(locales),
27
+ fallbackLocale
28
+ )
29
+ if (warning) {
30
+ if (!fallbackLocale) {
31
+ console.warn()
32
+ } else if (locale !== fallbackLocale) {
33
+ console.warn()
34
+ }
35
+ }
36
+ return {
37
+ locale,
38
+ locales,
39
+ delimiters
40
+ }
41
+ }
42
+
43
+ const localeJsonRE = /uni-app.*.json/
44
+
45
+ function isUniAppLocaleFile (filepath) {
46
+ if (!filepath) {
47
+ return false
48
+ }
49
+ return localeJsonRE.test(path.basename(filepath))
50
+ }
51
+
52
+ function parseLocaleJson (filepath) {
53
+ let jsonObj = parseJson(fs.readFileSync(filepath, 'utf8'))
54
+ if (isUniAppLocaleFile(filepath)) {
55
+ jsonObj = jsonObj.common || {}
56
+ }
57
+ return jsonObj
58
+ }
59
+
60
+ function initLocales (dir, withMessages = true) {
61
+ if (!fs.existsSync(dir)) {
62
+ return {}
63
+ }
64
+ return fs.readdirSync(dir).reduce((res, filename) => {
65
+ if (path.extname(filename) === '.json') {
66
+ const locale = path
67
+ .basename(filename)
68
+ .replace(/(uni-app.)?(.*).json/, '$2')
69
+ if (withMessages) {
70
+ Object.assign(
71
+ res[locale] || (res[locale] = {}),
72
+ parseLocaleJson(path.join(dir, filename))
73
+ )
74
+ } else {
75
+ res[locale] = {}
76
+ }
77
+ }
78
+ return res
79
+ }, {})
80
+ }
81
+
82
+ function resolveI18nLocale (platfrom, locales, locale) {
83
+ if (locale && locales.includes(locale)) {
84
+ return locale
85
+ }
86
+ const defaultLocales = ['zh-Hans', 'zh-Hant']
87
+ if (platfrom === 'app' || platfrom === 'h5') {
88
+ defaultLocales.unshift('en')
89
+ } else {
90
+ // 小程序
91
+ defaultLocales.push('en')
92
+ }
93
+ return defaultLocales.find(locale => locales.includes(locale)) || locales[0]
94
+ }
95
+
96
+ module.exports = {
97
+ initLocales,
98
+ initI18nOptions
99
+ }
package/lib/json.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
3
  const stripJsonComments = require('strip-json-comments')
4
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
4
5
 
5
6
  function parseJson (content, preprocess = false) {
6
7
  if (typeof content === 'string') {
@@ -13,11 +14,11 @@ function parseJson (content, preprocess = false) {
13
14
  type: jsPreprocessOptions.type
14
15
  })
15
16
  }
16
-
17
- try {
18
- content = JSON.parse(stripJsonComments(content))
19
- } catch (e) {
20
- throw new Error('uni-app-compiler: ' + e.message)
17
+
18
+ try {
19
+ content = JSON.parse(stripJsonComments(content))
20
+ } catch (e) {
21
+ throw new Error('uni-app-compiler: ' + e.message)
21
22
  }
22
23
  }
23
24
 
@@ -31,16 +32,16 @@ function parseJson (content, preprocess = false) {
31
32
  function getJson (jsonFileName, preprocess = false) {
32
33
  const jsonFilePath = path.resolve(process.env.UNI_INPUT_DIR, jsonFileName)
33
34
  if (!fs.existsSync(jsonFilePath)) {
34
- throw new Error(jsonFilePath + ' 不存在')
35
+ throw new Error(jsonFilePath + ' ' + uniI18n.__('cliShared.doesNotExist'))
35
36
  }
36
37
  try {
37
38
  return parseJson(fs.readFileSync(jsonFilePath, 'utf8'), preprocess)
38
39
  } catch (e) {
39
- console.error(jsonFileName + ' 解析失败')
40
+ console.error(jsonFileName + uniI18n.__('cliShared.parsingFailed'))
40
41
  }
41
42
  }
42
43
 
43
44
  module.exports = {
44
45
  getJson,
45
46
  parseJson
46
- }
47
+ }
package/lib/manifest.js CHANGED
@@ -85,8 +85,7 @@ function getH5Options (manifestJson) {
85
85
  }
86
86
 
87
87
  /* eslint-disable no-mixed-operators */
88
- h5.template = h5.template && path.resolve(process.env.UNI_INPUT_DIR, h5.template) || path.resolve(__dirname,
89
- '../../../../public/index.html')
88
+ h5.template = h5.template && path.resolve(process.env.UNI_INPUT_DIR, h5.template) || path.resolve(require('./util').getCLIContext(), 'public/index.html')
90
89
 
91
90
  h5.devServer = h5.devServer || {}
92
91
 
@@ -103,4 +102,4 @@ module.exports = {
103
102
  parseManifestJson,
104
103
  getNetworkTimeout,
105
104
  getH5Options
106
- }
105
+ }
package/lib/package.js CHANGED
@@ -1,3 +1,5 @@
1
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
2
+
1
3
  const PLATFORMS = [
2
4
  'h5',
3
5
  'app-plus',
@@ -20,22 +22,22 @@ module.exports = {
20
22
  }
21
23
 
22
24
  if (!scriptOptions) {
23
- console.error(`package.json->uni-app->scripts->${name} 不存在`)
25
+ console.error(`package.json->uni-app->scripts->${name} ${uniI18n.__('cliShared.doesNotExist')}`)
24
26
  process.exit(0)
25
27
  }
26
28
 
27
29
  if (!scriptOptions.env || !scriptOptions.env.UNI_PLATFORM) {
28
- console.error(`package.json->uni-app->scripts->${name}->env 不存在,必须配置 env->UNI_PLATFORM 基础平台`)
30
+ console.error(uniI18n.__('cliShared.requireConfigUniPlatform', { 0: `package.json->uni-app->scripts->${name}->env ` }))
29
31
  process.exit(0)
30
32
  }
31
33
 
32
34
  if (PLATFORMS.indexOf(scriptOptions.env.UNI_PLATFORM) === -1) {
33
- console.error(`UNI_PLATFORM 支持以下平台 ${JSON.stringify(PLATFORMS)}`)
35
+ console.error(uniI18n.__('cliShared.supportPlatform', { 0: 'UNI_PLATFORM', 1: JSON.stringify(PLATFORMS) }))
34
36
  process.exit(0)
35
37
  }
36
38
 
37
39
  process.env.UNI_PLATFORM = scriptOptions.env.UNI_PLATFORM
38
-
40
+
39
41
  process.env.UNI_SCRIPT = name
40
42
  process.UNI_SCRIPT_ENV = scriptOptions.env || {}
41
43
  process.UNI_SCRIPT_DEFINE = scriptOptions.define || {}
package/lib/pages.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
3
4
 
4
5
  const {
5
6
  removeExt,
@@ -62,10 +63,10 @@ function processPagesJson (pagesJson, loader = {
62
63
  if (typeof pagesJsonJsFn === 'function') {
63
64
  pagesJson = pagesJsonJsFn(pagesJson, loader)
64
65
  if (!pagesJson) {
65
- console.error(`${pagesJsonJsFileName} 必须返回一个 json 对象`)
66
+ console.error(`${pagesJsonJsFileName} ${uniI18n.__('cliShared.requireReturnJsonObject')}`)
66
67
  }
67
68
  } else {
68
- console.error(`${pagesJsonJsFileName} 必须导出 function`)
69
+ console.error(`${pagesJsonJsFileName} ${uniI18n.__('cliShared.requireExportFunction')}`)
69
70
  }
70
71
  }
71
72
  // 将 subpackages 转换成 subPackages
@@ -112,7 +113,7 @@ function isNVuePage (page, root = '') {
112
113
 
113
114
  function isValidPage (page, root = '') {
114
115
  if (typeof page === 'string' || !page.path) { // 不合法的配置
115
- console.warn('pages.json 页面配置错误, 已被忽略, 查看文档: https://uniapp.dcloud.io/collocation/pages?id=pages')
116
+ console.warn(uniI18n.__('cliShared.pagesJsonError', { 0: 'https://uniapp.dcloud.io/collocation/pages?id=pages' }))
116
117
  return false
117
118
  }
118
119
  let pagePath = page.path
@@ -390,9 +391,7 @@ function initAutoComponents () {
390
391
  })
391
392
  if (conflictFiles.length > 0) {
392
393
  conflictFiles.forEach(files => {
393
- console.warn('easycom组件冲突:[' + files.map((file, index) => {
394
- return file
395
- }).join(',') + ']')
394
+ console.warn(uniI18n.__('cliShared.easycomConflict', { 0: '[' + files.map((file, index) => { return file }).join(',') + ']' }))
396
395
  console.log('\n')
397
396
  })
398
397
  }
package/lib/platform.js CHANGED
@@ -122,7 +122,7 @@ module.exports = {
122
122
  getShadowCss,
123
123
  getShadowTemplate (colorType = 'grey') {
124
124
  let tagName = 'cover-image'
125
- if (process.env.UNI_PLATFORM === 'mp-toutiao') {
125
+ if (process.env.UNI_PLATFORM === 'mp-toutiao' || process.env.UNI_PLATFORM === 'mp-lark') {
126
126
  tagName = 'image'
127
127
  }
128
128
  return `<${tagName} src="https://cdn.dcloud.net.cn/img/shadow-${colorType}.png" style="z-index:998;position:fixed;left:0;top:0;width:100%;height:3px;"/>`
@@ -137,6 +137,8 @@ module.exports = {
137
137
  return {
138
138
  sourceType: 'module',
139
139
  plugins: [
140
+ ['pipelineOperator', { proposal: 'minimal' }],
141
+ 'doExpressions',
140
142
  'optionalChaining',
141
143
  'typescript',
142
144
  ['decorators', {
package/lib/plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path')
2
-
3
2
  const initPreprocessContext = require('./preprocess')
3
+ const uniI18n = require('@dcloudio/uni-cli-i18n')
4
4
 
5
5
  const Plugin = {
6
6
  options: {},
@@ -25,7 +25,7 @@ function initPlugin (plugin) {
25
25
  try {
26
26
  pluginApi = require(path.join(plugin.id, (plugin.config.main || '/lib/uni.config.js')))
27
27
  } catch (e) {
28
- console.warn(`${plugin.id} 缺少 uni.config.js `)
28
+ console.warn(uniI18n.__('cliShared.missingUniConfig', { 0: plugin.id }))
29
29
  }
30
30
 
31
31
  pluginApi && PLUGIN_KEYS.forEach(name => {
@@ -56,7 +56,7 @@ function resolvePlugins () {
56
56
  return
57
57
  }
58
58
  if (!config.name) {
59
- return console.warn(`${id}/package.json->uni-app 缺少 name 属性`)
59
+ return console.warn(uniI18n.__('cliShared.missingNameAttribute', { 0: `${id}/package.json->uni-app` }))
60
60
  }
61
61
  return {
62
62
  id,
@@ -71,13 +71,13 @@ function initExtends (name, plugin, plugins) {
71
71
  const extendsPlatform = plugin.config.extends
72
72
  if (extendsPlatform) {
73
73
  if (extendsPlatform !== 'h5') {
74
- console.error('目前仅支持基于 h5 平台做扩展')
74
+ console.error(uniI18n.__('cliShared.extendOnlySupportH5'))
75
75
  process.exit(0)
76
76
  }
77
77
  if (!plugin) {
78
- console.error(`缺少平台 ${extendsPlatform} 插件`)
78
+ console.error(uniI18n.__('cliShared.noFoundPlatformPlugin', { 0: extendsPlatform }))
79
79
  process.exit(0)
80
- }
80
+ }
81
81
  const extendsPlugin = plugins.find(plugin => plugin.name === extendsPlatform)
82
82
  process.env.UNI_SUB_PLATFORM = name
83
83
  process.env.UNI_PLATFORM = extendsPlatform
@@ -102,7 +102,7 @@ module.exports = {
102
102
  const plugins = resolvePlugins()
103
103
  const plugin = plugins.find(plugin => plugin.name === process.env.UNI_PLATFORM)
104
104
  if (!plugin) {
105
- console.error(`缺少平台 ${process.env.UNI_PLATFORM} 插件`)
105
+ console.error(uniI18n.__('cliShared.noFoundPlatformPlugin', { 0: process.env.UNI_PLATFORM }))
106
106
  process.exit(0)
107
107
  }
108
108
  const name = plugin.name
@@ -119,4 +119,4 @@ module.exports = {
119
119
 
120
120
  return Plugin
121
121
  }
122
- }
122
+ }
package/lib/preprocess.js CHANGED
@@ -1,4 +1,6 @@
1
1
  const DEFAULT_KEYS = [
2
+ 'VUE2',
3
+ 'VUE3',
2
4
  'MP',
3
5
  'APP',
4
6
  'APP-PLUS-NVUE',
@@ -25,6 +27,15 @@ module.exports = function initPreprocess (name, platforms, userDefines = {}) {
25
27
  defaultContext[normalize(name)] = false
26
28
  })
27
29
 
30
+ if (process.env.UNI_USING_VUE3) {
31
+ defaultContext.VUE3 = true
32
+ } else {
33
+ defaultContext.VUE2 = true
34
+ }
35
+ // nvue 只支持vue2
36
+ nvueContext.VUE2 = true
37
+ nvueContext.VUE3 = false
38
+
28
39
  vueContext[normalize(name)] = true
29
40
 
30
41
  if (name === 'app-plus') {
@@ -21,7 +21,21 @@ function normalizeUniModulesPagesJson (pagesJson, pluginId) {
21
21
  return pagesJson
22
22
  }
23
23
 
24
+ function initUniModules () {
25
+ global.uniModules = []
26
+ try {
27
+ global.uniModules = fs
28
+ .readdirSync(path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules'))
29
+ .filter(module =>
30
+ fs.existsSync(
31
+ path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'package.json')
32
+ )
33
+ )
34
+ } catch (e) {}
35
+ }
36
+
24
37
  module.exports = {
38
+ initUniModules,
25
39
  getPagesJson (content) {
26
40
  const uniModulesDir = path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules')
27
41
  const pluginPagesJsons = []
package/lib/url-loader.js CHANGED
@@ -1,28 +1,16 @@
1
- const path = require('path')
2
-
3
- const isWin = /^win/.test(process.platform)
4
-
5
- const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
1
+ const fileLoader = require('./file-loader.js')
6
2
 
7
3
  const defaultOptions = {
8
4
  limit: -1,
9
- fallback: {
10
- loader: 'file-loader',
11
- options: {
12
- publicPath (url, resourcePath, context) {
13
- return '/' + normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
14
- },
15
- outputPath (url, resourcePath, context) {
16
- return normalizePath(path.relative(process.env.UNI_INPUT_DIR, resourcePath))
17
- }
18
- }
19
- }
5
+ fallback: fileLoader
20
6
  }
21
7
 
22
8
  const inlineLimit =
23
9
  process.env.UNI_PLATFORM === 'mp-weixin' ||
24
10
  process.env.UNI_PLATFORM === 'mp-qq' ||
25
11
  process.env.UNI_PLATFORM === 'mp-toutiao' ||
12
+ process.env.UNI_PLATFORM === 'mp-kuaishou' ||
13
+ process.env.UNI_PLATFORM === 'mp-lark' ||
26
14
  process.env.UNI_PLATFORM === 'app-plus' // v2需要base64,v3需要rewriteUrl
27
15
 
28
16
  // mp-weixin,mp-qq,app-plus 非v3(即:需要base64的平台)
@@ -59,4 +47,4 @@ module.exports = {
59
47
  }
60
48
  },
61
49
  rewriteUrl
62
- }
50
+ }
package/lib/util.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const path = require('path')
2
+ const fs = require('fs')
2
3
  const hash = require('hash-sum')
3
4
  const crypto = require('crypto')
4
5
 
@@ -14,6 +15,24 @@ try {
14
15
  const isInHBuilderX = !!aboutPkg
15
16
  const isInHBuilderXAlpha = !!(isInHBuilderX && aboutPkg.alpha)
16
17
 
18
+ function getCLIContext () {
19
+ var context = path.resolve(__dirname, '../../../../')
20
+ // const isInHBuilderX = fs.existsSync(path.resolve(context, 'bin/uniapp-cli.js'))
21
+ if (isInHBuilderX) {
22
+ return context
23
+ }
24
+ const pnpmFind = __dirname.match(/.+?[/\\].pnpm[/\\]/)
25
+ if (pnpmFind) {
26
+ const pnpm = pnpmFind[0]
27
+ context = path.resolve(pnpm, '../../')
28
+ }
29
+ const isInCLI = fs.existsSync(path.resolve(context, './src'))
30
+ if (isInCLI) {
31
+ return context
32
+ }
33
+ return process.cwd()
34
+ }
35
+
17
36
  function removeExt (str, ext) {
18
37
  if (ext) {
19
38
  const reg = new RegExp(ext.replace(/\./, '\\.') + '$')
@@ -105,6 +124,7 @@ const _hasOwnProperty = Object.prototype.hasOwnProperty
105
124
  module.exports = {
106
125
  isInHBuilderX,
107
126
  isInHBuilderXAlpha,
127
+ getCLIContext,
108
128
  normalizeNodeModules,
109
129
  md5,
110
130
  hasOwn (obj, key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-alpha-32920211110001",
4
4
  "description": "uni-cli-shared",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "postcss-urlrewrite": "^0.2.2",
24
24
  "strip-json-comments": "^2.0.1"
25
25
  },
26
- "gitHead": "b1bdfb4de3f518c1c0fbab242403ea05feced4e3"
26
+ "gitHead": "7cba94e25eba256f3cab0f2b2b73383bd25abe49"
27
27
  }
@@ -1 +1 @@
1
- !function(e){var t={};function A(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,A),i.l=!0,i.exports}A.m=e,A.c=t,A.d=function(e,t,a){A.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},A.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},A.t=function(e,t){if(1&t&&(e=A(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(A.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)A.d(a,i,function(t){return e[t]}.bind(null,i));return a},A.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return A.d(t,"a",t),t},A.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},A.p="",A(A.s=41)}([function(e,t){e.exports={}},function(e,t,A){"use strict";function a(e,t,A,a,i,n,o,s,r,c){var l,d="function"==typeof e?e.options:e;if(r){d.components||(d.components={});var u=Object.prototype.hasOwnProperty;for(var h in r)u.call(r,h)&&!u.call(d.components,h)&&(d.components[h]=r[h])}if(c&&((c.beforeCreate||(c.beforeCreate=[])).unshift((function(){this[c.__module]=this})),(d.mixins||(d.mixins=[])).push(c)),t&&(d.render=t,d.staticRenderFns=A,d._compiled=!0),a&&(d.functional=!0),n&&(d._scopeId="data-v-"+n),o?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var f=d.render;d.render=function(e,t){return l.call(t),f(e,t)}}else{var g=d.beforeCreate;d.beforeCreate=g?[].concat(g,l):[l]}return{exports:e,options:d}}A.d(t,"a",(function(){return a}))},function(e,t,A){"use strict";var a;Object.defineProperty(t,"__esModule",{value:!0}),t.weexPlus=t.default=void 0,a="function"==typeof getUni?getUni:function(){var e=function(e){return"function"==typeof e},t=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},A=/^\$|^on|^create|Sync$|Manager$|^pause/,a=["os","getCurrentSubNVue","getSubNVueById","stopRecord","stopVoice","stopBackgroundAudio","stopPullDownRefresh","hideKeyboard","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","canIUse","navigateBack","closeSocket","pageScrollTo","drawCanvas"],n=function(e){return(!A.test(e)||"createBLEConnection"===e)&&!~a.indexOf(e)},o=function(A){return function(){for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(o.success)||e(o.fail)||e(o.complete)?A.apply(void 0,[o].concat(i)):t(new Promise((function(e,t){A.apply(void 0,[Object.assign({},o,{success:e,fail:t})].concat(i)),Promise.prototype.finally=function(e){var t=this.constructor;return this.then((function(A){return t.resolve(e()).then((function(){return A}))}),(function(A){return t.resolve(e()).then((function(){throw A}))}))}})))}},s=[],r=void 0;function c(e){s.forEach((function(t){return t({origin:r,data:e})}))}var l=i.webview.currentWebview().id,d=new BroadcastChannel("UNI-APP-SUBNVUE");function u(e){var t=i.webview.getWebviewById(e);return t&&!t.$processed&&function(e){e.$processed=!0;var t=i.webview.currentWebview().id===e.id,A="uniNView"===e.__uniapp_origin_type&&e.__uniapp_origin_id,a=e.id;if(e.postMessage=function(e){A?d.postMessage({data:e,to:t?A:a}):w({type:"UniAppSubNVue",data:e})},e.onMessage=function(e){s.push(e)},e.__uniapp_mask_id){r=e.__uniapp_host;var n=e.__uniapp_mask,o=i.webview.getWebviewById(e.__uniapp_mask_id);o=o.parent()||o;var c=e.show,l=e.hide,u=e.close,h=function(){o.setStyle({mask:n})},f=function(){o.setStyle({mask:"none"})};e.show=function(){h();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return c.apply(e,A)},e.hide=function(){f();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return l.apply(e,A)},e.close=function(){f();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return u.apply(e,A)}}}(t),t}d.onmessage=function(e){e.data.to===l&&c(e.data.data)};var h=weex.requireModule("plus"),f=weex.requireModule("globalEvent"),g=0,p={};f.addEventListener("plusMessage",(function(e){"UniAppJsApi"===e.data.type?v(e.data.id,e.data.data):"UniAppSubNVue"===e.data.type?c(e.data.data,e.data.options):"onNavigationBarButtonTap"===e.data.type?"function"==typeof _&&_(e.data.data):"onNavigationBarSearchInputChanged"===e.data.type?"function"==typeof y&&y(e.data.data):"onNavigationBarSearchInputConfirmed"===e.data.type?"function"==typeof B&&B(e.data.data):"onNavigationBarSearchInputClicked"===e.data.type&&"function"==typeof x&&x(e.data.data)}));var v=function(e,t){var A=p[e];A?(A(t),A.keepAlive||delete p[e]):console.error("callback["+e+"] is undefined")},m=function(t){var A,a,i=t.id,n=t.type,o=t.params;p[i]=(a=function(t){e(A)?A(t):A&&(~t.errMsg.indexOf(":ok")?e(A.success)&&A.success(t):~t.errMsg.indexOf(":fail")&&e(A.fail)&&A.fail(t),e(A.complete)&&A.complete(t))},(e(A=o)||A&&e(A.callback))&&(a.keepAlive=!0),a),h.postMessage({id:i,type:n,params:o},"__uniapp__service")};function w(e){h.postMessage(e,"__uniapp__service")}var b=function(e){return function(t){m({id:g++,type:e,params:t})}},_=void 0,y=void 0,B=void 0,x=void 0;function S(e){_=e}function C(e){y=e}function D(e){B=e}function L(e){x=e}function I(e){return weex.requireModule(e)}var E=weex.requireModule("dom"),k=weex.requireModule("globalEvent"),M=[];function N(e){"function"==typeof e&&(this.isUniAppReady?e():M.push(e))}k.addEventListener("plusMessage",(function(e){"UniAppReady"===e.data.type&&(N.isUniAppReady=!0,M.length&&(M.forEach((function(e){return e()})),M=[]))}));var j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O=weex.requireModule("stream"),P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/x-www-form-urlencoded";return"object"===(void 0===e?"undefined":j(e))?"POST"===t.toUpperCase()&&"application/json"===A.toLowerCase()?JSON.stringify(e):Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&"):e},G=weex.requireModule("plusstorage"),T=weex.requireModule("clipboard"),Q=function(){if("function"==typeof getUniEmitter)return getUniEmitter;var e={$on:function(){console.warn("uni.$on failed")},$off:function(){console.warn("uni.$off failed")},$once:function(){console.warn("uni.$once failed")},$emit:function(){console.warn("uni.$emit failed")}};return function(){return e}}();function U(e,t,A){return e[t].apply(e,A)}var F=Object.freeze({loadFontFace:function(t){var A=t.family,a=t.source,i=(t.desc,t.success),n=(t.fail,t.complete);E.addRule("fontFace",{fontFamily:A,src:a.replace(/"/g,"'")});var o={errMsg:"loadFontFace:ok",status:"loaded"};e(i)&&i(o),e(n)&&n(o)},ready:N,request:function(t){var A=t.url,a=t.data,i=t.header,n=t.method,o=void 0===n?"GET":n,s=t.dataType,r=void 0===s?"json":s,c=(t.responseType,t.success),l=t.fail,d=t.complete,u=!1,h=!1,f={};if(i)for(var g in i)h||"content-type"!==g.toLowerCase()?f[g]=i[g]:(h=!0,f["Content-Type"]=i[g]);return"GET"===o&&a&&(A=A+(~A.indexOf("?")?"&"===A.substr(-1)||"?"===A.substr(-1)?"":"&":"?")+P(a)),O.fetch({url:A,method:o,headers:f,type:"json"===r?"json":"text",body:"GET"!==o?P(a,o,f["Content-Type"]):""},(function(t){var A=t.status,a=(t.ok,t.statusText,t.data),i=t.headers,n={};!A||-1===A||u?(n.errMsg="request:fail",e(l)&&l(n)):(n.data=a,n.statusCode=A,n.header=i,e(c)&&c(n)),e(d)&&d(n)})),{abort:function(){u=!0}}},getStorage:function(t){var A=t.key,a=(t.data,t.success),i=t.fail,n=t.complete;G.getItem(A+"__TYPE",(function(t){if("success"===t.result){var o=t.data;G.getItem(A,(function(t){if("success"===t.result){var A=t.data;o&&A?("String"!==o&&(A=JSON.parse(A)),e(a)&&a({errMsg:"getStorage:ok",data:A})):(t.errMsg="setStorage:fail",e(i)&&i(t))}else t.errMsg="setStorage:fail",e(i)&&i(t);e(n)&&n(t)}))}else t.errMsg="setStorage:fail",e(i)&&i(t),e(n)&&n(t)}))},setStorage:function(t){var A=t.key,a=t.data,i=t.success,n=t.fail,o=t.complete,s="String";"object"===(void 0===a?"undefined":j(a))&&(s="Object",a=JSON.stringify(a)),G.setItem(A,a,(function(t){"success"===t.result?G.setItem(A+"__TYPE",s,(function(t){"success"===t.result?e(i)&&i({errMsg:"setStorage:ok"}):(t.errMsg="setStorage:fail",e(n)&&n(t))})):(t.errMsg="setStorage:fail",e(n)&&n(t)),e(o)&&o(t)}))},removeStorage:function(t){var A=t.key,a=(t.data,t.success),i=t.fail,n=t.complete;G.removeItem(A,(function(t){"success"===t.result?e(a)&&a({errMsg:"removeStorage:ok"}):(t.errMsg="removeStorage:fail",e(i)&&i(t)),e(n)&&n(t)})),G.removeItem(A+"__TYPE")},clearStorage:function(e){e.key,e.data,e.success,e.fail,e.complete},getClipboardData:function(t){var A=t.success,a=(t.fail,t.complete);T.getString((function(t){var i={errMsg:"getClipboardData:ok",data:t.data};e(A)&&A(i),e(a)&&a(i)}))},setClipboardData:function(t){var A=t.data,a=t.success,i=(t.fail,t.complete),n={errMsg:"setClipboardData:ok"};T.setString(A),e(a)&&a(n),e(i)&&i(n)},onSubNVueMessage:c,getSubNVueById:u,getCurrentSubNVue:function(){return u(i.webview.currentWebview().id)},$on:function(){return U(Q(),"$on",[].concat(Array.prototype.slice.call(arguments)))},$off:function(){return U(Q(),"$off",[].concat(Array.prototype.slice.call(arguments)))},$once:function(){return U(Q(),"$once",[].concat(Array.prototype.slice.call(arguments)))},$emit:function(){return U(Q(),"$emit",[].concat(Array.prototype.slice.call(arguments)))}}),R={os:{nvue:!0}},V={};return"undefined"!=typeof Proxy?V=new Proxy({},{get:function(e,t){if("os"===t)return{nvue:!0};if("postMessage"===t)return w;if("requireNativePlugin"===t)return I;if("onNavigationBarButtonTap"===t)return S;if("onNavigationBarSearchInputChanged"===t)return C;if("onNavigationBarSearchInputConfirmed"===t)return D;if("onNavigationBarSearchInputClicked"===t)return L;var A=F[t];return A||(A=b(t)),n(t)?o(A):A}}):(Object.keys(R).forEach((function(e){V[e]=R[e]})),V.postMessage=w,V.requireNativePlugin=I,V.onNavigationBarButtonTap=S,V.onNavigationBarSearchInputChanged=C,V.onNavigationBarSearchInputConfirmed=D,V.onNavigationBarSearchInputClicked=L,Object.keys({uploadFile:!0,downloadFile:!0,chooseImage:!0,previewImage:!0,getImageInfo:!0,saveImageToPhotosAlbum:!0,chooseVideo:!0,saveVideoToPhotosAlbum:!0,saveFile:!0,getSavedFileList:!0,getSavedFileInfo:!0,removeSavedFile:!0,openDocument:!0,setStorage:!0,getStorage:!0,getStorageInfo:!0,removeStorage:!0,clearStorage:!0,getLocation:!0,chooseLocation:!0,openLocation:!0,getSystemInfo:!0,getNetworkType:!0,makePhoneCall:!0,scanCode:!0,setScreenBrightness:!0,getScreenBrightness:!0,setKeepScreenOn:!0,vibrateLong:!0,vibrateShort:!0,addPhoneContact:!0,showToast:!0,showLoading:!0,hideToast:!0,hideLoading:!0,showModal:!0,showActionSheet:!0,setNavigationBarTitle:!0,setNavigationBarColor:!0,navigateTo:!0,redirectTo:!0,reLaunch:!0,switchTab:!0,navigateBack:!0,getProvider:!0,login:!0,getUserInfo:!0,share:!0,requestPayment:!0,subscribePush:!0,unsubscribePush:!0,onPush:!0,offPush:!0}).forEach((function(e){var t=F[e];t||(t=b(e)),n(e)?V[e]=o(t):V[e]=t}))),V};var i=new WeexPlus(weex);t.weexPlus=i;var n=a(weex,i,BroadcastChannel);t.default=n},function(e,t,A){Vue.prototype.__$appStyle__={},Vue.prototype.__merge_style&&Vue.prototype.__merge_style(A(4).default,Vue.prototype.__$appStyle__)},function(e,t,A){"use strict";A.r(t);var a=A(0),i=A.n(a);for(var n in a)"default"!==n&&function(e){A.d(t,e,(function(){return a[e]}))}(n);t.default=i.a},function(e,t,A){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var A={onLoad:function(){this.initMessage()},methods:{initMessage:function(){var t=this,A=e.webview.currentWebview().extras||{},a=A.from,i=(A.callback,A.runtime),n=A.data,o=void 0===n?{}:n,s=A.useGlobalEvent;this.__from=a,this.__runtime=i,this.__page=e.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(o)),e.key.addEventListener("backbutton",(function(){"function"==typeof t.onClose?t.onClose():e.webview.currentWebview().close("auto")}));var r=this,c=function(e){var t=e.data&&e.data.__message;t&&r.__onMessageCallback&&r.__onMessageCallback(t.data)};this.__useGlobalEvent?weex.requireModule("globalEvent").addEventListener("plusMessage",c):new BroadcastChannel(this.__page).onmessage=c},postMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:t,keep:A}})),i=this.__from;if("v8"===this.__runtime)if(this.__useGlobalEvent)e.webview.postMessageToUniNView(a,i);else{var n=new BroadcastChannel(i);n.postMessage(a)}else{var o=e.webview.getWebviewById(i);o&&o.evalJS("__plusMessage&&__plusMessage(".concat(JSON.stringify({data:a}),")"))}},onMessage:function(e){this.__onMessageCallback=e}}};t.default=A}).call(this,A(2).weexPlus)},function(e,t,A){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var A={data:function(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"完成",cancel:"取消"},"zh-hans":{},"zh-hant":{},messages:{}}}},onLoad:function(){this.initLocale()},created:function(){this.initLocale()},methods:{initLocale:function(){if(!this.__initLocale){this.__initLocale=!0;var t=(e.webview.currentWebview().extras||{}).data||{};if(t.messages&&(this.localization.messages=t.messages),t.locale)this.locale=t.locale.toLowerCase();else{var A=e.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),a=A[1];a&&(A[1]={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"}[a]||a),A.length=A.length>2?2:A.length,this.locale=A.join("-")}}},localize:function(e){var t=this.locale,A=t.split("-")[0],a=this.fallbackLocale,i=this.localization;function n(e){return i[e]||{}}return n("messages")[e]||n(t)[e]||n(A)[e]||n(a)[e]||e}}};t.default=A}).call(this,A(2).weexPlus)},function(e,t,A){"use strict";var a=A(29),i=A(12),n=A(1);var o=Object(n.a)(i.default,a.b,a.c,!1,null,null,"14d2bcf2",!1,a.a,void 0);(function(e){this.options.style||(this.options.style={}),Vue.prototype.__merge_style&&Vue.prototype.__$appStyle__&&Vue.prototype.__merge_style(Vue.prototype.__$appStyle__,this.options.style),Vue.prototype.__merge_style?Vue.prototype.__merge_style(A(36).default,this.options.style):Object.assign(this.options.style,A(36).default)}).call(o),t.default=o.exports},,,,,function(e,t,A){"use strict";var a=A(13),i=A.n(a);t.default=i.a},function(e,t,A){"use strict";(function(e,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(A(5)),n=o(A(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),A.push.apply(A,a)}return A}function r(e,t,A){return t in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}weex.requireModule("dom").addRule("fontFace",{fontFamily:"unichooselocation",src:"url('data:font/truetype;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NV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0,latitude:39.908692,longitude:116.397477,nearList:[],nearSelectedIndex:-1,nearLoading:!1,nearLoadingEnd:!1,noNearData:!1,isUserLocation:!1,statusBarHeight:20,mapHeight:250,markers:[{id:"location",latitude:39.908692,longitude:116.397477,zIndex:"1",iconPath:l,width:26,height:36}],showSearch:!1,searchList:[],searchSelectedIndex:-1,searchLoading:!1,searchEnd:!1,noSearchData:!1,localization:{en:{search_tips:"Search for a place",no_found:"No results found",nearby:"Nearby",more:"More"},zh:{search_tips:"搜索地点",no_found:"对不起,没有搜索到相关数据",nearby:"附近",more:"更多"}},searchNearFlag:!0,searchMethod:"poiSearchNearBy"}},computed:{disableOK:function(){return this.nearSelectedIndex<0&&this.searchSelectedIndex<0},searchMethods:function(){return[{title:this.localize("nearby"),method:"poiSearchNearBy"},{title:this.localize("more"),method:"poiKeywordsSearch"}]}},filters:{distance:function(e){return e>100?"".concat(e>1e3?(e/1e3).toFixed(1)+"k":e.toFixed(0),"m | "):e>0?"100m内 | ":""}},watch:{searchMethod:function(){this._searchPageIndex=1,this.searchEnd=!1,this.searchList=[],this._searchKeyword&&this.search()}},onLoad:function(){this.statusBarHeight=e.navigator.getStatusbarHeight(),this.mapHeight=e.screen.resolutionHeight/2;var t=this.data;this.userKeyword=t.keyword||"",this._searchInputTimer=null,this._searchPageIndex=1,this._searchKeyword="",this._nearPageIndex=1,this._hasUserLocation=!1,this._userLatitude=0,this._userLongitude=0},onReady:function(){this.mapContext=this.$refs.map1,this.data.latitude&&this.data.longitude?(this._hasUserLocation=!0,this.moveToCenter({latitude:this.data.latitude,longitude:this.data.longitude})):this.getUserLocation()},onUnload:function(){this.clearSearchTimer()},methods:{cancelClick:function(){this.postMessage({event:"cancel"})},doneClick:function(){if(!this.disableOK){var e=this.showSearch&&this.searchSelectedIndex>=0?this.searchList[this.searchSelectedIndex]:this.nearList[this.nearSelectedIndex],t={name:e.name,address:e.address,latitude:e.location.latitude,longitude:e.location.longitude};this.postMessage({event:"selected",detail:t})}},getUserLocation:function(){var t=this;e.geolocation.getCurrentPosition((function(e){var A=e.coordsType,a=e.coords;"wgs84"===A.toLowerCase()?t.wgs84togcjo2(a,(function(e){t.getUserLocationSuccess(e)})):t.getUserLocationSuccess(a)}),(function(e){t._hasUserLocation=!0,a("log","Gelocation Error: code - "+e.code+"; message - "+e.message," at template/__uniappchooselocation.nvue:292")}),{geocode:!1})},getUserLocationSuccess:function(e){this._userLatitude=e.latitude,this._userLongitude=e.longitude,this._hasUserLocation=!0,this.moveToCenter({latitude:e.latitude,longitude:e.longitude})},searchclick:function(t){this.showSearch=t,!1===t&&e.key.hideSoftKeybord()},showSearchView:function(){this.searchList=[],this.showSearch=!0},hideSearchView:function(){this.showSearch=!1,e.key.hideSoftKeybord(),this.noSearchData=!1,this.searchSelectedIndex=-1,this._searchKeyword=""},onregionchange:function(e){var t=this,A=e.detail,a=A.type||e.type;"drag"===(A.causedBy||e.causedBy)&&"end"===a&&this.mapContext.getCenterLocation((function(e){t.searchNearFlag?t.moveToCenter({latitude:e.latitude,longitude:e.longitude}):t.searchNearFlag=!t.searchNearFlag}))},onItemClick:function(e,t){this.searchNearFlag=!1,t.stopPropagation&&t.stopPropagation(),this.nearSelectedIndex!==e&&(this.nearSelectedIndex=e),this.moveToLocation(this.nearList[e]&&this.nearList[e].location)},moveToCenter:function(e){this.latitude===e.latitude&&this.longitude===e.longitude||(this.latitude=e.latitude,this.longitude=e.longitude,this.updateCenter(e),this.moveToLocation(e),this.isUserLocation=this._userLatitude===e.latitude&&this._userLongitude===e.longitude)},updateCenter:function(e){var t=this;this.nearSelectedIndex=-1,this.nearList=[],this._hasUserLocation&&(this._nearPageIndex=1,this.nearLoadingEnd=!1,this.reverseGeocode(e),this.searchNearByPoint(e),this.onItemClick(0,{stopPropagation:function(){t.searchNearFlag=!0}}),this.$refs.nearListLoadmore.resetLoadmore())},searchNear:function(){this.nearLoadingEnd||this.searchNearByPoint({latitude:this.latitude,longitude:this.longitude})},searchNearByPoint:function(e){var t=this;this.noNearData=!1,this.nearLoading=!0,c.poiSearchNearBy({point:{latitude:e.latitude,longitude:e.longitude},key:this.userKeyword,index:this._nearPageIndex,radius:1e3},(function(e){t.nearLoading=!1,t._nearPageIndex=e.pageIndex+1,t.nearLoadingEnd=e.pageIndex===e.pageNumber,e.poiList&&e.poiList.length?(t.fixPois(e.poiList),t.nearList=t.nearList.concat(e.poiList),t.fixNearList()):t.noNearData=0===t.nearList.length}))},moveToLocation:function(e){e&&this.mapContext.moveToLocation(function(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?s(Object(A),!0).forEach((function(t){r(e,t,A[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):s(Object(A)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))}))}return e}({},e,{fail:function(e){a("error","chooseLocation_moveToLocation",e," at template/__uniappchooselocation.nvue:418")}}))},reverseGeocode:function(e){var t=this;c.reverseGeocode({point:e},(function(A){"success"===A.type&&t._nearPageIndex<=2&&(t.nearList.splice(0,0,{code:A.code,location:e,name:"地图位置",address:A.address||""}),t.fixNearList())}))},fixNearList:function(){var e=this.nearList;if(e.length>=2&&"地图位置"===e[0].name){var t=this.getAddressStart(e[1]),A=e[0].address;A.startsWith(t)&&(e[0].name=A.substring(t.length))}},onsearchinput:function(e){var t=this,A=e.detail.value.replace(/^\s+|\s+$/g,"");this.clearSearchTimer(),this._searchInputTimer=setTimeout((function(){clearTimeout(t._searchInputTimer),t._searchPageIndex=1,t.searchEnd=!1,t._searchKeyword=A,t.searchList=[],t.search()}),300)},clearSearchTimer:function(){this._searchInputTimer&&clearTimeout(this._searchInputTimer)},search:function(){var e=this;0===this._searchKeyword.length||this._searchEnd||this.searchLoading||(this.searchLoading=!0,this.noSearchData=!1,c[this.searchMethod]({point:{latitude:this.latitude,longitude:this.longitude},key:this._searchKeyword,index:this._searchPageIndex,radius:5e4},(function(t){e.searchLoading=!1,e._searchPageIndex=t.pageIndex+1,e.searchEnd=t.pageIndex===t.pageNumber,t.poiList&&t.poiList.length?(e.fixPois(t.poiList),e.searchList=e.searchList.concat(t.poiList)):e.noSearchData=0===e.searchList.length})))},onSearchListTouchStart:function(){e.key.hideSoftKeybord()},onSearchItemClick:function(e,t){t.stopPropagation(),this.searchSelectedIndex!==e&&(this.searchSelectedIndex=e),this.moveToLocation(this.searchList[e]&&this.searchList[e].location)},getAddressStart:function(e){var t=e.addressOrigin||e.address;return e.province+(e.province===e.city?"":e.city)+(/^\d+$/.test(e.district)?"":t.startsWith(e.district)?"":e.district)},fixPois:function(e){for(var t=0;t<e.length;t++){var A=e[t];A.name=A.name.replace(/\\/g,""),A.addressOrigin=A.address.replace(/\\/g,""),A.address=this.getAddressStart(A)+A.addressOrigin}},wgs84togcjo2:function(e,t){var A=weex.requireModule("stream"),a="https://apis.map.qq.com/jsapi?qt=translate&type=1&points=".concat(e.longitude,",").concat(e.latitude,"&key=MAP_KEY&output=json&pf=jsapi&ref=jsapi");A.fetch({method:"GET",url:a,type:"json"},(function(e){if(e.ok){var A=e.data.detail.points[0];t({latitude:A.lat,longitude:A.lng})}}))}}};t.default=d}).call(this,A(2).weexPlus,A(35).default)},function(e,t){e.exports={map_center_marker_container:{alignItems:"flex-start",width:"22",height:"70"},map_center_marker:{width:"22",height:"35"},"unichooselocation-icons":{fontFamily:"unichooselocation",textDecoration:"none",textAlign:"center"},page:{flex:1,position:"relative"},"flex-r":{flexDirection:"row",flexWrap:"nowrap"},"flex-c":{flexDirection:"column",flexWrap:"nowrap"},"flex-fill":{flex:1},"a-i-c":{alignItems:"center"},"j-c-c":{justifyContent:"center"},"nav-cover":{position:"absolute",left:0,top:0,right:0,height:"100",backgroundImage:"linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0))"},statusbar:{height:"22"},"title-view":{paddingTop:"5",paddingRight:"15",paddingBottom:"5",paddingLeft:"15"},"btn-cancel":{paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},"btn-cancel-text":{fontSize:"30",color:"#ffffff"},"btn-done":{backgroundColor:"#007AFF",borderRadius:"3",paddingTop:"5",paddingRight:"12",paddingBottom:"5",paddingLeft:"12"},"btn-done-disabled":{backgroundColor:"#62abfb"},"text-done":{color:"#ffffff",fontSize:"15",fontWeight:"bold",lineHeight:"15",height:"15"},"text-done-disabled":{color:"#c0ddfe"},"map-view":{flex:2,position:"relative"},map:{width:"750rpx",justifyContent:"center",alignItems:"center"},"map-location":{position:"absolute",right:"20",bottom:"25",width:"44",height:"44",backgroundColor:"#ffffff",borderRadius:"40",boxShadow:"0 2px 4px rgba(100, 100, 100, 0.2)"},"map-location-text":{fontSize:"20"},"map-location-text-active":{color:"#007AFF"},"result-area":{flex:2,position:"relative"},"search-bar":{paddingTop:"12",paddingRight:"15",paddingBottom:"12",paddingLeft:"15",backgroundColor:"#ffffff"},"search-area":{backgroundColor:"#ebebeb",borderRadius:"5",height:"30",paddingLeft:"8"},"search-text":{fontSize:"14",lineHeight:"16",color:"#b4b4b4"},"search-icon":{fontSize:"16",color:"#b4b4b4",marginRight:"4"},"search-tab":{flexDirection:"row",paddingTop:"2",paddingRight:"16",paddingBottom:"2",paddingLeft:"16",marginTop:"-10",backgroundColor:"#FFFFFF"},"search-tab-item":{marginTop:0,marginRight:"5",marginBottom:0,marginLeft:"5",textAlign:"center",fontSize:"14",lineHeight:"32",color:"#333333",borderBottomStyle:"solid",borderBottomWidth:"2",borderBottomColor:"rgba(0,0,0,0)"},"search-tab-item-active":{borderBottomColor:"#0079FF"},"no-data":{color:"#808080"},"no-data-search":{marginTop:"50"},"list-item":{position:"relative",paddingTop:"12",paddingRight:"15",paddingBottom:"12",paddingLeft:"15"},"list-line":{position:"absolute",left:"15",right:0,bottom:0,height:".5",backgroundColor:"#d3d3d3"},"list-name":{fontSize:"14",lines:1,textOverflow:"ellipsis"},"list-address":{fontSize:"12",color:"#808080",lines:1,textOverflow:"ellipsis",marginTop:"5"},"list-icon-area":{paddingLeft:"10",paddingRight:"10"},"list-selected-icon":{fontSize:"20",color:"#007AFF"},"search-view":{position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"#f6f6f6"},"searching-area":{flex:5},"search-input":{fontSize:"14",height:"30",paddingLeft:"6"},"search-cancel":{color:"#0079FF",marginLeft:"10"},"loading-view":{paddingTop:"15",paddingRight:"15",paddingBottom:"15",paddingLeft:"15"},"loading-icon":{width:"28",height:"28",color:"#808080"}}},,,,,,,,,,,,,,,function(e,t,A){"use strict";var a=function(){var e=this,t=e.$createElement,A=e._self._c||t;return A("scroll-view",{staticStyle:{flexDirection:"column"},attrs:{scrollY:!0,enableBackToTop:!0,bubble:"true"}},[A("view",{staticClass:["page","flex-c"]},[A("view",{staticClass:["flex-r","map-view"]},[A("map",{ref:"map1",staticClass:["map","flex-fill"],style:"height:"+e.mapHeight+"px",attrs:{scale:e.mapScale,showLocation:e.showLocation,longitude:e.longitude,latitude:e.latitude},on:{regionchange:e.onregionchange}},[A("div",{staticClass:["map_center_marker_container"]},[A("u-image",{staticClass:["map_center_marker"],attrs:{src:e.positionIcon}})],1)]),A("view",{staticClass:["map-location","flex-c","a-i-c","j-c-c"],on:{click:function(t){e.getUserLocation()}}},[A("u-text",{staticClass:["unichooselocation-icons","map-location-text"],class:{"map-location-text-active":e.isUserLocation}},[e._v("")])]),A("view",{staticClass:["nav-cover"]},[A("view",{staticClass:["statusbar"],style:"height:"+e.statusBarHeight+"px"}),A("view",{staticClass:["title-view","flex-r"]},[A("view",{staticClass:["btn-cancel"],on:{click:e.cancelClick}},[A("u-text",{staticClass:["unichooselocation-icons","btn-cancel-text"]},[e._v("")])]),A("view",{staticClass:["flex-fill"]}),A("view",{staticClass:["btn-done","flex-r","a-i-c","j-c-c"],class:{"btn-done-disabled":e.disableOK},on:{click:e.doneClick}},[A("u-text",{staticClass:["text-done"],class:{"text-done-disabled":e.disableOK}},[e._v(e._s(e.localize("done")))])])])])],1),A("view",{staticClass:["flex-c","result-area"],class:{"searching-area":e.showSearch}},[A("view",{staticClass:["search-bar"]},[A("view",{staticClass:["search-area","flex-r","a-i-c"],on:{click:e.showSearchView}},[A("u-text",{staticClass:["search-icon","unichooselocation-icons"]},[e._v("")]),A("u-text",{staticClass:["search-text"]},[e._v(e._s(e.localize("search_tips")))])])]),e.noNearData?e._e():A("list",{ref:"nearListLoadmore",staticClass:["flex-fill","list-view"],attrs:{loadmoreoffset:"5",scrollY:!0},on:{loadmore:function(t){e.searchNear()}}},[e._l(e.nearList,(function(t,a){return A("cell",{key:t.uid,appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["list-item"],on:{click:function(t){e.onItemClick(a,t)}}},[A("view",{staticClass:["flex-r"]},[A("view",{staticClass:["list-text-area","flex-fill","flex-c"]},[A("u-text",{staticClass:["list-name"]},[e._v(e._s(t.name))]),A("u-text",{staticClass:["list-address"]},[e._v(e._s(e._f("distance")(t.distance))+e._s(t.address))])]),a===e.nearSelectedIndex?A("view",{staticClass:["list-icon-area","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["unichooselocation-icons","list-selected-icon"]},[e._v("")])]):e._e()]),A("view",{staticClass:["list-line"]})])])})),e.nearLoading?A("cell",{appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["loading-view","flex-c","a-i-c","j-c-c"]},[A("loading-indicator",{staticClass:["loading-icon"],attrs:{animating:!0,arrow:"false"}})])]):e._e()],2),e.noNearData?A("view",{staticClass:["flex-fill","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["no-data"]},[e._v(e._s(e.localize("no_found")))])]):e._e(),e.showSearch?A("view",{staticClass:["search-view","flex-c"]},[A("view",{staticClass:["search-bar","flex-r","a-i-c"]},[A("view",{staticClass:["search-area","flex-fill","flex-r"]},[A("u-input",{staticClass:["search-input","flex-fill"],attrs:{focus:!0,placeholder:e.localize("search_tips")},on:{input:e.onsearchinput}})],1),A("u-text",{staticClass:["search-cancel"],on:{click:e.hideSearchView}},[e._v(e._s(e.localize("cancel")))])]),A("view",{staticClass:["search-tab"]},e._l(e.searchMethods,(function(t,a){return A("u-text",{key:a,staticClass:["search-tab-item"],class:{"search-tab-item-active":t.method===e.searchMethod},on:{click:function(A){e.searchMethod=e.searchLoading?e.searchMethod:t.method}}},[e._v(e._s(t.title))])})),0),e.noSearchData?e._e():A("list",{staticClass:["flex-fill","list-view"],attrs:{enableBackToTop:!0,scrollY:!0},on:{loadmore:function(t){e.search()},touchstart:e.onSearchListTouchStart}},[e._l(e.searchList,(function(t,a){return A("cell",{key:t.uid,appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["list-item"],on:{click:function(t){e.onSearchItemClick(a,t)}}},[A("view",{staticClass:["flex-r"]},[A("view",{staticClass:["list-text-area","flex-fill","flex-c"]},[A("u-text",{staticClass:["list-name"]},[e._v(e._s(t.name))]),A("u-text",{staticClass:["list-address"]},[e._v(e._s(e._f("distance")(t.distance))+e._s(t.address))])]),a===e.searchSelectedIndex?A("view",{staticClass:["list-icon-area","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["unichooselocation-icons","list-selected-icon"]},[e._v("")])]):e._e()]),A("view",{staticClass:["list-line"]})])])})),e.searchLoading?A("cell",{appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["loading-view","flex-c","a-i-c","j-c-c"]},[A("loading-indicator",{staticClass:["loading-icon"],attrs:{animating:!0}})])]):e._e()],2),e.noSearchData?A("view",{staticClass:["flex-fill","flex-r","j-c-c"]},[A("u-text",{staticClass:["no-data","no-data-search"]},[e._v(e._s(e.localize("no_found")))])]):e._e()]):e._e()])])])},i=[];A.d(t,"b",(function(){return a})),A.d(t,"c",(function(){return i})),A.d(t,"a",(function(){}))},,,,,,function(e,t,A){"use strict";function a(e){var t=Object.prototype.toString.call(e);return t.substring(8,t.length-1)}function i(){return"string"==typeof __channelId__&&__channelId__}Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),a=1;a<t;a++)A[a-1]=arguments[a];console[e].apply(console,A)},t.default=function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];var n=t.shift();if(i())return t.push(t.pop().replace("at ","uni-app:///")),console[n].apply(console,t);var o=t.map((function(e){var t=Object.prototype.toString.call(e).toLowerCase();if("[object object]"===t||"[object array]"===t)try{e="---BEGIN:JSON---"+JSON.stringify(e)+"---END:JSON---"}catch(t){e="[object object]"}else if(null===e)e="---NULL---";else if(void 0===e)e="---UNDEFINED---";else{var A=a(e).toUpperCase();e="NUMBER"===A||"BOOLEAN"===A?"---BEGIN:"+A+"---"+e+"---END:"+A+"---":String(e)}return e})),s="";if(o.length>1){var r=o.pop();s=o.join("---COMMA---"),0===r.indexOf(" at ")?s+=r:s+="---COMMA---"+r}else s=o[0];console[n](s)}},function(e,t,A){"use strict";A.r(t);var a=A(14),i=A.n(a);for(var n in a)"default"!==n&&function(e){A.d(t,e,(function(){return a[e]}))}(n);t.default=i.a},,,,,function(e,t,A){"use strict";A.r(t);A(3);var a=A(7);a.default.mpType="page",a.default.route="template/__uniappchooselocation",a.default.el="#root",new Vue(a.default)}]);
1
+ !function(e){var t={};function A(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,A),i.l=!0,i.exports}A.m=e,A.c=t,A.d=function(e,t,a){A.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},A.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},A.t=function(e,t){if(1&t&&(e=A(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(A.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)A.d(a,i,function(t){return e[t]}.bind(null,i));return a},A.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return A.d(t,"a",t),t},A.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},A.p="",A(A.s=41)}([function(e,t){e.exports={}},function(e,t,A){"use strict";function a(e,t,A,a,i,n,o,s,r,c){var l,u="function"==typeof e?e.options:e;if(r){u.components||(u.components={});var d=Object.prototype.hasOwnProperty;for(var h in r)d.call(r,h)&&!d.call(u.components,h)&&(u.components[h]=r[h])}if(c&&((c.beforeCreate||(c.beforeCreate=[])).unshift((function(){this[c.__module]=this})),(u.mixins||(u.mixins=[])).push(c)),t&&(u.render=t,u.staticRenderFns=A,u._compiled=!0),a&&(u.functional=!0),n&&(u._scopeId="data-v-"+n),o?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var f=u.render;u.render=function(e,t){return l.call(t),f(e,t)}}else{var g=u.beforeCreate;u.beforeCreate=g?[].concat(g,l):[l]}return{exports:e,options:u}}A.d(t,"a",(function(){return a}))},function(e,t,A){"use strict";var a;Object.defineProperty(t,"__esModule",{value:!0}),t.weexPlus=t.default=void 0,a="function"==typeof getUni?getUni:function(){var e=function(e){return"function"==typeof e},t=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},A=/^\$|^on|^create|Sync$|Manager$|^pause/,a=["os","getCurrentSubNVue","getSubNVueById","stopRecord","stopVoice","stopBackgroundAudio","stopPullDownRefresh","hideKeyboard","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","canIUse","navigateBack","closeSocket","pageScrollTo","drawCanvas"],n=function(e){return(!A.test(e)||"createBLEConnection"===e)&&!~a.indexOf(e)},o=function(A){return function(){for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e(o.success)||e(o.fail)||e(o.complete)?A.apply(void 0,[o].concat(i)):t(new Promise((function(e,t){A.apply(void 0,[Object.assign({},o,{success:e,fail:t})].concat(i)),Promise.prototype.finally=function(e){var t=this.constructor;return this.then((function(A){return t.resolve(e()).then((function(){return A}))}),(function(A){return t.resolve(e()).then((function(){throw A}))}))}})))}},s=[],r=void 0;function c(e){s.forEach((function(t){return t({origin:r,data:e})}))}var l=i.webview.currentWebview().id,u=new BroadcastChannel("UNI-APP-SUBNVUE");function d(e){var t=i.webview.getWebviewById(e);return t&&!t.$processed&&function(e){e.$processed=!0;var t=i.webview.currentWebview().id===e.id,A="uniNView"===e.__uniapp_origin_type&&e.__uniapp_origin_id,a=e.id;if(e.postMessage=function(e){A?u.postMessage({data:e,to:t?A:a}):w({type:"UniAppSubNVue",data:e})},e.onMessage=function(e){s.push(e)},e.__uniapp_mask_id){r=e.__uniapp_host;var n=e.__uniapp_mask,o=i.webview.getWebviewById(e.__uniapp_mask_id);o=o.parent()||o;var c=e.show,l=e.hide,d=e.close,h=function(){o.setStyle({mask:n})},f=function(){o.setStyle({mask:"none"})};e.show=function(){h();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return c.apply(e,A)},e.hide=function(){f();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return l.apply(e,A)},e.close=function(){f();for(var t=arguments.length,A=Array(t),a=0;a<t;a++)A[a]=arguments[a];return d.apply(e,A)}}}(t),t}u.onmessage=function(e){e.data.to===l&&c(e.data.data)};var h=weex.requireModule("plus"),f=weex.requireModule("globalEvent"),g=0,p={};f.addEventListener("plusMessage",(function(e){"UniAppJsApi"===e.data.type?v(e.data.id,e.data.data):"UniAppSubNVue"===e.data.type?c(e.data.data,e.data.options):"onNavigationBarButtonTap"===e.data.type?"function"==typeof _&&_(e.data.data):"onNavigationBarSearchInputChanged"===e.data.type?"function"==typeof y&&y(e.data.data):"onNavigationBarSearchInputConfirmed"===e.data.type?"function"==typeof B&&B(e.data.data):"onNavigationBarSearchInputClicked"===e.data.type&&"function"==typeof x&&x(e.data.data)}));var v=function(e,t){var A=p[e];A?(A(t),A.keepAlive||delete p[e]):console.error("callback["+e+"] is undefined")},m=function(t){var A,a,i=t.id,n=t.type,o=t.params;p[i]=(a=function(t){e(A)?A(t):A&&(~t.errMsg.indexOf(":ok")?e(A.success)&&A.success(t):~t.errMsg.indexOf(":fail")&&e(A.fail)&&A.fail(t),e(A.complete)&&A.complete(t))},(e(A=o)||A&&e(A.callback))&&(a.keepAlive=!0),a),h.postMessage({id:i,type:n,params:o},"__uniapp__service")};function w(e){h.postMessage(e,"__uniapp__service")}var b=function(e){return function(t){m({id:g++,type:e,params:t})}},_=void 0,y=void 0,B=void 0,x=void 0;function S(e){_=e}function C(e){y=e}function D(e){B=e}function L(e){x=e}function I(e){return weex.requireModule(e)}var E=weex.requireModule("dom"),k=weex.requireModule("globalEvent"),M=[];function N(e){"function"==typeof e&&(this.isUniAppReady?e():M.push(e))}k.addEventListener("plusMessage",(function(e){"UniAppReady"===e.data.type&&(N.isUniAppReady=!0,M.length&&(M.forEach((function(e){return e()})),M=[]))}));var j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O=weex.requireModule("stream"),P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/x-www-form-urlencoded";return"object"===(void 0===e?"undefined":j(e))?"POST"===t.toUpperCase()&&"application/json"===A.toLowerCase()?JSON.stringify(e):Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&"):e},G=weex.requireModule("plusstorage"),T=weex.requireModule("clipboard"),Q=function(){if("function"==typeof getUniEmitter)return getUniEmitter;var e={$on:function(){console.warn("uni.$on failed")},$off:function(){console.warn("uni.$off failed")},$once:function(){console.warn("uni.$once failed")},$emit:function(){console.warn("uni.$emit failed")}};return function(){return e}}();function U(e,t,A){return e[t].apply(e,A)}var F=Object.freeze({loadFontFace:function(t){var A=t.family,a=t.source,i=(t.desc,t.success),n=(t.fail,t.complete);E.addRule("fontFace",{fontFamily:A,src:a.replace(/"/g,"'")});var o={errMsg:"loadFontFace:ok",status:"loaded"};e(i)&&i(o),e(n)&&n(o)},ready:N,request:function(t){var A=t.url,a=t.data,i=t.header,n=t.method,o=void 0===n?"GET":n,s=t.dataType,r=void 0===s?"json":s,c=(t.responseType,t.success),l=t.fail,u=t.complete,d=!1,h=!1,f={};if(i)for(var g in i)h||"content-type"!==g.toLowerCase()?f[g]=i[g]:(h=!0,f["Content-Type"]=i[g]);return"GET"===o&&a&&(A=A+(~A.indexOf("?")?"&"===A.substr(-1)||"?"===A.substr(-1)?"":"&":"?")+P(a)),O.fetch({url:A,method:o,headers:f,type:"json"===r?"json":"text",body:"GET"!==o?P(a,o,f["Content-Type"]):""},(function(t){var A=t.status,a=(t.ok,t.statusText,t.data),i=t.headers,n={};!A||-1===A||d?(n.errMsg="request:fail",e(l)&&l(n)):(n.data=a,n.statusCode=A,n.header=i,e(c)&&c(n)),e(u)&&u(n)})),{abort:function(){d=!0}}},getStorage:function(t){var A=t.key,a=(t.data,t.success),i=t.fail,n=t.complete;G.getItem(A+"__TYPE",(function(t){if("success"===t.result){var o=t.data;G.getItem(A,(function(t){if("success"===t.result){var A=t.data;o&&A?("String"!==o&&(A=JSON.parse(A)),e(a)&&a({errMsg:"getStorage:ok",data:A})):(t.errMsg="setStorage:fail",e(i)&&i(t))}else t.errMsg="setStorage:fail",e(i)&&i(t);e(n)&&n(t)}))}else t.errMsg="setStorage:fail",e(i)&&i(t),e(n)&&n(t)}))},setStorage:function(t){var A=t.key,a=t.data,i=t.success,n=t.fail,o=t.complete,s="String";"object"===(void 0===a?"undefined":j(a))&&(s="Object",a=JSON.stringify(a)),G.setItem(A,a,(function(t){"success"===t.result?G.setItem(A+"__TYPE",s,(function(t){"success"===t.result?e(i)&&i({errMsg:"setStorage:ok"}):(t.errMsg="setStorage:fail",e(n)&&n(t))})):(t.errMsg="setStorage:fail",e(n)&&n(t)),e(o)&&o(t)}))},removeStorage:function(t){var A=t.key,a=(t.data,t.success),i=t.fail,n=t.complete;G.removeItem(A,(function(t){"success"===t.result?e(a)&&a({errMsg:"removeStorage:ok"}):(t.errMsg="removeStorage:fail",e(i)&&i(t)),e(n)&&n(t)})),G.removeItem(A+"__TYPE")},clearStorage:function(e){e.key,e.data,e.success,e.fail,e.complete},getClipboardData:function(t){var A=t.success,a=(t.fail,t.complete);T.getString((function(t){var i={errMsg:"getClipboardData:ok",data:t.data};e(A)&&A(i),e(a)&&a(i)}))},setClipboardData:function(t){var A=t.data,a=t.success,i=(t.fail,t.complete),n={errMsg:"setClipboardData:ok"};T.setString(A),e(a)&&a(n),e(i)&&i(n)},onSubNVueMessage:c,getSubNVueById:d,getCurrentSubNVue:function(){return d(i.webview.currentWebview().id)},$on:function(){return U(Q(),"$on",[].concat(Array.prototype.slice.call(arguments)))},$off:function(){return U(Q(),"$off",[].concat(Array.prototype.slice.call(arguments)))},$once:function(){return U(Q(),"$once",[].concat(Array.prototype.slice.call(arguments)))},$emit:function(){return U(Q(),"$emit",[].concat(Array.prototype.slice.call(arguments)))}}),R={os:{nvue:!0}},V={};return"undefined"!=typeof Proxy?V=new Proxy({},{get:function(e,t){if("os"===t)return{nvue:!0};if("postMessage"===t)return w;if("requireNativePlugin"===t)return I;if("onNavigationBarButtonTap"===t)return S;if("onNavigationBarSearchInputChanged"===t)return C;if("onNavigationBarSearchInputConfirmed"===t)return D;if("onNavigationBarSearchInputClicked"===t)return L;var A=F[t];return A||(A=b(t)),n(t)?o(A):A}}):(Object.keys(R).forEach((function(e){V[e]=R[e]})),V.postMessage=w,V.requireNativePlugin=I,V.onNavigationBarButtonTap=S,V.onNavigationBarSearchInputChanged=C,V.onNavigationBarSearchInputConfirmed=D,V.onNavigationBarSearchInputClicked=L,Object.keys({uploadFile:!0,downloadFile:!0,chooseImage:!0,previewImage:!0,getImageInfo:!0,saveImageToPhotosAlbum:!0,chooseVideo:!0,saveVideoToPhotosAlbum:!0,saveFile:!0,getSavedFileList:!0,getSavedFileInfo:!0,removeSavedFile:!0,openDocument:!0,setStorage:!0,getStorage:!0,getStorageInfo:!0,removeStorage:!0,clearStorage:!0,getLocation:!0,chooseLocation:!0,openLocation:!0,getSystemInfo:!0,getNetworkType:!0,makePhoneCall:!0,scanCode:!0,setScreenBrightness:!0,getScreenBrightness:!0,setKeepScreenOn:!0,vibrateLong:!0,vibrateShort:!0,addPhoneContact:!0,showToast:!0,showLoading:!0,hideToast:!0,hideLoading:!0,showModal:!0,showActionSheet:!0,setNavigationBarTitle:!0,setNavigationBarColor:!0,navigateTo:!0,redirectTo:!0,reLaunch:!0,switchTab:!0,navigateBack:!0,getProvider:!0,login:!0,getUserInfo:!0,share:!0,requestPayment:!0,subscribePush:!0,unsubscribePush:!0,onPush:!0,offPush:!0}).forEach((function(e){var t=F[e];t||(t=b(e)),n(e)?V[e]=o(t):V[e]=t}))),V};var i=new WeexPlus(weex);t.weexPlus=i;var n=a(weex,i,BroadcastChannel);t.default=n},function(e,t,A){Vue.prototype.__$appStyle__={},Vue.prototype.__merge_style&&Vue.prototype.__merge_style(A(4).default,Vue.prototype.__$appStyle__)},function(e,t,A){"use strict";A.r(t);var a=A(0),i=A.n(a);for(var n in a)"default"!==n&&function(e){A.d(t,e,(function(){return a[e]}))}(n);t.default=i.a},function(e,t,A){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var A={onLoad:function(){this.initMessage()},methods:{initMessage:function(){var t=this,A=e.webview.currentWebview().extras||{},a=A.from,i=(A.callback,A.runtime),n=A.data,o=void 0===n?{}:n,s=A.useGlobalEvent;this.__from=a,this.__runtime=i,this.__page=e.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(o)),e.key.addEventListener("backbutton",(function(){"function"==typeof t.onClose?t.onClose():e.webview.currentWebview().close("auto")}));var r=this,c=function(e){var t=e.data&&e.data.__message;t&&r.__onMessageCallback&&r.__onMessageCallback(t.data)};this.__useGlobalEvent?weex.requireModule("globalEvent").addEventListener("plusMessage",c):new BroadcastChannel(this.__page).onmessage=c},postMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:t,keep:A}})),i=this.__from;if("v8"===this.__runtime)if(this.__useGlobalEvent)e.webview.postMessageToUniNView(a,i);else{var n=new BroadcastChannel(i);n.postMessage(a)}else{var o=e.webview.getWebviewById(i);o&&o.evalJS("__plusMessage&&__plusMessage(".concat(JSON.stringify({data:a}),")"))}},onMessage:function(e){this.__onMessageCallback=e}}};t.default=A}).call(this,A(2).weexPlus)},function(e,t,A){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var A={data:function(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"完成",cancel:"取消"},"zh-hans":{},"zh-hant":{},messages:{}}}},onLoad:function(){this.initLocale()},created:function(){this.initLocale()},methods:{initLocale:function(){if(!this.__initLocale){this.__initLocale=!0;var t=(e.webview.currentWebview().extras||{}).data||{};if(t.messages&&(this.localization.messages=t.messages),t.locale)this.locale=t.locale.toLowerCase();else{var A=e.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),a=A[1];a&&(A[1]={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"}[a]||a),A.length=A.length>2?2:A.length,this.locale=A.join("-")}}},localize:function(e){var t=this.locale,A=t.split("-")[0],a=this.fallbackLocale,i=this.localization;function n(e){return i[e]||{}}return n("messages")[e]||n(t)[e]||n(A)[e]||n(a)[e]||e}}};t.default=A}).call(this,A(2).weexPlus)},function(e,t,A){"use strict";var a=A(29),i=A(12),n=A(1);var o=Object(n.a)(i.default,a.b,a.c,!1,null,null,"14d2bcf2",!1,a.a,void 0);(function(e){this.options.style||(this.options.style={}),Vue.prototype.__merge_style&&Vue.prototype.__$appStyle__&&Vue.prototype.__merge_style(Vue.prototype.__$appStyle__,this.options.style),Vue.prototype.__merge_style?Vue.prototype.__merge_style(A(36).default,this.options.style):Object.assign(this.options.style,A(36).default)}).call(o),t.default=o.exports},,,,,function(e,t,A){"use strict";var a=A(13),i=A.n(a);t.default=i.a},function(e,t,A){"use strict";(function(e,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(A(5)),n=o(A(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),A.push.apply(A,a)}return A}function r(e,t,A){return t in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}weex.requireModule("dom").addRule("fontFace",{fontFamily:"unichooselocation",src:"url('data:font/truetype;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzI8gE4kAAABfAAAAFZjbWFw4nGd6QAAAegAAAGyZ2x5Zn61L/EAAAOoAAACJGhlYWQXJ/zZAAAA4AAAADZoaGVhB94DhgAAALwAAAAkaG10eBQAAAAAAAHUAAAAFGxvY2EBUAGyAAADnAAAAAxtYXhwARMAZgAAARgAAAAgbmFtZWs+cdAAAAXMAAAC2XBvc3SV1XYLAAAIqAAAAE4AAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAAUAAQAAAAEAAFP+qyxfDzz1AAsEAAAAAADaBFxuAAAAANoEXG4AAP+gBAADYAAAAAgAAgAAAAAAAAABAAA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mLimJcENoKlOnBWsr8KbRNUGYt5LXgd6HtD3lNQIoyN4S2G5RJIUOZm0LbTcqsBqVmhLYZSlkPsP4VWf+Rrd+m1v9o9h8Vv5p42C1R5qL1x7WRglOgVN52yfwNOBu76P+lLPoYidu23KPciIHGa07ZeIW1jvcNtI7q5vexCPGYCmf+m/Y9a3sAwQ5bI9T7ukPgPcn9GToEao+xk1OixJT+GIsvNAbx6eAgPq0xiF+KtkpYKhRXCQ8eFFcJhSWGu3rZ8jJkCM8kz9K4TUnrC6mAgzTsB9tLwQ2W15qfosQ2GrQNpZr7aczbzVjBZsvLcaC1g0bsbIVEnU8DOr6H1KDH2LwtUBi0/JII6Dxm9zUXkH+XMWzfh1Dte1i2Pe3QkC77Zel7aehpO8wyHG6Dtt0NjKxhN6I4uSli/TqJiJJDUQ4NDCURXTrXRy1XcumyD24M+AzhD1RXIIZsl/LoyZmurJHDM7s8lvB2FQ/PmPJ6PseAXP5HGMYAAC7ABbgAF+ACXIALcAEuwAW4ABfgAlyAC3ABLsAFuID/d8Cx4NEt8/byOf0wLnis8zjMq9/Kp7bWw4JOj8u8TlhRl+G/Mp2wpOX48GffvvZ1CyL4B53LAS6zb08EAAAAAElFTkSuQmCC";var u={mixins:[i.default,n.default],data:function(){return{positionIcon:l,mapScale:16,userKeyword:"",showLocation:!0,latitude:39.908692,longitude:116.397477,nearList:[],nearSelectedIndex:-1,nearLoading:!1,nearLoadingEnd:!1,noNearData:!1,isUserLocation:!1,statusBarHeight:20,mapHeight:250,markers:[{id:"location",latitude:39.908692,longitude:116.397477,zIndex:"1",iconPath:l,width:26,height:36}],showSearch:!1,searchList:[],searchSelectedIndex:-1,searchLoading:!1,searchEnd:!1,noSearchData:!1,localization:{en:{search_tips:"Search for a place",no_found:"No results found",nearby:"Nearby",more:"More"},zh:{search_tips:"搜索地点",no_found:"对不起,没有搜索到相关数据",nearby:"附近",more:"更多"}},searchNearFlag:!0,searchMethod:"poiSearchNearBy"}},computed:{disableOK:function(){return this.nearSelectedIndex<0&&this.searchSelectedIndex<0},searchMethods:function(){return[{title:this.localize("nearby"),method:"poiSearchNearBy"},{title:this.localize("more"),method:"poiKeywordsSearch"}]}},filters:{distance:function(e){return e>100?"".concat(e>1e3?(e/1e3).toFixed(1)+"k":e.toFixed(0),"m | "):e>0?"100m内 | ":""}},watch:{searchMethod:function(){this._searchPageIndex=1,this.searchEnd=!1,this.searchList=[],this._searchKeyword&&this.search()}},onLoad:function(){this.statusBarHeight=e.navigator.getStatusbarHeight(),this.mapHeight=e.screen.resolutionHeight/2;var t=this.data;this.userKeyword=t.keyword||"",this._searchInputTimer=null,this._searchPageIndex=1,this._searchKeyword="",this._nearPageIndex=1,this._hasUserLocation=!1,this._userLatitude=0,this._userLongitude=0},onReady:function(){this.mapContext=this.$refs.map1,this.data.latitude&&this.data.longitude?(this._hasUserLocation=!0,this.moveToCenter({latitude:this.data.latitude,longitude:this.data.longitude})):this.getUserLocation()},onUnload:function(){this.clearSearchTimer()},methods:{cancelClick:function(){this.postMessage({event:"cancel"})},doneClick:function(){if(!this.disableOK){var e=this.showSearch&&this.searchSelectedIndex>=0?this.searchList[this.searchSelectedIndex]:this.nearList[this.nearSelectedIndex],t={name:e.name,address:e.address,latitude:e.location.latitude,longitude:e.location.longitude};this.postMessage({event:"selected",detail:t})}},getUserLocation:function(){var t=this;e.geolocation.getCurrentPosition((function(e){var A=e.coordsType,a=e.coords;"wgs84"===A.toLowerCase()?t.wgs84togcjo2(a,(function(e){t.getUserLocationSuccess(e)})):t.getUserLocationSuccess(a)}),(function(e){t._hasUserLocation=!0,a("log","Gelocation Error: code - "+e.code+"; message - "+e.message," at template/__uniappchooselocation.nvue:292")}),{geocode:!1})},getUserLocationSuccess:function(e){this._userLatitude=e.latitude,this._userLongitude=e.longitude,this._hasUserLocation=!0,this.moveToCenter({latitude:e.latitude,longitude:e.longitude})},searchclick:function(t){this.showSearch=t,!1===t&&e.key.hideSoftKeybord()},showSearchView:function(){this.searchList=[],this.showSearch=!0},hideSearchView:function(){this.showSearch=!1,e.key.hideSoftKeybord(),this.noSearchData=!1,this.searchSelectedIndex=-1,this._searchKeyword=""},onregionchange:function(e){var t=this,A=e.detail,a=A.type||e.type;"drag"===(A.causedBy||e.causedBy)&&"end"===a&&this.mapContext.getCenterLocation((function(e){t.searchNearFlag?t.moveToCenter({latitude:e.latitude,longitude:e.longitude}):t.searchNearFlag=!t.searchNearFlag}))},onItemClick:function(e,t){this.searchNearFlag=!1,t.stopPropagation&&t.stopPropagation(),this.nearSelectedIndex!==e&&(this.nearSelectedIndex=e),this.moveToLocation(this.nearList[e]&&this.nearList[e].location)},moveToCenter:function(e){this.latitude===e.latitude&&this.longitude===e.longitude||(this.latitude=e.latitude,this.longitude=e.longitude,this.updateCenter(e),this.moveToLocation(e),this.isUserLocation=this._userLatitude===e.latitude&&this._userLongitude===e.longitude)},updateCenter:function(e){var t=this;this.nearSelectedIndex=-1,this.nearList=[],this._hasUserLocation&&(this._nearPageIndex=1,this.nearLoadingEnd=!1,this.reverseGeocode(e),this.searchNearByPoint(e),this.onItemClick(0,{stopPropagation:function(){t.searchNearFlag=!0}}),this.$refs.nearListLoadmore.resetLoadmore())},searchNear:function(){this.nearLoadingEnd||this.searchNearByPoint({latitude:this.latitude,longitude:this.longitude})},searchNearByPoint:function(e){var t=this;this.noNearData=!1,this.nearLoading=!0,c.poiSearchNearBy({point:{latitude:e.latitude,longitude:e.longitude},key:this.userKeyword,sortrule:1,index:this._nearPageIndex,radius:1e3},(function(e){t.nearLoading=!1,t._nearPageIndex=e.pageIndex+1,t.nearLoadingEnd=e.pageIndex===e.pageNumber,e.poiList&&e.poiList.length?(t.fixPois(e.poiList),t.nearList=t.nearList.concat(e.poiList),t.fixNearList()):t.noNearData=0===t.nearList.length}))},moveToLocation:function(e){e&&this.mapContext.moveToLocation(function(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?s(Object(A),!0).forEach((function(t){r(e,t,A[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):s(Object(A)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))}))}return e}({},e,{fail:function(e){a("error","chooseLocation_moveToLocation",e," at template/__uniappchooselocation.nvue:419")}}))},reverseGeocode:function(e){var t=this;c.reverseGeocode({point:e},(function(A){"success"===A.type&&t._nearPageIndex<=2&&(t.nearList.splice(0,0,{code:A.code,location:e,name:"地图位置",address:A.address||""}),t.fixNearList())}))},fixNearList:function(){var e=this.nearList;if(e.length>=2&&"地图位置"===e[0].name){var t=this.getAddressStart(e[1]),A=e[0].address;A.startsWith(t)&&(e[0].name=A.substring(t.length))}},onsearchinput:function(e){var t=this,A=e.detail.value.replace(/^\s+|\s+$/g,"");this.clearSearchTimer(),this._searchInputTimer=setTimeout((function(){clearTimeout(t._searchInputTimer),t._searchPageIndex=1,t.searchEnd=!1,t._searchKeyword=A,t.searchList=[],t.search()}),300)},clearSearchTimer:function(){this._searchInputTimer&&clearTimeout(this._searchInputTimer)},search:function(){var e=this;0===this._searchKeyword.length||this._searchEnd||this.searchLoading||(this.searchLoading=!0,this.noSearchData=!1,c[this.searchMethod]({point:{latitude:this.latitude,longitude:this.longitude},key:this._searchKeyword,sortrule:1,index:this._searchPageIndex,radius:5e4},(function(t){e.searchLoading=!1,e._searchPageIndex=t.pageIndex+1,e.searchEnd=t.pageIndex===t.pageNumber,t.poiList&&t.poiList.length?(e.fixPois(t.poiList),e.searchList=e.searchList.concat(t.poiList)):e.noSearchData=0===e.searchList.length})))},onSearchListTouchStart:function(){e.key.hideSoftKeybord()},onSearchItemClick:function(e,t){t.stopPropagation(),this.searchSelectedIndex!==e&&(this.searchSelectedIndex=e),this.moveToLocation(this.searchList[e]&&this.searchList[e].location)},getAddressStart:function(e){var t=e.addressOrigin||e.address;return e.province+(e.province===e.city?"":e.city)+(/^\d+$/.test(e.district)?"":t.startsWith(e.district)?"":e.district)},fixPois:function(e){for(var t=0;t<e.length;t++){var A=e[t];A.name=A.name.replace(/\\/g,""),A.addressOrigin=A.address.replace(/\\/g,""),A.address=this.getAddressStart(A)+A.addressOrigin}},wgs84togcjo2:function(e,t){var A=weex.requireModule("stream"),a="https://apis.map.qq.com/jsapi?qt=translate&type=1&points=".concat(e.longitude,",").concat(e.latitude,"&key=MAP_KEY&output=json&pf=jsapi&ref=jsapi");A.fetch({method:"GET",url:a,type:"json"},(function(e){if(e.ok){var A=e.data.detail.points[0];t({latitude:A.lat,longitude:A.lng})}}))}}};t.default=u}).call(this,A(2).weexPlus,A(35).default)},function(e,t){e.exports={map_center_marker_container:{alignItems:"flex-start",width:"22",height:"70"},map_center_marker:{width:"22",height:"35"},"unichooselocation-icons":{fontFamily:"unichooselocation",textDecoration:"none",textAlign:"center"},page:{flex:1,position:"relative"},"flex-r":{flexDirection:"row",flexWrap:"nowrap"},"flex-c":{flexDirection:"column",flexWrap:"nowrap"},"flex-fill":{flex:1},"a-i-c":{alignItems:"center"},"j-c-c":{justifyContent:"center"},"nav-cover":{position:"absolute",left:0,top:0,right:0,height:"100",backgroundImage:"linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0))"},statusbar:{height:"22"},"title-view":{paddingTop:"5",paddingRight:"15",paddingBottom:"5",paddingLeft:"15"},"btn-cancel":{paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},"btn-cancel-text":{fontSize:"30",color:"#ffffff"},"btn-done":{backgroundColor:"#007AFF",borderRadius:"3",paddingTop:"5",paddingRight:"12",paddingBottom:"5",paddingLeft:"12"},"btn-done-disabled":{backgroundColor:"#62abfb"},"text-done":{color:"#ffffff",fontSize:"15",fontWeight:"bold",lineHeight:"15",height:"15"},"text-done-disabled":{color:"#c0ddfe"},"map-view":{flex:2,position:"relative"},map:{width:"750rpx",justifyContent:"center",alignItems:"center"},"map-location":{position:"absolute",right:"20",bottom:"25",width:"44",height:"44",backgroundColor:"#ffffff",borderRadius:"40",boxShadow:"0 2px 4px rgba(100, 100, 100, 0.2)"},"map-location-text":{fontSize:"20"},"map-location-text-active":{color:"#007AFF"},"result-area":{flex:2,position:"relative"},"search-bar":{paddingTop:"12",paddingRight:"15",paddingBottom:"12",paddingLeft:"15",backgroundColor:"#ffffff"},"search-area":{backgroundColor:"#ebebeb",borderRadius:"5",height:"30",paddingLeft:"8"},"search-text":{fontSize:"14",lineHeight:"16",color:"#b4b4b4"},"search-icon":{fontSize:"16",color:"#b4b4b4",marginRight:"4"},"search-tab":{flexDirection:"row",paddingTop:"2",paddingRight:"16",paddingBottom:"2",paddingLeft:"16",marginTop:"-10",backgroundColor:"#FFFFFF"},"search-tab-item":{marginTop:0,marginRight:"5",marginBottom:0,marginLeft:"5",textAlign:"center",fontSize:"14",lineHeight:"32",color:"#333333",borderBottomStyle:"solid",borderBottomWidth:"2",borderBottomColor:"rgba(0,0,0,0)"},"search-tab-item-active":{borderBottomColor:"#0079FF"},"no-data":{color:"#808080"},"no-data-search":{marginTop:"50"},"list-item":{position:"relative",paddingTop:"12",paddingRight:"15",paddingBottom:"12",paddingLeft:"15"},"list-line":{position:"absolute",left:"15",right:0,bottom:0,height:".5",backgroundColor:"#d3d3d3"},"list-name":{fontSize:"14",lines:1,textOverflow:"ellipsis"},"list-address":{fontSize:"12",color:"#808080",lines:1,textOverflow:"ellipsis",marginTop:"5"},"list-icon-area":{paddingLeft:"10",paddingRight:"10"},"list-selected-icon":{fontSize:"20",color:"#007AFF"},"search-view":{position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"#f6f6f6"},"searching-area":{flex:5},"search-input":{fontSize:"14",height:"30",paddingLeft:"6"},"search-cancel":{color:"#0079FF",marginLeft:"10"},"loading-view":{paddingTop:"15",paddingRight:"15",paddingBottom:"15",paddingLeft:"15"},"loading-icon":{width:"28",height:"28",color:"#808080"}}},,,,,,,,,,,,,,,function(e,t,A){"use strict";var a=function(){var e=this,t=e.$createElement,A=e._self._c||t;return A("scroll-view",{staticStyle:{flexDirection:"column"},attrs:{scrollY:!0,enableBackToTop:!0,bubble:"true"}},[A("view",{staticClass:["page","flex-c"]},[A("view",{staticClass:["flex-r","map-view"]},[A("map",{ref:"map1",staticClass:["map","flex-fill"],style:"height:"+e.mapHeight+"px",attrs:{scale:e.mapScale,showLocation:e.showLocation,longitude:e.longitude,latitude:e.latitude},on:{regionchange:e.onregionchange}},[A("div",{staticClass:["map_center_marker_container"]},[A("u-image",{staticClass:["map_center_marker"],attrs:{src:e.positionIcon}})],1)]),A("view",{staticClass:["map-location","flex-c","a-i-c","j-c-c"],on:{click:function(t){e.getUserLocation()}}},[A("u-text",{staticClass:["unichooselocation-icons","map-location-text"],class:{"map-location-text-active":e.isUserLocation}},[e._v("")])]),A("view",{staticClass:["nav-cover"]},[A("view",{staticClass:["statusbar"],style:"height:"+e.statusBarHeight+"px"}),A("view",{staticClass:["title-view","flex-r"]},[A("view",{staticClass:["btn-cancel"],on:{click:e.cancelClick}},[A("u-text",{staticClass:["unichooselocation-icons","btn-cancel-text"]},[e._v("")])]),A("view",{staticClass:["flex-fill"]}),A("view",{staticClass:["btn-done","flex-r","a-i-c","j-c-c"],class:{"btn-done-disabled":e.disableOK},on:{click:e.doneClick}},[A("u-text",{staticClass:["text-done"],class:{"text-done-disabled":e.disableOK}},[e._v(e._s(e.localize("done")))])])])])],1),A("view",{staticClass:["flex-c","result-area"],class:{"searching-area":e.showSearch}},[A("view",{staticClass:["search-bar"]},[A("view",{staticClass:["search-area","flex-r","a-i-c"],on:{click:e.showSearchView}},[A("u-text",{staticClass:["search-icon","unichooselocation-icons"]},[e._v("")]),A("u-text",{staticClass:["search-text"]},[e._v(e._s(e.localize("search_tips")))])])]),e.noNearData?e._e():A("list",{ref:"nearListLoadmore",staticClass:["flex-fill","list-view"],attrs:{loadmoreoffset:"5",scrollY:!0},on:{loadmore:function(t){e.searchNear()}}},[e._l(e.nearList,(function(t,a){return A("cell",{key:t.uid,appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["list-item"],on:{click:function(t){e.onItemClick(a,t)}}},[A("view",{staticClass:["flex-r"]},[A("view",{staticClass:["list-text-area","flex-fill","flex-c"]},[A("u-text",{staticClass:["list-name"]},[e._v(e._s(t.name))]),A("u-text",{staticClass:["list-address"]},[e._v(e._s(e._f("distance")(t.distance))+e._s(t.address))])]),a===e.nearSelectedIndex?A("view",{staticClass:["list-icon-area","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["unichooselocation-icons","list-selected-icon"]},[e._v("")])]):e._e()]),A("view",{staticClass:["list-line"]})])])})),e.nearLoading?A("cell",{appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["loading-view","flex-c","a-i-c","j-c-c"]},[A("loading-indicator",{staticClass:["loading-icon"],attrs:{animating:!0,arrow:"false"}})])]):e._e()],2),e.noNearData?A("view",{staticClass:["flex-fill","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["no-data"]},[e._v(e._s(e.localize("no_found")))])]):e._e(),e.showSearch?A("view",{staticClass:["search-view","flex-c"]},[A("view",{staticClass:["search-bar","flex-r","a-i-c"]},[A("view",{staticClass:["search-area","flex-fill","flex-r"]},[A("u-input",{staticClass:["search-input","flex-fill"],attrs:{focus:!0,placeholder:e.localize("search_tips")},on:{input:e.onsearchinput}})],1),A("u-text",{staticClass:["search-cancel"],on:{click:e.hideSearchView}},[e._v(e._s(e.localize("cancel")))])]),A("view",{staticClass:["search-tab"]},e._l(e.searchMethods,(function(t,a){return A("u-text",{key:a,staticClass:["search-tab-item"],class:{"search-tab-item-active":t.method===e.searchMethod},on:{click:function(A){e.searchMethod=e.searchLoading?e.searchMethod:t.method}}},[e._v(e._s(t.title))])})),0),e.noSearchData?e._e():A("list",{staticClass:["flex-fill","list-view"],attrs:{enableBackToTop:!0,scrollY:!0},on:{loadmore:function(t){e.search()},touchstart:e.onSearchListTouchStart}},[e._l(e.searchList,(function(t,a){return A("cell",{key:t.uid,appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["list-item"],on:{click:function(t){e.onSearchItemClick(a,t)}}},[A("view",{staticClass:["flex-r"]},[A("view",{staticClass:["list-text-area","flex-fill","flex-c"]},[A("u-text",{staticClass:["list-name"]},[e._v(e._s(t.name))]),A("u-text",{staticClass:["list-address"]},[e._v(e._s(e._f("distance")(t.distance))+e._s(t.address))])]),a===e.searchSelectedIndex?A("view",{staticClass:["list-icon-area","flex-r","a-i-c","j-c-c"]},[A("u-text",{staticClass:["unichooselocation-icons","list-selected-icon"]},[e._v("")])]):e._e()]),A("view",{staticClass:["list-line"]})])])})),e.searchLoading?A("cell",{appendAsTree:!0,attrs:{append:"tree"}},[A("view",{staticClass:["loading-view","flex-c","a-i-c","j-c-c"]},[A("loading-indicator",{staticClass:["loading-icon"],attrs:{animating:!0}})])]):e._e()],2),e.noSearchData?A("view",{staticClass:["flex-fill","flex-r","j-c-c"]},[A("u-text",{staticClass:["no-data","no-data-search"]},[e._v(e._s(e.localize("no_found")))])]):e._e()]):e._e()])])])},i=[];A.d(t,"b",(function(){return a})),A.d(t,"c",(function(){return i})),A.d(t,"a",(function(){}))},,,,,,function(e,t,A){"use strict";function a(e){var t=Object.prototype.toString.call(e);return t.substring(8,t.length-1)}function i(){return"string"==typeof __channelId__&&__channelId__}Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),a=1;a<t;a++)A[a-1]=arguments[a];console[e].apply(console,A)},t.default=function(){for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];var n=t.shift();if(i())return t.push(t.pop().replace("at ","uni-app:///")),console[n].apply(console,t);var o=t.map((function(e){var t=Object.prototype.toString.call(e).toLowerCase();if("[object object]"===t||"[object array]"===t)try{e="---BEGIN:JSON---"+JSON.stringify(e)+"---END:JSON---"}catch(t){e="[object object]"}else if(null===e)e="---NULL---";else if(void 0===e)e="---UNDEFINED---";else{var A=a(e).toUpperCase();e="NUMBER"===A||"BOOLEAN"===A?"---BEGIN:"+A+"---"+e+"---END:"+A+"---":String(e)}return e})),s="";if(o.length>1){var r=o.pop();s=o.join("---COMMA---"),0===r.indexOf(" at ")?s+=r:s+="---COMMA---"+r}else s=o[0];console[n](s)}},function(e,t,A){"use strict";A.r(t);var a=A(14),i=A.n(a);for(var n in a)"default"!==n&&function(e){A.d(t,e,(function(){return a[e]}))}(n);t.default=i.a},,,,,function(e,t,A){"use strict";A.r(t);A(3);var a=A(7);a.default.mpType="page",a.default.route="template/__uniappchooselocation",a.default.el="#root",new Vue(a.default)}]);