login3.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <u-navbar back-text="返回" 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. }
  44. }
  45. </script>
  46. <style>
  47. page{
  48. background: url(../../static/img/bgbg.png) no-repeat;
  49. background-size: 100%;
  50. }
  51. </style>
  52. <style lang="scss" scoped>
  53. .login-logo{
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. padding-top: 20%;
  58. h3{
  59. margin:15px 0;
  60. }
  61. }
  62. .tip{
  63. margin:100rpx 0rpx;
  64. padding:30rpx;
  65. text-align: center;
  66. font-size: 32rpx;
  67. color:#333;
  68. }
  69. </style>