江西小程序管理端
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.

193 lines
4.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="main">
  3. <view class="u-back-top">
  4. <view class="backBox">
  5. <u-icon name="arrow-left" color="#333" size="28"></u-icon>
  6. </view>
  7. </view>
  8. <view class="title">
  9. <image src="@/static/images/userCenter/loginTitle.png" mode=""></image>
  10. </view>
  11. <view class="form">
  12. <view class="form-item">
  13. <view class="inputBox my">
  14. <u--input placeholder="请输入登录账号" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input>
  15. </view>
  16. </view>
  17. <view class="form-item">
  18. <view class="inputBox my">
  19. <u--input placeholder="请输入密码" border="none" clearable style="height: 100%;" :clearable="false" v-model="FormData.password"></u--input>
  20. </view>
  21. </view>
  22. <view class="forgetTps" @click="$u.toast('请联系管理员重置密码!')">忘记密码</view>
  23. <view class="loginBtn" :class="{active: btnHighlight}" @click="submitFn"> </view>
  24. <!-- <view class="radioWrap">
  25. <u-checkbox-group >
  26. <u-checkbox v-model="isCheck" shape="circle" label="已阅读并同意" :labelSize="12" ></u-checkbox>
  27. </u-checkbox-group>
  28. <view class="privacyText">
  29. <text>用户协议</text> <text>隐私协议</text>
  30. </view>
  31. </view> -->
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { getLoginCode } from '@/config/api.js'
  37. export default {
  38. data() {
  39. return {
  40. isCheck: false,
  41. codeText: '获取验证码',
  42. FormData: {},
  43. codeOn: false
  44. }
  45. },
  46. onLoad() {
  47. },
  48. computed: {
  49. isPhone() {
  50. return uni.$u.test.mobile(this.FormData.phone)
  51. },
  52. btnHighlight() {
  53. return this.isPhone&&this.FormData.password
  54. }
  55. },
  56. methods: {
  57. // 是否选择协议
  58. groupChangeEnvnt(e) {
  59. this.isCheck = e.value
  60. console.log('是否选择协议', this.isCheck)
  61. },
  62. // 发送短信验证码
  63. async goSms() {
  64. const {
  65. FormData
  66. } = this
  67. if (!FormData.phone) return this.$u.toast('请输入手机号');
  68. if (!this.isPhone) return this.$u.toast('手机号格式有误');
  69. if (this.codeOn) return
  70. const data = await getLoginCode({
  71. codeType: 1,
  72. phone: FormData.phone,
  73. })
  74. console.log(data)
  75. // 获取验证码
  76. var time = 60;
  77. var timer = setInterval(() => {
  78. time--;
  79. this.codeText = time + "秒后重新发送"
  80. this.codeOn = true;
  81. if (time == 0) {
  82. clearInterval(timer);
  83. this.codeText = "获取验证码";
  84. this.codeOn = false;
  85. }
  86. }, 1000);
  87. },
  88. submitFn() {
  89. let val = 1
  90. if(this.FormData.phone=='18267103167') {
  91. val = 1
  92. }else if(this.FormData.phone=='18267103168') {
  93. val = 2
  94. }else {
  95. val = 3
  96. }
  97. this.$store.commit('upDateIdentity', val)
  98. uni.reLaunch({
  99. url: '/pages/tabbar/statistics/index'
  100. })
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .main {
  107. width: 100%;
  108. min-height: 100vh;
  109. background: url('../../../static/images/userCenter/loginTopBg.png') no-repeat;
  110. background-size: 100% 360rpx;
  111. .u-back-top {
  112. padding: 32rpx 0 0 0;
  113. .backBox {
  114. padding: 24rpx;
  115. }
  116. }
  117. .title {
  118. width: 658rpx;
  119. height: 94rpx;
  120. margin: 130rpx auto 114rpx auto;
  121. }
  122. .form {
  123. padding: 0 46rpx;
  124. .form-item {
  125. height: 112rpx;
  126. background: #F4F7FF;
  127. border-radius: 16rpx;
  128. width: 100%;
  129. line-height: 112rpx;
  130. display: flex;
  131. margin-bottom: 40rpx;
  132. padding: 0 40rpx;
  133. .prefix {
  134. display: flex;
  135. align-items: center;
  136. font-size: 32rpx;
  137. color: #333;
  138. font-weight: 600;
  139. }
  140. .inputBox {
  141. flex: 1;
  142. }
  143. .code {
  144. color: #BBBBBB;
  145. margin-left: 30rpx;
  146. &.active {
  147. color: $themC
  148. }
  149. }
  150. }
  151. .forgetTps {
  152. font-size: 28rpx;
  153. color: $themC;
  154. margin-top: -20rpx;
  155. text-align: right;
  156. }
  157. .loginBtn {
  158. width: 100%;
  159. height: 112rpx;
  160. background: rgba(25,137,250,0.3);
  161. border-radius: 16rpx;
  162. text-align: center;
  163. line-height: 112rpx;
  164. font-size: 32rpx;
  165. font-weight: 600;
  166. color: #fff;
  167. margin-top: 100rpx;
  168. &.active {
  169. background: rgba(25,137,250,1);
  170. }
  171. }
  172. .radioWrap {
  173. display: flex;
  174. align-items: center;
  175. margin-top: 40rpx;
  176. .privacyText {
  177. font-size: 24rpx;
  178. color: #888E94;
  179. text {
  180. color: $themC;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>