bindPhone.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view>
  3. <navbar :config="config" backColor="#999999"></navbar>
  4. <view class="box">
  5. <view class="item">
  6. <u-input v-model="form.value" type="text" placeholder="请输入手机号" />
  7. </view>
  8. <view class="item flex">
  9. <u-input v-model="form.value" type="text" placeholder="请输入验证码" />
  10. <view @click="getCode()">{{txt}}</view>
  11. </view>
  12. </view>
  13. <view class="btnBox">
  14. <u-button type="primary" @click="logOut">完 成</u-button>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. config: {
  23. back: true, //false是tolbar页面 是则不写
  24. title: '绑定手机号',
  25. color: '#1A1A1A',
  26. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  27. backgroundColor: [1, "#FFFFFF"],
  28. },
  29. form: {},
  30. txt: "获取验证码"
  31. }
  32. },
  33. methods: {
  34. getCode() {
  35. if (this.txt == "获取验证码") {
  36. this.txt=60+'s'
  37. let num=60;
  38. this.$u.toast('验证码已发送');
  39. let setTime = setInterval(() => {
  40. num--
  41. this.txt=num+'s'
  42. if (num == 0) {
  43. this.txt = "获取验证码";
  44. clearTimeout(setTime)
  45. }
  46. }, 1000);
  47. }
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. /deep/ .hxicon {
  54. color: #1A1A1A !important;
  55. }
  56. .box {
  57. padding: 20rpx;
  58. .item {
  59. padding: 20rpx 30rpx;
  60. border-bottom: 1rpx solid rgb(222, 222, 222);
  61. /deep/ .u-input__input {
  62. font-size: 32rpx;
  63. }
  64. }
  65. .flex {
  66. display: flex;
  67. justify-content: space-between;
  68. align-items: center;
  69. >view {
  70. color: rgb(64, 149, 226);
  71. }
  72. }
  73. }
  74. .btnBox{
  75. width: 100%;
  76. display: flex;
  77. justify-content: center;
  78. margin-top: 30rpx;
  79. }
  80. .u-btn{
  81. width: 90%;
  82. border-radius: 10rpx;
  83. background: rgb(64,149,229);
  84. }
  85. </style>