_social.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <!-- <div class="creditIndex">-->
  3. <section class="app__bg_w app__mt_10">
  4. <div class="app__f_r app__al_c app__h_50 app__pl_20 app__pr_20 app__fs_15" v-for="social in socials">
  5. <img :src="social.icon" class="app__img_xs"/>
  6. <a :href="social.targetUrl" class="app__f_g_1">
  7. <a class="app__ml_10 app__fc_666 app__cursor_point">{{social.name}}</a>
  8. <a class=" app__ml_20">{{social.account}}</a>
  9. </a>
  10. <button class="app__w_70 app__h_30 app__f_r app__al_c app__jf_c app_fc_w app_br_5" @click="goBind(social)"
  11. v-bind:class="!social.account ? 'app_bg_919AA7' : 'app__bg_308EFF'" v-if="social.tag !='jishuin'">{{social.account ?"已绑定":"未绑定"}}
  12. </button>
  13. </div>
  14. </section>
  15. <!-- </div>-->
  16. </template>
  17. <script>
  18. import CreditCommonTitle from '@/components/credit/header.vue'
  19. import data from '../../components/credit/data'
  20. /**
  21. * 首页
  22. */
  23. export default {
  24. layout: "opacity_header",
  25. components: {CreditCommonTitle},
  26. head() {
  27. return {
  28. title: '程序员客栈技术信用-程序员技术开发能力认证,企业程序员背调专用数据平台',
  29. meta: [{
  30. 'name': 'keywords',
  31. 'content': '技术信用,程序员背调,程序员技术能力认证'
  32. }, {
  33. 'name': 'description',
  34. 'content': '程序员客栈技术信用平台依托多年的程序员数据,提供程序员技能等级认证,服务口碑,就业情况数据核实。为每一位入驻的程序员提供真实有效符合自身能力的技术信用认证,给用工单位提供所录用的程序员以往从业经历或者服务历史口碑的准确报告;对接程序员和用工企业,找出最适合程序员发展的平台,为用工单位提供最合适的程序员人选。程序员技术信用认证、程序员背景调查,请认准程序员客栈技术信用平台!'
  35. }, {
  36. 'name': 'h1',
  37. 'content': '技术信用'
  38. }]
  39. }
  40. },
  41. data() {
  42. return {
  43. socials: []
  44. }
  45. },
  46. mounted() {
  47. this.needLogin();
  48. this.socials = data.socialLines;
  49. console.log("socials", this.socials);
  50. this.getData();
  51. },
  52. methods: {
  53. jumpTo(url) {
  54. location.href = url
  55. },
  56. goBind(social) {
  57. console.log("social", social);
  58. //未绑定
  59. switch (social.tag) {
  60. case "wechat":
  61. break;
  62. case "jishuin":
  63. location.href = social.targetUrl;
  64. break;
  65. default:
  66. if (!social.account) {
  67. location.href = `${this.$store.state.domainConfig.siteUrl}/setting/snsimport`;
  68. } else {
  69. location.href = social.targetUrl;
  70. }
  71. break;
  72. }
  73. },
  74. /**
  75. * 获取社区数据
  76. * @return {Promise<void>}
  77. */
  78. async getData() {
  79. const res = await this.$axios.$post("/api/SocialNetwork/getList");
  80. console.log(res);
  81. if (res.status == 1) {
  82. const data = !res.data ? [] : res.data;
  83. this.socials.forEach(so => {
  84. so.account = data[so.tag] || "";
  85. switch (so.tag) {
  86. case"wechat":
  87. break;
  88. case "jishuin":
  89. const {userinfo} = this.$store.state || {};
  90. //检查登录
  91. if (!userinfo || !userinfo.uid) {
  92. this.$message.info("请先登录!");
  93. location.href =
  94. "/?loginbox=show&next=" + encodeURIComponent(location.href);
  95. }
  96. so.targetUrl = this.$store.state.domainConfig.jishuinUrl + "/u/" + userinfo.uid;
  97. console.log("jishuin target url", so.targetUrl);
  98. break;
  99. default:
  100. so.targetUrl = so.account ? so.targetUrl + so.account : "javascript:void(0)";
  101. break;
  102. }
  103. });
  104. }
  105. console.log(this.socials);
  106. },
  107. }
  108. }
  109. </script>
  110. <style scope lang="scss">
  111. @import "../../assets/css/public.css";
  112. @import "../../assets/css/credit/pages/index.scss";
  113. </style>