From 1fc1dfd7a7705c551bc93268a3251a0fca3fee9c Mon Sep 17 00:00:00 2001 From: Wayne Date: Sun, 24 Dec 2023 18:01:32 +0800 Subject: [PATCH] 0000815 --- src/utils/card/card1.js | 2 +- src/views/Home/index.vue | 1 + src/views/Send/index.vue | 21 ++++++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/utils/card/card1.js b/src/utils/card/card1.js index 5a860a8..f8fc699 100644 --- a/src/utils/card/card1.js +++ b/src/utils/card/card1.js @@ -91,7 +91,7 @@ function genCard(vcard) { } } ] - } + }, `; } else { vcardAddr = ""; diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index 697090c..13805e6 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -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 diff --git a/src/views/Send/index.vue b/src/views/Send/index.vue index 8881f6d..61ee6fa 100644 --- a/src/views/Send/index.vue +++ b/src/views/Send/index.vue @@ -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) => {
上面圖內「分享」無效,請點下列「分享」
- +