|
|
|
@ -60,12 +60,15 @@ |
|
|
|
|
</view> |
|
|
|
|
<u-button text="登录" :disabled="!phone||!code" @click="smsLogin" class="loginBtn"></u-button> |
|
|
|
|
<!-- <view >登录</view> --> |
|
|
|
|
<!-- <view class="otherLogin"> |
|
|
|
|
<!-- #ifdef APP-PLUS --> |
|
|
|
|
<view class="otherLogin"> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="otext">其他登录</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
</view> |
|
|
|
|
<image src="@/static/wlogin.png" class="wlogin" @tap="$refs.show_rule_item.open()" mode="widthFix"></image> --> |
|
|
|
|
|
|
|
|
|
<image src="@/static/wlogin.png" class="wlogin" @tap="$refs.show_rule_item.open()" mode="widthFix"></image> |
|
|
|
|
|
|
|
|
|
<!-- <view class="page-height flex-center flex-column"> |
|
|
|
|
<image mode="aspectFill" lazy-load class="logo-img mb-md" :src="base_info.app_logo"></image> |
|
|
|
|
<view class="f-caption c-caption">{{base_info.app_text}}</view> |
|
|
|
@ -75,7 +78,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
<!-- <uni-popup ref="show_rule_item" type="center" :maskClick="false"> |
|
|
|
|
<uni-popup ref="show_rule_item" type="center" :maskClick="false"> |
|
|
|
|
<view class="common-popup-content fill-base pd-lg radius-34"> |
|
|
|
|
<view class="title">温馨提示</view> |
|
|
|
|
<view class="f-desc c-title mt-lg"> |
|
|
|
@ -91,7 +94,8 @@ |
|
|
|
|
:style="{background: primaryColor,color:'#fff'}">确定</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> --> |
|
|
|
|
</uni-popup> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -113,12 +117,19 @@ |
|
|
|
|
code:'', |
|
|
|
|
phone:'', |
|
|
|
|
checked:[], |
|
|
|
|
|
|
|
|
|
pid:null |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async onLoad() { |
|
|
|
|
console.log('pages/login',"888") |
|
|
|
|
async onLoad(option) { |
|
|
|
|
// console.log('pages/login',"888") |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var searchURL = window.location.search; |
|
|
|
|
searchURL = searchURL.substring(1, searchURL.length); |
|
|
|
|
var targetPageId = searchURL.split("&")[0].split("=")[1]; |
|
|
|
|
// console.log(option,targetPageId.substring(-1,1)) |
|
|
|
|
this.pid=targetPageId?targetPageId.substring(-1,1):'' |
|
|
|
|
// #endif |
|
|
|
|
let { |
|
|
|
|
autograph = '', |
|
|
|
|
appLogin = '' |
|
|
|
@ -163,61 +174,61 @@ |
|
|
|
|
userInfo: state => state.user.userInfo, |
|
|
|
|
}), |
|
|
|
|
methods: { |
|
|
|
|
...mapActions(['getConfigInfo', 'getUserInfo']), |
|
|
|
|
...mapActions(['getConfigInfo', 'getUserInfo','getMineInfo']), |
|
|
|
|
...mapMutations(['updateConfigItem', 'updateUserItem']), |
|
|
|
|
//微信登录 |
|
|
|
|
// async wxLogin() { |
|
|
|
|
// this.$refs.show_rule_item.close() |
|
|
|
|
// try { |
|
|
|
|
// let [providerErr, providerData] = await uni.getProvider({ |
|
|
|
|
// service: 'oauth', |
|
|
|
|
// }); |
|
|
|
|
// console.log("111") |
|
|
|
|
// // let [loginErr, loginData] =await uni.getUserProfile({ |
|
|
|
|
// // desc: '用于您的页面展示用户头像与昵称', |
|
|
|
|
// // lang: 'zh_CN', |
|
|
|
|
// // success: res => { |
|
|
|
|
// // console.log(res,"jjj"); |
|
|
|
|
// // // this.isShowLogin = false; |
|
|
|
|
// // // this.userInfo = res.userInfo; |
|
|
|
|
// // }, |
|
|
|
|
// // fail: err => { |
|
|
|
|
// // console.log(err.errMsg); |
|
|
|
|
// // } |
|
|
|
|
// // }); |
|
|
|
|
async wxLogin() { |
|
|
|
|
this.$refs.show_rule_item.close() |
|
|
|
|
try { |
|
|
|
|
let [providerErr, providerData] = await uni.getProvider({ |
|
|
|
|
service: 'oauth', |
|
|
|
|
}); |
|
|
|
|
console.log("111") |
|
|
|
|
// let [loginErr, loginData] =await uni.getUserProfile({ |
|
|
|
|
// desc: '用于您的页面展示用户头像与昵称', |
|
|
|
|
// lang: 'zh_CN', |
|
|
|
|
// success: res => { |
|
|
|
|
// console.log(res,"jjj"); |
|
|
|
|
// // this.isShowLogin = false; |
|
|
|
|
// // this.userInfo = res.userInfo; |
|
|
|
|
// }, |
|
|
|
|
// fail: err => { |
|
|
|
|
// console.log(err.errMsg); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// let [loginErr, loginData] = await uni.login({ |
|
|
|
|
// provider: 'weixin' |
|
|
|
|
// }); |
|
|
|
|
// console.log("222") |
|
|
|
|
// let [infoErr, infoData] = await uni.getUserInfo({ |
|
|
|
|
// provider: 'weixin' |
|
|
|
|
// }) |
|
|
|
|
// console.log("333",infoData) |
|
|
|
|
// let { |
|
|
|
|
// userInfo = {} |
|
|
|
|
// } = infoData |
|
|
|
|
// let { |
|
|
|
|
// openId = '' |
|
|
|
|
// } = userInfo |
|
|
|
|
// if (!openId) return |
|
|
|
|
// this.$util.showLoading({ |
|
|
|
|
// title: "登录中..." |
|
|
|
|
// }) |
|
|
|
|
// try { |
|
|
|
|
// this.toLogin(userInfo) |
|
|
|
|
// } catch (e) { |
|
|
|
|
// this.$util.hideAll() |
|
|
|
|
// } |
|
|
|
|
// } catch (e) { |
|
|
|
|
// console.log(e) |
|
|
|
|
// this.$util.showToast({ |
|
|
|
|
// title: '请先安装微信或升级版本' |
|
|
|
|
let [loginErr, loginData] = await uni.login({ |
|
|
|
|
provider: 'weixin' |
|
|
|
|
}); |
|
|
|
|
console.log("222") |
|
|
|
|
let [infoErr, infoData] = await uni.getUserInfo({ |
|
|
|
|
provider: 'weixin' |
|
|
|
|
}) |
|
|
|
|
console.log("333",infoData) |
|
|
|
|
let { |
|
|
|
|
userInfo = {} |
|
|
|
|
} = infoData |
|
|
|
|
let { |
|
|
|
|
openId = '' |
|
|
|
|
} = userInfo |
|
|
|
|
if (!openId) return |
|
|
|
|
this.$util.showLoading({ |
|
|
|
|
title: "登录中..." |
|
|
|
|
}) |
|
|
|
|
try { |
|
|
|
|
this.toLogin(userInfo) |
|
|
|
|
} catch (e) { |
|
|
|
|
this.$util.hideAll() |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e) |
|
|
|
|
this.$util.showToast({ |
|
|
|
|
title: '请先安装微信或升级版本' |
|
|
|
|
|
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
async smsLogin(item){ |
|
|
|
|
console.log("短信登陆") |
|
|
|
|
if(this.checked.length==0){ |
|
|
|
@ -228,7 +239,8 @@ |
|
|
|
|
if(!item){ |
|
|
|
|
userInfo = await this.$api.base.smsLogin({ |
|
|
|
|
phone:this.phone, |
|
|
|
|
code:this.code |
|
|
|
|
code:this.code, |
|
|
|
|
pid:this.pid |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
userInfo = item; |
|
|
|
@ -261,6 +273,7 @@ |
|
|
|
|
if (!this.configInfo.id) { |
|
|
|
|
await this.getConfigInfo() |
|
|
|
|
} |
|
|
|
|
this.getMineInfo(1) |
|
|
|
|
let { |
|
|
|
|
phone = '' |
|
|
|
|
} = data |
|
|
|
@ -274,7 +287,7 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async toLogin(userInfo) { |
|
|
|
|
console.log(userInfo,"mmnn") |
|
|
|
|
console.log(userInfo,"mmnn",this.configInfo) |
|
|
|
|
let user_info = await this.$api.base.appLogin({ |
|
|
|
|
data: userInfo |
|
|
|
|
}) |
|
|
|
|