|
|
|
@ -76,8 +76,9 @@
|
|
|
|
<van-step v-for="(v,i) in userConnections" :key="i">
|
|
|
|
<van-step v-for="(v,i) in userConnections" :key="i">
|
|
|
|
<div class="user-conn">
|
|
|
|
<div class="user-conn">
|
|
|
|
<div class="user-conn-left">{{ v.name }}</div>
|
|
|
|
<div class="user-conn-left">{{ v.name }}</div>
|
|
|
|
<div class="user-conn-right" @click="goUC(v.nfcurl)">
|
|
|
|
<div class="user-conn-right" >
|
|
|
|
查看
|
|
|
|
<i class="icon-heart" @click="handleAddFavorite">收藏</i>
|
|
|
|
|
|
|
|
<i class="icon-eye-circle" @click="goUC(v.nfcurl)">查看</i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p>{{ v.company }}</p>
|
|
|
|
<p>{{ v.company }}</p>
|
|
|
|
@ -89,10 +90,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
|
|
|
|
|
|
|
import { nextTick, onBeforeMount, reactive, ref, toRefs, watch, computed } from 'vue'
|
|
|
|
import { nextTick, onBeforeMount, reactive, ref, toRefs, watch, computed } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
import { checkUser, getCard, getCusCard, getVipCard } from '@/api'
|
|
|
|
import { checkUser, getCard, getCusCard, getVipCard, addFavorite, uploadUserConnections, getUserConnections } from '@/api'
|
|
|
|
|
|
|
|
|
|
|
|
import { changeMeta } from '@/utils/meta'
|
|
|
|
import { changeMeta } from '@/utils/meta'
|
|
|
|
|
|
|
|
|
|
|
|
@ -261,7 +263,7 @@ export default {
|
|
|
|
//人脈紀錄
|
|
|
|
//人脈紀錄
|
|
|
|
const showUserConn = ref(false)
|
|
|
|
const showUserConn = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
function saveConnection(data){
|
|
|
|
async function saveConnection(data){
|
|
|
|
|
|
|
|
|
|
|
|
let connData = {
|
|
|
|
let connData = {
|
|
|
|
userid: data.user_id,
|
|
|
|
userid: data.user_id,
|
|
|
|
@ -289,10 +291,20 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
localStorage.setItem('user_conn',JSON.stringify(n_user_conn))
|
|
|
|
localStorage.setItem('user_conn',JSON.stringify(n_user_conn))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Cookies.get('token')){
|
|
|
|
|
|
|
|
let res = await uploadUserConnections(JSON.stringify(n_user_conn))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userConnections = computed(()=>{
|
|
|
|
const userConnections = computed(async ()=>{
|
|
|
|
|
|
|
|
if(Cookies.get('token')){
|
|
|
|
|
|
|
|
let res = await getUserConnections()
|
|
|
|
|
|
|
|
if(res.code === 200){
|
|
|
|
|
|
|
|
return JSON.parse(res.data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return JSON.parse(localStorage.getItem('user_conn'))
|
|
|
|
return JSON.parse(localStorage.getItem('user_conn'))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
@ -301,6 +313,16 @@ export default {
|
|
|
|
window.location.href = url + '&nouc=1'
|
|
|
|
window.location.href = url + '&nouc=1'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleAddFavorite = async (userid)=>{
|
|
|
|
|
|
|
|
if(!Cookies.get('token')){
|
|
|
|
|
|
|
|
return Toast('請先登入會員')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let res = await addFavorite(state.user.user_id)
|
|
|
|
|
|
|
|
if(res.code === 200){
|
|
|
|
|
|
|
|
return Toast('收藏成功')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
...toRefs(state),
|
|
|
|
...toRefs(state),
|
|
|
|
showUserConn,
|
|
|
|
showUserConn,
|
|
|
|
@ -309,7 +331,8 @@ export default {
|
|
|
|
flexRef,
|
|
|
|
flexRef,
|
|
|
|
isIOs,
|
|
|
|
isIOs,
|
|
|
|
userConnections,
|
|
|
|
userConnections,
|
|
|
|
goUC
|
|
|
|
goUC,
|
|
|
|
|
|
|
|
handleAddFavorite
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -418,7 +441,11 @@ export default {
|
|
|
|
font-weight: 500;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.user-conn-right{
|
|
|
|
.user-conn-right{
|
|
|
|
width: 50px
|
|
|
|
width: 70px;
|
|
|
|
|
|
|
|
i{
|
|
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
|
|
margin:0 5px;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|