学习?学个屁 2 giorni fa
parent
commit
acd01640e8

+ 4 - 4
src/pages/index/attestation/index.vue

@@ -24,15 +24,15 @@
 		<view class="a-form">
 			<view class="form-item">
 				<view class="">真实姓名</view>
-				<input type="text" v-model="formData.fullName" placeholder="请输入本人姓名" />
+				<input type="text" v-model="formData.fullName" placeholder="请输入学员姓名" />
 			</view>
 			<view class="form-item">
 				<view class="">身份证号</view>
-				<input type="idcard" v-model="formData.identityCard" placeholder="请输入本人身份证号" @blur="getIdCardInfo" />
+				<input type="idcard" v-model="formData.identityCard" placeholder="请输入学员身份证号" @blur="getIdCardInfo" />
 			</view>
 			<view class="form-item">
 				<view class="">手机号码</view>
-				<input type="number" v-model="formData.phone" placeholder="请输入手机号" />
+				<input type="number" v-model="formData.phone" placeholder="请输入监护人手机号" />
 			</view>
 			<view class="form-tips">请填写监护人手机号</view>
 			<view class="form-item-upload">
@@ -40,7 +40,7 @@
 				<sunui-upimg :url="upPicUrl" :header="{ 'x-access-token': cache.get('TOKEN') }" ref="upload1"
 					title="店铺logo" @change="handleChange" :upload_count="1" @remove="removeImages"></sunui-upimg>
 			</view>
-			<view class="form-tips-upload">请上传本人近期高清、无遮挡照片</view>
+			<view class="form-tips-upload">请上传学员近期高清、无遮挡照片</view>
 		</view>
 		<view class="u-select-btn">
 			<button hover-class="hover-btn" @click="submit">下一步</button>

+ 34 - 11
src/pages/index/courseDetail/index.vue

@@ -39,8 +39,10 @@
 			<view class="c-instructor">
 				<view class="c-instructor-title">授课教练:</view>
 				<view class="c-instructor-name">
-					<image :src="courseDetailInfo?.instructorAvatar" mode=""></image>
-					<view class="">{{ courseDetailInfo?.instructorName }}</view>
+					<view class="instructor-item" v-for="(avatar, index) in instructorAvatars" :key="index">
+						<image :src="avatar" mode="" />
+						<view class="instructor-name-text">{{ instructorName[index] || '' }}</view>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -160,7 +162,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, onMounted, getCurrentInstance, nextTick } from 'vue';
+import { ref, onMounted, getCurrentInstance, nextTick, computed } from 'vue';
 import { RouterUtils, _previewImage } from '@/utils/util';
 import { http } from '@/utils/http'
 import zzxNavbar from '@/components/zzx-navbar/zzx-navbar.vue';
@@ -184,6 +186,15 @@ onLoad((option) => {
 		cache.set('COURSE_ID', courseDetailInfo.value.id)
 	}
 })
+const instructorAvatars = computed(() => {
+	const avatarStr = courseDetailInfo.value?.instructorAvatar
+	return avatarStr ? avatarStr.split(',') : []
+})
+
+const instructorName = computed(() => {
+	const name = courseDetailInfo.value?.instructorName
+	return name ? name.split(',') : []
+})
 
 onShareAppMessage((res) => {
 	if (res.from === 'button') {// 来自页面内分享按钮
@@ -293,7 +304,7 @@ const scrollToTop = () => {
 }
 
 const toOrderPage = (buyType: number) => {
-	RouterUtils.to_page(`/pages/index/gymPay/index?courseId=${courseId.value}&type=${type.value}&orderType=2&buyType=${buyType}`)
+	RouterUtils.to_page(`/pages/index/gymPay/index?courseId=${courseId.value}&type=${type.value}&orderType=2&buyType=${buyType}&schoolName=${courseDetailInfo.value.address}`)
 }
 
 // 获取评价
@@ -450,15 +461,27 @@ const fixImgStyle = (html: string) => {
 			font-size: 24rpx;
 			color: #AAAAAA;
 
-			.c-instructor-title {}
-
 			.c-instructor-name {
-				text-align: center;
+				display: flex;
+				gap: 30rpx;
+
+				.instructor-item {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					gap: 10rpx; // 头像和姓名之间的间距
 
-				&>image {
-					width: 60rpx;
-					height: 60rpx;
-					border-radius: 50%;
+					&>image {
+						width: 60rpx;
+						height: 60rpx;
+						border-radius: 50%;
+					}
+
+					.instructor-name-text {
+						font-size: 24rpx;
+						color: #222222;
+						text-align: center;
+					}
 				}
 			}
 		}

+ 128 - 14
src/pages/index/gymPay/index.vue

@@ -115,7 +115,6 @@
 					<button class="g-share-btn" open-type="share"></button>
 				</view>
 			</view>
-			<!-- <view class="user-tags">张三</view> -->
 			<view class="r-user-list" v-for="item in userData" :key="item.id">
 				<view class="minus-user" @click="deleteUser(item)">-</view>
 				<view class="r-list">
@@ -128,6 +127,35 @@
 				<view class="add-text">添加用户</view>
 			</view>
 		</view>
+		<view class="g-userinfo-card" v-for="(item, index) in userData" :key="item.id">
+			<view style="font-size: 28rpx;font-weight: bold;">补充信息{{ index + 1 }}({{ item.fullName }})</view>
+			<view class="use-is-schoolStutent">
+				<view class="is-schoolStutent"><text style="color: red;">*</text>是否本校({{ schoolName }})学生</view>
+				<view class="radio-box">
+					<view class="select-radio" @click="setSchoolStudent(index, true)">
+						<zzx-icon :name="schoolStudentStatus[index] === true ? 'selected' : 'unchecked'"
+							size="14"></zzx-icon>
+						<view style="margin-bottom: 6rpx;">是</view>
+					</view>
+					<view style="width: 40rpx;"></view>
+					<view class="select-radio" @click="setSchoolStudent(index, false)">
+						<zzx-icon :name="schoolStudentStatus[index] === false ? 'selected' : 'unchecked'"
+							size="14"></zzx-icon>
+						<view style="margin-bottom: 6rpx;">否</view>
+					</view>
+				</view>
+			</view>
+			<view class="use-select-grade-class" v-if="schoolStudentStatus[index] === true">
+				<view class="select-grade-title"><text style="color: red;">*</text>年级班级</view>
+				<view class="select-grade-input">
+					<input type="text" placeholder="请输入" v-model="gradeClassInfo[index].grade" />
+					<view>年级</view>
+					<input type="text" placeholder="请输入" v-model="gradeClassInfo[index].class" />
+					<view>班</view>
+				</view>
+				<view class="select-grade-tips">请输入数字,年级范围为1-12,班级范围为1-40</view>
+			</view>
+		</view>
 		<view class="g-usetips-card">
 			<view class="use-title">{{ placeId ? '使用须知' : '购买须知' }}</view>
 			<block v-if="previewCourseInfo?.usableCount && previewCourseInfo?.indate">
@@ -149,11 +177,6 @@
 					<rich-text :nodes="fixImgStyle(previewCourseInfo?.reminder)"></rich-text>
 				</view>
 			</view>
-			<!-- <view class="use-tips-more"
-				@click="RouterUtils.to_page(`/pages/index/useNotice/index?reminder=${previewCourseInfo?.reminder}`)">
-				<view class="more-text">查看更多</view>
-				<view class="use-line"></view>
-			</view> -->
 		</view>
 		<view class="g-usetips-card">
 			<view class="use-title">服务保障</view>
@@ -163,10 +186,6 @@
 					{{ previewCourseInfo?.refundType == 1 ? '未消费随时退款,过期未消费自动退款。' : '不支退款,请慎重考虑后购买。' }}
 				</view>
 			</view>
-			<!-- <view class="use-tips-more">
-				<view class="more-text">查看更多</view>
-				<view class="use-line"></view>
-			</view> -->
 		</view>
 		<view style="height: 166rpx;"></view>
 		<view class="footer footer-box">
@@ -222,9 +241,9 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, onMounted, computed } from 'vue';
+import { ref, onMounted, computed, watch } from 'vue';
 import { onLoad, onShareAppMessage } from '@dcloudio/uni-app';
-import { RouterUtils, TipsUtils, idCardHide, debounce,fixImgStyle } from '@/utils/util';
+import { RouterUtils, TipsUtils, idCardHide, debounce, fixImgStyle } from '@/utils/util';
 import { http } from '@/utils/http'
 import { useCacheStore } from '@/stores/cache'
 const cache = useCacheStore()
@@ -233,12 +252,14 @@ const select_insurance = ref(false)
 const loadType = ref(1)
 const buyType = ref()
 const placeId = ref()
+const schoolName = ref()
 onLoad((options) => {
 	console.log(options);
 	loadType.value = options.type
 	courseId.value = options.courseId
 	placeId.value = options.placeId
 	buyType.value = options.buyType
+	schoolName.value = options.schoolName
 	orderFormData.value.type = options.orderType
 	orderFormData.value.orFreeOrder = options.buyType
 	orderFormData.value.amount = 1
@@ -264,6 +285,16 @@ onMounted(() => {
 	getInsureData()
 })
 
+
+// 设置某个用户是否为学生
+const setSchoolStudent = (index, isStudent) => {
+	if (schoolStudentStatus.value[index] === true && isStudent === false) {
+		gradeClassInfo.value[index].grade = '';
+		gradeClassInfo.value[index].class = '';
+	}
+	schoolStudentStatus.value[index] = isStudent;
+};
+
 const toUserList = () => {
 	RouterUtils.to_page('/pages/index/userList/index')
 }
@@ -281,6 +312,17 @@ const get_userData = () => {
 	})
 }
 
+const schoolStudentStatus = ref([])
+const gradeClassInfo = ref([])
+
+watch(userData, (newUserData) => {
+	schoolStudentStatus.value = new Array(newUserData.length).fill(false);
+	gradeClassInfo.value = new Array(newUserData.length).fill(null).map(() => ({
+		grade: '',
+		class: ''
+	}));
+}, { immediate: true });
+
 const deleteUser = async (e) => {
 	let res: any = await TipsUtils.tips_alert('确定删除该用户吗?', true)
 	if (res.confirm) {
@@ -431,14 +473,37 @@ let orderFormData = ref({
 		assertEndTime: '',
 		insurePriceId: '',
 		familyMembersIds: '',
-	}
+	},
+	addGradeLevelInformation: []
 })
 
 const orderCode = ref(null)
 const orderId = ref(null)
 const submitOrderImpl = () => {
 	orderFormData.value.amount = countTotal.value
+	for (let i = 0; i < userData.value.length; i++) {
+		if (schoolStudentStatus.value[i] === true) {
+			const grade = gradeClassInfo.value[i].grade;
+			const clazz = gradeClassInfo.value[i].class;
 
+			if (!grade || !clazz) {
+				return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入完整的年级和班级信息`);
+			}
+			const gradeNum = parseInt(grade);
+			const classNum = parseInt(clazz);
+			if (isNaN(gradeNum) || gradeNum < 1 || gradeNum > 12) {
+				return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的年级(1-12)`);
+			}
+			if (isNaN(classNum) || classNum < 1 || classNum > 40) {
+				return TipsUtils.tips_toast(`请为${userData.value[i].fullName}输入有效的班级(1-40)`);
+			}
+		}
+	}
+	orderFormData.value.addGradeLevelInformation = userData.value.map((user, index) => ({
+		class: schoolStudentStatus.value[index] === true ? gradeClassInfo.value[index].class : '',
+		familyId: user.id,
+		levelInfo: schoolStudentStatus.value[index] === true ? `${gradeClassInfo.value[index].grade}年级 ${gradeClassInfo.value[index].class}班` : ''
+	}));
 	// 计算总金额
 	let totalPrice = 0;
 	if (previewCourseInfo.value?.originalPrice) {
@@ -466,7 +531,6 @@ const submitOrderImpl = () => {
 	if (!userData || userData.value.length === 0) {
 		delete data.familyIds
 	}
-
 	// 如果总金额为0,直接创建订单并跳转,不调用微信支付
 	if (totalPrice === 0 || buyType.value == 1) {
 		http.post('/order/createOrder', data, { loading: true }).then((res) => {
@@ -829,6 +893,56 @@ const getOrderQuery = (orderCode: string, orderId: string, retryCount = 0) => {
 	background: #FFFFFF;
 	border-radius: 32rpx;
 
+	.use-is-schoolStutent {
+		.is-schoolStutent {
+			font-size: 24rpx;
+			color: #222222;
+		}
+
+		.radio-box {
+			display: flex;
+			align-items: center;
+			font-size: 24rpx;
+			margin-top: 20rpx;
+
+			.select-radio {
+				display: flex;
+				align-items: center;
+				gap: 8rpx;
+			}
+		}
+	}
+
+	.use-select-grade-class {
+		margin-top: 20rpx;
+		font-size: 24rpx;
+
+		.select-grade-title {
+			margin-top: 20rpx;
+		}
+
+		.select-grade-input {
+			display: flex;
+			align-items: center;
+			gap: 8rpx;
+			margin-top: 20rpx;
+
+			&>input {
+				width: 132rpx;
+				height: 60rpx;
+				background-color: rgba(246, 246, 246, 1);
+				border-radius: 16rpx;
+				text-align: center;
+			}
+		}
+
+		.select-grade-tips {
+			margin-top: 20rpx;
+			font-size: 24rpx;
+			color: #AAAAAA;
+		}
+	}
+
 	.r-user {
 		display: flex;
 		align-items: center;

+ 1 - 1
src/pages/index/toBeUsed/index.vue

@@ -158,7 +158,7 @@
 				<!-- type:0-学校 1-包场 2-无固定场 3-个人赛 4-团队赛 5-课程 6-保险 -->
 				<view style="display: flex;align-items: center;justify-content: space-between;">
 					<view class="order-num" @click="selectOrderInfo(item, index)">
-						<text v-if="item.type != 6">{{ item.ticketNo }}&nbsp;&nbsp; {{ item.userName }}</text>
+						<text v-if="item.type != 6">{{ item.ticketNo }}&nbsp;&nbsp; {{ item.userName }} {{item.classGroupingName}} {{ item.coachName }}</text>
 						<zzx-icon v-if="item.type != 6" name="ashRight" size="12"></zzx-icon>
 						<!-- <text v-if="item.type != 6 && orderPageInfo?.orderType == 1">{{ item.expireTime }}到期</text> -->
 					</view>

+ 2 - 2
src/utils/http/index.ts

@@ -180,8 +180,8 @@ export class HttpClient {
 export const http = new HttpClient({
   // baseURL: 'http://192.168.0.217:8080/jeecg-boot/app',
   // baseURL: 'http://192.168.1.166:8080/jeecg-boot/app',
-  // baseURL: 'http://192.168.0.11:8080/jeecg-boot/app',
-  baseURL: 'https://api.qlapp.cn/jeecgboot/app', //生产
+  baseURL: 'http://192.168.0.11:8080/jeecg-boot/app',
+  // baseURL: 'https://api.qlapp.cn/jeecgboot/app', //生产
   headers: {
     'Content-Type': 'application/json'
   }