Pārlūkot izejas kodu

判断进入pc增加设备判断

jwyu 3 gadi atpakaļ
vecāks
revīzija
23701e8886
3 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 3 1
      App.vue
  2. 1 1
      pages/activity/activity.vue
  3. 1 1
      pages/report/report.vue

+ 3 - 1
App.vue

@@ -10,7 +10,9 @@
 			hasUpdate()
 			uni.getSystemInfo({
 				success: function (res) {
-					if (res.windowWidth > 700) {
+					console.log('宽度:',res.windowWidth);
+					console.log('设备:',res.platform);
+					if (res.windowWidth > 600||['windows','mac'].includes(res.platform)) {
 						const params=options.query//此处的query就是在pc分享钩子函数中拼接的参数
 						let paramsStr=`xcxPath=${decodeURIComponent(options.path)}`
 						for(const key in params){

+ 1 - 1
pages/activity/activity.vue

@@ -329,7 +329,7 @@ export default {
         this.initAudio()
         uni.getSystemInfo({
 			success: function (res) {
-				if (res.windowWidth > 700) {
+				if (res.windowWidth > 600||['windows','mac'].includes(res.platform)) {
 					console.log('跳转启动页判断进入pc');
 					uni.reLaunch({
 						url: "/pages/pc",

+ 1 - 1
pages/report/report.vue

@@ -111,7 +111,7 @@ export default {
   onShow() {
     uni.getSystemInfo({
 			success: function (res) {
-				if (res.windowWidth > 700) {
+				if (res.windowWidth > 600||['windows','mac'].includes(res.platform)) {
 					console.log('跳转启动页判断进入pc');
 					uni.reLaunch({
 						url: "/pages/pc",