|
|
@@ -3,10 +3,13 @@
|
|
|
<section class="app__bg_w app__mt_10">
|
|
|
<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">
|
|
|
<img :src="social.icon" class="app__img_xs"/>
|
|
|
- <a class="app__f_g_1 app__ml_10">{{social.name}}</a>
|
|
|
+ <a :href="social.targetUrl" class="app__f_g_1">
|
|
|
+ <a class="app__ml_10 app__fc_666 app__cursor_point">{{social.name}}</a>
|
|
|
+ <a class=" app__ml_20">{{social.account}}</a>
|
|
|
+ </a>
|
|
|
|
|
|
<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)"
|
|
|
- v-bind:class="!social.status || social.status== 0 ? 'app_bg_919AA7' : 'app__bg_308EFF'">{{social.bindStatus==1 ?"已绑定":"未绑定"}}
|
|
|
+ v-bind:class="!social.account ? 'app_bg_919AA7' : 'app__bg_308EFF'" v-if="social.tag !='jishuin'">{{social.account ?"已绑定":"未绑定"}}
|
|
|
</button>
|
|
|
</div>
|
|
|
|
|
|
@@ -49,6 +52,8 @@
|
|
|
this.needLogin();
|
|
|
this.socials = data.socialLines;
|
|
|
console.log("socials", this.socials);
|
|
|
+
|
|
|
+ this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
jumpTo(url) {
|
|
|
@@ -57,11 +62,58 @@
|
|
|
goBind(social) {
|
|
|
console.log("social", social);
|
|
|
//未绑定
|
|
|
- if (!social.status || social.status == 0) {
|
|
|
- // `proginn://recruit/edit?id=${recruitId}`;
|
|
|
- location.href = `${this.$store.state.domainConfig.siteUrl}/setting/snsimport`;
|
|
|
+ switch (social.tag) {
|
|
|
+ case "wechat":
|
|
|
+ break;
|
|
|
+ case "jishuin":
|
|
|
+ location.href = social.targetUrl;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ if (!social.account) {
|
|
|
+ location.href = `${this.$store.state.domainConfig.siteUrl}/setting/snsimport`;
|
|
|
+ } else {
|
|
|
+ location.href = social.targetUrl;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取社区数据
|
|
|
+ * @return {Promise<void>}
|
|
|
+ */
|
|
|
+ async getData() {
|
|
|
+ const res = await this.$axios.$post("/api/SocialNetwork/getList");
|
|
|
+ console.log(res);
|
|
|
+ if (res.status == 1) {
|
|
|
+ const data = !res.data ? [] : res.data;
|
|
|
+ this.socials.forEach(so => {
|
|
|
+ so.account = data[so.tag] || "";
|
|
|
+ switch (so.tag) {
|
|
|
+ case"wechat":
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "jishuin":
|
|
|
+ const {userinfo} = this.$store.state || {};
|
|
|
+ //检查登录
|
|
|
+ if (!userinfo || !userinfo.uid) {
|
|
|
+ this.$message.info("请先登录!");
|
|
|
+ location.href =
|
|
|
+ "/?loginbox=show&next=" + encodeURIComponent(location.href);
|
|
|
+ }
|
|
|
+ so.targetUrl = this.$store.state.domainConfig.jishuinUrl + "/u/" + userinfo.uid;
|
|
|
+ console.log("jishuin target url", so.targetUrl);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ so.targetUrl = so.account ? so.targetUrl + so.account : "javascript:void(0)";
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(this.socials);
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|