新增活动前是否添加企微状态

This commit is contained in:
tcubic 2022-08-05 22:56:49 +08:00
parent f45b6731c2
commit e391123b4e
3 changed files with 62 additions and 34 deletions

View File

@ -170,7 +170,6 @@ const serviceLuckyMsg = reactive({
const hideServiceLuckyPop = () => { const hideServiceLuckyPop = () => {
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 }); gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 });
}; };
// //
@ -360,11 +359,16 @@ onMounted(() => {
addPoint(); addPoint();
// ,,, // ,,,
if (
store.state.userAccount.isAddCustomer == 1 && //
!isGetedServiceLucky.value
) { if (store.state.userAccount.isAddCustomerBefore == 0) {
getluckyBag2(2); if (
store.state.userAccount.isAddCustomer == 1 &&
!isGetedServiceLucky.value
) {
getluckyBag2(2);
}
} }
if (!isDraw.value) { if (!isDraw.value) {
@ -401,7 +405,13 @@ const activityBtn = (item) => {
console.log(item.id); console.log(item.id);
if (item.id == 1) { if (item.id == 1) {
showServicePop.value = true;
if(store.state.userAccount.isAddCustomerBefore == 1){
Toast("您已添加过专属服务人员,请参与其他活动")
}else{
showServicePop.value = true;
}
} }
if (item.id == 2) { if (item.id == 2) {
@ -513,9 +523,9 @@ const getMyPrizeRecored = () => {
}); });
}; };
// isInActivityDate 0 1 // isInActivityDate 0 1
const getIsAddService = () => { const getIsAddService = (id) => {
let isInActivityDate = 0; let isInActivityDate = id;
service service
.post( .post(
process.env.VUE_APP_API + process.env.VUE_APP_API +
@ -601,7 +611,7 @@ const getluckyBag2 = (id) => {
duration: 0.5, duration: 0.5,
autoAlpha: 0, autoAlpha: 0,
y: 50, y: 50,
delay:0.5 delay: 0.5,
}); });
} else { } else {
console.log("企微不中奖"); console.log("企微不中奖");
@ -659,20 +669,22 @@ const addPoint = () => {
const deleteNum = ref(0); const deleteNum = ref(0);
// //
const deleteData = (type) => { const deleteData = (type) => {
deleteNum.value++; if (process.env.NODE_ENV == "test") {
if (deleteNum.value == 3) { deleteNum.value++;
let type = 0; if (deleteNum.value == 3) {
service let type = 0;
.post( service
process.env.VUE_APP_API + .post(
"/cms-activity/cms88/redpacket/delete/" + process.env.VUE_APP_API +
type, "/cms-activity/cms88/redpacket/delete/" +
{} type,
) {}
.then((res) => { )
console.log("数据已清空", res); .then((res) => {
deleteNum.value = 0; console.log("数据已清空", res);
}); deleteNum.value = 0;
});
}
} }
}; };
</script> </script>

View File

@ -75,9 +75,9 @@ const getBrithday = () => {
// }); // });
}; };
// isInActivityDate 0 1 // isInActivityDate 0 1
const getIsAddService = () => { const getIsAddService = (id) => {
let isInActivityDate = 1; let isInActivityDate = id;
return service return service
.post( .post(
process.env.VUE_APP_API + process.env.VUE_APP_API +
@ -146,7 +146,8 @@ const apiAll = ()=>{
getMyPrizeRecored(), getMyPrizeRecored(),
getBrithday(), getBrithday(),
getActivityNum(), getActivityNum(),
getIsAddService(), getIsAddService(0),
getIsAddService(1),
]).then((result) => { ]).then((result) => {
// console.log("", result); // console.log("", result);
console.log("1.获取企业微信二维码:",result[0].data); console.log("1.获取企业微信二维码:",result[0].data);
@ -154,7 +155,8 @@ const apiAll = ()=>{
console.log("3.获取红包记录:",result[2].data); console.log("3.获取红包记录:",result[2].data);
console.log("4.获取生日状态:",result[3].data); console.log("4.获取生日状态:",result[3].data);
console.log("5.获取活动人数:",result[4].data); console.log("5.获取活动人数:",result[4].data);
console.log("5.获取添加企业微信状态:",result[5].data); console.log("6.获取添加企业微信状态【活动前是否存在】:",result[5].data);
console.log("7.获取添加企业微信状态【活动期间是否添加】:",result[6].data);
// //
store.commit({ type: "updateeEqcodeImg", eqcodeImg: result[0].data.data,}); store.commit({ type: "updateeEqcodeImg", eqcodeImg: result[0].data.data,});
@ -170,8 +172,11 @@ const apiAll = ()=>{
// //
store.commit({type: "updateParticipantNum",participantNum: result[4].data.data,}); store.commit({type: "updateParticipantNum",participantNum: result[4].data.data,});
// //
store.commit({type: "updateIsAddCustomer",isAddCustomer: result[5].data.data,}); store.commit({type: "updateisAddCustomerBefore",isAddCustomerBefore: result[5].data.data,});
//
store.commit({type: "updateIsAddCustomer",isAddCustomer: result[6].data.data,});

View File

@ -13,7 +13,8 @@ export default createStore({
nkh: '', //牛卡号 nkh: '', //牛卡号
isDraw: false, //是否抽过奖 isDraw: false, //是否抽过奖
isHasAccount: false, //是否存在牛卡号 isHasAccount: false, //是否存在牛卡号
isAddCustomer: 0, //是否添加过服务人员 isAddCustomer: 0, //活动期间内是否添加过服务人员
isAddCustomerBefore:0, //活动前是否存在服务人员
isHasPrize: [], //是否存在奖品 isHasPrize: [], //是否存在奖品
participantNum: 0, //活动参与人数 participantNum: 0, //活动参与人数
prizeResult: 0, //中奖金额 prizeResult: 0, //中奖金额
@ -43,27 +44,37 @@ export default createStore({
state.userAccount.nkh = val.nkh state.userAccount.nkh = val.nkh
}, },
// 更新cardId
updateCardId(state,val){ updateCardId(state,val){
state.userAccount.cardId = val.cardId state.userAccount.cardId = val.cardId
}, },
// 更新二维码
updateeEqcodeImg(state,val){ updateeEqcodeImg(state,val){
state.userAccount.eqcodeImg = val.eqcodeImg state.userAccount.eqcodeImg = val.eqcodeImg
}, },
// 更新活动参与人数
updateParticipantNum(state,val){ updateParticipantNum(state,val){
state.userAccount.participantNum = val.participantNum state.userAccount.participantNum = val.participantNum
}, },
// 更新生日是否处于当月状态
updateBirthMoon(state,val){ updateBirthMoon(state,val){
state.userAccount.isBirthMon = val.isBirthMon state.userAccount.isBirthMon = val.isBirthMon
}, },
// 更新活动期间内是否添加过企微状态
updateIsAddCustomer(state,val){ updateIsAddCustomer(state,val){
state.userAccount.isAddCustomer = val.isAddCustomer state.userAccount.isAddCustomer = val.isAddCustomer
}, },
// 更新奖品 // 更新活动前是否存在企微状态
updateisAddCustomerBefore(state,val){
state.userAccount.isAddCustomerBefore = val.isAddCustomerBefore
},
// 更新奖品列表
updatePrizeList(state,val){ updatePrizeList(state,val){
state.userAccount.prizeList = val.prizeList state.userAccount.prizeList = val.prizeList
} }