|
|
|
|
@ -3,7 +3,7 @@ import liff from "@line/liff";
|
|
|
|
|
|
|
|
|
|
import { showToast, showSuccessToast } from 'vant';
|
|
|
|
|
|
|
|
|
|
import { onBeforeMount, onMounted, reactive, ref, toRefs, computed, watch } from 'vue'
|
|
|
|
|
import { onMounted, ref, computed, watch } from 'vue'
|
|
|
|
|
|
|
|
|
|
import { getCard, getCusCard, getVipCard, updateSendCount, getFlexcard } from '@/api'
|
|
|
|
|
|
|
|
|
|
@ -46,7 +46,6 @@ const cusCardInfo = computed(() => {
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
// console.log('liff',liff)
|
|
|
|
|
await liff.init({ liffId: import.meta.env.VITE_APP_LINE_LIFF_ID });
|
|
|
|
|
|
|
|
|
|
await userStore.getUserData();
|
|
|
|
|
@ -59,9 +58,9 @@ onMounted(async () => {
|
|
|
|
|
state.value.vip_card = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切換tab
|
|
|
|
|
watch(() => activeName.value, function (newVal, oldVal) {
|
|
|
|
|
watch(() => activeName.value, function (newVal, oldVal) {
|
|
|
|
|
if (newVal !== oldVal) {
|
|
|
|
|
showFlex(newVal)
|
|
|
|
|
}
|
|
|
|
|
@ -86,14 +85,18 @@ 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 !== 0 && !userInfo.value.is_send_ad) { //正常 & 願意帶廣告
|
|
|
|
|
state.value.flexContent = JSON.parse(card)
|
|
|
|
|
} 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);
|
|
|
|
|
if (res2.data.length !== 0) {
|
|
|
|
|
let data = res2.data;
|
|
|
|
|
data.ad_image = imageUrl.value + data.ad_image;
|
|
|
|
|
state.value.flexContent = genAdCard(JSON.parse(card), data);
|
|
|
|
|
}else{
|
|
|
|
|
state.value.flexContent = JSON.parse(card)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -259,7 +262,7 @@ const changeTpl = async (val) => {
|
|
|
|
|
</div>
|
|
|
|
|
<h6 class="text-center text-white bg-darkBlue py-2">上面圖內「分享」無效,請點下列「分享」</h6>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<van-sticky position="bottom">
|
|
|
|
|
<div class="bottomBtnCnt d-flex">
|
|
|
|
|
<van-button block class="btn-skyBlue m-2" @click="sendEcard">
|
|
|
|
|
|