|
@@ -2,8 +2,9 @@
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
<view class="container_text">
|
|
<view class="container_text">
|
|
|
<image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image>
|
|
<image class="banner-img" src="/static/img/img01.png" mode="scaleToFill"></image>
|
|
|
|
|
+ <view class="title-img"><image class="title-image" src="../../static/img/login-title.png" mode=""></image></view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="loginTitle"><text>登录</text></view>
|
|
|
|
|
|
|
+ <view class="loginTitle"><text>欢迎登录易趣CBB</text></view>
|
|
|
<view class="login_text">
|
|
<view class="login_text">
|
|
|
<view class="login_input flex">
|
|
<view class="login_input flex">
|
|
|
<view class="login_img"><image src="/static/icon/img03.png"></image></view>
|
|
<view class="login_img"><image src="/static/icon/img03.png"></image></view>
|
|
@@ -16,39 +17,14 @@
|
|
|
<view><button type="green" class="uni-button uni-button-green" @click="toLogin">登录</button></view>
|
|
<view><button type="green" class="uni-button uni-button-green" @click="toLogin">登录</button></view>
|
|
|
<view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true" hover-class="none" @click="register">注册</button></view>
|
|
<view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true" hover-class="none" @click="register">注册</button></view>
|
|
|
<navigator url="./forget"><view class="forget">忘记密码</view></navigator>
|
|
<navigator url="./forget"><view class="forget">忘记密码</view></navigator>
|
|
|
- <view class="flex other">
|
|
|
|
|
- <view class="fenge"></view>
|
|
|
|
|
- <view class="qita">其他方式登录</view>
|
|
|
|
|
- <view class="fenge"></view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <!-- #ifndef APP-PLUS -->
|
|
|
|
|
- <view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png"></image></view>
|
|
|
|
|
- <view class="weixin_text" @click="wecahtLogin">微信登录</view>
|
|
|
|
|
- <!-- #endif -->
|
|
|
|
|
- <!-- #ifdef APP-PLUS -->
|
|
|
|
|
- <block v-if="!is_ios">
|
|
|
|
|
- <view class="weixin" @click="wecahtLogin"><image src="/static/img/img05.png" mode="scaleToFill"></image></view>
|
|
|
|
|
- <view class="weixin_text" @click="wecahtLogin">微信登录</view>
|
|
|
|
|
- </block>
|
|
|
|
|
- <block v-else>
|
|
|
|
|
- <view class="ios_login flex" @click="wecahtLogin('weixin')">
|
|
|
|
|
- <text class="iconfont iconweixin"></text>
|
|
|
|
|
- <text class="weixin_text">微信登录</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-if='is_apple_login' class="ios_login flex" @click="wecahtLogin('apple')">
|
|
|
|
|
- <image class="loginIcon" src="/static/icon/appleIcon.png" mode=" scaleToFill"></image>
|
|
|
|
|
- <text class="weixin_text">通过Apple登录</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </block>
|
|
|
|
|
- <!-- #endif -->
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { mapMutations } from 'vuex';
|
|
import { mapMutations } from 'vuex';
|
|
|
-import { login} from '@/api/login.js';
|
|
|
|
|
-import { getUserInfo} from '@/api/user.js';
|
|
|
|
|
|
|
+import { login } from '@/api/login.js';
|
|
|
|
|
+import { getUserInfo } from '@/api/user.js';
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
// applelogin接口需要开发编写,基础项目中可能没有
|
|
// applelogin接口需要开发编写,基础项目中可能没有
|
|
|
import { applelogin } from '@/api/set.js';
|
|
import { applelogin } from '@/api/set.js';
|
|
@@ -64,8 +40,8 @@ export default {
|
|
|
username: '',
|
|
username: '',
|
|
|
passward: '',
|
|
passward: '',
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
- is_ios: false ,//判断是否为ios手机
|
|
|
|
|
- is_apple_login:false,//是否有ios授权登录功能
|
|
|
|
|
|
|
+ is_ios: false, //判断是否为ios手机
|
|
|
|
|
+ is_apple_login: false //是否有ios授权登录功能
|
|
|
// #endif
|
|
// #endif
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -79,11 +55,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
uni.getSystemInfo({
|
|
uni.getSystemInfo({
|
|
|
success(e) {
|
|
success(e) {
|
|
|
- if(+e.system.split('.')[0]>=13){
|
|
|
|
|
- obj.is_apple_login=true;
|
|
|
|
|
|
|
+ if (+e.system.split('.')[0] >= 13) {
|
|
|
|
|
+ obj.is_apple_login = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -104,7 +80,7 @@ export default {
|
|
|
uni.getUserInfo({
|
|
uni.getUserInfo({
|
|
|
provider: type,
|
|
provider: type,
|
|
|
success(es) {
|
|
success(es) {
|
|
|
- if(type==='weixin'){
|
|
|
|
|
|
|
+ if (type === 'weixin') {
|
|
|
loginWx(es.userInfo)
|
|
loginWx(es.userInfo)
|
|
|
.then(e => {
|
|
.then(e => {
|
|
|
uni.setStorageSync('token', e.data.token);
|
|
uni.setStorageSync('token', e.data.token);
|
|
@@ -127,13 +103,13 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- if(type==='apple'){
|
|
|
|
|
|
|
+ if (type === 'apple') {
|
|
|
console.log(es.userInfo);
|
|
console.log(es.userInfo);
|
|
|
applelogin({
|
|
applelogin({
|
|
|
- account: es.userInfo.openId,
|
|
|
|
|
|
|
+ account: es.userInfo.openId
|
|
|
})
|
|
})
|
|
|
.then(function(e) {
|
|
.then(function(e) {
|
|
|
- console.log(e,'token')
|
|
|
|
|
|
|
+ console.log(e, 'token');
|
|
|
uni.setStorageSync('token', e.data.token);
|
|
uni.setStorageSync('token', e.data.token);
|
|
|
getUserInfo({}).then(e => {
|
|
getUserInfo({}).then(e => {
|
|
|
obj.login();
|
|
obj.login();
|
|
@@ -144,13 +120,11 @@ export default {
|
|
|
url: '/pages/index/index'
|
|
url: '/pages/index/index'
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
.catch(function(e) {
|
|
.catch(function(e) {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
fail(es) {
|
|
fail(es) {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -195,7 +169,7 @@ export default {
|
|
|
password: obj.passward
|
|
password: obj.passward
|
|
|
})
|
|
})
|
|
|
.then(function(e) {
|
|
.then(function(e) {
|
|
|
- console.log(e.data.token,"123456");
|
|
|
|
|
|
|
+ console.log(e.data.token, '123456');
|
|
|
uni.setStorageSync('token', e.data.token);
|
|
uni.setStorageSync('token', e.data.token);
|
|
|
// obj.$store.commit('hasLogin', true);
|
|
// obj.$store.commit('hasLogin', true);
|
|
|
getUserInfo({}).then(e => {
|
|
getUserInfo({}).then(e => {
|
|
@@ -205,7 +179,7 @@ export default {
|
|
|
// let ur = uni.getStorageSync('present')|| '/pages/index/index';
|
|
// let ur = uni.getStorageSync('present')|| '/pages/index/index';
|
|
|
//成功跳转首页
|
|
//成功跳转首页
|
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
|
- url: "/pages/index/index",
|
|
|
|
|
|
|
+ url: '/pages/index/index'
|
|
|
// fail(e) {
|
|
// fail(e) {
|
|
|
// uni.navigateTo({
|
|
// uni.navigateTo({
|
|
|
// url: ur,
|
|
// url: ur,
|
|
@@ -238,51 +212,51 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
- /* #ifdef APP-PLUS */
|
|
|
|
|
-
|
|
|
|
|
- .ios_login {
|
|
|
|
|
- width: 260rpx;
|
|
|
|
|
- border-radius: 12rpx;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- border: 1px solid #212121;
|
|
|
|
|
- margin: 24rpx auto;
|
|
|
|
|
- padding: 10rpx;
|
|
|
|
|
- background-color: #212121;
|
|
|
|
|
- color: #ffffff;
|
|
|
|
|
- .loginIcon {
|
|
|
|
|
- width: 50rpx;
|
|
|
|
|
- height: 50rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .weixin_text {
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
- margin-left: 20rpx;
|
|
|
|
|
- color: #ffffff !important;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+/* #ifdef APP-PLUS */
|
|
|
|
|
+
|
|
|
|
|
+.ios_login {
|
|
|
|
|
+ width: 260rpx;
|
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ border: 1px solid #212121;
|
|
|
|
|
+ margin: 24rpx auto;
|
|
|
|
|
+ padding: 10rpx;
|
|
|
|
|
+ background-color: #212121;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ .loginIcon {
|
|
|
|
|
+ width: 50rpx;
|
|
|
|
|
+ height: 50rpx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- /* #endif */
|
|
|
|
|
- .ios_login {
|
|
|
|
|
- width: 350rpx;
|
|
|
|
|
- border-radius: 12rpx;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- border: 1px solid #212121;
|
|
|
|
|
- margin: 24rpx auto;
|
|
|
|
|
- padding: 15rpx;
|
|
|
|
|
- background-color: #212121;
|
|
|
|
|
- color: #ffffff;
|
|
|
|
|
- font-size: 32rpx;
|
|
|
|
|
- .loginIcon {
|
|
|
|
|
- font-size: 35rpx;
|
|
|
|
|
- width: 35rpx;
|
|
|
|
|
- height: 35rpx;
|
|
|
|
|
- }
|
|
|
|
|
- .weixin_text {
|
|
|
|
|
- line-height: 1;
|
|
|
|
|
- margin-left: 20rpx;
|
|
|
|
|
- color: #ffffff !important;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .weixin_text {
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
|
+ color: #ffffff !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* #endif */
|
|
|
|
|
+.ios_login {
|
|
|
|
|
+ width: 350rpx;
|
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ border: 1px solid #212121;
|
|
|
|
|
+ margin: 24rpx auto;
|
|
|
|
|
+ padding: 15rpx;
|
|
|
|
|
+ background-color: #212121;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ .loginIcon {
|
|
|
|
|
+ font-size: 35rpx;
|
|
|
|
|
+ width: 35rpx;
|
|
|
|
|
+ height: 35rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ .weixin_text {
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+ margin-left: 20rpx;
|
|
|
|
|
+ color: #ffffff !important;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
page {
|
|
page {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
}
|
|
}
|
|
@@ -292,6 +266,7 @@ page {
|
|
|
background-size: 100%;
|
|
background-size: 100%;
|
|
|
}
|
|
}
|
|
|
.container_text {
|
|
.container_text {
|
|
|
|
|
+ position: relative;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 500rpx;
|
|
height: 500rpx;
|
|
|
top: 0rpx;
|
|
top: 0rpx;
|
|
@@ -299,14 +274,26 @@ page {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
+ .title-img {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ top: 100rpx;
|
|
|
|
|
+ margin-left: -130rpx;
|
|
|
|
|
+ width: 260rpx;
|
|
|
|
|
+ height: 156rpx;
|
|
|
|
|
+ .title-image {
|
|
|
|
|
+ width: 260rpx;
|
|
|
|
|
+ height: 156rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.login_text {
|
|
.login_text {
|
|
|
- margin: auto 30rpx;
|
|
|
|
|
|
|
+ margin: -100rpx 0 0;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
padding: 100rpx 102rpx;
|
|
padding: 100rpx 102rpx;
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
- margin-top: -180rpx;
|
|
|
|
|
- border-radius: 20rpx;
|
|
|
|
|
|
|
+ border-top-left-radius: 40rpx;
|
|
|
|
|
+ border-top-right-radius: 40rpx;
|
|
|
.login_input {
|
|
.login_input {
|
|
|
border-bottom: 1px solid #f0f0f0;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
|
margin-bottom: 65rpx;
|
|
margin-bottom: 65rpx;
|
|
@@ -360,15 +347,15 @@ page {
|
|
|
|
|
|
|
|
.uni-button-green {
|
|
.uni-button-green {
|
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
|
- background-color: #5dbc7c;
|
|
|
|
|
|
|
+ background-color: #db292b;
|
|
|
margin: 40rpx 10rpx;
|
|
margin: 40rpx 10rpx;
|
|
|
border-radius: 50rpx;
|
|
border-radius: 50rpx;
|
|
|
}
|
|
}
|
|
|
.uni-button-green-plain {
|
|
.uni-button-green-plain {
|
|
|
- border: 1px solid #5dbc7c;
|
|
|
|
|
|
|
+ border: 1px solid #db292b;
|
|
|
margin: 40rpx 10rpx;
|
|
margin: 40rpx 10rpx;
|
|
|
border-radius: 50rpx;
|
|
border-radius: 50rpx;
|
|
|
- color: #5dbc7c;
|
|
|
|
|
|
|
+ color: #db292b;
|
|
|
background-color: #ffffff;
|
|
background-color: #ffffff;
|
|
|
}
|
|
}
|
|
|
.uni-button {
|
|
.uni-button {
|
|
@@ -378,7 +365,7 @@ page {
|
|
|
}
|
|
}
|
|
|
.loginTitle {
|
|
.loginTitle {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: 250rpx;
|
|
|
|
|
|
|
+ top: 270rpx;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
color: white;
|
|
color: white;
|