xionghaojie 3 éve
szülő
commit
de1ec390c3

+ 17 - 1
pages/certificateDetail/certificateDetail.vue

@@ -1,5 +1,5 @@
 <template>
-	<view  v-if="systemInfo.platform.indexOf('windows')!=-1">
+	<view  v-if="isPc">
 		<Headers></Headers>
 		<view class="project">
 			<view style="width: 1200px;margin: auto;">证书查询系统</view>
@@ -178,6 +178,7 @@
 				options:{},
 				infoList:[],
 				info:{},
+				isPc:true,
 				
 				systemInfo:{}
 			}
@@ -185,6 +186,7 @@
 		onReady() {},
 		onLoad() {
 			this.systemInfo = uni.getSystemInfoSync()
+			this.isPc = this.IsPC()
 			if(!req.getStorage('options')){
 				uni.reLaunch({
 					url:'/pages/certificateQuery/certificateQuery'
@@ -198,6 +200,20 @@
 			req.removeStorage('options')
 		},
 		methods: {
+			IsPC() {
+			    var userAgentInfo = navigator.userAgent;
+			    var Agents = ["Android", "iPhone",
+			                "SymbianOS", "Windows Phone",
+			                "iPad", "iPod"];
+			    var flag = true;
+			    for (var v = 0; v < Agents.length; v++) {
+			        if (userAgentInfo.indexOf(Agents[v]) > 0) {
+			            flag = false;
+			            break;
+			        }
+			    }
+			    return flag;
+			},
 			jumpUrl(url){
 				uni.navigateTo({
 					url:url

+ 16 - 1
pages/certificateQuery/certificateQuery.vue

@@ -1,5 +1,5 @@
 <template>
-	<view style="position: relative;" v-if="systemInfo.platform.indexOf('windows')!=-1">
+	<view style="position: relative;" v-if="isPc">
 		<Headers></Headers>
 		
 		<image class="top-bg" src="/static/images/certificate_top_bg.png" mode="widthFix"></image>
@@ -129,8 +129,23 @@
 		},
 		onLoad() {
 			this.systemInfo = uni.getSystemInfoSync()
+			this.isPc = this.IsPC()
 		},
 		methods: {
+			IsPC() {
+			    var userAgentInfo = navigator.userAgent;
+			    var Agents = ["Android", "iPhone",
+			                "SymbianOS", "Windows Phone",
+			                "iPad", "iPod"];
+			    var flag = true;
+			    for (var v = 0; v < Agents.length; v++) {
+			        if (userAgentInfo.indexOf(Agents[v]) > 0) {
+			            flag = false;
+			            break;
+			        }
+			    }
+			    return flag;
+			},
 			query(){
 				let ql = [this.name,this.idNumber,this.certificateNo]
 				if(ql.filter(item=>{return item}).length<2) return req.msg('请填写两项内容查询')