Commit 39f19c11 by cwq0219
2 parents ec830332 d2b11524
...@@ -163,6 +163,24 @@ const remindUserGroup = params => { ...@@ -163,6 +163,24 @@ const remindUserGroup = params => {
sign: true sign: true
}) })
} }
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.card.class.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -179,5 +197,7 @@ export default { ...@@ -179,5 +197,7 @@ export default {
groupDetailStatistic, groupDetailStatistic,
staffList, staffList,
customerDetailList, customerDetailList,
groupDetailList groupDetailList,
getMerchant,
getCard
} }
export function debounce(func, wait= 200){
let timeout;
return function(event){
clearTimeout(timeout)
timeout = setTimeout(()=>{
func.call(this, event)
},wait)
}
}
export function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') { export function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime) const date = new Date(dateTime)
const config = { const config = {
......
...@@ -2,6 +2,27 @@ ...@@ -2,6 +2,27 @@
<template> <template>
<div class="edit-share marketing p-t-20"> <div class="edit-share marketing p-t-20">
<div class="container edit-container"> <div class="container edit-container">
<div class="right_show">
<div class="card-top"></div>
<div class="card-middle">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype"><span class="ctypeName">代金券</span></span>
</div>
<div class="ctime">
<span class="ctime_name">有效期: </span>
<span class="ctime_content" v-if="editForm.effectiveType == 3">无限制</span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{editForm.effectiveDays}}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{couponTime}}</span>
</div>
<div class="ctime">
<span class="ctime_name">使用限制: </span>
<span class="ctime_content">{{editForm.useBarriers==1?'无限制':'满'+ editForm.full + '可用'}}</span>
</div>
<div class="cremarks">使用说明: </div>
<div class="cremarks_content">{{editForm.useDescription}}</div>
</div>
</div>
<p class="edit-title">{{ title }}代金券</p> <p class="edit-title">{{ title }}代金券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="144px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="144px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="useChannelHtml"> <template slot="useChannelHtml">
...@@ -26,7 +47,7 @@ ...@@ -26,7 +47,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays"> <el-form-item prop="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
领取后你好<el-input v-model="editForm.effectiveDays" style="width:100px;margin-left:5px;margin-right:5px" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />天内有效 领取后<el-input v-model="editForm.effectiveDays" style="width:100px;margin-left:5px;margin-right:5px" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />天内有效
</el-radio> </el-radio>
</el-form-item> </el-form-item>
</template> </template>
...@@ -65,7 +86,7 @@ ...@@ -65,7 +86,7 @@
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="view pull-left"> <!-- <div class="view pull-left">
<img src="@/images/wechat_top.png"> <img src="@/images/wechat_top.png">
<div class='view-box'> <div class='view-box'>
<div class='coupon-img'> <div class='coupon-img'>
...@@ -105,7 +126,7 @@ ...@@ -105,7 +126,7 @@
</div> </div>
<div>立即领取</div> <div>立即领取</div>
</div> </div>
</div> </div> -->
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button> <el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
...@@ -150,6 +171,7 @@ export default { ...@@ -150,6 +171,7 @@ export default {
effectiveType: '3', effectiveType: '3',
effectiveDays: '', effectiveDays: '',
useBarriers: '1', useBarriers: '1',
full: '',
goods: '1', goods: '1',
goodsRefList: [], goodsRefList: [],
}, },
...@@ -543,182 +565,125 @@ export default { ...@@ -543,182 +565,125 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.view { .right_show {
width: 375px; /* float: right; */
height: 600px; position: absolute;
/* margin: 30px 45px 0 60px; */ z-index: 10;
background: #F6F6F6; height: 566px;
position: relative; width: 290px;
right: 44px;
position: absolute; top: 92px;
top: 110px; background-image:url(../../assets/coupon/phone.png);
left: 50%;
}
.coupon-img {
position: relative;
}
.conpon-left {
position: absolute;
width: 90px;
height: 80px;
top: 0;
left: 0;
z-index: 2;
}
.conpon-left>div {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
font-size: 30px;
width: 100%;
text-align: center;
}
.conpon-left>div span {
font-size: 12px;
} }
.conpon-left>div p { .right_show .card-top {
font-size: 10px; height: 59px;
margin: 0; width: 251px;
margin-left: 18px;
margin-top: 55px;
} }
.conpon-right { .right_show .card-middle {
position: absolute; height: 388px;
background: #fff; width: 251px;
z-index: 2; margin-left: 18px;
width: calc(100% - 90px); overflow:auto
height: 80px;
box-sizing: border-box;
padding: 8px 11px 0;
top: 0;
left: 90px;
font-size: 12px;
color: #999999;
} }
.coupon_name { .right_show .card-middle .cname {
color: #333; width: 170px;
font-size: 14px; height: 17px;
margin-bottom: 10px; font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
margin-left: 10px;
margin-top: 15px;
display: inline-block;
} }
.view img { .right_show .card-middle .ctype {
width: 100%; width: 48px;
vertical-align: top; height: 20px;
background: #5850FF;
border-radius: 10px;
margin-right: 6px;
margin-top: 10px;
display: inline-block;
float: right;
} }
.view-btn { .right_show .card-middle .ctype .ctypeName {
position: absolute; width: 36px;
left: 0; height: 17px;
bottom: 0; font-family: PingFangSC-Regular;
width: 100%; font-size: 12px;
height: 50px; color: #FFFFFF;
text-align: center; font-weight: 400;
background: #fff; margin-left: 6px;
font-size: 10px;
color: #999999;
} }
.view-btn>div:first-of-type { .right_show .card-middle .ctime {
float: left; margin-left: 10px;
width: 100px; margin-top: 17px;
height: 100%;
box-sizing: border-box;
padding-top: 7px;
} }
.right_show .card-middle .ctime .ctime_name {
.view-btn>div:last-of-type { width: 48px;
float: left; height: 17px;
width: calc(100% - 100px); font-family: PingFangSC-Regular;
line-height: 50px; font-size: 12px;
height: 100%; color: #333333;
background: #FF6600; font-weight: 400;
color: #fff;
font-size: 16px;
}
.view-btn img {
width: 22px;
height: 20px;
}
.view-box {
margin: 14px 20px 0;
}
.view-box .mt3 {
background: #FFFFFF;
border-radius: 4px;
}
.view-box .mt3 div {
padding: 20px;
font-size: 14px;
color: #333;
}
.couponName {
padding: 10px 0 0 125px;
}
.couponName span {
margin-right: 10px;
cursor: pointer;
}
.couponName span:hover {
color: #00a479;
} }
.form-item-input { .right_show .card-middle .ctime .ctime_content {
height: 30px; height: 17px;
width: 180px; font-family: PingFangSC-Regular;
box-sizing: border-box; font-size: 12px;
border: 1px solid #cccccc; color: #717171;
border-radius: 2px; font-weight: 400;
box-sizing: border-box; margin-left: 5px;
padding: 0 10px;
outline: none;
} }
.couponTypeList { .right_show .card-middle .ccode {
float: left; width: 120px;
height: 30px; height: 120px;
line-height: 30px; margin-left: 67px;
border-radius: 2px; margin-top: 8px;
padding: 0 14px;
box-sizing: border-box;
border: 1px solid #ccc;
margin-right: 10px;
cursor: pointer;
} }
.couponTypeList:hover, .right_show .card-middle .ccodeName {
.couponTypeList.active { width: 68px;
color: #fff; height: 17px;
background-color: #00a479; font-family: PingFangSC-Medium;
border-color: #00a479; font-size: 12px;
color: #1D1D1D;
font-weight: 500;
margin-left: 93px;
margin-top: 8px;
} }
.user { .right_show .card-middle .cremarks {
font-size: 14px; margin-left: 10px;
color: #666; margin-top: 17px;
height: 18px; width: 60px;
line-height: 18px; height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
} }
.user img { .right_show .card-middle .cremarks_content {
width: 18px; margin-left: 10px;
height: 18px; margin-right: 11px;
border-radius: 100%; margin-top: 4px;
overflow: hidden; width: 230px;
vertical-align: middle; height: 34px;
margin-right: 6px; font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
word-break: break-word;
} }
</style> </style>
<!-- 编辑代金券 --> <!-- 编辑代金券 -->
<template> <template>
<div class="edit-share marketing p-t-20"> <div class="edit-share marketing p-t-20">
<div class="container edit-container"> <div class="container edit-container" style="height: 630px;">
<div class="right_show">
<div class="card-top"></div>
<div class="card-middle">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype"><span class="ctypeName">折扣券</span></span>
</div>
<div class="ctime">
<span class="ctime_name">有效期: </span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{editForm.effectiveDays}}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{couponTime}}</span>
</div>
<div class="ctime">
<span class="ctime_name">核销劵码: </span>
</div>
<img class="ccode" src="../../assets/coupon/code.png" />
<div class="ccodeName">GH078-003</div>
<div class="cremarks">使用说明: </div>
<div class="cremarks_content">{{editForm.useDescription}}</div>
</div>
</div>
<p class="edit-title">{{ title }}折扣劵</p> <p class="edit-title">{{ title }}折扣劵</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
...@@ -30,24 +51,6 @@ ...@@ -30,24 +51,6 @@
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="left_show">
<div class="card-panel-top">
<div class="card-h-title">折扣券</div>
<!-- <div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div> -->
<div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div>
<!-- <div class="card-extime" ng-show="effectiveType == 2 && model.effectiveStartTime">有效期:{{model.effectiveTime}}</div> -->
<!-- <div class="card-extime" ng-show="effective == 2 && effectiveTime">有效期:{{effectiveTime.startDate.format('YYYY-MM-DD')}}-{{effectiveTime.endDate.format('YYYY-MM-DD')}}</div> -->
<div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div>
<div class="card-name">{{editForm.couponName}}</div>
<!-- <div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div>
<div class="card-day" v-if="editForm.useType == 1">使用限制:{{editForm.usageTimes}}次</div>
<div class="card-day" v-if="editForm.useType == 2">使用限制:每{{editForm.useLimitDays}}天可以使用{{editForm.usageTimes2}}次</div> -->
</div>
<div class="card-panel-bottom">
<div class="card-remark">使用说明:</div>
<div class="card-remark">{{editForm.useDescription}}</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button> <el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
...@@ -163,7 +166,7 @@ export default { ...@@ -163,7 +166,7 @@ export default {
}, },
'editForm.effectiveTime'(newValue, oldValue){ 'editForm.effectiveTime'(newValue, oldValue){
if(newValue && newValue.length > 0){ if(newValue && newValue.length > 0){
this.couponTime = this.setDateString(newValue[0], true) + ' - ' + this.setDateString(newValue[1], true) this.couponTime = this.setDateString(newValue[0], true) + ' ~ ' + this.setDateString(newValue[1], true)
}else{ }else{
this.couponTime = '' this.couponTime = ''
} }
...@@ -275,54 +278,125 @@ export default { ...@@ -275,54 +278,125 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.left_show { .right_show {
width: 400px; /* float: right; */
/*min-height: 600px;*/
background: #fff;
/*border: 1px solid #eee;*/
position:relative;
display:flex;
flex-direction: column;
position: absolute; position: absolute;
top: 110px; z-index: 10;
left: 50%; height: 566px;
width: 290px;
right: 44px;
top: 92px;
background-image:url(../../assets/coupon/phone.png);
} }
.left_show .card-panel-top { .right_show .card-top {
/* margin-top: 200px; */ height: 59px;
width: 365px; width: 251px;
height: 122px; margin-left: 18px;
background-color: rgba(245, 154, 35, 0.7); margin-top: 55px;
border: none;
text-align: center;
line-height: 24px;
position: relative;
} }
.card-h-title {
position: absolute; .right_show .card-middle {
font-weight: 500; height: 388px;
font-size: 20px; width: 251px;
top: 20px; margin-left: 18px;
transform: rotate(-45deg); overflow:auto
} }
.card-panel-bottom {
width: 353px; .right_show .card-middle .cname {
min-height: 90px; width: 170px;
background-color: rgba(250, 205, 145, 1); height: 17px;
padding: 6px; font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
margin-left: 10px;
margin-top: 15px;
display: inline-block;
} }
.card-extime {
.right_show .card-middle .ctype {
width: 48px;
height: 20px;
background: #5850FF;
border-radius: 10px;
margin-right: 6px;
margin-top: 10px; margin-top: 10px;
display: inline-block;
float: right;
} }
.card-name {
margin: 16px 0px; .right_show .card-middle .ctype .ctypeName {
font-size: 16px; width: 36px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #FFFFFF;
font-weight: 400;
margin-left: 6px;
} }
.card-day {
margin-top: 10px; .right_show .card-middle .ctime {
margin-left: 10px;
margin-top: 17px;
}
.right_show .card-middle .ctime .ctime_name {
width: 48px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
}
.right_show .card-middle .ctime .ctime_content {
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #717171;
font-weight: 400;
margin-left: 5px;
}
.right_show .card-middle .ccode {
width: 120px;
height: 120px;
margin-left: 67px;
margin-top: 8px;
} }
.card-remark {
.right_show .card-middle .ccodeName {
width: 68px;
height: 17px;
font-family: PingFangSC-Medium;
font-size: 12px;
color: #1D1D1D;
font-weight: 500;
margin-left: 93px;
margin-top: 8px;
}
.right_show .card-middle .cremarks {
margin-left: 10px;
margin-top: 17px;
width: 60px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
}
.right_show .card-middle .cremarks_content {
margin-left: 10px;
margin-right: 11px;
margin-top: 4px;
width: 230px;
height: 34px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
word-break: break-word; word-break: break-word;
} }
</style> </style>
...@@ -2,6 +2,27 @@ ...@@ -2,6 +2,27 @@
<template> <template>
<div class="edit-share marketing p-t-20"> <div class="edit-share marketing p-t-20">
<div class="container edit-container"> <div class="container edit-container">
<div class="right_show">
<div class="card-top"></div>
<div class="card-middle">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype"><span class="ctypeName">兑换券</span></span>
</div>
<div class="ctime">
<span class="ctime_name">有效期: </span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{editForm.effectiveDays}}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{couponTime}}</span>
</div>
<div class="ctime">
<span class="ctime_name">核销劵码: </span>
</div>
<img class="ccode" src="../../assets/coupon/code.png" />
<div class="ccodeName">GH078-003</div>
<div class="cremarks">使用说明: </div>
<div class="cremarks_content">{{editForm.useDescription}}</div>
</div>
</div>
<p class="edit-title">{{ title }}兑换券</p> <p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
...@@ -30,24 +51,6 @@ ...@@ -30,24 +51,6 @@
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="left_show">
<div class="card-panel-top">
<div class="card-h-title">兑换券</div>
<!-- <div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div> -->
<div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div>
<!-- <div class="card-extime" ng-show="effectiveType == 2 && model.effectiveStartTime">有效期:{{model.effectiveTime}}</div> -->
<!-- <div class="card-extime" ng-show="effective == 2 && effectiveTime">有效期:{{effectiveTime.startDate.format('YYYY-MM-DD')}}-{{effectiveTime.endDate.format('YYYY-MM-DD')}}</div> -->
<div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div>
<div class="card-name">{{editForm.couponName}}</div>
<!-- <div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div>
<div class="card-day" v-if="editForm.useType == 1">使用限制:{{editForm.usageTimes}}次</div>
<div class="card-day" v-if="editForm.useType == 2">使用限制:每{{editForm.useLimitDays}}天可以使用{{editForm.usageTimes2}}次</div> -->
</div>
<div class="card-panel-bottom">
<div class="card-remark">使用说明:</div>
<div class="card-remark">{{editForm.useDescription}}</div>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button> <el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
...@@ -275,54 +278,125 @@ export default { ...@@ -275,54 +278,125 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.left_show { .right_show {
width: 400px; /* float: right; */
/*min-height: 600px;*/
background: #fff;
/*border: 1px solid #eee;*/
position:relative;
display:flex;
flex-direction: column;
position: absolute; position: absolute;
top: 110px; z-index: 10;
left: 50%; height: 566px;
width: 290px;
right: 44px;
top: 92px;
background-image:url(../../assets/coupon/phone.png);
} }
.left_show .card-panel-top { .right_show .card-top {
/* margin-top: 200px; */ height: 59px;
width: 365px; width: 251px;
height: 122px; margin-left: 18px;
background-color: rgba(245, 154, 35, 0.7); margin-top: 55px;
border: none;
text-align: center;
line-height: 24px;
position: relative;
} }
.card-h-title {
position: absolute; .right_show .card-middle {
font-weight: 500; height: 388px;
font-size: 20px; width: 251px;
top: 20px; margin-left: 18px;
transform: rotate(-45deg); overflow:auto
} }
.card-panel-bottom {
width: 353px; .right_show .card-middle .cname {
min-height: 90px; width: 170px;
background-color: rgba(250, 205, 145, 1); height: 17px;
padding: 6px; font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
margin-left: 10px;
margin-top: 15px;
display: inline-block;
} }
.card-extime {
.right_show .card-middle .ctype {
width: 48px;
height: 20px;
background: #5850FF;
border-radius: 10px;
margin-right: 6px;
margin-top: 10px; margin-top: 10px;
display: inline-block;
float: right;
} }
.card-name {
margin: 16px 0px; .right_show .card-middle .ctype .ctypeName {
font-size: 16px; width: 36px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #FFFFFF;
font-weight: 400;
margin-left: 6px;
} }
.card-day {
margin-top: 10px; .right_show .card-middle .ctime {
margin-left: 10px;
margin-top: 17px;
}
.right_show .card-middle .ctime .ctime_name {
width: 48px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
}
.right_show .card-middle .ctime .ctime_content {
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #717171;
font-weight: 400;
margin-left: 5px;
}
.right_show .card-middle .ccode {
width: 120px;
height: 120px;
margin-left: 67px;
margin-top: 8px;
} }
.card-remark {
.right_show .card-middle .ccodeName {
width: 68px;
height: 17px;
font-family: PingFangSC-Medium;
font-size: 12px;
color: #1D1D1D;
font-weight: 500;
margin-left: 93px;
margin-top: 8px;
}
.right_show .card-middle .cremarks {
margin-left: 10px;
margin-top: 17px;
width: 60px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #333333;
font-weight: 400;
}
.right_show .card-middle .cremarks_content {
margin-left: 10px;
margin-right: 11px;
margin-top: 4px;
width: 230px;
height: 34px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
word-break: break-word; word-break: break-word;
} }
</style> </style>
...@@ -50,13 +50,11 @@ ...@@ -50,13 +50,11 @@
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="left_show"> <!-- <div class="left_show">
<div class="card-panel-top"> <div class="card-panel-top">
<div class="card-h-title">会员券</div> <div class="card-h-title">会员券</div>
<div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div> <div class="card-extime" v-if="editForm.effectiveType == 3">有效期:无限制</div>
<div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div> <div class="card-extime" v-if="editForm.effectiveType == 1">有效期:{{editForm.effectiveDays}}天</div>
<!-- <div class="card-extime" ng-show="effectiveType == 2 && model.effectiveStartTime">有效期:{{model.effectiveTime}}</div> -->
<!-- <div class="card-extime" ng-show="effective == 2 && effectiveTime">有效期:{{effectiveTime.startDate.format('YYYY-MM-DD')}}-{{effectiveTime.endDate.format('YYYY-MM-DD')}}</div> -->
<div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div> <div class="card-extime" v-if="editForm.effectiveType == 2">有效期:{{couponTime}}</div>
<div class="card-name">{{editForm.couponName}}</div> <div class="card-name">{{editForm.couponName}}</div>
<div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div> <div class="card-day" v-if="editForm.useType == 0">使用限制:无限定次数</div>
...@@ -67,7 +65,7 @@ ...@@ -67,7 +65,7 @@
<div class="card-remark">使用说明:</div> <div class="card-remark">使用说明:</div>
<div class="card-remark">{{editForm.useDescription}}</div> <div class="card-remark">{{editForm.useDescription}}</div>
</div> </div>
</div> </div> -->
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button> <el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<div class="marketing pro-group p-t-20"> <div class="marketing pro-group p-t-20">
<div class="m-b-20"> <div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新建代金券</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新建代金券</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建会员服务</el-button> <el-button :size="size" type="primary" class="el-icon-plus" style="margin-left:30px;" @click="addService()">新建会员服务</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addDiscountCoupon()">新建折扣劵</el-button> <el-button :size="size" type="primary" class="el-icon-plus" style="margin-left:30px;" @click="addDiscountCoupon()">新建折扣劵</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addExchangeCoupon()">新建兑换券</el-button> <el-button :size="size" type="primary" class="el-icon-plus" style="margin-left:30px;" @click="addExchangeCoupon()">新建兑换券</el-button>
</div> </div>
<div class="container"> <div class="container">
<div> <div>
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<el-form :model="basicForm.condition" label-width="120px"> <el-form :model="basicForm.condition" label-width="120px">
<el-form-item label="性别"> <el-form-item label="性别">
<el-radio-group v-model="basicForm.condition.sex" @change="valueChange"> <el-radio-group v-model="basicForm.condition.sex" @change="valueChange">
<el-radio :label="1">全部</el-radio> <el-radio label>全部</el-radio>
<el-radio :label="2">男性</el-radio> <el-radio :label="1">男性</el-radio>
<el-radio :label="3">女性</el-radio> <el-radio :label="2">女性</el-radio>
<el-radio :label="4">未知性别</el-radio> <el-radio :label="0">未知性别</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="所在群聊"> <el-form-item label="所在群聊">
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers :selectData="selectData" ref="membersForm"></SelectMembers> <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers>
</glsx-dialog> </glsx-dialog>
</div> </div>
<div <div
...@@ -219,6 +219,7 @@ export default { ...@@ -219,6 +219,7 @@ export default {
} }
} }
const validatorAttachment = (rule, value, callback) => { const validatorAttachment = (rule, value, callback) => {
console.log(this.$refs.welcome.previewList)
const previewList = this.$refs.welcome.previewList const previewList = this.$refs.welcome.previewList
if (previewList.length != 0) { if (previewList.length != 0) {
this.basicForm.attachmentList = previewList this.basicForm.attachmentList = previewList
...@@ -281,7 +282,7 @@ export default { ...@@ -281,7 +282,7 @@ export default {
// 是否有修改筛选成员 // 是否有修改筛选成员
isUpdate: true, isUpdate: true,
tagging: [], tagging: [],
groupNumber: '', groupNumber: 0,
dateOptions: { dateOptions: {
disabledDate(time) { disabledDate(time) {
let now = new Date() let now = new Date()
...@@ -332,17 +333,32 @@ export default { ...@@ -332,17 +333,32 @@ export default {
this.$refs.selectLabel.init() this.$refs.selectLabel.init()
}, },
handleSubmit() { handleSubmit() {
console.log(this.basicForm) console.log(this.basicForm, this.$refs.welcome.previewList)
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
console.log(valid) console.log(valid)
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(v => {
if (v) { if (v) {
console.log(v) if (this.basicForm.selectType == 2 && this.groupNumber == 0) {
this.$message({
type: 'error',
message: '选择客户数量为0,不可创建'
})
return
}
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
params.attachmentList = this.basicForm.attachmentList // params.attachmentList = this.basicForm.attachmentList
params.sendType = this.basicForm.sendType params.sendType = this.basicForm.sendType
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => {
// const attachmentList = this.$common.utils.deepClone(this.$refs.welcome.previewList).map(item => {
if (item.attType == 1) {
item.attContent = item.attContent.replace('@昵称', '[@昵称]')
}
return item
})
params.attachmentList = attachmentList
// const params = { // const params = {
// type: 1, // type: 1,
// attachmentList: this.basicForm.attachmentList, // attachmentList: this.basicForm.attachmentList,
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers ref="membersForm"></SelectMembers> <SelectMembers ref="membersForm" islord="true"></SelectMembers>
</glsx-dialog> </glsx-dialog>
</div> </div>
</template> </template>
......
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="model-panel">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane label="券营销" name="1"></el-tab-pane>
<el-tab-pane label="权益卡" name="2"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div
class="model-item"
:class="{ checked: selectItem == item }"
v-for="(item, index) in modelList"
:key="index"
@click="handleSelectItem(item)"
>
<div class="model-item-title" v-show="activeName == 2">{{ item.cardClassName }}</div>
<div class="model-item-title" v-show="activeName == 1">{{ item.couponName }}</div>
<div class="model-item-content" v-show="activeName == 1">数量:{{ item.residueAmount }}</div>
<div class="model-item-content" v-show="activeName == 2">价格:{{ item.price }}</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 2"
>有效期:{{ item.effectiveNum }}天</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 1"
>有效期:无限制</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 2"
>有效期:{{ item.effectiveStartTime }}~{{ item.effectiveEndTime }}</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 1"
>有效期:{{ item.effectiveDays }}天</div>
<div
class="model-item-content"
v-show="activeName == 1 && item.effectiveType == 3"
>有效期:无限制</div>
<div
class="model-item-content"
v-show="activeName == 1"
>类型:{{ item.discountType == 1 ? '满减劵' : item.discountType == 2 ? '折扣券' : item.discountType == 3 ? '代金券' : item.discountType == 4 ? '实物券' : item.discountType == 5 ? '购车代金券' : item.discountType == 6 ? '商品折扣券' : item.discountType == 7 ? '会员服务' : '' }}</div>
<div class="model-item-content" v-show="activeName == 2">类型:权益卡</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="tableTotal"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'ActivityModel',
data() {
return {
dialogVisible: false,
loading: false,
activeName: '1',
modelList: [],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
selectItem: {}
}
},
methods: {
handleSelectItem(item) {
this.selectItem = item
},
handleSelect() {
if (!this.selectItem.id) {
this.$message({
type: 'error',
message: '请选择活动'
})
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id, marketingType: this.activeName == 1 ? 2 : 3, marketingName: this.activeName == 2 ? this.selectItem.cardClassName : this.selectItem.couponName })
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '1':
market = 'getMerchant'
break
case '2':
market = 'getCard'
break
}
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
this.$apis.customerTransform[market](params).then(res => {
this.modelList = res.list ? res.list : res.data
this.tableTotal = res.total
this.loading = false
})
},
init() {
this.dialogVisible = true
this.getModelList()
this.selectItem = {}
},
handleClick() {
this.getModelList()
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-empty {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
}
.model-item-panel {
display: grid;
grid-template-columns: repeat(4, 25%);
grid-row-gap: 10px;
height: 40vh;
overflow: auto;
.model-item {
position: relative;
height: 128px;
background: #ffffff;
border-radius: 4px;
border: 2px solid #e6e6e6;
padding: 14px 24px;
box-sizing: border-box;
margin-right: 10px;
&:nth-child(4n) {
margin-right: 0px;
}
&.checked {
border: 2px solid #5850ff;
}
&-qrcode {
position: absolute;
right: 10px;
bottom: 10px;
width: 60px;
height: 60px;
border: 1px solid #979797;
}
&-title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -7,11 +7,19 @@ ...@@ -7,11 +7,19 @@
<template v-if="item.attType == 1"> <template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div> <div class="preview-text text">{{ item.attContent }}</div>
</template> </template>
<template v-else-if="item.attType == 4"> <template v-else-if="item.attType == 7">
<div class="preview-text preview-link"> <div class="preview-activity">
<img class="applet-logo" src="@/assets/guestCustom/applet-logo.png" alt />
<div class="activity-name">{{item.attContent.marketingName}}</div>
<img class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt />
<div class="activity-footer">
<img src="@/assets/guestCustom/applet-footer.png" alt />
</div>
</div>
<!-- <div class="preview-text preview-link">
{{ item.attContent.url }} {{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt /> <img src="@/assets/guestCustom/preview-link.png" alt />
</div> </div>-->
</template> </template>
<template v-else-if="item.attType == 2"> <template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
...@@ -139,6 +147,31 @@ export default { ...@@ -139,6 +147,31 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
.preview-activity {
width: 160px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #dce1e5;
padding: 7px 7px 0;
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.applet-logo {
width: 95px;
height: 24px;
}
.activity-footer {
margin-top: 4px;
border-top: 1px solid #edeff3;
}
}
} }
} }
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<script> <script>
export default { export default {
name: 'selectEmp', name: 'selectEmp',
props: ['selectData'], props: ['selectData', 'islord'],
data() { data() {
return { return {
treeHeight: 0, treeHeight: 0,
...@@ -69,7 +69,6 @@ export default { ...@@ -69,7 +69,6 @@ export default {
] ]
}, },
tableEmpData: [], tableEmpData: [],
group: {},
currentArr: [], currentArr: [],
loading: true loading: true
} }
...@@ -79,10 +78,14 @@ export default { ...@@ -79,10 +78,14 @@ export default {
this.$emit('selectTable', val) this.$emit('selectTable', val)
}, },
listDepartmentTree() { listDepartmentTree() {
this.$apis.customerTransform.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => { const params = { merchantId: 10001001, addChildrensFlag: true }
if (this.islord) {
params.islord = this.islord
}
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.listTree = res this.listTree = res
this.loading = false this.loading = false
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree) // this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree) console.log(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses) this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
this.selectData.forEach(i => { this.selectData.forEach(i => {
...@@ -145,6 +148,7 @@ export default { ...@@ -145,6 +148,7 @@ export default {
// } // }
}, },
mounted() { mounted() {
console.log('islord', this.islord)
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 650 this.treeHeight = clientHeight - 650
this.listDepartmentTree() this.listDepartmentTree()
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="select-sale-panel"> <div class="select-sale-panel">
<select-emp <select-emp
:selectData="selectData" :selectData="selectData"
@group="handlGroup" :islord="islord"
@selectTable="selectTable" @selectTable="selectTable"
ref="selectEmpTabel" ref="selectEmpTabel"
></select-emp> ></select-emp>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
import selectEmp from './selectEmp.vue' import selectEmp from './selectEmp.vue'
export default { export default {
name: 'SelectMembers', name: 'SelectMembers',
props: ['selectData'], props: ['selectData', 'islord'],
components: { components: {
selectEmp selectEmp
}, },
......
...@@ -3,15 +3,30 @@ ...@@ -3,15 +3,30 @@
<!-- <div class="required">入群欢迎语</div> --> <!-- <div class="required">入群欢迎语</div> -->
<div class="content"> <div class="content">
<div class="content-bg"> <div class="content-bg">
<el-input <!-- <div id="nick" contenteditable="false" class="nickname">
@昵称
<i class="el-icon-error"></i>
</div>-->
<!-- <div id="toolbar-container" style="display: none;"></div>
<div id="text-container" class="editor-container"></div>-->
<div
id="editor"
ref="editor"
@input="changeInput"
class="text-editor"
contenteditable="true"
autofocus
></div>
<!-- <el-input
type="textarea" type="textarea"
:rows="9" :rows="9"
maxlength="600" maxlength="600"
show-word-limit show-word-limit
v-model="guestForm.name" v-model="guestForm.name"
@input="textInput" @input="textInput"
style="-webkit-user-modify: read-write-plaintext-only !important;"
placeholder="请输入内容" placeholder="请输入内容"
></el-input> ></el-input>-->
<div v-for="itm in previewList" :key="itm.id"> <div v-for="itm in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1"> <div class="welcome-file" v-if="itm.attType != 1">
<template v-if="itm.attType == 2"> <template v-if="itm.attType == 2">
...@@ -22,9 +37,9 @@ ...@@ -22,9 +37,9 @@
<img src="@/assets/guestCustom/icon-img.png" alt /> <img src="@/assets/guestCustom/icon-img.png" alt />
<span>{{ itm.attContent }}</span> <span>{{ itm.attContent }}</span>
</template> </template>
<template v-else-if="itm.attType == 4"> <template v-else-if="itm.attType == 7">
<img src="@/assets/guestCustom/icon-link.png" alt /> <img src="@/assets/guestCustom/icon-applet.png" alt />
<span>{{ itm.attContent.url }}</span> <span>{{ itm.attContent.marketingName }}</span>
</template> </template>
<template v-else-if="itm.attType == 5"> <template v-else-if="itm.attType == 5">
<img src="@/assets/guestCustom/icon-applet.png" alt /> <img src="@/assets/guestCustom/icon-applet.png" alt />
...@@ -35,9 +50,9 @@ ...@@ -35,9 +50,9 @@
</div> </div>
<div class="btn-group"> <div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id"> <div class="add-btn" v-for="item in btnList" :key="item.id">
<i class="el-icon-circle-plus-outline"></i> <!-- <i class="el-icon-circle-plus-outline"></i> -->
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" alt />
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<!-- <div id="video"></div> -->
<input <input
v-if="item.type == 'img'" v-if="item.type == 'img'"
type="file" type="file"
...@@ -49,7 +64,7 @@ ...@@ -49,7 +64,7 @@
@change="e => handleImgChange(e, item)" @change="e => handleImgChange(e, item)"
/> />
<input <input
v-if="item.type == 'video'" v-else-if="item.type == 'video'"
type="file" type="file"
style="opacity: 0" style="opacity: 0"
:id="item.name + 'file'" :id="item.name + 'file'"
...@@ -58,11 +73,7 @@ ...@@ -58,11 +73,7 @@
:accept="item.accept || 'video/*'" :accept="item.accept || 'video/*'"
@change="e => handleVideoChange(e, item)" @change="e => handleVideoChange(e, item)"
/> />
<el-link <el-link v-else style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
v-if="item.type == 'popup'"
style="opacity: 0"
@click="switchDailog(item.funName)"
>{{ item.name }}</el-link>
</div> </div>
</div> </div>
</div> </div>
...@@ -71,85 +82,7 @@ ...@@ -71,85 +82,7 @@
<span>客户每个月最多接收来自同一企业的管理员的 4 条群发消息,4条消息可在同一天发送,达到上限后,无法再接收管理员的群发消息。</span> <span>客户每个月最多接收来自同一企业的管理员的 4 条群发消息,4条消息可在同一天发送,达到上限后,无法再接收管理员的群发消息。</span>
</div> </div>
</div> </div>
<!-- <div class="required">发送时间</div> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<div class="content">
<el-radio-group v-model="sendType">
<el-radio :label="1">立即发送</el-radio>
<el-radio :label="2">定时发送</el-radio>
</el-radio-group>
<div v-show="sendType == 2" class="date-picker">
<el-date-picker v-model="sendTime" size="small" type="date" placeholder="选择日期"></el-date-picker>
-
<el-time-picker v-model="sendDate" size="small" placeholder="选择时间"></el-time-picker>
</div>
</div>-->
<glsx-dialog
:title="dialogTitle"
:width="'712px'"
:isVisible="dialogVisible"
@confirmDialog="handleConfirm"
@closeDialog="dialogVisible = !dialogVisible"
>
<slot>
<el-form
v-if="dialogTitle == '添加网页消息'"
:model="linkForm"
:rules="linkRules"
ref="linkForm"
label-width="120px"
>
<el-form-item label="网页标题" prop="title">
<el-input v-model="linkForm.title" placeholder="请输入网页标题"></el-input>
</el-form-item>
<el-form-item label="添加网页链接" prop="url">
<el-input v-model="linkForm.url" placeholder="以http或https开头"></el-input>
</el-form-item>
</el-form>
<el-form
v-else-if="dialogTitle == '添加小程序'"
:model="appletForm"
:rules="appletRules"
ref="appletForm"
label-width="120px"
>
<el-form-item label="小程序标题" prop="title">
<el-input v-model="appletForm.title" placeholder="请输入小程序标题"></el-input>
</el-form-item>
<el-form-item label="小程序appID" prop="appid">
<el-input v-model="appletForm.appid" placeholder="请输入小程序appID"></el-input>
</el-form-item>
<el-form-item label="小程序路径" prop="page">
<el-input v-model="appletForm.page" placeholder="请输入小程序路径"></el-input>
<div class="form-tips">注意:小程序路径以html作为后缀</div>
</el-form-item>
<el-form-item label="小程序封面" prop="page">
<div class="upload">
<div v-show="!appletForm.picUrl" class="upload-bg">
<i class="el-icon-circle-plus"></i>
<div class="upload-text">上传封面</div>
</div>
<input
type="file"
style="opacity: 0"
ref="file"
class="form-upload img-w-h"
accept="image/png, image/jpeg, image/gif, image/jpg"
@change="handleImg"
/>
<el-image
v-show="appletForm.picUrl"
style="width: 140px"
:src="appletForm.picUrl"
fit="contain"
></el-image>
</div>
<div class="form-tips">建议图片大小在2M以内,建议尺寸:352*282px</div>
</el-form-item>
</el-form>
</slot>
</glsx-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -159,66 +92,75 @@ const ATT_TYPE = { ...@@ -159,66 +92,75 @@ const ATT_TYPE = {
VEDIO: 3, VEDIO: 3,
URL: 4, URL: 4,
MINIPROGRAM: 5, MINIPROGRAM: 5,
FILE: 6 FILE: 6,
ACTIVITY: 7
} }
// import E from 'wangeditor'
import ActivityModel from './activityModel'
import { debounce } from '@/utils/index'
export default { export default {
name: 'WelcomeWords', name: 'WelcomeWords',
components: {
ActivityModel
},
props: { eventBus: Object }, props: { eventBus: Object },
data() { data() {
return { return {
btnList: [ btnList: [
// {
// id: 1,
// name: '表情',
// funcName: '',
// type: 'expression',
// limitSize: 10
// },
{ {
id: 1, id: 2,
name: '图片', name: '图片',
funcName: '', funcName: '',
type: 'img', type: 'img',
limitSize: 10 limitSize: 10
}, },
{ // {
id: 2, // id: 3,
name: '视频', // name: '昵称',
funcName: '', // type: 'nickname',
type: 'video', // funName: 'nickname'
limitSize: 10 // },
},
{
id: 3,
name: '链接',
type: 'popup',
funName: 'link'
},
{ {
id: 4, id: 4,
name: '小程序', name: '活动',
type: 'popup', type: 'acivity',
funName: 'applet' funName: 'activity'
} }
], ],
guestForm: {}, guestForm: {},
dialogTitle: '',
dialogVisible: false,
linkForm: {},
linkRules: {
title: [{ required: true, message: '请输入网页标题', trigger: 'blur' }],
url: [{ required: true, message: '请输入网页链接', trigger: 'blur' }]
},
appletForm: {},
appletRules: {
title: [{ required: true, message: '请输入网页标题', trigger: 'blur' }],
appid: [{ required: true, message: '请输入网页链接', trigger: 'blur' }],
page: [{ required: true, message: '请输入小程序路径', trigger: 'blur' }]
},
previewList: [], previewList: [],
sendType: '', sendType: '',
sendTime: '', sendTime: '',
sendDate: '' sendDate: '',
editor: {}
} }
}, },
mounted() { mounted() {
// const _this = this
// this.editor = new E('#toolbar-container', '#text-container')
// this.editor.config.zIndex = 100
// this.editor.config.height = 165
// this.editor.config.colors = ['#000000', '#f7f7f7']
// this.editor.config.focus = false
// this.editor.config.onchange = function(newHtml) {
// console.log('change 之后最新的 html', newHtml)
// console.log(_this.editor.txt.text())
// const val = _this.editor.txt.text()
// _this.textInput(val)
// }
// this.editor.config.onchangeTimeout = 500
// this.editor.create()
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
// obj.init('video')
}, },
methods: { methods: {
// 上传图片
handleImgChange(e, targetItem) { handleImgChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
...@@ -250,6 +192,7 @@ export default { ...@@ -250,6 +192,7 @@ export default {
} }
} }
}, },
// 上传视频
handleVideoChange(e, targetItem) { handleVideoChange(e, targetItem) {
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
...@@ -275,77 +218,29 @@ export default { ...@@ -275,77 +218,29 @@ export default {
}) })
} }
}, },
handleImg(e) { // 添加昵称
var reader = new FileReader() handleFun(name) {
var file = e.srcElement.files[0] if (name == 'nickname') {
console.log(file) this.$refs.editor.focus()
// 默认1MB this.insertHtmlAtCaret('@昵称')
const limitSize = 10 this.changeInput()
const isLt = file.size / 1024 / 1024 < limitSize // var range = window.getSelection().getRangeAt(0)
if (!isLt) { // console.log(range)
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!') // range.selectNodeContents(range.endContainer.childNodes[range.startOffset - 2])
return true // var el = document.createElement('span')
} // el.setAttribute('contenteditable', false)
reader.readAsDataURL(file) // el.setAttribute('class', 'nickname')
reader.onload = e => { // el.innerHTML = '@昵称<i class="el-icon-error"></i>'
var image = new Image() // el.innerHTML = '<span id="nick" contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
image.src = e.target.result // var node = document.getElementById('nick')
image.onload = () => { // var targetNode = document.getElementById('editor')
const imgFile = e.target.result // targetNode.appendChild(el)
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] // var EL = document.createElement('div')
this.$apis.common.pictureUpload({ file: base64 }).then(res => { // EL.setAttribute('contenteditable', true)
if (res) { // targetNode.appendChild(EL)
console.log(res) // this.editor.txt.append('<span class="nickname">@昵称<i class="el-icon-error"></i><span>')
this.$set(this.appletForm, 'picUrl', res) } else if (name == 'activity') {
// this.appletForm.picUrl = res this.$refs.activity.init()
}
})
}
}
},
switchDailog(funName) {
if (funName == 'link') {
this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') {
this.dialogTitle = '添加小程序'
}
this.dialogVisible = !this.dialogVisible
},
handleConfirm() {
const { dialogTitle } = this
switch (dialogTitle) {
case '添加网页消息':
this.$refs.linkForm.validate(valid => {
if (valid) {
console.log(this.linkForm)
this.previewList.push({
attType: ATT_TYPE.URL,
attContent: this.linkForm
})
this.dialogVisible = !this.dialogVisible
} else {
console.log('error submit!!')
return false
}
})
break
case '添加小程序':
this.$refs.appletForm.validate(valid => {
if (valid) {
console.log(this.appletForm)
this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm
})
this.dialogVisible = !this.dialogVisible
} else {
console.log('error submit!!')
return false
}
})
break
default:
console.log(dialogTitle)
} }
}, },
close(index) { close(index) {
...@@ -365,7 +260,58 @@ export default { ...@@ -365,7 +260,58 @@ export default {
attType: ATT_TYPE.TEXT attType: ATT_TYPE.TEXT
}) })
} }
} },
selectActivity(val) {
console.log(val)
if (val) {
this.previewList.push({
attContent: val,
attType: ATT_TYPE.ACTIVITY
})
}
},
insertHtmlAtCaret(html) {
var sel, range, frag
if (window.getSelection) {
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
var el = document.createElement('span')
el.innerHTML = '<span contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
// var el = document.createElement('div')
// el.innerHTML = html
frag = document.createDocumentFragment()
var node
var lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
if (lastNode) {
range = range.cloneRange()
range.setEndAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
}
},
changeInput: debounce(function() {
console.log(document.getElementById('editor').childNodes)
var allNodes = document.getElementById('editor').childNodes
var str = ''
allNodes.forEach(item => {
if (item.className == 'nickname') {
str += item.innerText
} else if (item.data) {
str += item.data
}
})
console.log(str)
this.textInput(str)
})
} }
} }
</script> </script>
...@@ -385,6 +331,7 @@ export default { ...@@ -385,6 +331,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
color: #999; color: #999;
line-height: 20px;
padding: 10px; padding: 10px;
margin-bottom: 10px; margin-bottom: 10px;
border-left: 1px solid #dcdfe6; border-left: 1px solid #dcdfe6;
...@@ -431,6 +378,10 @@ export default { ...@@ -431,6 +378,10 @@ export default {
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
} }
img {
width: 16px;
height: 16px;
}
.el-link { .el-link {
position: absolute; position: absolute;
width: 100%; width: 100%;
...@@ -516,10 +467,51 @@ export default { ...@@ -516,10 +467,51 @@ export default {
background-color: rgba(230, 233, 255, 0.49); background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49); border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px; border-radius: 4px;
line-height: 20px;
.tips-icon { .tips-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
margin-right: 8px; margin-right: 8px;
} }
} }
// 编辑器
.editor-container {
border: 1px solid #dcdfe6;
min-height: 165px;
/deep/ {
.w-e-text {
background-color: #f7f7f7;
}
}
}
.text-editor {
outline: 0;
width: 100%;
min-height: 200px;
max-height: 200px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
padding: 5px;
line-height: 20px;
font-size: 12px;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
_overflow-y: visible;
}
/deep/.nickname {
display: inline;
// width: 64px;
// height: 20px;
border-radius: 2px;
background-color: #fff;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 2px;
margin: 0 5px;
i {
font-size: 10px;
}
}
</style> </style>
...@@ -17,7 +17,6 @@ export default { ...@@ -17,7 +17,6 @@ export default {
// formatter: `{b}\r \n成交金额:{c}\n \n 订单总数:{d}单` // formatter: `{b}\r \n成交金额:{c}\n \n 订单总数:{d}单`
formatter: function(params) { formatter: function(params) {
var tips = '' var tips = ''
console.log(params)
if (params != null && params.length > 0) { if (params != null && params.length > 0) {
tips += params[0].name + '<br />' tips += params[0].name + '<br />'
for (var i = 0; i < params.length; i++) { for (var i = 0; i < params.length; i++) {
...@@ -71,7 +70,7 @@ export default { ...@@ -71,7 +70,7 @@ export default {
console.log(val) console.log(val)
const xData = val.map(i => i.dataDateStr) const xData = val.map(i => i.dataDateStr)
const yData = val.map(i => i.amount) const yData = val.map(i => i.amount)
this.option.xAxis.data = xData.reverse() this.option.xAxis.data = xData
this.option.series[0].data = yData this.option.series[0].data = yData
this.option.series[0].count = val.map(i => i.count) this.option.series[0].count = val.map(i => i.count)
this.option && this.myChart.setOption(this.option) this.option && this.myChart.setOption(this.option)
......
...@@ -34,7 +34,16 @@ ...@@ -34,7 +34,16 @@
<div class="data-item"> <div class="data-item">
<span class="data-title w-90"> <span class="data-title w-90">
优惠券总数 优惠券总数
<img :src="iconUrl" alt /> <el-popover
placement="top-start"
title="优惠券总数"
width="200"
trigger="hover"
content="营销工具中优惠券类配置的所有类型的券总数量。"
>
<img slot="reference" :src="iconUrl" alt />
</el-popover>
<!-- <img :src="iconUrl" alt /> -->
</span> </span>
<span class="date-content"> <span class="date-content">
<span class="data-num">{{coupon.totalIssue}}</span>张 <span class="data-num">{{coupon.totalIssue}}</span>张
...@@ -43,7 +52,16 @@ ...@@ -43,7 +52,16 @@
<div class="data-item"> <div class="data-item">
<span class="data-title w-90"> <span class="data-title w-90">
发放总数 发放总数
<img :src="iconUrl" alt /> <el-popover
placement="top-start"
title="发放总数"
width="200"
trigger="hover"
content="配置的优惠券中已发放给客户的数量。"
>
<img slot="reference" :src="iconUrl" alt />
</el-popover>
<!-- <img :src="iconUrl" alt /> -->
</span> </span>
<span class="date-content"> <span class="date-content">
<span class="data-num">{{coupon.totalIssue}}</span>张 <span class="data-num">{{coupon.totalIssue}}</span>张
...@@ -52,7 +70,16 @@ ...@@ -52,7 +70,16 @@
<div class="data-item"> <div class="data-item">
<span class="data-title w-90"> <span class="data-title w-90">
核销总数 核销总数
<img :src="iconUrl" alt /> <el-popover
placement="top-start"
title="核销总数"
width="200"
trigger="hover"
content="已发放给客户的券被核销的数量。"
>
<img slot="reference" :src="iconUrl" alt />
</el-popover>
<!-- <img :src="iconUrl" alt /> -->
</span> </span>
<span class="date-content"> <span class="date-content">
<span class="data-num">{{coupon.totalVerification}}</span>张 <span class="data-num">{{coupon.totalVerification}}</span>张
...@@ -105,7 +132,7 @@ ...@@ -105,7 +132,7 @@
<!-- <img :src="iconUrl" alt /> --> <!-- <img :src="iconUrl" alt /> -->
</span> </span>
<span class="date-content"> <span class="date-content">
<span class="data-num">{{merchant.viewAmount}}</span>人 <span class="data-num">{{merchant.viewAmount}}</span>次
</span> </span>
</div> </div>
<div class="data-item"> <div class="data-item">
...@@ -339,21 +366,24 @@ export default { ...@@ -339,21 +366,24 @@ export default {
switch (name) { switch (name) {
case 'week': case 'week':
startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek) startTime = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek)
endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek) endTime = new Date()
// endTime = new Date(nowYear, nowMonth, nowDay + 6 - nowDayOfWeek)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
break break
case 'month': case 'month':
startTime = new Date(nowYear, nowMonth, 1) startTime = new Date(nowYear, nowMonth, 1)
endTime = new Date(nowYear, nowMonth + 1, 0) endTime = new Date()
// endTime = new Date(nowYear, nowMonth + 1, 0)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
break break
case 'year': case 'year':
startTime = new Date(nowYear, 0, 1) startTime = new Date(nowYear, 0, 1)
endTime = new Date(nowYear, 11, 31) endTime = new Date()
// endTime = new Date(nowYear, 11, 31)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date)
...@@ -633,6 +663,7 @@ export default { ...@@ -633,6 +663,7 @@ export default {
&-picker { &-picker {
// width: 240px; // width: 240px;
// width: 25%; // width: 25%;
width: calc(100% - 130px);
margin-left: 20px; margin-left: 20px;
} }
&-content { &-content {
......
...@@ -216,7 +216,6 @@ export default { ...@@ -216,7 +216,6 @@ export default {
{ {
label: '开通日期', label: '开通日期',
prop: 'activeTime' prop: 'activeTime'
// addHtml: 'activeTime' // addHtml: 'activeTime'
}, },
{ {
...@@ -240,7 +239,8 @@ export default { ...@@ -240,7 +239,8 @@ export default {
cardName: '', cardName: '',
price: '', price: '',
marketPrice: '', marketPrice: '',
linkUrl: '' linkUrl: '',
tryAble:''
}, },
copyRuleForm: {}, copyRuleForm: {},
rules: { rules: {
...@@ -263,7 +263,7 @@ export default { ...@@ -263,7 +263,7 @@ export default {
created() { created() {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
} }
this.getCardContentFun() this.getCardContentFun()
}, },
...@@ -301,11 +301,13 @@ export default { ...@@ -301,11 +301,13 @@ export default {
}, },
getCardContentFun() { getCardContentFun() {
getCardContent({ merchantId: this.merchantId }).then(res => { getCardContent({ merchantId: this.merchantId }).then(res => {
this.ruleForm.equityId = res[0].id this.ruleForm.equityId = res[0].id
this.ruleForm.cardName = res[0].cardClassName this.ruleForm.cardName = res[0].cardClassName
this.ruleForm.price = res[0].price this.ruleForm.price = res[0].price
this.ruleForm.marketPrice = res[0].marketPrice this.ruleForm.marketPrice = res[0].marketPrice
this.ruleForm.linkUrl = res[0].url this.ruleForm.linkUrl = res[0].url
this.ruleForm.tryAble=res[0].tryAble
}) })
}, },
openEditWrap() { openEditWrap() {
...@@ -328,7 +330,7 @@ export default { ...@@ -328,7 +330,7 @@ export default {
params.cardClassName = this.ruleForm.cardName params.cardClassName = this.ruleForm.cardName
params.price = this.ruleForm.price params.price = this.ruleForm.price
params.marketPrice = this.ruleForm.marketPrice params.marketPrice = this.ruleForm.marketPrice
params.tryAble=this.ruleForm.tryAble
updateCardContent(params).then(res => { updateCardContent(params).then(res => {
if (!res) { if (!res) {
return return
......
...@@ -509,8 +509,9 @@ export default { ...@@ -509,8 +509,9 @@ export default {
// flag = false // flag = false
// } // }
if(this.nameToValSpecsList && this.nameToValSpecsList.length > 0){ if(this.nameToValSpecsList && this.nameToValSpecsList.length > 0){
for (var key in this.nameToValSpecsList) { var list = this.nameToValSpecsList
var item = this.nameToValSpecsList[key] for (var key = 0; key < list.length; key++) {
var item = list[key]
if(!item.activityPrice){ if(!item.activityPrice){
this.$message({ this.$message({
message: '有未设置秒杀价的项', message: '有未设置秒杀价的项',
...@@ -532,14 +533,14 @@ export default { ...@@ -532,14 +533,14 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
if(!flag){ if(!flag){
return return false
} }
var params = this.getCouponInfoParams() var params = this.getCouponInfoParams()
console.log(params); console.log(params);
this.$apis.seckillActivity.addOrUpdateActivityApi(params).then(res => { this.$apis.seckillActivity.addOrUpdateActivityApi(params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : (res.message?res.message:'操作失败'),
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
if (res.code == '0') { if (res.code == '0') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!