|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<script setup>
|
|
|
|
|
import liff from "@line/liff";
|
|
|
|
|
|
|
|
|
|
import { showToast,showSuccessToast } from 'vant';
|
|
|
|
|
import { showToast, showSuccessToast } from 'vant';
|
|
|
|
|
|
|
|
|
|
import { onBeforeMount, onMounted, reactive, ref, toRefs, computed, watch } from 'vue'
|
|
|
|
|
|
|
|
|
|
@ -60,10 +60,8 @@ onMounted(async () => {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切換tab
|
|
|
|
|
watch(() => activeName.value, function (newVal, oldVal) {
|
|
|
|
|
|
|
|
|
|
if (newVal !== oldVal) {
|
|
|
|
|
showFlex(newVal)
|
|
|
|
|
}
|
|
|
|
|
@ -89,14 +87,14 @@ async function showFlex(id) {
|
|
|
|
|
let { data: res } = await getCard({ userid: sessionStorage.getItem('uid') })
|
|
|
|
|
let { card } = cardFactory({ tid: userInfo.value.nc_template, vcard: res })
|
|
|
|
|
|
|
|
|
|
if(userInfo.value.status === 1 && userInfo.value.is_send_ad === 0){ //正常 & 願意帶廣告
|
|
|
|
|
if (userInfo.value.status === 1 && userInfo.value.is_send_ad === 0) { //正常 & 願意帶廣告
|
|
|
|
|
state.value.flexContent = JSON.parse(card)
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
let res2 = await getFlexcard();
|
|
|
|
|
if (res2.code === 200) {
|
|
|
|
|
let data = res2.data;
|
|
|
|
|
data.ad_image = imageUrl.value + data.ad_image;
|
|
|
|
|
state.value.flexContent = genAdCard(JSON.parse(card),data);
|
|
|
|
|
state.value.flexContent = genAdCard(JSON.parse(card), data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -152,6 +150,7 @@ const sendEcard = async () => {
|
|
|
|
|
|
|
|
|
|
let content = JSON.parse(JSON.stringify(state.value.flexContent))
|
|
|
|
|
|
|
|
|
|
console.log('content', JSON.stringify(state.value.flexContent))
|
|
|
|
|
let res
|
|
|
|
|
|
|
|
|
|
if (activeName.value === '0') {
|
|
|
|
|
@ -212,7 +211,7 @@ const changeTpl = async (val) => {
|
|
|
|
|
<h5 class="text-white mb-1"><strong>名片分享</strong></h5>
|
|
|
|
|
</template>
|
|
|
|
|
<template #left>
|
|
|
|
|
<h4><i class="fa-solid fa-angle-left text-white" :style="{opacity:0.5}"></i></h4>
|
|
|
|
|
<h4><i class="fa-solid fa-angle-left text-white" :style="{ opacity: 0.5 }"></i></h4>
|
|
|
|
|
</template>
|
|
|
|
|
</van-nav-bar>
|
|
|
|
|
|
|
|
|
|
@ -232,7 +231,7 @@ const changeTpl = async (val) => {
|
|
|
|
|
<template #title>
|
|
|
|
|
<div class="tab_item">
|
|
|
|
|
<i class="fa-solid fa-clipboard fa-2x mb-1"></i>
|
|
|
|
|
<p class="mb-3">{{state.card_title}}</p>
|
|
|
|
|
<p class="mb-3">{{ state.card_title }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</van-tab>
|
|
|
|
|
@ -241,7 +240,7 @@ const changeTpl = async (val) => {
|
|
|
|
|
<template #title>
|
|
|
|
|
<div class="tab_item">
|
|
|
|
|
<i class="fa-regular fa-file-lines fa-2x mb-1"></i>
|
|
|
|
|
<p class="mb-3">{{card.title}}</p>
|
|
|
|
|
<p class="mb-3">{{ card.title }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</van-tab>
|
|
|
|
|
@ -319,8 +318,9 @@ const changeTpl = async (val) => {
|
|
|
|
|
|
|
|
|
|
.tpl-list {
|
|
|
|
|
.tpl-item {
|
|
|
|
|
width:150px;
|
|
|
|
|
width: 150px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|