|
|
|
|
@ -70,10 +70,8 @@
|
|
|
|
|
<i class="icon-link-variant icli"></i>
|
|
|
|
|
<span>推薦連結</span>
|
|
|
|
|
</a>
|
|
|
|
|
<button v-clipboard:copy="userInfo.refer_url"
|
|
|
|
|
v-clipboard:success="onSuccess"
|
|
|
|
|
v-clipboard:error="onError"
|
|
|
|
|
>複制</button>
|
|
|
|
|
<button v-clipboard:copy="userInfo.refer_url" v-clipboard:success="onSuccess"
|
|
|
|
|
v-clipboard:error="onError">複制</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li @click="$router.push('/address')">
|
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
|
@ -93,6 +91,7 @@
|
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<template v-if="userInfo.is_resale === 1">
|
|
|
|
|
<li @click="$router.push('/user/account')">
|
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
|
<i class="icon-home icli"></i>
|
|
|
|
|
@ -120,9 +119,22 @@
|
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<li @click="handleBeResale">
|
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
|
<i class="icon-bank icli"></i>
|
|
|
|
|
<span>成為經銷商</span>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="arrow">
|
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</template>
|
|
|
|
|
</ul>
|
|
|
|
|
<!-- Navigation End -->
|
|
|
|
|
<button class="log-out" data-bs-toggle="offcanvas" data-bs-target="#confirmation" aria-controls="confirmation" @click="handleLogout">
|
|
|
|
|
<button class="log-out" data-bs-toggle="offcanvas" data-bs-target="#confirmation" aria-controls="confirmation"
|
|
|
|
|
@click="handleLogout">
|
|
|
|
|
<i class="icon-arrow-right-bold-box icli"></i>
|
|
|
|
|
登出
|
|
|
|
|
</button>
|
|
|
|
|
@ -142,9 +154,12 @@ import { useShopStore } from '@/store/Shop'
|
|
|
|
|
|
|
|
|
|
import { getUserInfo } from '@/services/user'
|
|
|
|
|
import { showToast } from 'vant';
|
|
|
|
|
import { showConfirmDialog } from 'vant';
|
|
|
|
|
|
|
|
|
|
import defaultAvatar from '@/assets/images/avatar/avatar.png'
|
|
|
|
|
|
|
|
|
|
import {updateUserResale} from '@/services/user'
|
|
|
|
|
import { getArticle } from '@/services/article'
|
|
|
|
|
// (async ()=>{
|
|
|
|
|
// await liff.init({ liffId: '1657782615-qGK9WQ5m' });
|
|
|
|
|
// })()
|
|
|
|
|
@ -154,6 +169,7 @@ const router = useRouter()
|
|
|
|
|
const shopStore = useShopStore()
|
|
|
|
|
|
|
|
|
|
const userInfo = ref({})
|
|
|
|
|
const resaleRule = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
@ -163,8 +179,33 @@ onMounted(async () => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
userInfo.value = res.data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let resArticle = await getArticle(146)
|
|
|
|
|
if(resArticle.code === 200){
|
|
|
|
|
resaleRule.value = resArticle.data.content
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const handleBeResale = async () => {
|
|
|
|
|
try{
|
|
|
|
|
await showConfirmDialog({
|
|
|
|
|
title: '申請成為經銷商',
|
|
|
|
|
message: resaleRule.value,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let res = await updateUserResale()
|
|
|
|
|
if(res.code === 200){
|
|
|
|
|
userInfo.value.is_resale = 1
|
|
|
|
|
return showToast('您已成為本站經銷商')
|
|
|
|
|
}else{
|
|
|
|
|
showToast(res.msg)
|
|
|
|
|
}
|
|
|
|
|
}catch(e){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleLogout = () => {
|
|
|
|
|
Cookies.remove('token', { domain: shopStore.sso_domain })
|
|
|
|
|
Cookies.remove('uid', { domain: shopStore.sso_domain })
|
|
|
|
|
@ -188,21 +229,25 @@ const onError = () => {
|
|
|
|
|
.media-body {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.media-right {
|
|
|
|
|
// width: 100%;
|
|
|
|
|
vertical-align: text-top;
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
|
|
|
|
i {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-info-block {
|
|
|
|
|
box-sizing: content-box;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
|
// flex: 1;
|
|
|
|
|
border: 1px gray solid;
|
|
|
|
|
@ -212,5 +257,4 @@ const onError = () => {
|
|
|
|
|
width: 48%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|