ck@123911.net 2 mesiacov pred
rodič
commit
ad40aec130

+ 194 - 5
pages/isLand/HuaTian.scss

@@ -11,6 +11,13 @@
   background: url('../../static/island/huatian/bg_huatian.png');
   background-size: 700rpx 952rpx;
   position: relative;
+  .task_day {
+	  display: flex;flex-direction: column;justify-content: center;align-items: center;
+	  width:120rpx;position: absolute;left:30rpx;top:30rpx;
+	  image {
+		  width:96rpx;height:76rpx;
+	  }
+  }
   
   .board-title {
     display: flex;
@@ -25,7 +32,7 @@
 		display: flex;
 		flex-wrap: wrap;
 		justify-content: center;
-		padding: 10rpx;padding-top: 20rpx;
+		padding: 10rpx;padding-top: 40rpx;
 		
 		.item {
 			width:150rpx;height:120rpx;padding:10rpx;
@@ -43,6 +50,30 @@
 				width:100rpx;height:100rpx;
 				position: absolute;z-index: 99;top:0rpx;
 			}
+			.souhuo {
+				width:66rpx;height:72rpx;
+				position: absolute;z-index: 99;top:-20rpx;
+			}
+			.zacao {
+				width:100rpx;height:100rpx;
+				position: absolute;z-index: 99;top:0rpx;
+			}
+			.timer {
+				width: 102rpx;
+				height: 28rpx;
+				background: rgba(0,0,0,0.3);
+				border-radius: 14rpx 14rpx 14rpx 14rpx;
+				position: absolute;z-index: 99;top:0rpx;
+				display: flex;flex-direction: row;justify-content: center;align-items: center;
+				.icon {
+					width:20rpx;height:20rpx;margin-right: 4rpx;
+				}
+				text {
+					font-size: 22rpx;
+					color: #FFEFE1;
+					line-height: 26rpx;padding-right: 4rpx;
+				}
+			}
 		}
 		.blank {
 			width:70rpx;height:30rpx;
@@ -72,7 +103,7 @@
 		text-align: justify;
 		font-style: normal;
 		text-transform: none;
-		position:absolute;z-index: 210;bottom:0rpx;right:0rpx;
+		position:absolute;z-index: 210;bottom:0rpx;right:20rpx;
 	}
 	.title {
 		width: 156rpx;
@@ -85,10 +116,168 @@
 		font-size: 24rpx;
 		color: #987453;
 		line-height: 28rpx;
-		position:absolute;z-index: 220;bottom:166rpx;right:30rpx;
+		position:absolute;z-index: 220;bottom:166rpx;right:60rpx;
 	}
 	.npc {
 		width:174rpx;height:308rpx;
-		position: absolute;bottom:220rpx;right:0rpx;z-index: 200;
+		position: absolute;bottom:120rpx;right:40rpx;z-index: 200;
+		image {
+			width:174rpx;height:308rpx;
+		}
+	}
+}
+.btn_task {
+	width:156rpx;height:156rpx;
+	background: url('../../static/island/huatian/btn_task.png');
+	background-size: 156rpx 156rpx;
+	font-weight: 700;
+	font-size: 16rpx;
+	color: #683830;
+	text-align: center;padding-top: 114rpx;
+	position: fixed;top:120rpx;left:20rpx;
+}
+.btn_list {
+	position: absolute;bottom:-170rpx;left:0rpx;z-index: 999;
+	width:700rpx;height:156rpx;
+	display: flex;flex-direction: row;justify-content: space-between;align-items: center;
+	.item {
+		width:156rpx;height:156rpx;
+		font-weight: 700;
+		font-size: 16rpx;
+		color: #683830;
+		text-align: center;padding-top: 116rpx;
+	}
+	.item1 {
+		background: url('../../static/island/huatian/btn_jiesuo.png');
+		background-size: 156rpx 156rpx;
+	}
+	.item2 {
+		background: url('../../static/island/huatian/btn_cucao.png');
+		background-size: 156rpx 156rpx;
+	}
+	.item3 {
+		background: url('../../static/island/huatian/btn_bozong.png');
+		background-size: 156rpx 156rpx;
+	}
+	.item4 {
+		background: url('../../static/island/huatian/btn_souhuo.png');
+		background-size: 156rpx 156rpx;
+	}
+}
+.select_zz {
+	position: absolute;bottom:-10rpx;left:27rpx;z-index: 990;
+	width: 656rpx;
+	height: 150rpx;
+	background: #FDDEC1;
+	border: 2rpx solid #DEB691;border-radius: 20rpx;padding:20rpx;
+	display: flex;flex-direction: row;justify-content: flex-start;align-items: center;
+	.item {
+		width: 104rpx;
+		height: 104rpx;margin-right: 20rpx;
+		background: #FBD6A9;
+		border-radius: 14rpx 14rpx 14rpx 14rpx;
+		border: 2rpx solid #DEB691;
+		display: flex;flex-direction: column;justify-content: center;align-items: center;
+		.img {
+			width:104rpx;height:70rpx;
+			display: flex;flex-direction: column;justify-content: center;align-items: center;
+			image {
+				width:48rpx;height:48rpx;
+			}
+		}
+		.foot {
+			width: 100rpx;height: 34rpx;
+			background: #FFE7CA;
+			border-radius: 0rpx 0rpx 14rpx 14rpx;
+			font-weight: 700;
+			font-size: 16rpx;
+			color: #987453;
+			display: flex;flex-direction: column;justify-content: center;align-items: center;
+		}
 	}
-}
+	.jiantou {
+		position: absolute;z-index: 999;
+		width:32rpx;height:18rpx;bottom:-8rpx;right:114rpx;
+		image {
+			width:32rpx;height:18rpx;
+		}
+	}
+}
+	.confirm-dialog {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		background-color: rgba(0, 0, 0, 0.5);
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		z-index: 999;
+
+		.dialog-content {
+			width: 500rpx;
+			background: #FDDEC1;
+			border-radius: 20rpx;
+			overflow: hidden;
+			box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
+			border: 2rpx solid #d06262;
+
+			.dialog-title {
+				text-align: center;
+				color: #683830;
+				font-size: 34rpx;
+				font-weight: bold;
+				padding: 20rpx 0;
+				border-bottom: 0rpx solid #d06262;
+				position: relative;
+
+			}
+
+			.dialog-text {
+				padding: 40rpx 30rpx;
+				text-align: center;
+				font-size: 30rpx;
+				color: #987453;
+				border-radius: 0 0 12rpx 12rpx;
+				position: relative;
+
+			}
+
+			.dialog-buttons {
+				display: flex;
+				justify-content: space-around;
+				padding: 30rpx;
+
+				.btn-cancel,
+				.btn-confirm {
+					width: 180rpx;
+					height: 80rpx;
+					border-radius: 40rpx;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					font-size: 32rpx;
+					font-weight: bold;
+					width:184rpx;height:80rpx;
+					background: url('../../static/island/huatian/zx_btn_queren.png');
+					background-size: 184rpx 80rpx;
+				}
+
+				.btn-cancel {
+					color: white;
+					position: relative;
+					width:184rpx;height:80rpx;
+					background: url('../../static/island/huatian/zx_btn_quxiao.png');
+					background-size: 184rpx 80rpx;
+
+				}
+
+				.btn-confirm {
+					color: white;
+					position: relative;
+
+				}
+			}
+		}
+	}

+ 919 - 59
pages/isLand/HuaTian.vue

@@ -1,29 +1,110 @@
 <template>
+	<!-- 
+	
+设定:
+suo:锁;
+flower:花,共7种,图片分别为flower1.png flower2.png flower7.png;
+zacao:杂草;
+tian:田地,如果是待解锁的田地,图片用tian_suo.png,如果是已解锁就用tian.png;
+souhuo:收获标识;
+select_zz:7种花的view,默认应该隐藏,点击播种时显示,播种结束后隐藏
+4个按钮:
+解锁荒地:点击时,将第一块待解锁的田地转换为已解锁地
+除草:点击时,让杂草隐藏
+播种:点击时,需要先将7种花显示出来,选择其中一种,然后再点击除去杂草的地,然后该块地上显示种子,然后10分钟倒计时,然后显示对应的花,以及收获标识
+收获:点击后,有收获标识的土地上的收获标识图片隐藏,花隐藏,出现杂草
+操作流程:
+默认显示待解锁的田地(其他几个图标都隐藏),点击"解锁荒地",点击"除草",点击"播种",到时间后点击"收获" -->
 	<view class="page">
 		<view class="task-board">
+			<view class="task_day">
+				<image src="../../static/island/huatian/btn_task_day.png" class="task"></image>
+			</view>
 			<view class="board-title">
 			</view>
 			<view class="bodyContent">
 
-				<block v-for="(reward, index) in 20" :key="index">
+				<block v-for="(field, index) in fields" :key="index">
 					<view class="blank" v-if="index == 0 || index == 7 || index == 10"></view>
-					<view class="item">
-						<image src="../../static/island/huatian/suo.png" class="suo"></image>
-						<image src="../../static/island/huatian/flower3.png" class="flower"></image>
-						<image src="../../static/island/huatian/tian_suo.png" class="tian"></image>
+					<view class="item" :class="{
+							  'locked': !field.isUnlocked,
+							  'weedy': field.hasWeed,
+							  'weed-blink': weedMode && field.hasWeed,
+							  'planted': field.flower,
+							  'growing': field.isGrowing,
+							  'ready': field.canHarvest,
+							  'harvest-blink': harvestMode && field.canHarvest
+						  }" @click="handleFieldClick(index)">
+						<image v-if="!field.isUnlocked" src="../../static/island/huatian/suo.png" class="suo"></image>
+						<image v-if="field.flower && field.growthCompleted"
+							:src="`../../static/island/huatian/flower${field.flowerType}.png`" class="flower"></image>
+						<image v-if="field.seedStage && field.isGrowing" src="../../static/island/huatian/zongzi.png"
+							class="flower"></image>
+						<image v-if="field.hasWeed && field.isUnlocked" src="../../static/island/huatian/zacao.png"
+							class="zacao"></image>
+						<image
+							:src="field.isUnlocked ? '../../static/island/huatian/tian.png' : '../../static/island/huatian/tian_suo.png'"
+							class="tian"></image>
+						<image v-if="field.canHarvest" src="../../static/island/huatian/souhuo.png" class="souhuo">
+						</image>
+						<view class="timer" v-if="field.isGrowing">
+							<image src="../../static/island/huatian/timer.png" class="icon"></image>
+							<text>{{formatTime(field.remainingTime)}}</text>
+						</view>
 					</view>
 					<view class="blank" v-if="index == 2 || index == 9 || index == 12"></view>
 				</block>
 
 			</view>
-			<view class="close">
+			<view class="close" @click="onClose">
 				<image src="../../static/island/UI/btn_close.png" class="close"></image>
 			</view>
+			<view class="btn_list">
+				<view class="item item1" @click="showUnlockConfirm">
+					解锁荒地
+				</view>
+				<view class="item item2" @click="removeWeed">
+					除草
+				</view>
+				<view class="item item3" @click="showFlowerSelect">
+					播种
+				</view>
+				<view class="item item4" @click="enterHarvestMode">
+					收获
+				</view>
+
+			</view>
+			<view class="select_zz" v-if="showFlowerSelection">
+				<view class="item" v-for="(flower, idx) in flowers" :key="idx" @click="selectFlower(idx)"
+					v-if="flower.count > 0">
+					<view class="img">
+						<image :src="`../../static/island/huatian/flower${idx+1}.png`"></image>
+					</view>
+					<view class="foot">
+						{{flower.count}}
+					</view>
+				</view>
+				<view class="jiantou">
+					<image class="jiantou" src="../../static/island/huatian/jiantou.png"></image>
+				</view>
+			</view>
 		</view>
 
-		<view class="guild">
+		<!-- 解锁确认对话框 -->
+		<view class="confirm-dialog" v-if="showUnlockDialog">
+			<view class="dialog-content">
+				<view class="dialog-title">解锁荒地</view>
+				<view class="dialog-text">是否支付{{nextLandPrice}}铃钱解锁荒地?</view>
+				<view class="dialog-buttons">
+					<view class="btn-cancel" @click="cancelUnlock">取消</view>
+					<view class="btn-confirm" @click="confirmUnlock">确认</view>
+				</view>
+			</view>
+		</view>
+
+		<view class="guild" v-if="showGuide">
 			<view class="content">
-				"欢迎来到花田!在这里,你将成为农场的主人,体验种植和经营农场的乐趣。首先,让我们来开垦一块土地吧。只需支付100金币即可解锁!"
+				"欢迎来到花田!在这里,你将成为农场的主人,体验种植和经营农场的乐趣。首先,让我们来开垦一块土地吧。只需支付铃钱即可解锁!"
 			</view>
 			<view class="title">
 				罗奇
@@ -32,6 +113,8 @@
 				<image src="../../static/island/npc.png"></image>
 			</view>
 		</view>
+
+
 	</view>
 </template>
 
@@ -49,67 +132,800 @@
 		},
 		data() {
 			return {
-				tasks: [{
-						title: '负债累累的冒险家',
-						description: '终极目标就是偿还移民的债务,做一个无债一身轻的玩家',
-						rewards: [{
-								icon: '/static/icons/coin.png',
-								text: '金币×3000'
+				// 用户ID
+				ssoId: 0,
+				// 田地数据
+				fields: Array(20).fill().map(() => ({
+					id: 0, // 后端数据库ID
+					tid: 0, // 对应的土地表ID
+					isUnlocked: false,
+					hasWeed: false,
+					flower: false,
+					flowerType: null,
+					isGrowing: false,
+					growthCompleted: false,
+					canHarvest: false,
+					remainingTime: 0,
+					timer: null,
+					seedStage: false,
+					plantTime: '',
+					state: 0 // 与后端对应的状态
+				})),
+
+				// 花的数据
+				flowers: [],
+				// 种子数据
+				seeds: [],
+				// 用户铃钱
+				money: 0,
+				// 下一块要解锁的土地价格
+				nextLandPrice: 100,
+				// 选择状态
+				selectedFlowerIndex: -1,
+				showFlowerSelection: false,
+				showGuide: false,
+				plantMode: false,
+				showUnlockDialog: false, // 解锁确认对话框显示状态
+				// 当前选择的土地ID
+				selectedLandId: 0,
+				// 成长检查定时器
+				growthCheckTimer: null,
+				weedMode: false, // 添加除草模式状态
+				weedyFields: [], // 添加可除草的地块列表
+				harvestMode: false, // 添加收获模式状态
+				harvestableFields: [], // 添加可收获的地块列表
+			}
+		},
+		onLoad() {
+			// 初始化获取数据
+			this.fetchData();
+		},
+		onShow() {
+			// 重新获取数据
+			this.fetchData();
+		},
+		beforeDestroy() {
+			// 清除所有定时器
+			this.fields.forEach(field => {
+				if (field.timer) {
+					clearInterval(field.timer);
+				}
+			});
+
+			// 清除生长检查定时器
+			if (this.growthCheckTimer) {
+				clearInterval(this.growthCheckTimer);
+			}
+		},
+		methods: {
+			// 关闭界面
+			onClose() {
+				this.$emit('close');
+			},
+
+			// 初始化获取数据
+			async fetchData() {
+				console.log("uuid", getApp().globalData.uuid)
+				try {
+					uni.request({
+						url: this.$apiHost + '/Game/huatian/index',
+						method: 'POST',
+						data: {
+							uuid: getApp().globalData.uuid,
+						},
+						header: {
+							'Content-Type': 'application/x-www-form-urlencoded',
+							'sign': getApp().globalData.headerSign,
+						},
+						success: (res) => {
+							if (res.data && res.data.code === 0) {
+								// 更新用户铃钱
+								this.money = res.data.money;
+
+								// 更新种子数据
+								this.seeds = res.data.seeds || [];
+
+								// 更新背包数据
+								const bagItems = res.data.bag_list || [];
+
+								// 更新花的数据(背包中type=1的是种子)
+								this.flowers = [];
+								for (let i = 1; i <= 7; i++) {
+									// 找到对应的种子数量
+									const seedBag = bagItems.find(item => item.type === 1 && item.tid ===
+										i);
+
+									this.flowers.push({
+										id: i,
+										name: this.seeds[i - 1]?.name || `花${i}`,
+										count: seedBag ? seedBag.num : 0
+									});
+								}
+
+								// 更新土地数据
+								const tudiList = res.data.tudi_list || [];
+
+								// 重置田地数据
+								this.fields = Array(20).fill().map((_, index) => ({
+									id: 0,
+									tid: index + 1,
+									isUnlocked: false,
+									hasWeed: false,
+									flower: false,
+									flowerType: null,
+									isGrowing: false,
+									growthCompleted: false,
+									canHarvest: false,
+									remainingTime: 0,
+									timer: null,
+									seedStage: false,
+									plantTime: '',
+									state: 0
+								}));
+
+								// 更新已解锁的田地状态
+								tudiList.forEach(land => {
+									const fieldIndex = land.tid - 1;
+									if (fieldIndex >= 0 && fieldIndex < this.fields.length) {
+										const field = this.fields[fieldIndex];
+
+										field.id = land.id;
+										field.tid = land.tid;
+										field.isUnlocked = true;
+										field.state = land.state;
+										field.plantTime = land.plant_time;
+
+										// 根据状态设置不同的显示
+										if (land.state === -1) {
+											// 杂草地
+											field.hasWeed = true;
+										} else if (land.state === 0) {
+											// 待播种的空地
+											field.hasWeed = false;
+										} else if (land.state >= 1 && land.state <= 7) {
+											// 种植了花
+											field.hasWeed = false;
+											field.flowerType = land.zzid;
+
+											// 计算是否已经成熟
+											if (land.plant_time) {
+												const plantTime = new Date(land.plant_time);
+												const now = new Date();
+												const growthHours = (now - plantTime) / (1000 *
+													60 * 60);
+
+												// 获取对应种子的生长周期
+												const seed = this.seeds.find(s => s.id === land
+													.state);
+												const limitHours = seed ? seed.limit_time : 0;
+
+												if (growthHours >= limitHours) {
+													// 已成熟
+													field.flower = true;
+													field.growthCompleted = true;
+													field.canHarvest = true;
+												} else {
+													// 未成熟,显示生长中
+													field.isGrowing = true;
+													field.seedStage = true;
+													field.remainingTime = Math.ceil((limitHours -
+														growthHours) * 60 * 60);
+													this.startGrowthTimer(fieldIndex);
+												}
+											}
+										} else if (land.state === 99) {
+											// 成熟待收割
+											field.hasWeed = false;
+											field.flower = true;
+											field.flowerType = land.flowerType || land
+												.zzid;
+											field.growthCompleted = true;
+											field.canHarvest = true;
+										}
+									}
+								});
+
+								// 找到下一块可解锁土地的价格
+								for (let i = 0; i < this.fields.length; i++) {
+									if (!this.fields[i].isUnlocked) {
+										console.log("this.landpric", i + 1)
+										// 从服务端获取土地价格
+										uni.request({
+											url: this.$apiHost + '/Game/huatian/get_land_price',
+											method: 'POST',
+											data: {
+												uuid: getApp().globalData.uuid,
+												land_id: i + 1
+											},
+											header: {
+												'Content-Type': 'application/x-www-form-urlencoded',
+												'sign': getApp().globalData.headerSign,
+												uuid: getApp().globalData.uuid,
+											},
+											success: (res) => {
+												console.log('res.data', res.data);
+												if (res.data && res.data.code === 0) {
+													this.nextLandPrice = res.data.data.price;
+												} else {
+													// 如果获取失败,使用默认值
+													this.nextLandPrice = 100;
+												}
+											},
+											fail: (err) => {
+												console.error('获取土地价格异常', err);
+												// 如果获取失败,使用默认值
+												this.nextLandPrice = 100;
+											}
+										});
+										break;
+									}
+								}
+
+								// 启动定时检查植物生长状态
+								this.startGrowthCheck();
+							} else {
+								uni.showToast({
+									title: res.data?.msg || '获取数据失败',
+									icon: 'none'
+								});
+							}
+						},
+						fail: (err) => {
+							console.error('获取数据异常', err);
+							uni.showToast({
+								title: '网络异常,请重试',
+								icon: 'none'
+							});
+						}
+					});
+				} catch (error) {
+					console.error('获取数据异常', error);
+					uni.showToast({
+						title: '网络异常,请重试',
+						icon: 'none'
+					});
+				}
+			},
+
+			// 显示解锁确认对话框
+			showUnlockConfirm() {
+				this.showUnlockDialog = true;
+			},
+
+			// 取消解锁
+			cancelUnlock() {
+				this.showUnlockDialog = false;
+			},
+
+			// 确认解锁
+			async confirmUnlock() {
+				try {
+					uni.request({
+						url: this.$apiHost + '/Game/huatian/unlock_land',
+						method: 'POST',
+						data: {
+							uuid: getApp().globalData.uuid,
+						},
+						header: {
+							'Content-Type': 'application/x-www-form-urlencoded',
+							'sign': getApp().globalData.headerSign,
+							uuid: getApp().globalData.uuid,
+						},
+						success: (res) => {
+							if (res.data && res.data.code === 0) {
+								uni.showToast({
+									title: '解锁成功',
+									icon: 'success'
+								});
+
+								// 更新用户铃钱
+								this.money = res.data.data.money;
+
+								// 重新获取数据
+								this.fetchData();
+							} else {
+								uni.showToast({
+									title: res.data?.msg || '解锁失败',
+									icon: 'none'
+								});
+							}
+						},
+						fail: (err) => {
+							console.error('解锁土地异常', err);
+							uni.showToast({
+								title: '网络异常,请重试',
+								icon: 'none'
+							});
+						}
+					});
+				} catch (error) {
+					console.error('解锁土地异常', error);
+					uni.showToast({
+						title: '网络异常,请重试',
+						icon: 'none'
+					});
+				}
+
+				this.showUnlockDialog = false;
+			},
+
+			// 除草
+			async removeWeed() {
+				if (this.weedMode) {
+					// 如果已经在除草模式,则退出
+					this.weedMode = false;
+					this.weedyFields = [];
+					return;
+				}
+
+				// 找到所有有杂草的已解锁土地
+				this.weedyFields = this.fields.filter(field => field.isUnlocked && field.hasWeed);
+
+				if (this.weedyFields.length === 0) {
+					uni.showToast({
+						title: '没有需要除草的土地',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 进入除草模式
+				this.weedMode = true;
+				uni.showToast({
+					title: '请点击需要除草的土地',
+					icon: 'none'
+				});
+			},
+
+			// 进入收获模式
+			enterHarvestMode() {
+				if (this.harvestMode) {
+					// 如果已经在收获模式,则退出
+					this.harvestMode = false;
+					this.harvestableFields = [];
+					return;
+				}
+
+				// 找到所有可收获的土地
+				this.harvestableFields = this.fields.filter(field => field.canHarvest);
+
+				if (this.harvestableFields.length === 0) {
+					uni.showToast({
+						title: '没有可收获的花',
+						icon: 'none'
+					});
+					return;
+				}
+
+				// 进入收获模式
+				this.harvestMode = true;
+				uni.showToast({
+					title: '请点击需要收获的土地',
+					icon: 'none'
+				});
+			},
+
+			// 显示花的选择
+			showFlowerSelect() {
+				if (this.showFlowerSelection) {
+					this.showFlowerSelection = false;
+					return;
+				}
+				// 检查是否有可播种的土地
+				const canPlantFields = this.fields.filter(field => field.isUnlocked && !field.hasWeed && !field.flower && !
+					field.isGrowing);
+
+				if (canPlantFields.length === 0) {
+					uni.showToast({
+						title: '没有可播种的土地',
+						icon: 'none'
+					});
+					return;
+				}
+
+				this.showFlowerSelection = true;
+				this.plantMode = false;
+				this.selectedFlowerIndex = -1;
+			},
+
+			// 选择花
+			selectFlower(idx) {
+				this.selectedFlowerIndex = idx;
+				this.showFlowerSelection = false;
+				this.plantMode = true;
+			},
+
+			// 点击田地
+			handleFieldClick(index) {
+				if (this.weedMode) {
+					// 在除草模式下,只处理有草的地块
+					if (this.fields[index].hasWeed) {
+						this.removeWeedFromField(index);
+					}
+					return;
+				}
+
+				if (this.harvestMode) {
+					// 在收获模式下,只处理可收获的地块
+					if (this.fields[index].canHarvest) {
+						this.harvestField(this.fields[index].id);
+					}
+					return;
+				}
+				if (this.plantMode) {
+					if (this.fields[index].canHarvest) {
+					}
+					this.handleFieldClickBZ(index);
+					return;
+				}
+
+				// 原有的种植逻辑
+				if (!this.fields[index].isUnlocked) {
+					uni.showToast({
+						title: '该地块未解锁',
+						icon: 'none'
+					});
+					return;
+				}
+
+				if (this.fields[index].flower) {
+					if (this.fields[index].canHarvest) {
+						this.harvestField(this.fields[index].id);
+					} else {
+						uni.showToast({
+							title: '花朵正在生长中',
+							icon: 'none'
+						});
+					}
+					return;
+				}
+
+				// 打开种子选择弹窗
+				this.currentFieldIndex = index;
+				this.showSeedSelector = true;
+			},
+			// 点击田地
+			async handleFieldClickBZ(index) {
+				const field = this.fields[index];
+
+				// 已解锁土地且处于播种模式
+				if (this.plantMode && field.isUnlocked && !field.hasWeed && !field.flower && !field.isGrowing) {
+					// 设置当前选中的土地
+					this.selectedLandId = field.id;
+
+					// 播种
+					try {
+						uni.request({
+							url: this.$apiHost + '/Game/huatian/plant_seed',
+							method: 'POST',
+							data: {
+								uuid: getApp().globalData.uuid,
+								land_id: field.id,
+								seed_id: this.selectedFlowerIndex + 1
 							},
-							{
-								icon: '/static/icons/exp.png',
-								text: '经验×3000'
+							header: {
+								'Content-Type': 'application/x-www-form-urlencoded',
+								'sign': getApp().globalData.headerSign,
+								uuid: getApp().globalData.uuid,
 							},
-							{
-								icon: '/static/icons/blueprint.png',
-								text: '升级房屋图纸×1'
+							success: (res) => {
+								if (res.data && res.data.code === 0) {
+									// 更新土地状态
+									field.isGrowing = true;
+									field.seedStage = true;
+									field.flowerType = this.selectedFlowerIndex + 1;
+									field.state = this.selectedFlowerIndex + 1;
+									field.plantTime = res.data.data.plantTime;
+
+									// 计算剩余生长时间
+									const limitTimeHours = res.data.data.limitTime;
+									field.remainingTime = limitTimeHours * 60 * 60;
+
+									// 开始计时
+									this.startGrowthTimer(index);
+
+									// 更新种子数量
+									const flowerData = this.flowers[this.selectedFlowerIndex];
+									if (flowerData && flowerData.count > 0) {
+										flowerData.count--;
+									}
+
+									// 退出播种模式
+									this.plantMode = false;
+
+									uni.showToast({
+										title: '播种成功',
+										icon: 'success'
+									});
+								} else {
+									uni.showToast({
+										title: res.data?.msg || '播种失败',
+										icon: 'none'
+									});
+									this.plantMode = false;
+								}
+							},
+							fail: (err) => {
+								console.error('播种异常', err);
+								uni.showToast({
+									title: '网络异常,请重试',
+									icon: 'none'
+								});
+								this.plantMode = false;
 							}
-						],
-						date: '2024/04/08',
-						status: 'completed'
+						});
+					} catch (error) {
+						console.error('播种异常', error);
+						uni.showToast({
+							title: '网络异常,请重试',
+							icon: 'none'
+						});
+						this.plantMode = false;
+					}
+				} else if (field.canHarvest) {
+					// 收获花朵
+					this.harvestField(field.id);
+				}
+			},
+
+			// 从特定地块移除杂草
+			removeWeedFromField(index) {
+				// 调用除草API
+				uni.request({
+					url: this.$apiHost + '/Game/huatian/remove_weed',
+					method: 'POST',
+					data: {
+						uuid: getApp().globalData.uuid,
+						land_id: this.fields[index].id
 					},
-					{
-						title: '负债累累的冒险家',
-						description: '终极目标就是偿还移民的债务,做一个无债一身轻的玩家',
-						rewards: [{
-								icon: '/static/icons/coin.png',
-								text: '金币×3000'
-							},
-							{
-								icon: '/static/icons/exp.png',
-								text: '经验×3000'
-							},
-							{
-								icon: '/static/icons/blueprint.png',
-								text: '升级房屋图纸×1'
+					header: {
+						'Content-Type': 'application/x-www-form-urlencoded',
+						'sign': getApp().globalData.headerSign,
+						uuid: getApp().globalData.uuid,
+					},
+					success: (res) => {
+						if (res.data && res.data.code === 0) {
+							// 更新地块状态
+							this.fields[index].hasWeed = false;
+							this.fields[index].state = 0;
+
+							// 从可除草地块列表中移除
+							this.weedyFields = this.weedyFields.filter(f => f.id !== this.fields[index].id);
+
+							uni.showToast({
+								title: '除草成功',
+								icon: 'success'
+							});
+
+							// 如果所有草都已清除,退出除草模式
+							if (this.weedyFields.length === 0) {
+								this.weedMode = false;
+								uni.showToast({
+									title: '所有杂草已清除',
+									icon: 'success'
+								});
 							}
-						],
-						date: '2024/04/08',
-						status: 'available'
+						} else {
+							uni.showToast({
+								title: res.data?.msg || '除草失败',
+								icon: 'none'
+							});
+						}
+					},
+					fail: (err) => {
+						console.error('除草异常', err);
+						uni.showToast({
+							title: '网络异常,请重试',
+							icon: 'none'
+						});
 					}
-				]
-			}
-		},
-		methods: {
-			onClose() {
-				this.$emit('close')
+				});
+			},
+
+			// 开始生长计时器
+			startGrowthTimer(fieldIndex) {
+				const field = this.fields[fieldIndex];
+
+				// 清除可能存在的旧定时器
+				if (field.timer) {
+					clearInterval(field.timer);
+				}
+
+				field.timer = setInterval(() => {
+					field.remainingTime--;
+
+					if (field.remainingTime <= 0) {
+						// 生长完成
+						clearInterval(field.timer);
+						field.isGrowing = false;
+						field.seedStage = false;
+						field.growthCompleted = true;
+						field.flower = true;
+						field.canHarvest = true;
+					}
+				}, 1000);
 			},
-			handleTaskAction(task) {
-				if (task.status === 'completed') {
-					// 处理完成任务的逻辑
+
+			// 收获特定地块
+			async harvestField(landId) {
+				console.log("land", landId);
+				try {
+					uni.request({
+						url: this.$apiHost + '/Game/huatian/harvest',
+						method: 'POST',
+						data: {
+							uuid: getApp().globalData.uuid,
+							land_id: landId
+						},
+						header: {
+							'Content-Type': 'application/x-www-form-urlencoded',
+							'sign': getApp().globalData.headerSign,
+							uuid: getApp().globalData.uuid,
+						},
+						success: (res) => {
+							if (res.data && res.data.code === 0) {
+								// 找到对应的田地
+								const fieldIndex = this.fields.findIndex(f => f.id === landId);
+
+								if (fieldIndex >= 0) {
+									const field = this.fields[fieldIndex];
+
+									// 重置状态
+									field.flower = false;
+									field.flowerType = null;
+									field.growthCompleted = false;
+									field.canHarvest = false;
+									field.hasWeed = true;
+									field.state = -1;
+
+									// 如果有定时器,清除它
+									if (field.timer) {
+										clearInterval(field.timer);
+										field.timer = null;
+									}
+								}
+
+								// 重新获取数据以更新背包
+								this.fetchData();
+
+								uni.showToast({
+									title: `收获了${res.data.data.harvestNum}朵花`,
+									icon: 'success'
+								});
+
+								// 从可收获地块列表中移除
+								this.harvestableFields = this.harvestableFields.filter(f => f.id !==
+									landId);
+
+								// 如果所有花都已收获,退出收获模式
+								if (this.harvestableFields.length === 0) {
+									this.harvestMode = false;
+									uni.showToast({
+										title: '所有花已收获',
+										icon: 'success'
+									});
+								}
+							} else {
+								uni.showToast({
+									title: res.data?.msg || '收获失败',
+									icon: 'none'
+								});
+							}
+						},
+						fail: (err) => {
+							console.error('收获异常', err);
+							uni.showToast({
+								title: '网络异常,请重试',
+								icon: 'none'
+							});
+						}
+					});
+				} catch (error) {
+					console.error('收获异常', error);
 					uni.showToast({
-						title: '任务已完成!',
-						icon: 'success'
-					})
-				} else {
-					// 处理领取任务的逻辑
+						title: '网络异常,请重试',
+						icon: 'none'
+					});
+				}
+			},
+
+			// 收获所有可收获的花
+			async harvest() {
+				const harvestFields = this.fields.filter(field => field.canHarvest);
+
+				if (harvestFields.length === 0) {
 					uni.showToast({
-						title: '已领取任务',
-						icon: 'success'
-					})
+						title: '没有可收获的花',
+						icon: 'none'
+					});
+					return;
 				}
-			}
-		}
+
+				try {
+					for (const field of harvestFields) {
+						await this.harvestField(field.id);
+					}
+				} catch (error) {
+					console.error('批量收获异常', error);
+				}
+			},
+
+			// 格式化时间显示
+			formatTime(seconds) {
+				const hours = Math.floor(seconds / 3600);
+				const minutes = Math.floor((seconds % 3600) / 60);
+				const secs = seconds % 60;
+				
+				// 获取当前时间,用于控制冒号闪烁
+				const now = new Date();
+				const blinkState = now.getSeconds() % 2 === 0;
+				
+				// 格式化为 "HH:MM" 格式
+				return `${hours.toString().padStart(2, '0')}${blinkState ? ':' : ' '}${minutes.toString().padStart(2, '0')}`;
+			},
+
+			// 开始定时检查植物生长状态
+			startGrowthCheck() {
+				// 清除可能存在的旧定时器
+				if (this.growthCheckTimer) {
+					clearInterval(this.growthCheckTimer);
+				}
+
+				// 每分钟检查一次植物生长状态
+				this.growthCheckTimer = setInterval(async () => {
+					try {
+						uni.request({
+							url: this.$apiHost + '/Game/huatian/check_growth',
+							method: 'POST',
+							data: {
+								uuid: getApp().globalData.uuid,
+							},
+							header: {
+								'Content-Type': 'application/x-www-form-urlencoded',
+								'sign': getApp().globalData.headerSign,
+								uuid: getApp().globalData.uuid,
+							},
+							success: (res) => {
+								if (res.data && res.data.code === 0) {
+									const growthData = res.data.data || [];
+
+									// 更新每块土地的状态
+									growthData.forEach(item => {
+										if (item.isReady) {
+											// 找到对应的田地
+											const field = this.fields.find(f => f.id ===
+												item.landId);
+
+											if (field) {
+												// 更新为可收获状态
+												field.isGrowing = false;
+												field.seedStage = false;
+												field.growthCompleted = true;
+												field.flower = true;
+												field.canHarvest = true;
+												field.state = 99;
+
+												// 清除定时器
+												if (field.timer) {
+													clearInterval(field.timer);
+													field.timer = null;
+												}
+											}
+										}
+									});
+								}
+							},
+							fail: (err) => {
+								console.error('检查生长状态异常', err);
+							}
+						});
+					} catch (error) {
+						console.error('检查生长状态异常', error);
+					}
+				}, 60000); // 60秒检查一次
+			},
+		},
+
 	}
 </script>
 
@@ -117,4 +933,48 @@
 
 <style lang="scss">
 	@import './HuaTian.scss';
+
+	@keyframes weedBlink {
+		0% {
+			opacity: 1;
+			transform: scale(1);
+		}
+
+		50% {
+			opacity: 0.5;
+			transform: scale(1.1);
+		}
+
+		100% {
+			opacity: 1;
+			transform: scale(1);
+		}
+	}
+
+	.weed-blink {
+		animation: weedBlink 1s infinite;
+		z-index: 10;
+	}
+
+	@keyframes harvestBlink {
+		0% {
+			opacity: 1;
+			transform: scale(1);
+		}
+
+		50% {
+			opacity: 0.5;
+			transform: scale(1.1);
+		}
+
+		100% {
+			opacity: 1;
+			transform: scale(1);
+		}
+	}
+
+	.harvest-blink {
+		animation: harvestBlink 1s infinite;
+		z-index: 10;
+	}
 </style>

+ 499 - 547
pages/my/job.vue

@@ -1,40 +1,31 @@
 <template>
-  <view class="page">
-    <!-- 顶部黄色背景 -->
-    <PageHeader class="PageHeader">
-      <template slot="center"> 任务中心 </template>
-      <template slot="right">
-        <DropdownMenu
-          :options="dropdownOptions"
-          @select="handleDropdownSelect"
-        />
-      </template>
-    </PageHeader>
-    <view class="occupyHigh"></view>
-    <!-- 内容区域 -->
-    <view class="content-area">
-      <!-- 星源余额展示区 -->
-      <view class="person-info">
-        <view class="person-info-left">
-          <CircleAvatar
-            class="avator"
-            v-if="myinfo.avator"
-            :src="myinfo.avator"
-          ></CircleAvatar>
-          <view class="title-area">
-            <text class="my-bean-title">我的星源</text>
-            <view class="bean-number">
-              <image src="@/static/me/job/wd_icon_xingyuan.png"></image>
-              {{ num_gmd | formatNumberToK }}
-            </view>
-          </view>
-        </view>
-        <view class="exchange-btn" @click="openNicknamePopUpWindow()"
-          >兑换</view
-        >
-      </view>
-      <!-- 星源余额展示区 -->
-      <!-- <view class="bean-balance"  >
+	<view class="page">
+		<!-- 顶部黄色背景 -->
+		<PageHeader class="PageHeader">
+			<template slot="center"> 任务中心 </template>
+			<template slot="right">
+				<DropdownMenu :options="dropdownOptions" @select="handleDropdownSelect" />
+			</template>
+		</PageHeader>
+		<view class="occupyHigh"></view>
+		<!-- 内容区域 -->
+		<view class="content-area">
+			<!-- 星源余额展示区 -->
+			<view class="person-info">
+				<view class="person-info-left">
+					<CircleAvatar class="avator" v-if="myinfo.avator" :src="myinfo.avator"></CircleAvatar>
+					<view class="title-area">
+						<text class="my-bean-title">我的星源</text>
+						<view class="bean-number">
+							<image src="@/static/me/job/wd_icon_xingyuan.png"></image>
+							{{ num_gmd | formatNumberToK }}
+						</view>
+					</view>
+				</view>
+				<view class="exchange-btn" @click="openNicknamePopUpWindow()">兑换</view>
+			</view>
+			<!-- 星源余额展示区 -->
+			<!-- <view class="bean-balance"  >
 				<view class="balance-header">
 					<view class="title-area">
 						<view class="yellow-dot"></view>
@@ -44,36 +35,28 @@
 				</view>
 				<view class="bean-number">{{ num_gmd }}</view>
 			</view> -->
-      <view class="starWishCheckIn">
-        <image src="@/static/me/job/rw_wenzi_01.png" class="title"></image>
-        <view
-          class="card purple-card"
-          @click="newer_bfb == 'finish' ? '' : goPage('/pages/my/editInfo')"
-        >
-          <view class="bg-box" v-if="newer_bfb == 'finish'">
-            <image
-              src="@/static/me/job/sy_icon_yilingqu.png"
-              class="bg"
-            ></image>
-          </view>
-          <view class="card-title">初次见面礼</view>
-          <view class="card-desc">完善个人资料领取星源奖励</view>
-          <view class="card-btn card-reward" v-if="newer_bfb != 'finish'"
-            >+100星源</view
-          >
-          <view class="card-btn card-reward" v-else>已领取</view>
-        </view>
-        <view class="card yellow-card">
-          <view class="card-title">每日签到</view>
-          <view class="card-desc">签到领奖励,快来签到吧!</view>
-          <view class="card-btn sign-btn" @click="opencheckInPopUpWindow()">
-            <template v-if="signInfo.isSigned">已签到</template>
-            <template v-else>立即签到</template>
-          </view>
-        </view>
-      </view>
-      <!-- 星愿打卡区域 -->
-      <!-- <view class="sign-cards" v-if="false">
+			<view class="starWishCheckIn">
+				<image src="@/static/me/job/rw_wenzi_01.png" class="title"></image>
+				<view class="card purple-card" @click="newer_bfb == 'finish' ? '' : goPage('/pages/my/editInfo')">
+					<view class="bg-box" v-if="newer_bfb == 'finish'">
+						<image src="@/static/me/job/sy_icon_yilingqu.png" class="bg"></image>
+					</view>
+					<view class="card-title">初次见面礼</view>
+					<view class="card-desc">完善个人资料领取星源奖励</view>
+					<view class="card-btn card-reward" v-if="newer_bfb != 'finish'">+100星源</view>
+					<view class="card-btn card-reward" v-else>已领取</view>
+				</view>
+				<view class="card yellow-card">
+					<view class="card-title">每日签到</view>
+					<view class="card-desc">签到领奖励,快来签到吧!</view>
+					<view class="card-btn sign-btn" @click="opencheckInPopUpWindow()">
+						<template v-if="signInfo.isSigned">已签到</template>
+						<template v-else>立即签到</template>
+					</view>
+				</view>
+			</view>
+			<!-- 星愿打卡区域 -->
+			<!-- <view class="sign-cards" v-if="false">
 				<view class="card purple-card">
 					<view class="card-title">初次见面礼</view>
 					<view class="card-desc">完善个人资料可得</view>
@@ -88,38 +71,37 @@
 				</view>
 			</view> -->
 
-      <!-- 每日任务列表 -->
-      <view class="task-list-box">
-        <view class="task-header">
-          <image src="@/static/me/job/rw_wenzi_02.png"></image>
-          <text class="task-subtitle">(获取免费星源)</text>
-        </view>
+			<!-- 每日任务列表 -->
+			<view class="task-list-box">
+				<view class="task-header">
+					<image src="@/static/me/job/rw_wenzi_02.png"></image>
+					<text class="task-subtitle">(获取免费星源)</text>
+				</view>
 
-        <!-- 任务项列表 -->
-        <view class="task-item" v-for="(item, index) in taskList" :key="index">
-          <view class="task-info">
-            <image :src="item.image"></image>
-            <view>
-              <view class="task-name one-omit">{{ item.name }}</view>
-              <view class="task-desc one-omit">{{ item.content }}</view>
-            </view>
-          </view>
-          <view class="task-reward">
-            <image src="@/static/me/job/wd_icon_xingyuan.png"></image>+{{
+				<!-- 任务项列表 -->
+				<view class="task-item" v-for="(item, index) in taskList" :key="index">
+					<view class="task-info">
+						<image :src="item.image"></image>
+						<view>
+							<view class="task-name one-omit">{{ item.name }}</view>
+							<view class="task-desc one-omit">{{ item.content }}</view>
+						</view>
+					</view>
+					<view class="task-reward">
+						<image src="@/static/me/job/wd_icon_xingyuan.png"></image>+{{
               item.num
             }}
-          </view>
-          <view
-            class="task-btn"
-            :class="{ 'task-completed': item.status == 9 }"
-            @click="claimReward(index)"
-          >
-            {{ item.status == 9 ? "已领取" : "领取" }}
-          </view>
-        </view>
-      </view>
+					</view>
+					<view class="task-btn" :class="{ 'task-completed': item.status == 9 || item.status == 1 }"
+						@click="claimReward(index)">
+						<text v-if="item.status == 1">未完成</text>
+						<text v-if="item.status == 2">领取</text>
+						<text v-if="item.status == 9">已领取</text>
+					</view>
+				</view>
+			</view>
 
-      <!-- 每日任务列表 
+			<!-- 每日任务列表 
 			<view class="task-list">
 				<view class="task-header">
 					<text class="task-title">每日任务</text>
@@ -136,487 +118,457 @@
 					</view>
 				</view>
 			</view>-->
-    </view>
+		</view>
 
-    <!-- 星源兑换弹窗 -->
-    <view class="exchange-popup" v-if="showExchange">
-      <view class="popup-mask" @click="hideExchangePopup"></view>
-      <view class="popup-content">
-        <!-- 弹窗顶部信息栏 -->
-        <view class="popup-header">
-          <text class="available-balance">可用M币: 14500</text>
-          <text class="exchange-title">兑换星源</text>
-        </view>
+		<!-- 星源兑换弹窗 -->
+		<view class="exchange-popup" v-if="showExchange">
+			<view class="popup-mask" @click="hideExchangePopup"></view>
+			<view class="popup-content">
+				<!-- 弹窗顶部信息栏 -->
+				<view class="popup-header">
+					<text class="available-balance">可用M币: 14500</text>
+					<text class="exchange-title">兑换星源</text>
+				</view>
 
-        <!-- 兑换区域主体 -->
-        <view class="exchange-area">
-          <view class="exchange-title-area">
-            <text class="exchange-main-title">M币兑换星源数</text>
-            <text class="exchange-subtitle">兑换星源数必须是10的倍数</text>
-          </view>
+				<!-- 兑换区域主体 -->
+				<view class="exchange-area">
+					<view class="exchange-title-area">
+						<text class="exchange-main-title">M币兑换星源数</text>
+						<text class="exchange-subtitle">兑换星源数必须是10的倍数</text>
+					</view>
 
-          <view class="input-area">
-            <view class="bean-icon"></view>
-            <input
-              type="number"
-              class="exchange-input"
-              placeholder="请输入兑换星源数量"
-              v-model="exchangeAmount"
-            />
-          </view>
+					<view class="input-area">
+						<view class="bean-icon"></view>
+						<input type="number" class="exchange-input" placeholder="请输入兑换星源数量" v-model="exchangeAmount" />
+					</view>
 
-          <!-- 操作按钮 -->
-          <view class="action-area">
-            <view class="exchange-btn-large" @click="confirmExchange"
-              >立即兑换星源</view
-            >
-            <text class="tips-text"
-              >星源可用于创作(生成图片、音乐等AI创作功能)</text
-            >
-          </view>
-        </view>
-      </view>
-    </view>
+					<!-- 操作按钮 -->
+					<view class="action-area">
+						<view class="exchange-btn-large" @click="confirmExchange">立即兑换星源</view>
+						<text class="tips-text">星源可用于创作(生成图片、音乐等AI创作功能)</text>
+					</view>
+				</view>
+			</view>
+		</view>
 
-    <checkInPopUpWindow
-      :checkInDays="6"
-      :signInfo="signInfo"
-      :signNotify="signNotify"
-      @toggleSignNotify="toggleSignNotify"
-      ref="checkInPopUpWindow"
-      @confirmSign="confirmSign()"
-    >
-    </checkInPopUpWindow>
+		<checkInPopUpWindow :checkInDays="6" :signInfo="signInfo" :signNotify="signNotify"
+			@toggleSignNotify="toggleSignNotify" ref="checkInPopUpWindow" @confirmSign="confirmSign()">
+		</checkInPopUpWindow>
 
-    <!-- 提示框 -->
-    <DialogBox ref="DialogBox"></DialogBox>
-    <!-- 兑换m币弹窗-->
-    <view class="NicknamePopUpWindowBox">
-      <NicknamePopup
-        title=""
-        subtitle=""
-        class="NicknamePopUpWindow"
-        ref="NicknamePopUpWindow"
-      >
-        <template slot="heard">
-          <view class="nickname-heard">
-            <view class="available-mCoin"
-              >可用M币:{{ myinfo.num_gmm | formatNumberToK }}</view
-            >
-            <view class="exchange-title">兑换星源</view>
-          </view>
-        </template>
-        <template slot="content">
-          <view class="content-box">
-            <view class="prompt">
-              M币兑换星源数<text>(兑换星源数必须是10的倍数)</text>
-            </view>
-            <view class="input-box">
-              <image src="@/static/me/job/wd_icon_xingyuan.png"></image>
-              <uv-input
-                type="number"
-                class="input"
-                placeholder="请输入昵称"
-                border="none"
-                v-model="exchangeAmount"
-                maxlength="20"
-              ></uv-input>
-            </view>
-            <view class="btn-box" @click="showExchangeConfirm"
-              >立即兑换星源</view
-            >
-            <text class="tips-text"
-              >星源可用于创作(生成图片、音乐等AI创作功能)</text
-            >
-          </view>
-        </template>
-      </NicknamePopup>
-    </view>
-  </view>
+		<!-- 提示框 -->
+		<DialogBox ref="DialogBox"></DialogBox>
+		<!-- 兑换m币弹窗-->
+		<view class="NicknamePopUpWindowBox">
+			<NicknamePopup title="" subtitle="" class="NicknamePopUpWindow" ref="NicknamePopUpWindow">
+				<template slot="heard">
+					<view class="nickname-heard">
+						<view class="available-mCoin">可用M币:{{ myinfo.num_gmm | formatNumberToK }}</view>
+						<view class="exchange-title">兑换星源</view>
+					</view>
+				</template>
+				<template slot="content">
+					<view class="content-box">
+						<view class="prompt">
+							M币兑换星源数<text>(兑换星源数必须是10的倍数)</text>
+						</view>
+						<view class="input-box">
+							<image src="@/static/me/job/wd_icon_xingyuan.png"></image>
+							<uv-input type="number" class="input" placeholder="请输入昵称" border="none"
+								v-model="exchangeAmount" maxlength="20"></uv-input>
+						</view>
+						<view class="btn-box" @click="showExchangeConfirm">立即兑换星源</view>
+						<text class="tips-text">星源可用于创作(生成图片、音乐等AI创作功能)</text>
+					</view>
+				</template>
+			</NicknamePopup>
+		</view>
+	</view>
 </template>
 
 <script>
-import checkInPopUpWindow from "@/components/checkIn-popUp-window/checkIn-popUp-window.vue";
-import DropdownMenu from "@/components/DropdownMenu.vue";
+	import checkInPopUpWindow from "@/components/checkIn-popUp-window/checkIn-popUp-window.vue";
+	import DropdownMenu from "@/components/DropdownMenu.vue";
 
-export default {
-  components: {
-    checkInPopUpWindow,
-    DropdownMenu,
-  },
-  data() {
-    return {
-      title: "任务中心",
-      myinfo: {},
-      realname: "",
-      num_gmd: 0,
-      newer_bfb: "",
-      beanBalance: 2560,
-      showExchange: false,
-      exchangeAmount: "",
-      mCoinBalance: 0,
-      signNotify: true,
-      signRewards: [
-        {
-          dayNum: "01",
-          reward: "10星源",
-          isVip: false,
-        },
-        {
-          dayNum: "02",
-          reward: "15星源",
-          isVip: false,
-        },
-        {
-          dayNum: "03",
-          reward: "20星源",
-          isVip: false,
-        },
-        {
-          dayNum: "04",
-          reward: "25星源",
-          isVip: false,
-        },
-        {
-          dayNum: "05",
-          reward: "30星源",
-          isVip: false,
-        },
-        {
-          dayNum: "06",
-          reward: "35星源",
-          isVip: true,
-        },
-        {
-          dayNum: "07",
-          reward: "50星源",
-          isVip: true,
-        },
-      ],
-      signInfo: {
-        signDay: 1,
-        isSigned: false,
-        reward: 0,
-      },
-      taskList: [],
-      dropdownOptions: [{ label: "星源记录", type: "starSourceRecord" }],
-      isRefreshing: false,
-    };
-  },
-  onPullDownRefresh() {
-    if (this.isRefreshing) return;
+	export default {
+		components: {
+			checkInPopUpWindow,
+			DropdownMenu,
+		},
+		data() {
+			return {
+				title: "任务中心",
+				myinfo: {},
+				realname: "",
+				num_gmd: 0,
+				newer_bfb: "",
+				beanBalance: 2560,
+				showExchange: false,
+				exchangeAmount: "",
+				mCoinBalance: 0,
+				signNotify: true,
+				signRewards: [{
+						dayNum: "01",
+						reward: "10星源",
+						isVip: false,
+					},
+					{
+						dayNum: "02",
+						reward: "15星源",
+						isVip: false,
+					},
+					{
+						dayNum: "03",
+						reward: "20星源",
+						isVip: false,
+					},
+					{
+						dayNum: "04",
+						reward: "25星源",
+						isVip: false,
+					},
+					{
+						dayNum: "05",
+						reward: "30星源",
+						isVip: false,
+					},
+					{
+						dayNum: "06",
+						reward: "35星源",
+						isVip: true,
+					},
+					{
+						dayNum: "07",
+						reward: "50星源",
+						isVip: true,
+					},
+				],
+				signInfo: {
+					signDay: 1,
+					isSigned: false,
+					reward: 0,
+				},
+				taskList: [],
+				dropdownOptions: [{
+					label: "星源记录",
+					type: "starSourceRecord"
+				}],
+				isRefreshing: false,
+			};
+		},
+		onPullDownRefresh() {
+			if (this.isRefreshing) return;
 
-    this.isRefreshing = true;
-    this.refreshData();
-  },
-  onLoad(e) {
-    if (e && e.type == "recharge") {
-      setTimeout(() => {
-        this.openNicknamePopUpWindow();
-      }, 0);
-    }
-    this.loadData();
-    this.getSignInfo();
-  },
-  onShow() {},
-  methods: {
-    opencheckInPopUpWindow() {
-      this.$refs.checkInPopUpWindow.open();
-    },
-    closecheckInPopUpWindow() {
-      this.$refs.checkInPopUpWindow.close();
-    },
-    openNicknamePopUpWindow() {
-      this.$refs.NicknamePopUpWindow.open();
-    },
-    closeNicknamePopUpWindow() {
-      this.$refs.NicknamePopUpWindow.close();
-    },
-    onBack() {},
+			this.isRefreshing = true;
+			this.refreshData();
+		},
+		onLoad(e) {
+			if (e && e.type == "recharge") {
+				setTimeout(() => {
+					this.openNicknamePopUpWindow();
+				}, 0);
+			}
+			this.loadData();
+			this.getSignInfo();
+		},
+		onShow() {},
+		methods: {
+			opencheckInPopUpWindow() {
+				this.$refs.checkInPopUpWindow.open();
+			},
+			closecheckInPopUpWindow() {
+				this.$refs.checkInPopUpWindow.close();
+			},
+			openNicknamePopUpWindow() {
+				this.$refs.NicknamePopUpWindow.open();
+			},
+			closeNicknamePopUpWindow() {
+				this.$refs.NicknamePopUpWindow.close();
+			},
+			onBack() {},
 
-    loadData() {
-      return new Promise((resolve, reject) => {
-        uni.request({
-          url: this.$apiHost + "/Job/getlist",
-          data: {
-            uuid: getApp().globalData.uuid,
-          },
-          header: {
-            "content-type": "application/json",
-            sign: getApp().globalData.headerSign,
-          },
-          success: (res) => {
-            console.log("----:", res.data);
-            this.num_gmd = res.data.num_gmd;
-            this.newer_bfb = res.data.newer_bfb; 
-            this.taskList = res.data.list;
-            resolve(res);
-          },
-          complete: (com) => {
-            // uni.hideLoading();
-          },
-          fail: (e) => {
-            console.log("----e:", e);
-            reject(e);
-          },
-        });
-      });
-    },
+			loadData() {
+				return new Promise((resolve, reject) => {
+					uni.request({
+						url: this.$apiHost + "/Job/getlist",
+						data: {
+							uuid: getApp().globalData.uuid,
+						},
+						header: {
+							"content-type": "application/json",
+							sign: getApp().globalData.headerSign,
+						},
+						success: (res) => {
+							console.log("----:", res.data);
+							this.num_gmd = res.data.num_gmd;
+							this.newer_bfb = res.data.newer_bfb;
+							this.taskList = res.data.list;
+							resolve(res);
+						},
+						complete: (com) => {
+							// uni.hideLoading();
+						},
+						fail: (e) => {
+							console.log("----e:", e);
+							reject(e);
+						},
+					});
+				});
+			},
 
-    getSignInfo() {
-      return new Promise((resolve, reject) => {
-        uni.request({
-          url: this.$apiHost + "/User/sign7Day",
-          data: {
-            uuid: getApp().globalData.uuid,
-            action: "get",
-          },
-          header: {
-            "content-type": "application/json",
-            sign: getApp().globalData.headerSign,
-          },
-          success: (res) => {
-            if (res.data.success === "yes") {
-              this.signInfo = {
-                signDay: res.data.data.sign_day,
-                isSigned: res.data.data.is_signed,
-                reward: res.data.data.reward || 0,
-              };
-            }
-            resolve(res);
-          },
-          fail: (e) => {
-            console.log("获取签到信息失败:", e);
-            reject(e);
-          },
-        });
+			getSignInfo() {
+				return new Promise((resolve, reject) => {
+					uni.request({
+						url: this.$apiHost + "/User/sign7Day",
+						data: {
+							uuid: getApp().globalData.uuid,
+							action: "get",
+						},
+						header: {
+							"content-type": "application/json",
+							sign: getApp().globalData.headerSign,
+						},
+						success: (res) => {
+							if (res.data.success === "yes") {
+								this.signInfo = {
+									signDay: res.data.data.sign_day,
+									isSigned: res.data.data.is_signed,
+									reward: res.data.data.reward || 0,
+								};
+							}
+							resolve(res);
+						},
+						fail: (e) => {
+							console.log("获取签到信息失败:", e);
+							reject(e);
+						},
+					});
 
-        uni.request({
-          url: this.$apiHost + "/User/getinfo",
-          data: {
-            uuid: getApp().globalData.uuid,
-            skey: getApp().globalData.skey,
-          },
-          header: {
-            "content-type": "application/json",
-            sign: getApp().globalData.headerSign,
-          },
-          success: (res) => {
-            this.myinfo = res.data;
-            resolve(res);
-          },
-          complete: (com) => {},
-          fail: (e) => {
-            console.log("----e:", e);
-            reject(e);
-          },
-        });
-      });
-    },
+					uni.request({
+						url: this.$apiHost + "/User/getinfo",
+						data: {
+							uuid: getApp().globalData.uuid,
+							skey: getApp().globalData.skey,
+						},
+						header: {
+							"content-type": "application/json",
+							sign: getApp().globalData.headerSign,
+						},
+						success: (res) => {
+							this.myinfo = res.data;
+							resolve(res);
+						},
+						complete: (com) => {},
+						fail: (e) => {
+							console.log("----e:", e);
+							reject(e);
+						},
+					});
+				});
+			},
 
-    showExchangePopup() {
-      this.showExchange = true;
-    },
+			showExchangePopup() {
+				this.showExchange = true;
+			},
 
-    hideExchangePopup() {
-      this.showExchange = false;
-    },
+			hideExchangePopup() {
+				this.showExchange = false;
+			},
 
-    toggleSignNotify(falg) {
-      this.signNotify = falg;
-    },
+			toggleSignNotify(falg) {
+				this.signNotify = falg;
+			},
 
-    confirmSign(type) {
-      if (this.signInfo.isSigned) {
-        uni.showToast({
-          title: "今日已签到,明天再来吧",
-          icon: "none",
-        });
-        return;
-      }
+			confirmSign(type) {
+				if (this.signInfo.isSigned) {
+					uni.showToast({
+						title: "今日已签到,明天再来吧",
+						icon: "none",
+					});
+					return;
+				}
 
-      uni.request({
-        url: this.$apiHost + "/User/sign7Day",
-        data: {
-          uuid: getApp().globalData.uuid,
-          action: "sign",
-        },
-        header: {
-          "content-type": "application/json",
-          sign: getApp().globalData.headerSign,
-        },
-        success: (res) => {
-          if (res.data.success === "yes") {
-            uni.showToast({
-              title: res.data.str,
-              icon: "none",
-            });
-            this.getSignInfo();
-            this.loadData();
-          } else {
-            uni.showToast({
-              title: res.data.str,
-              icon: "none",
-            });
-          }
-        },
-        fail: (e) => {
-          console.log("签到失败:", e);
-          uni.showToast({
-            title: "签到失败,请稍后重试",
-            icon: "none",
-          });
-        },
-      });
-    },
+				uni.request({
+					url: this.$apiHost + "/User/sign7Day",
+					data: {
+						uuid: getApp().globalData.uuid,
+						action: "sign",
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: (res) => {
+						if (res.data.success === "yes") {
+							uni.showToast({
+								title: res.data.str,
+								icon: "none",
+							});
+							this.getSignInfo();
+							this.loadData();
+						} else {
+							uni.showToast({
+								title: res.data.str,
+								icon: "none",
+							});
+						}
+					},
+					fail: (e) => {
+						console.log("签到失败:", e);
+						uni.showToast({
+							title: "签到失败,请稍后重试",
+							icon: "none",
+						});
+					},
+				});
+			},
 
-    confirmExchange() {
-      if (!this.exchangeAmount) {
-        uni.showToast({
-          title: "请输入兑换数量",
-          icon: "none",
-        });
-        return;
-      }
+			confirmExchange() {
+				if (!this.exchangeAmount) {
+					uni.showToast({
+						title: "请输入兑换数量",
+						icon: "none",
+					});
+					return;
+				}
 
-      const amount = parseInt(this.exchangeAmount);
+				const amount = parseInt(this.exchangeAmount);
 
-      if (isNaN(amount) || amount <= 0) {
-        uni.showToast({
-          title: "请输入有效数量",
-          icon: "none",
-        });
-        return;
-      }
+				if (isNaN(amount) || amount <= 0) {
+					uni.showToast({
+						title: "请输入有效数量",
+						icon: "none",
+					});
+					return;
+				}
 
-      if (amount % 10 !== 0) {
-        uni.showToast({
-          title: "兑换数量必须是10的倍数",
-          icon: "none",
-        });
-        return;
-      }
-      let that = this;
-      uni.request({
-        url: this.$apiHost + "/User/gmmToGMD",
-        data: {
-          uuid: getApp().globalData.uuid,
-          num: amount,
-        },
-        header: {
-          "content-type": "application/json",
-          sign: getApp().globalData.headerSign,
-        },
-        success: (res) => {
-          console.log("----:", res.data);
-          uni.showToast({
-            title: res.data.str,
-            icon: "none",
-          });
-          if (res.data.success == "yes") {
-            this.hideExchangePopup();
-            this.exchangeAmount = "";
-            setTimeout(function () {
-              that.loadData();
-            }, 900);
-          }
-        },
-        complete: (com) => {
-          this.closeNicknamePopUpWindow();
-        },
-        fail: (e) => {
-          console.log("----e:", e);
-        },
-      });
-    },
+				if (amount % 10 !== 0) {
+					uni.showToast({
+						title: "兑换数量必须是10的倍数",
+						icon: "none",
+					});
+					return;
+				}
+				let that = this;
+				uni.request({
+					url: this.$apiHost + "/User/gmmToGMD",
+					data: {
+						uuid: getApp().globalData.uuid,
+						num: amount,
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: (res) => {
+						console.log("----:", res.data);
+						uni.showToast({
+							title: res.data.str,
+							icon: "none",
+						});
+						if (res.data.success == "yes") {
+							this.hideExchangePopup();
+							this.exchangeAmount = "";
+							setTimeout(function() {
+								that.loadData();
+							}, 900);
+						}
+					},
+					complete: (com) => {
+						this.closeNicknamePopUpWindow();
+					},
+					fail: (e) => {
+						console.log("----e:", e);
+					},
+				});
+			},
 
-    claimReward(index) {
-      if (this.taskList[index].status == 9) {
-        uni.showToast({
-          title: "已领取该奖励",
-          icon: "none",
-        });
-        return;
-      }
-      let that = this;
-      uni.request({
-        url: this.$apiHost + "/Job/doAct",
-        data: {
-          uuid: getApp().globalData.uuid,
-          id: this.taskList[index].id,
-        },
-        header: {
-          "content-type": "application/json",
-          sign: getApp().globalData.headerSign,
-        },
-        success: (res) => {
-          console.log("----:", res.data);
-          if (res.data.success == "yes") {
-            uni.showToast({
-              title: res.data.str,
-              icon: "none",
-            });
-            setTimeout(function () {
-              that.loadData();
-            }, 900);
-          }
-        },
-        complete: (com) => {
-          // uni.hideLoading();
-        },
-        fail: (e) => {
-          console.log("----e:", e);
-        },
-      });
-    },
+			claimReward(index) {
+				if (this.taskList[index].status == 9) {
+					uni.showToast({
+						title: "已领取该奖励",
+						icon: "none",
+					});
+					return;
+				}
+				let that = this;
+				uni.request({
+					url: this.$apiHost + "/Job/doAct",
+					data: {
+						uuid: getApp().globalData.uuid,
+						id: this.taskList[index].id,
+					},
+					header: {
+						"content-type": "application/json",
+						sign: getApp().globalData.headerSign,
+					},
+					success: (res) => {
+						console.log("----:", res.data);
+						if (res.data.success == "yes") {
+							uni.showToast({
+								title: res.data.str,
+								icon: "none",
+							});
+							setTimeout(function() {
+								that.loadData();
+							}, 900);
+						}
+					},
+					complete: (com) => {
+						// uni.hideLoading();
+					},
+					fail: (e) => {
+						console.log("----e:", e);
+					},
+				});
+			},
 
-    handleDropdownSelect(item) {
-      switch (item.type) {
-        case "starSourceRecord":
-          uni.navigateTo({
-            url: "/pages/vip/record?type=star",
-          });
-          break;
-      }
-    },
+			handleDropdownSelect(item) {
+				switch (item.type) {
+					case "starSourceRecord":
+						uni.navigateTo({
+							url: "/pages/vip/record?type=star",
+						});
+						break;
+				}
+			},
 
-    showExchangeConfirm() {
-      this.$refs["DialogBox"]
-        .confirm({
-          title: "确认兑换",
-          content: "确定要兑换" + this.exchangeAmount + "星源吗?",
-          DialogType: "inquiry",
-          btn1: "再考虑一下",
-          btn2: "确认兑换",
-          animation: 0,
-        })
-        .then((res) => {
-          if (res.confirm) {
-            this.confirmExchange();
-          }
-        });
-    },
+			showExchangeConfirm() {
+				this.$refs["DialogBox"]
+					.confirm({
+						title: "确认兑换",
+						content: "确定要兑换" + this.exchangeAmount + "星源吗?",
+						DialogType: "inquiry",
+						btn1: "再考虑一下",
+						btn2: "确认兑换",
+						animation: 0,
+					})
+					.then((res) => {
+						if (res.confirm) {
+							this.confirmExchange();
+						}
+					});
+			},
 
-    refreshData() {
-      Promise.all([this.loadData(), this.getSignInfo()])
-        .then(() => {
-          this.isRefreshing = false;
-          uni.stopPullDownRefresh();
-        })
-        .catch(() => {
-          this.isRefreshing = false;
-          uni.stopPullDownRefresh();
-        });
-    },
-    goPage(page) {
-      uni.navigateTo({
-        url: page,
-      });
-    },
-  },
-};
+			refreshData() {
+				Promise.all([this.loadData(), this.getSignInfo()])
+					.then(() => {
+						this.isRefreshing = false;
+						uni.stopPullDownRefresh();
+					})
+					.catch(() => {
+						this.isRefreshing = false;
+						uni.stopPullDownRefresh();
+					});
+			},
+			goPage(page) {
+				uni.navigateTo({
+					url: page,
+				});
+			},
+		},
+	};
 </script>
 
 <style scoped lang="scss">
-@import "job.scss";
+	@import "job.scss";
 </style>

BIN
static/island/huatian/btn_bozong.png


BIN
static/island/huatian/btn_cucao.png


BIN
static/island/huatian/btn_jiesuo.png


BIN
static/island/huatian/btn_souhuo.png


BIN
static/island/huatian/btn_task.png


BIN
static/island/huatian/btn_task_day.png


BIN
static/island/huatian/jiantou.png


BIN
static/island/huatian/souhuo.png


BIN
static/island/huatian/timer.png


BIN
static/island/huatian/zx_btn_queren.png


BIN
static/island/huatian/zx_btn_quxiao.png


BIN
static/tabbar-icon/原/center.png


BIN
static/tabbar-icon/原/index.png


BIN
static/tabbar-icon/原/indexActive.png


BIN
static/tabbar-icon/原/make.png


BIN
static/tabbar-icon/原/makeActive.png


BIN
static/tabbar-icon/原/message.png


BIN
static/tabbar-icon/原/messageActive.png


BIN
static/tabbar-icon/原/mine.png


BIN
static/tabbar-icon/原/mineActive.png