| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='创衡汇教练AI智能体' bgColor="transparent" backUrl="/pages/home"></cus-header>
- <image class="topbg" :src="imgBase+'login_top_bg.png'"></image>
- <div class="content">
- <div class="c_top">
- <image :src="imgBase+'logo.png'" mode="heightFix"></image>
- <div class="title">Hi,我是创衡团队教练助手</div>
- <div class="tip">可以为您提供PERILL团队评估、团队评估报告分析和团队教练督导对话,期待和您的共创~</div>
- <div class="item adf">
- <div class="qa">
- <p>PERILL团队发展动态评估</p>
- <p>据您对相关陈述的评分,帮助团队从六个维度评估团队的现状。</p>
- </div>
- </div>
- <div class="item adf">
- <div class="qa">
- <p>AI教练督导对话</p>
- <p>保持正念教练督导心态,对您的PERILL测评报告或团队教练计划进行启发式沟通。</p>
- </div>
- </div>
- </div>
- <div class="c_bottom">
- <button class="zt_btn" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">手机号一键登录</button>
- <div class="qx_btn" style="margin-top: 40rpx;" @tap="codeLogin" v-if="!channelType">授权码登录</div>
- <div class="agree adfacjc" @click="changeAgree">
- <image :src="imgBase+'not_select.png'" v-if="!agree"></image>
- <image :src="imgBase+'selected.png'" v-else></image>
- <div class="text">已阅读并同意我们的<span>“服务协议与隐私政策”</span></div>
- </div>
- </div>
- </div>
- <u-popup :show="show" @close="cancel" mode="center" :round="20">
- <div class="code">
- <p>授权码登录</p>
- <u-input v-model="phone" placeholder="请输入手机号"></u-input>
- <div style="margin-top: 20rpx;"></div>
- <u-input v-model="code" placeholder="请输入授权码"></u-input>
- <div class="cbtns adfacjb">
- <div class="zt_btn" @tap="toCodeLogin">登录</div>
- <div class="qx_btn" @tap="cancel">取消</div>
- </div>
- </div>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data(){
- return {
- show:false,
- phone:'',
- code:'',
- agree:false,
- channelType:''
- }
- },
- created() {
- if(uni.getStorageSync('channelType')) this.channelType = uni.getStorageSync('channelType')
- },
- methods:{
- decryptPhoneNumber(e){
- if(!this.agree) return this.$showToast('请勾选协议与政策')
- if(uni.getStorageSync('token')){
- uni.reLaunch({
- url:'/pages/home'
- })
- return
- }
- if(e.detail.code) this.wxLogin(e.detail.code);
- },
- codeLogin(){
- if(!this.agree) return this.$showToast('请勾选协议与政策')
- this.show = true;
- },
- toCodeLogin(){
- if(!this.$reg.mobile(this.phone)) return this.$showToast('请输入正确的手机号!')
- if(!this.code) return this.$showToast('请输入授权码!')
- this.$api.get('/wx/login-code',{
- checkCode:this.code,
- phone:this.phone
- }).then(res=>{
- if(res.data.code!==0) return this.$showToast(res.data.msg)
- this.loginSuccessFn(res);
- })
- },
- cancel(){
- this.code = '';
- this.show = false;
- },
- wxLogin(code){
- uni.showLoading({ title:'登录中' });
- let that = this;
- wx.login({
- success(res){
- that.$api.get('/wx/login',{
- code:res.code,
- phoneCode:code,
- channelType:that.channelType
- },false).then(res=>{
- if(res.data.code===0){
- if(res.data.data.isRegister==1) that.loginSuccessFn(res);
- else{
- uni.navigateTo({
- url:'/pages/registerInfo?params='+encodeURIComponent(JSON.stringify({
- info:{
- channelType:that.channelType,
- mobile:res.data.data.mobile||'',
- isRegister:res.data.data.isRegister,
- referrerId:res.data.data.referrerId||'',
- teamQuestionnaireId:res.data.data.teamQuestionnaireId||'',
- userId:res.data.data.id||''
- },
- user:{
- token:res.data.data.token,
- id:res.data.data.id,
- gender:res.data.data.gender,
- realName:res.data.data.realName,
- mobile:res.data.data.mobile,
- headUrl:res.data.data.headUrl,
- teamId:res.data.data.teamId,
- enterpriseId:res.data.data.enterpriseId,
- enterpriseName:res.data.data.enterpriseName,
- teamName:res.data.data.teamName,
- referrerId:res.data.data.referrerId,
- teamQuestionnaireId:res.data.data.teamQuestionnaireId,
- isRegister:res.data.data.isRegister
- }
- }))
- })
- }
- }else that.$showToast(res.data.msg)
- })
- }
- })
- },
- loginSuccessFn(res){
- uni.setStorageSync('token',res.data.data.token);
- uni.setStorageSync('userInfo',JSON.stringify({
- id:res.data.data.id,
- gender:res.data.data.gender,
- realName:res.data.data.realName,
- mobile:res.data.data.mobile,
- headUrl:res.data.data.headUrl,
- teamId:res.data.data.teamId,
- enterpriseId:res.data.data.enterpriseId,
- enterpriseName:res.data.data.enterpriseName,
- teamName:res.data.data.teamName,
- referrerId:res.data.data.referrerId,
- teamQuestionnaireId:res.data.data.teamQuestionnaireId,
- isRegister:res.data.data.isRegister
- }));
-
- uni.hideLoading();
- this.$showToast('登录成功');
- setTimeout(()=>{
- uni.reLaunch({ url:'/pages/home' })
- },1500)
- },
- changeAgree(){
- this.agree = !this.agree
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .page{
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
-
- .topbg{
- width: 100%;
- height: 584rpx;
- position: fixed;
- top: 0;
- left: 0;
- }
-
- .content{
- padding: 0 45rpx;
- flex: 1;
- overflow-y: auto;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- position: relative;
-
- .c_top{
- padding: 0 20rpx;
- &>image{
- height: 88rpx;
- margin-top: 76rpx;
- }
- .title{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 48rpx;
- color: #252525;
- line-height: 67rpx;
- margin-top: 36rpx;
- }
- .tip{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #646464;
- line-height: 47rpx;
- margin-top: 20rpx;
- }
- .item{
- margin-top: 64rpx;
- .qa{
- box-sizing: border-box;
- p{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #252525;
- line-height: 45rpx;
- &:last-child{
- font-weight: 400;
- font-size: 28rpx;
- color: #646464;
- line-height: 47rpx;
- }
- }
- }
- }
- }
-
- .c_bottom{
- .qx_btn{
- margin-top: 36rpx;
- }
- .agree{
- margin-top: 64rpx;
- image{
- width: 30rpx;
- height: 30rpx;
- }
- .text{
- margin-left: 8rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #95A5B1;
- line-height: 44rpx;
- span{
- color: #833478;
- }
- }
- }
- }
- }
- }
-
- .code{
- width: 700rpx;
- padding: 40rpx 60rpx 40rpx;
- border-radius: 32rpx 32rpx 0 0;
- box-sizing: border-box;
- p{
- font-size: 40rpx;
- font-weight: bold;
- margin-bottom: 50rpx;
- }
- .cbtns{
- margin-top: 50rpx;
- &>div{
- width: calc(50% - 20rpx);
- }
- .qx_btn{
- background: #f1f1f1;
- }
- }
- }
- </style>
|