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(e.detail.code) this.wxLogin(e.detail.code);
  36. },
  37. wxLogin(code){
  38. uni.showLoading({ title:'登录中' });
  39. this.$showToast('登录成功');
  40. setTimeout(()=>{
  41. uni.reLaunch({ url:'/pages/dialog' })
  42. },1500)
  43. return
  44. let that = this;
  45. wx.login({
  46. success(res){
  47. that.$api.get('/wx/login',{
  48. code:res.code,
  49. phoneCode:code
  50. },false).then(res=>{
  51. if(res.data.code===0){
  52. uni.setStorageSync('token',res.data.data.token);
  53. uni.setStorageSync('userInfo',JSON.stringify({
  54. id:res.data.data.id,
  55. gender:res.data.data.gender,
  56. realName:res.data.data.realName,
  57. email:res.data.data.email,
  58. headUrl:res.data.data.headUrl,
  59. roleCodes:res.data.data.roleCodes,
  60. status:res.data.data.status
  61. }));
  62. uni.hideLoading();
  63. that.$showToast('登录成功');
  64. setTimeout(()=>{
  65. uni.reLaunch({ url:'/pages/dialog' })
  66. },1500)
  67. }else that.$showToast(res.data.msg)
  68. })
  69. }
  70. })
  71. },
  72. cancelLogin(){
  73. uni.exitMiniProgram();
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .page{
  80. background: #FFFFFF;
  81. display: flex;
  82. flex-direction: column;
  83. box-sizing: border-box;
  84. .content{
  85. padding: 0 45rpx;
  86. flex: 1;
  87. overflow-y: auto;
  88. &>image{
  89. width: 88rpx;
  90. height: 88rpx;
  91. margin-top: 100rpx;
  92. }
  93. .title{
  94. font-family: PingFang-SC, PingFang-SC;
  95. font-weight: bold;
  96. font-size: 48rpx;
  97. color: #252525;
  98. line-height: 67rpx;
  99. margin-top: 36rpx;
  100. }
  101. .tip{
  102. font-family: PingFangSC, PingFang SC;
  103. font-weight: 400;
  104. font-size: 30rpx;
  105. color: #646464;
  106. line-height: 47rpx;
  107. margin-top: 20rpx;
  108. }
  109. .item{
  110. margin-top: 64rpx;
  111. &>image{
  112. width: 64rpx;
  113. height: 64rpx;
  114. }
  115. .qa{
  116. width: calc(100% - 64rpx);
  117. padding-left: 24rpx;
  118. box-sizing: border-box;
  119. p{
  120. font-family: PingFang-SC, PingFang-SC;
  121. font-weight: bold;
  122. font-size: 32rpx;
  123. color: #252525;
  124. line-height: 45rpx;
  125. &:last-child{
  126. font-weight: 400;
  127. font-size: 28rpx;
  128. color: #646464;
  129. line-height: 47rpx;
  130. }
  131. }
  132. }
  133. }
  134. .zt_btn{
  135. margin-top: 216rpx;
  136. }
  137. .qx_btn{
  138. margin-top: 36rpx;
  139. }
  140. }
  141. }
  142. </style>