login.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='创衡正念企业教练' :showback="false"></cus-header>
  4. <div class="content">
  5. <image src="@/static/logo.png"></image>
  6. <div class="title">Hi,我是企业教练~</div>
  7. <div class="tip">很高兴遇见你!作为你的AI教练,我随时可以回答您的问题</div>
  8. <div class="item adf">
  9. <image src="@/static/qa.png"></image>
  10. <div class="qa">
  11. <p>智能问答</p>
  12. <p>正念修己 教练达人,知识推理整合,要点清晰呈现,助力企业打造高价值团队</p>
  13. </div>
  14. </div>
  15. <div class="item adf">
  16. <image src="@/static/qs.png"></image>
  17. <div class="qa">
  18. <p>PERILL模型问题库</p>
  19. <p>作为团队成员,您可以对所在团队相关描述的体验进行评分,帮助团队有效评估团队的现状</p>
  20. </div>
  21. </div>
  22. <button class="zt_btn" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">手机号一键登录</button>
  23. <div class="qx_btn" @click="cancelLogin">取消</div>
  24. </div>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data(){
  30. return {
  31. }
  32. },
  33. methods:{
  34. decryptPhoneNumber(e){
  35. if(uni.getStorageSync('token')){
  36. uni.reLaunch({
  37. url:'/pages/dialog'
  38. })
  39. return
  40. }
  41. if(e.detail.code) this.wxLogin(e.detail.code);
  42. },
  43. wxLogin(code){
  44. uni.showLoading({ title:'登录中' });
  45. let that = this;
  46. wx.login({
  47. success(res){
  48. that.$api.get('/wx/login',{
  49. code:res.code,
  50. phoneCode:code
  51. },false).then(res=>{
  52. if(res.data.code===0){
  53. uni.setStorageSync('token',res.data.data.token);
  54. uni.setStorageSync('userInfo',JSON.stringify({
  55. id:res.data.data.id,
  56. gender:res.data.data.gender,
  57. realName:res.data.data.realName,
  58. mobile:res.data.data.mobile,
  59. headUrl:res.data.data.headUrl,
  60. teamId:res.data.data.teamId,
  61. enterpriseId:res.data.data.enterpriseId
  62. }));
  63. uni.hideLoading();
  64. that.$showToast('登录成功');
  65. setTimeout(()=>{
  66. uni.reLaunch({ url:'/pages/dialog' })
  67. },1500)
  68. }else that.$showToast(res.data.msg)
  69. })
  70. }
  71. })
  72. },
  73. cancelLogin(){
  74. uni.exitMiniProgram();
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .page{
  81. background: #FFFFFF;
  82. display: flex;
  83. flex-direction: column;
  84. box-sizing: border-box;
  85. .content{
  86. padding: 0 45rpx;
  87. flex: 1;
  88. overflow-y: auto;
  89. &>image{
  90. width: 88rpx;
  91. height: 88rpx;
  92. margin-top: 100rpx;
  93. }
  94. .title{
  95. font-family: PingFang-SC, PingFang-SC;
  96. font-weight: bold;
  97. font-size: 48rpx;
  98. color: #252525;
  99. line-height: 67rpx;
  100. margin-top: 36rpx;
  101. }
  102. .tip{
  103. font-family: PingFangSC, PingFang SC;
  104. font-weight: 400;
  105. font-size: 30rpx;
  106. color: #646464;
  107. line-height: 47rpx;
  108. margin-top: 20rpx;
  109. }
  110. .item{
  111. margin-top: 64rpx;
  112. &>image{
  113. width: 64rpx;
  114. height: 64rpx;
  115. }
  116. .qa{
  117. width: calc(100% - 64rpx);
  118. padding-left: 24rpx;
  119. box-sizing: border-box;
  120. p{
  121. font-family: PingFang-SC, PingFang-SC;
  122. font-weight: bold;
  123. font-size: 32rpx;
  124. color: #252525;
  125. line-height: 45rpx;
  126. &:last-child{
  127. font-weight: 400;
  128. font-size: 28rpx;
  129. color: #646464;
  130. line-height: 47rpx;
  131. }
  132. }
  133. }
  134. }
  135. .zt_btn{
  136. margin-top: 216rpx;
  137. }
  138. .qx_btn{
  139. margin-top: 36rpx;
  140. }
  141. }
  142. }
  143. </style>