优化营销中心霸王餐/超级会员分店限时
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<my-bottom-btn-group @cancel="cancel" @save="editFreeDing" isOpenPermission></my-bottom-btn-group>
|
||||
<my-marketing-mask name="霸王餐" v-if="isMarketShow(form)"></my-marketing-mask>
|
||||
<my-marketing-mask name="霸王餐" v-if="isMarketShow(configInfo, 'shopIdList', 'enable')"></my-marketing-mask>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -74,6 +74,9 @@ import { onShow, onLoad } from '@dcloudio/uni-app';
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { isMainShop, isMarketShow } from '@/store/account';
|
||||
import { getFreeDing, updateFreeDing } from '@/http/api/freeDing.js';
|
||||
|
||||
const configInfo = ref({});
|
||||
|
||||
const form = reactive({
|
||||
rechargeTimes: 2,
|
||||
rechargeThreshold: '',
|
||||
@@ -96,6 +99,7 @@ onShow(() => {
|
||||
*/
|
||||
const getlist = async () => {
|
||||
let res = await getFreeDing();
|
||||
configInfo.value = res;
|
||||
res.shopIdList = res.shopIdList || [];
|
||||
Object.assign(form, res);
|
||||
};
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
@select="selectStatus"
|
||||
:show="showAction"
|
||||
></u-action-sheet>
|
||||
<my-marketing-mask name="充值兑换码" v-if="isMarketShow(form)"></my-marketing-mask>
|
||||
<my-marketing-mask name="券兑换码" v-if="isMarketShow(form)"></my-marketing-mask>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<my-header-card :options="{ name: '限时折扣', intro: '批量设置商品折扣', icon: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/bc360b13e5734821a2de2f0494b72a8b.png' }"></my-header-card>
|
||||
<my-header-card
|
||||
:options="{ name: '限时折扣', intro: '批量设置商品折扣', icon: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/bc360b13e5734821a2de2f0494b72a8b.png' }"
|
||||
></my-header-card>
|
||||
<view class="list">
|
||||
<view class="item" v-for="item in tableData.list" :key="item.id">
|
||||
<view class="head">
|
||||
@@ -49,7 +51,7 @@ import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { limitTimeDiscountPage, limitTimeDiscountDel } from '@/http/api/market/index.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { convertTimeFormat } from '@/utils/index.js';
|
||||
import {isMainShop} from "@/store/account.js";
|
||||
import { isMainShop, isMarketShow } from '@/store/account.js';
|
||||
// 去编辑
|
||||
function editorHandle(item) {
|
||||
uni.setStorageSync('limitDiscountObj', item);
|
||||
|
||||
@@ -1,354 +1,329 @@
|
||||
<template>
|
||||
<view class="box">
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">提交生日/姓名</text>
|
||||
<up-radio-group v-model="form.isSubmitInfo" placement="row">
|
||||
<up-radio :key="1" :name="1">
|
||||
<template #label>
|
||||
<text> 是 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio :key="0" :name="0">
|
||||
<template #label>
|
||||
<text> 否 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-10"
|
||||
>*成为会员前需提交生日、姓名、性别信息</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">提交生日/姓名</text>
|
||||
<up-radio-group v-model="form.isSubmitInfo" placement="row">
|
||||
<up-radio :key="1" :name="1" :customStyle="radioStyle">
|
||||
<template #label>
|
||||
<text>是</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio :key="0" :name="0" :customStyle="radioStyle">
|
||||
<template #label>
|
||||
<text>否</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-10">*成为会员前需提交生日、姓名、性别信息</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">会员开通方式</text>
|
||||
<up-radio-group v-model="form.openType" placement="row">
|
||||
<up-radio key="PAY" name="PAY">
|
||||
<template #label>
|
||||
<text> 购买开通 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio key="CONDITION" name="CONDITION">
|
||||
<template #label>
|
||||
<text> 条件开通 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-line></up-line>
|
||||
</view>
|
||||
<template v-if="form.openType == 'PAY'">
|
||||
<view
|
||||
class="u-flex u-row-between u-p-t-26"
|
||||
@click="go.to('PAGES_MARKET_SUPER_VIP_VIP_PLANS')"
|
||||
>
|
||||
<text class="font-bold color-333">会员周期列表</text>
|
||||
<view class="u-flex">
|
||||
<text class="u-font-24 color-main">去设置</text>
|
||||
<up-icon name="arrow-right" color="#318AFE"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="form.openType == 'CONDITION'">
|
||||
<view class="u-flex u-row-between u-col-baseline u-m-t-32">
|
||||
<text class="font-bold color-333">成为会员条件</text>
|
||||
<view class="u-flex-1 u-p-l-32">
|
||||
<view v-for="(item, index) in conditionLists" :key="index">
|
||||
<up-checkbox usedAlone v-model:checked="item.checked">
|
||||
<template #label>
|
||||
<view> {{ item.label }} </view>
|
||||
</template>
|
||||
</up-checkbox>
|
||||
<view class="u-m-t-24 u-m-b-24">
|
||||
<up-number-box
|
||||
:inputWidth="100"
|
||||
:decimalLength="item.precision || 0"
|
||||
v-if="item.label != '绑定手机号' && item.checked"
|
||||
v-model="item.value"
|
||||
:step="item.step"
|
||||
:min="item.min || 0"
|
||||
></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">可用门店</view>
|
||||
<my-shop-select
|
||||
@shop-select="shopSelect"
|
||||
v-model:selShops="form.memberPriceShopIdList"
|
||||
v-model:useType="form.memberPriceShopType"
|
||||
></my-shop-select>
|
||||
</view>
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">会员开通方式</text>
|
||||
<up-radio-group v-model="form.openType" placement="row">
|
||||
<up-radio key="PAY" name="PAY" :customStyle="radioStyle">
|
||||
<template #label>
|
||||
<text>购买开通</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio key="CONDITION" name="CONDITION" :customStyle="radioStyle">
|
||||
<template #label>
|
||||
<text>条件开通</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-line></up-line>
|
||||
</view>
|
||||
<template v-if="form.openType == 'PAY'">
|
||||
<view class="u-flex u-row-between u-p-t-26" @click="go.to('PAGES_MARKET_SUPER_VIP_VIP_PLANS')">
|
||||
<text class="font-bold color-333">会员周期列表</text>
|
||||
<view class="u-flex">
|
||||
<text class="u-font-24 color-main">去设置</text>
|
||||
<up-icon name="arrow-right" color="#318AFE"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="form.openType == 'CONDITION'">
|
||||
<view class="u-flex u-row-between u-col-baseline u-m-t-32">
|
||||
<text class="font-bold color-333">成为会员条件</text>
|
||||
<view class="u-flex-1 u-p-l-32">
|
||||
<view v-for="(item, index) in conditionLists" :key="index">
|
||||
<up-checkbox usedAlone v-model:checked="item.checked">
|
||||
<template #label>
|
||||
<view>{{ item.label }}</view>
|
||||
</template>
|
||||
</up-checkbox>
|
||||
<view class="u-m-t-24 u-m-b-24">
|
||||
<up-number-box
|
||||
:inputWidth="100"
|
||||
:decimalLength="item.precision || 0"
|
||||
v-if="item.label != '绑定手机号' && item.checked"
|
||||
v-model="item.value"
|
||||
:step="item.step"
|
||||
:min="item.min || 0"
|
||||
></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">可用门店</view>
|
||||
<my-shop-select @shop-select="shopSelect" v-model:selShops="form.memberPriceShopIdList" v-model:useType="form.memberPriceShopType"></my-shop-select>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">规则说明</view>
|
||||
<up-textarea
|
||||
v-model="form.remark"
|
||||
placeholder="请输入规则说明"
|
||||
></up-textarea>
|
||||
</view>
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">规则说明</view>
|
||||
<up-textarea v-model="form.remark" placeholder="请输入规则说明"></up-textarea>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333">获取成长值升级</view>
|
||||
<view class="u-m-t-6 color-999 u-font-24"
|
||||
>*两个条件必选有一条是大于0的数值</view
|
||||
>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每消费1元获得成长值</text>
|
||||
<up-number-box
|
||||
v-model="form.costReward"
|
||||
inputWidth="80"
|
||||
placeholder="请输入内容"
|
||||
></up-number-box>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每充值1元获得成长值</text>
|
||||
<up-number-box
|
||||
v-model="form.rechargeReward"
|
||||
inputWidth="80"
|
||||
placeholder="请输入内容"
|
||||
></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333">获取成长值升级</view>
|
||||
<view class="u-m-t-6 color-999 u-font-24">*两个条件必选有一条是大于0的数值</view>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每消费1元获得成长值</text>
|
||||
<up-number-box v-model="form.costReward" inputWidth="80" placeholder="请输入内容"></up-number-box>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每充值1元获得成长值</text>
|
||||
<up-number-box v-model="form.rechargeReward" inputWidth="80" placeholder="请输入内容"></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, computed, onMounted, ref, inject, watch } from "vue";
|
||||
import userTypes from "./user-types.vue";
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { reactive, computed, onMounted, ref, inject, watch } from 'vue';
|
||||
import userTypes from './user-types.vue';
|
||||
import { onLoad, onReady, onShow, onPageScroll, onReachBottom, onBackPress } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
|
||||
const radioStyle = ref({
|
||||
marginLeft: '14px'
|
||||
});
|
||||
|
||||
const conditionLists = ref([
|
||||
{ label: "绑定手机号", checked: false, code: "BIND_PHONE" },
|
||||
{
|
||||
label: "订单达成指定次数",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "ORDER",
|
||||
step: 1,
|
||||
stepStrictly: true,
|
||||
min: 1,
|
||||
},
|
||||
{
|
||||
label: "消费达到指定金额",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "COST_AMOUNT",
|
||||
precision: 2,
|
||||
min: 0.01,
|
||||
},
|
||||
{
|
||||
label: "充值达到指定金额",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "RECHARGE_AMOUNT",
|
||||
precision: 2,
|
||||
min: 0.01,
|
||||
},
|
||||
{ label: '绑定手机号', checked: false, code: 'BIND_PHONE' },
|
||||
{
|
||||
label: '订单达成指定次数',
|
||||
checked: false,
|
||||
value: '',
|
||||
code: 'ORDER',
|
||||
step: 1,
|
||||
stepStrictly: true,
|
||||
min: 1
|
||||
},
|
||||
{
|
||||
label: '消费达到指定金额',
|
||||
checked: false,
|
||||
value: '',
|
||||
code: 'COST_AMOUNT',
|
||||
precision: 2,
|
||||
min: 0.01
|
||||
},
|
||||
{
|
||||
label: '充值达到指定金额',
|
||||
checked: false,
|
||||
value: '',
|
||||
code: 'RECHARGE_AMOUNT',
|
||||
precision: 2,
|
||||
min: 0.01
|
||||
}
|
||||
]);
|
||||
|
||||
const superVipStore = inject("superVipStore");
|
||||
const superVipStore = inject('superVipStore');
|
||||
|
||||
//分销奖励次数
|
||||
const isLimitCount = ref(0);
|
||||
const isLimitCounts = [
|
||||
{
|
||||
value: 0,
|
||||
label: "限制",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "不限制",
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '限制'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '不限制'
|
||||
}
|
||||
];
|
||||
//开通方式
|
||||
const opentypes = [
|
||||
{
|
||||
value: "auto",
|
||||
label: "自动开通",
|
||||
},
|
||||
{
|
||||
value: "manual",
|
||||
label: "手动开通",
|
||||
},
|
||||
{
|
||||
value: "pay",
|
||||
label: "付费开通",
|
||||
},
|
||||
{
|
||||
value: 'auto',
|
||||
label: '自动开通'
|
||||
},
|
||||
{
|
||||
value: 'manual',
|
||||
label: '手动开通'
|
||||
},
|
||||
{
|
||||
value: 'pay',
|
||||
label: '付费开通'
|
||||
}
|
||||
];
|
||||
const form = reactive({
|
||||
isSubmitInfo: 1,
|
||||
openType: "PAY",
|
||||
configList: [],
|
||||
memberPriceShopType: "ALL",
|
||||
remark: "",
|
||||
costReward: 0,
|
||||
rechargeReward: 0,
|
||||
memberPriceShopIdList: [],
|
||||
isMemberPrice: 1,
|
||||
isOpen: 0,
|
||||
isSubmitInfo: 1,
|
||||
openType: 'PAY',
|
||||
configList: [],
|
||||
memberPriceShopType: 'ALL',
|
||||
remark: '',
|
||||
costReward: 0,
|
||||
rechargeReward: 0,
|
||||
memberPriceShopIdList: [],
|
||||
isMemberPrice: 1,
|
||||
isOpen: 0
|
||||
});
|
||||
watch(
|
||||
() => isLimitCount.value,
|
||||
(newval) => {
|
||||
if (newval) {
|
||||
form.rewardCount = -1;
|
||||
} else {
|
||||
form.rewardCount = "";
|
||||
}
|
||||
}
|
||||
() => isLimitCount.value,
|
||||
(newval) => {
|
||||
if (newval) {
|
||||
form.rewardCount = -1;
|
||||
} else {
|
||||
form.rewardCount = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
async function save() {
|
||||
console.log(form);
|
||||
const submitData = {
|
||||
...form,
|
||||
conditionList: conditionLists.value
|
||||
.filter((v) => v.checked)
|
||||
.map((v) => ({
|
||||
code: v.code,
|
||||
value: v.value,
|
||||
})),
|
||||
};
|
||||
const res = await superVipStore.editConfig(submitData);
|
||||
uni.showToast({
|
||||
title: "更新成功",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
console.log(form);
|
||||
const submitData = {
|
||||
...form,
|
||||
conditionList: conditionLists.value
|
||||
.filter((v) => v.checked)
|
||||
.map((v) => ({
|
||||
code: v.code,
|
||||
value: v.value
|
||||
}))
|
||||
};
|
||||
const res = await superVipStore.editConfig(submitData);
|
||||
uni.showToast({
|
||||
title: '更新成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
function cancel() {
|
||||
uni.navigateBack();
|
||||
uni.navigateBack();
|
||||
}
|
||||
watch(
|
||||
() => superVipStore.config,
|
||||
(newval) => {
|
||||
setForm(newval);
|
||||
}
|
||||
() => superVipStore.config,
|
||||
(newval) => {
|
||||
setForm(newval);
|
||||
}
|
||||
);
|
||||
|
||||
function setForm(data) {
|
||||
if (data.rewardCount == -1) {
|
||||
isLimitCount.value = 1;
|
||||
}
|
||||
console.log(data);
|
||||
if (data.rewardCount == -1) {
|
||||
isLimitCount.value = 1;
|
||||
}
|
||||
console.log(data);
|
||||
|
||||
conditionLists.value = conditionLists.value.map((v) => {
|
||||
const findItem = data.conditionList.find((cond) => cond.code == v.code);
|
||||
if (findItem) {
|
||||
v.value = findItem.value;
|
||||
v.checked = true;
|
||||
} else {
|
||||
v.checked = false;
|
||||
}
|
||||
return v;
|
||||
});
|
||||
Object.assign(form, data);
|
||||
console.log(form);
|
||||
conditionLists.value = conditionLists.value.map((v) => {
|
||||
const findItem = data.conditionList.find((cond) => cond.code == v.code);
|
||||
if (findItem) {
|
||||
v.value = findItem.value;
|
||||
v.checked = true;
|
||||
} else {
|
||||
v.checked = false;
|
||||
}
|
||||
return v;
|
||||
});
|
||||
Object.assign(form, data);
|
||||
console.log(form);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setForm(superVipStore.config);
|
||||
setForm(superVipStore.config);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.x-padding {
|
||||
padding: 0 24rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.text-tips {
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background-color: #f7f7fa;
|
||||
line-height: 60rpx;
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background-color: #f7f7fa;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.text-tips1 {
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
}
|
||||
.gap-40 {
|
||||
gap: 40rpx;
|
||||
gap: 40rpx;
|
||||
}
|
||||
.my-input {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
height: 60rpx;
|
||||
border-right: none;
|
||||
width: 240rpx;
|
||||
text-align: center;
|
||||
padding: 0 2px;
|
||||
font-size: 14px;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
height: 60rpx;
|
||||
border-right: none;
|
||||
width: 240rpx;
|
||||
text-align: center;
|
||||
padding: 0 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.box {
|
||||
padding: 0 28rpx;
|
||||
font-size: 28rpx;
|
||||
padding: 0 28rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.add {
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #318afe;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
line-height: 56rpx;
|
||||
margin: 0;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #318afe;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
line-height: 56rpx;
|
||||
margin: 0;
|
||||
}
|
||||
.color-red {
|
||||
color: #ff2f2f;
|
||||
color: #ff2f2f;
|
||||
}
|
||||
$height: 70rpx;
|
||||
.number-box {
|
||||
font-size: 28rpx;
|
||||
padding: 0 26rpx;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
border-top: 2rpx solid #d9d9d9;
|
||||
border-bottom: 2rpx solid #d9d9d9;
|
||||
border-left: 2rpx solid #d9d9d9;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
height: $height;
|
||||
flex: 1;
|
||||
line-height: $height;
|
||||
font-size: 28rpx;
|
||||
padding: 0 26rpx;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
border-top: 2rpx solid #d9d9d9;
|
||||
border-bottom: 2rpx solid #d9d9d9;
|
||||
border-left: 2rpx solid #d9d9d9;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
height: $height;
|
||||
flex: 1;
|
||||
line-height: $height;
|
||||
}
|
||||
.unit {
|
||||
display: flex;
|
||||
padding: 0 38rpx;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
align-items: center;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #f7f7fa;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
display: flex;
|
||||
padding: 0 38rpx;
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
align-items: center;
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #f7f7fa;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
:deep(.custome .u-radio-group) {
|
||||
justify-content: flex-end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,447 +1,372 @@
|
||||
<template>
|
||||
<view class="min-page u-font-28">
|
||||
<up-sticky>
|
||||
<view class="bg-fff top">
|
||||
<view class="bg-fff container u-flex u-m-b-48">
|
||||
<image
|
||||
style="width: 60rpx; height: 60rpx"
|
||||
src="/pageMarket/static/images/member.png"
|
||||
></image>
|
||||
<view class="u-flex-1 u-flex u-p-l-24">
|
||||
<view class="u-font-28 u-flex-1 u-p-r-4">
|
||||
<view class="color-333 font-bold">超级会员</view>
|
||||
<view class="color-666 u-m-t-4 u-font-24">用户会员管理设置 </view>
|
||||
</view>
|
||||
<up-switch
|
||||
v-model="superVipStore.config.isOpen"
|
||||
size="18"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
|
||||
<view
|
||||
v-if="active == 2"
|
||||
class="u-flex u-row-between u-m-t-32"
|
||||
style="gap: 58rpx"
|
||||
>
|
||||
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
||||
<up-icon name="search" size="18"></up-icon>
|
||||
<input
|
||||
class="u-m-l-10 u-font-28"
|
||||
type="text"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
placeholder="搜索关键词"
|
||||
v-model="keyWord"
|
||||
@blur="keyWordBlur"
|
||||
/>
|
||||
<up-icon
|
||||
v-if="keyWord"
|
||||
name="close"
|
||||
size="14"
|
||||
@click="clearKeyWord"
|
||||
></up-icon>
|
||||
</view>
|
||||
<view
|
||||
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
|
||||
@click="showTimeArea = true"
|
||||
>
|
||||
<template
|
||||
v-if="userComponentQuery.startTime && userComponentQuery.endTime"
|
||||
>
|
||||
<text class="u-font-20">
|
||||
{{ userComponentQuery.startTime }} -
|
||||
{{ userComponentQuery.endTime }}
|
||||
</text>
|
||||
<view @click.stop="clearTime">
|
||||
<up-icon name="close" size="14"></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="color-999">请选择日期范围</text>
|
||||
<up-icon name="arrow-right" size="12"></up-icon>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="min-page u-font-28">
|
||||
<up-sticky>
|
||||
<view class="bg-fff top">
|
||||
<view class="bg-fff container u-flex u-m-b-48">
|
||||
<image style="width: 60rpx; height: 60rpx" src="/pageMarket/static/images/member.png"></image>
|
||||
<view class="u-flex-1 u-flex u-p-l-24">
|
||||
<view class="u-font-28 u-flex-1 u-p-r-4">
|
||||
<view class="color-333 font-bold">超级会员</view>
|
||||
<view class="color-666 u-m-t-4 u-font-24">用户会员管理设置</view>
|
||||
</view>
|
||||
<up-switch v-model="superVipStore.config.isOpen" size="18" active-value="1" inactive-value="0" :disabled="isMainShop() ? false : true"></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
|
||||
<view v-if="active == 2" class="u-flex u-row-between u-m-t-32" style="gap: 58rpx">
|
||||
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
||||
<up-icon name="search" size="18"></up-icon>
|
||||
<input class="u-m-l-10 u-font-28" type="text" placeholder-class="color-999 u-font-28" placeholder="搜索关键词" v-model="keyWord" @blur="keyWordBlur" />
|
||||
<up-icon v-if="keyWord" name="close" size="14" @click="clearKeyWord"></up-icon>
|
||||
</view>
|
||||
<view class="u-flex-1 u-font-28 filter-box u-flex u-row-between" @click="showTimeArea = true">
|
||||
<template v-if="userComponentQuery.startTime && userComponentQuery.endTime">
|
||||
<text class="u-font-20">
|
||||
{{ userComponentQuery.startTime }} -
|
||||
{{ userComponentQuery.endTime }}
|
||||
</text>
|
||||
<view @click.stop="clearTime">
|
||||
<up-icon name="close" size="14"></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="color-999">请选择日期范围</text>
|
||||
<up-icon name="arrow-right" size="12"></up-icon>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="active == 2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.totalRow
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单数</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.totalAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单金额(元)</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="active == 3" class="u-flex u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.successAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">已入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.pendingAmount || 0
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">待入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.balanceAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">
|
||||
<text>运营余额(元)</text>
|
||||
<text class="color-main" @click="go.to('PAGES_PAY')"
|
||||
>充值{{ ">" }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-sticky>
|
||||
<configVue v-if="active == 0"></configVue>
|
||||
<vipLvList
|
||||
v-if="active == 1"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></vipLvList>
|
||||
<view v-if="active == 2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{ listRes.totalRow }}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单数</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{ listRes.totalAmount }}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单金额(元)</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="active == 3" class="u-flex u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{ listRes.successAmount }}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">已入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{ listRes.pendingAmount || 0 }}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">待入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{ listRes.balanceAmount }}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">
|
||||
<text>运营余额(元)</text>
|
||||
<text class="color-main" @click="go.to('PAGES_PAY')">充值{{ '>' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-sticky>
|
||||
<configVue v-if="active == 0"></configVue>
|
||||
<vipLvList v-if="active == 1" :list="list" :isEnd="isEnd" @refresh="refresh"></vipLvList>
|
||||
|
||||
<openListVue
|
||||
v-if="active == 2"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></openListVue>
|
||||
<fenxiaoMingxiVue
|
||||
v-if="active == 3"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></fenxiaoMingxiVue>
|
||||
<!-- 选择门店 -->
|
||||
<shopSelActionSheetVue
|
||||
@choose="chooseShop"
|
||||
v-model="showShopSelActionSheet"
|
||||
title="选择门店"
|
||||
>
|
||||
</shopSelActionSheetVue>
|
||||
<openListVue v-if="active == 2" :list="list" :isEnd="isEnd" @refresh="refresh"></openListVue>
|
||||
<fenxiaoMingxiVue v-if="active == 3" :list="list" :isEnd="isEnd" @refresh="refresh"></fenxiaoMingxiVue>
|
||||
<!-- 选择门店 -->
|
||||
<shopSelActionSheetVue @choose="chooseShop" v-model="showShopSelActionSheet" title="选择门店"></shopSelActionSheetVue>
|
||||
|
||||
<dateAreaSel
|
||||
:show="showTimeArea"
|
||||
:minYear="2022"
|
||||
@close="showTimeArea = false"
|
||||
@confirm="confirmTimeArea"
|
||||
></dateAreaSel>
|
||||
<dateAreaSel :show="showTimeArea" :minYear="2022" @close="showTimeArea = false" @confirm="confirmTimeArea"></dateAreaSel>
|
||||
|
||||
<!-- 分销明细状态 -->
|
||||
<up-action-sheet
|
||||
:show="showActions"
|
||||
:actions="actions"
|
||||
@select="handleSelect"
|
||||
@close="showActions = false"
|
||||
cancel-text="取消"
|
||||
></up-action-sheet>
|
||||
</view>
|
||||
<!-- 分销明细状态 -->
|
||||
<up-action-sheet :show="showActions" :actions="actions" @select="handleSelect" @close="showActions = false" cancel-text="取消"></up-action-sheet>
|
||||
|
||||
<my-marketing-mask name="超级会员" v-if="isMarketShow(configInfo, 'memberPriceShopIdList', 'isOpen')"></my-marketing-mask>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { ref, onMounted, watch, provide } from "vue";
|
||||
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
|
||||
import * as memberApi from "@/http/api/market/member.js";
|
||||
import configVue from "./components/config.vue";
|
||||
import shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
|
||||
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
||||
import vipLvList from "./components/vip-lv-list.vue";
|
||||
import openListVue from "./components/open-list.vue";
|
||||
import fenxiaoMingxiVue from "./components/fenxiao-mingxi.vue";
|
||||
import { onLoad, onReady, onShow, onPageScroll, onReachBottom, onBackPress } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { ref, onMounted, watch, provide } from 'vue';
|
||||
import * as consumeCashbackApi from '@/http/api/market/consumeCashback.js';
|
||||
import * as memberApi from '@/http/api/market/member.js';
|
||||
import configVue from './components/config.vue';
|
||||
import shopSelActionSheetVue from '@/pageMarket/components/shop-sel-action-sheet.vue';
|
||||
import dateAreaSel from '@/components/date-range-picker/date-range-picker.vue';
|
||||
import vipLvList from './components/vip-lv-list.vue';
|
||||
import openListVue from './components/open-list.vue';
|
||||
import fenxiaoMingxiVue from './components/fenxiao-mingxi.vue';
|
||||
import { isMainShop, isMarketShow } from '@/store/account';
|
||||
|
||||
import { useSuperVipStore } from "@/store/market.js";
|
||||
import { reactive } from "vue";
|
||||
import { useSuperVipStore } from '@/store/market.js';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
const actions = [
|
||||
{
|
||||
name: "全部",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "已入账",
|
||||
value: "success",
|
||||
},
|
||||
{
|
||||
name: "待入账",
|
||||
value: "pending",
|
||||
},
|
||||
{
|
||||
name: "已退款",
|
||||
value: "refund",
|
||||
},
|
||||
{
|
||||
name: '全部',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
name: '已入账',
|
||||
value: 'success'
|
||||
},
|
||||
{
|
||||
name: '待入账',
|
||||
value: 'pending'
|
||||
},
|
||||
{
|
||||
name: '已退款',
|
||||
value: 'refund'
|
||||
}
|
||||
];
|
||||
function clearKeyWord() {
|
||||
keyWord.value = "";
|
||||
userComponentQuery.user = "";
|
||||
keyWord.value = '';
|
||||
userComponentQuery.user = '';
|
||||
}
|
||||
function clearTime() {
|
||||
userComponentQuery.startTime = "";
|
||||
userComponentQuery.endTime = "";
|
||||
userComponentQuery.startTime = '';
|
||||
userComponentQuery.endTime = '';
|
||||
}
|
||||
const selActions = ref("");
|
||||
const selActions = ref('');
|
||||
const showActions = ref(false);
|
||||
function handleSelect(e) {
|
||||
selActions.value = e;
|
||||
selActions.value = e;
|
||||
}
|
||||
|
||||
const superVipStore = useSuperVipStore();
|
||||
superVipStore.getConfig();
|
||||
provide("superVipStore", superVipStore);
|
||||
provide("memberApi", memberApi);
|
||||
provide('superVipStore', superVipStore);
|
||||
provide('memberApi', memberApi);
|
||||
const showTimeArea = ref(false);
|
||||
function confirmTimeArea(e) {
|
||||
console.log(e);
|
||||
userComponentQuery.startTime = e[0];
|
||||
userComponentQuery.endTime = e[1];
|
||||
console.log(e);
|
||||
userComponentQuery.startTime = e[0];
|
||||
userComponentQuery.endTime = e[1];
|
||||
}
|
||||
const tabs = [
|
||||
{
|
||||
label: "会员基础设置",
|
||||
value: "basic",
|
||||
},
|
||||
{
|
||||
label: "会员等级设置",
|
||||
value: "user",
|
||||
},
|
||||
{
|
||||
label: "购买会员订单",
|
||||
value: "recoders",
|
||||
},
|
||||
{
|
||||
label: '会员基础设置',
|
||||
value: 'basic'
|
||||
},
|
||||
{
|
||||
label: '会员等级设置',
|
||||
value: 'user'
|
||||
},
|
||||
{
|
||||
label: '购买会员订单',
|
||||
value: 'recoders'
|
||||
}
|
||||
];
|
||||
|
||||
const keyWord = ref("");
|
||||
const keyWord = ref('');
|
||||
function keyWordBlur() {
|
||||
userComponentQuery.user = keyWord.value;
|
||||
userComponentQuery.user = keyWord.value;
|
||||
}
|
||||
const userComponentQuery = reactive({
|
||||
user: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
user: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
});
|
||||
|
||||
const form = ref({
|
||||
isOpen: 0,
|
||||
isOpen: 0
|
||||
});
|
||||
|
||||
const list = ref([]);
|
||||
const pageNum = ref(1);
|
||||
const isEnd = ref(false);
|
||||
const selShop = ref({
|
||||
shopId: "",
|
||||
shopName: "",
|
||||
shopId: '',
|
||||
shopName: ''
|
||||
});
|
||||
const searchText = ref("");
|
||||
const searchText = ref('');
|
||||
|
||||
function search() {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
function chooseShop(e) {
|
||||
selShop.value = e;
|
||||
selShop.value = e;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => selShop.value.shopId,
|
||||
(newval) => {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
() => selShop.value.shopId,
|
||||
(newval) => {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => userComponentQuery,
|
||||
(newval) => {
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
() => userComponentQuery,
|
||||
(newval) => {
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
|
||||
getList();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
getList();
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
|
||||
function refresh() {
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const listRes = ref({});
|
||||
async function getList() {
|
||||
let res = null;
|
||||
if (active.value == 1) {
|
||||
//会员等级列表
|
||||
res = await memberApi.levelList();
|
||||
if (res) {
|
||||
list.value = res || [];
|
||||
isEnd.value = true;
|
||||
superVipStore.setVipLevelList(res || []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (active.value == 2) {
|
||||
//购买会员订单记录
|
||||
res = await memberApi.orderList({
|
||||
page: pageNum.value,
|
||||
size: 10,
|
||||
key: userComponentQuery.user,
|
||||
startTime: userComponentQuery.startTime
|
||||
? userComponentQuery.startTime + " 00:00:00"
|
||||
: "",
|
||||
endTime: userComponentQuery.endTime
|
||||
? userComponentQuery.endTime + " 23:59:59"
|
||||
: "",
|
||||
});
|
||||
}
|
||||
let res = null;
|
||||
if (active.value == 1) {
|
||||
//会员等级列表
|
||||
res = await memberApi.levelList();
|
||||
if (res) {
|
||||
list.value = res || [];
|
||||
isEnd.value = true;
|
||||
superVipStore.setVipLevelList(res || []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (active.value == 2) {
|
||||
//购买会员订单记录
|
||||
res = await memberApi.orderList({
|
||||
page: pageNum.value,
|
||||
size: 10,
|
||||
key: userComponentQuery.user,
|
||||
startTime: userComponentQuery.startTime ? userComponentQuery.startTime + ' 00:00:00' : '',
|
||||
endTime: userComponentQuery.endTime ? userComponentQuery.endTime + ' 23:59:59' : ''
|
||||
});
|
||||
}
|
||||
|
||||
if (res) {
|
||||
listRes.value = res;
|
||||
if (pageNum.value == 1) {
|
||||
list.value = res.records || [];
|
||||
} else {
|
||||
list.value = [...list.value, ...(res.records || [])];
|
||||
}
|
||||
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
|
||||
console.log(isEnd.value);
|
||||
}
|
||||
if (res) {
|
||||
listRes.value = res;
|
||||
if (pageNum.value == 1) {
|
||||
list.value = res.records || [];
|
||||
} else {
|
||||
list.value = [...list.value, ...(res.records || [])];
|
||||
}
|
||||
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
|
||||
console.log(isEnd.value);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示选择门店弹窗
|
||||
const showShopSelActionSheet = ref(false);
|
||||
|
||||
function showShopSelActionSheetFun() {
|
||||
showShopSelActionSheet.value = true;
|
||||
showShopSelActionSheet.value = true;
|
||||
}
|
||||
const active = ref(0);
|
||||
|
||||
watch(
|
||||
() => active.value,
|
||||
(newval) => {
|
||||
userComponentQuery.startTime = "";
|
||||
userComponentQuery.endTime = "";
|
||||
keyWord.value = "";
|
||||
refresh();
|
||||
}
|
||||
() => active.value,
|
||||
(newval) => {
|
||||
userComponentQuery.startTime = '';
|
||||
userComponentQuery.endTime = '';
|
||||
keyWord.value = '';
|
||||
refresh();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => selActions.value,
|
||||
() => {
|
||||
refresh();
|
||||
}
|
||||
() => selActions.value,
|
||||
() => {
|
||||
refresh();
|
||||
}
|
||||
);
|
||||
onReachBottom(() => {
|
||||
if (!isEnd.value) {
|
||||
pageNum.value++;
|
||||
getList();
|
||||
}
|
||||
if (!isEnd.value) {
|
||||
pageNum.value++;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => superVipStore.config.isOpen,
|
||||
() => {
|
||||
superVipStore.editConfig().then((res) => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "更新成功",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
() => superVipStore.config.isOpen,
|
||||
() => {
|
||||
superVipStore.editConfig().then((res) => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '更新成功',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
onShow(() => {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
});
|
||||
|
||||
const configInfo = ref({});
|
||||
onLoad(async () => {
|
||||
configInfo.value = await memberApi.getConfig();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
background: #f7f7f7;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.box {
|
||||
}
|
||||
|
||||
.top {
|
||||
padding: 32rpx 24rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 30rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.filter-box {
|
||||
display: flex;
|
||||
padding: 8rpx 24rpx;
|
||||
align-items: center;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #f7f7f7;
|
||||
min-height: 62rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
padding: 8rpx 24rpx;
|
||||
align-items: center;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #f7f7f7;
|
||||
min-height: 62rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,25 +16,51 @@ export const isMainShop = (shopId) => {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断值是否为 非null + 非空对象(纯对象)
|
||||
* @param {any} obj 要检测的值
|
||||
* @returns {boolean} true=非空对象,false=否则
|
||||
*/
|
||||
function isNonEmptyObject(obj) {
|
||||
// 第一步:排除 null/undefined
|
||||
if (obj === null || obj === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 第二步:排除非纯对象(数组、函数、日期等)
|
||||
if (Object.prototype.toString.call(obj) !== '[object Object]') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 第三步:判断是否为空对象(无自有可枚举属性)
|
||||
for (const key in obj) {
|
||||
// 只检测自有属性(排除原型链属性)
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主店在配置该功能时未选择分店
|
||||
* 判断分店是否显示活动信息
|
||||
* @param {Object} activit
|
||||
* 活动信息
|
||||
*/
|
||||
export function isMarketShow(activit = null, key = 'shopIdList') {
|
||||
console.log('isMarketShow===', activit);
|
||||
if (activit == null || !activit.id) return false
|
||||
export function isMarketShow(activit = null, key = 'shopIdList', isEnableKey = 'isEnable') {
|
||||
console.log('isMarketShow.activit===', activit);
|
||||
if (!isNonEmptyObject(activit)) return false
|
||||
|
||||
let flag = false
|
||||
const shopInfo = uni.getStorageSync("shopInfo");
|
||||
|
||||
if (!shopInfo.isHeadShop && (!activit[key].some(item => item == shopInfo.id) || !activit.isEnable)) {
|
||||
if (!shopInfo.isHeadShop && (!activit[key].some(item => item == shopInfo.id) || !activit[isEnableKey])) {
|
||||
flag = true
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
console.log('isMarketShow===', flag);
|
||||
console.log('isMarketShow.flag===', flag);
|
||||
return flag
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user