Bladeren bron

订单支付基础

学习?学个屁 4 dagen geleden
bovenliggende
commit
f574353f3f

+ 5 - 11
src/pages/index/gymPay/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<!-- 不同类型进入的type(1:学校课程;2:体育馆课程;3:教练课程) -->
+	<!-- 不同类型进入的loadType(1:学校课程;2:体育馆课程;3:教练课程) -->
 	<view class="content">
 		<view class="g-orderinfo-card">
 			<view class="g-shoping-info">
@@ -23,8 +23,8 @@
 				</view>
 				<view class="total-price">
 					<view class="">
-						<text v-if="(loadType == 1 || loadType == 2) && !placeId">试听优惠</text>
-						<text v-if="loadType == 3 || placeId">团购优惠</text>
+						<text v-if="buyType == 1">试听优惠</text>
+						<text v-if="buyType == 0 || placeId">团购优惠</text>
 					</view>
 					<view class="">-¥{{ previewCourseInfo.discountPrice || previewCourseInfo.sellingPrice }}</view>
 				</view>
@@ -32,7 +32,6 @@
 			<view class="subtotal">小计 ¥{{ previewCourseInfo.subtotal }}</view>
 		</view>
 		<!-- 课程进入 -->
-		<!-- v-if="loadType==1||loadType==3" -->
 		<view class="r-insurance" v-for="item in insureIdList" :key="item.id">
 			<view class="r-insurance-infobox">
 				<view class="r-image-box">
@@ -86,7 +85,6 @@
 				</view>
 			</blcok>
 		</view>
-		<!-- v-if="loadType==1||loadType==3" -->
 		<view class="g-userinfo-card" v-if="!placeId">
 			<view class="r-user">
 				<view class="user-title">用户信息</view>
@@ -110,7 +108,6 @@
 				<view class="add-text">添加用户</view>
 			</view>
 		</view>
-		<!-- v-if="loadType==1" -->
 		<view class="g-usetips-card">
 			<view class="use-title">{{ placeId ? '使用须知' : '购买须知' }}</view>
 			<view class="use-text">
@@ -127,7 +124,7 @@
 			<view class="use-title">服务保障</view>
 			<view class="use-text">
 				<view class="item-text">
-					{{previewCourseInfo.refundType == 1 ? '未消费随时退款,过期未消费自动退款。' : '不支退款,请慎重考虑后购买。'}}
+					{{ previewCourseInfo.refundType == 1 ? '未消费随时退款,过期未消费自动退款。' : '不支退款,请慎重考虑后购买。' }}
 				</view>
 			</view>
 			<view class="use-tips-more" @click="RouterUtils.to_page('/pages/index/useNotice/index')">
@@ -334,9 +331,6 @@ const toRefuse = () => {
 	}
 }
 
-// uni.navigateTo({
-// 	url: '/pages/index/toBeUsed/index'
-// })
 let orderFormData = ref({
 	type: null,
 	orderType: null,
@@ -363,7 +357,7 @@ let orderFormData = ref({
 const submitOrder = () => {
 	if (!userData.value) return TipsUtils.tips_toast('请添加用户信息')
 	http.post('/order/createOrder', orderFormData.value, { loading: true }).then((res) => {
-
+		RouterUtils.to_page(`/pages/index/toBeUsed/index?orderId=${res.result.orderId}&orderType=${loadType.value}`)
 	})
 }
 </script>

+ 26 - 14
src/pages/index/toBeUsed/index.vue

@@ -1,3 +1,4 @@
+<!-- 订单类型orderType:1;2体育馆课程进入 -->
 <template>
 	<view class="content">
 		<view class="t-header">
@@ -12,7 +13,7 @@
 			<view class="booking-btn">立即预约</view>
 		</view>
 		<!-- 包场 -->
-		<view class="c-scheduled-card">
+		<view class="c-scheduled-card" v-if="orderPageInfo.orderType!=2">
 			<view class="title">预定信息</view>
 			<view class="schedule-address">
 				<view class="text">场馆</view>
@@ -68,7 +69,7 @@
 			</view>
 		</view>
 		<!-- 待使用展示 -->
-		<view class="t-qrcode-card">
+		<view class="t-qrcode-card" v-if="orderPageInfo.orderType==2">
 			<view class="qrcode-box">
 				<view class="item-qrcode">
 					<uv-qrcode ref="qrcode" size="100px" value="https://h5.uvui.cn"></uv-qrcode>
@@ -84,7 +85,7 @@
 			</view>
 		</view>
 		<!-- 已使用已过期展示 -->
-		<view class="t-qrcode-card">
+		<view class="t-qrcode-card" v-if="orderPageInfo.orderType!=2">
 			<view class="t-todeused" v-for="item in 2" style="border-bottom: 1rpx solid #F0F0F0;">
 				<view class="todeused">
 					<view class="item-todeused">
@@ -100,7 +101,7 @@
 			</view>
 		</view>
 		<!-- 学校场地预定订单详情展示 -->
-		<view class="t-scheduled-card">
+		<view class="t-scheduled-card" v-if="orderPageInfo.orderType!=2">
 			<view class="s-title">预定信息</view>
 			<view class="t-scheduled-list">
 				<view class="item-list">
@@ -147,7 +148,7 @@
 				<zzx-icon name="ashRight" size="12"></zzx-icon>
 			</view>
 		</view>
-		<view class="t-use-card">
+		<view class="t-use-card" v-if="orderPageInfo.orderType!=2">
 			<view class="use-tips">
 				<view class="title">参赛意外险</view>
 				<view class="text">实际付款:6元(3元/份×2)</view>
@@ -157,7 +158,7 @@
 				<zzx-icon name="ashRight" size="12"></zzx-icon>
 			</view>
 		</view>
-		<view class="t-use-card">
+		<view class="t-use-card" v-if="orderPageInfo.orderType!=2">
 			<view class="use-tips t-contract-list">
 				<view class="title">电子合同</view>
 				<view class="text contract-list">
@@ -289,14 +290,23 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue';
+import { ref,onMounted } from 'vue';
 import { TipsUtils, RouterUtils } from '@/utils/util'
+import { onLoad } from '@dcloudio/uni-app';
 import { http } from '@/utils/http'
 const qrcode = ref();
 const pricePopup = ref()  //价格
 const refundPopup = ref()  //退款
 const selected = ref(false)
-const download_qrcode = () => {     //下载二维码
+const orderPageInfo=ref()
+onLoad((option) => {
+	orderPageInfo.value = option
+	console.log(orderPageInfo.value);
+})
+onMounted(()=>{
+	getOrderDetailInfo()
+})
+const download_qrcode = () => {//下载二维码
 	uni.showLoading()
 	qrcode.value.save({
 		success: (res) => {
@@ -310,21 +320,23 @@ const download_qrcode = () => {     //下载二维码
 }
 
 const torecord_page = () => {
-	uni.navigateTo({
-		url: '/pages/index/verificationRecord/index'
-	})
+	RouterUtils.to_page('/pages/index/verificationRecord/index')
 }
 
 const refund_btn = () => {
-	uni.navigateTo({
-		url: '/pages/index/refundDetail/index'
-	})
+	RouterUtils.to_page('/pages/index/refundDetail/index')
 }
 
 const goToContract = () => {
 	get_UserIdentityInfo()
 }
 
+const getOrderDetailInfo=(()=>{
+	http.get('/order/queryOrderInfo',{data:{orderId:orderPageInfo.value.orderId},loading:true}).then((res)=>{
+
+	})
+})
+
 // 查询授权
 const get_UserIdentityInfo = () => {
 	http.get('/esign/getUserIdentityInfo', { data: { phoneNumber: '17585167187' }, loading: true }).then((res) => {

+ 161 - 151
src/pages/index/userList/index.vue

@@ -12,196 +12,206 @@
 			<view class="card">
 				<zzx-icon name="wechat" size="14"></zzx-icon>
 				<view class="">邀请好友加入</view>
+				<button class="g-share-btn" open-type="share"></button>
 			</view>
 		</view>
 		<view class="u-user-list-box">
-			<view class="u-user-list" v-for="(item,index) in userList" :key="index" @click="selectUser(item)">
+			<view class="u-user-list" v-for="(item, index) in userList" :key="index" @click="selectUser(item)">
 				<view class="user-info">
-					<view class="name">{{item.fullName}}</view>
-					<view class="idcard">身份证 {{idCardHide(item.identityCard)}}</view>
+					<view class="name">{{ item.fullName }}</view>
+					<view class="idcard">身份证 {{ idCardHide(item.identityCard) }}</view>
 				</view>
 				<view class="">
-					<zzx-icon :name="item.selOut?'selected' : 'unchecked'" size="14"></zzx-icon>
+					<zzx-icon :name="item.selOut ? 'selected' : 'unchecked'" size="14"></zzx-icon>
 				</view>
 			</view>
 		</view>
 		<view style="height: 160rpx;"></view>
-		<view class="u-select-btn" @click="confirmSelect">
-			<button hover-class="hover-btn">确认选择:{{selTotal}}人</button>
+		<view class="u-select-btn" @click="confirmSelect" v-if="!nameText">
+			<button hover-class="hover-btn">确认选择:{{ selTotal }}人</button>
 		</view>
 	</view>
 </template>
 
 <script lang="ts" setup>
-	import { ref, onMounted, computed } from 'vue';
-	import { http } from '@/utils/http';
-	import { useCacheStore } from '@/stores/cache'
-	import { onLoad, onReachBottom } from '@dcloudio/uni-app';
-	import { RouterUtils, idCardHide } from '@/utils/util';
-	const cache = useCacheStore()
-	const userList = ref()
-	const selTotal = ref(0)
-	const pageNo = ref(1)
-	const userinfo = computed(() => {
-		return cache.get('USER_INFO')
-	})
-	const selectType=ref()
-	onLoad((options) => {
-		selectType.value=options.type
-		console.log('options', options);
-		if (options.name) {
-			uni.setNavigationBarTitle({
-				title: options.name
-			});
-		}
-	})
-	onReachBottom(() => {
-		pageNo.value++
-		get_userList()
-	})
-	onMounted(() => {
-		get_userList()
-	})
-
-	const get_userList = () => {
-		http.get('/my/familyMembers/findFamilyMembers', { data: { userId: userinfo.value.id, pageNo: pageNo.value, pageSize:30 }, loading: true }).then((res) => {
-			res.result.records = res.result.records.map((item:any) => ({
-				...item,
-				selOut: false
-			}))
-			if (pageNo.value == 1) {
-				userList.value = res.result.records
-			} else {
-				userList.value = [...userList.value, ...res.result.records]
-			}
-		})
+import { ref, onMounted, computed } from 'vue';
+import { http } from '@/utils/http';
+import { useCacheStore } from '@/stores/cache'
+import { onLoad, onReachBottom } from '@dcloudio/uni-app';
+import { RouterUtils, idCardHide } from '@/utils/util';
+const cache = useCacheStore()
+const userList = ref()
+const selTotal = ref(0)
+const pageNo = ref(1)
+const userinfo = computed(() => {
+	return cache.get('USER_INFO')
+})
+const selectType = ref()
+const nameText = ref()
+onLoad((options) => {
+	selectType.value = options.type
+	// console.log('options', options);
+	nameText.value = options.name
+	if (options.name) {
+		uni.setNavigationBarTitle({
+			title: options.name
+		});
 	}
-	
-	const selArr=ref([])
-	const selectUser = (item : any) => {
-		item.selOut = !item.selOut
-		if (item.selOut) {
-			selTotal.value++
-			selArr.value.push(item)
+})
+onReachBottom(() => {
+	pageNo.value++
+	get_userList()
+})
+onMounted(() => {
+	get_userList()
+})
+
+const get_userList = () => {
+	http.get('/my/familyMembers/findFamilyMembers', { data: { userId: userinfo.value.id, pageNo: pageNo.value, pageSize: 30 }, loading: true }).then((res) => {
+		res.result.records = res.result.records.map((item: any) => ({
+			...item,
+			selOut: false
+		}))
+		if (pageNo.value == 1) {
+			userList.value = res.result.records
 		} else {
-			selTotal.value--
-			selArr.value = selArr.value.filter((i:any) => i.id != item.id)
-		} 
-	}
-
-	const addUser = () => {
-		RouterUtils.to_page('/pages/index/attestation/index');
-	}
-	const confirmSelect=()=>{
-		if(selectType.value=='insure'){
-			uni.$emit('insureUserData',selArr.value)
-		}else{
-		uni.$emit('userData',selArr.value)
+			userList.value = [...userList.value, ...res.result.records]
 		}
-		uni.navigateBack()
+	})
+}
+
+const selArr = ref([])
+const selectUser = (item: any) => {
+	item.selOut = !item.selOut
+	if (item.selOut) {
+		selTotal.value++
+		selArr.value.push(item)
+	} else {
+		selTotal.value--
+		selArr.value = selArr.value.filter((i: any) => i.id != item.id)
 	}
+}
+
+const addUser = () => {
+	RouterUtils.to_page('/pages/index/attestation/index');
+}
+const confirmSelect = () => {
+	if (selectType.value == 'insure') {
+		uni.$emit('insureUserData', selArr.value)
+	} else {
+		uni.$emit('userData', selArr.value)
+	}
+	uni.navigateBack()
+}
 </script>
 
 <style lang="less" scoped>
-	.u-tips {
-		display: flex;
-		align-items: center;
-		gap: 6rpx;
-		background: rgba(255, 163, 71, 0.1);
-		padding: 20rpx;
-
-		.icon {
-			width: 30rpx;
-			height: 30rpx;
-			border-radius: 50%;
-			background: #FFA347;
-			color: #fff;
-			font-size: 24rpx;
-			text-align: center;
-			line-height: 30rpx;
-		}
+.u-tips {
+	display: flex;
+	align-items: center;
+	gap: 6rpx;
+	background: rgba(255, 163, 71, 0.1);
+	padding: 20rpx;
+
+	.icon {
+		width: 30rpx;
+		height: 30rpx;
+		border-radius: 50%;
+		background: #FFA347;
+		color: #fff;
+		font-size: 24rpx;
+		text-align: center;
+		line-height: 30rpx;
+	}
 
-		&>text {
-			font-size: 24rpx;
-			color: #222222;
-		}
+	&>text {
+		font-size: 24rpx;
+		color: #222222;
 	}
+}
+
+.u-card {
+	display: flex;
+	align-items: center;
+	justify-content: space-around;
+	margin-top: 20rpx;
 
-	.u-card {
+	.card {
+		width: 336rpx;
+		height: 120rpx;
+		background: #FFFFFF;
+		border-radius: 16rpx;
 		display: flex;
 		align-items: center;
-		justify-content: space-around;
-		margin-top: 20rpx;
-
-		.card {
-			width: 336rpx;
-			height: 120rpx;
-			background: #FFFFFF;
-			border-radius: 16rpx;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			// flex-direction: column;  换行	
-			gap: 10rpx;
-
-			&>view {
-				font-size: 28rpx;
-				color: #222222;
-			}
+		justify-content: center;
+		// flex-direction: column;  换行	
+		gap: 10rpx;
+		position: relative;
+		&>view {
+			font-size: 28rpx;
+			color: #222222;
 		}
-	}
 
-	.u-user-list-box {
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 20rpx;
-		margin-top: 20rpx;
-
-		.u-user-list {
-			margin-top: 24rpx;
-			display: flex;
-			justify-content: space-between;
-			border-bottom: 1rpx solid #F0F0F0;
-
-			.name {
-				font-weight: bold;
-				font-size: 28rpx;
-				color: #222222;
-				margin-bottom: 20rpx;
-			}
-
-			.idcard {
-				margin-bottom: 24rpx;
-				font-size: 28rpx;
-				color: #222222;
-			}
+		.g-share-btn {
+			position: absolute;
+			width: 300rpx;
+			height:110rpx;
+			opacity: 0;
 		}
 	}
+}
 
+.u-user-list-box {
+	background: #FFFFFF;
+	border-radius: 16rpx;
+	padding: 20rpx;
+	margin-top: 20rpx;
 
-	.u-select-btn {
-		position: fixed;
-		bottom: 60rpx;
-		width: 95%;
+	.u-user-list {
+		margin-top: 24rpx;
+		display: flex;
+		justify-content: space-between;
+		border-bottom: 1rpx solid #F0F0F0;
 
-		&>button {
-			width: 100%;
-			height: 100rpx;
-			line-height: 100rpx;
-			background: #D3FD76;
-			border-radius: 60rpx;
+		.name {
 			font-weight: bold;
-			font-size: 32rpx;
+			font-size: 28rpx;
 			color: #222222;
+			margin-bottom: 20rpx;
 		}
 
-		&>button::after {
-			border: none;
+		.idcard {
+			margin-bottom: 24rpx;
+			font-size: 28rpx;
+			color: #222222;
 		}
+	}
+}
+
+
+.u-select-btn {
+	position: fixed;
+	bottom: 60rpx;
+	width: 95%;
+
+	&>button {
+		width: 100%;
+		height: 100rpx;
+		line-height: 100rpx;
+		background: #D3FD76;
+		border-radius: 60rpx;
+		font-weight: bold;
+		font-size: 32rpx;
+		color: #222222;
+	}
 
-		.hover-btn {
-			background: #ccf371;
-			color: #999999;
-		}
+	&>button::after {
+		border: none;
+	}
+
+	.hover-btn {
+		background: #ccf371;
+		color: #999999;
 	}
+}
 </style>

+ 2 - 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="'http://192.168.1.34:8080/jeecg-boot/sys/common/static/'+item.cover" mode=""></image>
+					<image :src="'http://192.168.0.11: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>
@@ -88,6 +88,7 @@
 		sel_index.value = i
 		sel_btn.value=0
 		tagsVal.value=e.tagsVal
+		current.value=1
 		get_dictType(e.value || 0)
 		get_placeList(e.tagsVal)
 	}

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

@@ -179,9 +179,9 @@ export class HttpClient {
 
 // 创建实例
 export const http = new HttpClient({
-  baseURL: 'http://192.168.1.34:8080/jeecg-boot/app',
+  // baseURL: 'http://192.168.1.34: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: 'http://192.168.0.11:8080/jeecg-boot/app',
   headers: {
     'Content-Type': 'application/json'
   }