Преглед изворни кода

增加扫码欢迎页,常用功能前两个页面修改、专业支持页面修改

htc пре 8 часа
родитељ
комит
dbeeaec3c5
7 измењених фајлова са 141 додато и 109 уклоњено
  1. 25 2
      App.vue
  2. 18 6
      pages.json
  3. 7 7
      pages/home.vue
  4. 28 0
      pages/perillPgjs.vue
  5. 28 0
      pages/perillPgsm.vue
  6. 29 26
      pages/scan.vue
  7. 6 68
      pages/support.vue

+ 25 - 2
App.vue

@@ -5,11 +5,12 @@
 				
 			}
 		},
-		onLaunch: function() {
-			
+		onLaunch: function(options) {
+			this.handleLaunchOrShow(options);
 		},
 		onShow: function(options) {
 			this.autoUpdate();
+			this.handleLaunchOrShow(options);
 			
 			//通过 URL Scheme 唤醒小程序,传递的参数 query
 			if (options.scene === 1065 && options.query) {
@@ -60,6 +61,28 @@
 						showCancel: false
 					})
 				}
+			},
+			async handleLaunchOrShow(options) {
+			      // 获取扫码参数(scene是场景值,query是扫码携带的参数)
+			      const { scene, query } = options;
+			      
+			      // 判断是否是扫码打开(微信扫码场景值:1011 小程序码扫码,1012 长按识别小程序码)
+			      const isScanScene = [1011, 1012].includes(scene);
+			      const isScanType = query.q && query.q.indexOf('scan')>-1;
+			
+			      if (isScanScene && isScanType) {
+			        // 关闭首页的加载/渲染,避免闪烁
+			        uni.hideHomeButton();
+			        uni.reLaunch({
+			          url: '/pages/scan',
+			          fail: (err) => {
+			            uni.reLaunch({ url: '/pages/home' });
+			          }
+			        });
+			        return;
+			      }
+			
+			      uni.reLaunch({ url: '/pages/home' });
 			}
 		}
 	}

+ 18 - 6
pages.json

@@ -7,37 +7,49 @@
 			}
 		},
 		{
-			"path": "pages/support",
+			"path": "pages/scan",
 			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path": "pages/webView",
+			"path": "pages/perillPgjs",
 			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path": "pages/publish",
+			"path": "pages/perillPgsm",
 			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path": "pages/login",
+			"path": "pages/support",
 			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path": "pages/registerInfo",
+			"path": "pages/webView",
 			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path": "pages/scan",
+			"path": "pages/publish",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/login",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/registerInfo",
 			"style": {
 				"navigationStyle": "custom"
 			}

+ 7 - 7
pages/home.vue

@@ -56,19 +56,19 @@
 			</view>
 			<view class="boxs-pre bp2" @click="toTurn('/pages/support')">
 				<view class="boxs-pre-title">专业支持</view>
-				<view class="boxs-pre-tip adfac">添加客服微信预约<image :src="imgBase+'home_arrow_right.png'"></image></view>
+				<view class="boxs-pre-tip adfac">常见问题与支持<image :src="imgBase+'home_arrow_right.png'"></image></view>
 			</view>
 		</view>
 		<view class="common">
 			<view class="common-title">常用功能</view>
 			<view class="common-menu adf">
-				<view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=receive')">
+				<view class="common-menu-pre adffcac" @click="toTurn('/pages/perillPgjs')">
 					<image :src="imgBase+'home_img_pinggu.png'"></image>
-					<text>PERILL团队发展动态评估</text>
+					<text>PERILL团队发展动态评估介绍</text>
 				</view>
-				<view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/report')">
+				<view class="common-menu-pre adffcac" @click="toTurn('/pages/perillPgsm')">
 					<image :src="imgBase+'home_img_baogao.png'"></image>
-					<text>PERILL团队发展动态评估报告</text>
+					<text>PERILL团队发展动态评估说明</text>
 				</view>
 				<view class="common-menu-pre adffcac" @click="toTurn('/pagesHome/questionnaire?type=create')">
 					<image :src="imgBase+'home_img_guanli.png'"></image>
@@ -219,7 +219,7 @@
 			},
 			toTurn(url){
 				if(!url) return 
-				const notloginurls = ['/pages/dialog','/pages/support','/pagesHome/weixin'];
+				const notloginurls = ['/pages/dialog','/pages/support','/pagesHome/weixin','perillPgjs','perillPgsm'];
 				if(!notloginurls.includes(url)&&!this.isLogin()) return
 				uni.navigateTo({
 					url
@@ -459,7 +459,7 @@
 					text{
 						font-family: PingFangSC, PingFang SC;
 						font-weight: 400;
-						font-size: 24rpx;
+						font-size: 22rpx;
 						color: #193D59;
 						line-height: 32rpx;
 						text-align: center;

+ 28 - 0
pages/perillPgjs.vue

@@ -0,0 +1,28 @@
+<template>
+	<view class="page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+		<cus-header title='PERILL团队发展动态评估介绍'></cus-header>
+		<image src="https://oss.familydaf.cn/sxsnfile/20260119/1b5158ed8d624784b3381c93a27973bd.jpg" mode="widthFix"></image>
+	</view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return {
+				
+			}
+		},
+		methods:{
+			
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.page{
+		box-sizing: border-box;
+		image{
+			width: 100%;
+		}
+	}
+</style>

+ 28 - 0
pages/perillPgsm.vue

@@ -0,0 +1,28 @@
+<template>
+	<view class="page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+		<cus-header title='PERILL团队发展动态评估说明'></cus-header>
+		<image src="https://oss.familydaf.cn/sxsnfile/20260119/fa1110e1c71d4aafa6d494a98ab749ab.jpg" mode="widthFix"></image>
+	</view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return {
+				
+			}
+		},
+		methods:{
+			
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.page{
+		box-sizing: border-box;
+		image{
+			width: 100%;
+		}
+	}
+</style>

+ 29 - 26
pages/scan.vue

@@ -1,7 +1,6 @@
 <template>
-	<view class="page" :style="{'height':h+'px', 'padding-top':mt+'px'}">
-		<cus-header title='欢迎' backUrl="/pages/home"></cus-header>
-		<div class="text">欢迎进入创衡汇AI智能教练小程序<br>该页面正在紧锣密鼓建设中,敬请期待~</div>
+	<view class="page" :style="{'min-height':h+'px'}">
+		<image src="https://oss.familydaf.cn/sxsnfile/20260119/2322ddce87aa42e7b4906e4286c7ffe1.png" mode="widthFix" @click="handleHome"></image>
 	</view>
 </template>
 
@@ -13,36 +12,40 @@
 			}
 		},
 		onLoad(options) {
-			if(options.q){
-				try{
-					console.log("扫码进入参数:", options.q);
-					const decodedUrl = decodeURIComponent(qrString);
-					console.log("decodedUrl:", decodedUrl);
-					const codeMatch = decodedUrl.match(/code=([^&]+)/);
-					console.log("codeMatch:", codeMatch);
-					const stationCode = codeMatch ? codeMatch[1] : null;
-					console.log("stationCode:", stationCode);
-				}catch(e){
-					//TODO handle the exception
-					console.log(e,'e');
-				}
-			}	
+			this.handleLaunchOrShow(options)
 		},
 		methods:{
-			
+			async handleLaunchOrShow(options) {
+				if(options.q){
+					try{
+						const decodedUrl = decodeURIComponent(options.q);
+						const codeMatch = decodedUrl.match(/type=([^&]+)/);
+						const stationCode = codeMatch ? codeMatch[1] : null;
+						if(stationCode === 'scan') {
+							// 关闭首页的加载/渲染,避免闪烁
+							uni.hideHomeButton();
+							return;
+						}
+						uni.reLaunch({ url: '/pages/home' });
+					}catch(e){
+						uni.reLaunch({ url: '/pages/home' });
+					}
+				}
+			},
+			handleHome(){
+				uni.reLaunch({
+					url:'/pages/home'
+				})
+			}
 		}
 	}
 </script>
 
-<style scoped lang="less">
+<style scoped lang="scss">
 	.page{
-		.text{
-			font-size: 32rpx;
-			color: #333333;
-			line-height: 50rpx;
-			letter-spacing: 2rpx;
-			padding: 300rpx 60rpx 0;
-			text-align: center;
+		box-sizing: border-box;
+		image{
+			width: 100%;
 		}
 	}
 </style>

+ 6 - 68
pages/support.vue

@@ -1,90 +1,28 @@
 <template>
-	<view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
+	<view class="page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
 		<cus-header title='专业支持'></cus-header>
-		<image style="width: 100%;" :src="imgBase+'support.png'" mode="widthFix" @click="handleTurn"></image>
-		<div class="code" :style="{'top':codetop+'px'}">
-			<canvas canvas-id="qrcode" style="width:108px;height:108px;border-radius: 8px; position: fixed;left: -9999px;top: -9999px;"></canvas>
-			<image v-if="qrCodeDataURL" :src="qrCodeDataURL" mode="scaleToFill" show-menu-by-longpress></image>
-		</div>
+		<image src="https://oss.familydaf.cn/sxsnfile/20260119/e1692241167044db93dc77c4d29bddfe.jpg" mode="widthFix"></image>
 	</view>
 </template>
 
 <script>
-	import UQrcode from '@/uqrcode.js'
 	export default {
 		data(){
 			return {
-				imgBase:this.$imgBase,
-				qrCodeDataURL:'',
-				qrVal:'https://wxapp.transcend-intl.cn',
-				codetop:0,
-			}
-		},
-		onLoad() {
-			this.codetop = uni.upx2px(this.mt*2+1278);
-			this.generateQRCode();
-			if(uni.getStorageSync('userInfo')){
-				this.qrVal = `https://wxapp.transcend-intl.cn?shareUserId=${JSON.parse(uni.getStorageSync('userInfo'))?.id||''}`;
+				
 			}
 		},
 		methods:{
-			handleTurn(){
-				uni.navigateTo({
-					url:'/pages/webView?src=https://appyf7rnhyg7811.h5.xiaoeknow.com'
-				})
-			},
-			async generateQRCode(){
-				try {
-					let that = this;
-					// 确保DOM已经更新,canvas元素已准备好
-					this.$nextTick(() => { 
-						UQrcode.make({
-							canvasId: 'qrcode',
-							componentInstance: this,
-							text: that.qrVal,
-							size: 108, // 对应 216rpx 的物理像素大小
-							margin: 5,
-							backgroundColor: '#ffffff',
-							foregroundColor: '#000000',
-							fileType: 'png',
-							errorCorrectLevel: UQrcode.errorCorrectLevel.H,
-							success: res => {
-								uni.canvasToTempFilePath({
-									canvasId: 'qrcode', 
-									fileType: 'png', 
-									quality: 1, 
-									success: (canvasRes) => {
-										that.qrCodeDataURL = canvasRes.tempFilePath; 
-									},
-									fail: (err) => {
-										that.qrCodeDataURL = res; 
-									}
-								}, this);
-							}
-						});
-					});
-				} catch { }
-			},
+			
 		}
 	}
 </script>
 
 <style scoped lang="scss">
-	.default_page{
-		position: relative;
-	}
-	.code{
-		width: 108px;
-		height: 108px;
-		background: #FFFFFF;
-		border-radius: 8px;
-		position: absolute;
-		left: 50%;
-		margin-left: -54px;
+	.page{
+		box-sizing: border-box;
 		image{
 			width: 100%;
-			height: 100%;
-			border-radius: 8px;
 		}
 	}
 </style>