new.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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.realnamshowToaste_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. this.cnzz("签约","签约页面+申请签约点击","");
  82. let res = await this.$axios.$post(`/api/user/sign`);
  83. if (res.status === 1) {
  84. this.$message.success(res.info);
  85. this.isShowToast = true
  86. } else if (res.status === -11) {
  87. // this.$message.error("请设置主要展示工作经历");
  88. } else if (res.status === -10) {
  89. // this.$message.error("其他错误");
  90. }
  91. },
  92. setFrom() {
  93. let doc = "";
  94. let from = this.$route.query.from || this.$route.params.from;
  95. console.log("run setFrom: ", from);
  96. switch (from) {
  97. case "wo_intro":
  98. doc = document.getElementById("profile");
  99. break;
  100. case "wo_workexp":
  101. doc = document.getElementById("workexp");
  102. break;
  103. case "wo_edu":
  104. doc = document.getElementById("education");
  105. break;
  106. case "wo_skill":
  107. doc = document.getElementById("skill");
  108. break;
  109. case "works":
  110. doc = document.getElementById("works");
  111. break;
  112. }
  113. console.log("执行!!!!");
  114. if (doc) {
  115. setTimeout(() => {
  116. doc.scrollIntoView();
  117. }, 600);
  118. }
  119. },
  120. jumpToCredit() {
  121. this.cnzz("签约","签约页面+申请签约","确认");
  122. location.href = "/credit/pages"
  123. },
  124. onToastClose() {
  125. this.isShowToast = false
  126. window.location.reload();
  127. }
  128. }
  129. };
  130. </script>
  131. <style lang="scss">
  132. .sign {
  133. display: flex;
  134. flex-direction: column;
  135. align-items: center;
  136. width: 1000px;
  137. background: #f7f7f7;
  138. > div {
  139. margin-bottom: 10px;
  140. width: 100%;
  141. background: #fff;
  142. &:last-of-type {
  143. margin-bottom: 0;
  144. }
  145. > header {
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: center;
  149. padding: 13px 20px;
  150. border-bottom: 1px solid #ebeef5;
  151. }
  152. h5 {
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: center;
  156. font-size: 16px;
  157. font-family: PingFangSC-Medium;
  158. font-weight: 500;
  159. color: rgba(29, 42, 58, 1);
  160. line-height: 22px;
  161. }
  162. .status {
  163. position: relative;
  164. display: inline-block;
  165. float: right;
  166. font-size: 14px;
  167. font-family: PingFangSC-Medium;
  168. font-weight: 500;
  169. line-height: 20px;
  170. }
  171. .success {
  172. color: rgba(16, 185, 106, 1);
  173. &::before {
  174. content: "";
  175. position: absolute;
  176. display: inline-block;
  177. left: -10px;
  178. top: 50%;
  179. transform: translate3d(-100%, -50%, 0);
  180. width: 20px;
  181. height: 20px;
  182. background: url("~@/assets/img/sign/success.png");
  183. }
  184. }
  185. .info {
  186. color: gray;
  187. }
  188. .warning {
  189. color: red;
  190. }
  191. button {
  192. height: 34px;
  193. line-height: 10px;
  194. border-radius: 2px;
  195. }
  196. }
  197. .sign-btn {
  198. margin-top: 30px;
  199. width: 210px;
  200. height: 46px;
  201. background: rgba(48, 142, 255, 1);
  202. border-radius: 2px;
  203. font-size: 14px;
  204. font-family: PingFangSC-Medium;
  205. font-weight: 500;
  206. color: rgba(255, 255, 255, 1);
  207. line-height: 20px;
  208. }
  209. }
  210. </style>