Commit 449eeaf8 by damodmg

更新卡券包

parent dcb7dd56
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.63f304fbaba183114f321a851d8df85f.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.35.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.06.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c5834cc437c7b2d524e.js></script><script type=text/javascript src=./static/js/app.c35080911462b139b60c.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.2693c4a42f4bed345363c568f4f72f01.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.33.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.35.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.06.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.26.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c5834cc437c7b2d524e.js></script><script type=text/javascript src=./static/js/app.e2ae2eaa1fd24f809015.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,7 +18,7 @@
<div class="section-content">
<h3>选择卡券</h3>
<el-form-item label="选择卡券" required v-show="mallProId === '-1'">
<el-button plain @click="showCard">添加卡券</el-button>
<el-button plain @click="showCard" :disabled="cardList.length >= 10">添加卡券</el-button>
<span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;">支持选择兑换券</span>
</el-form-item>
<div class="alert-content" v-if="couponStatus">
......@@ -44,7 +44,19 @@
</template>
</el-table-column>
<el-table-column label="库存" prop="couponStock"> </el-table-column>
<el-table-column label="操作" v-if="mallProId === '-1'">
<template slot-scope="scope">
<dm-delete @confirm="deleteCard(scope.$index)" tips="确定删除该卡券吗?">
<el-button type="text">删除</el-button>
</dm-delete>
</template>
</el-table-column>
</el-table>
<el-form-item label="券包名称" v-if="cardList.length > 1" prop="proName">
<el-input v-model.trim="couponForm.proName" class="w-600" type="text" placeholder="请输入券包名称" @input="value => goodsLimit(value)">
<span slot="suffix">{{ proNameLen }}/30</span>
</el-input>
</el-form-item>
<el-form-item label="卡券主图">
<span style="font-size: 12px;color: rgb(144, 147, 153);">小程序积分商城请升级至V3.0.5及以上版本方可支持</span>
<div class="upload-list-box">
......@@ -235,6 +247,7 @@ export default {
disabledList: [],
selectedData: {},
cardList: [],
limitTimesNumArr: [],
limitTimes: 0,
limitTimesNum: 0,
proReferId: '', //卡券关联id
......@@ -286,17 +299,21 @@ export default {
exchangeFixDate: [{ required: true, message: '请选择时间', trigger: 'change' }],
exchangeDateDayArr: [{ required: true, message: '请选择时间', trigger: 'change' }],
exchangeDateWeekArr: [{ required: true, message: '请选择时间', trigger: 'change' }],
limitTimeBegin: [{ required: true, message: '请选择时间', trigger: 'change' }]
limitTimeBegin: [{ required: true, message: '请选择时间', trigger: 'change' }],
proName: [{ required: true, message: '请输入券包名称', trigger: 'blur' }]
},
validateTime,
mallProId: '',
coupCardId: '', //卡券id
costValue: '', //礼品成本
costValueArr: [],
costValueStatus: true,
couponCardStock: '', //优惠券库存
couponCardStockArr: [],
couponStatus: false, //卡券状态
canEdit: true,
groupIdDisableList: []
groupIdDisableList: [],
proNameLen: 0
// 人群筛选器
// // 可传参数
// // projectName: 'integral-mall', // 当前项目名
......@@ -314,8 +331,6 @@ export default {
mounted() {
this.getOpenStatus();
window.onbeforeunload = function(e) {
// var storage = window.localStorage;
// storage.clear('couponListObj');
localStorage.removeItem('giftListObj');
};
let val = {
......@@ -387,6 +402,8 @@ export default {
this.proReferId = this.coupCardId;
this.getCardInfo();
}
this.couponForm.proName = res.data.result.proName;
this.proNameLen = getInputVal.getZhLen(this.couponForm.proName);
//积分费用
this.couponForm.integralCost = res.data.result.integralCost;
//现金费用
......@@ -508,6 +525,13 @@ export default {
}
});
},
// 礼品字数限制
goodsLimit(value) {
this.$nextTick(() => {
this.couponForm.proName = getInputVal.getInputVal(value, 30);
this.proNameLen = getInputVal.getZhLen(this.couponForm.proName);
});
},
// 获取卡券详情
getCardInfo() {
let params = {
......@@ -516,24 +540,33 @@ export default {
request.post('/api-integral-mall/get-card', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.cardList = [];
this.cardList.push(res.data.result);
this.cardList = res.data.result;
if (this.cardList) {
this.couponForm.cardType = this.cardList[0].cardType;
for (let item of this.cardList) {
item.beginDate = this.getTime2(item.beginDate);
item.endDate = this.getTime2(item.endDate);
this.limitTimesNumArr.push(item.cardLimit);
this.couponCardStockArr.push(item.couponStock);
this.limitTimes = Math.min.apply(null, this.limitTimesNumArr);
this.limitTimesNum = Math.min.apply(null, this.limitTimesNumArr);
this.couponCardStock = Math.min.apply(null, this.couponCardStockArr);
}
}
if (res.data.result.status === 0) {
this.couponStatus = true;
} else {
this.couponStatus = false;
}
this.limitTimes = Number(res.data.result.cardLimit);
this.limitTimesNum = res.data.result.cardLimit;
this.couponCardStock = res.data.result.couponStock;
this.couponStatus = this.cardList.some(item => {
return item.status === 0;
});
// if (res.data.result.status) {
// this.couponStatus = true;
// } else {
// this.couponStatus = false;
// }
// this.limitTimes = Number(res.data.result.cardLimit);
// this.limitTimesNum = res.data.result.cardLimit;
// this.couponCardStock = res.data.result.couponStock;
// this.couponForm.virtualStock = this.couponCardStock;
this.couponForm.proName = res.data.result.cardName;
// this.couponForm.proName = res.data.result.cardName;
} else {
this.$message.error(res.data.message);
}
......@@ -563,33 +596,105 @@ export default {
this.showCardDialog = true;
},
// 子组件触发方法
// selectCard(val) {
// console.log(111, val);
// this.showCardDialog = false;
// this.cardList = [];
// if (val) {
// this.cardList.push(val);
// this.limitTimes = val.cardLimit;
// this.limitTimesNum = val.cardLimit;
// this.proReferId = val.coupCardId;
// this.couponForm.cardType = val.cardType;
// this.couponCardStock = val.couponStock;
// // this.couponForm.virtualStock = this.couponCardStock;
// this.couponForm.proName = val.cardName;
// this.couponForm.limitTimesStatus = true;
// let params = {
// couponCardId: val.coupCardId,
// proType: 1
// };
// request.post('/api-integral-mall/get-integral-mall-CashCost', qs.stringify(params)).then(res => {
// if (res.data.errorCode === 0) {
// this.costValue = res.data.result.costValue;
// } else {
// this.$message.error(res.data.message);
// }
// });
// }
// },
selectCard(val) {
this.showCardDialog = false;
this.cardList = [];
// this.cardList = [];
if (val) {
this.cardList.push(val);
this.limitTimes = val.cardLimit;
this.limitTimesNum = val.cardLimit;
this.proReferId = val.coupCardId;
this.couponForm.cardType = val.cardType;
//重复卡券去掉
if (
!this.cardList.find(row => {
return row.coupCardId === val.coupCardId;
})
) {
this.cardList.push(val);
this.limitTimesNumArr.push(val.cardLimit);
this.couponCardStockArr.push(val.couponStock);
} else {
this.$message.error('重复的卡券不允许');
return;
}
// this.limitTimes = val.cardLimit;
this.limitTimes = Math.min.apply(null, this.limitTimesNumArr);
this.limitTimesNum = Math.min.apply(null, this.limitTimesNumArr);
this.couponCardStock = Math.min.apply(null, this.couponCardStockArr);
// this.limitTimesNum = val.cardLimit;
// this.proReferId = val.coupCardId;
// this.couponForm.cardType = val.cardType;
// this.couponCardStock = val.couponStock;
this.couponCardStock = val.couponStock;
// this.couponForm.virtualStock = this.couponCardStock;
this.couponForm.proName = val.cardName;
// this.couponForm.proName = val.cardName;
this.couponForm.limitTimesStatus = true;
let params = {
couponCardId: val.coupCardId,
coupCardId: val.coupCardId,
proType: 1
};
request.post('/api-integral-mall/get-integral-mall-CashCost', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.costValue = res.data.result.costValue;
this.costValueArr.push(res.data.result.costValue);
//计算数组的总和
let sum = this.costValueArr.reduce(function(prev, cur, index, array) {
return prev + cur;
});
this.costValue = sum;
} else {
this.$message.error(res.data.message);
}
});
}
},
deleteCard(index) {
this.cardList.splice(index, 1);
this.costValueArr.splice(index, 1);
let sum = this.costValueArr.reduce(function(prev, cur, index, array) {
return prev + cur;
});
this.costValue = sum;
if (this.cardList.length > 0) {
this.limitTimesNumArr = [];
this.couponCardStockArr = [];
for (let item of this.cardList) {
this.limitTimesNumArr.push(item.cardLimit);
this.couponCardStockArr.push(item.couponStock);
this.limitTimes = Math.min.apply(null, this.limitTimesNumArr);
this.limitTimesNum = Math.min.apply(null, this.limitTimesNumArr);
this.couponCardStock = Math.min.apply(null, this.couponCardStockArr);
}
} else {
this.limitTimes = '';
this.limitTimesNum = '';
this.couponCardStock = '';
this.couponForm.limitTimesStatus = false;
}
},
// 添加兑换时段
addTimeRange() {
if (this.couponForm.timeRangeList.length >= 5) {
......@@ -693,24 +798,21 @@ export default {
// 提交数据
submitForm(couponForm) {
this.couponForm.detailDescription = this.$refs.tinymceWrap.tinymceHtml;
let proReferIdArr = [];
if (this.cardList.length === 0) {
this.$message.error('请选择卡券');
return false;
} else {
for (let item of this.cardList) {
proReferIdArr.push(item.coupCardId);
}
}
// if (Number(this.couponForm.cashCost) > Number(this.costValue)) {
// this.$message.error('现金费用不能大于礼品成本 ');
// return false;
// }
if (this.cardList.length) {
if (Number(this.couponForm.limitTimes) > Number(this.limitTimes)) {
this.$message.error('兑换限制不得大于此优惠券的领取次数');
return false;
}
}
// if (Number(this.couponForm.virtualStock) === 0) {
// this.$message.error('库存不能为0');
// return false;
// }
if (Number(this.couponForm.virtualStock) > Number(this.couponCardStock)) {
this.$message.error('礼品库存不能大于卡券库存 ');
return false;
......@@ -721,41 +823,38 @@ export default {
return false;
}
}
//图文详情的大小限制
// if (this.couponForm.detailDescription) {
// if (this.couponForm.detailDescription.length > 5000) {
// this.$message.error('图文详情输入内容不能超过5000');
// return false;
// }
// }
if (this.couponForm.cardType === 2) {
//兑换券必须上传主图
if (this.cardList.length > 1) {
if (this.couponForm.images.length === 0) {
this.$message.error('兑换券要上传商品主图');
this.$message.error('券包上传商品主图');
return false;
}
} else {
if (this.cardList[0].cardType === 2) {
//兑换券必须上传主图
if (this.couponForm.images.length === 0) {
this.$message.error('兑换券要上传商品主图');
return false;
}
}
}
let giftImageUrls = [];
let giftImageFiledCodes = [];
for (let item of this.couponForm.images) {
giftImageUrls.push(item.imageUrl);
giftImageFiledCodes.push(item.imageCode);
}
// if (this.toggleTag && !this.getSaveData) {
// this.$message.error('请选中人群筛选器的数据');
// return false;
// }
this.$refs[couponForm].validate(valid => {
if (valid) {
let params = {
proName: this.couponForm.proName,
proName: this.cardList.length > 1 ? this.couponForm.proName : this.cardList[0].cardName,
integralMallProId: this.mallProId === '-1' ? '' : this.mallProId, //礼品id
proType: 1, //优惠券
proReferId: this.proReferId, //卡券id
proReferId: proReferIdArr.join(','), //卡券id
detailDescription: this.couponForm.detailDescription, //图文详情
giftImageUrls: giftImageUrls.join(','), //礼品主图
giftImageFiledCodes: giftImageFiledCodes.join(','),
cardType: this.couponForm.cardType,
cardType: this.cardList[0].cardType,
integralCost: this.couponForm.integralCost, //积分费用
costValue: this.costValue, //礼品成本
cashCost: this.couponForm.cashCost, //现金
......@@ -773,8 +872,6 @@ export default {
proShowStatus: this.couponForm.proShowStatus, //显示状态
releaseType: this.couponForm.releaseType, //上架状态
limitTimeBegin: this.couponForm.releaseType === 2 ? this.getTimeAll(this.couponForm.limitTimeBegin) : '' //定时上架时间
// searchParams: JSON.stringify(this.searchParams) === '{}' ? null : this.searchParams, //会员筛选
// responseParams: this.responseParams.length ? this.responseParams : null
};
// 门店分类
if (this.sendChildData.storeType === 1) {
......
......@@ -252,7 +252,6 @@
</el-table>
</div>
</div>
<div class="section-content section-tip-content">
<h3>售后服务</h3>
<el-form-item label="支持买家申请退款 " required>
......
......@@ -64,12 +64,7 @@
<img v-if="scope.row.cardType === 1 && !scope.row.giftMainPic" src="../../../static/img/quan03.png" alt="" />
<div class="info-name">
<p class="pro-ellipsis">{{ scope.row.giftName }}</p>
<!-- status: <= 1是未领取,2是已领取 -->
<p style="font-size:13px;color:#909399"><span v-if="scope.row.status === 2">已领取</span><span v-if="scope.row.status <= 1">未领取</span> / <span v-if="scope.row.useStatus === 5">已使用</span><span v-if="scope.row.useStatus === 0">未使用</span></p>
<!-- <p class="category-ellipsis">
<span v-for="(i, v) in scope.row.sku" :key="v" style="margin-right:3px">{{ i.proName }}:{{ v.valueName ? v.valueName : '--' }}</span>
</p>
<p class="category-ellipsis">规格编码:{{ scope.row.proCode }}</p> -->
<p style="font-size:13px;color:#909399" v-if="scope.row.proReferId.indexOf(',') === -1"><span v-if="scope.row.status === 2">已领取</span><span v-if="scope.row.status <= 1">未领取</span> / <span v-if="scope.row.useStatus === 5">已使用</span><span v-if="scope.row.useStatus === 0">未使用</span></p>
</div>
</div>
</template>
......
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