瀏覽代碼

Merge branch '大连交通技师学院' of https://gogs.mtavip.com/wangguoyu/uniProject into 大连交通技师学院

tanxue 1 月之前
父節點
當前提交
d005551c57

+ 3 - 7
components/MtaCard/listTwo.vue

@@ -24,7 +24,8 @@
 		getStringByHtml3,
 		formatDateToYearMonthDay
 	} from "@/utils/common.js"
-
+	import default2 from '@/static/images/common/news-bj2.png'
+	import default1 from '@/static/images/common/news-bj1.jpg'
 	const props = defineProps({
 		data: {
 			type: Object
@@ -34,17 +35,12 @@
 		}
 	})
 
-	const myData = reactive({
-		default1: '', // 默认图
-		default2: '' // 默认图2
-	})
-
 	const formatDate = computed(() => {
 		return formatDateToYearMonthDay(props.data.createTime)
 	})
 
 	const defaultImg = computed(() => {
-		return props.type == 1 ? myData.default1 : myData.default2
+		return props.type == 1 ? default1 : default2
 	})
 </script>
 

+ 7 - 1
pages/xygkLianxifangshi/xygkLianxifangshi.vue

@@ -14,7 +14,7 @@
 					<view class="breadcrumb-active">联系方式</view>
 				</view>
 				<view class="lxfs-content-box">
-					<view class="lxfs-map"></view>
+					<view class="lxfs-map"  @click="handlePreview"></view>
 					<!-- 图 -->
 					<view class="lxfs-tel-box">办公室电话:{{data.info.bangongshi}}</view>
 					<view class="lxfs-tel-box">职业培训电话:{{data.info.zhiyepeixun}}</view>
@@ -68,6 +68,12 @@
 			data.info = res.data;
 		})
 	}
+	
+	function handlePreview() {
+		uni.previewImage({
+					urls: ['/static/images/xygk/xywh-lxfs-img.png'],
+				});
+	}
 </script>
 
 <style>

+ 2 - 2
pages/xygkXueyuanrongyu/xygkXueyuanrongyu.vue

@@ -11,7 +11,7 @@
 					<icon class="breadcrumb-jt"></icon>
 					<view class="breadcrumb-active">学院荣誉</view>
 				</view>
-				<MtaScrollViewVue :refreshFn="getList">
+				<MtaScrollViewVue :refreshFn="getList" :size="data.size">
 					<template v-slot="{ list }">
 						<view class="xyry-item-row" v-for="item in list" :key="item.id">
 							<icon class="xyry-icon"></icon>
@@ -46,7 +46,7 @@
 		list: '',
 		total: '',
 		page: 1,
-		size: 5
+		size: 10
 	})
 
 	function getList(data) {

+ 6 - 0
pages/zsjyXiaoqihezuo/zsjyXiaoqihezuo.vue

@@ -58,6 +58,12 @@
 	})
 
 
+	function handleGo() {
+		uni.navigateTo({
+			url: '/pages/index/index'
+		})
+	}
+
 	function handleClick(item) {
 		uni.navigateTo({
 			url: `/pages/zsjyXiaoqihezuoInfo/zsjyXiaoqihezuoInfo?id=${item.id}`

+ 15 - 9
pages/zsjyYubaoming/zsjyYubaoming.vue

@@ -19,12 +19,12 @@
 						</view>
 						<view class="dljt-input-row require-row">
 							<view class="input-title">身份证号</view>
-							<input class="form-input" name="input" v-model="formData.name" placeholder="请输入身份证号" />
+							<input class="form-input" name="input" v-model="formData.idcard" placeholder="请输入身份证号" />
 						</view>
 						<view class="dljt-input-row require-row">
 							<view class="input-title">预报专业</view>
 							<uni-data-select class="form-select" v-model="formData.zhuanye" :localdata="range"
-								@change="change" placeholder="请选择预报专业"></uni-data-select>
+								placeholder="请选择预报专业"></uni-data-select>
 						</view>
 						<view class="dljt-input-row require-row">
 							<view class="input-title">联系电话</view>
@@ -71,7 +71,9 @@
 	import MtaScrollViewVue from "@/components/MtaScrollView/MtaScrollView.vue";
 	import {
 		formatDateToYearMonthDay,
-		getStringByHtml3
+		getStringByHtml3,
+		validateIdCard,
+		validatePhone
 	} from "@/utils/common.js"
 	import MtaFooter from "@/components/MtaFooter.vue"
 	import default1 from '@/static/images/common/news-bj1.jpg'
@@ -93,27 +95,31 @@
 		
 		if (!formData.name) {
 			uni.showToast({
-				title: '请输入姓名'
+				title: '请输入姓名',
+				icon: 'error'
 			})
 			return;
 		}
 		
-		if (!formData.idcard) {
+		if (!validateIdCard(formData.idcard)) {
 			uni.showToast({
-				title: '请输入身份证号'
+				title: '请输入有效身份证号',
+				icon: 'error'
 			})
 			return;
 		}
 		if (!formData.zhuanye) {
 			uni.showToast({
-				title: '请选择预报专业'
+				title: '请选择预报专业',
+				icon: 'error'
 			})
 			return;
 		}
 		
-		if (!formData.dianhua) {
+		if (!validatePhone(formData.dianhua)) {
 			uni.showToast({
-				title: '请输入联系电话'
+				title: '请输入有效联系电话',
+				icon: 'error'
 			})
 			return;
 		}

+ 38 - 1
utils/common.js

@@ -106,4 +106,41 @@ export function addClassToWebViewIframe() {
 
       // 设置超时停止监听(防止内存泄漏)
       setTimeout(() => observer.disconnect(), 5000);
-    }
+    }
+	
+	
+	/**
+	 * 验证中国大陆身份证号码
+	 * @param {string} idCard - 身份证号码
+	 * @returns {boolean} - 是否有效
+	 */
+	export function validateIdCard(idCard) {
+	    // 基本格式验证
+	    if (!/^\d{17}[\dXx]$/.test(idCard)) {
+	        return false;
+	    }
+	    
+	    // 校验码计算
+	    const factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+	    const checkCodes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
+	    
+	    let sum = 0;
+	    for (let i = 0; i < 17; i++) {
+	        sum += parseInt(idCard[i]) * factors[i];
+	    }
+	    
+	    const mod = sum % 11;
+	    const checkCode = checkCodes[mod];
+	    
+	    return idCard[17].toUpperCase() === checkCode;
+	}
+	
+	/**
+	 * 验证中国大陆手机号码
+	 * @param {string} phone - 手机号码
+	 * @returns {boolean} - 是否有效
+	 */
+	export function validatePhone(phone) {
+	    // 正则表达式验证
+	    return /^1[3-9]\d{9}$/.test(phone);
+	}