|
@@ -15,6 +15,10 @@
|
|
|
<Icon type="md-copy" class="copy-link-icon" :title="$t('cusMgt.copyUrl')" />
|
|
|
<span style="font-size:14px">{{$t('cusMgt.inviteUrl')}}</span>
|
|
|
</p>
|
|
|
+ <p class="invite-url-text" @click="copyShortUrl" style="margin-top: 10px;">
|
|
|
+ <Icon type="md-copy" class="copy-link-icon" :title="$t('cusMgt.inviteShortUrl')" />
|
|
|
+ <span style="font-size:14px">{{$t('cusMgt.inviteShortUrl')}}</span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -43,12 +47,14 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ shortUrl:'',
|
|
|
showQrStatus: false,
|
|
|
joinQRcode: undefined
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
async copyUrl() {
|
|
|
+ console.error(this.config)
|
|
|
this.$copyText(this.config.shareContent).then(
|
|
|
ok => {
|
|
|
this.$Message.success(this.$t("settings.copyModal1"))
|
|
@@ -58,17 +64,27 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
+ copyShortUrl(){
|
|
|
+ this.$copyText(this.shortUrl.result).then(
|
|
|
+ ok => {
|
|
|
+ this.$Message.success(this.$t("settings.copyModal1"))
|
|
|
+ },
|
|
|
+ fail => {
|
|
|
+ this.$Message.error(this.$t("settings.copyModal2"))
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
createQRCode() {
|
|
|
this.$nextTick(async () => {
|
|
|
// 此时已经渲染完成
|
|
|
try {
|
|
|
- let shortUrl = await this.$api.getShortUrl(encodeURI(this.config.url))
|
|
|
+ this.shortUrl = await this.$api.getShortUrl(encodeURI(this.config.url))
|
|
|
if (this.joinQRcode == undefined) {
|
|
|
let qrcode = new QRCode('qrcode', {
|
|
|
width: 280, // 设置宽度,单位像素
|
|
|
height: 280, // 设置高度,单位像素
|
|
|
// text: encodeURI(url), // 编码处理
|
|
|
- text: encodeURI(this.config.url), // 编码处理
|
|
|
+ text: encodeURI(this.config.simpleUrl), // 编码处理
|
|
|
// text: shortUrl.result || encodeURI(this.config.url), // 编码处理
|
|
|
correctLevel: QRCode.CorrectLevel.Q //解决编码后网址太长的问题
|
|
|
})
|
|
@@ -76,7 +92,7 @@ export default {
|
|
|
} else {
|
|
|
this.joinQRcode.clear()
|
|
|
// this.joinQRcode.makeCode(shortUrl.result || encodeURI(this.config.url))
|
|
|
- this.joinQRcode.makeCode(encodeURI(this.config.url))
|
|
|
+ this.joinQRcode.makeCode(encodeURI(this.config.simpleUrl))
|
|
|
}
|
|
|
let dom = document.getElementById('qrcode')
|
|
|
if (dom) dom.title = ''
|