|
| xqd
@@ -44,23 +44,37 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 按钮 -->
|
|
|
- <view style="height: 30vh;padding: 0 80rpx;">
|
|
|
+ <view style="height: 30vh;padding: 0 80rpx;">
|
|
|
<!-- 登录 -->
|
|
|
- <u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">登录</u-button>
|
|
|
- <view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
|
|
|
- <u-button @click="getinfo()" shape="circle" style="width: 50%;font-size: 30rpx;color:#84BB43;" :custom-style="customStyle" hair-line="false">微信授权一键登录</u-button>
|
|
|
- <u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
|
|
|
+ <u-button @click="startReg()" type="primary" shape="circle" :loading="isRotate">登录</u-button>
|
|
|
+
|
|
|
+ <view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
|
|
|
+ <button style="margin-top: 20rpx;" :class="['buttonBorder',!istrue?'dlbutton':'dlbutton_loading']" open-type="getUserInfo"
|
|
|
+ @getuserinfo="getinfo">
|
|
|
+ <view :class="istrue?'rotate_loop':''">
|
|
|
+ <text v-if="istrue" class="cuIcon cuIcon-loading1 "></text>
|
|
|
+ <view v-if="!istrue">
|
|
|
+ <slot name="text">微信授权一键登录</slot>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
+ <u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="flex align-center justify-between" style="margin: 70rpx 0 100rpx 0;">
|
|
|
+ <u-button open-type="getUserInfo" @getuserInfo="getinfo" shape="circle" style="width: 50%;font-size: 30rpx;color:#84BB43;" :custom-style="customStyle"
|
|
|
+ hair-line="false">微信授权一键登录</u-button>
|
|
|
+ <u-button @click="toindex()" shape="circle" style="width: 45%;font-size: 30rpx;" hair-line="false">暂不登录</u-button>
|
|
|
+ </view> -->
|
|
|
+ <view class="flex align-center justify-between">
|
|
|
+ <view style="width: 50%;text-align: center;">
|
|
|
+ <text style="text-decoration:underline; color: #666666;" @click="goreg">注册账号</text>
|
|
|
</view>
|
|
|
- <view class="flex align-center justify-between">
|
|
|
- <view style="width: 50%;text-align: center;">
|
|
|
- <text style="text-decoration:underline; color: #666666;" @click="goreg">注册账号</text>
|
|
|
- </view>
|
|
|
- <view style="width: 50%;text-align: center;">
|
|
|
- <text style="text-decoration:underline ; color: #666666;" @click="ispwd">{{ispwdlogin?'验证码':'账号密码'}}登录</text>
|
|
|
- </view>
|
|
|
-
|
|
|
+ <view style="width: 50%;text-align: center;">
|
|
|
+ <text style="text-decoration:underline ; color: #666666;" @click="ispwd">{{ispwdlogin?'验证码':'账号密码'}}登录</text>
|
|
|
</view>
|
|
|
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
| xqd
@@ -90,14 +104,16 @@
|
|
|
data() {
|
|
|
return {
|
|
|
//一键登录按钮样式
|
|
|
- customStyle: {color: '#84BB43',boxShadow: '0px 0px 16px 0px rgba(0, 0, 0, 0.08)',border:'none'},
|
|
|
- //短信还是密码
|
|
|
- loginMethod: 0, //0短信 1密码
|
|
|
+ customStyle: {
|
|
|
+ color: '#84BB43',
|
|
|
+ boxShadow: '0px 0px 16px 0px rgba(0, 0, 0, 0.08)',
|
|
|
+ border: 'none'
|
|
|
+ },
|
|
|
//logo图片 base64
|
|
|
phoneData: '', // 用户/电话
|
|
|
verCode: "", //验证码
|
|
|
password: "", //密码
|
|
|
- ispwdlogin: false,//是否使用密码登录
|
|
|
+ ispwdlogin: false, //是否使用密码登录
|
|
|
isRotate: false, //是否登录按钮加载旋转
|
|
|
istrue: false,
|
|
|
num: 1,
|
|
| xqd
@@ -137,7 +153,6 @@
|
|
|
//验证码点击事件
|
|
|
getVerCode: async function() {
|
|
|
//获取验证码
|
|
|
-
|
|
|
if (_this.phoneData.length != 11) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
| xqd
@@ -146,8 +161,10 @@
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- let res = await this.$request.post("common/putverfiy",{'phone':_this.phoneData});
|
|
|
- console.log(res)
|
|
|
+ console.log(_this.phoneData)
|
|
|
+ let res = await this.$request.post("common/putverfiy", {
|
|
|
+ 'phone': _this.phoneData
|
|
|
+ });
|
|
|
if (res.status == 0) {
|
|
|
uni.setStorageSync('verfiyCode', res.data);
|
|
|
uni.showToast({
|
|
| xqd
@@ -165,13 +182,15 @@
|
|
|
});
|
|
|
}, 3000)
|
|
|
} else {
|
|
|
- console.log('请求失败',this.phoneData)
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
position: 'bottom',
|
|
|
title: '请求失败'
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
//点击登录
|
|
| xqd
@@ -320,8 +339,14 @@
|
|
|
ispwd() {
|
|
|
this.ispwdlogin = !this.ispwdlogin
|
|
|
},
|
|
|
+ // 一键登录
|
|
|
getinfo: async function(e) {
|
|
|
let that = this;
|
|
|
+ uni.login({
|
|
|
+ success:(res) =>{
|
|
|
+ console.log(res.code)
|
|
|
+ }
|
|
|
+ });
|
|
|
let meToken = user.loginByWeixin(e.detail.userInfo).then(res => {
|
|
|
if (res.status == 0) {
|
|
|
uni.showToast({
|