index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="content">
  3. <!-- <img src="../../static/bei.png" alt="" class="tubei"> -->
  4. <form @submit="formSubmit">
  5. <view class="avatorWrapper">
  6. </view>
  7. <view class="form">
  8. <view class="inputWrapper">
  9. <input class="input" name="yonghuming" type="text" value="" placeholder-style="font-size:.8125rem;color:rgb(223, 223, 223);" placeholder="请输入登录账号" @blur="spggBlur"/>
  10. </view>
  11. <view class="inputWrapper">
  12. <input class="input" name="mima" type="password" value="" placeholder-style="font-size:.8125rem;color:rgb(223, 223, 223);" placeholder="请输入密码" @blur="spggBlur1"/>
  13. </view>
  14. </view>
  15. <button form-type="submit" class="loginBtn">登录</button>
  16. </form>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. title: 'Hello',
  24. yonghuming:"",
  25. mima:"",
  26. }
  27. },
  28. onLoad() {
  29. },
  30. methods: {
  31. /**发布提交 */
  32. formSubmit(e) {
  33. var that = this;
  34. var yonghuming1= e.detail.value.yonghuming;
  35. var mima1= e.detail.value.mima;
  36. uni.request({
  37. url:'https://换成你自己的域名接口',
  38. header: {
  39. 'content-type': 'application/x-www-form-urlencoded'
  40. },
  41. method: 'POST',
  42. data: {
  43. yonghuming:yonghuming1,
  44. mima:mima1,
  45. },
  46. success: (res) => {
  47. if(res.data=="5"){
  48. wx.showToast({
  49. title: '用户名或密码错误',
  50. icon: 'none',
  51. duration: 500
  52. });
  53. }
  54. else{
  55. uni.navigateTo({
  56. url:"/pages/index1/index1",
  57. })
  58. }
  59. }
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style>
  66. .content {
  67. background: #377EB4;
  68. width: 100vw;
  69. height: 100vh;
  70. background: url('../../static/bei.png') no-repeat;
  71. background-size: 100% 100%;
  72. }
  73. .avatorWrapper{
  74. height: 20vh;
  75. width: 100vw;
  76. display: flex;
  77. justify-content: center;
  78. align-items: flex-end;
  79. }
  80. .avator{
  81. width: 200upx;
  82. height: 200upx;
  83. overflow: hidden;
  84. }
  85. .avator .img{
  86. width: 100%
  87. }
  88. .form{
  89. padding: 0 100upx;
  90. margin-top: 80px;
  91. }
  92. .inputWrapper{
  93. width: 100%;
  94. height: 80upx;
  95. background: rgba(0, 0, 0, 0);
  96. box-sizing: border-box;
  97. padding: 0 20px;
  98. margin-top: 25px;
  99. border-bottom: 1px solid rgb(223, 223, 223);
  100. }
  101. .inputWrapper .input{
  102. width: 100%;
  103. height: 100%;
  104. text-align: center;
  105. color: rgb(223, 223, 223);
  106. font-family: Noto Sans SC;
  107. font-size: .8125rem;
  108. font-weight: 500;
  109. }
  110. .loginBtn{
  111. width: 18.75rem;
  112. height: 2.5rem;
  113. background: linear-gradient(177.56deg, rgba(54.04,157.79,205.96,1) -33.78%,rgba(59.83,102.58,194.93,1) 173%);
  114. border-radius: 2px;
  115. margin-top: 50px;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. color: rgb(223, 223, 223);
  120. font-family: Noto Sans SC;
  121. font-size: 15px;
  122. font-weight: 700;
  123. }
  124. .loginBtn .btnValue{
  125. color: white;
  126. }
  127. .forgotBtn{
  128. text-align: center;
  129. color: #EAF6F9;
  130. font-size: 15px;
  131. margin-top: 20px;
  132. }
  133. </style>