普兆健康管家前端代码仓库
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.

282 lines
6.1 KiB

  1. <template>
  2. <view class="page_view">
  3. <image class="bg" src="@/pages_order/static/auth/bg.png" mode="aspectFill"></image>
  4. <view class="content flex flex-column">
  5. <!-- todo: 替换为配置项 -->
  6. <image class="logo" src="@/pages_order/static/auth/logo.png" mode="widthFix"></image>
  7. <view class="box">
  8. <view class="box-intro">Hi ></view>
  9. <uv-input
  10. v-model="form.account"
  11. placeholder="请输入账号"
  12. border="none"
  13. shape='circle'
  14. clearable
  15. :customStyle="{
  16. 'margin-top': '64rpx',
  17. 'padding': '37rpx 52rpx',
  18. 'background-color': '#FAFAFF',
  19. 'box-shadow': 'inset -10rpx -10rpx 20rpx 0 rgba(255, 255, 255, 0.77), inset 10rpx 10rpx 20rpx 0 rgba(170, 170, 204, 0.12), inset 4rpx 4rpx 8rpx 0 rgba(170, 170, 204, 0.25), inset -4rpx -4rpx 8rpx 0 rgba(255, 255, 255, 0.5)',
  20. }"
  21. >
  22. <template #prefix>
  23. <image class="input-prefix-icon" src="@/pages_order/static/auth/account.png" mode="widthFix"></image>
  24. </template>
  25. </uv-input>
  26. <uv-input
  27. v-model="form.password"
  28. placeholder="请输入密码"
  29. :type="passwordInputType"
  30. border="none"
  31. shape='circle'
  32. clearable
  33. :customStyle="{
  34. 'margin-top': '24rpx',
  35. 'padding': '37rpx 52rpx',
  36. 'background-color': '#FAFAFF',
  37. 'box-shadow': 'inset -10rpx -10rpx 20rpx 0 rgba(255, 255, 255, 0.77), inset 10rpx 10rpx 20rpx 0 rgba(170, 170, 204, 0.12), inset 4rpx 4rpx 8rpx 0 rgba(170, 170, 204, 0.25), inset -4rpx -4rpx 8rpx 0 rgba(255, 255, 255, 0.5)',
  38. }"
  39. >
  40. <template #prefix>
  41. <image class="input-prefix-icon" src="@/pages_order/static/auth/account.png" mode="widthFix"></image>
  42. </template>
  43. <template #suffix v-if="form.password">
  44. <image class="input-prefix-icon" src="@/pages_order/static/auth/hide.png" mode="widthFix"
  45. @click="switchPasswordInputType"
  46. ></image>
  47. </template>
  48. </uv-input>
  49. <button class="btn flex" @click="onAccountLogin" > </button>
  50. <view class="agreement">
  51. <uv-checkbox-group
  52. v-model="checkboxValue"
  53. shape="circle"
  54. >
  55. <uv-checkbox
  56. size="36rpx"
  57. icon-size="36rpx"
  58. activeColor="#7451DE"
  59. :name="1"
  60. ></uv-checkbox>
  61. </uv-checkbox-group>
  62. <view class="desc">
  63. 我已阅读并同意
  64. <!-- todo: 替换配置项key -->
  65. <text class="highlight" @click="$refs.popup.open('config_privacy')">服务协议与隐私条款</text>
  66. <!-- todo: 替换配置项key -->
  67. <text class="highlight" @click="$refs.popup.open('config_agreement')">个人信息保护指引</text>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="other">
  72. <view class="title">其他登录方式</view>
  73. <view class="btns">
  74. <button class="btn flex" @click="onPhoneLogin" >
  75. <image class="btn-icon" src="@/pages_order/static/auth/phone.png" mode="widthFix"></image>
  76. </button>
  77. <button class="btn flex" @click="onWxLogin" >
  78. <image class="btn-icon" src="@/pages_order/static/auth/wx.png" mode="widthFix"></image>
  79. </button>
  80. </view>
  81. </view>
  82. </view>
  83. <configPopup ref="popup"></configPopup>
  84. </view>
  85. </template>
  86. <script>
  87. export default {
  88. name : 'Login',
  89. data() {
  90. return {
  91. checkboxValue : [],
  92. form: {
  93. account: null,
  94. password: null,
  95. },
  96. passwordInputType: 'password',
  97. }
  98. },
  99. components: {
  100. },
  101. methods: {
  102. onAccountLogin() {
  103. // todo
  104. },
  105. onPhoneLogin() {
  106. // todo
  107. },
  108. onWxLogin() {
  109. // todo
  110. },
  111. wxLogin(){
  112. if(!this.checkboxValue.length){
  113. return uni.showToast({
  114. title: '请先同意隐私协议',
  115. icon:'none'
  116. })
  117. }
  118. this.$store.commit('login')
  119. },
  120. openModal() {
  121. this.$refs.modal.open()
  122. },
  123. onConfirmAggrement(confirm) {
  124. if (confirm) {
  125. this.checkboxValue = [1]
  126. } else {
  127. this.checkboxValue = []
  128. }
  129. },
  130. onCancel() {
  131. console.log('--onCancel')
  132. uni.reLaunch({
  133. url: '/pages/index/index'
  134. })
  135. },
  136. switchPasswordInputType() {
  137. this.passwordInputType = this.passwordInputType === 'password' ? 'text' : 'password'
  138. },
  139. }
  140. }
  141. </script>
  142. <style scoped lang="scss">
  143. .page_view {
  144. width: 100vw;
  145. height: 100vh;
  146. }
  147. .bg,
  148. .content {
  149. width: 100%;
  150. height: 100%;
  151. }
  152. .content {
  153. position: absolute;
  154. top: 0;
  155. justify-content: flex-start;
  156. padding: 208rpx 40rpx 0 40rpx;
  157. box-sizing: border-box;
  158. }
  159. .logo {
  160. width: 366rpx;
  161. height: auto;
  162. }
  163. .box {
  164. margin-top: 48rpx;
  165. width: 100%;
  166. padding: 64rpx 40rpx;
  167. box-sizing: border-box;
  168. background: rgba(255, 255, 255, 0.48);
  169. border: 1rpx solid #FFFFFF;
  170. border-radius: 48rpx;
  171. &-intro {
  172. color: $uni-color;
  173. font-size: 44rpx;
  174. line-height: 1.4;
  175. font-weight: 600;
  176. font-family: PingFang SC;
  177. }
  178. .input-prefix-icon {
  179. width: 32rpx;
  180. height: auto;
  181. }
  182. /deep/ .uv-input__content__prefix-icon {
  183. margin-right: 16rpx;
  184. }
  185. .btn {
  186. margin-top: 64rpx;
  187. border-radius: 44rpx;
  188. padding: 23rpx 0;
  189. font-size: 30rpx;
  190. line-height: 1.4;
  191. font-weight: 600;
  192. font-family: PingFang SC;
  193. color: #FFFFFF;
  194. background-image: linear-gradient(to right, #007FFF, #644CFF, #BE76F7);
  195. box-shadow: 12rpx 12rpx 36rpx 0 rgba(0, 0, 0, 0.06),
  196. -8rpx -8rpx 26rpx 0 #FFFFFF,
  197. 8rpx 8rpx 14rpx 0 rgba(0, 0, 0, 0.07);
  198. }
  199. .agreement {
  200. margin-top: 24rpx;
  201. display: flex;
  202. .desc {
  203. font-family: PingFang SC;
  204. font-size: 24rpx;
  205. font-weight: 400;
  206. line-height: 1.4;
  207. color: #8B8B8B;
  208. }
  209. .highlight {
  210. color: $uni-color;
  211. }
  212. }
  213. }
  214. .other {
  215. margin-top: 48rpx;
  216. width: 100%;
  217. padding: 0 57rpx;
  218. box-sizing: border-box;
  219. .title {
  220. width: 100%;
  221. padding: 8rpx 0;
  222. text-align: center;
  223. font-weight: 400;
  224. font-size: 26rpx;
  225. line-height: 1.4;
  226. font-family: PingFang SC;
  227. color: #FFFFFF;
  228. background-image: linear-gradient(to right, #007FFF00, #644CFF, #BE76F700);
  229. }
  230. .btns {
  231. display: flex;
  232. justify-content: center;
  233. margin-top: 48rpx;
  234. }
  235. .btn {
  236. width: 80rpx;
  237. height: 80rpx;
  238. border-radius: 50%;
  239. background: #EEEEF7;
  240. box-shadow: -10rpx -10rpx 20rpx 0 #FFFFFFBF,
  241. 10rpx 10rpx 40rpx 0 #AAAACC80,
  242. 4rpx 4rpx 10rpx 0 #AAAACC40,
  243. -4rpx -4rpx 10rpx 0 #FFFFFFED;
  244. &-icon {
  245. width: 48rpx;
  246. height: auto;
  247. }
  248. }
  249. .btn + .btn {
  250. margin-left: 64rpx;
  251. }
  252. }
  253. </style>