添加实时查询是否添加企微状态逻辑

This commit is contained in:
tcubic 2022-08-05 16:33:32 +08:00
parent cd86b96687
commit ef0b91c95c
3 changed files with 78 additions and 9 deletions

View File

@ -2,16 +2,16 @@
NODE_ENV = 'production'
// 入口地址
VUE_APP_BASE_URL = 'https://cdn.xglpa.com/tcubic/pdf/'
VUE_APP_BASE_URL = 'https://wealthplus.cmschina.com'
// 业务接口
VUE_APP_API = 'https://cdn.xglpa.com/tcubic/pdf/'
VUE_APP_API = 'https://wealthplus.cmschina.com'
// CDN地址
VUE_APP_CDN = 'https://cdn.xglpa.com/tcubic/pdf/'
VUE_APP_CDN = './'
// XGL授权接口
VUE_APP_XGL_DOMAIN = https://wealth.newone.com.cn
VUE_APP_XGL_DOMAIN = https://wealthplus.cmschina.com
// 招商证券授权接口
VUE_APP_ZS_DOMAIN = https://wealth.newone.com.cn
VUE_APP_ZS_DOMAIN = https://wealthplus.cmschina.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -7,16 +7,20 @@
<img :src="store.state.userAccount.eqcodeImg" alt="" />
</div>
</div>
<div class="update" v-if="isadd == 0" @click="updateStaus"></div>
<!-- 已经添加过并且领取了红包 -->
<div class="is_got_box" v-if="isadd == 1 && isgot"></div>
<!-- 已经添加过未领取了红包 -->
<div class="has_service_box" v-if="isadd == 1 && !isgot">
<!-- 红包中奖 -->
<div class="has_service_box" v-if="isadd == 1 && !isgot && !noPrize">
<div class="money">{{ moneyNum }}</div>
<div class="get_luckybag" @click="getLuckyBag"></div>
</div>
<!-- 红包未中奖 -->
<div class="no_prize" v-if="isadd == 1 && !isgot && noPrize"></div>
<div class="service_cls_btn" @click="hidePop"></div>
</div>
</div>
@ -61,6 +65,13 @@ const redpacketId = ref(0); //奖品Id
const moneyNum = ref(""); //
const isBingo = ref(false); //
const noPrize = ref(false); //
//
const updateStaus = () => {
getIsAddService();
};
//
onBeforeMount(() => {
if (store.state.userAccount.isAddCustomer == 1) {
@ -95,6 +106,13 @@ onMounted(() => {
autoAlpha: 0,
delay: 0.1,
});
gsap.from(".update", {
duration: 0.3,
y: 20,
autoAlpha: 0,
delay: 0.3,
});
gsap.from(".service_cls_btn", {
duration: 0.3,
y: 20,
@ -128,10 +146,20 @@ const draw = () => {
})
.then((res) => {
console.log("添加企微-抽取红包结果:", res);
redpacketId.value = res.data.data.id;
moneyNum.value = res.data.data.amount;
let data = res.data;
getMyPrizeRecored();
if (data.code == 0) {
isadd.value = true;
redpacketId.value = data.data.id;
moneyNum.value = data.data.amount;
if (data.data.amount == 0) {
noPrize.value = true;
}
} else {
Toast(data.msg);
}
});
};
@ -170,6 +198,36 @@ const getMyPrizeRecored = () => {
});
});
};
// isInActivityDate 0 1
const getIsAddService = () => {
let isInActivityDate = 1;
return service
.post(
process.env.VUE_APP_API +
"/cms-activity/cms88/qywx/isadded/" +
isInActivityDate,
{}
)
.then((res) => {
console.log("是否添加了企微", res.data);
// store.state.userAccount.isBirthMon = res.data.data
store.commit({
type: "updateIsAddCustomer",
isAddCustomer: res.data.data,
});
let data = res.data;
if (data.data == 1) {
draw();
}
if (data.data == 0) {
Toast("您还未添加企微,请扫码添加");
}
});
};
</script>
<style lang="scss" scoped>
@ -219,6 +277,12 @@ const getMyPrizeRecored = () => {
}
}
//
.no_prize {
@include box(573px, 362px);
@include bg_pos("../assets/img/pop/no_prize_pop.png");
}
.service_box {
@include box(573px, 688px);
@include bg_pos("../assets/img/pop/service_box.png");
@ -238,6 +302,11 @@ const getMyPrizeRecored = () => {
}
}
}
.update {
@include box(274px, 92px);
@include bg_pos("../assets/img/update_btn.png");
margin-top: 20px;
}
.service_cls_btn {
@include box(72px, 72px);