cancelAccount.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="container">
  3. <view class="desc-box">
  4. 请您注意,注销申请一经提交,则无法撤销,请谨慎选择!
  5. </view>
  6. <view class="form-box">
  7. <u-form :model="formData.form" ref="formRef" label-width="120" :label-style="{fontWeight: 'bold', fontSize: '26rpx'}">
  8. <u-form-item prop="phone">
  9. <view class="input-code">
  10. <view class="input">
  11. <u-input v-model="formData.form.phone" :border="true" type="text" placeholder="请输入绑定手机号"/>
  12. </view>
  13. <view class="btn">
  14. <text class="form-item-text" @click="getCode">{{tips}}</text>
  15. </view>
  16. </view>
  17. </u-form-item>
  18. <u-form-item prop="code">
  19. <u-input v-model="formData.form.code" :border="true" type="text" placeholder="请输入验证码"/>
  20. </u-form-item>
  21. </u-form>
  22. </view>
  23. <view class="bottom-box">
  24. <u-button type="primary" shape="circle" @click="onSubmit">确定注销</u-button>
  25. </view>
  26. </view>
  27. </template>
  28. <script setup>
  29. import { ref, reactive } from 'vue'
  30. import { onLoad, onReady } from '@dcloudio/uni-app'
  31. const formRef = ref()
  32. const formData = reactive({
  33. form: {
  34. email: null
  35. },
  36. rules: {
  37. email: [
  38. {
  39. required: true,
  40. message: '请输入电子邮箱',
  41. // 可以单个或者同时写两个触发验证方式
  42. trigger: 'blur',
  43. }
  44. ]
  45. },
  46. })
  47. const tips = ref('获取验证码') // 59秒重新获取
  48. function onSubmit() {
  49. formRef.value.validate((valid) => {
  50. if (valid) {
  51. // 提交
  52. }
  53. })
  54. }
  55. onReady(() => {
  56. formRef.value.setRules(formData.rules)
  57. })
  58. </script>
  59. <style lang="scss" scoped>
  60. .container {
  61. height: 100vh;
  62. width: 100vw;
  63. background-color: $uni-bg-color;
  64. padding: 20rpx;
  65. .desc-box {
  66. text-indent: 2em;
  67. line-height: 60rpx;
  68. padding: 20rpx 0;
  69. margin-bottom: 20rpx;
  70. }
  71. .form-box {
  72. padding: 20rpx 0;
  73. .input-code {
  74. display: flex;
  75. align-items: center;
  76. gap: 20rpx;
  77. .input {
  78. width: 70%;
  79. }
  80. .btn {
  81. width: 30%;
  82. text-align: center;
  83. }
  84. }
  85. }
  86. .bottom-box {
  87. margin-top: 50rpx;
  88. padding: 0 50rpx;
  89. }
  90. }
  91. </style>