展品维保小程序前端代码接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
4.8 KiB

2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
  1. <template>
  2. <view class="login-container">
  3. <!-- 背景图 -->
  4. <image class="bg-image" src="@/subPages/static/登录_背景图.png" mode="aspectFill"></image>
  5. <!-- 主要内容 -->
  6. <view class="content">
  7. <!-- Logo和标题区域 -->
  8. <view class="logo-section">
  9. <image class="logo" :src="configParamImage('app_logo')" mode="aspectFit"></image>
  10. <text class="title-text">展品维保报修小程序</text>
  11. </view>
  12. <!-- 登录按钮区域 -->
  13. <view class="login-section">
  14. <button class="login-btn" @click="handleLogin">
  15. 授权手机号登录
  16. </button>
  17. <button class="guest-btn" @click="handleGuestLogin">
  18. 暂不登录
  19. </button>
  20. <!-- 协议文本 -->
  21. <view class="agreement-text">
  22. <view class="agreement-content">
  23. <view class="checkbox-container" @click="toggleAgreement">
  24. <view class="checkbox" :class="{ 'checked': isAgreed }">
  25. <view class="checkbox-inner" v-if="isAgreed"></view>
  26. </view>
  27. </view>
  28. <text>阅读并同意我们的
  29. <text class="link-text" @click="showServiceAgreement">服务协议与隐私条款</text>
  30. <text></text>
  31. <text class="link-text" @click="showPrivacyPolicy">个人信息保护指引</text>
  32. </text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. name: 'Login',
  42. data() {
  43. return {
  44. isAgreed: false
  45. }
  46. },
  47. methods: {
  48. // 授权登录
  49. handleLogin() {
  50. // 这里实现微信授权登录逻辑
  51. console.log('授权登录');
  52. // 可以调用微信授权API
  53. // uni.getUserProfile({
  54. // desc: '用于完善用户资料',
  55. // success: (res) => {
  56. // // 登录成功后跳转
  57. // uni.switchTab({
  58. // url: '/pages/index/home'
  59. // });
  60. // }
  61. // });
  62. },
  63. // 游客登录
  64. handleGuestLogin() {
  65. console.log('暂不登录');
  66. // 跳转到主页
  67. uni.switchTab({
  68. url: '/pages/index/home'
  69. });
  70. },
  71. // 显示服务协议
  72. showServiceAgreement() {
  73. console.log('查看服务协议');
  74. // 这里可以跳转到协议页面或显示弹窗
  75. },
  76. // 显示隐私政策
  77. showPrivacyPolicy() {
  78. console.log('查看隐私条款');
  79. // 这里可以跳转到隐私政策页面或显示弹窗
  80. },
  81. // 切换协议同意状态
  82. toggleAgreement() {
  83. this.isAgreed = !this.isAgreed;
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .login-container {
  90. position: relative;
  91. width: 100vw;
  92. height: 100vh;
  93. overflow: hidden;
  94. .bg-image {
  95. position: absolute;
  96. top: 0;
  97. left: 0;
  98. width: 100%;
  99. height: 100%;
  100. z-index: 1;
  101. }
  102. .content {
  103. position: relative;
  104. z-index: 2;
  105. height: 100%;
  106. display: flex;
  107. flex-direction: column;
  108. align-items: center;
  109. justify-content: center;
  110. padding: 0 60rpx;
  111. .logo-section {
  112. display: flex;
  113. flex-direction: column;
  114. align-items: center;
  115. margin-bottom: 120rpx;
  116. .logo {
  117. width: 120rpx;
  118. height: 120rpx;
  119. margin-bottom: 40rpx;
  120. }
  121. .title-text {
  122. font-size: 36rpx;
  123. font-weight: 600;
  124. color: $primary-text-color;
  125. text-align: center;
  126. }
  127. }
  128. .login-section {
  129. width: 100%;
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. .login-btn {
  134. width: 630rpx;
  135. height: 88rpx;
  136. margin-bottom: 30rpx;
  137. background-color: $primary-color;
  138. border: none;
  139. border-radius: 44rpx;
  140. color: white;
  141. font-size: 32rpx;
  142. font-weight: 500;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. }
  147. .guest-btn {
  148. width: 630rpx;
  149. height: 88rpx;
  150. margin-bottom: 60rpx;
  151. border: 2rpx solid $secondary-text-color;
  152. border-radius: 44rpx;
  153. color: $secondary-text-color;
  154. font-size: 32rpx;
  155. font-weight: 400;
  156. background-color: transparent;
  157. display: flex;
  158. align-items: center;
  159. justify-content: center;
  160. }
  161. .agreement-text {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. font-size: 24rpx;
  166. color: $secondary-text-color;
  167. line-height: 1.5;
  168. .checkbox-container {
  169. margin-right: 12rpx;
  170. cursor: pointer;
  171. .checkbox {
  172. width: 29rpx;
  173. height: 29rpx;
  174. border: 1rpx solid $secondary-text-color;
  175. border-radius: 50%;
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. transition: all 0.3s ease;
  180. &.checked {
  181. border-color: $primary-color;
  182. background-color: $primary-color;
  183. }
  184. .checkbox-inner {
  185. width: 16rpx;
  186. height: 16rpx;
  187. background-color: white;
  188. border-radius: 50%;
  189. }
  190. }
  191. }
  192. .agreement-content {
  193. flex: 1;
  194. text-align: left;
  195. display: flex;
  196. .link-text {
  197. color: $primary-color;
  198. text-decoration: underline;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. </style>