学习?学个屁 hai 5 días
pai
achega
f415332e75

+ 1 - 1
src/pages/index/detail/components/instructor.vue

@@ -6,7 +6,7 @@
 		</view>
 		<scroll-view class="header-swiper content" scroll-x="true" :show-scrollbar="false">
 			<view class="swiper-box">
-				<view class="swiper-inner" v-for="item in instrctorList" :key="item.id">
+				<view class="swiper-inner" v-for="(item,idx) in instrctorList" :key="idx">
 					<view class="header-img">
 						<image :src="item.avatar" mode=""></image>
 						<image src="/src/static/badge.png" mode=""></image>

+ 7 - 7
src/pages/index/detail/index.vue

@@ -30,7 +30,7 @@
 			</view>
 		</view>
 		<view class="open-time">
-			<view class="time">
+			<view class="time" v-if="teachingDay">
 				<view>教学日 <text style="margin-right: 14rpx;" v-for="(item,index) in teachingDay.data" :key="index">{{item.startTime+'-'+item.endTime||'--'}}</text></view>
 				<view class="">非教学日 <text style="margin-right: 14rpx;" v-for="(item,index) in noTeachingDay.data" :key="index">{{item.startTime+'-'+item.endTime||'--'}}</text></view>
 			</view>
@@ -125,12 +125,12 @@
 	const teachingDay=ref()
 	const get_placeInfo = () => {
 		http.get('/detail/getPlaceInfo', { data: { id: listId.value }, loading: true }).then((res) => {
-			const startIndex = res.result.cover.indexOf('"') + 1;
-			const endIndex = res.result.cover.lastIndexOf('');
-			bannerList.value = res.result.cover.slice(startIndex, endIndex).split(',');
-			let videoIndex = res.result.video.indexOf('"') + 1;
-			let videoEndIndex = res.result.video.lastIndexOf('');
-			videoList.value = res.result.video.slice(videoIndex, videoEndIndex).split(',');
+			const startIndex = res.result.cover?res.result.cover.indexOf('"') + 1:'0';
+			const endIndex = res.result.cover?res.result.cover.lastIndexOf(''):'0';
+			bannerList.value = res.result.cover?res.result.cover.slice(startIndex, endIndex).split(','):[];
+			let videoIndex = res.result.video?res.result.video.indexOf('"') + 1:'0';
+			let videoEndIndex = res.result.video?res.result.video.lastIndexOf(''):'0';
+			videoList.value = res.result.video?res.result.video.slice(videoIndex, videoEndIndex).split(','):[];
 			detailInfo.value = res.result
 			noTeachingDay.value=JSON.parse(res.result.noTeachingDay)
 			teachingDay.value=JSON.parse(res.result.teachingDay)

+ 2 - 2
src/pages/index/gymDetail/index.vue

@@ -120,7 +120,7 @@
 								<view class="">¥{{item.sellingPrice}}</view>
 								<view class="">¥{{item.originalPrice}}</view>
 							</view>
-							<view class="price-btn" @click="RouterUtils.to_page(`/pages/index/gymPay/index?type=1&courseId=${item.id}`)">抢购</view>
+							<view class="price-btn" @click="RouterUtils.to_page(`/pages/index/gymPay/index?type=1&placeId=${item.id}`)">抢购</view>
 						</view>
 					</view>
 					<view class="card-tips">
@@ -180,7 +180,7 @@
 			</block>
 			<loading v-else/>
 			<view class="not-data" v-if="courseList.length<1&&!courseLoading">暂无数据</view>
-			<view class="more">查看更多</view>
+			<!-- <view class="more">查看更多</view> -->
 		</view>
 		<view class="instructor-card" id="schedule">
 			<view class="card-title"  @click="RouterUtils.to_page('/pages/index/allInstructor/index')">

+ 152 - 86
src/pages/index/gymPay/index.vue

@@ -5,7 +5,7 @@
 			<view class="g-shoping-info">
 				<image class="shoping-img" :src="previewCourseInfo.cover" mode=""></image>
 				<view class="shoping-info">
-					<view class="name">{{ previewCourseInfo.name }}</view>
+					<view class="name">{{ previewCourseInfo.placeName }}</view>
 					<view class="price-info">
 						<view class="price"><text class="mini-text">¥</text>{{ previewCourseInfo.sellingPrice }}</view>
 						<view class="price-stepper">
@@ -23,77 +23,71 @@
 				</view>
 				<view class="total-price">
 					<view class="">
-						<text v-if="loadType == 1 || loadType == 2">试听优惠</text>
-						<text v-if="loadType == 3">团购优惠</text>
+						<text v-if="(loadType == 1 || loadType == 2) && !placeId">试听优惠</text>
+						<text v-if="loadType == 3 || placeId">团购优惠</text>
 					</view>
-					<view class="">-¥{{ previewCourseInfo.discountPrice }}</view>
+					<view class="">-¥{{ previewCourseInfo.discountPrice || previewCourseInfo.sellingPrice }}</view>
 				</view>
 			</view>
 			<view class="subtotal">小计 ¥{{ previewCourseInfo.subtotal }}</view>
 		</view>
-		<!-- 无固定场进入 -->
-		<view class="g-buy-tips" v-if="loadType == 4">
-			<view class="tips-title">购买须知</view>
-			<view class="tips-info-card">
-				<view class="title">有效期</view>
-				<view class="text">购买后90天内有效</view>
-				<view class="title">使用时间</view>
-				<view class="text">10:00-22:00</view>
-				<view class="title">预约信息</view>
-				<view class="text">请您<text style="color: #222;">提前1小时</text>预约</view>
-				<view class="title">使用人数</view>
-				<view class="text">每张券最多20人使用</view>
-				<view class="title">温馨提示</view>
-				<view class="text">如需该券发票,请您在消费时,向场馆咨询。</view>
-				<view class="text">为了保障您的权益,建议使用平台线上支付,若使用了其他方式支付导致纠纷,平台不承担任何责任,感谢您的理解和支持。</view>
-			</view>
-		</view>
 		<!-- 课程进入 -->
 		<!-- v-if="loadType==1||loadType==3" -->
-		<view class="r-insurance">
+		<view class="r-insurance" v-for="item in insureIdList" :key="item.id">
 			<view class="r-insurance-infobox">
 				<view class="r-image-box">
-					<image src="https://img.keaitupian.cn/newupload/08/1629449018344288.jpg" mode=""></image>
+					<image :src="item.coverImg" mode=""></image>
 				</view>
 				<view class="r-insurance-title">
 					<view class="r-insurance-name">
-						<view class="r-name">运动无忧保</view>
+						<view class="r-name">{{ item.name }}</view>
 						<view class="r-tags">不支持退款</view>
 					</view>
-					<view class="r-insurance-desc">意外身故、残疾10万;意外医疗1万;意外补充医疗1万;</view>
-					<view class="r-insurance-type">保险公司:中国人保</view>
+					<view class="r-insurance-desc" v-for="(desc, index) in item.insuranceObvious" :key="index">
+						<text v-for="([key, value], idx) in Object.entries(desc)" :key="key + idx">{{ key }}, {{
+							value }};</text>
+					</view>
+					<view class="r-insurance-type">保险公司:{{ item.insuranceName_dictText }}</view>
 					<view class="r-insurance-price">
-						<view class="r-price">¥2/天·人</view>
-						<!-- RouterUtils.to_page('/pages/index/insure/index') -->
-						<view class="r-insurance-btn" @click="insurePopup.open()">去投保
+						<view class="r-price">¥{{ insurePrice }}/天·人</view>
+						<view class="r-insurance-btn" v-if="insureData.length < 1"
+							@click="gotoInsuracePage(item, item.priceDataList)">去投保
 						</view>
 					</view>
 				</view>
 			</view>
-			<view class="line"></view>
-			<view class="r-insurance-adduser">
-				<view class="r-adduser-btn" @click="toUserList">
-					<view class="r-celar" @click="clearUser">清除</view>
-					<view class="r-edit" @click="editUser">修改</view>
-				</view>
-				<view class="r-userinfo-list">
-					<view class="r-userinfo-item">
-						<view class="r-item-title">被保人</view>
-						<view class="r-item-info">2人(杨锦新、赵四儿)</view>
-					</view>
-					<view class="r-userinfo-item">
-						<view class="r-item-title">生效时间</view>
-						<view class="r-item-info">2天(2025.07.24-2025.07-28)</view>
+			<view class="line" v-if="insureData.length > 0"></view>
+			<blcok v-if="insureData.length > 0">
+				<view class="r-insurance-adduser" v-for="(insureUser, index) in insureData" :key="index">
+					<view class="r-adduser-btn">
+						<view class="r-celar" @click="clearUser">清除</view>
+						<view class="r-edit"
+							@click="RouterUtils.to_page(`/pages/index/insure/index?priceDataList=${JSON.stringify(item.priceDataList)}`)">
+							修改</view>
 					</view>
-					<view class="r-userinfo-item">
-						<view class="r-item-title">保费总金额</view>
-						<view class="r-item-info">¥8</view>
+					<view class="r-userinfo-list">
+						<view class="r-userinfo-item">
+							<view class="r-item-title">被保人</view>
+							<view class="r-item-info">{{ insureUser.userData.length }}人(<text
+									v-for="user in insureUser.userData" :key="user.id">{{ user.fullName }},</text>)
+							</view>
+						</view>
+						<view class="r-userinfo-item">
+							<view class="r-item-title">生效时间</view>
+							<view class="r-item-info">{{ insureUser.slectObj.day }}天({{ insureUser.startDate }}-{{
+								insureUser.endDate }})
+							</view>
+						</view>
+						<view class="r-userinfo-item">
+							<view class="r-item-title">保费总金额</view>
+							<view class="r-item-info">¥{{ insureUser.totalPrice }}</view>
+						</view>
 					</view>
 				</view>
-			</view>
+			</blcok>
 		</view>
 		<!-- v-if="loadType==1||loadType==3" -->
-		<view class="g-userinfo-card">
+		<view class="g-userinfo-card" v-if="!placeId">
 			<view class="r-user">
 				<view class="user-title">用户信息</view>
 				<view class="invite">
@@ -118,7 +112,7 @@
 		</view>
 		<!-- v-if="loadType==1" -->
 		<view class="g-usetips-card">
-			<view class="use-title">使用须知</view>
+			<view class="use-title">{{ placeId ? '使用须知' : '购买须知' }}</view>
 			<view class="use-text">
 				<view class="item-text">
 					<rich-text :nodes="previewCourseInfo.reminder"></rich-text>
@@ -129,6 +123,18 @@
 				<view class="use-line"></view>
 			</view>
 		</view>
+		<view class="g-usetips-card">
+			<view class="use-title">服务保障</view>
+			<view class="use-text">
+				<view class="item-text">
+					{{previewCourseInfo.refundType == 1 ? '未消费随时退款,过期未消费自动退款。' : '不支退款,请慎重考虑后购买。'}}
+				</view>
+			</view>
+			<view class="use-tips-more" @click="RouterUtils.to_page('/pages/index/useNotice/index')">
+				<view class="more-text">查看更多</view>
+				<view class="use-line"></view>
+			</view>
+		</view>
 		<view style="height: 166rpx;"></view>
 		<view class="footer footer-box">
 			<view class="footer-price">
@@ -145,33 +151,10 @@
 		</view>
 	</view>
 	<uni-popup ref="insurePopup" type="center">
-		<view class="r-center-popup">
-			<view class="r-popup-title">无保险免责声明</view>
+		<view class="r-center-popup" v-if="agreementContent">
+			<view class="r-popup-title">{{ agreementContent.protocolName }}</view>
 			<view class="r-popup-content">
-				一、本声明的目的是为了使用体育场地的人员明确
-				知晓体育活动所存在的风险,凡签署本声明的人员,
-				均视为已经仔细阅读和完全理解并同意接受本声明
-				的全部条款。对于违反国家相关法规、恶意侵犯他
-				人或其他涉及犯罪行为的事件,均不在本声明范国
-				内跟覆篮戏娇须由个人承担相应的法律责任。
-				一、本声明的目的是为了使用体育场地的人员明确
-				知晓体育活动所存在的风险,凡签署本声明的人员,
-				均视为已经仔细阅读和完全理解并同意接受本声明
-				的全部条款。对于违反国家相关法规、恶意侵犯他
-				人或其他涉及犯罪行为的事件,均不在本声明范国
-				内跟覆篮戏娇须由个人承担相应的法律责任。
-				一、本声明的目的是为了使用体育场地的人员明确
-				知晓体育活动所存在的风险,凡签署本声明的人员,
-				均视为已经仔细阅读和完全理解并同意接受本声明
-				的全部条款。对于违反国家相关法规、恶意侵犯他
-				人或其他涉及犯罪行为的事件,均不在本声明范国
-				内跟覆篮戏娇须由个人承担相应的法律责任。
-				一、本声明的目的是为了使用体育场地的人员明确
-				知晓体育活动所存在的风险,凡签署本声明的人员,
-				均视为已经仔细阅读和完全理解并同意接受本声明
-				的全部条款。对于违反国家相关法规、恶意侵犯他
-				人或其他涉及犯罪行为的事件,均不在本声明范国
-				内跟覆篮戏娇须由个人承担相应的法律责任。
+				<rich-text :nodes="agreementContent.protocolContent"></rich-text>
 			</view>
 			<view class="r-popup-footer">
 				<view class="r-popup-needbtn" @click="toNeed">我需要购买保险</view>
@@ -186,25 +169,32 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, onMounted, computed } from 'vue';
-import { onLoad, onPageScroll } from '@dcloudio/uni-app';
+import { ref, onMounted } from 'vue';
+import { onLoad } from '@dcloudio/uni-app';
 import { RouterUtils, TipsUtils, idCardHide } from '@/utils/util';
 import { http } from '@/utils/http'
 const insurePopup = ref()
 const select_insurance = ref(false)
 const loadType = ref(1)
-const buyType=ref()
+const buyType = ref()
+const placeId = ref()
 onLoad((options) => {
 	loadType.value = options.type
 	courseId.value = options.courseId
-	buyType.value=options.buyType
+	placeId.value = options.placeId
+	buyType.value = options.buyType
 	orderFormData.value.type = options.orderType
 	orderFormData.value.orFreeOrder = options.buyType
-	orderFormData.value.amount=1
+	orderFormData.value.amount = 1
 })
 onMounted(() => {
-	get_previewOrderCourse()
+	if (placeId.value) {
+		getEventsDetail()
+	} else {
+		get_previewOrderCourse()
+	}
 	get_userData()
+	getInsureData()
 })
 
 const toUserList = () => {
@@ -231,15 +221,75 @@ const deleteUser = async (e) => {
 	}
 }
 
+const priceDataListData = ref([])
+const gotoInsuracePage = (e1: any, e2: any) => {
+	getFindByType(e1.insuranceName)
+	priceDataListData.value = e2
+	orderFormData.value.insureOrderInfoForm.insureId = e1.id
+}
+
+const agreementContent = ref()
+const getFindByType = (insuranceName: any) => {
+	http.get('/my/feedback/findByType', { data: { insuranceName: insuranceName, protocolType: 0 }, loading: true }).then((res: any) => {
+		agreementContent.value = res.result
+		insurePopup.value.open()
+	})
+}
+
 const courseId = ref()
 const previewCourseInfo = ref()
+const insureIdList = ref([])  // 保险列表
+const insurePrice = ref() // 保险价格
+// 课程预览
 const get_previewOrderCourse = () => {
 	http.get('/order/previewOrderCourse', { data: { courseId: courseId.value }, loading: true }).then((res) => {
 		previewCourseInfo.value = res.result
 		orderFormData.value.productIds = res.result.id
+		res.result.insureIdList.map((item: any) => {
+			item.insuranceObvious = JSON.parse(item.insuranceObvious)
+			item.insuranceObvious = [item.insuranceObvious]
+			item.priceDataList.map((item2: any) => {
+				if (item2.insureDay === 1) {
+					insurePrice.value = item2.insurePrice
+				}
+			})
+		})
+		insureIdList.value = res.result.insureIdList
+	})
+}
+
+// 场地预览
+const getEventsDetail = () => {
+	http.get('/order/PreviewOrderPlaceGymnasiumNoFixation', { data: { placeId: placeId.value }, loading: true }).then((res) => {
+		previewCourseInfo.value = res.result
+		orderFormData.value.productIds = res.result.id
 	})
 }
 
+const insureData = ref([])
+const getInsureData = () => {
+	uni.$on('insureData', function (data) {
+		insureData.value = data
+		console.log(insureData.value, '投保人信息');
+		orderFormData.value.insureOrderInfoForm.assertStartTime = insureData.value[0].startDate
+		orderFormData.value.insureOrderInfoForm.assertEndTime = insureData.value[0].endDate
+		orderFormData.value.insureOrderInfoForm.insurePriceId = insureData.value[0].slectObj.id
+		if (data.length > 0) {
+			let familyMembersIds = data[0].userData.map(item => item.id)
+			orderFormData.value.insureOrderInfoForm.familyMembersIds = familyMembersIds.join(',')
+		} else {
+			orderFormData.value.insureOrderInfoForm.familyMembersIds = []
+		}
+	})
+}
+
+const clearUser = async () => {
+	let res: any = await TipsUtils.tips_alert('确定清除投保人信息吗?', true)
+	if (res.confirm) {
+		insureData.value = []
+	}
+}
+
 const countTotal = ref(1)
 const minusNum = () => {
 	if (countTotal.value > 1) {
@@ -249,9 +299,9 @@ const minusNum = () => {
 }
 
 const addNum = () => {
-	if(buyType.value==1) return TipsUtils.tips_toast('试听课程不支持多个购买')
+	if (buyType.value == 1) return TipsUtils.tips_toast('试听课程不支持多个购买')
 	get_checkCourseLimitNum(countTotal.value + 1)
-	orderFormData.value.amount = countTotal.value+1
+	orderFormData.value.amount = countTotal.value + 1
 }
 
 const get_checkCourseLimitNum = (targetNum) => {
@@ -272,8 +322,8 @@ const get_checkCourseLimitNum = (targetNum) => {
 
 const toNeed = () => {
 	if (!select_insurance.value) return TipsUtils.tips_toast('请先阅读并同意协议')
+	RouterUtils.to_page(`/pages/index/insure/index?priceDataList=${JSON.stringify(priceDataListData.value)}`)
 	insurePopup.value.close()
-	RouterUtils.to_page('/pages/index/insure/index')
 }
 
 const toRefuse = () => {
@@ -294,6 +344,21 @@ let orderFormData = ref({
 	productIds: null,
 	amount: null,
 	familyIds: null,
+	insureOrderInfoForm: {
+		insureId: null,
+		assertStartTime: null,
+		assertEndTime: null,
+		insurePriceId: null,
+		familyMembersIds: null,
+	},
+	// gameCertificationForm:{
+	// 	teamName:'',
+	// 	teamEmblemImg: '',
+	// 	certificationDTOS:[{
+	// 		name: '',
+	// 		certificationImg: '',
+	// 	}]
+	// }
 })
 const submitOrder = () => {
 	if (!userData.value) return TipsUtils.tips_toast('请添加用户信息')
@@ -474,6 +539,7 @@ const submitOrder = () => {
 			}
 
 			.r-insurance-desc {
+				width: 440rpx;
 				margin-top: 10rpx;
 				font-size: 24rpx;
 				color: #AAAAAA;
@@ -767,7 +833,7 @@ const submitOrder = () => {
 
 .r-center-popup {
 	width: 646rpx;
-	height: 1000rpx;
+	max-height: 1000rpx;
 	background: #F6F6F6;
 	border-radius: 32rpx;
 	padding: 20rpx;
@@ -783,7 +849,7 @@ const submitOrder = () => {
 		margin-top: 28rpx;
 		font-size: 28rpx;
 		color: #222222;
-		height: 600rpx;
+		max-height: 600rpx;
 		overflow: auto;
 	}
 

+ 1 - 0
src/pages/index/insure/index.vue

@@ -91,6 +91,7 @@ import ZzxIcon from '@/components/zzx-icon/zzx-icon.vue';
 const priceDataList = ref<any[]>([]);
 onLoad((option) => {
   priceDataList.value = JSON.parse(option.priceDataList || '[]')
+  console.log(priceDataList.value,'携带数据');
 
 })
 onMounted(() => {

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

@@ -13,7 +13,7 @@
 		<view v-if="!searchLoading">
 			<view class="venue-card" v-for="item in dataList" @click="gotoDetail(item)" :key="item.id">
 				<view class="venues-image">
-					<image :src="item.cover" mode=""></image>
+					<image :src="'http://192.168.1.34:8080/jeecg-boot/sys/common/static/'+item.cover" mode=""></image>
 					<view class="e-badge">
 						<image src="/src/static/events-icon1.png" mode="widthFix"></image>
 						<view class="text">{{item.ticketWhether?'今日有票':'暂无余票'}}</view>