Преглед изворни кода

[首次登录][增加]:[首次登录获得成长值]

tags/湖南版5.1.4
meo пре 6 година
родитељ
комит
a986630ef2
4 измењених фајлова са 67 додато и 16 уклоњено
  1. +1
    -6
      pages/index/index.js
  2. +27
    -10
      pages/main/index.js
  3. +6
    -0
      pages/main/index.wxml
  4. +33
    -0
      pages/main/index.wxss

+ 1
- 6
pages/index/index.js Прегледај датотеку

@@ -189,12 +189,7 @@ Page({
app.globalData.token = res.data.token;
if (res.data && res.data.score) {
if (res.data.score != 0){
}else{
wx.showToast({
title: '获得' + res.data.score+'成长值',
duration:2000,
icon:"none"
})
app.globalData.score=res.data.score;
}
}
Http.setToken(res.data.token);


+ 27
- 10
pages/main/index.js Прегледај датотеку

@@ -30,6 +30,8 @@ Page({
market: app.globalData.market,
list: [],
loading: true,
fistLogin:null,
alphaData: null,
swiperCurrent: 0,
title: null,
desc: null,
@@ -54,6 +56,11 @@ Page({
showIf:false
})
},
alphaClick: function (even) {
var animation = wx.createAnimation({})
animation.opacity(0).step({ duration: 2000 })
this.setData({ alphaData: animation.export() })
},
// 我的卡包
mycard:function(){
wx.navigateTo({
@@ -233,8 +240,6 @@ Page({
onLoad: function(options) {
let that = this;
let optionss = JSON.parse(wx.getStorageSync('options'));
console.log(optionss);
console.log("-------------------------------------------optionssss------------------------------------")
if (options.played == "true") {
that.setData({
played: true
@@ -252,7 +257,8 @@ Page({
// util.barcode("barcode", optionss.quancode, 510, 100);
},
onShow: function() {
this.setData({
let that = this;
that.setData({
havePlayEd: app.globalData.havePlayEd ? app.globalData.havePlayEd : false
})
let num = wx.getStorageSync('couponNum');
@@ -261,14 +267,14 @@ Page({
wx.showTabBarRedDot({
index: 2
})
this.setData({
that.setData({
display: "block"
})
}else{
wx.hideTabBarRedDot({
index: 2
})
this.setData({
that.setData({
display: "none"
})
}
@@ -276,17 +282,27 @@ Page({
wx.showTabBarRedDot({
index: 2
})
this.setData({
that.setData({
display1: "block"
})
} else {
wx.hideTabBarRedDot({
index: 2
})
this.setData({
that.setData({
display1: "none"
})
}
console.log(app.globalData.score)
if (app.globalData.score){
that.setData({
fistLogin: app.globalData.score
})
}
// 如果有游戏
setTimeout(function(){
that.alphaClick();
},8000)
},
// 会员码获取
getmemberId: function(token) {
@@ -426,7 +442,7 @@ Page({
}).then(res => {
if (res.data.id) {
_this.setData({
showGame: true
showGame: true,
})
}else{
_this.setData({
@@ -441,6 +457,7 @@ Page({
_this.setData({
showGame: false
})
this.alphaClick();
})
},
/**
@@ -455,14 +472,14 @@ Page({
pageSize: 7
}
}).then(res => {
that.getmemberId(app.globalData.token);
// that.getmemberId(app.globalData.token);
// that.checkUserCarStatus();
that.setData({
list: res.data.list
});
})
.catch(err => {
that.getmemberId(app.globalData.token);
// that.getmemberId(app.globalData.token);
// that.checkUserCarStatus();
})
;


+ 6
- 0
pages/main/index.wxml Прегледај датотеку

@@ -86,4 +86,10 @@
<canvas canvas-id="barcode" />
<button class='button' bindtap='mySpecial'>特享礼遇</button>
</view>
</view>
<!-- 顶部签到成长值 -->
<view class='signin' wx:if="{{fistLogin}}" animation="{{alphaData}}">
<open-data class="open" type="userAvatarUrl"></open-data>
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text>
</view>

+ 33
- 0
pages/main/index.wxss Прегледај датотеку

@@ -278,4 +278,37 @@ height:100%;
width:690rpx;
height:120rpx;
border-radius:60rpx;
}
.signin{
width: 542rpx;
height: 94rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
margin: auto;
}
.signin open-data {
position: absolute;
width:90rpx;
left: 0;
top: 0;
bottom: 0;
height:94rpx;
margin: auto;
border-radius: 50%;
overflow: hidden;
}
.signin text{
display: block;
background: rgba(0, 0, 0, 0.5);
font-size: 28rpx;
height: 80rpx;
width: 100%;
line-height: 80rpx;
color: #D6D5D5;
text-indent: 4em;
border-radius:60rpx;
margin-top: 7rpx;
}

Loading…
Откажи
Сачувај