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

增加判断,查看报告仅可在手机端打开,其他如PC端会提示

htc преди 5 дни
родител
ревизия
a3073fa1b3
променени са 2 файла, в които са добавени 21 реда и са изтрити 8 реда
  1. 10 4
      pagesHome/components/report/generateList.vue
  2. 11 4
      pagesHome/components/report/receiveList.vue

+ 10 - 4
pagesHome/components/report/generateList.vue

@@ -42,6 +42,7 @@
 </template>
 
 <script>
+	import { getPlatformInfo } from '@/utils/platform.js'; 
 	export default {
 		props:{
 			list:{
@@ -78,10 +79,15 @@
 				uni.navigateTo({ url })
 			},
 			reviewReport(item){
-				if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
-				uni.navigateTo({
-					url:'/pages/webView?src='+item.fileUrl
-				})
+				const { isPC, isMobile, platform } = getPlatformInfo();
+				if (isPC) {
+					this.$showModal('请在手机端该微信小程序中查看报告')
+				} else if (isMobile||platform==='devtools') {
+					if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
+					uni.navigateTo({
+						url:'/pages/webView?src='+item.fileUrl
+					})
+				}
 			},
 			askReport(item){
 				uni.navigateTo({

+ 11 - 4
pagesHome/components/report/receiveList.vue

@@ -28,6 +28,7 @@
 </template>
 
 <script>
+	import { getPlatformInfo } from '@/utils/platform.js'; 
 	export default {
 		props:{
 			list:{
@@ -49,7 +50,6 @@
 				this.$emit('scrolltolower')
 			},
 			reviewReport(item){
-				if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
 				// uni.navigateTo({
 				// 	url:`/pagesHome/reportDetail?pdfUrl=${item.fileUrl}&reportId=${item.reportId}&fileName=${this.typeCfg[item.type]||'个人版'}-${item.reportName}`
 				// })
@@ -62,9 +62,16 @@
 				//     })
 				//   }
 				// })
-				uni.navigateTo({
-					url:'/pages/webView?src='+item.fileUrl
-				})
+				
+				const { isPC, isMobile, platform } = getPlatformInfo();
+				if (isPC) {
+					this.$showModal('请在手机端该微信小程序中查看报告')
+				} else if (isMobile||platform==='devtools') {
+					if(!item.fileUrl) return this.$showToast('报告pdf为空,请稍后再试。')
+					uni.navigateTo({
+						url:'/pages/webView?src='+item.fileUrl
+					})
+				}
 			},
 			askReport(item){
 				uni.navigateTo({