瀏覽代碼

安卓权限

twt 2 年之前
父節點
當前提交
e58c8829f5

+ 5 - 1
pages/addjk/activity.vue

@@ -114,12 +114,16 @@
 			 var qxnum=uni.getStorageSync("quanxian");
 			 if(qxnum==1){
 				 this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
+			 }else if(qxnum==2){
+				 window.getAndroid=this.getAndroid;
 			 }
 		},
 
 
 		methods: {
-			
+			getAndroid(e){
+				this.iOSInfo=e		
+			},
 			goAdd(){
 				uni.navigateTo({
 					url:'choice?type=2'

+ 10 - 3
pages/addjk/addActivity.vue

@@ -9,7 +9,7 @@
 			<view class="name3">这里展示活动说明,如果后台没填则不展示</view>
 		</view>
 		<view style="height: 98rpx;"></view>
-		<view class="btn" @click="eadit" >编辑内容</view><!-- v-if="qxdata.indexOf('Q021')!=-1" -->
+		<view class="btn" @click="eadit" v-if="iOSInfo.indexOf('Q021')!=-1||!iOSInfo">编辑内容</view><!-- v-if="qxdata.indexOf('Q021')!=-1" -->
 	</view>
 </template>
 
@@ -19,19 +19,26 @@
 			return {
 				img:'',
 				qxdata:'',
+				iOSInfo:'',
 			}
 		},
 		onLoad(opt) {
            this.img=opt.img;
 		    let iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
 		     var qxnum=uni.getStorageSync("quanxian");
-		    //if()
-		   //console.log(this.qxdata)
+		     if(qxnum==1){
+		     	this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
+		     }else if(qxnum==2){
+				 window.getAndroid=this.getAndroid;
+			 }
 		},
 		onShow() {
 			
 		},
 		methods: {
+			getAndroid(e){	
+				this.iOSInfo=e		
+			},
             eadit(){
 				uni.removeStorageSync('shopckList');
 				uni.removeStorageSync('ckmusic');

+ 33 - 4
pages/index/index.vue

@@ -1,6 +1,7 @@
 <template>
 	<view class="content">
-		
+		<view @click="getAndroid">安卓测试</view>
+		{{androidData}}
 	</view>
 </template>
 
@@ -8,14 +9,42 @@
 	export default {
 		data() {
 			return {
-				title: 'Hello'
+				title: 'Hello',
+				androidData:'',
 			}
 		},
 		onLoad() {
-
+          window.getAndroid=this.getAndroid;
+		//  setTimeout( this.getAndroid(),500)
+		  
+		 
+		 // this.callByAndroid()
+		 // window.LoginOut=this.LoginOut
+		},
+		created() {
+			
 		},
 		methods: {
-
+			// LoginOut(){
+			// 	uni.showToast({
+			// 		 title: '66666',
+			// 		 icon:'none',
+			// 		 duration: 6000
+			// 	});
+			// },
+           getAndroid(e){
+			   uni.showToast({
+			   	 title: '66666',
+			   	 icon:'none',
+			   	 duration: 6000
+			   });
+			  
+			   this.androidData=e
+			   return "hello";
+		   },
+		   callByAndroid(){
+			    alert("Js收到消息");
+		   }
 		}
 	}
 </script>

+ 7 - 2
pages/myOrder/activityOrderDetail.vue

@@ -319,12 +319,17 @@
 			var qxnum = uni.getStorageSync("quanxian");
 			if (qxnum == 1) {
 				this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
-			}
+			}else if(qxnum==2){
+				 window.getAndroid=this.getAndroid;
+			 }
 
 		},
 
 
-		methods: {
+		methods: {
+			getAndroid(e){
+				this.iOSInfo=e		
+			},
 			goTui() {
 			
 				let yuanyin = this.tuicauseList[this.index].contents

+ 6 - 1
pages/myOrder/mallOrderDetail.vue

@@ -348,12 +348,17 @@
 			var qxnum = uni.getStorageSync("quanxian");
 			if (qxnum == 1) {
 				this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
-			}
+			}else if(qxnum==2){
+				 window.getAndroid=this.getAndroid;
+			 }
 
 		},
 
 
 		methods: {
+			getAndroid(e){
+				this.iOSInfo=e		
+			},
 			goTui() {
 
 				let yuanyin = this.tuicauseList[this.index].contents

+ 7 - 2
pages/myOrder/paintOrderDetail.vue

@@ -329,11 +329,16 @@
 			var qxnum = uni.getStorageSync("quanxian");
 			if (qxnum == 1) {
 				this.iOSInfo = JSON.parse(JSON.stringify(window.iOSInfo));
-			}
+			}else if(qxnum==2){
+				 window.getAndroid=this.getAndroid;
+			 }
 		},
 		
 
-		methods: {
+		methods: {
+			getAndroid(e){
+				this.iOSInfo=e		
+			},
 			payDone(){
 				var that = this
 				uni.showModal({