bindPhoneNumber.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="tab-page">
  3. <view class="backimage">
  4. <image class="back" src="/static/image/login/back.png" mode=""></image>
  5. <image class="title-img" src="/static/image/login/bindPhoneNumber.png" mode=""></image>
  6. <image class="title" src="/static/image/login/bindTip.png" mode=""></image>
  7. </view>
  8. <view class="info ">
  9. <u--input v-model="info.mobile" border="bottom" clearable maxlength="11" placeholderStyle="color:#999"
  10. style="padding: 34rpx 0;box-sizing: border-box;" :focus="true">
  11. </u--input>
  12. </view>
  13. <view class=" btn dis a-c j-c " @click="getVerificationCode">
  14. 获取验证码
  15. </view>
  16. <uni-Popup :show="modalshow" @close='modalshow=false' headerTitle="请输入下方图形验证码" overflow="auto"
  17. maxHeight="580rpx" mode="center" width="90%">
  18. <template #content>
  19. <view class="codemodal">
  20. <u--input v-model="info.captcha" border="bottom" clearable placeholder="请输入图形验证码" maxlength="5"
  21. placeholderStyle="color:#999" style="padding: 34rpx 0;box-sizing: border-box;">
  22. </u--input>
  23. <view class="suffixClass">
  24. <image :src="imgcodesrc" mode="" @tap="refreshCaptcha" style="width: 146rpx;height: 52rpx;">
  25. </image>
  26. </view>
  27. <view class="dis a-c j-end mt-1">
  28. <text style="font-size: 26rpx; color: #666;" @tap="refreshCaptcha">看不清?换一张</text>
  29. </view>
  30. <view class="buttom dis a-c j-c mt-4" @click="confirm">
  31. <text>确定</text>
  32. </view>
  33. </view>
  34. </template>
  35. </uni-Popup>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. mapState,
  41. mapMutations
  42. } from "vuex"
  43. export default {
  44. data() {
  45. return {
  46. modalshow: false,
  47. imgcodesrc: "", //图形验证码
  48. info: {
  49. code: "",
  50. mobile: "",
  51. captcha: "", //验证码
  52. captchaId: "", //验证码id
  53. },
  54. }
  55. },
  56. onLoad(options) {
  57. if (options.code) {
  58. this.info.code = options.code;
  59. }
  60. },
  61. watch: {
  62. },
  63. onShow() {},
  64. methods: {
  65. getVerificationCode() {
  66. if (this.info.mobile.length < 11) {
  67. return uni.showToast({
  68. title: '请输入正确的手机号',
  69. icon: 'none'
  70. });
  71. }
  72. this.modalshow = true;
  73. this.refreshCaptcha();
  74. },
  75. // 图片验证码
  76. refreshCaptcha() {
  77. let randnum = Math.floor(Math.random() * (1000000 - 1 + 1)) + 1
  78. this.imgcodesrc = this.$base.baseUrl + "/auth/captchaById?t=" + new Date().getTime() +
  79. '&captchaId=' + randnum;
  80. this.info.captchaId = randnum;
  81. },
  82. confirm() {
  83. uni.navigateTo({
  84. url: '/pages/login/smsCode?info=' + JSON.stringify(this.info),
  85. })
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. page {
  92. background-color: #fff;
  93. }
  94. .backimage {
  95. width: 100%;
  96. height: 503rpx;
  97. background-color: #fff;
  98. position: relative;
  99. .back {
  100. width: 100%;
  101. height: 100%;
  102. }
  103. .title-img {
  104. position: absolute;
  105. top: 247rpx;
  106. left: 60rpx;
  107. width: 516rpx;
  108. height: 91rpx;
  109. }
  110. .title {
  111. position: absolute;
  112. top: 347rpx;
  113. left: 60rpx;
  114. width: 612rpx;
  115. height: 36rpx;
  116. }
  117. }
  118. .info {
  119. padding: 0 75rpx;
  120. box-sizing: border-box;
  121. .icon-img {
  122. width: 30rpx;
  123. height: 30rpx;
  124. }
  125. }
  126. //登录
  127. .performLogin {
  128. margin-top: 100rpx;
  129. .buttom {
  130. width: 100%;
  131. padding: 19rpx;
  132. box-sizing: border-box;
  133. background-color: #FDE935;
  134. border-radius: 45rpx;
  135. font-weight: bold;
  136. font-size: 36rpx;
  137. color: #1f1f1f;
  138. }
  139. .arigon {
  140. font-size: 28rpx;
  141. color: #666;
  142. padding: 0 30rpx;
  143. box-sizing: border-box;
  144. }
  145. }
  146. .footer {
  147. position: fixed;
  148. left: 0;
  149. right: 0;
  150. bottom: 62rpx;
  151. text {
  152. font-size: 26rpx;
  153. color: #999;
  154. }
  155. }
  156. .codemodal {
  157. padding: 40rpx;
  158. box-sizing: border-box;
  159. .buttom {
  160. width: 100%;
  161. padding: 19rpx;
  162. box-sizing: border-box;
  163. background-color: #FDE935;
  164. border-radius: 45rpx;
  165. font-weight: bold;
  166. font-size: 36rpx;
  167. color: #1f1f1f;
  168. }
  169. }
  170. .sendcode {
  171. font-size: 28rpx;
  172. color: #F9E000;
  173. }
  174. .u-page__code-text {
  175. padding: 4rpx 18rpx;
  176. background: rgba(253, 233, 53, 0.2);
  177. border-radius: 6rpx 6rpx 6rpx 6rpx;
  178. border: 1rpx solid #FDE935;
  179. color: #333333;
  180. font-size: 26rpx;
  181. }
  182. .btn {
  183. margin: 60rpx 75rpx 0;
  184. box-sizing: border-box;
  185. background: #FDE935;
  186. border-radius: 58rpx 58rpx 58rpx 58rpx;
  187. padding: 20rpx;
  188. box-sizing: border-box;
  189. font-weight: bold;
  190. }
  191. .suffixClass {
  192. margin-left: 10rpx;
  193. font-size: 30rpx;
  194. }
  195. </style>