index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="content">
  3. <view class="title-text">
  4. 欢迎登录!
  5. </view>
  6. <view class="title-icon">
  7. </view>
  8. <loginPassword :themeColor="themeColor" :logoUrl="logoUrl" @loginFun="loginFun"></loginPassword>
  9. </view>
  10. </template>
  11. <script>
  12. import loginPassword from '@/components/ay-login/login-password.vue';
  13. import backImage from '@/static/home.png';
  14. export default {
  15. components: {
  16. loginPassword
  17. },
  18. data() {
  19. return {
  20. themeColor: '#33CCCC',
  21. logoUrl: 'https://cdn.pixabay.com/photo/2016/11/23/17/55/beach-1854072__340.jpg',
  22. }
  23. },
  24. onLoad() {
  25. },
  26. methods: {
  27. loginFun(data) {
  28. this.$http('common.login', data, '登录中', true).then((res) => {
  29. if (res.success == true) {
  30. uni.setStorageSync('token', res.data.token);
  31. uni.showToast({
  32. title: '登录成功',
  33. icon: 'none',
  34. success: function() {
  35. uni.navigateTo({
  36. url: '/pages/home/home',
  37. success: function(res) {}
  38. });
  39. }
  40. }, );
  41. }
  42. })
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .content {
  49. width: 100%;
  50. height: 100%;
  51. background: url('../../static/loginback.png');
  52. background-size: 100% 100%;
  53. padding-top: 60rpx;
  54. position: relative;
  55. .title-text {
  56. width: 200rpx;
  57. height: 56rpx;
  58. font-family: PingFangSC-bold;
  59. font-weight: normal;
  60. font-size: 40rpx;
  61. margin-left: 50rpx;
  62. }
  63. .title-icon {
  64. position: absolute;
  65. right: 0rpx;
  66. top: 90rpx;
  67. width: 358rpx;
  68. height: 358rpx;
  69. background: url('../../static/icontitle.svg');
  70. background-size: 100% 100%;
  71. }
  72. }
  73. </style>