Commit d4569c06 by 杨明

fixed

1 parent 68b2e525
......@@ -2,11 +2,11 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:56
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-09 18:19:51
* @LastEditTime: 2023-07-05 10:23:20
* @FilePath: \scrm-micro-link\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http } from '@/main'
import { http, http_gpt } from '@/main'
const defaultPath = 'scrm.api.shopmall.activity.'
//分页查询媒体文件列表
const dropdownList = params => {
......@@ -126,6 +126,16 @@ const getShared = params => {
sign: true
})
}
// 历史营销列表
const activityPage = params => {
params.method = `scrm.api.shopmall.history.activity.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
dropdownList,
......@@ -138,5 +148,6 @@ export default {
pageApi,
pageAllApi,
updateApi,
getShared
getShared,
activityPage
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 16:38:54
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2023-05-12 16:18:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-04 19:54:09
* @FilePath: \scrm-micro-link\src\api\modules\giftBag.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -62,5 +62,34 @@ const equityMerchant = params => {
sign: true
})
}
export default { getghDirectionalGiftListApi, getEquityListApi, brandList, couponTemplate, couponTemplateDetails, equityMerchant }
//新建或修改营销礼包预设方案(超级营销)
const packageAdd = params => {
params.method = 'scrm.api.shopmall.activity.coupon.package.add.or.update'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//获取默认营销礼包预设方案(超级营销)
const packageList = params => {
params.method = 'scrm.api.shopmall.activity.coupon.package.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//查询某个营销礼包预设方案详情(超级营销)
const packageDetail = params => {
params.method = 'scrm.api.shopmall.activity.coupon.package.detail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { packageAdd, packageList, packageDetail, getghDirectionalGiftListApi, getEquityListApi, brandList, couponTemplate, couponTemplateDetails, equityMerchant }
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 16:16:03
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-07 14:33:25
* @FilePath: \scrm-micro-link\src\api\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { http, http_gpt, http_merchant } from '@/main'
const url = '/rop-scrm-entmicro/router'
//客户概览
const viewData = params => {
params.method = 'entmicro.api.Customer.customer.view.data'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
const getChatGPTList = params => {
return http_gpt({
url: 'openai/title',
method: 'POST',
data: params,
sign: false,
returnAll: false
})
}
const calendarPage = params => {
params.method = 'marketing.api.calendar.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
const calendarDetail = params => {
params.method = 'marketing.api.calendar.detail'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//营销任务-导入客户
const importCustomer = params => {
params.method = 'marketing.api.supermarket.importCustomer'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//获取机器人下拉列表
const getRobotList = params => {
params.method = 'marketing.api.supermarket.bulge.getRobotList'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//查询员工列表
const findMerchantStaffList = params => {
params.method = 'merchants.api.open.findMerchantStaffList'
return http_merchant({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
viewData,
getChatGPTList,
calendarPage,
calendarDetail,
importCustomer,
getRobotList,
findMerchantStaffList
}
......@@ -7,6 +7,35 @@ html {
overflow: hidden;
background-color: #f4f5fa;
}
.msgTips {
z-index: 3000 !important;
}
.flex {
display: flex;
}
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.flex-row-center {
display: flex;
justify-content: center;
}
.flex-column-center {
display: flex;
align-items: center;
}
.flex-space-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
}
.link-main {
.container {
background: #ffffff;
......@@ -64,32 +93,6 @@ html {
white-space: nowrap;
overflow: hidden;
}
.flex {
display: flex;
}
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.flex-row-center {
display: flex;
justify-content: center;
}
.flex-col-center {
display: flex;
align-items: center;
}
.flex-space-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
}
.tips-icon {
display: inline-block;
width: 14px;
......
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:51:04
* @LastEditTime: 2023-07-04 18:11:29
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
......@@ -21,8 +21,8 @@ export const fetchConfig = function(isEnv = true) {
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/6351298f6a118b4ff787ef2b/live/config')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/63a541ae2019ec5113826ea3/link/config')
return new Http().get('https://oss-config.glsx.com.cn/mock/63c12a2e28a427953783403b/link/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/63a541ae2019ec5113826ea3/link/config')
// return new Http().get('https://oss-config.glsx.com.cn/mock/63c12a2e28a427953783403b/link/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:50:51
* @LastEditTime: 2023-07-07 14:32:24
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
......@@ -29,3 +29,5 @@ start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_gpt = params => Vue.prototype.$http_gpt(params)
export const http_merchant = params => Vue.prototype.$http_merchant(params)
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-31 18:11:57
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapState, mapActions } from 'vuex'
import Drawing from '@/utils/drawing'
export default {
data() {
return {}
},
methods: {
//主图、内容图、logo合并图片
async createCanvas() {
this.loading = true
const { backgroundImage, detailImage, merchantLog, marketingTitle, marketingSubtitle } = this.editForm
if (!backgroundImage) return
try {
const res = await Promise.all([this.getImgWH(backgroundImage), this.getImgWH(detailImage), this.getImgWH(merchantLog)])
const h = (res[0].dh / res[0].dw) * 375 + (res[1].dh / res[1].dw) * 375
this.logoInfo = { url: merchantLog, x: 375 - res[2].dw / 2 - 20, y: 20, width: res[2].dw / 2, height: res[2].dh / 2 }
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: 375,
height: h
}),
imageList = [
{
url: backgroundImage,
x: 0,
y: 0,
width: 375,
height: (res[0].dh / res[0].dw) * 375
},
{
url: detailImage,
x: 0,
y: (res[0].dh / res[0].dw) * 375,
width: 375,
height: (res[1].dh / res[1].dw) * 375
},
{ ...this.logoInfo }
].filter(item => item.url)
let textList = [],
title = this.cavansObj[this.editForm.templateId]
if (title) {
marketingTitle.split(' ').forEach((item, index) => {
textList.push({
x: title.titleStyle.x,
y: title.titleStyle.y + index * title.titleStyle.fontSize * 1.14,
fontSize: title.titleStyle.fontSize,
color: title.titleStyle.color,
text: item,
bold: title.titleStyle.bold
})
})
new Array(marketingSubtitle).forEach((item, index) => {
textList.push({
x: title.subTitleStyle.x,
y: title.subTitleStyle.y + title.titleStyle.fontSize * 1.14 * (textList.length - 1),
fontSize: title.subTitleStyle.fontSize,
color: title.subTitleStyle.color,
text: item
})
})
}
console.log(title, textList)
const canvasBase64 = await drawfun.begin({
imageList,
textList
})
await this.uploadImg(canvasBase64)
this.addOrUpdate()
} catch (e) {
console.log(e)
}
}
},
mounted() {}
}
import { mapState } from 'vuex'
export default {
data() {
return {
currentIndex: '1',
goodsIndex: 1,
serviceIndex: 7,
carList: [],
selectedCarList: [],
goodsTabList: [
{ label: '卡券', type: 1 },
{ label: '直充', type: 2 }
],
serviceTabList: [
{ label: '门店服务', type: 7 },
{ label: '代金券', type: 2 },
{ label: '折扣券', type: 3 },
{ label: '兑换券', type: 4 }
],
carTableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'packageCode',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '名称',
prop: 'packageName',
width: 300
},
{
label: '价格',
prop: 'packageServicePeriod',
addHtml: 'price'
}
]
},
serviceList: [],
selectedServiceList: [],
serviceTableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'packageCode',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '名称',
prop: 'couponName',
width: 180
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '有效期',
prop: 'effectiveType',
addHtml: 'effectiveType'
},
{
label: '使用限制',
prop: 'useType',
addHtml: 'useType'
},
{
label: '剩余库存',
prop: 'residueAmount'
}
]
},
goodsList: [],
selectedGoodsList: [],
goodsTableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'packageCode',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '品牌',
prop: 'brandName',
width: 120
},
{
label: '商品名称',
prop: 'goodsName',
width: 180
},
{
label: '劵面额',
prop: 'denomination',
formatter: cellValue => {
return isNaN(cellValue.denomination) ? cellValue.denomination : (cellValue.denomination / 100).toFixed(2) + '元'
}
},
{
label: '有效期',
prop: 'effectiveDays',
formatter: cellValue => {
return cellValue.effectiveDays + '天'
}
}
]
}
}
},
computed: {
...mapState('marketing', ['subscribe'])
}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-30 16:21:24
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
t1: 0, // 主标题下标
t2: 0 // 副标题下标
}
},
computed: {
...mapState('marketing', ['keywords', 'GPTList'])
},
watch: {
GPTList: {
handler() {
this.t1 = 0
this.t2 = 0
},
deep: true
}
},
methods: {
getGPTitle(type) {
const len = this.GPTList.mainTitles.length
console.log(len)
if (type == 1) {
this.editForm.marketingTitle = this.GPTList.mainTitles[this.t1 % len].title
this.t1++
}
if (type == 2) {
this.editForm.marketingSubtitle = this.GPTList.subTitles[this.t2 % len].title
this.t2++
}
}
},
mounted() {}
}
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:45:51
* @LastEditTime: 2023-07-05 10:16:54
* @FilePath: \scrm-micro-link\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -20,7 +20,7 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig()
const { response, request, sign, secret, sign_common, request_common, request_gpt, request_merchant } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState }) {
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.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: ElementUI.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.prototype.$http_gpt = new common.Http({ response, request: request_gpt, sign, secret, alert: ElementUI.Message.error })
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-12-13 09:23:57
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-04 19:41:54
* @FilePath: \scrm-micro-link\src\store\modules\aside.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
namespaced: true,
state: {},
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-07 12:16:23
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import apis from '@/api'
const subscribeData = { 5: '保险', 2: '定保', 8: '售后众筹' }
export default {
namespaced: true,
state: {
subscribe: null,
keywords: null,
GPTList: null,
packageList: {}
},
mutations: {
// 设置场景值
SET_SUBSCRIBE(state, data) {
state.subscribe = data
},
SET_KET_WORDs(state, data) {
state.keywords = data
},
SET_GPT_LIST(state, data) {
state.GPTList = data
},
SET_PACKAGE_LIST(state, data) {
state.packageList = Object.assign({}, data)
}
},
actions: {
setKeyWords({ commit, state }, data) {
if (state.keywords == data) return
commit('SET_KET_WORDs', data)
apis.marketing.getChatGPTList({ 'req.userPrompt': data }).then(res => {
const gptList = JSON.parse(res.message)
commit('SET_KET_WORDs', '')
if (gptList.mainTitles) {
commit('SET_GPT_LIST', gptList)
}
})
},
setPackage({ commit }, data) {
commit('SET_PACKAGE_LIST', data)
},
setSubscribe({ commit, dispatch }, data) {
commit('SET_SUBSCRIBE', data)
dispatch('setKeyWords', subscribeData[data])
}
}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-22 20:12:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-06 13:41:22
* @FilePath: \scrm-micro-home\src\utils\color.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
var img_width = 0,
img_height = 0
var canvas = document.createElement('canvas')
var context = canvas.getContext('2d')
var myColor = []
function getColor() {
var imageData = context.getImageData(img_width - 10, img_height - 10, img_width, img_height)
myColor = [imageData.data[0], imageData.data[1], imageData.data[2]]
var hexColor = gethex(...myColor)
return `#${hexColor}`
}
// 获取16进制颜色
function gethex(r, g, b) {
console.log(r, g, b)
r = r.toString(16)
g = g.toString(16)
b = b.toString(16)
// 补0
r.length == 1 ? (r = '0' + r) : ''
g.length == 1 ? (g = '0' + g) : ''
b.length == 1 ? (b = '0' + b) : ''
var hex = r + g + b
// 简化处理,如 FFEEDD 可以写为 FED
if (r.slice(0, 1) == r.slice(1, 1) && g.slice(0, 1) == g.slice(1, 1) && b.slice(0, 1) == b.slice(1, 1)) {
hex = r.slice(0, 1) + g.slice(0, 1) + b.slice(0, 1)
}
return hex
}
async function uploadImg(url, callbackFn) {
var image = new Image()
image.src = url
image.setAttribute('crossOrigin', 'Anonymous')
image.onload = function() {
img_width = this.width
img_height = this.height
// 设置画布尺寸
canvas.width = img_width
canvas.height = img_height
// 将图片按像素写入画布
context.drawImage(this, 0, 0, img_width, img_height)
callbackFn(getColor())
}
}
export default uploadImg
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-17 16:07:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-31 18:02:51
* @FilePath: \scrm-micro-home\src\utils\drawing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
class Drawing {
constructor(el, canvasParams) {
this.canvasId = el
let { width, height } = canvasParams
this.pixelRatio = 2
this.ctx = this.canvasId.getContext('2d')
width = this.toRpx(width)
height = this.toRpx(height)
this.canvasId.width = width
this.canvasId.height = height
}
async drawImages(imageParams, callback) {
this.ctx.beginPath()
this.ctx.save()
let { height, width, url, x, y } = imageParams
height = this.toRpx(height)
width = this.toRpx(width)
x = this.toRpx(x)
y = this.toRpx(y)
let image = this.createImage()
image.src = url
return new Promise(resolve => {
image.onload = () => {
setTimeout(() => {
this.ctx.drawImage(image, x, y, width, height)
// 再将图片填充到画布
let pattern = this.ctx.createPattern(image, 'no-repeat')
this.ctx.fillStyle = pattern
resolve(imageParams)
}, 3000)
}
})
}
toRpx(val) {
return this.pixelRatio * val
}
drawText(textParams) {
let { fontSize, color, text, x, y, bold } = textParams
fontSize = this.toRpx(fontSize)
x = this.toRpx(x)
y = this.toRpx(y)
this.ctx.font = `${bold ? 'bold ' : ''}${fontSize}px Calibri`
this.ctx.fillStyle = color
this.ctx.textAlign = 'center'
this.ctx.fillText(text, this.canvasId.width / 2, y + fontSize)
}
createImage() {
let image = new Image()
image.setAttribute('crossOrigin', 'Anonymous')
return image
}
async begin(data = {}) {
return new Promise(async (resolve, reject) => {
const drawFun = () => {
data.textList &&
data.textList.length &&
data.textList.map(e => {
this.drawText(e)
})
console.log(this.canvasId.toDataURL('image/png'))
resolve(this.canvasId.toDataURL('image/png'))
}
if (data.imageList && data.imageList.length) {
await this.drawImages(data.imageList[0])
if (data.imageList.length > 1)
for (let index = 1; index < data.imageList.length; index++) {
await this.drawImages(data.imageList[index])
if (index == data.imageList.length - 1) drawFun()
}
else drawFun()
} else drawFun()
})
}
}
export default Drawing
......@@ -2,10 +2,12 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-16 14:46:00
* @LastEditTime: 2023-06-29 14:48:46
* @FilePath: \live\src\utils\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*
*/
import { Message } from 'element-ui'
export function debounce(func, wait = 200) {
let timeout
return function(event) {
......@@ -15,7 +17,15 @@ export function debounce(func, wait = 200) {
}, wait)
}
}
export function cloneText(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({ message: '复制成功', customClass: 'msgTips' })
}
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime)
const config = {
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-31 15:53:44
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="gpt-box">
<div class="gpt-header" v-if="query.purchaseCustomerCount">
<div class="import-base">
<div class="import-item" v-for="(item, index) in importItem" :key="index">
{{ item.title }}:
<span>{{ query[item.name] }}</span>
</div>
</div>
</div>
<div class="gpt-header" v-else>
<div class="import-panel">
<el-button type="primary" size="small" icon="el-icon-download" @click="jumpUrl">导入企微魔方</el-button>
</div>
<div class="import-illustrate">
当前门店基盘客户为空,请通过企微魔方导入门店基盘客户数据。
</div>
</div>
<div class="gpt-body">
<div class="chat-panel" ref="chatRef">
<div class="chat-panel-b" ref="chatBRef">
<div v-for="(item, i) in chatItem" :key="i">
<div class="error-tips flex-center" v-if="item.type == 'error'">
<i class="el-icon-error"></i>
<span>{{ item.content }}</span>
<!-- <i class="el-icon-close"></i> -->
</div>
<template v-else>
<div :class="['chat-item', item.type == 'answer' ? 'is-left' : 'is-right']">
<div class="item-content left-item" v-if="item.type == 'answer'">{{ item.content }}</div>
<div class="item-content right-item" v-else>{{ item.content }}</div>
</div>
</template>
</div>
</div>
</div>
</div>
<div class="gpt-footer">
<div class="input-box" contenteditable="true" v-html="contentHtml" ref="inputRef"></div>
<div class="input-operate">
<div class="select-box">
<el-button size="mini" @click="phrasesShow = true" ref="phrases">常用语</el-button>
<div class="select-panel" v-show="phrasesShow">
<div class="select-item" v-for="(item, index) in phrases" :key="index" v-html="item" @click="selectText(item)"></div>
</div>
</div>
<el-button type="primary" size="small" @click="sendMsg">发送</el-button>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
isError: true,
phrasesShow: false,
query: {},
contentHtml: '我需要制定一套<span>续保</span>营销方案,活动时间为<span>5月份</span>。',
phrases: ['创建一个<span>端午节</span>的营销活动,活动时间为<span>6月份</span>', '我需要一个<span>立夏</span>的节日关怀营销活动', '建立一个<span>父亲节</span>的节日关怀活动'],
chatItem: [],
importItem: [
{
title: '基盘总客户数',
name: 'purchaseCustomerCount'
},
{
title: '企微客户数',
name: 'entmicroAddCustomerCount'
},
{
title: '未加企微客户数',
name: 'entmicroNotAddCustomerCount'
}
]
}
},
computed: {
...mapState('marketing', ['calendarDataAll', 'activityInfo', 'keywords', 'GPTList'])
},
watch: {
chatItem() {
const chatRef = this.$refs.chatRef
this.$nextTick(() => {
const height = this.$refs.chatBRef.offsetHeight - chatRef.offsetHeight + 40
chatRef.scrollTop = height //滚动到最底部
})
},
activityInfo(val) {
if (!val) return
if (val.type != 'chatgpt') this.chatItem = []
}
},
methods: {
...mapActions('marketing', ['setActivityInfo', 'setKeyWords']),
selectText(html) {
this.contentHtml = html
this.phrasesShow = false
},
jumpUrl() {
this.$history.push('/drainage/square/index')
},
//发送消息
sendMsg() {
console.log(this.calendarDataAll)
const content = this.$refs.inputRef.textContent
if (!content.trim()) return
this.chatItem.push({
type: 'question',
content
})
//根据关键字查找模板
const calendarData = this.calendarDataAll.find(item => content.includes(item.keywords))
if (calendarData) {
this.chatItem.push({
type: 'answer',
content: '我们为您生成以下方案,请查看“营销模型解析”'
})
this.setKeyWords(calendarData.keywords)
this.setActivityInfo({
id: calendarData.id,
type: 'chatgpt'
})
} else {
this.chatItem.push({
type: 'error',
content: '无法识别营销场景,请重新输入'
})
}
this.$refs.inputRef.textContent = ''
this.contentHtml = ''
},
/**点击空白处隐藏下拉框 */
bodyCloseMenus(e) {
const self = this
if (this.$refs.phrases && !this.$refs.phrases.$el.contains(e.target)) {
if (self.phrasesShow === true) {
self.phrasesShow = false
}
}
}
},
mounted() {
document.addEventListener('click', this.bodyCloseMenus)
this.query = this.$route.query || {}
console.log(this.$route.query)
},
beforeDestroy() {
document.removeEventListener('click', this.bodyCloseMenus)
}
}
</script>
<style lang="scss" scoped>
.gpt-box {
box-sizing: border-box;
padding: 8px;
.gpt-header {
height: 48px;
background: #e4e3ff;
border-radius: 4px;
display: flex;
align-items: center;
color: #000000a6;
.import-illustrate {
margin-left: 10px;
}
.import-base {
padding-left: 16px;
display: flex;
align-items: center;
.import-item {
margin-right: 80px;
span {
color: #5850ff;
}
}
}
}
.gpt-body {
height: 170px;
.error-tips {
width: 274px;
height: 40px;
background: #fce3e3;
border-radius: 4px;
margin: 0px auto;
font-size: 14px;
color: #000000a6;
span {
margin: 0 20px 0px 10px;
}
.el-icon-error {
color: #eb4e4e;
}
.el-icon-close {
color: #666666;
}
}
.chat-panel {
padding-top: 12px;
height: 150px;
overflow: auto;
.chat-item {
margin-top: 8px;
display: flex;
&.is-left {
justify-content: flex-start;
}
&.is-right {
justify-content: flex-end;
}
.item-content {
font-size: 14px;
display: inline-block;
padding: 12px 8px;
border: 1px solid #e5e5e5;
border-radius: 4px 4px 4px 0;
background: #fafbfe;
max-width: 500px;
}
}
}
}
.gpt-footer {
height: 98px;
background: #f5f5f5;
border: 1px solid #e5e5e5;
border-radius: 4px;
padding: 8px;
.input-box {
height: 66px;
overflow: auto;
}
.input-operate {
display: flex;
justify-content: space-between;
align-items: center;
.select-box {
position: relative;
.select-panel {
z-index: 1000;
background: #fff;
position: absolute;
top: 28px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: 4px;
width: 343px;
.select-item {
padding-left: 10px;
line-height: 36px;
color: #666666ff;
font-size: 14px;
cursor: pointer;
span {
color: #eb4e4e;
}
&:hover {
background: #f2f1ff;
}
}
}
}
}
}
}
</style>
<style>
.select-item span,
.input-box span {
color: #eb4e4e;
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 15:18:24
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-29 17:05:49
* @FilePath: \scrm-micro-link\src\views\activityLink\components\ImportCoustom.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="import-base">
<div class="import-item" v-for="(item, index) in importItem" :key="index">
{{ item.title }}:
<span>{{ viewDataDetail[item.name] }}</span>
</div>
<el-button class="import-btn" :size="size" type="primary" @click="jumpUrl" icon="el-icon-download">导入</el-button>
</div>
</template>
<script>
export default {
data() {
return {
importItem: [
{
title: '基盘总客户数',
name: 'purchaseCustomerCount'
},
{
title: '企微客户数',
name: 'entmicroAddCustomerCount'
},
{
title: '未加企微客户数',
name: 'entmicroNotAddCustomerCount'
}
],
viewDataDetail: {}
}
},
methods: {
jumpUrl() {
this.$history.push('/drainage/square/index')
}
},
mounted() {
this.$apis.marketing.viewData({}).then(res => {
this.loading = false
this.viewDataDetail = res || {}
})
}
}
</script>
<style lang="scss" scoped>
.import-base {
height: 48px;
background: #e4e3ff;
border-radius: 4px;
display: flex;
align-items: center;
color: #000000a6;
padding: 0px 16px;
display: flex;
align-items: center;
.import-item {
margin-right: 80px;
span {
color: #5850ff;
}
}
.import-btn {
margin-left: auto;
}
}
</style>
<template>
<div class="activity-container">
<div class="choseRow">
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in tabList" :key="index" @click="tabClick(index + 1)">{{ item.label }}</div>
<div @click="showCase" class="show-case-btn">历史营销方案</div>
</div>
<div class="acitity-content">
<marketing-task v-show="currentIndex == 1"></marketing-task>
<marketing-gift v-show="currentIndex == 2"></marketing-gift>
<marketing-content v-show="currentIndex == 3"></marketing-content>
</div>
<GLDialog mode="big" class="case-panel" bigTitle="历史营销方案" :hasFooter="false" :before-close="handleCaseClose" @onCancel="handleCaseClose" :visible.sync="caseVisible">
<div class="case-table">
<el-tabs class="case-tabs" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="保 险" name="5"></el-tab-pane>
<el-tab-pane label="定 保" name="2"></el-tab-pane>
<el-tab-pane label="节日关怀" name="6"></el-tab-pane>
<el-tab-pane label="售后众筹" name="4"></el-tab-pane>
</el-tabs>
<div></div>
</div>
<GLTable ref="caseRef" v-loading="loading" :tableData="caseList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</GLDialog>
</div>
</template>
<script>
import marketingTask from './MarketingTask'
import marketingGift from './MarketingGift'
import marketingContent from './MarketingContent'
export default {
components: {
marketingTask,
marketingGift,
marketingContent
},
data() {
return {
tabList: [{ label: '营销任务' }, { label: '营销礼包' }, { label: '营销内容' }],
caseList: [],
activeName: '5',
caseVisible: false,
currentIndex: 1,
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '数据',
attrs: {
type: 'text'
},
listeners: {
click: this.handleJump
}
},
{
type: 'el-button',
name: '预览',
attrs: {
type: 'text'
},
listeners: {
click: this.handleView
}
},
{
type: 'el-button',
name: '引用',
attrs: {
type: 'text'
},
listeners: {
click: this.handleUse
}
}
],
// 表格参数
tableParams: {
tableOption: true,
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '活动名称',
prop: 'activityName',
width: 180
},
{
label: '活动开始时间',
prop: 'startTime',
width: 180
},
{
label: '活动结束时间',
prop: 'endTime',
width: 180
},
{
label: '外呼费用/元',
prop: 'denomination',
formatter: cellValue => {
return isNaN(cellValue.denomination) ? cellValue.denomination : (cellValue.denomination / 100).toFixed(2) + '元'
}
}
]
}
}
},
methods: {
//数据看板
handleJump(row) {
this.$router.push({
path: '/activityLink/dataBoard',
query: {
activityId: row.id,
activityName: row.activityName
}
})
},
//引用
handleUse(row) {},
//预览
handleView(row) {},
tabClick(index) {
this.currentIndex = index
},
handleCaseClose() {
this.caseVisible = false
},
showCase() {
this.caseVisible = true
this.$nextTick(() => {
this.getList()
})
},
//获取营销列表
getList() {
let param = {
currentPage: this.$refs.caseRef.page.pageNum,
merchantId: this.$globalState.session.merchantId,
subscribe: this.activeName,
pageSize: this.$refs.caseRef.page.pageSize
}
this.$apis.activity.activityPage(param).then(res => {
this.caseList = res.list || []
})
},
handleTabClick() {
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.activity-container {
margin-top: 16px;
.acitity-content {
background: #fff;
padding: 20px;
}
}
.choseRow {
display: flex;
height: auto;
position: relative;
.show-case-btn {
cursor: pointer;
position: absolute;
font-size: 14px;
color: #685bff;
right: 10px;
top: 10px;
}
.choseItem {
display: inline-block;
cursor: pointer;
line-height: 40px;
height: 40px;
border-radius: 4px 4px 0px 0px;
border: 1px solid #e5e5e5;
margin-right: 1px;
padding: 0 32px;
box-sizing: border-box;
background: #f8f8f8;
}
.active {
color: #5850ff;
background: #ffffff;
border-bottom: 1px solid #fff;
font-weight: 600;
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 21:24:27
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-07 16:04:21
* @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<glsx-combi-form class="edit-form-container" :isBlock="true" ref="editFormRef" formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="model">
<el-button :size="size" icon="el-icon-plus" @click="modelVisible = true">选择模板</el-button>
</div>
<div slot="marketingTitle" class="input-slot">
<el-input placeholder="请输入营销主题" v-model="editForm.marketingTitle" style="width:400px" maxlength="12" show-word-limit></el-input>
<label @click="getGPTitle(1)" v-if="GPTList">ChatGPT重新生成</label>
<label v-else class="disabled-label">ChatGPT重新生成</label>
</div>
<div slot="marketingSubtitle" class="input-slot">
<el-input placeholder="请输入副主题" v-model="editForm.marketingSubtitle" style="width:400px" maxlength="20" show-word-limit></el-input>
<label @click="getGPTitle(2)" v-if="GPTList">ChatGPT重新生成</label>
<label v-else class="disabled-label">ChatGPT重新生成</label>
</div>
<template slot="activityTimeHtml">
<div class="activity-time-container">
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</div>
</template>
</glsx-combi-form>
<select-insure :modelVisible="modelVisible" v-if="modelVisible" @handleClose="handleClose" @handleSure="handleSure"></select-insure>
</div>
</template>
<script>
import selectInsure from './SelectInsure.vue'
import { mapState } from 'vuex'
export default {
components: {
selectInsure
},
data() {
return {
t1: 0, // 主标题下标
t2: 0, // 副标题下标
editChildRef: 'editChildRef',
modelVisible: false,
editForm: {
marketingTitle: '',
marketingSubtitle: '',
activityTime: [],
superMarketingCouponRelRequestList: [],
backgroundImage: '',
detailImage: '',
merchantLog: ''
},
editFormData: [
{
label: '预设模板',
addHtml: 'model'
},
{
label: '营销标题',
name: 'marketingTitle',
addHtml: 'marketingTitle',
type: 'input',
maxlength: 12
},
{
label: '营销副标题',
name: 'marketingSubtitle',
addHtml: 'marketingSubtitle',
type: 'input',
maxlength: 20
},
{
label: '活动时间',
name: 'activityTime',
addHtml: 'activityTimeHtml',
isHide: false
},
{
label: '主题背景图',
name: 'backgroundImage',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大5M,宽度750px,长度≤600px',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'backgroundImage',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
},
{
label: '内容图',
name: 'detailImage',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大10M,宽度750px,长度不限',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'detailImage',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
},
{
label: '门店名称',
name: 'merchantname',
type: 'input'
},
{
label: '门店地址',
name: 'merchantAddress',
type: 'map',
isReadonly: false,
provinceView: false,
attrObj: {
provinceName: 'activityAddressProvinceName',
provinceCode: 'activityAddressProvinceCode',
cityName: 'activityAddressCityName',
cityCode: 'activityAddressCityCode',
lat: 'activityAddressLat',
lng: 'activityAddressLng',
fullAddress: 'merchantAddress'
}
},
{
label: '服务热线',
name: 'serviceHotline',
type: 'input'
},
{
label: '门店Logo',
name: 'merchantLog',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大1M,尺寸216*60',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'merchantLog',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
}
],
editRule: {
marketingTitle: [{ required: true, message: '请输入营销标题', trigger: 'input' }],
marketingSubtitle: [{ required: true, message: '请输入营销副标题', trigger: 'input' }],
activityTime: [{ required: true, message: '请选择活动时间', trigger: 'input' }],
backgroundImage: [{ required: true, message: '请选择主题背景图', trigger: 'change' }],
detailImage: [{ required: true, message: '请选择内容图', trigger: 'change' }],
activityPrice: [{ required: true, message: '请输入活动参与价格/元:', trigger: 'input' }],
goodsStock: [{ required: true, message: '请输入库存', trigger: 'input' }],
merchantname: [{ required: true, message: '请输入门店名称', trigger: 'input' }],
merchantAddress: [{ required: true, message: '请选择门店地址', trigger: 'input' }],
serviceHotline: [{ required: true, message: '请输入服务热线', trigger: 'input' }]
}
}
},
watch: {
GPTList: {
handler() {
this.t1 = 0
this.t2 = 0
},
deep: true
},
subscribe(val) {
if (val == 5) {
this.editRule.detailImage[0].required = false
this.editFormData[0].isHide = false
} else {
this.editRule.detailImage[0].required = true
this.editFormData[0].isHide = true
}
}
},
computed: {
...mapState('marketing', ['GPTList', 'subscribe'])
},
methods: {
handleSure(val) {
this.modelVisible = false
this.getTemplateInfo(val.id)
},
getTemplateInfo(id) {
this.$apis.marketing.calendarDetail({ id }).then(res => {
console.log(res)
const { title, subTitle, startTime, endTime, backgroundImg, captionImg } = this.$common.utils.deepClone(res || {})
this.editForm.templateId = id
this.editForm.marketingTitle = title
this.editForm.marketingSubtitle = subTitle
this.editForm.backgroundImage = backgroundImg
this.editForm.detailImage = captionImg
this.editForm.activityTime = [startTime + ' 00:00:00', endTime + ' 00:00:00']
})
},
handleClose() {
this.modelVisible = false
},
getGPTitle(type) {
const len = this.GPTList.mainTitles.length
console.log(len)
if (type == 1) {
this.editForm.marketingTitle = this.GPTList.mainTitles[this.t1 % len].title
this.t1++
}
if (type == 2) {
this.editForm.marketingSubtitle = this.GPTList.subTitles[this.t2 % len].title
this.t2++
}
}
}
}
</script>
<style lang="scss" scoped>
.edit-form-container {
padding: 8px 50px;
.input-slot {
label {
color: #5850ff;
font-size: 14px;
margin-left: 10px;
cursor: pointer;
&.disabled-label {
color: #999999;
cursor: no-drop;
}
}
}
}
</style>
<style lang="scss">
#merchantAddress {
.el-input {
width: 430px;
margin-right: 8px;
}
}
</style>
<template>
<div class="marketing-view">
<div class="case-step">
<div class="case-item" v-for="(item, index) in caseList" :key="index">
<i class="el-icon-success" v-if="item.isFinish"></i>
<i class="el-icon-error" v-if="!item.isFinish"></i>
<span>{{ item.label }}</span>
</div>
<div class="case-result">执行营销方案</div>
</div>
<div class="case-container">
<div class="case-container-title">预览营销方案</div>
<phoneView></phoneView>
</div>
</div>
</template>
<script>
import phoneView from './PhoneView'
export default {
components: {
phoneView
},
data() {
return {
caseList: [
{ label: '请导入营销任务客群', isFinish: true },
{ label: '请配置营销礼包', isFinish: false },
{ label: '请配置营销内容', isFinish: true }
]
}
}
}
</script>
<style lang="scss" scoped>
.marketing-view {
background: #ffffff;
padding-top: 10px;
}
.case-step {
width: 279px;
height: 170px;
background: #f9f9f9;
border-radius: 4px;
margin: 12px;
padding: 20px;
box-sizing: border-box;
.case-item {
font-size: 14px;
color: #000000a6;
letter-spacing: 0;
line-height: 26px;
.el-icon-success {
color: #2cca74;
}
.el-icon-error {
color: #eb4e4e;
}
span {
margin-left: 10px;
}
}
.case-result {
width: 116px;
height: 32px;
border: 1px solid #685bff;
border-radius: 4px;
line-height: 32px;
text-align: center;
font-size: 14px;
color: #685bff;
margin: 20px auto;
cursor: pointer;
}
}
.case-container {
padding: 14px;
&-title {
font-size: 16px;
color: #333333;
margin: 10px;
}
}
</style>
<template>
<div class="scene-container">
<el-button :size="size" type="primary" @click="handleAdd" class="el-icon-plus">新建营销方案</el-button>
<div class="choseRow">
<div class="choseItem" :class="{ active: currentIndex == item.type }" v-for="(item, index) in tabList" :key="index" @click="tabClick(item.type)">{{ item.label }}</div>
</div>
<div class="scene-content">
<div class="scene-item" v-for="(item, index) in sceneList" :key="index">
<div class="scene-item-box">
<div class="scene-item-title">
<img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" />
{{ item.title }}
</div>
<div class="scene-item-content">{{ item.content }}</div>
</div>
<div class="scene-item-next" v-if="index < 5">
<img src="@/assets/marketing/next.png" alt="" />
</div>
</div>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
data() {
return {
tabList: [{ label: '保险', type: 5 }, { label: '定保', type: 2 }, { label: '节日关怀', type: 6 }, { label: '售后众筹' }],
currentIndex: 5,
sceneList: [
{
title: '运营陪跑',
content: '添加运营小管家,组群获得在线支持'
},
{
title: '导入客群',
content: '导入营销客户群体并营销、跟进任务给到指定员工'
},
{
title: '配置营销礼包',
content: '配置客户营销关联的权益、平台福利、门店服务券等'
},
{
title: '配置营销内容',
content: '选定营销配图、活动相关内容'
},
{
title: '营销管理',
content: '按分配对客户进行营销并生成精细化数据反馈'
},
{
title: '营销结果',
content: '随时查看各项营销节点结果数据'
}
]
}
},
methods: {
...mapActions('marketing', ['setSubscribe']),
handleAdd() {},
tabClick(index) {
this.currentIndex = index
console.log(index)
this.setSubscribe(index)
}
}
}
</script>
<style lang="scss" scoped>
.scene-container {
margin-top: 16px;
.scene-content {
background: #fff;
padding: 16px;
display: flex;
.scene-item {
width: 16.7%;
display: flex;
align-items: center;
&-box {
width: calc(100% - 30px);
height: 0;
padding-bottom: 50%;
background-image: url('../../../assets/marketing/scence-bg.png');
background-size: 100% 100%;
padding-left: 8%;
padding-right: 8%;
.scene-item-title {
color: #333333;
margin-top: 8%;
font-size: 1.1vw;
transform: scale(0.6);
-webkit-transform-origin-x: 0;
width: 165%;
img {
width: 1.7vw;
vertical-align: middle;
}
}
.scene-item-content {
font-size: 1vw;
transform: scale(0.6);
color: #999999;
-webkit-transform-origin-x: 0;
display: inline-block;
width: 165%;
}
}
&-next {
margin: 0 8px;
img {
width: 16px;
}
}
}
}
}
.choseRow {
margin-top: 10px;
display: flex;
height: auto;
.choseItem {
display: inline-block;
cursor: pointer;
line-height: 40px;
height: 40px;
border-radius: 4px 4px 0px 0px;
border: 1px solid #e5e5e5;
margin-right: 1px;
padding: 0 32px;
box-sizing: border-box;
background: #f8f8f8;
}
.active {
color: #5850ff;
background: #ffffff;
border-bottom: 1px solid #fff;
font-weight: 600;
}
}
</style>
<template>
<GLDialog class="model-panel" width="720px" title="选择模板" :before-close="handleModelClose" @onCancel="handleModelClose" @onOk="handleConfirm" :visible.sync="modelVisible">
<div class="model-body">
<div class="model-panel">
<div class="model-item" v-for="item in modelList" :key="item.id" @click="selectObj = item">
<div :class="{ 'model-item-img': true, checked: selectObj.id == item.id }">
<img :src="item.backgroundImg" />
<i class="el-icon-success" v-if="selectObj.id == item.id"></i>
</div>
<div class="model-item-title">
{{ item.title }}
</div>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
export default {
data() {
return {
merchantId: this.$globalState.session.merchantId,
selectObj: {},
modelList: []
}
},
props: {
modelVisible: {
type: Boolean,
default: false
}
},
methods: {
calendarPage() {
this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1 }).then(res => {
this.modelList = (res.data || []).filter(item => item.marketingType == 5)
this.selectObj = this.modelList[0]
})
},
handleConfirm() {
this.$emit('handleSure', this.selectObj)
},
handleModelClose() {
this.$emit('handleClose')
}
},
mounted() {
this.calendarPage()
}
}
</script>
<style scoped lang="scss">
.model-panel {
display: grid;
grid-template-columns: repeat(5, 120px);
gap: 20px;
.model-item {
width: 120px;
cursor: pointer;
&-img {
height: 120px;
margin-bottom: 6px;
border-radius: 4px;
position: relative;
&.checked {
border: 1px solid #5850ff;
}
.el-icon-success {
position: absolute;
right: 10px;
top: 10px;
color: #5850ff;
font-size: 14px;
}
img {
border-radius: 4px;
width: 119px;
height: 119px;
}
}
&-title {
font-size: 14px;
color: #333333;
line-height: 20px;
}
}
}
</style>
......@@ -33,8 +33,24 @@
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<GLDialog class="qr-dialog" title="活动分享" mode="mid" okText="下载" :visible.sync="isQrcodeVisible" @onOk="handleCancelConfirm" @onCancel="isQrcodeVisible = false">
<div class="qrcode-body">
<GLDialog class="qr-dialog" :title="isLink ? '活动链接' : '活动分享'" mode="mid" :hasFooter="!isLink" okText="下载" :visible.sync="isQrcodeVisible" @onOk="handleCancelConfirm" @onCancel="isQrcodeVisible = false">
<div class="qrcode-body-link" v-if="isLink">
<div class="flex">
<div class="link-item" v-for="(item, index) in linkCode" :key="index">
<div class="link-item-l">
<div class="link-title">{{ item.title }}</div>
<div class="link-save"><el-button :size="size" type="primary" @click="downloadIamge">保存图片</el-button></div>
</div>
<div class="link-item-r"><el-image :src="qrCodeUrl" alt=""></el-image></div>
</div>
</div>
<div class="link-address-box" v-for="(item, index) in linkValue" :key="index">
<div class="link-address-title">{{ item.title }}</div>
<div class="link-address">{{ item.url }}</div>
<div class="link-clone"><el-button :size="size" type="primary" @click="cloneText(item, url)">复制链接</el-button></div>
</div>
</div>
<div class="qrcode-body" v-else>
<div class="img" v-loading="imgLoading">
<el-image :src="qrCodeUrl" alt=""></el-image>
</div>
......@@ -50,18 +66,25 @@
</template>
<script>
import { orderStatus, businessType, subscribe, downloadIamge } from '@/common/constant'
import { cloneText } from '@/utils/index'
import url from '@/assets/empty.png'
export default {
name: 'LiveIndex',
data() {
return {
orderStatus,
isLink: true,
attrToIcon: {
2: 'discount',
3: 'cash',
4: 'exchange',
7: 'service'
},
linkCode: [{ title: '活动二维码' }, { title: '注册二维码' }],
linkValue: [
{ title: '注册链接', url: 'thttp://scrm.test.glsx.com.cn/link/activityLink/index' },
{ title: '活动链接', url: 'thttp://scrm.test.glsx.com.cn/link/activityLink/index' }
],
qrCodeUrl: '',
linkUrl: '',
dialogVisibleDel: false,
......@@ -133,14 +156,16 @@ export default {
},
{
label: '商户名称',
prop: 'merchantName'
prop: 'merchantName',
width: 200
},
{
label: '场景选择',
prop: 'subscribe',
formatter: cellValue => {
return subscribe.find(item => item.optionId == cellValue.subscribe)?.optionLabel
}
},
width: 120
},
{
label: '销量',
......@@ -151,7 +176,8 @@ export default {
prop: 'activityPrice',
formatter: cellValue => {
return cellValue.activityPrice / 100
}
},
width: 100
},
{
label: '库存',
......@@ -258,6 +284,18 @@ export default {
this.handleBoard(row)
}
}
},
{
type: 'el-button',
name: '活动链接',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.shareQrcode(row)
}
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
......@@ -379,8 +417,9 @@ export default {
params.id = row.id
params.activityStatus = row.activityStatus
}
let path = this.loginpath ? '/activityLink/editActivity' : '/activityLink/marketingActivity'
this.$router.push({
path: `/activityLink/editActivity`,
path,
query: params
})
},
......@@ -431,9 +470,15 @@ export default {
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun()
},
handleCancelConfirm() {
downloadIamge(this.qrCodeUrl)
this.downloadIamge(this.qrCodeUrl)
this.isQrcodeVisible = false
},
downloadIamge(url) {
downloadIamge(url)
},
cloneText(text) {
cloneText(text)
},
handleSearch() {
this.$refs.classifyRef.refreshTable()
},
......@@ -508,6 +553,49 @@ export default {
}
.qr-dialog {
.qrcode-body-link {
.link-address-box {
background: #f8f8f8;
border-radius: 2px;
padding: 20px;
position: relative;
margin-top: 20px;
.link-address-title {
font-size: 14px;
color: #333333;
margin-bottom: 10px;
}
.link-address {
font-size: 14px;
color: #999999;
}
.link-clone {
position: absolute;
top: 20px;
right: 20px;
}
}
.flex {
gap: 10px;
.link-item {
background: #f8f8f8;
border-radius: 2px;
padding: 20px;
flex: 1;
display: flex;
justify-content: space-between;
.link-item-l {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.link-item-r {
width: 120px;
height: 120px;
}
}
}
}
/deep/.el-dialog__body {
// padding: 20px;
.el-scrollbar__wrap {
......
<template>
<div class="marketing-container">
<div class="marketing-content">
<import-custom></import-custom>
<scene></scene>
<marketing></marketing>
</div>
<div class="marketing-view">
<process></process>
</div>
</div>
</template>
<script>
import importCustom from './components/ImportCoustom'
import scene from './components/Scene'
import marketing from './components/Marketing'
import process from './components/Process'
export default {
components: {
importCustom,
scene,
marketing,
process
}
}
</script>
<style lang="scss" scoped>
.marketing-container {
display: flex;
.marketing-content {
flex: 1;
}
.marketing-view {
margin-left: 16px;
width: 303px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!