Commit e6113a9c by chenxin

fix:build 卡券 线下使用商品

parent 4e58efdd
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,o,c){for(var f,i,u,s=0,l=[];s<n.length;s++)i=n[s],t[i]&&l.push(t[i][0]),t[i]=0;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(e[f]=o[f]);for(r&&r(n,o,c);l.length;)l.shift()();if(c)for(s=0;s<c.length;s++)u=a(a.s=c[s]);return u};var n={},t={11:0};function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,a){r=t[e]=[n,a]});r[2]=n;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+({0:"game",1:"card",2:"wechat",3:"evaluation",4:"message",5:"ecm",6:"recharge",7:"msg",8:"calllog"}[e]||e)+"."+{0:"0ea5eee276916402d464",1:"40104db9d69acdc4a079",2:"5aa3ca7e326ef2ff5b56",3:"650a38a154a63ff404db",4:"b240fe6b93138b5f102a",5:"b7fe2f682028ce3b4180",6:"727cccae0b80bca129d5",7:"8b5caebf83a79ac810ca",8:"73199fa96bf2a53581b9"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=i,o.appendChild(c),n},a.m=e,a.c=n,a.d=function(e,r,n){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="/marketing/",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -111,15 +111,16 @@ export default {
],
coupGoodsWeimobList: [],
// ----微盟适用商品结束----
// ----斐乐适用商品开始----
// ----线下适用商品开始----
xxSysp: {
visible: false, // 适用商品选择器dialog
goodsEnable: false, // 显示标志(目前仅支持斐乐)
filterAbbrInfo: [], // 选择后回显的数据
goodsEnable: false,
filterAbbrInfo: [], // 选择后回显的label数据
goodsFilterId: null,
conditions: null // 商品选择器的筛选值 在分页查数据的时候要传过去
conditionList: null, // 商品选择器的回显值
isResign: false // 编辑后赋值
}
// ----斐乐适用商品结束----
// ----线下适用商品结束----
};
},
watch: {
......@@ -224,6 +225,13 @@ export default {
// 支持的品牌-商品选择器
if (res.result.goodsEnable) {
this.xxSysp.goodsEnable = res.result.goodsEnable;
this.xxSysp.goodsEnable = true;
this.xxSysp.goodsFilterId = res.result.card.goodsFilterId;
if (res.result.card.goodsSearchDetail) {
const goodsSearchDetail = JSON.parse(res.result.card.goodsSearchDetail);
this.xxSysp.conditionList = goodsSearchDetail.conditionList; // ref selector此时放在modal里并没有渲染,之后赋值
this.xxSysp.filterAbbrInfo = goodsSearchDetail.filterAbbrInfo || [];
}
}
// 新增情况下,如果配置了线下门店,默认选中线下门店
......@@ -521,7 +529,14 @@ export default {
// 线下适用商品
if (this.xxSysp.goodsEnable && this.xxSysp.goodsFilterId) {
card.goodsFilterId = this.xxSysp.goodsFilterId;
if (this.xxSysp.conditionList) {
card.goodsSearchDetail = JSON.stringify({
conditionList: this.xxSysp.conditionList,
filterAbbrInfo: this.xxSysp.filterAbbrInfo
}); // 反显数据
}
}
//卡券限制
if (this.cardLimitRadio === 1) {
card.cardLimit = 1;
......@@ -599,10 +614,7 @@ export default {
card.storeProMode = 0;
card.storeMode = this.storeMode;
card.storeWidgetKey = this.uuid;
// 线下适用商品
if (this.xxSysp.goodsEnable) {
card.goodsFilterId = this.xxSysp.conditions;
}
// 这里判断部分门店是否为空
if (card.storeMode) {
let data = await this.$refs.storeCard.getRightList();
......@@ -617,6 +629,7 @@ export default {
params.card = JSON.stringify(card);
this.submitLoading = true;
// console.log(params);
console.log(card);
saveUpdateCard(params)
.then(res => {
this.submitLoading = false;
......@@ -860,12 +873,46 @@ export default {
},
// ------微盟适用商品结束-------
// ------线下适用商品开始-------
// 清空线下适用商品 ,重置商品选择器
handleXxSyspReset() {
this.$refs.selector.conditions[0].goodsList = [];
this.xxSysp.filterAbbrInfo = [];
this.xxSysp.conditionList = null;
this.xxSysp.goodsFilterId = null;
},
// 编辑点击
handleXxSyspClick(visible = true) {
this.xxSysp.visible = visible;
// refs.selector放在modal里,初始化的时候并没有渲染
if (!this.xxSysp.isResign && this.isEdit) {
this.$nextTick(() => {
this.$refs.selector.conditions = this.xxSysp.conditionList;
this.xxSysp.isResign = true;
});
}
if (this.xxSysp.filterAbbrInfo.length !== 0) {
this.$refs.selector.changeComplexInfo();
this.$refs.selector.changeComplexInfo(); // 强制展开
}
},
xxSyspLabel(filterAbbrInfo) {
let _filterAbbrInfo = [];
// 设置显示label
filterAbbrInfo &&
filterAbbrInfo.forEach(y => {
_filterAbbrInfo = y.map(v => {
return {
optName: v.optName,
text: `${v.typeName}${v.belong}${v.childNames
.map(v => {
return `【${v}】`;
})
.join('')}`
};
});
});
return _filterAbbrInfo;
},
// 商品选择器确认
xxSyspConfirm() {
this.$refs.selector
.collectConditions()
......@@ -874,24 +921,10 @@ export default {
if (res == false) {
throw new Error('商品选择器条件不能为空!');
} else {
this.xxSysp.conditions = res.conditions;
// console.log(res.filterAbbrInfo);
let _filterAbbrInfo = [];
res.filterAbbrInfo &&
res.filterAbbrInfo.forEach(y => {
_filterAbbrInfo = y.map(v => {
return {
optName: v.optName,
text: `${v.typeName}${v.belong}${v.childNames
.map(v => {
return `【${v}】`;
})
.join('')}`
};
});
});
this.xxSysp.filterAbbrInfo = _filterAbbrInfo;
this.handleXxSyspClick(false);
this.xxSysp.goodsFilterId = res.id; // 保存id
this.xxSysp.conditionList = res.conditionList; // 保存回显list
this.xxSysp.filterAbbrInfo = this.xxSyspLabel(res.filterAbbrInfo);
this.handleXxSyspClick(false); // 强制展开
this.xxSysp.visible = false;
}
})
......@@ -902,14 +935,14 @@ export default {
// ------线下适用商品开始-------
},
mounted() {
this.cardGetShelfs();
this.getCardDetail();
this.getCategoryList(); // 获取适用商品第一层数据
if (this.isAdd) {
this.$refs.storeCard.init();
}
},
created() {
this.cardGetShelfs();
this.getCardDetail();
this.getCategoryList(); // 获取适用商品第一层数据
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券库', path: '/card/list' }, { name: '卡券详情', path: '' }]);
}
};
......@@ -78,8 +78,7 @@
</div>
</div>
<!-- 线下适用商品 -->
<!-- && xxSysp.goodsEnable -->
<div v-if="(form.cardType === 0 || form.cardType === 1) && form.cardApplyChannel.indexOf('offlineStore') !== -1">
<div v-if="(form.cardType === 0 || form.cardType === 1) && form.cardApplyChannel.indexOf('offlineStore') !== -1 && xxSysp.goodsEnable">
<span class="inline-block w100 pr10 text-right">线下适用商品</span>
<div class="sysp__content clearfix inline-block">
<div class="fl" v-if="xxSysp.filterAbbrInfo.length">
......@@ -88,8 +87,10 @@
<span :key="idx" class="item">{{ item.text }}</span>
</template>
</div>
<el-button type="primary" @click="handleXxSyspClick" class="fl mt5" size="mini">编辑</el-button>
<el-button type="primary" @click="handleXxSyspClick" class="fl mt5" size="mini">{{ isEdit ? '查看' : '编辑' }}</el-button>
<el-button v-show="xxSysp.filterAbbrInfo.length && isAdd" @click="handleXxSyspReset" class="fl mt5" size="mini">清空</el-button>
</div>
<div class="tips fz12 gray"><span class="w100 pr10 inline-block"></span>* 仅支持第三方api接口核销卡券时使用</div>
</div>
<!-- 兑换券 -->
<div v-show="form.cardType === 2" class="mb10"><el-checkbox :disabled="isEdit || isInfo" v-model="sale_limit.flag">消费条件</el-checkbox> <span class="fz12 gray">(至少填写一项)</span></div>
......@@ -221,11 +222,12 @@
<el-button @click="$router.go(-1)">返 回</el-button>
</div>
</el-form>
<el-dialog title="适用商品" :visible.sync="xxSysp.visible" width="690px">
<vue-gic-goods-selector ref="selector" :projectName="requestProject"></vue-gic-goods-selector>
<div slot="footer" class="dialog-footer">
<el-button @click="xxSysp.visible = false">取 消</el-button>
<el-button type="primary" @click="xxSyspConfirm">确定</el-button>
<el-button @click="xxSysp.visible = false">{{ isEdit ? '关闭' : '取消' }}</el-button>
<el-button v-if="isAdd" type="primary" @click="xxSyspConfirm">确定</el-button>
</div>
</el-dialog>
</div>
......@@ -239,11 +241,13 @@ export default cardForm;
<style lang="scss" scoped>
.sysp__content {
width: calc(100% - 170px);
display: flex;
> div {
margin-right: 10px;
display: inline-block;
vertical-align: middle;
max-width: 80%;
max-width: 60%;
}
.item {
display: inline-block;
......
<template>
<el-dialog title="赠送积分" :visible.sync="show" width="420px" :before-close="close">
<p class="regular-font-color mb20">请输入需要赠送的积分</p>
<p class="regular-font-color mb20">请输入需要赠送的积分<span class="fz12 gray ml10">* 仅支持给认证会员赠送积分</span></p>
<el-form :model="form" :rules="rules" ref="form" label-width="0">
<el-form-item prop="integral">
<el-input v-model.number="form.integral" />
......
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