diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7641bd4..2bdf234 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -74,6 +74,7 @@ const accountList = reactive([ { username: "19191703856", type: 'warning', label: '喜气洋洋' }, { username: "19107220837", type: 'danger', label: '快乐时光店铺' }, { username: "18199991111", type: 'success', label: '草莓加盟主店可直接管理' }, + { username: "18821670757", type: 'primary', label: '强盛集团' }, ]); // 快捷模拟登录 diff --git a/src/views/marketing_center/birthdayGift/index.vue b/src/views/marketing_center/birthdayGift/index.vue index 609887e..32909cc 100644 --- a/src/views/marketing_center/birthdayGift/index.vue +++ b/src/views/marketing_center/birthdayGift/index.vue @@ -1,75 +1,77 @@ @@ -85,7 +87,7 @@ import { ref, reactive, watch, toRaw, getCurrentInstance, onMounted } from "vue" import { ElMessage } from "element-plus"; import { useRouter } from "vue-router"; -const shopInfo = ref(""); +const shopInfo = ref(JSON.parse(localStorage.getItem("userInfo"))); const inputStyle = { width: "340px", }; @@ -150,21 +152,40 @@ function basicSubmit() { }); } + +const isUse = ref(false) async function init() { birthdayGiftApi.getConfig().then((res) => { res.configList = res.configList || []; Object.assign(basicForm, res); basicForm.isEnable = basicForm.isEnable; + + if (res.isEnable == 1) { + isUse.value = true + // if (shopInfo.value.shopType == 'only') { + // isUse.value = true + // } + // else { + // if (res.useType == 'all') { + // isUse.value = true + // } else { + // let currentShopId = shopInfo.value.shopId; + // res.shopIdList.some((item) => { + // if (item == currentShopId) { + // isUse.value = true; + // return true; + // } + // }); + // } + // } + } else { + isUse.value = false + } }); } -// 从本地获取商户信息 -function getLocalShopInfo() { - shopInfo.value = JSON.parse(localStorage.getItem("userInfo")); -} onMounted(() => { init(); - getLocalShopInfo(); }); //计算总优惠券数量 function totalCount(arr) { diff --git a/src/views/marketing_center/cashback/index.vue b/src/views/marketing_center/cashback/index.vue index 6f0aaf0..bd739e9 100644 --- a/src/views/marketing_center/cashback/index.vue +++ b/src/views/marketing_center/cashback/index.vue @@ -2,82 +2,85 @@ @@ -182,6 +185,7 @@ function submitHandle() { } // 配置信息获取 +const isUse = ref(false) async function consumeCashbackAjax() { try { const res = await consumeCashback() @@ -189,6 +193,22 @@ async function consumeCashbackAjax() { res.cashbackStepList = [] } form.value = res + + if (res.isEnable == 1) { + if (res.useType == 'all' || shopInfo.value.shopType == 'only') { + isUse.value = true + } else { + let currentShopId = shopInfo.value.shopId; + res.shopIdList.some((item) => { + if (item == currentShopId) { + isUse.value = true; + return true; + } + }); + } + } else { + isUse.value = false + } } catch (error) { console.log(error); } diff --git a/src/views/marketing_center/components/couponDialog.vue b/src/views/marketing_center/components/couponDialog.vue index e59a8a4..a817e53 100644 --- a/src/views/marketing_center/components/couponDialog.vue +++ b/src/views/marketing_center/components/couponDialog.vue @@ -808,43 +808,43 @@ function convertTimeToDate(timeStr, options = {}) { // input过滤 const time = 500; const discountNumInput = _.debounce(function (value) { - form.value.discountNum = filterNumberInput(value, true); + form.value.discountNum = filterNumberInput(value, 1); if (form.value.discountNum == "") { form.value.discountNum = 1; } }, time); const discountRateInput = _.debounce(function (value) { - form.value.discountRate = filterNumberInput(value, true); + form.value.discountRate = filterNumberInput(value, 1); if (form.value.discountRate >= 100) { form.value.discountRate = 100; } }, time); const validDaysInput = _.debounce(function (value) { - form.value.validDays = filterNumberInput(value, true); + form.value.validDays = filterNumberInput(value, 1); }, time); const daysToTakeEffectInput = _.debounce(function (value) { - form.value.daysToTakeEffect = filterNumberInput(value, true); + form.value.daysToTakeEffect = filterNumberInput(value, 1); if (form.value.daysToTakeEffect === "") { form.value.daysToTakeEffect = 0; } }, time); const giveNumInput = _.debounce(function (value) { - form.value.giveNum = filterNumberInput(value, true); + form.value.giveNum = filterNumberInput(value, 1); }, time); const getLimitInput = _.debounce(function (value) { - form.value.getLimit = filterNumberInput(value, true); + form.value.getLimit = filterNumberInput(value, 1); if (form.value.getLimit == "") { form.value.getLimit = 1; } }, time); const useLimitInput = _.debounce(function (value) { - form.value.useLimit = filterNumberInput(value, true); + form.value.useLimit = filterNumberInput(value, 1); if (form.value.useLimit >= form.value.getLimit) { form.value.useLimit = form.value.getLimit; } diff --git a/src/views/marketing_center/consume_ticket/components/dialogForm.vue b/src/views/marketing_center/consume_ticket/components/dialogForm.vue index d6e4dfb..5de6c8c 100644 --- a/src/views/marketing_center/consume_ticket/components/dialogForm.vue +++ b/src/views/marketing_center/consume_ticket/components/dialogForm.vue @@ -1,36 +1,15 @@