Commit 79b5a16b by chenxin

fix:限流js;卡券领取记录 默认时间获取

parent fcf49318
......@@ -4,6 +4,7 @@ import router from './router';
import store from './store';
import { axios } from './service/api/index';
import directives from './directives';
import limit from '@/utils/limiting';
Vue.config.productionTip = false;
if (process.env.NODE_ENV == 'development') { // eslint-disable-line
......@@ -31,10 +32,16 @@ Vue.prototype.$tips = function({ message = '提示', type = 'success' }) {
};
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
limit({
isApp: true,
createApp() {
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
});
}
});
......@@ -39,6 +39,9 @@ export const saveUpdateCard = params => requests(PREFIX + 'save-update-card', pa
//卡券营销--卡券记录--投放记录/领取记录
export const cardRecordPage = params => requests(PREFIX + 'card-record-page', params);
// 卡券营销--会员领取记录--获取领取记录默认时间段
export const getCouponDateLimit = params => requests(PREFIX + 'coupon-date-limit', params);
//卡券营销--卡券记录--投放记录/领取记录 - 投放记录
export const cardPutOnRecord = params => requests(PREFIX + 'card-put-on-record', params);
......
......@@ -2,6 +2,7 @@ import { getIsShowSelf } from '@/service/api/commonApi.js';
// initial state
const state = {
enterpriseId: '', // 企业id
all: 0,
cartData: [],
total: 0,
......@@ -52,6 +53,11 @@ const actions = {
// mutations
const mutations = {
// 更新企业id
updateEnterpriseId(state, id) {
state.enterpriseId = id;
},
mutations_setAll(state, num) {
state.all = num;
},
......
......@@ -104,7 +104,7 @@ export default {
try {
let res = await pageCoupDestoryPlan(this.listParams);
this.tableList = res.result.result || [];
this.total = res.totalCount || 0;
this.total = res.result.totalCount || 0;
} catch (err) {
this.$tips({ type: 'error', message: '加载列表失败' });
}
......
......@@ -99,7 +99,7 @@
</template>
<script>
import { formatDateTimeByType } from '@/utils/index.js';
import { cardRecordPage, coupcardDestroy, exportReceivedRecordExcel } from '@/service/api/cardApi.js';
import { cardRecordPage, coupcardDestroy, exportReceivedRecordExcel, getCouponDateLimit } from '@/service/api/cardApi.js';
import cardOrder from './card-order';
import tableMethods from '@/mixins/tableMethods.js';
import filterAvater from '@/mixins/filterAvater.js';
......@@ -113,7 +113,7 @@ export default {
data() {
return {
formatDateTimeByType,
dateTime: [Date.now() - 30 * 24 * 60 * 60 * 1000, Date.now()],
dateTime: [],
dateTime2: ['', ''],
cardStatusOptions: [{ value: '', label: '全部卡券状态' }, { value: 4, label: '待核销' }, { value: 5, label: '已核销' }, { value: 6, label: '已过期' }, { value: 7, label: '已销毁' }, { value: 8, label: '已占用' }], // eslint-disable-line
recordLoading: false,
......@@ -142,7 +142,7 @@ export default {
};
},
created() {
this.getTableList();
this.getCouponDateLimit();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券记录', path: '' }, { name: '领取记录', path: '' }]); // eslint-disable-line
this.$store.commit(
'mutations_layoutTips',
......@@ -200,6 +200,18 @@ export default {
this.listParams.sortBy = val.order === 'descending' ? val.prop + ' desc' : val.prop;
this.getTableList();
},
// 获取领取时间段
async getCouponDateLimit() {
let dateLimitRes = await getCouponDateLimit();
if (dateLimitRes.result == 1) {
// 默认1周
this.dateTime = [Date.now() - 0.25 * 30 * 24 * 60 * 60 * 1000, Date.now()];
} else {
// 默认一个月
this.dateTime = [Date.now() - 30 * 24 * 60 * 60 * 1000, Date.now()];
}
this.getTableList();
},
// 领取列表
async getTableList() {
this.recordLoading = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment