Commit 25ab5c4d by 陈玉桐

add 首页 新手引导

parent 7ef7133f
......@@ -400,6 +400,9 @@ Page({
totalTrainingDays: '',//训练成就天数
lastVision: '',//训练成就旧视力
nowVision: '',//训练成就新视力
guideStatus: '',//是否进行过新手引导 1:已经引导过 0:未引导过
guideId: 1,//引导顺序
},
onReady() {
},
......@@ -476,6 +479,7 @@ Page({
me.setData({
imgUrls: res.data.data.focusMap,
bindDeviceStatus: res.data.data.bindDeviceStatus,
guideStatus: res.data.data.guideStatus,
teenageName: res.data.data.teenageList[0].name,
gender: res.data.data.teenageList[0].gender,
age: res.data.data.teenageList[0].age,
......@@ -782,4 +786,60 @@ Page({
url: '/pages/plan/plan'
})
},
guide() {
this.setData({
guideId: this.data.guideId+1
})
console.log(this.data.guideId)
if(this.data.guideId==1 || this.data.guideId==2){//1,2
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
} else if(this.data.guideId==3){//3
wx.pageScrollTo({
scrollTop: 150,
duration: 0
})
} else if(this.data.guideId==4){//4
wx.pageScrollTo({
scrollTop: 250,
duration: 0
})
} else if(this.data.guideId==5){//5
wx.pageScrollTo({
scrollTop: 888,
duration: 0
})
}else{
wx.pageScrollTo({
scrollTop: 0,
duration: 0
})
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'users/guide',
method: 'POST',
data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
}
},
})
\ No newline at end of file
......@@ -267,6 +267,13 @@
</view>
</view>
</view>
<cover-view id="guide" wx:if="{{guideStatus==0}}" hidden="{{guideId>5}}" catchtouchmove="preventTouchMove" bindtap="guide">
<cover-image id="guide1" hidden="{{guideId!=1}}" src="../../assets/guide1.png"></cover-image>
<cover-image id="guide2" hidden="{{guideId!=2}}" src="../../assets/guide2.png"></cover-image>
<cover-image id="guide3" hidden="{{guideId!=3}}" src="../../assets/guide3.png"></cover-image>
<cover-image id="guide4" hidden="{{guideId!=4}}" src="../../assets/guide4.png"></cover-image>
<cover-image id="guide5" hidden="{{guideId!=5}}" src="../../assets/guide5.png"></cover-image>
</cover-view>
</view>
<wxs module="we">
......
......@@ -607,3 +607,49 @@
#lastGoBtn{
border-right: 2rpx solid #E5E5E5;
}
#guide{
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.6);
width: 100%;
height: 100%;
z-index: 9999;
}
#guide1{
position: absolute;
top: 320rpx;
left: 0;
width: 100%;
height: 387rpx;
}
#guide2{
position: absolute;
top: 338rpx;
left: 0;
width: 100%;
height: 432rpx;
}
#guide3{
position: absolute;
top: 320rpx;
left: 0;
width: 100%;
height: 524rpx;
}
#guide4{
position: absolute;
top: 405rpx;
left: 0;
width: 100%;
height: 359rpx;
}
#guide5{
position: absolute;
top: 405rpx;
left: 0;
width: 100%;
height: 416rpx;
}
\ No newline at end of file
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