senior.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="layout-page" :style="themeStyle">
  3. <v-header :title="$t('auth.a4')"></v-header>
  4. <main class="layout-main">
  5. <div class="form-item p-md m-md">
  6. <div class="color-light p-b-xs">1、{{$t('auth.b5')}}</div>
  7. <div class="d-flex justify-between m-t-md ">
  8. <div class="examples m-r-xs bg-panel-3 p-md rounded-sm box-shadow">
  9. <img src="static/img/fill6.png" />
  10. </div>
  11. <div
  12. @click="getFile('front_img')"
  13. class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
  14. >
  15. <van-icon v-if="!form.front_img" class="color-light fn-30" name="photograph" />
  16. <img v-else :src="form.front_img" alt />
  17. </div>
  18. </div>
  19. </div>
  20. <div class="form-item p-md m-md">
  21. <div class="color-light p-b-xs">2、{{$t('auth.b6')}}</div>
  22. <div class="d-flex justify-between m-t-md">
  23. <div class="examples m-r-xs bg-panel-3 p-md rounded-sm box-shadow">
  24. <img src="static/img/fill7.png" />
  25. </div>
  26. <div
  27. @click="getFile('back_img')"
  28. class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
  29. >
  30. <van-icon v-if="!form.back_img" class="color-light fn-30" name="photograph" />
  31. <img v-else :src="form.back_img" alt />
  32. </div>
  33. </div>
  34. </div>
  35. <div class="form-item p-md m-md ">
  36. <div class="color-light p-b-xs">3、{{$t('auth.b7')}}</div>
  37. <div class="fn-sm ">{{$t('auth.b8')}}。</div>
  38. <div class="d-flex justify-between m-t-md">
  39. <div class="examples m-r-xs bg-panel-3 p-md rounded-sm box-shadow">
  40. <img src="static/img/fill6.png" />
  41. </div>
  42. <div
  43. @click="getFile('hand_img')"
  44. class="upload-box d-flex justify-center align-center rounded-sm bg-panel-3 box-shadow"
  45. >
  46. <van-icon v-if="!form.hand_img" class="color-light fn-30" name="photograph" />
  47. <img v-else :src="form.hand_img" alt />
  48. </div>
  49. </div>
  50. </div>
  51. </main>
  52. <div class="p-md">
  53. <v-button block type="green" class="w-max rounded-lg" @click="topAuth" ref="btn">{{$t('common.submit')}}</v-button>
  54. </div>
  55. <van-toast id="van-toast" />
  56. </div>
  57. </template>
  58. <script>
  59. import utils from "@/utils";
  60. import Profile from "@/api/profile";
  61. import Member from "@/api/member";
  62. import { mapGetters } from "vuex";
  63. export default {
  64. data() {
  65. return {
  66. imgBase: undefined,
  67. form: {
  68. hand_img: "",
  69. back_img: "",
  70. front_img: "",
  71. }
  72. };
  73. },
  74. computed: {
  75. ...mapGetters(['themeStyle'])
  76. },
  77. methods: {
  78. getFile(name) {
  79. this.$getFile({count:9}).then((res) => {
  80. this.upLoadImg(res, name);
  81. })
  82. },
  83. // 上传图片
  84. upLoadImg(chooseImageRes, name) {
  85. Member.uploadImage(chooseImageRes).then((res) => {
  86. this.form[name] = res.data.url;
  87. this.$toast.success(this.$t('auth.c1'));
  88. });
  89. },
  90. // 提交审核
  91. topAuth() {
  92. let data = this.form;
  93. if (!data.hand_img) {
  94. this.$toast(this.$t('auth.b7'));
  95. return;
  96. }
  97. if (!data.back_img) {
  98. this.$toast(this.$t('auth.c2'));
  99. return;
  100. }
  101. if (!data.front_img) {
  102. this.$toast(this.$t('auth.c3'));
  103. return;
  104. }
  105. Profile.topAuth(data, { btn: this.$refs.btn })
  106. .then(() => {
  107. this.$toast.success(this.$t('auth.c4')+"。");
  108. this.$back();
  109. })
  110. .catch(() => {});
  111. },
  112. },
  113. };
  114. </script>
  115. <style lang="scss" scoped>
  116. .examples {
  117. width: 122px;
  118. height: 70px;
  119. display: flex;
  120. align-items: center;
  121. img {
  122. width: 100%;
  123. }
  124. }
  125. .upload-box {
  126. width: 150px;
  127. height: 100px;
  128. img {
  129. width: 100%;
  130. height: 100%;
  131. object-fit: cover;
  132. }
  133. }
  134. </style>