|
|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div id="home">
|
|
|
|
|
<van-nav-bar title="我的名片" v-if="nolog == 1"/>
|
|
|
|
|
<van-nav-bar title="我的名片" right-text="人脈紀錄" @click-right="showUserConn = true" v-else/>
|
|
|
|
|
<van-nav-bar title="我的名片" left-text="Slash會員中心" @click-left="goSlash" v-if="nolog == 1"/>
|
|
|
|
|
<van-nav-bar title="我的名片" left-text="Slash會員中心" @click-left="goSlash" right-text="人脈紀錄" @click-right="showUserConn = true" v-else/>
|
|
|
|
|
|
|
|
|
|
<div class="tab-section" v-cloak>
|
|
|
|
|
<van-tabs :lazy-render="true" v-model:active="activeName" v-show="user.nc_type > 1 && cid !== '1'">
|
|
|
|
|
<van-tabs :lazy-render="true" v-model:active="activeName" v-show="user.level > 0">
|
|
|
|
|
<van-tab title="我的名片" name="0">
|
|
|
|
|
</van-tab>
|
|
|
|
|
<van-tab :title="card_title" name="1" v-if="showCusCard">
|
|
|
|
|
@ -180,7 +181,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
state.user = card1Res.data
|
|
|
|
|
|
|
|
|
|
if (card1Res.data.nc_type > 1 && card1Res.data.has_cuscard === 1 && card1Res.data.show_cus === 1) {
|
|
|
|
|
if (card1Res.data.level > 0 && card1Res.data.has_cuscard === 1 && card1Res.data.show_cus === 1) {
|
|
|
|
|
state.showCusCard = true
|
|
|
|
|
state.card_title = card1Res.data.card_title
|
|
|
|
|
}
|
|
|
|
|
@ -223,7 +224,7 @@ export default {
|
|
|
|
|
// flex2html("flex", JSON.parse(card))
|
|
|
|
|
break
|
|
|
|
|
case '1':
|
|
|
|
|
if (state.user.nc_type > 1) {
|
|
|
|
|
if (state.user.level > 0) {
|
|
|
|
|
let card2Res = await getCusCard({ userid: state.user.user_id })
|
|
|
|
|
if (card2Res.code === 200) {
|
|
|
|
|
if (card2Res.data.cus_card) {
|
|
|
|
|
@ -316,11 +317,12 @@ export default {
|
|
|
|
|
const goUC = (url)=>{
|
|
|
|
|
showUserConn.value = false
|
|
|
|
|
window.location.href = url + '&nouc=1'
|
|
|
|
|
// window.location.href = url
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleAddFavorite = async (userid)=>{
|
|
|
|
|
if(!Cookies.get('token')){
|
|
|
|
|
return Toast('請先登入會員')
|
|
|
|
|
return Toast('您尚未登入Slash會員中心,請按左上角Slash會員中心登入或加入')
|
|
|
|
|
}
|
|
|
|
|
let res = await addFavorite(state.user.user_id)
|
|
|
|
|
if(res.code === 200){
|
|
|
|
|
@ -328,6 +330,10 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const goSlash=()=>{
|
|
|
|
|
window.location.href = 'https://card.slash1000.com/home/?refer=' + state.user.code
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
...toRefs(state),
|
|
|
|
|
showUserConn,
|
|
|
|
|
@ -338,6 +344,7 @@ export default {
|
|
|
|
|
isIOs,
|
|
|
|
|
userConnections,
|
|
|
|
|
goUC,
|
|
|
|
|
goSlash,
|
|
|
|
|
handleAddFavorite
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|