dev
xiaowen 3 years ago
parent 92d1f80829
commit e2748aad7e

@ -31,7 +31,7 @@ Page({
onShow() {
if(!wx.getStorageSync('token')) {
wx.navigateTo({
url: '/pages/mine/pages/bindUser/index',
url: '/pages/mine/pages/bindUser/index?isHome=1',
})
return;
}

@ -14,7 +14,9 @@ Page({
unionID: '',
code: '',
nickName: '未登录',
avatarUrl: ''
avatarUrl: '',
statusBarHeight: app.globalData.statusBarHeight,
isHome: 0
},
usernameInput: function (e) {
this.setData({
@ -29,8 +31,13 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// this.initData()
onLoad() {
let pages = getCurrentPages();
let currentPage = pages[pages.length - 1]
let options = currentPage.options
this.setData({
isHome: options.isHome || 0
})
},
// 微信用户初始化
initData() {
@ -169,5 +176,16 @@ Page({
}
})
})
},
handlerBack() {
if(this.data.isHome) {
wx.redirectTo({
url: '/pages/index/index'
})
} else {
wx.navigateBack({
delta: 1
});
}
}
})

@ -1,5 +1,6 @@
{
"usingComponents": {},
"navigationStyle": "custom",
"navigationBarTitleText":"绑定账号",
"navigationBarBackgroundColor":"#ffffff",
"navigationBarTextStyle":"black"

@ -1,4 +1,11 @@
<!--pages/mine/pages/bindUser.wxml-->
<view style="height:{{statusBarHeight}}px;width: 100%;"></view>
<view class="navigation nav-top" style="background: #006BFF;">
<view class="bs-top-title" style="height: {{navBarHeight}}px;width: 100%;">
<van-icon class="bs-top-title-ic" name="arrow-left" bindtap="handlerBack" />
<text>硕为思汽车智能洞察</text>
</view>
</view>
<view class="bind_box" >
<view style="font-size:28rpx;font-weight:bolder;margin-left: 32rpx">硕为思账号</view>
<input value="{{userName}}" placeholder="请输入账号" placeholder-class="placeholder-style" bindinput="usernameInput" ></input>

@ -34,4 +34,18 @@ page{
font-size: 28rpx;
height: 88rpx;
line-height: 88rpx;
}
}
.bs-top-title {
position: relative;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 26rpx;
height: 40px;
}
.bs-top-title-ic {
position: absolute;
left: 16px;
font-size: 19px;
}

Loading…
Cancel
Save