Эх сурвалжийг харах

16号预测完毕上线版本

学习?学个屁 1 долоо хоног өмнө
parent
commit
ba07cf4696

+ 10 - 7
src/App.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
+import { onLaunch, onShow, onHide, onLoad } from "@dcloudio/uni-app";
 import { initEid } from '@/pages/mp_ecard_sdk/main';
 import { TipsUtils } from '@/utils/util';
 import { useCacheStore } from '@/stores/cache'
@@ -7,9 +7,10 @@ const cache = useCacheStore()
 onLaunch((options) => {
 	console.log(options.scene, '小程序打开的场景值')
 	//  =============判断是否扫码进入start============
-	if (options.scene === 1011 || options.scene === 1012 || options.scene === 1013) {
+	if ([1011, 1012, 1013].includes(options.scene)) {
+		cache.remove('GAME_ID');
+		cache.remove('PLACE_ID');
 		const decodedUrl = decodeURIComponent(options.query.q);
-		// console.log(decodedUrl);
 		const urlParts = decodedUrl.split('?');
 		if (urlParts.length > 1) {
 			const queryParams = urlParts[1];
@@ -19,17 +20,19 @@ onLaunch((options) => {
 				const [key, value] = pair.split('=');
 				resultObj[key] = value;
 			});
+
 			const gamesId = resultObj['id'];
 			const placeId = resultObj['placeId'];
-			console.log(gamesId, '----赛事id');
-			console.log(placeId, '----场地id');
-			cache.set('GAME_ID',gamesId)
-			cache.set('PLACE_ID',placeId)
+
+			cache.set('GAME_ID', gamesId);
+			cache.set('PLACE_ID', placeId);
+
 			console.info(cache.get('GAME_ID'), '---用户通过扫赛事码进入')
 			console.info(cache.get('PLACE_ID'), '---用户通过扫学校场地进入')
 		}
 	}
 	//  =============判断是否扫码进入end============
+
 	//  =============获取经纬度start============
 	initEid()
 	uni.authorize({

+ 85 - 76
src/components/zzx-navbar/zzx-navbar.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="nav-title"
-		:style="{height:navBarHeight+'px',opacity: navOpacity,transition: 'opacity 0.3s ease-in-out',background: backgroundColor }">
-		<view class="back-icon" :style="{paddingTop:(statusBarHeight-30)+'px'}" v-if="back" @click="backToPage">
+		:style="{ height: navBarHeight + 'px', opacity: navOpacity, transition: 'opacity 0.3s ease-in-out', background: backgroundColor }">
+		<view class="back-icon" :style="{ paddingTop: (statusBarHeight - 30) + 'px' }" v-if="back" @click="backToPage">
 			<zzx-icon name="back"></zzx-icon>
 		</view>
-		<view class="title-style" :style="{paddingTop:(statusBarHeight-30)+'px'}" v-if="title!=''">
-			<text>{{title}}</text>
+		<view class="title-style" :style="{ paddingTop: (statusBarHeight - 30) + 'px' }" v-if="title != ''">
+			<text>{{ title }}</text>
 		</view>
 		<view class="slot-style" v-else>
 			<slot></slot>
@@ -15,85 +15,94 @@
 </template>
 
 <script lang="ts" setup>
-	import { ref, onMounted } from 'vue'
-	import { onLoad, onPageScroll } from '@dcloudio/uni-app';
-	const navBarHeight = ref(0);
-	const statusBarHeight = ref(0);
-	const titleBarHeight = ref(0);
-	const navOpacity = ref(0);
-	const backgroundColor = ref('#fff');
-	interface Props {
-		title ?: string 
-		back ?: boolean //是否开启返回
-		scrollable ?: boolean; //是否开启滚动显示
-		bgColor ?: string; //自定义背景颜色
+import { ref, onMounted } from 'vue'
+import { onLoad, onPageScroll } from '@dcloudio/uni-app';
+const navBarHeight = ref(0);
+const statusBarHeight = ref(0);
+const titleBarHeight = ref(0);
+const navOpacity = ref(0);
+const backgroundColor = ref('#fff');
+interface Props {
+	title?: string
+	back?: boolean //是否开启返回
+	scrollable?: boolean; //是否开启滚动显示
+	bgColor?: string; //自定义背景颜色
+}
+const props = withDefaults(defineProps<Props>(), {
+	title: '',
+	back: false,
+	scrollable: false,
+	bgColor: ''
+})
+onMounted(() => {
+	get_navheight()
+	backgroundColor.value = props.bgColor;
+	if (props.scrollable) {
+		navOpacity.value = 0
+	} else {
+		navOpacity.value = 1
 	}
-	const props = withDefaults(defineProps<Props>(), {
-		title: '',
-		back: false,
-		scrollable: false,
-		bgColor: ''
-	})
-	onMounted(() => {
-		get_navheight()
-		backgroundColor.value = props.bgColor;
-		if(props.scrollable){
-			navOpacity.value=0
-		}else{
-			navOpacity.value=1
-		}
-	})
-	onPageScroll((e) => {
-		if (props.scrollable) {
-			navOpacity.value = Math.min(Math.max(e.scrollTop / navBarHeight.value, 0), 1);
-		}
-	})
+})
+onPageScroll((e) => {
+	if (props.scrollable) {
+		navOpacity.value = Math.min(Math.max(e.scrollTop / navBarHeight.value, 0), 1);
+	}
+})
 
-	const backToPage = () => {
+const backToPage = () => {
+	const pages = getCurrentPages();
+	console.log(pages,'页面栈信息');
+	if (pages.length > 1) {
 		uni.navigateBack()
+	} else {
+		uni.switchTab({
+			url: '/pages/index/index'
+		})
 	}
+}
 
-	const get_navheight = () => {
-		// #ifdef MP-WEIXIN
-		const systemInfo = uni.getSystemInfoSync();
-		statusBarHeight.value = systemInfo.statusBarHeight || 0;
-		// 获取胶囊按钮信息
-		const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-		// 计算标题栏高度:胶囊按钮距状态栏的上下边距总和 + 按钮高度
-		const titleBarHeightCalc = (menuButtonInfo.top - statusBarHeight.value) * 2 + menuButtonInfo.height;
-		titleBarHeight.value = titleBarHeightCalc;
-		// 导航栏总高度 = 状态栏高度 + 标题栏高度
-		navBarHeight.value = statusBarHeight.value + titleBarHeight.value;
-		// #endif
-	}
+const get_navheight = () => {
+	// #ifdef MP-WEIXIN
+	const systemInfo = uni.getSystemInfoSync();
+	statusBarHeight.value = systemInfo.statusBarHeight || 0;
+	// 获取胶囊按钮信息
+	const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+	// 计算标题栏高度:胶囊按钮距状态栏的上下边距总和 + 按钮高度
+	const titleBarHeightCalc = (menuButtonInfo.top - statusBarHeight.value) * 2 + menuButtonInfo.height;
+	titleBarHeight.value = titleBarHeightCalc;
+	// 导航栏总高度 = 状态栏高度 + 标题栏高度
+	navBarHeight.value = statusBarHeight.value + titleBarHeight.value;
+	// #endif
+}
 </script>
 
 <style lang="less" scoped>
-	.nav-title {
-		position: fixed;
-		width: 100%;
-		background-color: #fff;
-		text-align: center;
-		font-size: 28rpx;
-		z-index: 9999;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		.back-icon {
-			position: absolute;
-			left: 20rpx;
-			top: 70%; 
-			transform: translateY(-50%);
-		}
-		
-		.title-style {
-			margin-top: 60rpx;
-			position: static;
-		}
-		
-		.slot-style {
-			margin-top:60rpx;
-			position: static; 
-		}
+.nav-title {
+	position: fixed;
+	width: 100%;
+	background-color: #fff;
+	text-align: center;
+	font-size: 28rpx;
+	z-index: 9999;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+
+	.back-icon {
+		position: absolute;
+		left: 20rpx;
+		top: 70%;
+		transform: translateY(-50%);
+	}
+
+	.title-style {
+		margin-top: 60rpx;
+		position: static;
+	}
+
+	.slot-style {
+		margin-top: 60rpx;
+		position: static;
 	}
+}
 </style>

+ 6 - 0
src/pages.json

@@ -347,6 +347,12 @@
 				"iconPath": "/static/tabbar/home.png",
 				"selectedIconPath": "/static/tabbar/select_home.png"
 			},
+			{
+				"text": "订单",
+				"pagePath": "pages/mine/orderInfo/index",
+				"iconPath": "/static/tabbar/order-icon.png",
+				"selectedIconPath": "/static/tabbar/sel-order-icon.png"
+			},
 			{
 				"text": "我的",
 				"pagePath": "pages/mine/index",

+ 6 - 5
src/pages/index/courseDetail/index.vue

@@ -45,7 +45,7 @@
 			</view>
 		</view>
 		<view class="c-line"></view>
-		<view class="c-rules">限制:每人限购{{courseDetailInfo?.limitNum}}张</view>
+		<view class="c-rules">限制:每人限购{{ courseDetailInfo?.limitNum }}张</view>
 	</view>
 	<view class="content">
 		<uv-sticky offset-top="70">
@@ -102,7 +102,8 @@
 				<view class="appraise-info" v-for="item in appraiseList.records" :key="item.id">
 					<view class="a-user-info">
 						<view class="info">
-							<image :src="item.avatar" mode=""></image>
+							<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+							<image v-else :src="item.avatar" mode=""></image>
 							<view class="name">{{ item.username }}</view>
 						</view>
 						<view class="time">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
@@ -207,8 +208,8 @@ onMounted(() => {
 
 const openMap = () => {
 	uni.openLocation({
-		latitude: courseDetailInfo.value.latitude||0,
-		longitude: courseDetailInfo.value.longitude||0,
+		latitude: courseDetailInfo.value.latitude || 0.0,
+		longitude: courseDetailInfo.value.longitude || 0.0,
 		name: courseDetailInfo.value.name,
 		address: courseDetailInfo.value.address,
 		success: function () {
@@ -317,7 +318,7 @@ const courseDetailInfo = ref()
 const bannerList = ref([])
 const videoList = ref([])
 const get_courseInfo = () => {
-	http.get('/detail/getCourseInfo', { data: { id: courseId.value || '22222', latitude: cache.get('LAT'), longitude: cache.get('LON') }, loading: true }).then((res) => {
+	http.get('/detail/getCourseInfo', { data: { id: courseId.value || '22222', latitude: cache.get('LAT') || '23.129163', longitude: cache.get('LON') || '113.264435' }, loading: true }).then((res) => {
 		if (res.result && res.result.details) {
 			res.result.details = fixImgStyle(res.result.details);
 		}

+ 31 - 30
src/pages/index/detail/components/appraise.vue

@@ -1,42 +1,43 @@
 <template>
-		<view class="appraise-card">
-			<view class="appraise-title">
-				<view class="title">评价</view>
-				<view class="comments">
-					<view class="a-star">
-						<zzx-icon name="star" size="10"></zzx-icon>
-						<text>{{ listData.averageScore }}</text>
-					</view>
-					<view class="a-text">| {{ listData.scoreNum }}人评论</view>
+	<view class="appraise-card">
+		<view class="appraise-title">
+			<view class="title">评价</view>
+			<view class="comments">
+				<view class="a-star">
+					<zzx-icon name="star" size="10"></zzx-icon>
+					<text>{{ listData.averageScore }}</text>
 				</view>
+				<view class="a-text">| {{ listData.scoreNum }}人评论</view>
 			</view>
-			<view class="appraise-info" v-for="item in listData.records" :key="item.id">
-				<view class="a-user-info">
-					<view class="info">
-						<image :src="item.avatar" mode=""></image>
-						<view class="name">{{ item.username }}</view>
-					</view>
-					<view class="time" v-if="item.createTime">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
-				</view>
-				<view class="a-score">
-					<text>{{ item.score.toFixed(1) }}</text>
-					<uni-rate :readonly="true" size="16" :value="item.score" />
-				</view>
-				<view class="a-content">
-					{{ item.evaluateContent }}
+		</view>
+		<view class="appraise-info" v-for="item in listData.records" :key="item.id">
+			<view class="a-user-info">
+				<view class="info">
+					<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+					<image v-else :src="item.avatar" mode=""></image>
+					<view class="name">{{ item.username }}</view>
 				</view>
-				<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false" v-if="item.images">
-					<view class="scroll-view-item_H uni-bg-red" v-for="(img, idx) in item.images.split(',')" :key="idx">
-						<image @click="_previewImage(item.images.split(','), img)" :src="img" mode=""></image>
-					</view>
-				</scroll-view>
+				<view class="time" v-if="item.createTime">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
 			</view>
-			<view class="not-data" v-if="!listData.records.length">暂无评价数据</view>
+			<view class="a-score">
+				<text>{{ item.score.toFixed(1) }}</text>
+				<uni-rate :readonly="true" size="16" :value="item.score" />
+			</view>
+			<view class="a-content">
+				{{ item.evaluateContent }}
+			</view>
+			<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false" v-if="item.images">
+				<view class="scroll-view-item_H uni-bg-red" v-for="(img, idx) in item.images.split(',')" :key="idx">
+					<image @click="_previewImage(item.images.split(','), img)" :src="img" mode=""></image>
+				</view>
+			</scroll-view>
 		</view>
+		<view class="not-data" v-if="!listData.records.length">暂无评价数据</view>
+	</view>
 </template>
 
 <script lang="ts" setup>
-import { DateUtils,_previewImage } from '@/utils/util';
+import { DateUtils, _previewImage } from '@/utils/util';
 
 interface Props {
 	listData?: any;

+ 4 - 1
src/pages/index/detail/components/course.vue

@@ -29,7 +29,10 @@
 					<view class="sale">
 						已售{{item.sales}} {{item.goodRate}}%好评
 					</view>
-					<view class="price-btn">{{ item.hasDiscount?'免费试听':'立即购买' }}</view>
+					<view class="price-btn">
+						<!-- {{ item.hasDiscount?'免费试听':'立即购买' }} -->
+						  抢购
+					</view>
 				</view>
 			</view>
 		</view>

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

@@ -9,7 +9,8 @@
 				<view class="swiper-inner" v-for="(item, idx) in instrctorList" :key="idx"
 					@click="RouterUtils.to_page(`/pages/index/instructorDetail/index?id=${item.id}`)">
 					<view class="header-img">
-						<image :src="item.avatar" mode=""></image>
+						<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+						<image v-else :src="item.avatar" mode=""></image>
 						<image src="/src/static/badge.png" mode=""></image>
 					</view>
 					<view class="instructor-name">{{ item.name }}</view>

+ 22 - 5
src/pages/index/eventsDetail/index.vue

@@ -167,8 +167,25 @@ const scrollTimer = ref<any>(null);
 const sel_index = ref(0);
 const selectList = ref(['赛程安排', '图文说明']);
 const instance = getCurrentInstance();
+const qrGameId = ref();
 onLoad((option) => {
-	formData.value.id = option.id?option.id:cache.get('GAME_ID');
+	console.log(option, '传递参数');
+	const decodedUrl = decodeURIComponent(option.q);
+	const urlParts = decodedUrl.split('?');
+	if (urlParts.length > 1) {
+		const queryParams = urlParts[1];
+		const paramPairs = queryParams.split('&');
+		const resultObj = {};
+		paramPairs.forEach(pair => {
+			const [key, value] = pair.split('=');
+			resultObj[key] = value;
+		});
+		const gameId = resultObj['id'];
+		qrGameId.value = gameId
+		console.log(gameId, '扫码');
+	}
+	formData.value.id = option.id ? option.id : qrGameId.value;
+	console.log(formData.value.id,'获取到的赛事id');
 	get_location()
 })
 onMounted(() => {
@@ -313,8 +330,8 @@ const updateCountdown = () => {
 const eventsInfoObj = ref({})
 const formData = ref({
 	id: 0,
-	latitude: cache.get('LAT')||0,
-	longitude: cache.get('LON')||0,
+	latitude: cache.get('LAT') || 0,
+	longitude: cache.get('LON') || 0,
 });
 const get_eventsInfo = () => {
 	http.get('/game/findById', { data: formData.value, loading: true }).then((res) => {
@@ -328,8 +345,8 @@ const get_eventsInfo = () => {
 // 打开地图
 const open_map = () => {
 	uni.openLocation({
-		latitude: eventsInfoObj.value.latitude||0,
-		longitude: eventsInfoObj.value.longitude||0,
+		latitude: eventsInfoObj.value.latitude || 0,
+		longitude: eventsInfoObj.value.longitude || 0,
 		name: eventsInfoObj.value.name,
 		address: eventsInfoObj.value.address,
 		success: function () {

+ 16 - 5
src/pages/index/gymDetail/components/popup.vue

@@ -136,6 +136,8 @@
 import { ref, onMounted, computed, watch, nextTick } from 'vue';
 import { http } from '@/utils/http'
 import { TipsUtils, phoneHide, RouterUtils, debounce } from '@/utils/util';
+import { useCacheStore } from '@/stores/cache'
+const cache = useCacheStore()
 interface Props {
 	listData?: any;
 	itemList?: any;
@@ -243,7 +245,16 @@ const deleteSelarr = (item) => {
 	}
 }
 
-const submit_order = () => {
+const submit_order = async () => {
+	if (!cache.get('TOKEN')) {
+		let res: any = await TipsUtils.tips_alert('请先登录~', true)
+		if (res.confirm) {
+			uni.switchTab({
+				url: '/pages/index/index'
+			})
+		}
+		return
+	}
 	if (selArr.value.length < 1) {
 		return TipsUtils.tips_toast('请选择场次')
 	}
@@ -302,16 +313,16 @@ const paymentOrder = (payInfo: object) => {
 		...payInfo,
 		success: function (res) {
 			console.log('支付成功', res);
-			setTimeout(()=>{
-			getOrderQuery(orderCode.value, orderId.value)
-			},500)
+			setTimeout(() => {
+				getOrderQuery(orderCode.value, orderId.value)
+			}, 500)
 		},
 		fail: function (err) {
 			console.log('支付失败', err);
 			if (err.errMsg == 'requestPayment:fail cancel') {
 				RouterUtils.to_page(`/pages/index/toBeUsed/index?orderId=${orderId.value}&orderType=${orderFormData.value.orderType}`)
 				return
-			}else{
+			} else {
 				RouterUtils.to_page(`/pages/index/payError/index?errMsg=${err.errMsg}`)
 			}
 			// TipsUtils.tips_toast('支付失败,请稍后重试');

+ 8 - 4
src/pages/index/gymDetail/index.vue

@@ -12,7 +12,8 @@
 				<block v-if="detailInfo.video">
 					<video v-for="(item, index) in videoList" :key="index" :src="item"></video>
 				</block>
-				<image v-for="(item, index) in bannerList" @click="_previewImage(bannerList, item)" :key="index" :src="item" mode=""></image>
+				<image v-for="(item, index) in bannerList" @click="_previewImage(bannerList, item)" :key="index"
+					:src="item" mode=""></image>
 			</view>
 		</scroll-view>
 	</view>
@@ -187,7 +188,8 @@
 							</view>
 							<view class="price-btn"
 								@click="RouterUtils.to_page(`/pages/index/courseDetail/index?id=${item.id}&type=2`)">
-								{{ item.hasDiscount ? '免费试听' : '立即购买' }}
+								<!-- {{ item.hasDiscount ? '免费试听' : '立即购买' }} -->
+								抢购
 							</view>
 						</view>
 					</view>
@@ -207,7 +209,8 @@
 					<view class="swiper-inner" v-for="item in detailInfo.instructorVOList" :key="item.id"
 						@click="RouterUtils.to_page(`/pages/index/instructorDetail/index?id=${item.id}`)">
 						<view class="header-img">
-							<image :src="item.avatar" mode=""></image>
+							<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+							<image v-else :src="item.avatar" mode=""></image>
 							<image src="/src/static/badge.png" mode=""></image>
 						</view>
 						<view class="instructor-name textHidden">{{ item.name }}</view>
@@ -232,7 +235,8 @@
 			<view class="appraise-info" v-for="item in appraiseList.records" :key="item.id">
 				<view class="a-user-info">
 					<view class="info">
-						<image :src="item.avatar" mode=""></image>
+						<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+						<image v-else :src="item.avatar" mode=""></image>
 						<view class="name">{{ item.username }}</view>
 					</view>
 					<view class="time">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>

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

@@ -35,8 +35,7 @@
 				<zs-loading></zs-loading>
 			</view>
 			<view style="height: 34rpx;"></view>
-				<liu-slide-img :list="bannerList" :type="2" :interval="3000" @change="change"
-					@click="click"></liu-slide-img>
+			<liu-slide-img :list="bannerList" :type="2" :interval="3000" :indicator-show="false"></liu-slide-img>
 		</view>
 	</view>
 	<view class="content">
@@ -308,6 +307,12 @@ const get_logininfo = (item: string) => {
 				cache.remove('PLACE_ID')
 			}, 500)
 		}
+		if (cache.get('GAME_ID') && token.value) {
+			gotoPage(`/pages/index/eventsDetail/index?id=${cache.get('GAME_ID')}`)
+			setTimeout(() => {
+				cache.remove('GAME_ID')
+			}, 500)
+		}
 	})
 }
 

+ 5 - 3
src/pages/index/instructorDetail/index.vue

@@ -94,7 +94,8 @@
 			<view class="appraise-info" v-for="item in appraiseList.records" :key="item.id">
 				<view class="a-user-info">
 					<view class="info">
-						<image :src="item.avatar" mode=""></image>
+						<image v-if="item.isAnonymous == 0" src="@/static/default-header.png" mode=""></image>
+						<image v-else :src="item.avatar" mode=""></image>
 						<view class="name">{{ item.username }}</view>
 					</view>
 					<view class="time">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
@@ -106,7 +107,7 @@
 				<view class="a-content">
 					{{ item.evaluateContent }}
 				</view>
-				<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false" v-if="item.images!=''">
+				<scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false" v-if="item.images != ''">
 					<view class="scroll-view-item_H uni-bg-red" v-for="(img, idx) in item.images.split(',')" :key="idx">
 						<image @click="_previewImage(item.images.split(','), img)" :src="img" mode=""></image>
 					</view>
@@ -153,7 +154,7 @@ const to_certifying = () => {
 const detailId = ref()
 const detailObj = ref()
 const get_findByCoachId = () => {
-	http.get('/coachC/findByCoachId', { data: { id: detailId.value, longitude: cache.get('LON')||0, latitude: cache.get('LAT')||0 }, loading: true }).then((res) => {
+	http.get('/coachC/findByCoachId', { data: { id: detailId.value, longitude: cache.get('LON') || 0, latitude: cache.get('LAT') || 0 }, loading: true }).then((res) => {
 		detailObj.value = res.result
 	})
 }
@@ -241,6 +242,7 @@ const getFindByOrderPage = () => {
 					color: #AAAAAA;
 					white-space: nowrap;
 				}
+
 				.type::-webkit-scrollbar {
 					display: none;
 				}

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

@@ -23,7 +23,7 @@
 			<!-- 场地 -->
 			<view v-if="sel_index==0">
 				<!-- pages/index/gymDetail/index -->
-				<view class="s-venue-card" v-for="(venue,index) in searchList" :key="venue.id" @click="RouterUtils.to_page(`/pages/index/gymDetail/index?id=${venue.id}`)">
+				<view class="s-venue-card" v-for="(venue,index) in searchList" :key="venue.id" @click="venue.type==0?RouterUtils.to_page(`/pages/index/detail/index?id=${venue.id}`):RouterUtils.to_page(`/pages/index/gymDetail/index?id=${venue.id}`)">
 					<view class="s-venue-info">
 						<view class="venue-img">
 							<image :src="venue.cover" mode=""></image>

+ 24 - 8
src/pages/index/submitOrder/index.vue

@@ -143,10 +143,26 @@ import { useCacheStore } from '@/stores/cache'
 const cache = useCacheStore()
 const calendar = ref();
 const check_index = ref(0);
-onLoad((option:any) => {
+const qrPlaceId = ref();
+onLoad((option: any) => {
+	const decodedUrl = decodeURIComponent(option.q);
+	const urlParts = decodedUrl.split('?');
+	if (urlParts.length > 1) {
+		const queryParams = urlParts[1];
+		const paramPairs = queryParams.split('&');
+		const resultObj = {};
+		paramPairs.forEach(pair => {
+			const [key, value] = pair.split('=');
+			resultObj[key] = value;
+		});
+		const placeId = resultObj['placeId'];
+		qrPlaceId.value = placeId
+	}
 	console.log(option, '传递参数');
-	placeId.value = option.id?option.id:cache.get('PLACE_ID')
-	orderFormData.value.productIds = option.id
+	placeId.value = option.id ? option.id : qrPlaceId.value
+	console.log(placeId.value,'获取到的场地id');
+	orderFormData.value.productIds = placeId.value
+
 })
 
 onShareAppMessage((res) => {
@@ -386,14 +402,14 @@ const submitOrderImpl = () => {
 			tmplIds: ['WSJjc9I24ijtr3EyNVXjEvTQm0gIECW9ABYVFcegOwM'],
 			success(su) {
 				TipsUtils.tips_toast('订阅成功')
-				if (orderFormData.value.insureOrderInfoForm.insureId!='') {
+				if (orderFormData.value.insureOrderInfoForm.insureId != '') {
 					paymentOrder(res.result.params)
 				} else {
 					getOrderQuery(res.result.orderCode, res.result.orderId)
 				}
 			},
 			fail(err) {
-				if (orderFormData.value.insureOrderInfoForm.insureId!='') {
+				if (orderFormData.value.insureOrderInfoForm.insureId != '') {
 					paymentOrder(res.result.params)
 				} else {
 					getOrderQuery(res.result.orderCode, res.result.orderId)
@@ -411,9 +427,9 @@ const paymentOrder = (payInfo: object) => {
 		...payInfo,
 		success: function (res) {
 			console.log('支付成功', res);
-			setTimeout(()=>{
-			getOrderQuery(orderCode.value, orderId.value)
-			},500)
+			setTimeout(() => {
+				getOrderQuery(orderCode.value, orderId.value)
+			}, 500)
 		},
 		fail: function (err) {
 			console.log('支付失败', err);

+ 10 - 7
src/pages/index/toBeUsed/index.vue

@@ -163,7 +163,9 @@
 						<!-- <text v-if="item.type != 6 && orderPageInfo?.orderType == 1">{{ item.expireTime }}到期</text> -->
 					</view>
 					<!-- &&item.type != 5 -->
-					<view class="application-btn" @click="openRefund(item)" v-if="item.orderStatus == 1&&item.type != 5 ">申请退款</view>
+					<view class="application-btn" @click="openRefund(item)"
+						v-if="(item.type == 1 || item.type == 2) && (item.orderStatus == 1 && orderDetailInfo?.refundType != 2)">
+						申请退款</view>
 				</view>
 			</view>
 		</view>
@@ -516,7 +518,7 @@ const refund_btn = async () => {
 
 // 查看子订单状态
 // <!-- orderStatus:0-待付款 1-待使用 2-已使用 3-已到期 4-已取消 5-退款中 6已退款 -->
-const selectOrderInfo = (e:any, i:number) => {
+const selectOrderInfo = (e: any, i: number) => {
 	if (e.orderStatus == 5 || e.orderStatus == 6) {
 		RouterUtils.to_page(`/pages/index/refundDetail/index?orderId=${orderDetailInfo?.value.id}&orderProInfoId=${e.id}`)
 	} else {
@@ -672,7 +674,9 @@ const downTimeFun = () => {
 	} else {
 		if (callCount < 3) {
 			callCount++;
-			getOrderDetailInfo();
+			setTimeout(() => {
+				getOrderDetailInfo();
+			}, 500)
 		}
 		downTime.value = "00:00";
 	}
@@ -711,7 +715,6 @@ const startCountdown = (startTime: string) => {
 			countdownVisible.value = false;
 			return;
 		}
-
 		updateCountdown(timeDifference);
 	}, 1000);
 };
@@ -749,9 +752,9 @@ const paymentOrder = (payInfo: object) => {
 		...payInfo,
 		success: function (res) {
 			console.log('支付成功', res);
-			setTimeout(()=>{
-			getOrderQuery(orderCode.value, orderId.value)
-			},500)
+			setTimeout(() => {
+				getOrderQuery(orderCode.value, orderId.value)
+			}, 500)
 		},
 		fail: function (err) {
 			console.log('支付失败', err);

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

@@ -14,7 +14,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.split(',')[0]" mode=""></image>
+					<image v-if="item.cover" :src="(item.cover.includes(',') ? item.cover.split(',')[0] : item.cover)" mode=""></image>
 					<view class="e-badge">
 						<image src="/src/static/events-icon1.png" mode="widthFix"></image>
 						<view class="text">{{ item.ticketWhether ? '今日有票' : '暂无余票' }}</view>

+ 9 - 1
src/pages/mine/index.vue

@@ -22,7 +22,7 @@
 	<view class="content">
 		<view class="m-mineinfo-card">
 			<view class="item-info" v-for="(item, index) in cardList" :key="index"
-				@click="RouterUtils.to_page(`/pages/mine/orderInfo/index?selIndex=${index}`)">
+				@click="checkoutOrder(index)">
 				<zzx-icon :name="item.icon" size="30"></zzx-icon>
 				<view class="item-text">{{ item.name }}</view>
 			</view>
@@ -93,6 +93,14 @@ const submitLogin = () => {
 	})
 }
 
+// RouterUtils.to_page(`/pages/mine/orderInfo/index?selIndex=${index}`)
+const checkoutOrder=(index:number)=>{
+	cache.set('ORDER_SEL_INDEX',index)
+	uni.switchTab({
+		url:`/pages/mine/orderInfo/index`
+	})
+}
+
 const get_logininfo = (item: string) => {
 	http.get('/user/loginByCode', { data: { code: item }, loading: true }).then(res => {
 		cache.set('TOKEN', res.result.token)

+ 2 - 1
src/pages/mine/mineComments/index.vue

@@ -13,7 +13,8 @@
 			<view class="m-user-info">
 				<view class="user-info">
 					<view class="user-header">
-						<image :src="item.avatar" mode=""></image>
+						<image v-if="item.isAnonymous==0" src="@/static/default-header.png" mode=""></image>
+						<image v-else :src="item.avatar" mode=""></image>
 					</view>
 					<view class="user-name textHidden">{{ item.username }}</view>
 				</view>

+ 56 - 41
src/pages/mine/orderInfo/index.vue

@@ -8,7 +8,8 @@
 		<view class="o-orderlist-card" v-for="item in orderList" :key="item.orderId"
 			@click="RouterUtils.to_page(`/pages/index/toBeUsed/index?orderId=${item.orderId}&orderType=${item.orderType}&isPayOrder=1`)">
 			<view class="o-order-name">
-				<view class="order-name" v-if="item?.orderProInfoList && item.orderProInfoList.length > 0">{{ item.orderType == 5 ? '上课地点' : '场地' }}:{{ item?.orderProInfoList[0].address || '--'
+				<view class="order-name" v-if="item?.orderProInfoList && item.orderProInfoList.length > 0">{{
+					item.orderType == 5 ? '上课地点' : '场地' }}:{{ item?.orderProInfoList[0].address || '--'
 					}}</view>
 				<!-- 待付款 -->
 				<view class="order-status" v-if="item.orderStatus == 0">待支付(剩余{{ item.downTime }})</view>
@@ -47,11 +48,15 @@
 					<!-- 没保险 -->
 					<view class="item-order-single" v-else>
 						<view class="single-img">
-							<image :src="item?.orderProInfoList && item.orderProInfoList.length > 0 ? item?.orderProInfoList[0]?.productImage.split(',')[0] : ''" mode=""></image>
+							<image
+								:src="item?.orderProInfoList && item.orderProInfoList.length > 0 ? item?.orderProInfoList[0]?.productImage.split(',')[0] : ''"
+								mode=""></image>
 						</view>
 						<view class="single-name">
-							<view class="item-single-name textHidden" v-if="item.orderType != 1 && item?.orderProInfoList && item.orderProInfoList.length > 0">{{
-								item?.orderProInfoList[0].productName }}</view>
+							<view class="item-single-name textHidden"
+								v-if="item.orderType != 1 && item?.orderProInfoList && item.orderProInfoList.length > 0">
+								{{
+									item?.orderProInfoList[0].productName }}</view>
 							<view class="item-single-name" v-else-if="item.orderType == 1 && item?.orderProInfoList">
 								<!-- {{ item.orderProInfoList[0].productName }} -->
 								<view class="textHidden" v-for="name in item.orderProInfoList" :key="name.id">{{
@@ -71,7 +76,8 @@
 				<view class="cancel-btn" v-if="item?.orderStatus == 0" @click.stop="cancelOrder(item)">取消订单</view>
 				<view class="pay-btn" v-if="item?.orderStatus == 0" @click.stop="submitPay(item)">付款</view>
 				<!-- 售后/退款 -->
-				<view class="pay-btn" v-if="item?.orderStatus == 2&&item.orEvaluate==0&&item.orderType!=3&&item.orderType!=4 && item?.orderProInfoList && item.orderProInfoList.length > 0"
+				<view class="pay-btn"
+					v-if="item?.orderStatus == 2 && item.orEvaluate == 0 && item.orderType != 3 && item.orderType != 4 && item?.orderProInfoList && item.orderProInfoList.length > 0"
 					@click.stop="RouterUtils.to_page(`/pages/index/writeComments/index?siteId=${item.addressSiteId}&orderId=${item.orderId}&siteName=${item.orderProInfoList[0].address}`)">
 					评价</view>
 				<!-- 已使用 -->
@@ -79,8 +85,11 @@
 				<view class="pay-btn" v-if="selected == 4">凭证</view>
 			</view>
 			<!-- 待使用 -->
-			<view class="o-order-tips" v-if="item.orderStatus == 1&&item.orderType != 3&&item.orderType != 4 && item?.orderProInfoList && item.orderProInfoList.length > 0">
-				<text v-if="item.orderProInfoList[0].frameTimeStr&&item.orderProInfoList[0].frameTimeStr!='00:00-00:00'">限{{ item.orderProInfoList[0].frameTimeStr }}使用,过期作废</text>
+			<view class="o-order-tips"
+				v-if="item.orderStatus == 1 && item.orderType != 3 && item.orderType != 4 && item?.orderProInfoList && item.orderProInfoList.length > 0">
+				<text
+					v-if="item.orderProInfoList[0].frameTimeStr && item.orderProInfoList[0].frameTimeStr != '00:00-00:00'">限{{
+						item.orderProInfoList[0].frameTimeStr }}使用,过期作废</text>
 				<text v-if="item.earlyRefundTime">请按时到场,退款需提前{{ item.earlyRefundTime }}分钟</text>
 			</view>
 		</view>
@@ -91,32 +100,34 @@
 <script lang="ts" setup>
 import { ref, onMounted, onUnmounted } from 'vue'
 import { http } from '@/utils/http'
-import { onLoad, onReachBottom,onShow } from '@dcloudio/uni-app';
-import zsEmpty from '@/components/zs-empty/index.vue'
-import { RouterUtils, TipsUtils } from '@/utils/util'
+import { onLoad, onReachBottom, onShow } from '@dcloudio/uni-app';
+import zsEmpty from '@/components/zs-empty/index.vue';
+import { RouterUtils, TipsUtils } from '@/utils/util';
+import { useCacheStore } from '@/stores/cache'
+const cache = useCacheStore()
 const selected = ref(0)
 const orderTypeList = ref(['全部', '待付款', '待使用', '已使用', '退款/售后'])
-
 onLoad((option) => {
-	selected.value = option.selIndex
-	if (selected.value == 0) {
-		orderFormData.value.orderStatus = null
-		orderFormData.value.orAfterSale = 0
-	} else if (selected.value == 1) {
-		orderFormData.value.orderStatus = 0
-		orderFormData.value.orAfterSale = 0
-	} else if (selected.value == 2) {
-		orderFormData.value.orderStatus = 1
-		orderFormData.value.orAfterSale = 0
-	} else if (selected.value == 3) {
-		orderFormData.value.orderStatus = 2
-		orderFormData.value.orAfterSale = 0
-	} else if (selected.value == 4) {
-		orderFormData.value.orderStatus = null
-		orderFormData.value.orAfterSale = 1
-	}
+
 })
-onShow(()=>{
+onShow(() => {
+	// selected.value = cache.get('ORDER_SEL_INDEX') || 0
+	const statusMap:any = {
+		0: { orderStatus: null, orAfterSale: 0 },
+		1: { orderStatus: 0, orAfterSale: 0 },
+		2: { orderStatus: 1, orAfterSale: 0 },
+		3: { orderStatus: 2, orAfterSale: 0 },
+		4: { orderStatus: null, orAfterSale: 1 }
+	}
+
+	const selectedIndex = cache.get('ORDER_SEL_INDEX')
+	selected.value = selectedIndex||0
+
+	if (statusMap[selectedIndex]) {
+		Object.assign(orderFormData.value, statusMap[selectedIndex])
+	}
+	// 使用完成后移除缓存
+	cache.remove('ORDER_SEL_INDEX')
 	getOrderList()
 })
 onReachBottom(() => {
@@ -128,6 +139,7 @@ onMounted(() => {
 	// getOrderList()
 })
 const selectedItem = (i) => {
+	orderFormData.value.pageNo = 1
 	selected.value = i
 	if (selected.value == 0) {
 		orderFormData.value.orderStatus = null
@@ -149,12 +161,12 @@ const selectedItem = (i) => {
 }
 
 // 提交支付start
-const orderCode=ref()
-const orderId=ref()
+const orderCode = ref()
+const orderId = ref()
 const submitPay = (e: any) => {
 	http.put(`/order/payOrder?appOrderId=${e.orderId}`, {}, { loading: true }).then((res) => {
-		orderCode.value=res.result.orderCode
-		orderId.value=res.result.orderId
+		orderCode.value = res.result.orderCode
+		orderId.value = res.result.orderId
 		paymentOrder(res.result.params)
 	})
 }
@@ -166,9 +178,9 @@ const paymentOrder = (payInfo: object) => {
 		...payInfo,
 		success: function (res) {
 			console.log('支付成功', res);
-			setTimeout(()=>{
-			getOrderQuery(orderCode.value, orderId.value)
-			},500)
+			setTimeout(() => {
+				getOrderQuery(orderCode.value, orderId.value)
+			}, 500)
 		},
 		fail: function (err) {
 			console.log('支付失败', err);
@@ -224,10 +236,11 @@ const getOrderList = () => {
 			orderList.value = [...orderList.value, ...res.result.records]
 		}
 		orderList.value.forEach((item) => {
-			const [datePart, timePart] = item.createTime.split(' ');
-			const [year, month, day] = datePart.split('-').map(Number);
-			const [hours, minutes, seconds] = timePart.split(':').map(Number);
-			item.createTime = new Date(year, month - 1, day, hours, minutes, seconds);
+			// const [datePart, timePart] = item.createTime.split(' ');
+			// const [year, month, day] = datePart.split('-').map(Number);
+			// const [hours, minutes, seconds] = timePart.split(':').map(Number);
+			// item.createTime = new Date(year, month - 1, day, hours, minutes, seconds);
+			console.log(item.createTime);
 			if (item.orderStatus == 0) {
 				item.downTime = "";
 				item.timer = null;
@@ -235,7 +248,7 @@ const getOrderList = () => {
 			}
 		})
 		console.log(orderList.value, '订单列表');
-		
+
 	})
 }
 // 倒计时
@@ -258,7 +271,9 @@ const startCountdown = (item) => {
 				item.downTime = "00:00";
 				if (callCount < 3) {
 					callCount++;
+					setTimeout(()=>{
 					getOrderList();
+					},500)
 				}
 				return;
 			}

BIN
src/static/tabbar/order-icon.png


BIN
src/static/tabbar/sel-order-icon.png


+ 131 - 126
src/uni_modules/liu-slide-img/components/liu-slide-img/liu-slide-img.vue

@@ -1,155 +1,160 @@
 <template>
 	<view class="slide">
-		<swiper :style="'height:'+heightNumber+'rpx'" :autoplay="autoplay" :interval="interval" :circular="circular"
-			:current="current" :previous-margin="type==2?'30rpx':'0rpx'" :next-margin="type==2?'30rpx':'0rpx'"
+		<swiper :style="'height:' + heightNumber + 'rpx'" :autoplay="autoplay" :interval="interval" :circular="circular"
+			:current="current" :previous-margin="type == 2 ? '30rpx' : '0rpx'" :next-margin="type == 2 ? '30rpx' : '0rpx'"
 			@change="handleChange">
 			<swiper-item
-				:class="{'swiper-item':type==1,'swiper-item-card':type==2,'swiper-item-card-margin':(type==2 && swiperCurrent!=index)}"
+				:class="{ 'swiper-item': type == 1, 'swiper-item-card': type == 2, 'swiper-item-card-margin': (type == 2 && swiperCurrent != index) }"
 				v-for="(item, index) in list" :key="index" @click="click(index)">
-				<image :src="item.imageUrl" lazy-load :style="'border-radius:'+borderRadius+'rpx;'"
-					:class="{'defaut-img':type==1 || (type==2 && swiperCurrent==index),'card-img':type==2 && swiperCurrent!=index,'card-margin':type==2 && swiperCurrent==index}" />
+				<image :src="item.imageUrl" lazy-load :style="'border-radius:' + borderRadius + 'rpx;'"
+					:class="{ 'defaut-img': type == 1 || (type == 2 && swiperCurrent == index), 'card-img': type == 2 && swiperCurrent != index, 'card-margin': type == 2 && swiperCurrent == index }" />
 			</swiper-item>
 		</swiper>
-		<view class="custom-indicator">
-			<view v-for="(item,index) in list" :key="index"
-				:class="['indicator-item',swiperCurrent==index?'indicator-item-active':'']"></view>
+		<view class="custom-indicator" v-if="indicatorShow">
+			<view v-for="(item, index) in list" :key="index"
+				:class="['indicator-item', swiperCurrent == index ? 'indicator-item-active' : '']"></view>
 		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		props: {
-			//轮播图数据源
-			list: {
-				type: Array,
-				default: () => {
-					return []
-				}
-			},
-			//轮播模式(1:默认;2:卡片)
-			type: {
-				type: Number,
-				default: 1
-			},
-			//轮播图高度(rpx)
-			heightNumber: {
-				type: Number,
-				default: 300
-			},
-			//轮播图圆角(rpx)
-			borderRadius: {
-				type: Number,
-				default: 8
-			},
-			//是否自动切换
-			autoplay: {
-				type: Boolean,
-				default: true
-			},
-			//自动切换时间间隔
-			interval: {
-				type: Number,
-				default: 5000
-			},
-			//是否采用衔接滑动,即播放到末尾后重新回到开头
-			circular: {
-				type: Boolean,
-				default: true
-			},
-			//当前所在滑块的index
-			current: {
-				type: Number,
-				default: 0
-			},
-		},
-		data() {
-			return {
-				swiperCurrent: 0
+export default {
+	props: {
+		//轮播图数据源
+		list: {
+			type: Array,
+			default: () => {
+				return []
 			}
 		},
-		mounted() {
-			this.swiperCurrent = this.current
+		//轮播模式(1:默认;2:卡片)
+		type: {
+			type: Number,
+			default: 1
 		},
-		methods: {
-			handleChange(e) {
-				this.swiperCurrent = e.detail.current
-				this.$emit("change", e.detail.current)
-			},
-			click(index) {
-				this.$emit("click", index)
-			}
+		//轮播图高度(rpx)
+		heightNumber: {
+			type: Number,
+			default: 300
+		},
+		//轮播图圆角(rpx)
+		borderRadius: {
+			type: Number,
+			default: 8
+		},
+		//是否自动切换
+		autoplay: {
+			type: Boolean,
+			default: true
+		},
+		//自动切换时间间隔
+		interval: {
+			type: Number,
+			default: 5000
+		},
+		//是否采用衔接滑动,即播放到末尾后重新回到开头
+		circular: {
+			type: Boolean,
+			default: true
+		},
+		//当前所在滑块的index
+		current: {
+			type: Number,
+			default: 0
+		},
+		// 是否显示指示点
+		indicatorShow: {
+			type: Boolean,
+			default: true
+		},
+	},
+	data() {
+		return {
+			swiperCurrent: 0
+		}
+	},
+	mounted() {
+		this.swiperCurrent = this.current
+	},
+	methods: {
+		handleChange(e) {
+			this.swiperCurrent = e.detail.current
+			this.$emit("change", e.detail.current)
+		},
+		click(index) {
+			this.$emit("click", index)
 		}
-	};
+	}
+};
 </script>
 
 <style scoped>
-	.slide {
-		width: 100%;
-		position: relative;
-	}
+.slide {
+	width: 100%;
+	position: relative;
+}
 
-	.swiper-item {
-		width: 100%;
-		height: 100%;
-		overflow: hidden;
-		box-sizing: border-box;
-	}
+.swiper-item {
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+	box-sizing: border-box;
+}
 
-	.swiper-item-card {
-		width: 92% !important;
-		height: 100%;
-		margin: 0 4%;
-		overflow: hidden;
-		box-sizing: border-box;
-		display: flex;
-		align-items: flex-start;
-		justify-content: center;
-	}
+.swiper-item-card {
+	width: 92% !important;
+	height: 100%;
+	margin: 0 4%;
+	overflow: hidden;
+	box-sizing: border-box;
+	display: flex;
+	align-items: flex-start;
+	justify-content: center;
+}
 
-	.swiper-item-card-margin {
-		padding: 4% 0;
-	}
+.swiper-item-card-margin {
+	padding: 4% 0;
+}
 
-	.defaut-img {
-		width: 100%;
-		height: 100%;
-		overflow: hidden;
-	}
+.defaut-img {
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+}
 
-	.card-img {
-		width: 100%;
-		height: 100%;
-		overflow: hidden;
-	}
+.card-img {
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+}
 
-	.card-margin {
-		width: calc(100% - 40rpx);
-		margin: 0 20rpx;
-		overflow: hidden;
-	}
+.card-margin {
+	width: calc(100% - 40rpx);
+	margin: 0 20rpx;
+	overflow: hidden;
+}
 
-	.custom-indicator {
-		width: 100%;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		position: absolute;
-		margin: 0 auto;
-		bottom: 30rpx;
-	}
+.custom-indicator {
+	width: 100%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	position: absolute;
+	margin: 0 auto;
+	bottom: 30rpx;
+}
 
-	.indicator-item {
-		width: 10rpx;
-		height: 10rpx;
-		background-color: #FFFFFF;
-		border-radius: 10rpx;
-		margin: 0 6rpx;
-		opacity: 0.6;
-	}
+.indicator-item {
+	width: 10rpx;
+	height: 10rpx;
+	background-color: #FFFFFF;
+	border-radius: 10rpx;
+	margin: 0 6rpx;
+	opacity: 0.6;
+}
 
-	.indicator-item-active {
-		background-color: #FFFFFF;
-		opacity: 1;
-	}
+.indicator-item-active {
+	background-color: #FFFFFF;
+	opacity: 1;
+}
 </style>

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

@@ -178,10 +178,10 @@ export class HttpClient {
 
 // 创建实例
 export const http = new HttpClient({
-  baseURL: 'http://192.168.0.217:8080/jeecg-boot/app',
+  // 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: 'https://api.qlapp.cn/jeecgboot/app', //生产
   headers: {
     'Content-Type': 'application/json'
   }

+ 46 - 38
src/utils/util/index.ts

@@ -78,7 +78,15 @@ export class RouterUtils {
 	* 返回上一页
 	*/
 	static back() {
-		uni.navigateBack();
+		const pages = getCurrentPages();
+		console.log(pages, '页面栈信息');
+		if (pages.length > 1) {
+			uni.navigateBack()
+		} else {
+			uni.switchTab({
+				url: '/pages/index/index'
+			})
+		}
 	}
 
 	/**
@@ -90,14 +98,14 @@ export class RouterUtils {
 		const noTokenRequiredPages = [
 			'/pages/index/index',
 			'/pages/index/venue/index',
-			// '/pages/index/detail/index',
-			// '/pages/index/gymDetail/index',
+			'/pages/index/detail/index',
+			'/pages/index/gymDetail/index',
 			'/pages/index/courseDetail/index',
 			'/pages/index/training/index',
 			'/pages/index/events/index',
 			'/pages/index/eventsDetail/index',
 			'/pages/index/allInstructor/index',
-			// '/pages/index/instructorDetail/index',
+			'/pages/index/instructorDetail/index',
 			'/pages/index/search/index',
 			'/pages/index/searchPage/index',
 			'/pages/index/vr/index',
@@ -211,40 +219,40 @@ export const randomColor = (): string => {
  * @param url - 图片地址
  */
 export const _previewImage = (urls: any, current?: string) => {
-    let previewUrls: string[] = [];
-    let previewCurrent: string | undefined = current;
-    // 如果 urls 是字符串,转换为数组
-    if (typeof urls === 'string') {
-        previewUrls = [urls];
-        // 如果没有指定 current,则使用第一个图片作为当前图片
-        if (!previewCurrent) {
-            previewCurrent = urls;
-        }
-    } 
-    // 如果 urls 是数组,直接使用
-    else if (Array.isArray(urls)) {
-        previewUrls = urls;
-        // 如果没有指定 current 且数组不为空,则使用数组第一个元素
-        if (!previewCurrent && urls.length > 0) {
-            previewCurrent = urls[0];
-        }
-    }
-    uni.previewImage({
-        urls: previewUrls,
-        current: previewCurrent,
-        longPressActions: {
-            itemList: ['发送给朋友', '保存图片', '收藏'],
-            success: function (data) {
-                uni.showToast({
-                    title: '操作成功',
-                    icon: 'none'
-                })
-            },
-            fail: function (err) {
-                console.log(err.errMsg);
-            }
-        }
-    });
+	let previewUrls: string[] = [];
+	let previewCurrent: string | undefined = current;
+	// 如果 urls 是字符串,转换为数组
+	if (typeof urls === 'string') {
+		previewUrls = [urls];
+		// 如果没有指定 current,则使用第一个图片作为当前图片
+		if (!previewCurrent) {
+			previewCurrent = urls;
+		}
+	}
+	// 如果 urls 是数组,直接使用
+	else if (Array.isArray(urls)) {
+		previewUrls = urls;
+		// 如果没有指定 current 且数组不为空,则使用数组第一个元素
+		if (!previewCurrent && urls.length > 0) {
+			previewCurrent = urls[0];
+		}
+	}
+	uni.previewImage({
+		urls: previewUrls,
+		current: previewCurrent,
+		longPressActions: {
+			itemList: ['发送给朋友', '保存图片', '收藏'],
+			success: function (data) {
+				uni.showToast({
+					title: '操作成功',
+					icon: 'none'
+				})
+			},
+			fail: function (err) {
+				console.log(err.errMsg);
+			}
+		}
+	});
 }
 
 /**