|
@@ -1,87 +1,126 @@
|
|
<style lang="less">
|
|
<style lang="less">
|
|
-.login-box {
|
|
|
|
- padding-top: 40px;
|
|
|
|
- .avatar-wrapper {
|
|
|
|
- padding: 0px;
|
|
|
|
- width: 196rpx;
|
|
|
|
- height: 196rpx;
|
|
|
|
- border-radius: 50%;
|
|
|
|
- image {
|
|
|
|
|
|
+page {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+}
|
|
|
|
+.auth-box {
|
|
|
|
+ position: relative;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding-top: 136rpx;
|
|
|
|
+ width: 100%;
|
|
|
|
+ background: #fff;
|
|
|
|
+ height: 100%;
|
|
|
|
+ .login-box {
|
|
|
|
+ // position: absolute;
|
|
|
|
+ padding-top: 40px;
|
|
|
|
+ .avatar-wrapper {
|
|
|
|
+ position: relative;
|
|
|
|
+ padding: 0px;
|
|
width: 196rpx;
|
|
width: 196rpx;
|
|
height: 196rpx;
|
|
height: 196rpx;
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
|
|
+ background: transparent;
|
|
|
|
+ image {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ width: 198rpx;
|
|
|
|
+ height: 198rpx;
|
|
|
|
+ z-index: 333;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- .avatar-tip {
|
|
|
|
- text-align: center;
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
- font-size: 28rpx;
|
|
|
|
- font-weight: 400;
|
|
|
|
- line-height: 44rpx;
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .bind-btn-box {
|
|
|
|
- position: fixed;
|
|
|
|
- bottom: 228rpx;
|
|
|
|
- left: 50%;
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
- .bind-btn {
|
|
|
|
- width: 548rpx;
|
|
|
|
- height: 100rpx;
|
|
|
|
- line-height: 100rpx;
|
|
|
|
- border-radius: 56rpx;
|
|
|
|
- background: rgba(61, 203, 204, 1);
|
|
|
|
- border: none;
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
- font-size: 32rpx;
|
|
|
|
- font-weight: 400;
|
|
|
|
- letter-spacing: 0px;
|
|
|
|
|
|
+ .avatar-tip {
|
|
text-align: center;
|
|
text-align: center;
|
|
- color: #fff;
|
|
|
|
- }
|
|
|
|
- .bind-btn-tip {
|
|
|
|
- //styleName: 14/常规;
|
|
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
- padding-top: 32rpx;
|
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
line-height: 44rpx;
|
|
line-height: 44rpx;
|
|
text-align: center;
|
|
text-align: center;
|
|
- color: rgba(139, 148, 158, 1);
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- .home-btn {
|
|
|
|
- margin-top: 240rpx;
|
|
|
|
- width: 548rpx;
|
|
|
|
- height: 100rpx;
|
|
|
|
- line-height: 100rpx;
|
|
|
|
- border-radius: 56rpx;
|
|
|
|
- border: 1px solid rgba(61, 203, 204, 1);
|
|
|
|
|
|
+ .bind-btn-box {
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 228rpx;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ z-index: 999;
|
|
|
|
+ .bind-btn {
|
|
|
|
+ width: 548rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ line-height: 100rpx;
|
|
|
|
+ border-radius: 56rpx;
|
|
|
|
+ background: rgba(61, 203, 204, 1);
|
|
|
|
+ border: none;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ .bind-btn-tip {
|
|
|
|
+ //styleName: 14/常规;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ padding-top: 32rpx;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ line-height: 44rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: rgba(139, 148, 158, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .home-btn {
|
|
|
|
+ margin-top: 240rpx;
|
|
|
|
+ width: 548rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ line-height: 100rpx;
|
|
|
|
+ border-radius: 56rpx;
|
|
|
|
+ border: 1px solid rgba(61, 203, 204, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .top {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ top: 0;
|
|
|
|
+ z-index: 33;
|
|
|
|
+ }
|
|
|
|
+ .bottom {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ z-index: 33;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
<template>
|
|
<template>
|
|
- <div class="login-box">
|
|
|
|
- <button class="avatar-wrapper"
|
|
|
|
- v-if="canIUseGetUserProfile"
|
|
|
|
- open-type="chooseAvatar"
|
|
|
|
- bind:chooseavatar="onChooseAvatar">
|
|
|
|
- <image class="avatar" src="{{avatarUrl}}"/>
|
|
|
|
- </button>
|
|
|
|
- <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
|
|
|
|
- <div class="bind-btn-box">
|
|
|
|
- <button class="bind-btn"
|
|
|
|
- open-type="getPhoneNumber"
|
|
|
|
- bindgetphonenumber="phonenumberAuth"
|
|
|
|
- >微信手机号认证</button>
|
|
|
|
- <!-- @click="goBindTenant" -->
|
|
|
|
- <!-- bindgetphonenumber="phonenumberAuth" -->
|
|
|
|
- <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
|
|
|
|
|
|
+<div class="auth-box">
|
|
|
|
+ <page-top-bar title=" "
|
|
|
|
+ titleColor="#1B2129"></page-top-bar>
|
|
|
|
+ <image class="top" src="{{h5StaticPath}}/page-bind-tenant/auth-top.jpg"/>
|
|
|
|
+ <div class="login-box">
|
|
|
|
+ <button class="avatar-wrapper"
|
|
|
|
+ v-if="canIUseGetUserProfile"
|
|
|
|
+ open-type="chooseAvatar"
|
|
|
|
+ bind:chooseavatar="onChooseAvatar">
|
|
|
|
+ <image class="avatar" src="{{avatarUrl}}"/>
|
|
|
|
+ </button>
|
|
|
|
+ <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
|
|
|
|
+ <div class="bind-btn-box">
|
|
|
|
+ <button class="bind-btn"
|
|
|
|
+ open-type="getPhoneNumber"
|
|
|
|
+ bindgetphonenumber="phonenumberAuth"
|
|
|
|
+ >微信手机号认证</button>
|
|
|
|
+ <!-- @click="goBindTenant" -->
|
|
|
|
+ <!-- bindgetphonenumber="phonenumberAuth" -->
|
|
|
|
+ <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <button class="home-btn" @click="goHome">首页</button> -->
|
|
</div>
|
|
</div>
|
|
- <!-- <button class="home-btn" @click="goHome">首页</button> -->
|
|
|
|
- </div>
|
|
|
|
|
|
+ <image class="bottom" src="{{h5StaticPath}}/page-bind-tenant/auth-bottom.jpg"/>
|
|
|
|
+
|
|
|
|
+</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -96,14 +135,15 @@ let defaultAvatarUrl =
|
|
wepy.page({
|
|
wepy.page({
|
|
store,
|
|
store,
|
|
config: {
|
|
config: {
|
|
- navigationBarTitleText: 'test'
|
|
|
|
|
|
+ navigationBarTitleText: 'test',
|
|
},
|
|
},
|
|
data: {
|
|
data: {
|
|
nicknameValue: '',
|
|
nicknameValue: '',
|
|
|
|
+ h5StaticPath: config.h5StaticPath,
|
|
avatarUrl: defaultAvatarUrl,
|
|
avatarUrl: defaultAvatarUrl,
|
|
msg: '测试数据',
|
|
msg: '测试数据',
|
|
canIUseGetUserProfile: false,
|
|
canIUseGetUserProfile: false,
|
|
- userInformation: wx.getStorageSync('userInformation')
|
|
|
|
|
|
+ userInformation: wx.getStorageSync('userInformation'),
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
if (wx.getUserProfile) {
|
|
if (wx.getUserProfile) {
|
|
@@ -125,13 +165,13 @@ wepy.page({
|
|
console.log(res.data);
|
|
console.log(res.data);
|
|
that.avatarUrl = 'data:image/png;base64,' + res.data;
|
|
that.avatarUrl = 'data:image/png;base64,' + res.data;
|
|
setAvatar(that.avatarUrl);
|
|
setAvatar(that.avatarUrl);
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getPageCompanyByPhone() {},
|
|
getPageCompanyByPhone() {},
|
|
goHome() {
|
|
goHome() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '/packagesEnv/pages/home/index'
|
|
|
|
|
|
+ url: '/packagesEnv/pages/home/index',
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 手机号认证
|
|
// 手机号认证
|
|
@@ -145,7 +185,7 @@ wepy.page({
|
|
// code 换取手机号
|
|
// code 换取手机号
|
|
getHttpPhoneNumber(code) {
|
|
getHttpPhoneNumber(code) {
|
|
getHttpPhoneNumber(code)
|
|
getHttpPhoneNumber(code)
|
|
- .then(res => {
|
|
|
|
|
|
+ .then((res) => {
|
|
let data = res.data || {};
|
|
let data = res.data || {};
|
|
let phoneNumber = data.purePhoneNumber;
|
|
let phoneNumber = data.purePhoneNumber;
|
|
if (phoneNumber) {
|
|
if (phoneNumber) {
|
|
@@ -155,22 +195,25 @@ wepy.page({
|
|
console.log('没获取到手机号');
|
|
console.log('没获取到手机号');
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .catch(error => {
|
|
|
|
|
|
+ .catch((error) => {
|
|
console.log('获取手机号的接口失败');
|
|
console.log('获取手机号的接口失败');
|
|
});
|
|
});
|
|
},
|
|
},
|
|
goBindTenant() {
|
|
goBindTenant() {
|
|
console.log('被点击了');
|
|
console.log('被点击了');
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: '/pages/bindTenant/index'
|
|
|
|
|
|
+ url: '/pages/bindTenant/index',
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- created() {}
|
|
|
|
|
|
+ created() {},
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
<config>
|
|
<config>
|
|
{
|
|
{
|
|
-navigationBarTitleText: '首页',
|
|
|
|
|
|
+navigationStyle:"custom",
|
|
|
|
+usingComponents: {
|
|
|
|
+ 'page-top-bar': '~@/components/common/page-top-bar',
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</config>
|
|
</config>
|