Authored by 邱骏

登录页

... ... @@ -43,6 +43,7 @@ Page({
isShow: 0,
referer: '',
needBind: 1,
showLogin: 0
},
onLoad: function(options) {
let that = this;
... ... @@ -64,6 +65,18 @@ Page({
});
}
if (app.getUid()) {
setTimeout(() => {
this.setData({ // 用来防止总是闪出登录界面后再显示限购码
showLogin: 1
});
}, 1000);
} else {
this.setData({ // 用来防止总是闪出登录界面后再显示限购码
showLogin: 1
});
}
yas = new Yas(app); // 实例化埋点
yas.pageOpenReport();
event.on('user-login-success', this.showBindUserInfo);
... ... @@ -78,10 +91,15 @@ Page({
},
onShow: function() {
let that = this;
setTimeout(() => {
app = app || getApp();
this.showBindUserInfo();
}, app ? 0 : 1000);
that.showBindUserInfo();
}, app ? 0 : 500);
},
onReady: function() {
... ... @@ -188,8 +206,8 @@ Page({
query.select('.out-login').boundingClientRect();
query.exec(result => {
let topHeight = result[0].height || 0;
let bottomHeight = result[1].height || 0;
let topHeight = result[0] && result[0].height || 0;
let bottomHeight = result[1] && result[1].height || 0;
let containerHeight = (windowHeight - topHeight - bottomHeight - 20 - 30) + 'px';
that.setData({
... ...
<wxs src="../../wxs/helper.wxs" module="helper" />
<view class="home-coupon-index">
<view class="user-info-bar" hidden='{{isBound}}'> <!--不需要显示用户信息了-->
<view class='login-container' wx:if="{{!isBound}}">
<image class="logo" src="../../static/images/home-logo.png"></image>
<view class='login-buttons'>
<view class='to-login'>{{loginText}}</view>
<login-button class="login-area auto-btn" openType="{{loginButtonType}}"></login-button>
</view>
<view class='login-tips'>{{loginTips}}</view>
</view>
<view wx:if="{{isBound}}">
<image wx:if="{{userInfo.avatarUrl == ''}}" class="avatar" src="../../static/images/icons/avatar@2x.png"></image>
<image wx:if="{{userInfo.avatarUrl != '' && userInfo.defaultAvatar}}" class="avatar"
src="{{userInfo.avatarUrl}}"></image>
<image wx:if="{{userInfo.avatarUrl != '' && !userInfo.defaultAvatar}}" class="avatar"
src="{{helper.image(userInfo.avatarUrl, 108, 108)}}"></image>
<text class="phone">{{userInfo.nickName || userInfo.phoneNum}}</text>
<text class="coin">积分:<text class="num">{{coinNum}}</text></text>
</view>
</view>
<!-- 我的限购码 -->
<!-- 我的限购码 -->
<view wx:if="{{isBound}}" class='container {{!limitCodes.invalidCodes.length && !limitCodes.codes.length ? "no-code" : ""}}' style='{{!limitCodes.invalidCodes.length && !limitCodes.codes.length ? "height:" + containerHeight : ""}}'>
<!--限购码介绍-->
<view class='desc-container'>
... ... @@ -112,6 +93,25 @@
</block>
</view>
</view>
<view wx:if='{{showLogin}}' class="user-info-bar" hidden='{{isBound}}'> <!--不需要显示用户信息了-->
<view class='login-container' wx:if="{{!isBound}}">
<image class="logo" src="../../static/images/home-logo.png"></image>
<view class='login-buttons'>
<view class='to-login'>{{loginText}}</view>
<login-button class="login-area auto-btn" openType="{{loginButtonType}}"></login-button>
</view>
<view class='login-tips'>{{loginTips}}</view>
</view>
<view wx:if="{{isBound}}">
<image wx:if="{{userInfo.avatarUrl == ''}}" class="avatar" src="../../static/images/icons/avatar@2x.png"></image>
<image wx:if="{{userInfo.avatarUrl != '' && userInfo.defaultAvatar}}" class="avatar"
src="{{userInfo.avatarUrl}}"></image>
<image wx:if="{{userInfo.avatarUrl != '' && !userInfo.defaultAvatar}}" class="avatar"
src="{{helper.image(userInfo.avatarUrl, 108, 108)}}"></image>
<text class="phone">{{userInfo.nickName || userInfo.phoneNum}}</text>
<text class="coin">积分:<text class="num">{{coinNum}}</text></text>
</view>
</view>
<!--不用显示退出登录了-->
<view class="out-login" bindtap="outLogin" wx:if="{{userInfo.uid}}" hidden='true'>退出登录</view>
</view>
... ...