phoneLoginOrRegister.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view class="login-container">
  3. <view>
  4. <view class="title-wrapper">
  5. <view class="title">手机号登录/注册</view>
  6. <view class="sub-title">未注册的手机号将自动完成账号注册</view>
  7. </view>
  8. <view class="input-wrapper flex align-center">
  9. <text class="country-code">{{ countryCode }}</text>
  10. <u-icon name="arrow-down" color="rgba(216, 216, 216, 1)"></u-icon>
  11. <text class="border">|</text>
  12. <input v-model="phoneNum" class="input" type="number" placeholder="请输入手机号" maxlength="11" placeholder-class="placeholder" />
  13. </view>
  14. <view class="protocol-wrapper flex">
  15. <view class="protocol-icon" @click="checked = !checked">
  16. <image src="@/static/images/jobApplicant/check.svg" v-if="checked" mode="scaleToFill" class="icon" />
  17. <image src="@/static/images/jobApplicant/border.svg" v-else mode="scaleToFill" class="icon" />
  18. </view>
  19. <view class="protocol-content">
  20. 已阅读并同意<navigator url="/my/setting/xieyi" class="link">《亿职赞用户协议》</navigator>
  21. 和<navigator url="/my/setting/mimi" class="link">《隐私协议》</navigator>,允许亿职赞统一管理本人账号信息
  22. </view>
  23. </view>
  24. <view class="button" :class="{ active: checked }" @click="handleSubmit">下一步</view>
  25. </view>
  26. <view class="infos flex align-center justify-between">
  27. <view class="info-button" v-for="item in infos" :key="item.type" @click="showPopup(item.type)">{{ item.name }}</view>
  28. </view>
  29. <u-popup v-model="show" mode="bottom" border-radius="14">
  30. <view class="popup-content">
  31. <view v-if="currentType == 1">企业套餐咨询</view>
  32. <view v-if="currentType == 2">投诉举报</view>
  33. <view v-if="currentType == 3">资质信息</view>
  34. </view>
  35. </u-popup>
  36. </view>
  37. </template>
  38. <script>
  39. import { jVerificationLogin } from '@/utils/jVerificationLogin'
  40. import { login } from '@/utils/login'
  41. export default {
  42. data() {
  43. return {
  44. countryCode: '+86',
  45. phoneNum: '',
  46. checked: false,
  47. show: false,
  48. infos: [
  49. {
  50. type: 1,
  51. name: '企业套餐咨询',
  52. },
  53. {
  54. type: 2,
  55. name: '投诉举报',
  56. },
  57. {
  58. type: 3,
  59. name: '资质信息',
  60. },
  61. ],
  62. currentType: 1,
  63. loading: false
  64. };
  65. },
  66. onLoad(options) {
  67. if (options.init) {
  68. jVerificationLogin((res) => {
  69. login(res)
  70. })
  71. }
  72. },
  73. methods: {
  74. showPopup(type) {
  75. this.currentType = type
  76. this.show = true
  77. },
  78. handleSubmit() {
  79. if (!this.checked || this.loading) {
  80. return
  81. }
  82. if (!this.phoneNum) {
  83. uni.showToast({
  84. title: '请输入手机号',
  85. icon: 'none'
  86. })
  87. return
  88. }
  89. if (!/^1[3-9]\d{9}$/.test(this.phoneNum)) {
  90. uni.showToast({
  91. title: '请输入正确的手机号',
  92. icon: 'none'
  93. })
  94. return
  95. }
  96. this.loading = true
  97. uni.showLoading({
  98. title: '正在发送验证码'
  99. })
  100. this.$Request
  101. .getT('/app/Login/sendMsg/' + this.phoneNum + '/bind')
  102. .then((res) => {
  103. if (res.code === 0) {
  104. uni.navigateTo({
  105. url: `/pages/public/verify?phoneNum=${this.phoneNum}&countryCode=${encodeURIComponent(this.countryCode)}`
  106. })
  107. } else {
  108. uni.showModal({
  109. showCancel: false,
  110. title: '短信发送失败',
  111. content: res.msg ? res.msg : '请一分钟后再获取验证码',
  112. });
  113. }
  114. })
  115. .finally(() => {
  116. this.loading = false
  117. uni.hideLoading();
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .login-container {
  125. display: flex;
  126. flex-direction: column;
  127. justify-content: space-between;
  128. height: 100vh;
  129. padding: 0 40rpx;
  130. .title-wrapper {
  131. padding-top: 132rpx;
  132. .title {
  133. font-size: 40rpx;
  134. font-weight: 700;
  135. line-height: 52rpx;
  136. color: rgba(51, 51, 51, 1);
  137. margin-bottom: 12rpx;
  138. }
  139. .sub-title {
  140. font-size: 28rpx;
  141. line-height: 36rpx;
  142. color: rgba(153, 153, 153, 1);
  143. }
  144. }
  145. .input-wrapper {
  146. margin-top: 120rpx;
  147. box-sizing: border-box;
  148. border: 1px solid rgba(242, 242, 242, 1);
  149. border-radius: 12rpx;
  150. background: rgba(250, 250, 250, 1);
  151. padding: 24rpx;
  152. .country-code {
  153. color: rgba(51, 51, 51, 1);
  154. margin-right: 24rpx;
  155. }
  156. .border {
  157. margin: 0 24rpx;
  158. color: rgba(234, 234, 234, 1);
  159. }
  160. .input {
  161. font-size: 28rpx;
  162. }
  163. .placeholder {
  164. color: rgba(153, 153, 153, 1);
  165. }
  166. }
  167. .protocol-wrapper {
  168. margin-top: 40rpx;
  169. .protocol-icon {
  170. width: 24rpx;
  171. margin-right: 16rpx;
  172. .icon {
  173. display: block;
  174. width: 24rpx;
  175. height: 24rpx;
  176. }
  177. }
  178. .protocol-content {
  179. flex: 1;
  180. display: flex;
  181. flex-wrap: wrap;
  182. font-size: 24rpx;
  183. line-height: 28rpx;
  184. color: rgba(96, 93, 103, 1);
  185. .link {
  186. color: #016BF6;
  187. }
  188. }
  189. }
  190. .button {
  191. width: 600rpx;
  192. height: 88rpx;
  193. text-align: center;
  194. color: #fff;
  195. line-height: 88rpx;
  196. font-size: 32rpx;
  197. font-weight: 500;
  198. border-radius: 100rpx;
  199. background: rgba(0, 0, 0, 0.08);
  200. margin: 40rpx auto;
  201. &.active {
  202. background: linear-gradient(90.00deg, rgba(13, 39, 247, 1),rgba(19, 193, 234, 1));
  203. }
  204. }
  205. .infos {
  206. width: 400rpx;
  207. margin: 0 auto 100rpx;
  208. color: rgba(153, 153, 153, 1);
  209. font-size: 24rpx;
  210. line-height: 28rpx;
  211. }
  212. .popup-content {
  213. padding: 40rpx;
  214. }
  215. }
  216. </style>