login.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="container">
  3. <!-- 顶部 Banner 区域 -->
  4. <view class="banner-area">
  5. <image class="banner-img" :src="loginBackgroundUrl" mode="widthFix"></image>
  6. </view>
  7. <!-- 白色内容卡片 -->
  8. <view class="content-card">
  9. <!-- 悬浮 Logo -->
  10. <view class="logo-wrapper">
  11. <image class="logo-img" :src="loginIconUrl" mode="widthFix"></image>
  12. </view>
  13. <!-- 登录 Tab 切换 -->
  14. <!-- <view class="tabs">
  15. <view
  16. class="tab-item"
  17. :class="{ active: currentTab === 0 }"
  18. @click="currentTab = 0"
  19. >
  20. <text class="tab-text">免密登录</text>
  21. <view class="tab-indicator" v-if="currentTab === 0"></view>
  22. </view>
  23. <view class="divider"></view>
  24. <view
  25. class="tab-item"
  26. :class="{ active: currentTab === 1 }"
  27. @click="currentTab = 1"
  28. >
  29. <text class="tab-text">密码登录</text>
  30. <view class="tab-indicator" v-if="currentTab === 1"></view>
  31. </view>
  32. </view> -->
  33. <view class="tabs">
  34. <view class="tab-item active">
  35. <text class="tab-text">密码登录</text>
  36. <view class="tab-indicator"></view>
  37. </view>
  38. </view>
  39. <!-- 表单区域 -->
  40. <view class="form-area">
  41. <!-- 手机号 (通用) -->
  42. <view class="input-group">
  43. <view class="area-code">
  44. <text>+86</text>
  45. <text class="arrow">﹀</text>
  46. </view>
  47. <input
  48. class="input"
  49. type="number"
  50. placeholder="手机号"
  51. placeholder-style="color: #ccc"
  52. v-model="mobile"
  53. maxlength="11"
  54. />
  55. </view>
  56. <!-- 免密登录: 验证码 -->
  57. <!-- <view class="input-group" v-if="currentTab === 0">
  58. <input
  59. class="input"
  60. type="number"
  61. placeholder="验证码"
  62. placeholder-style="color: #ccc"
  63. v-model="code"
  64. maxlength="6"
  65. />
  66. <view class="get-code-btn" @click="getVerifyCode">
  67. <text class="code-text">{{ countDown > 0 ? `${countDown}s后重试` : '获取验证码' }}</text>
  68. </view>
  69. </view> -->
  70. <!-- 密码登录: 密码框 -->
  71. <view class="input-group">
  72. <input
  73. class="input"
  74. :password="!showPassword"
  75. type="text"
  76. placeholder="请输入密码"
  77. placeholder-style="color: #ccc"
  78. v-model="password"
  79. />
  80. <view class="eye-icon" @click="showPassword = !showPassword">
  81. <template v-if="showPassword">
  82. <!-- 睁眼线框图标 -->
  83. <svg class="svg-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  84. <path d="M12 4.5C7 4.5 2.73 7.61 1 12C2.73 16.39 7 19.5 12 19.5C17 19.5 21.27 16.39 23 12C21.27 7.61 17 4.5 12 4.5ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM12 9C10.34 9 9 10.34 9 12C9 13.66 10.34 15 12 15C13.66 15 15 13.66 15 12C15 10.34 13.66 9 12 9Z" fill="#CCCCCC"/>
  85. </svg>
  86. </template>
  87. <template v-else>
  88. <!-- 闭眼线框图标 (带睫毛) -->
  89. <svg class="svg-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  90. <path d="M12 7C7 7 2.73 10.11 1 14.5" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  91. <path d="M23 14.5C21.27 10.11 17 7 12 7" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  92. <path d="M12 7V4" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  93. <path d="M16 8L18 5" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  94. <path d="M8 8L6 5" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  95. <path d="M20 10L22 8" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  96. <path d="M4 10L2 8" stroke="#CCCCCC" stroke-width="2" stroke-linecap="round"/>
  97. </svg>
  98. </template>
  99. </view>
  100. </view>
  101. <!-- 忘记密码 -->
  102. <!-- <view class="forgot-pwd">
  103. <text @click="goToForgotPwd">忘记密码?</text>
  104. </view> -->
  105. <!-- 登录按钮 -->
  106. <button class="login-btn" @click="handleLogin">登 录</button>
  107. <!-- 协议 -->
  108. <view class="agreement">
  109. <view class="checkbox" :class="{ checked: isAgreed }" @click="isAgreed = !isAgreed">
  110. <text v-if="isAgreed" class="check-mark">✓</text>
  111. </view>
  112. <text class="agree-text">
  113. 我已经阅读并同意 <text class="link" @click.stop="showAgreement(1)">《用户服务协议》</text> 和 <text class="link" @click.stop="showAgreement(2)">《隐私政策》</text>
  114. </text>
  115. </view>
  116. </view>
  117. <!-- 底部招募入口 (固定底部) -->
  118. <view class="footer-recruit" @click="goToRecruit">
  119. <view class="recruit-badge">
  120. <!-- 旗帜线框图标 -->
  121. <svg class="svg-icon flag-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="width:30rpx; height:30rpx;">
  122. <path d="M4 14V4H18L17 9L18 14H4Z" stroke="#FF5722" stroke-width="2" stroke-linejoin="round"/>
  123. <path d="M4 22V14" stroke="#FF5722" stroke-width="2" stroke-linecap="round"/>
  124. </svg>
  125. <text> 宠宝履约者招募</text>
  126. </view>
  127. </view>
  128. <!-- 协议弹窗 公共组件 -->
  129. <agreement
  130. :visible="showAgreementModal"
  131. :title="agreementTitle"
  132. :content="agreementContent"
  133. @close="showAgreementModal = false"
  134. >
  135. </agreement>
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. // 使用脚本文件
  141. import logic from './logic.js';
  142. import Agreement from '@/components/agreement/index.vue';
  143. export default {
  144. ...logic,
  145. components: {
  146. Agreement
  147. }
  148. }
  149. </script>
  150. <style>
  151. /* 引用样式文件 */
  152. @import './style.css';
  153. </style>