<template>
|
<div class="wrap">
|
<div class="flex align-center justify-between">
|
<h3 class="title">{{$t("message.Share")}}</h3>
|
<img class="close" src="../../assets/images/close.png" @click="close" />
|
</div>
|
<img class="banner" src="../../assets/images/1.png" />
|
<div class="share-box">
|
<h3>{{$t("message.ShareLink")}}</h3>
|
<div class="flex align-center justify-between">
|
<input :value="inviteUrl" class="flex-1" readonly/>
|
<button @click="onCopy">{{$t("message.Copy")}}</button>
|
</div>
|
</div>
|
<p class="tips">{{$t("message.CopyTip")}}</p>
|
</div>
|
</template>
|
|
<script>
|
import { ref, reactive, getCurrentInstance,onBeforeMount,onMounted } from 'vue';
|
import useClipboard from 'vue-clipboard3'
|
export default {
|
name: 'App',
|
setup() {
|
const { proxy } = getCurrentInstance()
|
const { toClipboard } = useClipboard()
|
const iShow = ref(false)
|
const inviteUrl = ref('')
|
const close = () => {
|
proxy.$emit('close')
|
}
|
const onCopy = async () => {
|
try {
|
await toClipboard(proxy.inviteUrl)
|
proxy.$notify({type: 'success', message: proxy.$t('message.CopySuc')});
|
} catch (e) {
|
proxy.$notify(proxy.$t('message.CopyErr'));
|
}
|
}
|
const initData = () => {
|
let str = window.location.href + '?code=';
|
proxy.$axios({
|
url: '/dapi/member/walletInfo',
|
method: 'post'
|
}).then((res) => {
|
if(res.code == 200) {
|
proxy.inviteUrl = str + res.data.inviteId;
|
}else{
|
proxy.inviteUrl = str
|
}
|
}).catch(() => {
|
proxy.inviteUrl = str
|
})
|
}
|
onMounted(() => {
|
initData()
|
})
|
return {
|
iShow,
|
close,
|
inviteUrl,
|
onCopy,
|
initData
|
}
|
},
|
methods: {
|
}
|
}
|
</script>
|
|
<style scoped>
|
.wrap {
|
padding: 36px 24px 36px 44px;
|
background: #FFFFFF;
|
height: 100vh;
|
box-sizing: border-box;
|
}
|
.wrap .title{
|
font-size: 32px;
|
position: relative;
|
margin: 0;
|
}
|
.wrap .title::before{
|
content: '';
|
width: 10px;
|
height: 10px;
|
background: #FEAA4A;
|
display: block;
|
border-radius: 50%;
|
position: absolute;
|
left: -20px;
|
top: 50%;
|
}
|
.close{
|
width: 32px;
|
font-weight: bold;
|
}
|
.banner{
|
display: block;
|
width: 78%;
|
margin: 45px auto;
|
}
|
.share-box{
|
box-shadow: 0px 10px 30px 1px rgba(153, 153, 153, 0.15);
|
padding: 28px 24px 48px;
|
text-align: left;
|
border-radius: 20px;
|
}
|
.share-box h3{
|
font-size: 28px;
|
margin: 0 0 30px;
|
}
|
.share-box input{
|
border: 1px solid #E9E9E9;
|
border-radius: 5px;
|
color: #AFAFAF;
|
font-size: 24px;
|
padding: 18px 24px;
|
margin-right: 24px;
|
}
|
.share-box button{
|
border: 0;
|
background: linear-gradient(86deg, #FEAA4A 0%, #FF8517 100%);
|
border-radius: 48px;
|
color: #ffffff;
|
font-size: 28px;
|
font-weight: bold;
|
padding: 14px 40px;
|
}
|
.tips{
|
color: #AFAFAF;
|
margin: 32px 0 0;
|
line-height: 32px;
|
text-align: left;
|
}
|
</style>
|