Commit 0db28d8f by 胡悦

群发修复bug

1 parent 48df1d71
......@@ -175,6 +175,7 @@ const remindUserGroup = params => {
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
......@@ -184,6 +185,7 @@ const getMerchant = params => {
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
......@@ -193,6 +195,27 @@ const getCard = params => {
sign: true
})
}
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
......@@ -202,6 +225,7 @@ const getCoupon = params => {
sign: true
})
}
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
......@@ -221,6 +245,7 @@ const getActivity = params => {
sign: true
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
......@@ -331,6 +356,8 @@ export default {
getMerchant,
getCard,
getCoupon,
merchant,
merchantOpen,
getPackage,
getActivity,
nameVaild,
......
......@@ -356,5 +356,17 @@ html {
border: 1px solid #F4F6FC !important;
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid #5850ff;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
/* tab */
\ No newline at end of file
......@@ -10,7 +10,7 @@
import Vue from 'vue'
import apis from './api'
import './public-path'
import '@/assets/css/public.scss'
// import '@/assets/css/public.scss'
import '@/components'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
......
......@@ -4,6 +4,7 @@ import { fetchConfig } from '@/config'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import ElementUI from 'element-ui'
import '@/assets/css/public.scss'
import render from './render'
// import 'glsx-components/src/theme/theme.scss'
import 'glsx-components/dist/glsx-components.css'
......@@ -13,7 +14,7 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request,request2, sign, secret, sign_common, request_common } = await fetchConfig()
const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -21,7 +22,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request:request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
import { Message } from 'element-ui'
let util = {}
util.cloneText = function (message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function (sign = '-') {
let day = new Date();
let month = day.getMonth() + 1;
let date = day.getDate();
if (month < 10) month = '0' + month;
if (date < 10) date = '0' + date;
var s = day.getFullYear() + sign + month + sign + date;
return s;
}
util.getBeforeMonth = function (days) {
let month = new Date().getMonth() + 1;
let year = new Date().getFullYear();
let arr = new Array();
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1;
month = month + 12;
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
}
return arr;
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function (time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function (dateStr, separator) {
if (!separator) {
separator = "-";
}
var dateArr = dateStr.split(separator);
var year = parseInt(dateArr[0]);
var month;
//处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) {
month = parseInt(dateArr[1].substring(1));
} else {
month = parseInt(dateArr[1]);
}
var day = parseInt(dateArr[2]);
var date = new Date(year, month - 1, day);
return date;
}
util.getDay = function (num, str = '-') {
var today = new Date();
var nowTime = today.getTime();
var ms = 24 * 3600 * 1000 * num;
today.setTime(parseInt(nowTime + ms));
var oYear = today.getFullYear();
var oMoth = (today.getMonth() + 1).toString();
if (oMoth.length <= 1) oMoth = '0' + oMoth;
var oDay = today.getDate().toString();
if (oDay.length <= 1) oDay = '0' + oDay;
return oYear + str + oMoth + str + oDay;
}
util.openUrl = function (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image();
// 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous");
image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
var context = canvas.getContext("2d");
context.drawImage(image, 0, 0, image.width, image.height);
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件
};
image.src = imgsrc;
}
export default util
\ No newline at end of file
......@@ -14,6 +14,7 @@
<el-tab-pane label="权益套餐" name="4"></el-tab-pane>
<el-tab-pane label="商城券" name="2"></el-tab-pane>
<el-tab-pane label="秒杀活动" name="5"></el-tab-pane>
<el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
......@@ -37,8 +38,8 @@
<div
class="model-item-title"
:title="item.couponName"
v-show="activeName == 1"
>{{ item.couponName }}</div>
v-show="activeName == 6"
>{{ item.equityName }}</div>
<div
class="model-item-title"
:title="item.packageName"
......@@ -49,13 +50,12 @@
:title="item.activityName"
v-show="activeName == 5"
>{{ item.activityName }}</div>
<div class="model-item-content" v-show="activeName == 1">剩余数量:{{ item.remainAmount }}</div>
<div class="model-item-content" v-show="activeName == 3">领取方式:免费领用</div>
<div class="model-item-content" v-show="activeName == 4">领取方式:付费购买</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 1"
>有效期:{{ item.effectiveDays }}天</div>
v-show="activeName == 2 && item.effectiveType == 6"
>有效期:{{ item.effectiveDays}}天</div>
<div
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 3"
......@@ -64,6 +64,8 @@
class="model-item-content"
v-show="activeName == 2 && item.effectiveType == 2"
>有效期:{{ item.effectiveStartTime ? item.effectiveStartTime.split(' ')[0] : '' }}~{{ item.effectiveEndTime ? item.effectiveEndTime.split(' ')[0] : '' }}</div>
<div class="model-item-content" v-show="activeName == 6">获取方式:需先购买无忧服务套餐</div>
<div class="model-item-content" v-show="activeName == 6">获取限制:每个服务套餐限领一次</div>
<div class="model-item-content" v-show="activeName == 3"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 3">
......@@ -74,9 +76,9 @@
使用途径:
{{ item.useChannel == 1 ? '线上商品' : '到店核销' }}
</div>
<div class="model-item-content" v-show="activeName == 1">
类型:
<span>精品券</span>
<div class="model-item-content" v-show="activeName == 6">
赠送天数:
<span>{{effectiveType == 2 ? item.effectiveDay + '天' : '永久有效' }}</span>
</div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4">
......@@ -115,24 +117,45 @@
</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>
<el-button size="small" type="primary" @click="handleSelect" v-show="modelList.length">确 定</el-button>
<el-button
size="small"
type="primary"
@click="handleOpen"
v-show="modelList.length == 0 && activeName == 2 && memberMenu"
>立即添加</el-button>
<el-button
size="small"
type="primary"
@click="handleOpen"
v-show="modelList.length == 0 && activeName == 4 && couponMenu"
>立即添加</el-button>
<el-button
size="small"
type="primary"
@click="handleOpen"
v-show="modelList.length == 0 && activeName == 5 && activityMenu"
>立即添加</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'ActivityModel',
data() {
return {
dialogVisible: false,
couponMenu: false,
loading: false,
activeName: '3',
modelList: [],
pageNum: 1,
pageSize: 12,
tableTotal: 0,
openFlag: 0,
selectItem: {
id: ''
}
......@@ -144,6 +167,7 @@ export default {
if (item.equityClassId) {
this.selectItem.id = item.equityClassId
}
console.log(this.selectItem)
},
handleSelect() {
if (!this.selectItem.id) {
......@@ -154,7 +178,7 @@ export default {
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.selectItem.couponName })
this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
},
handleSizeChange(val) {
this.pageSize = val
......@@ -164,13 +188,29 @@ export default {
this.pageNum = val
this.getModelList()
},
handleOpen() {
let url
switch (this.activeName) {
case '2':
url = '/marketing/couponManage/index'
break
case '4':
url = '/marketing/memberCenter/setmealAddUpdate?%24title=%25E5%2588%259B%25E5%25BB%25BA%25E5%25A5%2597%25E9%25A4%2590'
break
case '5':
url = '/marketing/seckillActivity/editActivity/1'
break
}
util.openUrl(location.origin + url)
this.dialogVisible = false
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '1':
market = 'getCoupon'
case '6':
market = 'merchant'
break
case '2':
market = 'getMerchant'
......@@ -201,9 +241,12 @@ export default {
params.currentPage = this.pageNum
params.activityStatus = 2
}
if (this.activeName == 6) {
params.merchantId = this.$globalState.session.merchantId
}
this.$apis.customerTransform[market](params)
.then(res => {
if (this.activeName == 3) {
if (this.activeName == 3 || this.activeName == 6) {
this.modelList = res
} else {
this.modelList = res.list ? res.list : res.data
......@@ -215,7 +258,36 @@ export default {
this.loading = false
})
},
merchantOpen() {
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.openFlag = res.openFlag
})
},
init() {
this.merchantOpen()
this.couponMenu = false
this.activityMenu = false
this.memberMenu = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (item.name == 'marketing') {
if (!item.children) {
return
}
item.children.forEach(itm => {
console.log(itm.path)
if (itm.path == '/couponManage/index') {
this.couponMenu = true
}
if (itm.path == '/seckillActivity/index') {
this.activityMenu = true
}
if (itm.path == '^') {
this.memberMenu = true
}
})
}
})
this.dialogVisible = true
this.getModelList()
this.selectItem = {}
......@@ -228,6 +300,13 @@ export default {
</script>
<style lang="scss" scoped>
.square-main {
/deep/ {
.el-dialog__footer {
text-align: center;
}
}
}
.model-panel {
.model-panel-tab {
display: flex;
......@@ -333,8 +412,8 @@ export default {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 16px;
height: 16px;
line-height: 18px;
height: 18px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
......@@ -351,7 +430,4 @@ export default {
}
}
}
/deep/ .el-pager {
height: 30px;
}
</style>
\ No newline at end of file
......@@ -37,8 +37,8 @@
<el-tab-pane label="售后" name="3"></el-tab-pane>
</el-tabs>
</div>-->
<div class="model-item-panel" v-if="modelList.length>0" v-loading="loading">
<div class="model-item" v-for="(item, index) in modelList" :key="index">
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item" v-for="item in modelList" :key="item.id">
<div class="model-item-radio">
<el-radio v-model="messageRadio" :label="item"></el-radio>
</div>
......@@ -47,7 +47,9 @@
<div class="model-title-h2">{{ item.content }}</div>
</div>
<div class="model-item-content">
<div class="model-content">创建人:巴拉巴拉</div>
<div
class="model-content"
>创建人:{{createdList.find(i => i.createdBy = item.createdBy).createdName}}{{userId}}</div>
<div class="model-content">创建日期:{{ item.createdTime }}</div>
</div>
<div class="model-item-btn">
......@@ -60,7 +62,7 @@
</div>
</div>
</div>
<div class="model-item-panel" v-else v-loading="loading">
<div class="model-item-panel" v-else>
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
......@@ -76,7 +78,7 @@
></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="selectModelItem">确 定</el-button>
</span>
</el-dialog>
......@@ -113,7 +115,7 @@
</el-form-item>
</el-form>
<div class="template-footer">
<el-button size="small" @click="createVisible = false">取 消</el-button>
<el-button size="small" @click="createModel">取 消</el-button>
<el-button size="small" type="primary" :loading="createLoading" @click="handleCreate">立即创建</el-button>
</div>
</el-dialog>
......@@ -175,6 +177,11 @@ export default {
search() {
this.dracImMessage(this.searchForm)
},
handleClose() {
this.dialogVisible = false
this.modelList = []
this.tableTotal = 0
},
dracImMessage(searcher) {
this.loading = true
let params = {
......@@ -201,7 +208,10 @@ export default {
console.log(`当前页: ${val}`)
},
createModel() {
this.createVisible = true
this.createVisible = !this.createVisible
if (!this.createVisible) {
this.templateForm = {}
}
},
handleCreate() {
this.$refs.templateForm.validate(valid => {
......@@ -226,7 +236,7 @@ export default {
type: 'success',
message: '操作成功!'
})
this.createVisible = false
this.createModel()
this.dracImMessage()
}
})
......@@ -234,7 +244,7 @@ export default {
})
},
editModel(id) {
this.createVisible = true
this.createModel()
this.modelTitle = '编辑群发模板'
this.getTemplateDetail(id)
},
......@@ -327,7 +337,8 @@ export default {
}
}
&-content {
width: 210px;
min-width: 210px;
margin-right: 50px;
.model-content {
font-size: 14px;
font-weight: 400;
......@@ -340,8 +351,12 @@ export default {
.model-title-h1 {
font-size: 14px;
font-weight: 400;
max-width: 658px;
color: #333333;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.model-title-h2 {
font-size: 14px;
......
......@@ -11,7 +11,24 @@
<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 />
<img
v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6"
class="activity-logo"
src="@/assets/guestCustom/activity-logo.png"
alt
/>
<img
v-if="item.attContent.marketingType == 5"
class="activity-logo"
src="@/assets/guestCustom/activity-spike.png"
alt
/>
<img
v-if="item.attContent.marketingType == 6"
class="activity-logo"
src="@/assets/guestCustom/activity-service.png"
alt
/>
<div class="activity-footer">
<img src="@/assets/guestCustom/applet-footer.png" alt />
</div>
......
......@@ -69,7 +69,8 @@
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item label style="margin-bottom: 0;">
<el-form-item label style="margin-bottom: 0;margin-left: 110px;">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
......@@ -249,6 +250,10 @@ export default {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
},
handleReset() {
this.searchForm = {}
this.search()
}
}
}
......
......@@ -21,7 +21,7 @@
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button
type="text"
:disabled="scope.scope.remindStatus == 1"
:disabled="scope.scope.status == 1 || (scope.scope.status == 0 && scope.scope.remindStatus == 1)"
@click="remind(scope.scope)"
>提醒发送</el-button>
</div>
......
......@@ -321,7 +321,7 @@ export default {
}
},
jumpWx() {
this.$history.push('/home/enterpriseWechat/index')
this.$history.push('/settings/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
......@@ -332,7 +332,7 @@ export default {
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.customerTransform.getStatus({}).then(res => {
if (res.status == 'SUCCESS') {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!