فهرست منبع

Merge remote-tracking branch 'origin/2024鹅状元' into 2024鹅状元

wangguoyu 4 ماه پیش
والد
کامیت
1570199cff

+ 16 - 3
common/styles/global/components.scss

@@ -103,7 +103,10 @@ $titleBar-tabBar-page: calc(100vh - var(--status-bar-height));
 		background-image: url("@/static/images/common/navBar-return-btn.png");@include ezy-no-repeat-cover();
 	}
 }
-
+// 仅一个返回按钮
+.ezy-nav-bar-icon{width: 24rpx;height: 38rpx;position: absolute;left: 24rpx;top: var(--status-bar-height);
+		background-image: url("@/static/images/common/navBar-return-btn.png");@include ezy-no-repeat-cover();
+	}
 /***** 试题---题干 *****/
 .ezy-shiti-question{
 	margin: 24rpx 0 42rpx;font-size: 32rpx;color: #333;line-height: 1.6;padding: 0 10rpx;box-sizing: border-box;
@@ -163,7 +166,7 @@ $titleBar-tabBar-page: calc(100vh - var(--status-bar-height));
 .ezy-tiankong-box{
 	.tiankongn-title{
 		width: 231rpx;height: 63rpx;
-		background-image: url("@/static/images/exam/panduan-title.png");@include ezy-no-repeat-cover;
+		background-image: url("@/static/images/exam/tiankong-title.png");@include ezy-no-repeat-cover;
 	}
 	.tiankong-input {width: 50px;height: 32rpx;border: 1px solid #999;}
 	.tk-input-box{display: inline-block;position: relative;font-size: 0;}
@@ -236,4 +239,14 @@ $titleBar-tabBar-page: calc(100vh - var(--status-bar-height));
 		background-image: url("@/static/images/common/tip-big-bj.png");
 	}
 	.tip-content{min-height: 240rpx;text-align: justify;}
-}
+}
+
+/*积分框*/
+.ezy-jf-box{
+	width: 142rpx;height: 46rpx;display: flex;align-items: center;line-height: 1.2;font-size: 26rpx;
+	@include ezy-no-repeat-cover;background-image: url("@/static/images/common/jf-bj.png");margin-top: 20rpx;
+	.jf-icon{width: 35rpx;height: 35rpx;margin:0 4rpx 0 10rpx;flex-shrink: 0;
+	@include ezy-no-repeat-cover;background-image: url("@/static/images/my/jf-qb.png");}
+	.jf-text{min-width: 60rpx;text-align: center;color: #fff;}
+}
+		

+ 75 - 15
common/styles/global/pages.scss

@@ -2,10 +2,6 @@
 // 登录页  padding-bottom: env(safe-area-inset-bottom); box-sizing: unset;
 .ezy-login-page {
 	width:100%;height:100vh; background-color: #80dfff;position: relative;
-	.login-nav-bar-icon{
-		width: 24rpx;height: 38rpx;position: absolute;left: 24rpx;top: var(--status-bar-height);
-		background-image: url("@/static/images/common/navBar-return-btn.png");@include ezy-no-repeat-cover();
-	}
 	.ezy-login-wrap{width:100%;height: 1623.08rpx;background-image: url("@/static/images/login/login-bj.jpg");@include ezy-no-repeat-cover(top);}
 	.login-body-box{
 		display: flex;flex-direction: column;display: flex;box-sizing: border-box;
@@ -123,7 +119,7 @@
 	.agree-title{font-size: 42rpx;text-align: center;margin-bottom: 42rpx;flex-shrink: 0;}
 	.agree-close-btn{width: 62rpx;height: 62rpx;@include ezy-no-repeat-cover;
 	position: absolute;top: 64rpx;right: 44rpx;
-	background-image: url("@/static/images/login/agree-sections-close.png");}
+	background-image: url("@/static/images/common/close-icon.png");}
 	.agree-section-box{font-size: 30rpx;line-height: 1.8;overflow: auto;flex: 1;padding: 0 46rpx;}
 	@media (max-height: 800px) {
 		.agree-content-box{margin-top: 18%;}
@@ -143,7 +139,7 @@
 		background-image: url("@/static/images/login/slider-dialog-bj.png");@include ezy-no-repeat-cover;position: relative;
 	}
 	.slider-close{width: 50rpx;height: 50rpx;@include ezy-no-repeat-cover;position: absolute;right: 30rpx;top: 30rpx;
-	background-image: url("@/static/images/login/agree-sections-close.png");}
+	background-image: url("@/static/images/common/close-icon.png");}
 	.slider-check-tip{color:#777;font-size: 32rpx;margin-top: 30rpx;font-weight: 800;}
 	.slider-check-btn{width: 208rpx;height: 85rpx;@include ezy-no-repeat-cover;margin: 32rpx auto 0;
 	background-image: url("@/static/images/login/slider-confirm.png");display: block;}
@@ -743,14 +739,6 @@
 		width: 100%;padding: 80rpx 24rpx 42rpx;box-sizing: border-box;display: flex;align-items: center;color: #fff;
 		.head-img-box{width: 154rpx;height: 154rpx;margin: 0 24rpx 0 12rpx;@include ezy-no-repeat-cover;}
 		.head-content-box{font-size: 30rpx;}
-		.jf-box{
-			width: 142rpx;height: 46rpx;display: flex;align-items: center;line-height: 1.2;font-size: 26rpx;
-			@include ezy-no-repeat-cover;background-image: url("@/static/images/my/jf-bj.png");margin-top: 20rpx;
-		}
-		.jf-icon{width: 35rpx;height: 35rpx;margin:0 4rpx 0 10rpx;flex-shrink: 0;
-		@include ezy-no-repeat-cover;background-image: url("@/static/images/my/jf-qb.png");}
-		.jf-text{min-width: 60rpx;
-		text-align: center;}
 	}
 	
 	// hyqy
@@ -912,7 +900,7 @@
 	position: fixed;display: flex;flex-direction: column;top: 0;left: 0;bottom:0;right: 0;
 	justify-content: center;align-items: center;
 	.tel-close{width: 50rpx;height: 50rpx;@include ezy-no-repeat-cover;position: absolute;right: 30rpx;top: 30rpx;
-	background-image: url("@/static/images/login/agree-sections-close.png");}
+	background-image: url("@/static/images/common/close-icon.png");}
 	.my-tel-content{
 		width: 625rpx;height: 740rpx;box-sizing: border-box;padding: 56rpx 62rpx;
 		background-image: url("@/static/images/my/my-tel-bj.png");@include ezy-no-repeat-cover;position: relative;
@@ -1050,3 +1038,75 @@
 	}
 }
 
+// 游戏
+.ezy-game-page{
+	width: 100%;height: 100vh;background-color: #23befb;position: relative;
+	padding-top:var(--status-bar-height);display: flex;flex-direction: column;
+	@include ezy-no-repeat-cover(bottom);background-image: url("@/static/images/game/game-bj.png");
+	.game-jf-box{position: absolute;right: 24rpx;top: var(--status-bar-height);}
+	// goose
+	.game-goose-box{
+		position: absolute;bottom: 300rpx;right: 80rpx;
+		.game-progress-box{
+			width: 138rpx;height: 25rpx;position: absolute;left: 48rpx;
+			.u-line-progress__background{
+				width: 138rpx;height: 25rpx!important;
+				@include ezy-no-repeat-cover;background-image: url("@/static/images/game/jf-bj.png");
+			}
+		}
+		.goose-img-box{width: 231rpx;height: 442rpx;@include ezy-no-repeat-cover;}
+	}
+	.game-goose-box0 .game-progress-box{bottom: 300rpx;}
+	.game-goose-box1 .game-progress-box{bottom: 330rpx;}
+	.game-goose-box2 .game-progress-box{bottom: 400rpx;}
+	.game-goose-box3 .game-progress-box{bottom: 460rpx;}
+	
+	// food
+	.food-img-box{width: 80rpx;height: 75rpx;position: absolute;}
+	.food-img25{bottom: 368rpx;left: 274rpx;}
+	.food-img50{bottom: 360rpx;left: 270rpx;}
+	.food-img100{bottom: 360rpx;left: 272rpx;}
+	
+	//btn
+	.food-btn-box{
+		width: 106rpx;height: 121rpx;position: absolute;bottom: 50rpx;left: 50rpx;
+		@include ezy-no-repeat-cover;background-image: url("@/static/images/game/food-common-img.png");
+	}
+	.yxsm-btn{
+		width: 125rpx;height: 125rpx;position: absolute;bottom: 50rpx;right: 50rpx;
+		@include ezy-no-repeat-cover;background-image: url("@/static/images/game/yxsm-btn-img.png");
+	}
+	
+	
+	// game-popup-box
+	.game-popup-box{
+		width: 100%;height: 514rpx;@include ezy-no-repeat-cover;
+		background-image: url("@/static/images/game/food-box-bj.png");
+		box-sizing: border-box;padding: 64rpx 36rpx 0;
+		.game-popup-head,.jf-btn-box{display: flex;justify-content: space-between;align-items: center;}
+		.game-popup-title{
+			width: 285rpx;height: 90rpx;@include ezy-no-repeat-cover;
+		background-image: url("@/static/images/game/food-title.png");
+		}
+		.game-popup-jf{margin: 0 20rpx 0 0;}
+		.popup-close-btn{
+			width: 46rpx;height: 46rpx;@include ezy-no-repeat-cover;
+			background-image: url("@/static/images/common/close-icon.png");
+		}
+		.food-list-box{display: flex;justify-content: space-between;margin-top: 24rpx;}
+		.food-item-box{
+			width: 204rpx;height: 250rpx;@include ezy-no-repeat-cover;
+			display: flex;flex-direction: column;align-items: center;justify-content: center;
+			background-image: url("@/static/images/game/food-bj.png");
+			img{width: 144rpx;height:135rpx;}
+			.food-item-jf{
+				width: 123rpx;height: 46rpx;
+				display: flex;align-items: center;line-height: 1.2;font-size: 26rpx;
+				@include ezy-no-repeat-cover;background-image: url("@/static/images/game/food-jf-bj.png");margin-top: 20rpx;
+				.jf-icon{width: 35rpx;height: 35rpx;margin:0 4rpx 0 10rpx;flex-shrink: 0;
+				@include ezy-no-repeat-cover;background-image: url("@/static/images/my/jf-qb.png");}
+				.jf-text{min-width: 60rpx;text-align: center;color: #fff;}
+			}
+		}
+	}
+}

+ 9 - 0
components/custom-tabbar/custom-tabbar.vue

@@ -62,6 +62,15 @@
 							.zhangId
 					});
 				}else{
+
+          if (path === '/pages/game/index') {
+            // 游戏需要返回功能
+            uni.navigateTo({
+              url: path
+            });
+            return ;
+          }
+
 					uni.redirectTo({
 						url: path 
 					});

+ 34 - 0
components/dialog/commonDialog.vue

@@ -0,0 +1,34 @@
+<!-- 中弹窗 二行文字 -->
+<template>
+	<uni-popup ref="dialogRef" :animation="false" :is-mask-click="false"
+	 mask-background-color="rgba(255, 255, 255, 0.6);">
+		<slot></slot>
+	</uni-popup>
+</template>
+
+<script setup>
+	import { ref } from 'vue';
+	const props = defineProps({
+	  title: {
+	    type: String,
+	    default: '提示'
+	  },
+	});
+	const dialogRef = ref(null); // 索引
+
+	// 打开弹窗
+	function handleShow() {
+		dialogRef.value.open();
+	}
+	// 取消
+	function handleClose() {
+		dialogRef.value.close();
+	}
+	defineExpose({
+		handleShow,
+		handleClose
+	})
+</script>
+
+<style>
+</style>

+ 16 - 12
pages/game/components/constantConfig.js

@@ -1,36 +1,40 @@
 // 食物种类列表
 export const foodSpeciesList = [{
-		id: 25,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+		id: 100,
+		imgUrl: '/static/images/game/food-img3.png',
 		credit: 100
 	},
 	{
-		id: 50,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
-		credit: 200
+		id: 300,
+		imgUrl: '/static/images/game/food-img2.png',
+		credit: 300
 	},
 	{
-		id: 100,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
-		credit: 300
+		id: 600,
+		imgUrl: '/static/images/game/food-img3.png',
+		credit: 600
 	}
 ]
 
 // 大鹅成长阶段
 export const gooseGrowthTypeList = [{
 		id: 0,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+		imgUrl: '/static/images/game/game-img1.gif',
+		range: [0,1000]
 	},
 	{
 		id: 1,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+		imgUrl: '/static/images/game/game-img2.gif',
+		range: [1000,3000]
 	},
 	{
 		id: 2,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+		imgUrl: '/static/images/game/game-img3.gif',
+		range: [3000,7000]
 	},
 	{
 		id: 3,
-		imgUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+		imgUrl: '/static/images/game/game-img4.gif',
+		range: [7000]
 	}
 ]

+ 1 - 3
pages/game/components/food.vue

@@ -1,7 +1,5 @@
 <template>
-	<view>
-		<image v-if="imgUrl" :src="imgUrl"></image>
-	</view>
+	<image v-if="imgUrl" :src="imgUrl"></image>
 </template>
 
 <script setup>

+ 28 - 6
pages/game/components/foodSelect.vue

@@ -1,12 +1,30 @@
 <template>
 	<!-- 食物图标按钮 -->
-	<view @click="handleOpen">选择</view>
-	<uni-popup ref="popupRef" type="bottom" border-radius="10px 10px 0 0" background-color="#fff">
-		<view style="height: 300px;display: flex;justify-content: space-between;">
-			<view v-for="item in foodSpeciesList" :key="item.id" @click="handleSelectFood(item)">
-				<img style="width: 50px;height: auto;" :src="item.imgUrl">
-				<text>{{item.credit}}</text>
+	<view @click="handleOpen" class="food-btn-box"></view>
+	<uni-popup ref="popupRef" type="bottom">
+		<view class="game-popup-box">
+			<view class="game-popup-head">
+				<view class="game-popup-title"></view>
+				<view class="jf-btn-box">
+					<!-- 积分 -->
+					<view class="ezy-jf-box game-popup-jf">
+						<icon class="jf-icon"></icon>
+						<text class="jf-text" >{{credit}}</text>
+					</view>
+					<!-- 关闭按钮 -->
+					<icon class="popup-close-btn" @click="handleClose"></icon>
+				</view>
 			</view>
+			<view class="food-list-box">
+				<view v-for="item in foodSpeciesList" :key="item.id" @click="handleSelectFood(item)" class="food-item-box">
+					<image :src="item.imgUrl" class="food-image"/>
+					<view class="food-item-jf">
+						<icon class="jf-icon"></icon>
+						<text class="jf-text" >{{item.credit}}</text>
+					</view>
+				</view>
+			</view>
+			
 		</view>
 	</uni-popup>
 </template>
@@ -18,6 +36,9 @@
 	const props = defineProps({
 		shiwuId: {
 			type: [String,Number]
+		},
+		credit: {
+			type: [String,Number]
 		}
 	})
 	
@@ -26,6 +47,7 @@
 		popupRef.value.open();
 	}
 	function handleClose() {
+		console.log(123)
 		popupRef.value.close();
 	}
 	function handleSelectFood(shiwu) {

+ 5 - 4
pages/game/components/goose.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
-		<up-line-progress :percentage="progress" activeColor="#ff0000"></up-line-progress>
-		<image :src="imgUrl"></image>
+		<up-line-progress :percentage="progress" activeColor="#54e1fe" class="game-progress-box"></up-line-progress>
+		<image :src="imgUrl" class="goose-img-box"></image>
 	</view>
 </template>
 
@@ -11,7 +11,7 @@
 	import upLineProgress from "uview-plus/components/u-line-progress/u-line-progress.vue";  
 	
 	const props = defineProps({
-		grouthType: {
+    growthType: {
 			type: [String,Number]
 		},
 		progress: {
@@ -21,7 +21,8 @@
 	})
 	
 	const imgUrl = computed(() => {
-		const active = gooseGrowthTypeList.find(item => item.grouthType == props.grouthType)
+		const active = gooseGrowthTypeList.find(item => item.grouthType == props.growthType)
+    console.log(active,props.growthType,props.progress)
 		return active ? active.imgUrl: ''
 	})
 </script>

+ 59 - 10
pages/game/index.vue

@@ -1,24 +1,73 @@
 <!-- 游戏页面 -->
 <template>
-	<!-- 积分 -->
-	<view>{{credit}}</view>
-	<!-- 桌面食物 -->
-	<foodVue :shiwuId="shiwuId"></foodVue>
-	<!-- 大鹅 4阶段 -->
-	<gooseVue :growth="growth" :growthType="growthType" :progress="progress"></gooseVue>
-	<!-- 食物选择 -->
-	<foodSelectVue ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
+	<view class="ezy-game-page">
+		<!-- 返回按钮 -->
+		<view class="ezy-nav-bar-icon"></view>
+		<!-- 积分 -->
+		<view class="ezy-jf-box game-jf-box">
+			<icon class="jf-icon"></icon>
+			<text class="jf-text" >{{credit}}</text>
+		</view>
+		<!-- 桌面食物 -->
+		<foodVue :shiwuId="shiwuId" class="food-img-box" :class="'food-img'+shiwuId"></foodVue>
+		<!-- 大鹅 4阶段 -->
+		<gooseVue :growth="growth" :growthType="growthType" :progress="progress"
+		class="game-goose-box" :class="'game-goose-box'+ growthType"></gooseVue>
+		<!-- 食物选择 -->
+		<foodSelectVue :credit="credit" ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
+		<!-- 游戏说明 -->
+		<view class="yxsm-btn" @click="showTishi"></view>
+		<!-- 游戏说明 -->
+		<commonDialogVue ref="dlRef">
+			<view class="yxsm-popup-box">
+				<view class="yxsm-popup-title">陪伴宠物鹅系统详细说明</view>
+				<view class="yxsm-item-box">
+					<view v-for="(item, index) in yxsmContent" :key="index">
+						<view class="item-title">{{item.title}}</view>
+						<text class="item-content">{{item.content}}</text>
+					</view>
+				</view>
+				<icon @click="handleClose" class="yxsm-close-btn"></icon>
+			</view>
+		</commonDialogVue>
+	</view>
 </template>
 
 <script setup>
-	import {ref} from "vue";
+	import {ref,reactive} from "vue";
 	import foodVue from "./components/food.vue";
 	import gooseVue from "./components/goose.vue";
 	import foodSelectVue from "./components/foodSelect.vue";
+	import commonDialogVue from "@/components/dialog/commonDialog.vue";
 	import { useGame } from "./useGame";
 	const {	credit,growth,growthType,progress,shiwuId ,handleWeishi } = useGame();
-	
+	const yxsmContent = reactive([{
+			title: '宠物鹅获取',
+			content: '学生首次注册并登录 APP 时,系统自动发放一颗宠物鹅蛋,开启养鹅之旅。每个账号有且仅有一次领取鹅蛋的机会,确保公平性,这颗蛋便是学生与宠物鹅相伴成长的起点。',
+	},{
+			title: '成长阶段',
+			content: `1. 破壳期(初始状态):刚获得的鹅蛋代表宠物鹅的初始形态,成长值为 0,静静等待成长契机。
+					2. 幼年期:当学生通过学习积累的经验值达到 1000 时,鹅蛋孵化,宠物鹅进入幼年期,模样娇小可爱,开启成长新篇。
+					3. 青年期:随着学习推进,经验值累计至 3000,幼鹅成长为青年鹅,体型增大,羽毛渐丰,活力更足。
+					4. 成年期:若学生持之以恒学习,使经验值攀升至 7000,青年鹅将进化为成年鹅,外形成熟矫健,成为学生学习路上的暖心陪伴。`,
+	},{
+			title: '积分规则',
+			content: `1. 学习课程积分:APP 提供丰富视频课程,学生首次完整学完一门课程,就能获得 30 积分。系统会记录学习情况,重复学习同一课程不再积分,激励学生探索新内容。
+					2. 答题积分:各章节配有单元测试,学生首次答题,每答对一题获 10 积分,答错无积分。重复测试以首次答题结果为准,促使学生认真对待初次测试。
+					3. 蛋糕兑换积分:
+						- 学生可用积分兑换成长值蛋糕,100 积分换 30 成长值蛋糕、300 积分换 100 成长值蛋糕、600 积分换 300 成长值蛋糕,为宠物鹅成长助力。
+						- 每天限定兑换2次成长值蛋糕。`,
+	}]);
 	const foodSelectRef = ref(null);
+	const dlRef = ref(null);
+	
+	function handleClose() {
+		dlRef.value.handleClose();
+	}
+	
+	function showTishi() {
+		dlRef.value.handleShow();
+	}
 	
 	function onWeiShi(data) {
 		handleWeishi(data.id, () => {

+ 15 - 3
pages/login/index.vue

@@ -30,6 +30,7 @@
 		</view>
 		<agree-content-dialog ref="agreeContentDialogRef"></agree-content-dialog>
 		<agree-dialog ref="agreeDialogRef" @confirm-btn="confirmBtn"></agree-dialog>
+		<agree-dialog ref="agreeYkDialog" @confirm-btn="ykConfirmBtn"></agree-dialog>
 	</view>
 </template>
 
@@ -63,6 +64,7 @@
 	})
 	const agreeContentDialogRef = ref(null);
 	const agreeDialogRef = ref(null);
+	const agreeYkDialog = ref(null);
 
 	onLoad((options) => {})
 
@@ -82,6 +84,12 @@
 		indexData.isAgreed = true;
 		getYzmBtn();
 	}
+	
+	const ykConfirmBtn = () => {
+		uni.navigateTo({
+			url: `/pages/selectGradesTerms/index`
+		})
+	}
 	// 手机号校验规则
 	const validatePhoneNumber = (value) => {
 		const phoneRegex = /^1[3-9]\d{9}$/;
@@ -120,9 +128,13 @@
 	}
 	// 游客登录
 	const ykBtn = () => {
-		uni.redirectTo({
-			url: `/pages/selectGradesTerms/index`
-		})
+		if (indexData.isAgreed === true) {
+			uni.navigateTo({
+				url: `/pages/selectGradesTerms/index`
+			})
+		} else {
+			agreeYkDialog.value.handleShow();
+		}
 	}
 
 	const wxLoginClick = () => {

+ 1 - 1
pages/login/login.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="ezy-login-page">
-		<view @click="goIndex" class="login-nav-bar-icon"></view>
+		<view @click="goIndex" class="ezy-nav-bar-icon"></view>
 		<view class="ezy-login-wrap">
 			<view class="login-body-box">
 				<view class="login-title-img"></view>

+ 1 - 1
pages/my/index.vue

@@ -4,7 +4,7 @@
 			<icon class="head-img-box" :style="{backgroundImage: 'url(' + myInfoData.userImg + ')'}"></icon>
 			<view class="head-content-box">
 				<text>{{myInfoData.userName}}</text>
-				<view class="jf-box" v-if="loginFlag">
+				<view class="ezy-jf-box" v-if="loginFlag">
 					<icon class="jf-icon"></icon>
 					<text class="jf-text" >{{myInfoData.credit}}</text>
 				</view>

+ 0 - 0
static/images/login/agree-sections-close.png → static/images/common/close-icon.png


+ 0 - 0
static/images/my/jf-bj.png → static/images/common/jf-bj.png


BIN
static/images/game/food-img1.png


BIN
static/images/game/food-img2.png


BIN
static/images/game/yxsm-btn-img.png