index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="page-box login-box">
  3. <view class="login-form">
  4. <view class="from-title">
  5. <view class="title-list">
  6. <view class="title-text dominant-text-color sys-size-28 text-center sys-weight-500" @click="setType(1)">验证码登录</view>
  7. <view class="title-text sys-size-28 text-center sys-weight-500" @click="setType(2)">密码登录</view>
  8. </view>
  9. <view class="title-bg one-background-color"></view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. components: {
  17. },
  18. data() {
  19. return {
  20. type:1,
  21. password:'',
  22. code:''
  23. }
  24. },
  25. mounted() {
  26. },
  27. methods: {
  28. setType(type){
  29. if(type!==this.type){
  30. this.type=type
  31. }
  32. },
  33. login() {
  34. uni.redirectTo({
  35. url: '/pages/index/index'
  36. })
  37. },
  38. },
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. @import "/static/css/login.css";
  43. .page-box{
  44. padding-top: 370rpx;
  45. .login-form{
  46. margin: 0 30rpx;
  47. height: 630rpx;
  48. border-radius: 50rpx;
  49. .from-title{
  50. background-color: rgba(255,255,255,0.5);
  51. border-radius: 50rpx 50rpx 0 0;
  52. height: 110rpx;
  53. position: relative;
  54. .title-bg{
  55. position: absolute;
  56. border-radius: 50rpx 50rpx 0 0;
  57. top: 0;
  58. left: 0;
  59. height:110rpx;
  60. width: 50%;
  61. transition: .5s ease;
  62. z-index: 0;
  63. }
  64. .title-bg::after {
  65. content: '';
  66. position: absolute;
  67. right: -50rpx;
  68. bottom: 0;
  69. width: 50rpx;
  70. height:50rpx;
  71. background-color: #fff;
  72. border-radius: 50rpx 50rpx 50rpx 0;
  73. clip-path:path('M 50,0 C 25,0 25,50 0,50 L 50,50 Z');
  74. }
  75. .title-list{
  76. display: flex;
  77. justify-content: space-between;
  78. z-index: 1;
  79. position: relative;
  80. .title-text{
  81. width: 50%;
  82. height: 102rpx;
  83. line-height: 102rpx;
  84. }
  85. }
  86. }
  87. }
  88. }
  89. </style>