Commit 4c50937b authored by 华国豪's avatar 华国豪 🙄

合并代码

parents 550d930e fc0633a7
#qiandaoBox .monthDiv{
margin-top: 0.5rem;
width: 100%;
height: 19rem;
position: relative;
}
#qiandaoBox .bottomDiv{
width: 80%;
margin: 1rem auto;
text-align: center;
}
#qiandaoBox .qiandaoBtn img{
width: 100%;
}
#qiandaoBox .bottomDiv .white{
color: #fff;
font-size: 1.1rem;
}
#qiandaoBox .bottomDiv .orange{
color: #FF8400;
font-size: 1.5rem;
margin:0 0.5rem;
}
#qiandaoBox .monthDiv .monthItem{
display: inline-block;
width: 12%;
height: 2.5rem;
margin-right:0.7%;
background: #FF8400;
position: relative;
text-align: center;
color: #fff;
margin-top: 0.8rem;
}
#qiandaoBox .monthDiv .monthItem .monthtop{
width: 100%;
height: 60%;
padding-top: 4%;
box-sizing: border-box;
}
#qiandaoBox .monthDiv .monthItem .monthbottom{
width: 100%;
height: 40%;
font-size: 0.5rem;
}
#qiandaoBox .monthDiv .monthItem .monthtop .wjx{
width: 50%;
}
#qiandaoBox .monthDiv .monthItem .grey{
background: #cccccc;
}
#qiandaoBox .monthDiv .monthItem .qiandaoImg{
position: absolute;
width: 0.8rem;
height: 0.8rem;
top: -0.2rem;
right: -0.2rem;
}
#qiandaoBox .monthDiv .monthItem .orange{
background: #FFF5B9;
}
#qiandaoBox .closeImg{
position: absolute;
top:2.5rem;
right: 1rem;
width: 3rem;
height: 3rem;
}
#wodeduihuanBox .myDuiBox{
width: 100%;
height: 29rem;
overflow: scroll;
}
#wodeduihuanBox .wodeduihuanBox_bg{
position: relative;
}
#wodeduihuanBox .wodeduihuanBox_bg .duihuan{
top:4.2rem;
right: -1rem;
width: 3rem;
height: 3rem;
position: absolute;
}
#wodeduihuanBox .duiItem{
width: 24.5%;
background: url('../images/task/ass/bg.png');
background-size: 100% 100%;
height: 7rem;
padding:1rem 0rem;
box-sizing: border-box;
position: relative;
overflow: hidden;
float: left;
}
#wodeduihuanBox .duiItem .imgDiv{
width: 100%;
height: 70%;
text-align: center;
}
#wodeduihuanBox .duiItem .imgDiv img{
height: 100%;
}
#wodeduihuanBox .duiItem .spanDiv{
background: #FF8400;
color: #fff;
border-radius:16px;
font-size: 0.8rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
width: 75%;
margin:0 auto;
padding:0.1rem 0.5rem;
box-sizing: border-box;
margin-top: 2%;
}
#wodeduihuanBox .duiItem .cpnum{
position: absolute;
top: 0;
right: 0;
background: #FF5656;
width: 1.5rem;
height: 1.5rem;
border-radius: 50%;
color: #fff;
text-align: center;
}
#wodeduihuanBox{
position: fixed;
}
\ No newline at end of file
......@@ -407,11 +407,21 @@ img{
padding: 11rem 6rem 9rem 3rem;
width: 85%;
height: 39.15rem;
margin-left: 2rem;
margin-left: 4rem;
background: url("../images/task/ass/qiandao_bg.png");
background-size: 100% 100%;
position: relative;
}
/* 兑换 */
.wodeduihuanBox_bg{
padding: 8rem 1.5rem 2rem 1.5rem;
width: 90%;
height: 39.15rem;
margin-left: 1.5rem;
background: url("../images/task/ass/duihuan.png");
background-size: 100% 100%;
position: relative;
}
#qiandaoBox .qiandaoBox_close{
position: absolute;
right: 1rem;
......
......@@ -16,6 +16,7 @@
<title>暑期活动</title>
<link rel="shortcut icon" href="../../images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="../../css/task.css">
<link rel="stylesheet" href="../../css/qiandao.css">
<link rel="stylesheet" href="../../css/bts/bootstrap.min.css">
<link rel="stylesheet" href="../../css/cssReset.css">
</head>
......@@ -206,7 +207,18 @@
<!-- 签到 -->
<div id="qiandaoBox" class="none">
<div class="qiandaoBox_bg">
<img onclick="CloseqiandaoBox('qiandaoBox')" class="closeImg" src="../../images/task/ass/close3.png" alt="">
<div class="monthDiv">
</div>
<div class="bottomDiv">
<div>
<img style="width:1rem;height: 1rem" src="../../images/task/ass/circle.png"></img>
<span class="white">本月已累计签到<span class="orange">8</span></span>
<img style="width:1rem;height: 1rem" src="../../images/task/ass/circle.png"></img></div>
<div class="qiandaoBtn" onclick="setSignTask()">
<img src="../../images/task/ass/qiandao_btn.png"></img>
</div>
</div>
</div>
</div>
<!-- 商城 -->
......@@ -224,7 +236,19 @@
<!-- 兑换 -->
<div id="wodeduihuanBox" class="none">
<div class="wodeduihuanBox_bg">
<img onclick="CloseqiandaoBox('wodeduihuanBox')" class="duihuan" src="../../images//task//ass/close4.png" alt="">
<div class="myDuiBox">
<!-- <div class="duiItem">
<div class="cpnum">x2</div>
<div class="imgDiv">
<img src="../../images/task/ass/bql_02.png" alt="">
</div>
<div class="spanDiv">
<span>空气进化器</span>
</div>
</div> -->
</div>
</div>
</div>
<div id="tips" class="none">
......@@ -237,6 +261,7 @@
<script type="text/javascript" src="../../js/awardRotate.js"></script>
<script type="text/javascript" src="../../js/bts/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/autosize.js"></script>
<script type="text/javascript" src="../../js/qiandao.js"></script>
<script>
let TaskHistory = [], IceList = [], UserMaterials = [],
userIceList = [], activityId = 1, customerId = 1549,
......
var url = getApiUrl().urlJava;
var dayList=[],TaskHistory=[],activityId = 1, customerId = 1549, taskId = 26;
let date = new Date();
let newDate = date.getFullYear()+"-"+((date.getMonth()+1) < 9 ? '0' + (date.getMonth()+1) : date.getMonth()+1) + "-" + (date.getDate() < 9 ? '0' + date.getDate() : date.getDate() );
let Year=date.getFullYear();
let Month=date.getMonth()+1;
let daynum=mGetDate(Year,Month)
let qiandaonum=0;
getQiandao();
getActivityGoods();
// 获取签到记录
function getQiandao(){
let msg = {
activityId: activityId,
customerId: customerId,
taskId: taskId
}
$.ajax({
type: "POST",
url: `${url}api/mactivity/getTaskHistory`,
contentType: "application/json",
data: getJavaData(msg),
async: false,
success: function (res) {
if (res.resultCode === 1) {
TaskHistory = res.data;
dayList=[];
for(let i=1;i<=daynum;i++){
let obj={
taskDate:Year+"-"+((Month<10)?'0'+Month:Month)+"-"+((i<10)?'0'+i:i),
day:i
}
dayList.push(obj);
}
dayList.forEach(day=>{
day.comday=false;
if(CompareDate(day.taskDate,newDate)){
day.comday=true;
}
TaskHistory.forEach(x=>{
if(day.taskDate==x.taskDate){
day.amount=x.amount;
day.awardMaterials=x.awardMaterials;
day.finishTime=x.finishTime;
day.materialId=x.materialId;
day.taskId=x.taskId;
day.taskStatus=x.taskStatus;
}
})
})
let dayitem="";
qiandaonum=0;
dayList.forEach(item=>{
if(item.taskStatus==1){
qiandaonum=qiandaonum+1;
}
// 今天之前
if(!item.comday){
// 已经签到
if(item.taskStatus&&item.taskStatus==1){
dayitem+=`
<div class="monthItem">
<div class="monthtop grey">
<img class="qiandaoImg" src="../../images/task/ass/xuan.png" alt="">
<img class="wjx" src="../../images/task/ass/wjx1.png" alt="">
</div>
<div class="monthbottom">${item.day}</div>
</div>
`;
}else{
dayitem+=`
<div class="monthItem">
<div class="monthtop grey">
<img class="wjx" src="../../images/task/ass/wjx1.png" alt="">
</div>
<div class="monthbottom">${item.day}</div>
</div>
`;
}
}else{
// 今天之后包括今天(今天已经签到)
if(item.taskStatus&&item.taskStatus==1){
dayitem+=`
<div class="monthItem">
<div class="monthtop grey">
<img class="qiandaoImg" src="../../images/task/ass/xuan.png" alt="">
<img class="wjx" src="../../images/task/ass/wjx1.png" alt="">
</div>
<div class="monthbottom">${item.day}</div>
</div>
`;
}else{
dayitem+=`
<div class="monthItem">
<div class="monthtop orange">
<img class="wjx" src="../../images/task/ass/wjx2.png" alt="">
</div>
<div class="monthbottom">${item.day}</div>
</div>
`
}
}
})
$('.monthDiv').html(dayitem)
$('.bottomDiv .orange').html(qiandaonum)
}
},
error: function (res) {
}
})
}
function mGetDate(year, month){
var d = new Date(year, month, 0);
return d.getDate();
}
function CompareDate(date1, date2){
var oDate1 = new Date(date1);
var oDate2 = new Date(date2);
if (oDate1.getTime() >= oDate2.getTime()) {
return true;
} else {
return false;
}
}
// 点击我要签到
function setSignTask(){
$.ajax({
type: "POST",
url: `${url}api/mactivity/setSignTask`,
contentType: "application/json",
data: getJavaData(),
async: false,
success: function (res) {
if (res.resultCode === 1) {
if (res.award === null) {
showTips("您今天已经签过到了!")
} else {
getQiandao()
}
}
},
error: function (res) {
}
})
}
function CloseqiandaoBox(id){
$('#'+id).hide()
$('#'+id).css('display', 'none')
}
// 商品兑换
function getActivityGoods(){
let msg = {
activityId: activityId
}
$.ajax({
type: "POST",
url: `${url}api/mactivity/getUserActivityGoods`,
contentType: "application/json",
data: getJavaData(msg),
async: false,
success: function (res) {
let list=res.data;
if (res.resultCode === 1) {
let goods="";
for(let i=0;i<list.length;i++){
goods+=`
<div class="duiItem">
<div class="cpnum">x${list[i].buyNum}</div>
<div class="imgDiv">
<img src="${list[i].imgs}" alt="">
</div>
<div class="spanDiv">
<span>${list[i].name}</span>
</div>
</div>
`;
}
$('.myDuiBox').html(goods)
}
},
error: function (res) {
}
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment