|
|
|
@ -1,29 +1,29 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<!-- Main Start -->
|
|
|
|
<!-- Main Start -->
|
|
|
|
<main class="main-wrap account-page mb-xxl">
|
|
|
|
<main class="main-wrap account-page mb-xxl">
|
|
|
|
<div class="account-wrap section-b-t">
|
|
|
|
<div class="account-wrap section-b-t">
|
|
|
|
<div class="user-panel">
|
|
|
|
<div class="user-panel">
|
|
|
|
<div class="media">
|
|
|
|
<div class="media">
|
|
|
|
<a href="javascript:void(0)">
|
|
|
|
<a href="javascript:void(0)">
|
|
|
|
<img :src="userInfo.headimg || defaultAvatar" alt="avatar" />
|
|
|
|
<img :src="userInfo.headimg || defaultAvatar" alt="avatar" />
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="media-body">
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" class="title-color">
|
|
|
|
|
|
|
|
{{ userInfo.line_name }}
|
|
|
|
|
|
|
|
<span class="content-color font-sm">{{ userInfo.is_validated ? 'Slash會員[可分銷]' : '一般會員[不可分銷]' }}</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
<div class="media-body">
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" class="title-color">
|
|
|
|
|
|
|
|
{{ userInfo.line_name }}
|
|
|
|
|
|
|
|
<span class="content-color font-sm">{{ userInfo.is_validated?'Slash會員[可分銷]':'一般會員[不可分銷]' }}</span>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="media-right" @click="$router.push('/user/setting')">
|
|
|
|
|
|
|
|
<i class="icon-pencil"></i>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="user-info-block">
|
|
|
|
<div class="media-right" @click="$router.push('/user/setting')">
|
|
|
|
|
|
|
|
<i class="icon-pencil"></i>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="user-info-block">
|
|
|
|
<div class="user-info">
|
|
|
|
<div class="user-info">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
餘額
|
|
|
|
餘額
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
${{ userInfo.user_money }}
|
|
|
|
${{ userInfo.user_money }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="user-info">
|
|
|
|
<div class="user-info">
|
|
|
|
@ -39,7 +39,7 @@
|
|
|
|
推薦人數
|
|
|
|
推薦人數
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{{ userInfo.refer_num}}人
|
|
|
|
{{ userInfo.refer_num }}人
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="user-info">
|
|
|
|
<div class="user-info">
|
|
|
|
@ -47,52 +47,51 @@
|
|
|
|
分潤金額
|
|
|
|
分潤金額
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
$0
|
|
|
|
$0
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Navigation Start -->
|
|
|
|
<!-- Navigation Start -->
|
|
|
|
<ul class="navigation">
|
|
|
|
<ul class="navigation">
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<i class="icon-account icli"></i>
|
|
|
|
<i class="icon-account icli"></i>
|
|
|
|
<span>推薦人</span>
|
|
|
|
<span>推薦人</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
<a>
|
|
|
|
<a>
|
|
|
|
{{ userInfo.parent_name || '沒有推薦人'}}
|
|
|
|
{{ userInfo.parent_name || '沒有推薦人' }}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<a href="javacript:void(0)" class="nav-link title-color font-sm">
|
|
|
|
<a href="javacript:void(0)" class="nav-link title-color font-sm">
|
|
|
|
<i class="icon-link-variant icli"></i>
|
|
|
|
<i class="icon-link-variant icli"></i>
|
|
|
|
<span>推薦連結</span>
|
|
|
|
<span>推薦連結</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
<button v-clipboard:copy="userInfo.refer_url"
|
|
|
|
<button v-clipboard:copy="userInfo.refer_url" v-clipboard:success="onSuccess"
|
|
|
|
v-clipboard:success="onSuccess"
|
|
|
|
v-clipboard:error="onError">複制</button>
|
|
|
|
v-clipboard:error="onError"
|
|
|
|
</li>
|
|
|
|
>複制</button>
|
|
|
|
<li @click="$router.push('/address')">
|
|
|
|
</li>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<li @click="$router.push('/address')">
|
|
|
|
<i class="icon-map-marker icli"></i>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<span>收貨地址</span>
|
|
|
|
<i class="icon-map-marker icli"></i>
|
|
|
|
</a>
|
|
|
|
<span>收貨地址</span>
|
|
|
|
<a class="arrow">
|
|
|
|
</a>
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
<a class="arrow">
|
|
|
|
</a>
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
</li>
|
|
|
|
</a>
|
|
|
|
<li @click="$router.push('/user/order')">
|
|
|
|
</li>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<li @click="$router.push('/user/order')">
|
|
|
|
<i class="icon-order icli"></i>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<span>我的訂單</span>
|
|
|
|
<i class="icon-order icli"></i>
|
|
|
|
</a>
|
|
|
|
<span>我的訂單</span>
|
|
|
|
<a class="arrow">
|
|
|
|
</a>
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
<a class="arrow">
|
|
|
|
</a>
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
</li>
|
|
|
|
</a>
|
|
|
|
<template v-if="userInfo.is_resale === 1">
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li @click="$router.push('/user/account')">
|
|
|
|
<li @click="$router.push('/user/account')">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<i class="icon-home icli"></i>
|
|
|
|
<i class="icon-home icli"></i>
|
|
|
|
@ -103,7 +102,7 @@
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li @click="$router.push('/user/share')">
|
|
|
|
<li @click="$router.push('/user/share')">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<i class="icon-share icli"></i>
|
|
|
|
<i class="icon-share icli"></i>
|
|
|
|
<span>我的推薦</span>
|
|
|
|
<span>我的推薦</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
@ -112,7 +111,7 @@
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li @click="$router.push('/user/bank')">
|
|
|
|
<li @click="$router.push('/user/bank')">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
<i class="icon-bank icli"></i>
|
|
|
|
<i class="icon-bank icli"></i>
|
|
|
|
<span>提領帳戶</span>
|
|
|
|
<span>提領帳戶</span>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
@ -120,31 +119,47 @@
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
<i class="icon-chevron-right"></i>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</template>
|
|
|
|
<!-- Navigation End -->
|
|
|
|
<template v-else>
|
|
|
|
<button class="log-out" data-bs-toggle="offcanvas" data-bs-target="#confirmation" aria-controls="confirmation" @click="handleLogout">
|
|
|
|
<li @click="handleBeResale">
|
|
|
|
<i class="icon-arrow-right-bold-box icli"></i>
|
|
|
|
<a class="nav-link title-color font-sm">
|
|
|
|
登出
|
|
|
|
<i class="icon-bank icli"></i>
|
|
|
|
</button>
|
|
|
|
<span>成為經銷商</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</main>
|
|
|
|
<a class="arrow">
|
|
|
|
<!-- Main End -->
|
|
|
|
<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">
|
|
|
|
|
|
|
|
<i class="icon-arrow-right-bold-box icli"></i>
|
|
|
|
|
|
|
|
登出
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<!-- Main End -->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import liff from '@line/liff';
|
|
|
|
import liff from '@line/liff';
|
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
|
|
|
|
|
|
|
|
import { onMounted , ref } from 'vue'
|
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
|
|
|
|
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
import { useShopStore } from '@/store/Shop'
|
|
|
|
import { useShopStore } from '@/store/Shop'
|
|
|
|
|
|
|
|
|
|
|
|
import { getUserInfo } from '@/services/user'
|
|
|
|
import { getUserInfo } from '@/services/user'
|
|
|
|
import { showToast } from 'vant';
|
|
|
|
import { showToast } from 'vant';
|
|
|
|
|
|
|
|
import { showConfirmDialog } from 'vant';
|
|
|
|
|
|
|
|
|
|
|
|
import defaultAvatar from '@/assets/images/avatar/avatar.png'
|
|
|
|
import defaultAvatar from '@/assets/images/avatar/avatar.png'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {updateUserResale} from '@/services/user'
|
|
|
|
|
|
|
|
import { getArticle } from '@/services/article'
|
|
|
|
// (async ()=>{
|
|
|
|
// (async ()=>{
|
|
|
|
// await liff.init({ liffId: '1657782615-qGK9WQ5m' });
|
|
|
|
// await liff.init({ liffId: '1657782615-qGK9WQ5m' });
|
|
|
|
// })()
|
|
|
|
// })()
|
|
|
|
@ -154,20 +169,46 @@ const router = useRouter()
|
|
|
|
const shopStore = useShopStore()
|
|
|
|
const shopStore = useShopStore()
|
|
|
|
|
|
|
|
|
|
|
|
const userInfo = ref({})
|
|
|
|
const userInfo = ref({})
|
|
|
|
|
|
|
|
const resaleRule = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
let res = await getUserInfo()
|
|
|
|
let res = await getUserInfo()
|
|
|
|
|
|
|
|
|
|
|
|
if(res.code === 200){
|
|
|
|
if (res.code === 200) {
|
|
|
|
userInfo.value = res.data
|
|
|
|
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 = () => {
|
|
|
|
const handleLogout = () => {
|
|
|
|
Cookies.remove('token',{ domain: shopStore.sso_domain})
|
|
|
|
Cookies.remove('token', { domain: shopStore.sso_domain })
|
|
|
|
Cookies.remove('uid',{ domain: shopStore.sso_domain})
|
|
|
|
Cookies.remove('uid', { domain: shopStore.sso_domain })
|
|
|
|
|
|
|
|
|
|
|
|
// liff.logout()
|
|
|
|
// liff.logout()
|
|
|
|
router.replace('/login')
|
|
|
|
router.replace('/login')
|
|
|
|
@ -184,26 +225,30 @@ const onError = () => {
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.media{
|
|
|
|
.media {
|
|
|
|
.media-body{
|
|
|
|
.media-body {
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.media-right{
|
|
|
|
|
|
|
|
// width: 100%;
|
|
|
|
.media-right {
|
|
|
|
vertical-align: text-top;
|
|
|
|
// width: 100%;
|
|
|
|
text-align: right;
|
|
|
|
vertical-align: text-top;
|
|
|
|
i{
|
|
|
|
text-align: right;
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
|
|
}
|
|
|
|
i {
|
|
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.user-info-block{
|
|
|
|
|
|
|
|
|
|
|
|
.user-info-block {
|
|
|
|
box-sizing: content-box;
|
|
|
|
box-sizing: content-box;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: space-around;
|
|
|
|
justify-content: space-around;
|
|
|
|
.user-info{
|
|
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
// flex: 1;
|
|
|
|
// flex: 1;
|
|
|
|
border: 1px gray solid;
|
|
|
|
border: 1px gray solid;
|
|
|
|
border-radius: 8px;
|
|
|
|
border-radius: 8px;
|
|
|
|
@ -212,5 +257,4 @@ const onError = () => {
|
|
|
|
width: 48%;
|
|
|
|
width: 48%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|