Ver código fonte

样式修复

duanshenglang 5 meses atrás
pai
commit
5306063539
1 arquivos alterados com 54 adições e 18 exclusões
  1. 54 18
      lottery/index.html

+ 54 - 18
lottery/index.html

@@ -2,7 +2,7 @@
 <html>
 <head>
 		<meta charset="utf-8">
-		<title></title>
+		<title>活动</title>
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 		<link href="css/mui.css" rel="stylesheet" />
 		<link href="css/mui.picker.css" rel="stylesheet" />
@@ -721,6 +721,14 @@
 		padding: 0 35rem;
 		width: 100%;
 		margin: 0;
+		font-size: 14rem;
+	}
+	.textarea_placeHolder {
+		color: #999999;
+		font-size: 14rem;
+		padding: 0 35rem;
+		position: absolute;
+		top: 42rem;
 	}
 	.photo-btn {
 		width: 80rem;
@@ -766,6 +774,9 @@
 		margin-right: 35rem;
 		color: #999;
 	}
+	input {
+		font-size: 14rem;
+	}
 </style>
 <body>
 	<div id="collectPage">
@@ -792,7 +803,10 @@
 			<div class="dialog-body">
 				<div class="text_bg">
 					<img class="close-text" id="closeText" src="./img/close-text.png" mode="widthFix" />
-					<textarea class="textarea_style" id="textarea" placeHolder="说出您和宝骏汽车的故事,为宝骏云海新车上市送上祝福"></textarea>
+					<div style="position: relative;">
+						<textarea class="textarea_style" id="textarea"></textarea>
+						<div class="textarea_placeHolder" id="textareaPlaceHolder">说出您和宝骏汽车的故事,为宝骏云海新车上市送上祝福</div>
+					</div>
 					<div class="img_list">
 						<div id="imageGallery" class="imageGallery">
 							<img class="photo-btn" id="photoBtn" src="./img/photo-btn.png" mode="widthFix" onclick="uploadImage()" />
@@ -1108,6 +1122,8 @@
 					success:function(res){
 						if (res.data) {
 							window.location.replace(res.data)
+						} else {
+							mui.toast(res.msg);
 						}
 					},
 					error:function(error){
@@ -1181,9 +1197,13 @@
 				dataType:'json',//服务器返回json格式数据
 				type:'get',//HTTP请求类型
 				success:function(res){
-					itemList = res.data||[]
-					itemIndex = 0
-					onShowItem()
+					if (res.code == 1) {
+						itemList = res.data||[]
+						itemIndex = 0
+						onShowItem()
+					} else {
+						mui.toast(res.msg);
+					}
 				},
 				error:function(error){
 					//异常处理;
@@ -1258,6 +1278,14 @@
 			document.getElementById("textarea").value = "";
 			onShowItem()
 		});
+		document.getElementById('textarea').addEventListener('focus', function() {
+			document.getElementById('textareaPlaceHolder').innerHTML = '';
+		});
+		document.getElementById('textarea').addEventListener('blur', function() {
+			if(document.getElementById('textarea').value == ''){
+				document.getElementById('textareaPlaceHolder').innerHTML = '说出您和宝骏汽车的故事,为宝骏云海新车上市送上祝福';
+			}
+		});
 		// 截取url中的数据
 		function getQueryParam(paramName) {
 			// 获取当前URL的查询字符串部分  
@@ -1318,6 +1346,7 @@
 				dataType:'json',//服务器返回json格式数据
 				type:'get',//HTTP请求类型
 				success:function(res){
+					if (res.code === 1) {
 						lotteryStatus = res.data.status
 						gridList = res.data.prizes
 						document.getElementById("tab1").innerHTML = res.data.activityInfo
@@ -1354,6 +1383,9 @@
 					    buttons.addEventListener('click', function() {
 							handleLottery();
 						})
+					} else {
+						mui.toast(res.msg);
+					}
 				},
 				error:function(error){
 					//异常处理;
@@ -1460,19 +1492,23 @@
 				type:'post',//HTTP请求类型
 				headers:{'Content-Type':'application/json'},
 				success:function(res){
-					const recordList = document.getElementById('recordList');
-					recordList.innerHTML = ''
-					res.data.records.forEach(record => {
-						recordList.innerHTML += `
-						<div class="record-item">
-							<img class="prize-img" src="${record.img}" mode="widthFix" />
-							<div>
-								<div class="prize-name">${record.name}</div>
-								<div class="prize-time">${timeFormat(record.raffleTime)}</div>
-							</div>
-							<button id="toggleButton" ${(record.status==-1 || record.status==1) ? 'disabled' : ''} class="get-btn" onclick="handleOpenForm(${record.id})">${record.status==1 ? '已领取' : (record.status==-1 ? '审核中' : '领取')}</button>
-						</div>`
-					});
+					if (res.code === 1) {
+						const recordList = document.getElementById('recordList');
+						recordList.innerHTML = ''
+						res.data.records.forEach(record => {
+							recordList.innerHTML += `
+							<div class="record-item">
+								<img class="prize-img" src="${record.img}" mode="widthFix" />
+								<div>
+									<div class="prize-name">${record.name}</div>
+									<div class="prize-time">${timeFormat(record.raffleTime)}</div>
+								</div>
+								<button id="toggleButton" ${(record.status==-1 || record.status==1) ? 'disabled' : ''} class="get-btn" onclick="handleOpenForm(${record.id})">${record.status==1 ? '已领取' : (record.status==-1 ? '审核中' : '领取')}</button>
+							</div>`
+						});
+					} else {
+						mui.toast(res.msg);
+					}
 				},
 				error:function(error){
 					//异常处理