login3.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <u-navbar back-text="返回" @leftClick="navbackHandler" class="top-navbar" :background="{'background':'transparent'}"></u-navbar>
  4. <view class="login-logo">
  5. <u-image width="120rpx" height="120rpx" src="../../static/img/logo.png" border-radius="20"></u-image>
  6. <h3>停车场管理端</h3>
  7. </view>
  8. <view class="tip">{{tiptxt}}</view>
  9. </view>
  10. </template>
  11. <script>
  12. import * as api from '@/apis/login.js'
  13. import app from '@/utils/app.js'
  14. export default {
  15. data() {
  16. return {
  17. tiptxt:'正在进入系统...'
  18. }
  19. },
  20. onLoad() {
  21. this.login(app.getURLParams())
  22. },
  23. methods: {
  24. login(param){
  25. api.login3(param).then(resp=>{
  26. if(!resp.success){
  27. this.tiptxt=resp.msg || '登录失败'
  28. return
  29. }
  30. app.addSetting(resp.data);
  31. uni.switchTab({
  32. url: '../index/index'
  33. })
  34. }).catch(err=>{
  35. console.log(err)
  36. this.tiptxt='登录出现错误'
  37. }).finally(()=>{
  38. if(this.tiptxt=='正在进入系统...'){
  39. this.tiptxt=''
  40. }
  41. })
  42. },
  43. navbackHandler(){
  44. console.log('navbackHandler')
  45. return false
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. page{
  52. background: url(../../static/img/bgbg.png) no-repeat;
  53. background-size: 100%;
  54. }
  55. </style>
  56. <style lang="scss" scoped>
  57. .login-logo{
  58. display: flex;
  59. flex-direction: column;
  60. align-items: center;
  61. padding-top: 20%;
  62. h3{
  63. margin:15px 0;
  64. }
  65. }
  66. .tip{
  67. margin:100rpx 0rpx;
  68. padding:30rpx;
  69. text-align: center;
  70. font-size: 32rpx;
  71. color:#333;
  72. }
  73. </style>