jufubao-base 1.0.373 → 1.0.375

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.373",
3
+ "version": "1.0.375",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -46,7 +46,8 @@ export default (data, gValue, gColor, oldData={})=>{
46
46
  isPath: false,
47
47
  isService: true,
48
48
  isWX: true,
49
- isPhone: true
49
+ isPhone: true,
50
+ isNoUrl: true,
50
51
  }
51
52
  },
52
53
  handleCustom({action,data}){
@@ -11,7 +11,7 @@
11
11
  >
12
12
  <bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT" type="NavigationControlType"></bm-navigation>
13
13
  <bm-geolocation
14
- v-if="isGeolocation"
14
+ v-if="isGeolocation && !isWebviewMp"
15
15
  @locationSuccess="handleLocationSuccess"
16
16
  class="xd-baidu__content-geolocation"
17
17
  anchor="BMAP_ANCHOR_BOTTOM_RIGHT"
@@ -230,12 +230,14 @@
230
230
  //判断地图是否加载完成
231
231
  BMap: null,
232
232
  loaded: false,
233
+ isWebviewMp: false,//是否是小程序套嵌情况
233
234
  }
234
235
  },
235
236
 
236
237
 
237
238
  created() {
238
239
  this.uiAk = this.$settings.baiduAk || this.ak;
240
+ this.isWebviewMp = !!navigator.userAgent.match(/miniprogram/i);
239
241
  if(!this.uiAk) throw new Error('请传入百度AK值');
240
242
  else{
241
243
  let uiCenter = '北京';
@@ -292,24 +294,34 @@
292
294
 
293
295
  handleInitDone({BMap}){
294
296
  if(this.isGeolocation) {
295
- let geolocation = new BMap['Geolocation']();
296
- geolocation['enableSDKLocation']();
297
- geolocation.getCurrentPosition(
298
- (location) => {
299
- console.log('handleInitDone',location)
300
- if(!this.defaultOverlays || this.defaultOverlays.length === 0) {
301
- let point = this.$xdUniHelper.cloneDeep(location.point);
302
- delete point['of']
303
- this.uiGeolocation = point;
304
- this.uiLevel = 15;
305
- this.uiCenter = point;
297
+
298
+ //非小程序套嵌情况
299
+ if(!this.isWebviewMp){
300
+ let geolocation = new BMap['Geolocation']();
301
+ geolocation['enableSDKLocation']();
302
+ geolocation.getCurrentPosition(
303
+ (location) => {
304
+ console.log('handleInitDone',location)
305
+ if(!this.defaultOverlays || this.defaultOverlays.length === 0) {
306
+ let point = this.$xdUniHelper.cloneDeep(location.point);
307
+ delete point['of']
308
+ this.uiGeolocation = point;
309
+ this.uiLevel = 15;
310
+ this.uiCenter = point;
311
+ }
312
+ this.$emit('onLocationSuccess',location);
313
+ },
314
+ (error) => {
315
+ console.log('handleInitDone',error)
306
316
  }
307
- this.$emit('onLocationSuccess',location);
308
- },
309
- (error) => {
310
- console.log('handleInitDone',error)
311
- }
312
- )
317
+ )
318
+ }
319
+
320
+ //小程序套嵌情况
321
+ else {
322
+ //todo
323
+ }
324
+
313
325
  }
314
326
  },
315
327