@@ -14,8 +14,7 @@ Page({ | |||
taskImgUrl:'https://www.jiyou-tech.com/2020/496_qichen/static/star/everyday/taskImg1.png', | |||
isSign:true, | |||
isShare:false, | |||
picturlName:[], | |||
picturlList: ['picturePuzzle1', 'picturePuzzle1'], | |||
picturlList: [], | |||
picturlCurrent:0, | |||
isRegister:false,//是否已注册 | |||
shareId:null, | |||
@@ -104,7 +103,7 @@ Page({ | |||
loadFun: function () { | |||
this.getTaskProgress(); | |||
this.getOrderInfo(); | |||
this.getShareId(); | |||
// this.getShareId(); | |||
if (this.data.isFriendShare) { | |||
this.useShareId(); | |||
} | |||
@@ -164,11 +163,8 @@ Page({ | |||
getTaskProgress: function () {//获取任务完成度 | |||
app.wxRequest(app.globalData.urlRoot + "task/getTaskProgress", { taskType: 1 }, res => { | |||
if (res.code == 200) { | |||
for(let i=0;i<res.data.length;i++){ | |||
this.data.picturlName.push(res.data[i].taskName); | |||
} | |||
this.setData({ | |||
picturlName: this.data.picturlName | |||
picturlList: res.data | |||
}) | |||
} else { | |||
wx.showToast({ | |||
@@ -242,5 +238,12 @@ Page({ | |||
maskShow:false | |||
}) | |||
}, this,"POST") | |||
}, | |||
swiperChange(e) {//通过鼠标滑动改变swiper时 | |||
if (e.detail.source == "touch") { | |||
this.setData({ | |||
picturlCurrent: e.detail.current, | |||
}) | |||
} | |||
} | |||
}) |
@@ -5,17 +5,22 @@ | |||
<view class="title">集碎片,攒红包</view> | |||
<view class="menuBox"> | |||
<image class="menu" src="{{imgUrl+'/star/everyday/menu.png'}}"></image> | |||
<view class="leftTitle">{{picturlName[picturlCurrent-1]}}</view> | |||
<!-- <view class="centerTitle">{{picturlName[picturlCurrent]}}</view> --> | |||
<view class="centerTitle">V-Galaxy星空家族前脸</view> | |||
<view class="rightTitle">{{picturlName[picturlCurrent+1]}}</view> | |||
<view class="leftTitle"></view> | |||
<view class="centerTitle">{{picturlList[picturlCurrent]['fullName']}}</view> | |||
<view class="rightTitle"></view> | |||
</view> | |||
<view class="swiperBox"> | |||
<swiper current="{{picturlCurrent}}"> | |||
<swiper current="{{picturlCurrent}}" bindchange="swiperChange"> | |||
<block wx:for="{{picturlList}}" wx:key="index"> | |||
<swiper-item> | |||
<view class="fragmentBox"> | |||
<image class="fragmentComplete" src="{{imgUrl+'/star/everyday/'+item+'.png'}}"></image> | |||
<view class="fragmentBox" wx:if="{{!item.fullPicUrl}}"> | |||
<image class="fragmentComplete1" src="{{item.childIdArr['picArr'][0]}}"></image> | |||
<image class="fragmentComplete2" src="{{item.childIdArr['picArr'][1]}}"></image> | |||
<image class="fragmentComplete3" src="{{item.childIdArr['picArr'][2]}}"></image> | |||
<image class="fragmentComplete4" src="{{item.childIdArr['picArr'][3]}}"></image> | |||
</view> | |||
<view class="fragmentBox" wx:if="{{item.fullPicUrl}}"> | |||
<image class="fragmentComplete" src="{{item.fullPicUrl}}"></image> | |||
</view> | |||
</swiper-item> | |||
</block> | |||
@@ -23,11 +28,11 @@ | |||
<image class="arrowBtn" style="left:-30rpx;" src="{{imgUrl+'/star/everyday/arrowLeftBtn.png'}}" bindtap="prevPicturl"></image> | |||
<image class="arrowBtn" style="right:-30rpx;" src="{{imgUrl+'/star/everyday/arrowRightBtn.png'}}" bindtap="nextPicturl"></image> | |||
</view> | |||
<!-- <view class="btnBox"> | |||
<view class="btnBox" wx:if="{{!picturlList[picturlCurrent]['fullPicUrl']}}"> | |||
<view class="btn" style="margin-right:20rpx;" bindtap="goScout">星探任务</view> | |||
<view class="btn select" style="margin-left:20rpx;">每日任务</view> | |||
</view> --> | |||
<view class="btnBox" style="width:677rpx;"> | |||
</view> | |||
<view class="btnBox" style="width:677rpx;" wx:if="{{picturlList[picturlCurrent]['fullPicUrl']}}"> | |||
<view class="receive" bindtap="receive">领取购车红包</view> | |||
</view> | |||
<view class="mask" wx:if="{{maskShow}}"> |
@@ -96,7 +96,34 @@ | |||
height: 100%; | |||
border-radius: 26rpx; | |||
} | |||
.fragmentBox>.fragmentComplete{ | |||
.fragmentComplete1,.fragmentComplete2,.fragmentComplete3,.fragmentComplete4{ | |||
position: absolute; | |||
} | |||
.fragmentComplete1{ | |||
left: 0; | |||
top: 0; | |||
width: 396rpx; | |||
height: 237rpx; | |||
} | |||
.fragmentComplete2{ | |||
right: 0; | |||
top: 0; | |||
width: 298rpx; | |||
height: 308rpx; | |||
} | |||
.fragmentComplete3{ | |||
left: 0; | |||
bottom: 0; | |||
width: 322rpx; | |||
height: 264rpx; | |||
} | |||
.fragmentComplete4{ | |||
right: 0; | |||
bottom: 0; | |||
width: 298rpx; | |||
height: 193rpx; | |||
} | |||
.fragmentComplete{ | |||
width: 100%; | |||
height: 100%; | |||
} |
@@ -395,6 +395,15 @@ Page({ | |||
getTaskProgress: function () {//获取任务完成度 1每日任务 | |||
app.wxRequest(app.globalData.urlRoot + "task/getTaskProgress", { taskType: this.data.taskNow},res=>{ | |||
if(res.code==200){ | |||
for (let i = 0; i < res.data.length; i++) { | |||
res.data[i]['unlockNum']=0; | |||
for (let j = 0; j < res.data[i].childIdArr['lockArr'].length; j++) { | |||
if (res.data[i].childIdArr['lockArr'][j]) { | |||
res.data[i]['unlockNum'] += 1; | |||
} | |||
} | |||
} | |||
console.log(res.data); | |||
this.setData({ | |||
taskList:res.data | |||
}) |
@@ -69,10 +69,10 @@ | |||
</view> | |||
<view class="taskDetailFrame"> | |||
<view class="taskDetailGroup" wx:for="{{taskList}}" wx:key="id"> | |||
<view class="taskName">{{item.taskName}}</view> | |||
<view class="taskName">{{item.fullName}}</view> | |||
<view style="margin-top:12rpx;"> | |||
<view class="taskLineFrame"> | |||
<view class="taskLine" style="width:{{(item.childIdArr.length*25)+'%'}}"></view> | |||
<view class="taskLine" style="width:{{(item.unlockNum*25)+'%'}}"></view> | |||
</view> | |||
<view class="taskSignGroup"> | |||
<image class="taskSignIcon" src="{{imgUrl+'/images/taskSignIcon.png'}}"></image> | |||
@@ -81,8 +81,8 @@ | |||
<image class="taskSignIcon" src="{{imgUrl+'/images/taskSignIcon.png'}}"></image> | |||
</view> | |||
</view> | |||
<view wx:if="{{item.childIdArr.length==4}}" class="taskSuccessBtn">已完成</view> | |||
<view wx:if="{{item.childIdArr.length!=4}}" class="taskWaitBtn">未完成</view> | |||
<view wx:if="{{item.unlockNum==4}}" class="taskSuccessBtn">已完成</view> | |||
<view wx:if="{{item.unlockNum!=4}}" class="taskWaitBtn">未完成</view> | |||
</view> | |||
</view> | |||
</view> |