new.vue 5.4 KB

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