main
Wayne 2 years ago
parent 54bbae189b
commit 1fc1dfd7a7

@ -91,7 +91,7 @@ function genCard(vcard) {
}
}
]
}
},
`;
} else {
vcardAddr = "";

@ -175,6 +175,7 @@ const onUpdateValue = (newValue) => {
cancelButtonText: "取消",
}).then(() => {
let res = userStore.setSendWithAd(newValue)
console.log('aaa',userInfo.value.is_send_ad)
}).catch(() => {
// on cancel

@ -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();
@ -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) {
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)
}
}
}

Loading…
Cancel
Save