Explorar el Código

fix: 升级获取定位权限

Basil hace 3 años
padre
commit
e7db3b67fa
Se han modificado 3 ficheros con 45 adiciones y 31 borrados
  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
     "transformPx" : false,
7
     "transformPx" : false,
8
     /* 5+App特有相关 */
8
     /* 5+App特有相关 */
9
     "app-plus" : {
9
     "app-plus" : {
10
-        //prompt取值为template时有效,用于配置模板提示框上显示的内容  
10
+        //prompt取值为template时有效,用于配置模板提示框上显示的内容
11
         "usingComponents" : true,
11
         "usingComponents" : true,
12
         "nvueCompiler" : "uni-app",
12
         "nvueCompiler" : "uni-app",
13
         "splashscreen" : {
13
         "splashscreen" : {
@@ -262,10 +262,22 @@
262
             "es6" : true
262
             "es6" : true
263
         },
263
         },
264
         "permission" : {
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
         "usingComponents" : true
281
         "usingComponents" : true
270
     },
282
     },
271
     "mp-alipay" : {
283
     "mp-alipay" : {

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

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

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

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