wangguoyu hace 1 mes
padre
commit
0a78a93102
Se han modificado 4 ficheros con 24 adiciones y 9 borrados
  1. 10 1
      pages/game/components/goose.vue
  2. 6 3
      pages/game/index.vue
  3. 6 3
      pages/game/useGame.js
  4. 2 2
      pages/pay/order.vue

+ 10 - 1
pages/game/components/goose.vue

@@ -2,7 +2,8 @@
 	<view>
 		<up-line-progress v-if="growthType!==3" :percentage="progress" :showText="false" activeColor="#54e1fe"
 			class="game-progress-box"></up-line-progress>
-		<text v-if="growthType!==3" class="game-progress-text">成长值:{{progress}}%</text>
+<!-- 		<text v-if="growthType!==3" class="game-progress-text">成长值:{{progress}}%</text> -->
+		<text v-if="growthType!==3" class="game-progress-text">{{growth}}/{{growthTotal}}</text>
 		<image :src="imgUrl" class="goose-img-box" @click="handleTouch"></image>
 	</view>
 </template>
@@ -26,6 +27,14 @@
 		progress: {
 			type: [String, Number],
 			default: 0
+		},
+		growth: {
+			type: [String, Number],
+			default: 0
+		},
+		growthTotal: {
+			type: [String, Number],
+			default: 0
 		}
 	})
 	const {growthType} = toRefs(props);

+ 6 - 3
pages/game/index.vue

@@ -11,7 +11,7 @@
 		<!-- 桌面食物 -->
 		<foodVue :shiwuId="shiwuId" class="food-img-box" :class="'food-img'+shiwuId"></foodVue>
 		<!-- 大鹅 4阶段 -->
-		<gooseVue :growth="growth" :growthType="growthType" :progress="progress"
+		<gooseVue :growth="growth" :growthType="growthType" :progress="progress"   :growthTotal="growthTotal"
 		class="game-goose-box" :class="'game-goose-box'+ growthType"></gooseVue>
 		<!-- 食物选择 -->
 		<foodSelectVue :credit="credit" ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
@@ -42,9 +42,12 @@
 	import foodSelectVue from "./components/foodSelect.vue";
 	import commonDialogVue from "@/components/dialog/commonDialog.vue";
   import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
-
+	import {
+		toast,
+		getUserIdentity
+	} from "@/utils/common";
 	import { useGame } from "./useGame";
-	const {	credit,growth,growthType,progress,shiwuId ,handleWeishi } = useGame();
+	const {	credit,growth,growthType,progress,shiwuId ,handleWeishi ,growthTotal } = useGame();
 	const yxsmContent = reactive([{
 			title: '宠物鹅获取',
 			content: '学生首次注册并登录 APP 时,系统自动发放一颗宠物鹅蛋,开启养鹅之旅。每个账号有且仅有一次领取鹅蛋的机会,确保公平性,这颗蛋便是学生与宠物鹅相伴成长的起点。',

+ 6 - 3
pages/game/useGame.js

@@ -20,6 +20,7 @@ export function useGame() {
 			credit: 0, // 当前积分
 			growth: 0, // 成长值
 			growthType:0, // 成长类型
+			growthTotal:0, // 成长类型
 			progress:0, // 当前进度
 			shiwuId:null // 上一次食物
 	})
@@ -34,10 +35,10 @@ export function useGame() {
 			return;
 		}
 		const {
-			credit,growth,growthType,progress,shiwuId
+			credit,growth,growthTotal,growthType,progress,shiwuId
 		} = info;
-		
 		data.credit = credit;
+		data.growthTotal = growthTotal;
 		data.growth = growth;
 		data.growthType = growthType;
 		data.progress = progress;
@@ -51,11 +52,13 @@ export function useGame() {
 			return;
 		}
 		const {
-			credit,growth,growthType,progress,shiwuId
+			credit,growth,growthType,progress,shiwuId,growthTotal
 		} = info;
 		
 		data.credit = credit;
+		data.growthTotal = growthTotal;
 		data.growthType = growthType;
+		data.growth = growth;
 		data.progress = progress;
 		data.shiwuId = shiwuId;
 		

+ 2 - 2
pages/pay/order.vue

@@ -41,7 +41,7 @@
 												<view class="order-kcb-btn" v-if="item2.type ==1"
 													@click.stop="detailBtn(item2,index2)">课程包明细<icon></icon>
 												</view>
-												<text class="content-yuanjia">¥{{item2.xianjia}}</text>
+												<text class="content-yuanjia">¥{{item.money}}</text>
 											</view>
 										</view>
 									</view>
@@ -115,7 +115,7 @@
 												<view class="order-kcb-btn" v-if="item2.type ==1"
 													@click="detailBtn(item2,index2)">课程包明细<icon></icon>
 												</view>
-												<text class="content-yuanjia">¥{{item2.xianjia}}</text>
+												<text class="content-yuanjia">¥{{item.money}}</text>
 											</view>
 										</view>
 									</view>