new.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="sign">
  3. <intro></intro>
  4. <verify></verify>
  5. <info></info>
  6. <profile></profile>
  7. <experience></experience>
  8. <education></education>
  9. <skills></skills>
  10. <works></works>
  11. <social></social>
  12. <el-button
  13. v-if="this.userInfo.realname_re == '3'||this.userInfo.realname_re=='0'"
  14. @click="signNow"
  15. class="sign-btn"
  16. >申请签约开发者</el-button>
  17. <showToast
  18. :isShowToast="isShowToast"
  19. title="完善技术信用"
  20. desc="你已成功提交签约申请,客栈将在2-3个工作日内完成签约审核,完善个人技术信用,可以提高签约成功率和接单率。"
  21. submitBtnDesc="立即了解"
  22. cancleBtnDesc="好的,知道了"
  23. @close="onToastClose"
  24. @submit="jumpToCredit"
  25. />
  26. </div>
  27. </template>
  28. <script>
  29. import { mapState } from "vuex";
  30. import intro from "@/components/sign/intro";
  31. import verify from "@/components/sign/verify";
  32. import info from "@/components/sign/info";
  33. import profile from "@/components/sign/profile";
  34. import experience from "@/components/sign/experience";
  35. import education from "@/components/sign/education";
  36. import skills from "@/components/sign/skills";
  37. import works from "@/components/sign/works";
  38. import social from "@/components/sign/social";
  39. import showToast from "@/components/common/showToast";
  40. import qs from "qs";
  41. export default {
  42. // async asyncData({ $axios, params }) {
  43. // let res = await $axios.$get(`/api/vip/getList`)
  44. // console.log('init', res)
  45. // },
  46. head: {
  47. title: "申请签约 - 程序员客栈"
  48. },
  49. components: {
  50. intro,
  51. verify,
  52. info,
  53. profile,
  54. experience,
  55. education,
  56. skills,
  57. works,
  58. social,
  59. showToast
  60. },
  61. // mixins: [getDeviceType],
  62. data() {
  63. return {
  64. sign: null,
  65. isShowToast: false,
  66. userInfo: {}
  67. };
  68. },
  69. computed: {},
  70. async mounted() {
  71. this.needLogin();
  72. // realname_re, 1是待审核,2已签约,3是拒绝
  73. this.userInfo = await this.getUserInfo();
  74. },
  75. methods: {
  76. async signNow() {
  77. let res = await this.$axios.$post(`/api/user/sign`);
  78. if (res.status === 1) {
  79. this.$message.success(res.info);
  80. this.isShowToast = true
  81. } else if (res.status === -11) {
  82. // this.$message.error("请设置主要展示工作经历");
  83. } else if (res.status === -10) {
  84. // this.$message.error("其他错误");
  85. }
  86. },
  87. jumpToCredit() {
  88. location.href = "/credit/pages"
  89. },
  90. onToastClose() {
  91. this.isShowToast=false
  92. window.location.reload();
  93. }
  94. }
  95. };
  96. </script>
  97. <style lang="scss">
  98. .sign {
  99. display: flex;
  100. flex-direction: column;
  101. align-items: center;
  102. width: 1000px;
  103. background: #f7f7f7;
  104. > div {
  105. margin-bottom: 10px;
  106. width: 100%;
  107. background: #fff;
  108. &:last-of-type {
  109. margin-bottom: 0;
  110. }
  111. > header {
  112. display: flex;
  113. justify-content: space-between;
  114. align-items: center;
  115. padding: 13px 20px;
  116. border-bottom: 1px solid #ebeef5;
  117. }
  118. h5 {
  119. display: flex;
  120. justify-content: space-between;
  121. align-items: center;
  122. font-size: 16px;
  123. font-family: PingFangSC-Medium;
  124. font-weight: 500;
  125. color: rgba(29, 42, 58, 1);
  126. line-height: 22px;
  127. }
  128. .status {
  129. position: relative;
  130. display: inline-block;
  131. float: right;
  132. font-size: 14px;
  133. font-family: PingFangSC-Medium;
  134. font-weight: 500;
  135. line-height: 20px;
  136. }
  137. .success {
  138. color: rgba(16, 185, 106, 1);
  139. &::before {
  140. content: "";
  141. position: absolute;
  142. display: inline-block;
  143. left: -10px;
  144. top: 50%;
  145. transform: translate3d(-100%, -50%, 0);
  146. width: 20px;
  147. height: 20px;
  148. background: url("~@/assets/img/sign/success.png");
  149. }
  150. }
  151. .info {
  152. color: gray;
  153. }
  154. .warning {
  155. color: red;
  156. }
  157. button {
  158. height: 34px;
  159. line-height: 10px;
  160. border-radius: 2px;
  161. }
  162. }
  163. .sign-btn {
  164. margin-top: 30px;
  165. width: 210px;
  166. height: 46px;
  167. background: rgba(48, 142, 255, 1);
  168. border-radius: 2px;
  169. font-size: 14px;
  170. font-family: PingFangSC-Medium;
  171. font-weight: 500;
  172. color: rgba(255, 255, 255, 1);
  173. line-height: 20px;
  174. }
  175. }
  176. </style>