index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="help-container">
  3. <uni-forms ref="form" :model="formData" labelWidth="95px" :rules="rules">
  4. <uni-forms-item label="原手机号码:" name="phone" required>
  5. <uni-easyinput v-model="formData.phone" placeholder="请输入原手机号码" maxlength="11" />
  6. </uni-forms-item>
  7. <view style="width: 100%;height: 40rpx;"></view>
  8. <uni-forms-item label="新手机号码:" name="newPhone" required>
  9. <uni-easyinput v-model="formData.newPhone" placeholder="请输入新手机号码" maxlength="11" />
  10. </uni-forms-item>
  11. <view style="width: 100%;height: 40rpx;"></view>
  12. <view style="display: flex;flex-wrap: nowrap;justify-content: center;align-items: center;">
  13. <view style="width: 65%;">
  14. <uni-forms-item label="验证码:" name="code" required>
  15. <uni-easyinput v-model="formData.code" placeholder="请输入新手机验证码" maxlength="6" />
  16. </uni-forms-item>
  17. </view>
  18. <view class="yaz-code">验证码</view>
  19. </view>
  20. <button type="primary" @click="submit" style="margin-top: 40rpx;width: 60%;">提交</button>
  21. </uni-forms>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. formData: {
  29. phone: '',
  30. newPhone: '',
  31. code: ''
  32. },
  33. rules: {
  34. phone: {
  35. rules: [{
  36. required: true,
  37. errorMessage: '原手机号码不能为空'
  38. },
  39. {
  40. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  41. errorMessage: '请输入正确的手机号码'
  42. }
  43. ]
  44. },
  45. newPhone: {
  46. rules: [{
  47. required: true,
  48. errorMessage: '新手机号码不能为空'
  49. }, {
  50. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  51. errorMessage: '请输入正确的手机号码'
  52. }]
  53. },
  54. code: {
  55. rules: [{
  56. required: true,
  57. errorMessage: '验证码不能为空'
  58. }]
  59. }
  60. }
  61. }
  62. },
  63. methods: {
  64. handleText(item) {
  65. this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
  66. },
  67. // 提交手机号
  68. submit() {
  69. console.log('iiiiiiiiii')
  70. this.$refs.form.validate().then(res => {
  71. // updateUserProfile(this.user).then(response => {
  72. // this.$modal.msgSuccess("修改成功")
  73. // })
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped>
  80. /deep/.uni-forms-item {
  81. margin-bottom: 0rpx !important;
  82. }
  83. </style>
  84. <style lang="scss" scoped>
  85. .yaz-code {
  86. width: 30%;
  87. margin-left: 5%;
  88. color: #fff;
  89. font-size: 28rpx;
  90. background-color: #42B983;
  91. text-align: center;
  92. padding: 17rpx;
  93. border-radius: 10rpx;
  94. }
  95. page {
  96. background-color: #f8f8f8;
  97. }
  98. .help-container {
  99. margin-bottom: 100rpx;
  100. padding: 30rpx;
  101. }
  102. .list-title {
  103. margin-bottom: 30rpx;
  104. }
  105. .childList {
  106. background: #ffffff;
  107. box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
  108. border-radius: 16rpx;
  109. margin-top: 10rpx;
  110. }
  111. .line {
  112. width: 100%;
  113. height: 1rpx;
  114. background-color: #F5F5F5;
  115. }
  116. .text-title {
  117. color: #303133;
  118. font-size: 32rpx;
  119. font-weight: bold;
  120. margin-left: 10rpx;
  121. .iconfont {
  122. font-size: 16px;
  123. margin-right: 10rpx;
  124. }
  125. }
  126. .text-item {
  127. font-size: 28rpx;
  128. padding: 24rpx;
  129. }
  130. .question {
  131. color: #606266;
  132. font-size: 28rpx;
  133. }
  134. </style>