Преглед на файлове

fix: 升级获取定位权限

Basil преди 3 години
родител
ревизия
e7db3b67fa
променени са 3 файла, в които са добавени 45 реда и са изтрити 31 реда
  1. 15 3
      src/manifest.json
  2. 13 13
      src/pages/tao_ke/other_goods_detail.vue
  3. 17 15
      src/pages/tao_ke/sift.vue

+ 15 - 3
src/manifest.json

@@ -7,7 +7,7 @@
7 7
     "transformPx" : false,
8 8
     /* 5+App特有相关 */
9 9
     "app-plus" : {
10
-        //prompt取值为template时有效,用于配置模板提示框上显示的内容  
10
+        //prompt取值为template时有效,用于配置模板提示框上显示的内容
11 11
         "usingComponents" : true,
12 12
         "nvueCompiler" : "uni-app",
13 13
         "splashscreen" : {
@@ -262,10 +262,22 @@
262 262
             "es6" : true
263 263
         },
264 264
         "permission" : {
265
-            "scope.userLocation" : {
266
-                "desc" : "获取您的位置"
265
+            "scope.userLocation": {
266
+                "desc": "你的位置信息将用于小程序位置接口的效果展示"
267
+            },
268
+            "scope.userFuzzyLocation": {
269
+                "desc": "你的位置信息将用于小程序位置接口的效果展示"
267 270
             }
268 271
         },
272
+        "requiredPrivateInfos": [
273
+            "chooseAddress",
274
+            "chooseLocation",
275
+            "choosePoi",
276
+            "getLocation",
277
+            "onLocationChange",
278
+            "startLocationUpdateBackground",
279
+            "startLocationUpdate"
280
+        ],
269 281
         "usingComponents" : true
270 282
     },
271 283
     "mp-alipay" : {

+ 13 - 13
src/pages/tao_ke/other_goods_detail.vue

@@ -198,7 +198,7 @@
198 198
 			}
199 199
 			this.user_msg = uni.getStorageSync('USERINFO');
200 200
 			this.user_data = uni.getStorageSync('user_data');
201
-			
201
+
202 202
 				if (e.status == 0) { // 获取京东的详情页面
203 203
 					this.getJDInfo()
204 204
 				} else if (this.typeStatus == 1) { // 获取淘宝的详情页面
@@ -317,7 +317,7 @@
317 317
 				// })
318 318
 				// return
319 319
 				console.log(type,'这是什么?');
320
-			
320
+
321 321
 				if (type == 'su') { // 苏宁的跳转外链购买
322 322
 					this.openTaoKe(this.couUrl)
323 323
 				}
@@ -325,7 +325,7 @@
325 325
 				console.log(this.vipLink,'vipLink');
326 326
 				let link = this.vipLink;
327 327
 				this.jingdo(link)
328
-					// #ifdef H5 
328
+					// #ifdef H5
329 329
 					uni.navigateTo({
330 330
 						url: '/pages/tao_ke/taokes?url=' + this.vipLink
331 331
 					});
@@ -335,14 +335,14 @@
335 335
 						})) {
336 336
 						this.openJingdong(this.vipLink);
337 337
 					} else {
338
-					
338
+
339 339
 						console.log("京东未安装");
340 340
 					}
341 341
 					// #endif
342 342
 				} else if (this.typeStatus == 1) { // 淘宝
343 343
 					// #ifdef H5 || MP
344 344
 					// console.log(this.JumpLink);
345
-					
345
+
346 346
 					getTBDetail(this.id).then(res => {
347 347
 						let url = res.data.item_url
348 348
 						// console.log(url);
@@ -352,20 +352,20 @@
352 352
 					});
353 353
 
354 354
 					// if(plus.runtime.isApplicationExist({
355
-					// 	pname: 'com.taobao.taobao',  
356
-					// 	action: 'taobao://'  
357
-					// })){  
355
+					// 	pname: 'com.taobao.taobao',
356
+					// 	action: 'taobao://'
357
+					// })){
358 358
 					// 	this.openTaoBao(this.vipLink);
359
-					// }else{  
359
+					// }else{
360 360
 					// 	 uni.navigateTo({
361 361
 					// 		url: './taokes?url='+this.vipLink
362
-					// 	}); 
363
-					// 	console.log("淘宝未安装");  
362
+					// 	});
363
+					// 	console.log("淘宝未安装");
364 364
 					// }
365 365
 					// #endif
366
-				} else if (this.typeStatus == 3) { // 唯品会 
366
+				} else if (this.typeStatus == 3) { // 唯品会
367 367
 					// #ifdef H5 || MP
368
-					
368
+
369 369
 						// this.openVPH(this.vipLink);
370 370
 						let Arr = this.vipLink.split('&')
371 371
 						console.log(Arr);

+ 17 - 15
src/pages/tao_ke/sift.vue

@@ -121,8 +121,10 @@
121 121
 							<view class="mer-box">
122 122
 								<view class="boxList">
123 123
 									<view style="margin-top: 10px;" :id=" JSON.stringify(item) " class="smallBoxList"
124
-										v-for="(item, index) in getJdListNewList.length == 0 ? JDList : getJdListNewList"
125
-										@click="godetal">
124
+										v-for="(item, itemIndex) in getJdListNewList.length == 0 ? JDList : getJdListNewList"
125
+										@click="godetal"
126
+                        :key="itemIndex"
127
+                  >
126 128
 										<image :src="item.thumb" mode="" class="boxListImg"></image>
127 129
 										<view class="boxListTest">
128 130
 											<view class="text">
@@ -416,7 +418,7 @@
416 418
 				swiperHeigth: 20 * 303, //滑块的高
417 419
 				bannList: [],
418 420
 				swiperCur: 0,
419
-				showGG: false,
421
+				// showGG: false,
420 422
 				imgUrls: [{
421 423
 					name: '1',
422 424
 					pic: 'https://test.bjtdba.com/uploads/def/20200930/85ebaab8dc897a6c0bca1da7341b4a57.jpg'
@@ -492,7 +494,7 @@
492 494
 		async onLoad(app) {
493 495
 			this.getJD()
494 496
 			this.getshowGG()
495
-			console.log(app, 'sdasdada');
497
+			// console.log(app, 'sdasdada');
496 498
 			this.currentPages = app.id
497 499
 			await Promise.all([this.getIndexConfig()]);
498 500
 			// 京东列表
@@ -505,7 +507,7 @@
505 507
 		},
506 508
 		mounted() {
507 509
 			// this.getlist();
508
-			console.log(this.swiperHeigth, '进入页面的高度');
510
+			// console.log(this.swiperHeigth, '进入页面的高度');
509 511
 		},
510 512
 		updated() {
511 513
 			// this.jiantingaaa() // 京东列表
@@ -516,7 +518,7 @@
516 518
 					url: "https://test.bjtdba.com/api/applet_audit",
517 519
 					method: "get",
518 520
 					success: (res) => {
519
-						// console.log(res.data.message,'giaoyahu');
521
+						console.log(res.data.message,'giaoyahu');
520 522
 						if (res.data.message == '2') {
521 523
 
522 524
 							this.showGG = false
@@ -574,7 +576,7 @@
574 576
 						if (this.currentPages == 0) {
575 577
 							this.getJD()
576 578
 						}
577
-						// else if (this.currentPages == 2) { //原本是1 
579
+						// else if (this.currentPages == 2) { //原本是1
578 580
 						// this.getTaoBao()
579 581
 						// }
580 582
 						else if (this.currentPages == 1) {
@@ -591,9 +593,9 @@
591 593
 						if (this.currentPages == 0) {
592 594
 							this.getJdListNew()
593 595
 						}
594
-						//  else if (this.currentPages == 2) {//原本是1 
596
+						//  else if (this.currentPages == 2) {//原本是1
595 597
 						// 	// this.getTaoBaoNew()
596
-						// } 
598
+						// }
597 599
 						else if (this.currentPages == 1) {
598 600
 							this.getPddListNew()
599 601
 						}
@@ -705,8 +707,8 @@
705 707
 				// console.log(event,'出发');
706 708
 				// console.log(event.keyCode);
707 709
 				// console.log(event.preventDefault);
708
-				// if (event.keyCode == 13) { //如果按的是enter键 13是enter 
709
-				// 	event.preventDefault(); //禁止默认事件(默认是换行) 
710
+				// if (event.keyCode == 13) { //如果按的是enter键 13是enter
711
+				// 	event.preventDefault(); //禁止默认事件(默认是换行)
710 712
 				// 	console.log(event.target.value,'用户啊啊啊')
711 713
 				// }
712 714
 			},
@@ -714,10 +716,10 @@
714 716
 			getIndexConfig: function() {
715 717
 				let that = this;
716 718
 				getIndexData().then(res => {
717
-					console.log(res, 'res返回值是什么');
719
+					// console.log(res, 'res返回值是什么');
718 720
 					that.$set(that, 'imgUrls', res.data.banner);
719 721
 					that.$set(that, 'menus', res.data.menu);
720
-					console.log(this.menus, 'this.menus');
722
+					// console.log(this.menus, 'this.menus');
721 723
 				});
722 724
 			},
723 725
 			godetal(e) {
@@ -769,7 +771,7 @@
769 771
 					page: this.JDPage,
770 772
 					limit: this.jdlimit
771 773
 				}).then(res => {
772
-					console.log(res, '京东的res');
774
+					// console.log(res, '京东的res');
773 775
 					let lists = res.data;
774 776
 					let loadend = lists.length < this.jdlimit;
775 777
 					let JDListArr = [...this.JDList, ...lists]
@@ -933,7 +935,7 @@
933 935
 						return
934 936
 					}
935 937
 
936
-					// } 
938
+					// }
937 939
 					// changeLink({
938 940
 					//   url: item.url,
939 941
 					//   name: item.name,