Commit 3e0cad58 by 前端

Merge branch 'v3.13.1' into 'master'

V3.13.1

See merge request !11
2 parents 68b2e525 2919f79b
Showing 60 changed files with 3937 additions and 69 deletions
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:56 * @Date: 2022-12-13 09:23:56
* @LastEditors: yangming yangming@didihu.com.cn * @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 * @FilePath: \scrm-micro-link\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @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 defaultPath = 'scrm.api.shopmall.activity.'
//分页查询媒体文件列表 //分页查询媒体文件列表
const dropdownList = params => { const dropdownList = params => {
...@@ -126,6 +126,16 @@ const getShared = params => { ...@@ -126,6 +126,16 @@ const getShared = params => {
sign: true 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 { export default {
dropdownList, dropdownList,
...@@ -138,5 +148,6 @@ export default { ...@@ -138,5 +148,6 @@ export default {
pageApi, pageApi,
pageAllApi, pageAllApi,
updateApi, updateApi,
getShared getShared,
activityPage
} }
/* /*
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 16:38:54 * @Date: 2022-12-13 16:38:54
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-12 16:18:55 * @LastEditTime: 2023-07-13 14:25:32
* @FilePath: \scrm-micro-link\src\api\modules\giftBag.js * @FilePath: \scrm-micro-link\src\api\modules\giftBag.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -62,5 +62,44 @@ const equityMerchant = params => { ...@@ -62,5 +62,44 @@ const equityMerchant = params => {
sign: true 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
})
}
//查询某个营销礼包预设方案详情(超级营销)
const packageDefault = params => {
params.method = 'scrm.api.shopmall.activity.coupon.package.default'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { packageDefault, 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-13 20:52:04
* @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, http_no_session } 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
})
}
//创建超级营销
const createSuperMarketing = params => {
params.method = 'marketing.api.supermarket.createSuperMarketing'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
const findActivityInfo = params => {
params.method = 'marketing.api.supermarket.findActivityInfo'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//获取小管家二维码
const EntWechatQrCode = params => {
params.method = 'marketing.api.supermarket.EntWechatQrCode'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
const activityDetail = params => {
params.method = 'scrm.api.shopmall.activity.detail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 门店详情
const findMerchantDetailByMerchantNo = params => {
params.method = 'merchants.api.open.findMerchantDetailByMerchantNo'
return http_merchant({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const registerSso = params => {
params.method = 'scrm.api.shopmall.staff.bulge.register'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const updateApi = params => {
params.method = `scrm.api.shopmall.activity.bulge.add.or.update`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
viewData,
getChatGPTList,
calendarPage,
calendarDetail,
importCustomer,
getRobotList,
findMerchantStaffList,
createSuperMarketing,
updateApi,
activityDetail,
findActivityInfo,
registerSso,
EntWechatQrCode,
findMerchantDetailByMerchantNo
}
...@@ -7,6 +7,35 @@ html { ...@@ -7,6 +7,35 @@ html {
overflow: hidden; overflow: hidden;
background-color: #f4f5fa; 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 { .link-main {
.container { .container {
background: #ffffff; background: #ffffff;
...@@ -64,32 +93,6 @@ html { ...@@ -64,32 +93,6 @@ html {
white-space: nowrap; white-space: nowrap;
overflow: hidden; 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 { .tips-icon {
display: inline-block; display: inline-block;
width: 14px; width: 14px;
......
...@@ -268,6 +268,10 @@ const subscribe = [ ...@@ -268,6 +268,10 @@ const subscribe = [
{ {
optionId: 8, optionId: 8,
optionLabel: '超级营销' optionLabel: '超级营销'
},
{
optionId: 9,
optionLabel: '售后众筹'
} }
] ]
const giftPackage = [ const giftPackage = [
...@@ -303,4 +307,6 @@ function isShowBtn(value) { ...@@ -303,4 +307,6 @@ function isShowBtn(value) {
} }
return isShowStatus return isShowStatus
} }
export { equityLevel, isShowBtn, subscribe, giftPackage, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, businessType, orderStatus, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight } const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8]
const FESTIVAL = [9, 10]
export { RENEWAL, FESTIVAL, equityLevel, isShowBtn, subscribe, giftPackage, limitPrice, getExplorer, exportFn, aToExport, downloadIamge, businessType, orderStatus, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, setMinHeight }
.vdr {
touch-action: none;
position: absolute;
box-sizing: border-box;
border: 1px dashed black;
}
.handle {
box-sizing: border-box;
position: absolute;
width: 10px;
height: 10px;
background: #EEE;
border: 1px solid #333;
}
.handle-tl {
top: -10px;
left: -10px;
cursor: nw-resize;
}
.handle-tm {
top: -10px;
left: 50%;
margin-left: -5px;
cursor: n-resize;
}
.handle-tr {
top: -10px;
right: -10px;
cursor: ne-resize;
}
.handle-ml {
top: 50%;
margin-top: -5px;
left: -10px;
cursor: w-resize;
}
.handle-mr {
top: 50%;
margin-top: -5px;
right: -10px;
cursor: e-resize;
}
.handle-bl {
bottom: -10px;
left: -10px;
cursor: sw-resize;
}
.handle-bm {
bottom: -10px;
left: 50%;
margin-left: -5px;
cursor: s-resize;
}
.handle-br {
bottom: -10px;
right: -10px;
cursor: se-resize;
}
@media only screen and (max-width: 768px) {
[class*="handle-"]:before {
content: '';
left: -10px;
right: -10px;
bottom: -10px;
top: -10px;
position: absolute;
}
}
...@@ -4,25 +4,18 @@ ...@@ -4,25 +4,18 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:51:04 * @LastEditTime: 2023-07-13 20:57:03
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(common) {
// console.log(1111111) let params = { moduleName: 'link', mockUrl: 'https://oss-config.glsx.com.cn/mock/63c12a2e28a427953783403b/link/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
// if (isEnv) { return common.utils.getConfig(params)
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
//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.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.glsx.com.cn/mock/63c12a2e28a427953783403b/link/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-08-13 14:12:11 * @Date: 2021-08-13 14:12:11
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:50:51 * @LastEditTime: 2023-07-13 17:50:52
* @FilePath: \scrm\scrm-sub-blog\src\main.js * @FilePath: \scrm\scrm-sub-blog\src\main.js
*/ */
import Vue from 'vue' import Vue from 'vue'
...@@ -19,6 +19,7 @@ Vue.prototype.$apis = apis ...@@ -19,6 +19,7 @@ Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
Vue.prototype.defaultLabelWidth = '154px' Vue.prototype.defaultLabelWidth = '154px'
Vue.prototype.staticImgUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/activity/' Vue.prototype.staticImgUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/activity/'
Vue.prototype.$vip = 'https://img01.glsx.com.cn/weapp/resource/miniprogram/expandedGold/vip.png'
try { try {
const loginpath = JSON.parse(sessionStorage.getItem('SCRM_BASE_SESSION'))?.loginpath const loginpath = JSON.parse(sessionStorage.getItem('SCRM_BASE_SESSION'))?.loginpath
if (loginpath === '/oss') Vue.prototype.loginpath = true if (loginpath === '/oss') Vue.prototype.loginpath = true
...@@ -29,3 +30,5 @@ start() ...@@ -29,3 +30,5 @@ start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(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-07-14 21:38:37
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import apis from '@/api'
import Drawing from '@/utils/drawing'
const WIDTH = 244
const RATIO = WIDTH / 375
export default {
data() {
return {}
},
methods: {
//获取图片宽度高度
getImgInfo(src) {
return new Promise(resolve => {
if (!src) {
resolve({ dw: 0, dh: 0, src })
}
const img = new Image()
img.src = src
img.onload = () => {
resolve({ dw: img.width, dh: img.height, src })
}
})
},
//主图、内容图、logo合并图片
async createBig(info, logoInfo, titleStyle, subTitleStyle) {
console.log(info)
this.loading = true
const { backgroundImage, detailImage, merchantLog, marketingTitle, marketingSubtitle } = info
if (!backgroundImage) return
try {
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLog)])
const h = (res[0].dh / res[0].dw) * WIDTH + (res[1].dh / res[1].dw) * WIDTH
this.logoInfo = { url: merchantLog, ...logoInfo }
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
height: h
}),
imageList = [
{
url: backgroundImage,
x: 0,
y: 0,
width: WIDTH,
height: (res[0].dh / res[0].dw) * WIDTH
},
{
url: detailImage,
x: 0,
y: (res[0].dh / res[0].dw) * WIDTH,
width: WIDTH,
height: (res[1].dh / res[1].dw) * WIDTH
},
{ ...this.logoInfo }
].filter(item => item.url)
const styles = [titleStyle, subTitleStyle]
for (const style of styles) {
style.x = parseInt(style.x * RATIO)
style.y = parseInt(style.y * RATIO)
style.size = parseInt(style.size * RATIO)
style.width = parseInt(style.width * RATIO)
}
let textList = [],
title = {
titleStyle,
subTitleStyle
}
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
})
return new Promise(async resolve => {
resolve(await this.uploadImg(canvasBase64))
})
} catch (e) {
console.log(e)
}
},
async createMain(h, url, draggableList) {
const style1 = draggableList[0]
const style2 = draggableList[1]
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
height: h
})
const imageList = [
{
url,
x: 0,
y: 0,
width: WIDTH,
height: h
}
]
const textList = [
{ x: style1.x, y: style1.y, fontSize: style1.size, width: style1.width, text: style1.content, color: style1.color, font: style1.font },
{ x: style2.x, y: style2.y, fontSize: style2.size, width: style2.width, text: style2.content, color: style2.color, font: style2.font }
]
console.log(imageList, textList)
const canvasBase64 = await drawfun.begin({
imageList,
textList
})
return new Promise(async resolve => {
resolve(await this.uploadImg(canvasBase64))
})
},
uploadImg(imgFile) {
return new Promise((resolve, reject) => {
const base64 = 'png' + '@' + imgFile.split(',')[1]
apis.common.pictureUpload({ file: base64, fileType: 'image' }).then(res => {
resolve(res)
})
})
}
},
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',
formatter: cellValue => {
return '无限制'
}
}
]
},
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() {}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-10 10:53:53
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-16 10:12:40
* @FilePath: \scrm-micro-link\src\mixins\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
data() {
return {
routerInfo: this.$route.query
}
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57 * @Date: 2022-12-13 09:23:57
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-22 13:45:51 * @LastEditTime: 2023-07-13 20:56:07
* @FilePath: \scrm-micro-link\src\setup\qiankun.js * @FilePath: \scrm-micro-link\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -20,7 +20,7 @@ let instance = null ...@@ -20,7 +20,7 @@ let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) { 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(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState }) { ...@@ -28,8 +28,9 @@ export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox 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 = 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.$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'] }) 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) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) 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 { export default {
namespaced: true, namespaced: true,
state: {}, state: {},
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-17 15:39:18
* @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: '定保', 9: '售后众筹' }
export default {
namespaced: true,
state: {
subscribe: null,
keywords: null,
GPTList: null,
packageList: {},
process: { 0: false, 1: false, 2: false },
activityInfo: {},
merchantInfo: {},
step: 1
},
mutations: {
SET_INIT(state, data) {
if (data) {
state.keywords = null
state.GPTList = null
state.packageList = {}
state.process = Object.assign({}, { 0: false, 1: false, 2: false })
state.activityInfo = Object.assign({})
}
},
SET_STEP(state, data) {
state.step = data
},
// 设置场景值
SET_SUBSCRIBE(state, data) {
state.subscribe = data
console.log(data, 'data')
},
//设置门店信息
SET_MERCHANT_INFO(state, data) {
state.merchantInfo = Object.assign({}, data)
},
// 设置活动信息
SET_ACTIVITY_INFO(state, data) {
if (data.activityBigImg) {
data.backgroundImage = data.activityBigImg
data.merchantAddress = data.activityAddressDetailName
}
state.activityInfo = Object.assign({}, 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)
},
SET_PROCESS(state, data) {
state.process = Object.assign(state.process, data)
}
},
actions: {
setKeyWords({ commit, state }, data) {
if (state.keywords == data) return
commit('SET_KET_WORDs', data)
if (!data) return
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)
}
})
},
//活动活动详情
getActivityInfo({ commit, state }, data) {
apis.marketing.activityDetail({ id: data }).then(res => {
state.subscribe = res.subscribe
commit('SET_ACTIVITY_INFO', res)
})
},
getTemplateInfo({ state }, data) {
apis.marketing.calendarDetail({ id: data }).then(res => {
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, codeId, couponItemList = [], subTitleStyle, titleStyle } = res || {}
if (couponItemList && couponItemList.length)
couponItemList.forEach(item => {
item.id = item.couponId
})
state.activityInfo = Object.assign({}, { titleStyle, subTitleStyle, codeId, marketingTitle: title, marketingSubtitle: subTitle, backgroundImage: backgroundImg, detailImage: captionImg, couponItemList, activityTime: [startTime + ' 00:00:00', endTime + ' 00:00:00'] })
})
},
//活动模板详情
getCalendarDetail({ commit }, data) {
apis.marketing.calendarDetail({ id: data }).then(res => {
commit('SET_ACTIVITY_INFO', res)
})
},
setPackage({ commit }, data) {
commit('SET_PACKAGE_LIST', data)
},
setProcess({ commit }, data) {
commit('SET_PROCESS', data)
},
getMerchantInfo(conText, payload) {
apis.marketing.findMerchantDetailByMerchantNo(payload).then(res => {
console.log(res, 33333333333)
if (res.data) {
conText.commit('SET_MERCHANT_INFO', res.data)
}
})
},
setSubscribe({ commit, dispatch }, data) {
if (!data) {
commit('SET_SUBSCRIBE', data)
return
}
commit('SET_SUBSCRIBE', data.subscribe ? data.subscribe : data)
dispatch('setKeyWords', data.subscribe ? data.keywords : 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
import { isFunction } from './fns'
export function matchesSelectorToParentElements(el, selector, baseNode) {
let node = el
const matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(func => isFunction(node[func]))
if (!isFunction(node[matchesSelectorFunc])) return false
do {
if (node[matchesSelectorFunc](selector)) return true
if (node === baseNode) return false
node = node.parentNode
} while (node)
return false
}
export function getComputedSize($el) {
const style = window.getComputedStyle($el)
return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]
}
export function addEvent(el, event, handler) {
if (!el) {
return
}
if (el.attachEvent) {
el.attachEvent('on' + event, handler)
} else if (el.addEventListener) {
el.addEventListener(event, handler, true)
} else {
el['on' + event] = handler
}
}
export function removeEvent(el, event, handler) {
if (!el) {
return
}
if (el.detachEvent) {
el.detachEvent('on' + event, handler)
} else if (el.removeEventListener) {
el.removeEventListener(event, handler, true)
} else {
el['on' + event] = null
}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-17 16:07:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-16 15:11:28
* @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 = 3
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, font } = textParams
fontSize = this.toRpx(fontSize)
x = this.toRpx(x)
y = this.toRpx(y)
this.ctx.font = `${bold ? 'bold ' : ''}${fontSize}px ${font}`
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
export function isFunction(func) {
return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'
}
export function snapToGrid(grid, pendingX, pendingY, scale = 1) {
const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale
const x = Math.round(pendingX / scaleX / grid[0]) * grid[0]
const y = Math.round(pendingY / scaleY / grid[1]) * grid[1]
return [x, y]
}
export function getSize(el) {
const rect = el.getBoundingClientRect()
return [parseInt(rect.width), parseInt(rect.height)]
}
export function computeWidth(parentWidth, left, right) {
return parentWidth - left - right
}
export function computeHeight(parentHeight, top, bottom) {
return parentHeight - top - bottom
}
export function restrictToBounds(value, min, max) {
if (min !== null && value < min) {
return min
}
if (max !== null && max < value) {
return max
}
return value
}
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49 * @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-03-16 14:46:00 * @LastEditTime: 2023-07-12 14:23:04
* @FilePath: \live\src\utils\index.js * @FilePath: \live\src\utils\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @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) { export function debounce(func, wait = 200) {
let timeout let timeout
return function(event) { return function(event) {
...@@ -15,7 +17,15 @@ export function debounce(func, wait = 200) { ...@@ -15,7 +17,15 @@ export function debounce(func, wait = 200) {
}, wait) }, 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') { export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime) const date = new Date(dateTime)
const config = { const config = {
...@@ -38,6 +48,13 @@ export function downloadUrl(url) { ...@@ -38,6 +48,13 @@ export function downloadUrl(url) {
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
} }
export function openTab(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
export function GetDateDiff(time1, time2 = new Date()) { export function GetDateDiff(time1, time2 = new Date()) {
let startTime = new Date(time1) //开始时间 let startTime = new Date(time1) //开始时间
let endTime = new Date(time2) //结束时间 let endTime = new Date(time2) //结束时间
......
<!--
* @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-07-12 17:15:00
* @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>
<a class="import-btn" @click="jumpUrl">导入</a>
</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: #d5f5e3;
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: #333333ff;
}
}
.import-btn {
margin-left: auto;
color: #685bff;
cursor: pointer;
}
}
</style>
<template>
<div class="activity-container">
<div class="choseRow">
<div class="choseRow-item">
<div class="choseItem" :class="{ active: step == index + 1 }" v-for="(item, index) in tabList" :key="index" @click="tabClick(index + 1)">{{ item.label }}</div>
</div>
<div @click="showCase" class="show-case-btn" v-if="routerInfo.addOrEdit == 'add'">历史营销方案</div>
</div>
<div class="acitity-content">
<marketing-task v-show="step == 1" v-if="routerInfo.addOrEdit != 'edit'"></marketing-task>
<marketing-gift v-show="step == 2"></marketing-gift>
<marketing-content v-show="step == 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="9"></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>
<el-dialog title="预览" :append-to-body="true" :before-close="handleClose" :visible.sync="dialogVisible" width="30%">
<phone-view v-if="dialogVisible" :activityDetail="activityInfo"></phone-view>
</el-dialog>
</div>
</template>
<script>
import marketingTask from './MarketingTask'
import marketingGift from './MarketingGift'
import marketingContent from './MarketingContent'
import { mapActions, mapState, mapMutations } from 'vuex'
import marketing from '@/mixins/marketing'
import PhoneView from './PhoneView.vue'
export default {
mixins: [marketing],
components: {
marketingTask,
marketingGift,
PhoneView,
marketingContent
},
data() {
return {
dialogVisible: false,
activityInfo: {},
routeInfo: {},
tabList: [{ label: '营销任务' }, { label: '营销礼包' }, { label: '营销内容' }],
caseList: [],
activeName: '5',
caseVisible: false,
// 表格按钮
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) + '元'
}
}
]
}
}
},
mounted() {
if (this.routerInfo.addOrEdit == 'edit') {
this.SET_STEP(2)
this.setProcess({ 0: true })
}
},
computed: {
...mapState('marketing', ['step', 'subscribe'])
},
watch: {
subscribe(val) {
if (val == 9) this.SET_STEP(2)
}
},
methods: {
...mapActions('marketing', ['getActivityInfo', 'setProcess']),
...mapMutations('marketing', ['SET_STEP']),
//数据看板
handleJump(row) {
this.$router.push({
path: '/activityLink/dataBoard',
query: {
activityId: row.id,
activityName: row.activityName
}
})
},
//引用
handleUse(row) {
this.caseVisible = false
this.getActivityInfo(row.id)
},
handleClose() {
this.dialogVisible = false
},
//预览
handleView(row) {
this.$apis.marketing.activityDetail({ id: row.id }).then(res => {
console.log(res)
if (res) {
const selectedCarList = res.serviceMerchantPackageConfigDTOS || []
let activityCoupon = res.activityCouponBaseInfoDTOS || res.couponList || res.couponItemList || []
let selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
let selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
this.dialogVisible = true
this.$nextTick(() => {
this.activityInfo = { ...res, selectedCarList, selectedServiceList, selectedGoodsList }
})
}
})
},
tabClick(index) {
if (index == 1 && (this.routerInfo.addOrEdit == 'edit' || this.subscribe == 9)) {
return
}
this.SET_STEP(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 || []
this.$refs.caseRef.tableTotal = res.total
})
},
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;
margin-bottom: 16px;
.show-case-btn {
cursor: pointer;
position: absolute;
font-size: 14px;
color: #685bff;
right: 10px;
top: 10px;
}
.choseRow-item {
height: 36px;
background: #ffffff;
border: 1px solid rgba(88, 80, 255, 0.51);
border-radius: 4px;
line-height: 36px;
}
.choseItem {
display: inline-block;
cursor: pointer;
margin-right: 1px;
padding: 0 32px;
box-sizing: border-box;
}
.active {
color: #685bff;
background: rgba(104, 91, 255, 0.15);
font-weight: 600;
}
}
</style>
<template>
<div class="marketing-view" v-loading="loading">
<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" @click="handleSave">执行营销方案</div>
</div>
<div class="case-container">
<div class="case-container-title">预览营销方案</div>
<phoneView ref="viewForm"></phoneView>
</div>
</div>
</template>
<script>
const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8]
const FESTIVAL = [9, 10]
import { mapState, mapMutations } from 'vuex'
import phoneView from './PhoneView'
import draw from '@/mixins/draw'
import marketing from '@/mixins/marketing'
export default {
mixins: [draw, marketing],
components: {
phoneView
},
data() {
return {
showPhone: false,
loading: false,
caseList: [
{ label: '请导入营销任务客群', isFinish: true },
{ label: '请配置营销礼包', isFinish: false },
{ label: '请配置营销内容', isFinish: true }
]
}
},
watch: {
process: {
handler(val) {
for (let k in val) {
this.caseList[k].isFinish = val[k] ? true : false
}
},
deep: true,
immediate: true
},
activityInfo: {
handler(val) {
if (this.routerInfo.addOrEdit == 'edit') {
for (let k in this.caseList) {
this.caseList[k].isFinish = true
}
}
},
deep: true,
immediate: true
}
},
methods: {
...mapMutations('marketing', ['SET_INIT']),
init() {
this.SET_INIT(true)
},
//执行营销方案
async handleSave() {
let params = { merchantId: this.$globalState.session.merchantId }
for (let k in this.process) {
if (!this.process[k]) {
this.$message.error(this.caseList[k].label)
return
}
params = { ...params, ...this.process[k] }
}
this.loading = true
const {
backgroundHeight,
detail: { backgroundImage, titleStyle, subTitleStyle },
draggableList
} = this.$refs.viewForm
let url = backgroundImage
if (RENEWAL.includes(params.codeId) && this.routerInfo.addOrEdit != 'edit') {
url = await this.createMain(backgroundHeight, backgroundImage, draggableList) //合并主图、文字
}
if (FESTIVAL.includes(params.codeId) && this.routerInfo.addOrEdit != 'edit') {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
}
let origin = 'createSuperMarketing'
if (params.id && this.routerInfo.addOrEdit == 'edit') {
origin = 'updateApi'
params.activityName = params.marketingTitle
params = { ...params, ...this.addProperties(params) }
params = this.deleteKeys(params, ['activityActionReport', 'couponList', 'superMarketingCouponRelRequestList'])
params.startTime = params.starttime.replace(/\//g, '-')
params.endTime = params.endtime.replace(/\//g, '-')
}
if (params.codeId) delete params.activityDetail
params.subscribe = this.subscribe
params.bigImage = url
this.$apis.marketing[origin](params)
.then(res => {
if (res) {
this.loading = false
this.init()
this.$message.success('操作成功')
if (params.id) this.$router.push('/activityLink/index')
}
})
.finally(() => {
this.loading = false
})
},
//删除对象中的属性
deleteKeys(obj, keys) {
const filteredEntries = Object.entries(obj).filter(([key]) => !keys.includes(key))
return Object.fromEntries(filteredEntries)
},
//添加的属性
addProperties(obj) {
return {
...obj,
marketingType: 5, // 膨胀金
couponCreateRequests: obj.superMarketingCouponRelRequestList
}
}
},
computed: {
...mapState('marketing', ['process', 'subscribe', 'activityInfo'])
}
}
</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="success" plain @click="handleAdd" class="el-icon-plus" v-if="routerInfo.addOrEdit == 'add'">新建营销方案</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="fes-box" v-if="currentIndex == 6">
<div :class="{ 'fes-item': true, checked: selectItem.id == item.id }" v-for="item in festivalList" :key="item.id" @click="selectFes(item)">{{ item.title }}</div>
<div class="fes-waiting">不断更新中……</div>
</div>
<div class="scene-content">
<div class="scene-item" v-for="(item, index) in sceneList" :key="index">
<div class="scene-item-box" v-if="index == 0">
<el-popover placement="top-start" width="200" trigger="hover">
<div class="scene-card">
<div class="scene-card-img">
<img :src="qrCode" />
</div>
<div class="scene-card-content">
请扫码添加小管家,并组群获得支持
</div>
</div>
<div class="scene-item_box" slot="reference">
<div class="scene-item-icon">
<img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" />
</div>
<div class="scene-item-title">
{{ item.title }}
</div>
<div class="scene-item-content">{{ item.content }}</div>
</div>
</el-popover>
</div>
<div class="scene-item-box" v-else @click="handleStep(index)">
<div class="scene-item-icon">
<img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" />
</div>
<div class="scene-item-title">
{{ 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, mapMutations, mapState } from 'vuex'
import marketing from '@/mixins/marketing'
export default {
mixins: [marketing],
data() {
return {
qrCode: '',
tabList: [
{ label: '保险', type: 5 },
{ label: '定保', type: 2 },
{ label: '节日关怀', type: 6 },
{ label: '售后众筹', type: 9 }
],
isShowCard: false,
selectItem: {},
festivalList: [],
currentIndex: 5,
isInit: true,
sceneList: [
{
title: '运营陪跑',
content: '添加运营小管家,组群获得在线支持'
},
{
title: '导入客群',
content: '导入营销客户群体并营销、跟进任务给到指定员工'
},
{
title: '配置营销礼包',
content: '配置客户营销关联的权益、平台福利、门店服务券等'
},
{
title: '配置营销内容',
content: '选定营销配图、活动相关内容'
},
{
title: '营销管理',
content: '按分配对客户进行营销并生成精细化数据反馈'
},
{
title: '营销结果',
content: '随时查看各项营销节点结果数据'
}
]
}
},
mounted() {
this.calendarPage()
this.EntWechatQrCode()
if (this.routerInfo.addOrEdit == 'edit' || this.routerInfo.addOrEdit == 'copy') {
this.getActivityInfo(this.routerInfo.id)
this.sceneList[1].content = '编辑无法再次导入客群'
} else {
this.setSubscribe(this.routerInfo.subscribe)
this.tabList.splice(3, 1)
}
},
computed: {
...mapState('marketing', ['subscribe', 'activityInfo'])
},
watch: {
subscribe(val) {
this.currentIndex = val
},
activityInfo: {
handler(info) {
if (Object.keys(info).length == 0) {
this.selectItem = {}
}
},
deep: true
}
},
beforeDestroy() {
this.setSubscribe(null)
this.SET_STEP(1)
this.handleAdd()
},
methods: {
...mapActions('marketing', ['setSubscribe', 'getActivityInfo', 'getTemplateInfo']),
...mapMutations('marketing', ['SET_INIT', 'SET_STEP', 'SET_ACTIVITY_INFO']),
selectFes(item) {
this.selectItem = item
this.getTemplateInfo(this.selectItem.id)
this.setSubscribe({ subscribe: 6, keywords: this.selectItem.keywords })
},
handleStep(index) {
if (this.routerInfo.addOrEdit == 'edit' && index == 1) return
if ([1, 2, 3].includes(index)) this.SET_STEP(index)
},
handleAdd() {
this.SET_INIT(true)
},
tabClick(index) {
console.log(this.routerInfo.addOrEdit, 'routerInfo.addOrEdit')
if (this.routerInfo.addOrEdit == 'edit') return
this.currentIndex = index
if (index != 6) {
this.setSubscribe(index)
this.SET_ACTIVITY_INFO({})
} else {
this.selectItem = this.festivalList[0]
this.getTemplateInfo(this.selectItem.id)
this.setSubscribe({ subscribe: 6, keywords: this.selectItem.keywords })
}
},
EntWechatQrCode() {
this.$apis.marketing.EntWechatQrCode({}).then(res => {
this.qrCode = res.qrCode
})
},
calendarPage() {
this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1 }).then(res => {
this.festivalList = (res.data || []).filter(item => item.marketingType == 6)
})
}
}
}
</script>
<style lang="scss" scoped>
.scene-card {
width: 158px;
height: 159px;
&-img {
width: 102px;
height: 102px;
margin: 10px auto;
img {
width: 102px;
height: 102px;
}
}
&-content {
font-size: 12px;
color: #666666;
text-align: center;
line-height: 18px;
}
}
.scene-container {
margin-top: 16px;
.scene-content {
background: #fff;
padding: 16px;
display: flex;
position: relative;
.scene-item {
width: 16.7%;
display: flex;
align-items: center;
position: relative;
z-index: 1;
&-box {
z-index: 1;
cursor: pointer;
width: calc(100% - 30px);
height: 0;
padding-bottom: 50%;
padding-bottom: 50%;
background-image: url('../../../assets/marketing/scence-bg.png');
background-size: 100% 100%;
padding-left: 8%;
padding-right: 8%;
.scene-item-icon {
text-align: center;
margin-top: 0.5vw;
img {
width: 1.7vw;
vertical-align: middle;
}
}
.scene-item-title {
text-align: center;
color: #333333;
margin-top: 1%;
font-size: 1.1vw;
font-weight: 700;
transform: scale(0.6);
-webkit-transform-origin-x: 0;
width: 165%;
}
.scene-item-content {
font-size: 1vw;
line-height: 1.2vw;
transform: scale(0.6);
color: #6c6c6c;
-webkit-transform-origin-x: 0;
display: inline-block;
width: 165%;
margin-top: -5px;
}
}
&-next {
margin: 0 8px;
img {
width: 16px;
}
}
}
}
}
.fes-box {
display: flex;
height: 70px;
background: #ffffff;
border-radius: 0 4px 4px 4px;
padding: 20px;
box-sizing: border-box;
.fes-item {
padding: 0px 16px;
background: #f9f9f9;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #666666;
margin-right: 10px;
&.checked {
color: #5850ff;
}
}
.fes-waiting {
font-size: 12px;
color: #666666;
line-height: 30px;
}
}
.choseRow {
margin-top: 10px;
display: flex;
height: auto;
.choseItem {
display: inline-block;
cursor: pointer;
line-height: 40px;
height: 40px;
margin-right: 1px;
padding: 0 32px;
box-sizing: border-box;
background: #e8effa;
}
.active {
color: #fff;
background: #5092ff;
font-weight: 600;
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-06 11:45:15
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-17 18:21:24
* @FilePath: \scrm-micro-link\src\views\activityLink\components\SelectInsure.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<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>
import { mapActions } from 'vuex'
export default {
data() {
return {
merchantId: this.$globalState.session.merchantId,
selectObj: {},
modelList: []
}
},
props: {
modelVisible: {
type: Boolean,
default: false
}
},
methods: {
...mapActions('marketing', ['getCalendarDetail']),
calendarPage() {
this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1, status: 1 }).then(res => {
this.modelList = (res.data || []).filter(item => item.marketingType == 5)
this.selectObj = this.modelList[0]
})
},
handleConfirm() {
this.$confirm('是否覆盖营销礼包的内容?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$emit('handleSure', this.selectObj)
})
.catch(() => {})
},
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>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="angle" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/get.png?v=1.0.2" />
<div class="title">
<span>门店专享服务</span>
<img class="xing " src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/xing_1.png?v=1.0.2" />
</div>
<div class="service-panel">
<div class="service-panel-bg"></div>
<div class="service-panel-box">
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">{{ discount[item.discountType] }}</div>
<div class="service-title">
<span>{{ item.couponName }}</span>
<span>x1</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList || []
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-top: 20px;
.container-panel {
background-image: linear-gradient(180deg, #ff626f 0%, #ff626f00 100%);
box-shadow: inset 0 3px 15px 0 #ffffffbf;
border-radius: 20px;
padding: 4px;
position: relative;
.angle {
position: absolute;
top: -8px;
left: -8px;
width: 60.87px;
height: 60.24px;
}
.title {
font-weight: 700;
font-size: 14px;
color: #ffffff;
padding-left: 30px;
padding-top: 5px;
position: relative;
display: inline-block;
text-shadow: 0 2px 3px #d81033;
font-weight: 700;
.xing {
position: absolute;
top: -5px;
width: 31.99px;
height: 34.89px;
}
}
.service-panel {
position: relative;
z-index: 2;
margin-top: 8px;
&-bg {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
background: rgba($color: #ffffff, $alpha: 0.3);
box-shadow: inset 0 0 18px 0 #ffffff;
border-radius: 20px;
z-index: -1;
}
&-box {
padding: 8px 10px;
}
}
.service-item {
margin-top: 10px;
display: flex;
&:first-child {
margin-top: 0px;
display: flex;
}
.service-title {
flex: 1;
height: 40px;
background: #fcf9ef;
background-image: linear-gradient(-84deg, #fe6a7545 0%, #fcf0ee00 96%);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0px 20px 0px 14px;
border-radius: 0px 8px 8px 0px;
font-size: 14px;
color: #5a3c36;
text {
font-size: 14px;
color: #5a3c36;
}
}
.service-time {
width: 40px;
// height: 40px;
padding: 2px 14px;
box-sizing: border-box;
background-image: linear-gradient(180deg, #ede7fa 0%, #b498ff 100%);
font-size: 10px;
color: #04005d;
position: relative;
border-radius: 8px 0px 0px 8px;
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="angle" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/rob.png?v=1.0.2" />
<div class="title">用车权益</div>
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-title">{{ item.packageName }}</div>
<div class="service-time">
{{ item.packageAmount }}
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList || []
console.log(serviceList)
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-bottom: 20px;
.container-panel {
background: #ffffff;
background-image: linear-gradient(90deg, #ffa4a4 0%, #f5dea2c7 27%, #ffc8d9 75%, #fe9ca400 100%);
box-shadow: inset 0 4px 54px 0 #ffffff;
border-radius: 16px;
padding: 8px 15px;
position: relative;
.angle {
position: absolute;
top: -8px;
left: -8px;
width: 60.87px;
height: 60.24px;
}
.title {
font-weight: 700;
font-size: 14px;
color: #ffffff;
text-shadow: 0 2px 3px #f37b87;
padding-left: 15px;
}
.service-item {
height: 32px;
background: #fefdf8;
background-image: linear-gradient(-84deg, #fdeef7 0%, #f6ffee 53%, #ffffff 96%);
border-radius: 8px;
margin-top: 8px;
padding: 0px 12px;
display: flex;
align-items: center;
&:first-child {
margin-top: 0px;
}
.service-title {
flex: 1;
font-size: 12px;
color: #5a3c36;
line-height: 40px;
}
.service-time {
color: #8e5310;
text-align: center;
font-size: 16px;
color: #ff5c67;
span {
font-size: 10px;
line-height: 40px;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="angle" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/deliver.png?v=1.0.2" />
<div class="title">
<span>超爽生活权益</span>
<img class="xing " src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/xing_2.png?v=1.0.2" />
</div>
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-logo">
<img :src="item.goodsImage || $vip" alt="" />
</div>
<div class="service-desc">
<div class="service-title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="service-content">x1 抵扣券</div>
</div>
<div class="service-price">
{{ item.price }}
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-top: 20px;
.container-panel {
background-image: linear-gradient(180deg, #efb94f 0%, #f8d87d00 100%);
box-shadow: inset 0 3px 15px 0 #ffffffbf;
border-radius: 16px;
padding: 4px;
position: relative;
.angle {
position: absolute;
top: -8px;
left: -8px;
width: 60.87px;
height: 60.24px;
}
.title {
font-weight: 700;
font-size: 14px;
color: #ffffff;
text-shadow: 0 2px 3px #d89410;
padding-left: 28px;
padding-top: 5px;
position: relative;
display: inline-block;
.xing {
position: absolute;
top: -5px;
width: 31.99px;
height: 34.89px;
}
}
.service-item {
display: flex;
height: 40px;
align-items: center;
background: #fcf9ef;
background-image: linear-gradient(-83deg, #fe6a7545 0%, #fcf0ee00 96%);
border-radius: 8px;
margin-top: 10px;
padding: 8px;
box-sizing: border-box;
&:last-child {
margin-bottom: 0px;
}
.service-logo {
width: 24px;
height: 24px;
margin-right: 10px;
img {
width: 24px;
height: 24px;
}
}
.service-desc {
.service-title {
font-size: 12px;
color: #5a3c36;
}
.service-content {
margin-top: 3px;
font-size: 10px;
color: #e16578;
}
}
.service-price {
margin-left: auto;
font-size: 12px;
color: #ff5c67;
font-weight: 700;
span {
font-size: 10px;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/get.png?v=1.0.2" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">{{ discount[item.discountType] }}</div>
<div class="service-title">
<div class="service-couponName">{{ item.couponName }}</div>
<div class="service-amount">x1</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList || []
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 10px;
.container-panel {
background: #ffffff;
border-radius: 6px;
padding: 10px 5px 8px;
position: relative;
.header-panel {
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
width: 146.5px;
height: 26px;
}
.service-item {
margin-top: 10px;
display: flex;
height: 33px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/get_b.png');
background-size: 100% 100%;
border-radius: 4px;
align-items: center;
&:first-child {
margin-top: 0px;
}
.service-title {
flex: 1;
display: flex;
border-radius: 0px 4px 8px 0px;
.service-couponName {
font-size: 10px;
color: #5a3c36;
margin-left: 25px;
}
.service-amount {
font-size: 10px;
color: #5a3c36;
margin-left: auto;
margin-right: 10px;
}
}
.service-time {
box-sizing: border-box;
font-size: 10px;
color: #763510;
line-height: 11px;
position: relative;
border-radius: 50%;
margin-left: 8px;
white-space: nowrap;
}
}
}
}
</style>
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-08 09:40:43
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-14 16:06:09
* @FilePath: \scrm-micro-link\src\views\activityLink\components\model\model_2\equity\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/rob.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-title">{{ item.packageName }}</div>
<div class="service-time">
{{ item.packageAmount }}
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList || []
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 8px;
margin-bottom: 21px;
.container-panel {
background: #ffffff;
border-radius: 4px;
padding: 20px 5px 8px;
position: relative;
.header-panel {
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
width: 146.5px;
height: 26px;
}
.service-item {
height: 30px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/rob_b.png');
background-size: 100% 100%;
border-radius: 4px;
margin-bottom: 8px;
display: flex;
align-items: center;
padding: 0px 18.5px 0px 8px;
&:first-child {
margin-top: 0px;
}
.service-title {
flex: 1;
font-size: 10px;
color: #5a3c36;
}
.service-time {
text-align: center;
font-size: 13px;
color: #fe455d;
span {
font-size: 10px;
color: #fe455d;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/delivery.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-logo">
<img :src="item.goodsImage || $vip" alt="" />
</div>
<div class="service-desc">
<div class="service-title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="service-content">x1 抵扣券</div>
</div>
<div class="service-price">
{{ item.price }}
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 10px;
margin-bottom: 21px;
.container-panel {
background: #ffffff;
border-radius: 12px;
padding: 20px 5px 8px;
position: relative;
.header-panel {
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
width: 126.5px;
height: 26px;
}
.service-item {
display: flex;
height: 32.5px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/deliver_b.png');
background-size: 100% 100%;
margin-bottom: 8px;
align-items: center;
&:last-child {
margin-bottom: 0px;
}
.service-logo {
width: 28px;
height: 28px;
margin-right: 8px;
img {
width: 28px;
height: 28px;
}
}
.service-desc {
.service-title {
font-size: 10px;
color: #5a3c36;
}
.service-content {
margin-top: 3px;
font-size: 10px;
color: #e16578;
}
}
.service-price {
margin-left: auto;
margin-right: 8px;
font-size: 10px;
color: #ff5c67;
font-weight: 700;
white-space: nowrap;
span {
font-size: 10px;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<div class="service-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/get.png" />
<div class="service-body-bg"></div>
<div class="service-panel-bg"></div>
<div class="service-panel-box">
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">{{ discount[item.discountType] }}</div>
<div class="service-title">
<div class="service-couponName">{{ item.couponName }}</div>
<div class="service-amount">x1 {{ discount[item.discountType] }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-top: 10px;
.container-panel {
padding: 4px;
position: relative;
.service-panel {
position: relative;
z-index: 2;
padding: 0px 5px;
.service-body-bg {
position: absolute;
height: calc(100% - 20px);
width: calc(100% - 5px);
left: 2px;
top: 25px;
z-index: -1;
border-radius: 0px 0px 12px 12px;
background-image: linear-gradient(180deg, #ec5cb2 2%, #ec5cb2 40%, #ed76c9 67%, #ffcf8600 100%);
}
.header-panel {
position: absolute;
width: 249px;
height: 121px;
top: -58px;
left: -6px;
z-index: -4;
}
&-bg {
position: absolute;
width: calc(100% - 20px);
height: calc(100% - 5px);
box-sizing: border-box;
background: rgba($color: #ffffff, $alpha: 0.3);
box-shadow: inset 0 0 18px 0 #ffffff;
border-radius: 20px;
z-index: -1;
}
&-box {
padding: 12px 13px;
}
}
.service-item {
margin-top: 5px;
display: flex;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/get_b.png');
background-size: 100% 100%;
&:first-child {
margin-top: 0px;
display: flex;
}
.service-title {
flex: 1;
margin-left: 20px;
.service-couponName {
font-size: 12px;
margin-top: 14px;
color: #111111;
}
.service-amount {
font-size: 11px;
color: #878e99;
}
}
.service-time {
width: 45px;
padding: 4px 14px;
box-sizing: border-box;
font-size: 12px;
color: #ffffff;
line-height: 14px;
transform: scale(0.9);
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<div class="service-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/rob.png" />
<div class="service-body-bg"></div>
<div class="service-panel-bg"></div>
<div class="service-panel-box">
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">
1
<span>元</span>
</div>
<div class="service-title">{{ item.packageName }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-bottom: 44px;
.container-panel {
padding: 4px;
position: relative;
.service-panel {
position: relative;
z-index: 2;
padding: 0px 5px;
.service-body-bg {
position: absolute;
height: calc(100% - 20px);
width: calc(100% - 15px);
left: 2.5px;
top: 25px;
z-index: -1;
border-radius: 0px 0px 12px 12px;
background-image: linear-gradient(180deg, #ff5a52 0%, #fe7141 34%, #fe912f 66%, #ffe6ab00 100%);
}
.header-panel {
position: absolute;
width: 249px;
height: 121px;
top: -58px;
left: -6px;
z-index: -4;
}
&-bg {
position: absolute;
width: calc(100% - 12px);
height: calc(100% - 5px);
box-sizing: border-box;
background: rgba(255, 255, 255, 0.3);
box-shadow: inset 0 0 18px 0 #ffffff;
border-radius: 20px;
z-index: -1;
}
&-box {
padding: 15px 13px;
}
}
.service-item {
display: flex;
height: 40px;
align-items: center;
background-image: url(https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/rob_b.png);
background-size: 102% 99%;
margin-top: 10px;
display: flex;
align-items: center;
}
}
&:first-child {
margin-top: 0px;
}
.service-title {
flex: 1;
font-size: 12px;
color: #5a3c36;
margin-left: 25px;
}
.service-time {
font-size: 14px;
color: #999896;
width: 40px;
text-align: center;
span {
font-size: 12px;
color: #8e5310;
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<div class="service-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/deliver.png" />
<div class="service-body-bg"></div>
<div class="service-panel-bg"></div>
<div class="service-panel-box">
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-logo">
<img :src="item.goodsImage || $vip" alt="" />
</div>
<div class="service-desc">
<div class="service-title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="service-content">x1 抵扣券</div>
</div>
<div class="service-price">
{{ item.price }}
<span>元</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
console.log(item.price, price, item)
})
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
margin-bottom: 35px;
.container-panel {
padding: 4px;
position: relative;
.service-panel {
position: relative;
z-index: 2;
padding: 0px 5px;
.service-body-bg {
position: absolute;
height: calc(100% - 20px);
width: calc(100% - 5px);
left: 2px;
top: 25px;
z-index: -1;
border-radius: 0px 0px 12px 12px;
background-image: linear-gradient(180deg, #ec5cb2 2%, #ec5cb2 40%, #ed76c9 67%, #ffcf8600 100%);
}
.header-panel {
position: absolute;
width: 249px;
height: 121px;
top: -58px;
left: -6px;
z-index: -4;
}
&-bg {
position: absolute;
width: calc(100% - 20px);
height: calc(100% - 5px);
box-sizing: border-box;
background: rgba($color: #ffffff, $alpha: 0.3);
box-shadow: inset 0 0 18px 0 #ffffff;
border-radius: 20px;
z-index: -1;
}
&-box {
padding: 12px 13px;
}
}
.service-item {
display: flex;
height: 32px;
align-items: center;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_5/delivery_b.png');
background-size: 100% 100%;
border-radius: 10px;
margin-bottom: 5px;
padding: 22px 0px 21px 11px;
box-sizing: border-box;
&:last-child {
margin-bottom: 0px;
}
.service-logo {
width: 25px;
height: 25px;
margin-right: 6px;
img {
width: 25px;
height: 25px;
}
}
.service-desc {
flex: 1;
.service-title {
font-size: 12px;
color: #111111;
}
.service-content {
margin-top: 3px;
font-size: 11px;
color: #878e99;
}
}
.service-price {
margin-left: auto;
width: 50px;
text-align: center;
font-size: 15px;
color: #ff5c67;
font-weight: 700;
white-space: nowrap;
span {
font-size: 12px;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/get.png?v=1.0.2" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">{{ discount[item.discountType] }}</div>
<div class="service-title">
<div class="service-couponName">{{ item.couponName }}</div>
<div class="service-amount">x1</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 5px;
.container-panel {
background: #ffffff;
border-radius: 12px;
padding: 15px 14px 8px;
position: relative;
.header-panel {
position: absolute;
top: -18.5px;
left: 50%;
transform: translateX(-50%);
width: 160px;
height: 36px;
}
.service-item {
margin-top: 5px;
display: flex;
height: 40px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/get_b.png');
background-size: 100% 100%;
border-radius: 6px;
&:first-child {
margin-top: 0px;
display: flex;
}
.service-title {
flex: 1;
height: 55px;
padding: 0px 27px 0px 14px;
border-radius: 0px 8px 8px 0px;
.service-couponName {
font-size: 10px;
margin-top: 10px;
color: #111111;
}
.service-amount {
font-size: 10px;
color: #878e99;
}
}
.service-time {
width: 50px;
height: 35px;
padding: 2px 30px;
box-sizing: border-box;
font-size: 10px;
color: #fe455d;
line-height: 12px;
position: relative;
transform: scale(0.8);
// &::before {
// content: '';
// position: absolute;
// top: 10px;
// left: 33px;
// color: #fe455d;
// background: #fe455d;
// width: 3px;
// height: 3px;
// border-radius: 50%;
// }
// &::after {
// content: '';
// position: absolute;
// bottom: 3px;
// left: 33px;
// color: #fe455d;
// background: #fe455d;
// width: 3px;
// height: 3px;
// border-radius: 50%;
// }
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList && serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/rob.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-time">
1
<sapn>元</sapn>
</div>
<div class="service-title">{{ item.packageName }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 5px;
margin-bottom: 21px;
.container-panel {
background: #ffffff;
border-radius: 12px;
padding: 28px 14px 8px;
position: relative;
.header-panel {
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
width: 160px;
height: 36px;
}
.service-item {
height: 40px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/rob_b.png');
background-size: 100% 100%;
border: 1px solid #ffffff;
box-shadow: inset 0 1px 0 0 #bcbebf;
border-radius: 6px;
margin-bottom: 8px;
display: flex;
align-items: center;
&:first-child {
margin-top: 0px;
}
.service-title {
flex: 1;
font-size: 12px;
color: #5a3c36;
}
.service-time {
text-align: center;
font-size: 14px;
color: #fe455d;
width: 63px;
span {
font-size: 10px;
color: #fe455d;
}
}
}
}
}
</style>
<template>
<div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/deliver.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-logo">
<img :src="item.goodsImage || $vip" alt="" />
</div>
<div class="service-desc">
<div class="service-title ellipsis-1">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="service-content">x1 抵扣券</div>
</div>
<div class="service-price">
{{ item.price }}
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
discount: {
2: '折扣券',
3: '代金券',
4: '兑换券',
7: '服务券'
},
serviceList: []
}
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(n) {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
},
deep: true,
immediate: true
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 0px 5px;
margin-bottom: 21px;
.container-panel {
background: #ffffff;
border-radius: 12px;
padding: 28px 14px 8px;
position: relative;
.header-panel {
position: absolute;
top: -18.5px;
left: 50%;
transform: translateX(-50%);
width: 160px;
height: 36px;
}
.service-item {
display: flex;
height: 40px;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/deliver-b.png');
background-size: 100% 100%;
margin-bottom: 8px;
align-items: center;
&:last-child {
margin-bottom: 0px;
}
.service-logo {
width: 20px;
height: 20px;
margin-right: 8px;
img {
width: 20px;
height: 20px;
}
}
.service-desc {
.service-title {
font-size: 12px;
color: #111111;
}
.service-content {
margin-top: 3px;
font-size: 10px;
color: #878e99;
}
}
.service-price {
margin-left: auto;
margin-right: 16px;
font-size: 12px;
color: #ff5c67;
font-weight: 700;
white-space: nowrap;
span {
font-size: 10px;
}
}
}
}
}
</style>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<img class="server-type" :src="require(`@/assets/coupon/equity.png`)" /> <img class="server-type" :src="require(`@/assets/coupon/equity.png`)" />
<div class="gift-content"> <div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in selectedEquityList" :key="subIndex"> <div class="gift-item" v-for="(subItem, subIndex) in selectedEquityList" :key="subIndex">
<p :class="['gift-coupon-name']">{{ subItem.packageName }}</p> <p :class="['gift-coupon-name']">{{ subitem && subitem.packageName }}</p>
<i class="el-icon-delete" style="color: #c6c6c6" @click="handleEquityDelete(subIndex)"></i> <i class="el-icon-delete" style="color: #c6c6c6" @click="handleEquityDelete(subIndex)"></i>
</div> </div>
</div> </div>
...@@ -745,6 +745,10 @@ export default { ...@@ -745,6 +745,10 @@ export default {
{ {
optionId: 3, optionId: 3,
optionLabel: '次新车转化' optionLabel: '次新车转化'
},
{
optionId: 9,
optionLabel: '售后众筹'
} }
], ],
optionId: 'optionId', optionId: 'optionId',
...@@ -1343,7 +1347,7 @@ export default { ...@@ -1343,7 +1347,7 @@ export default {
} }
}, },
'editForm.pageStyle'(val) { 'editForm.pageStyle'(val) {
console.log(val) if (val) return
this.activityModelImg = `${this.staticImgUrl}activity-${val}.png` this.activityModelImg = `${this.staticImgUrl}activity-${val}.png`
}, },
step() { step() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="gift-detail flex-wrap"> <div class="gift-detail flex-wrap">
<div class="gift-item" v-for="(item, index) in filterCouponList(scope.scope.couponList)" :key="index"> <div class="gift-item" v-for="(item, index) in filterCouponList(scope.scope.couponList)" :key="index">
<img :src="require(`@/assets/coupon/icon-${attrToIcon[item.discountType]}.png`)" /> <img :src="require(`@/assets/coupon/icon-${attrToIcon[item.discountType]}.png`)" />
<p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × {{ item.couponAmount }}</p> <p :class="['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']">{{ item.couponName }} × 1</p>
<p v-show="item.status == '3'" class="gift-tips">已失效</p> <p v-show="item.status == '3'" class="gift-tips">已失效</p>
</div> </div>
</div> </div>
...@@ -33,14 +33,30 @@ ...@@ -33,14 +33,30 @@
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<GLDialog class="qr-dialog" title="活动分享" mode="mid" okText="下载" :visible.sync="isQrcodeVisible" @onOk="handleCancelConfirm" @onCancel="isQrcodeVisible = false"> <GLDialog class="qr-dialog" :title="isLink ? '活动链接' : '活动分享'" mode="mid" :hasFooter="!isLink" okText="下载" :visible.sync="isQrcodeVisible" @onOk="handleCancelConfirm" @onCancel="isQrcodeVisible = false">
<div class="qrcode-body"> <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(linkInfo[item.name])">保存图片</el-button></div>
</div>
<div class="link-item-r"><el-image :src="linkInfo[item.name]" 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">{{ linkInfo[item.name] }}</div>
<div class="link-clone"><el-button :size="size" type="primary" @click="cloneText(linkInfo[item.name])">复制链接</el-button></div>
</div>
</div>
<div class="qrcode-body" v-else>
<div class="img" v-loading="imgLoading"> <div class="img" v-loading="imgLoading">
<el-image :src="qrCodeUrl" alt=""></el-image> <el-image :src="linkInfo.qrCodeUrl" alt=""></el-image>
</div> </div>
<div class="qrcode-link m-t-10"> <div class="qrcode-link m-t-10">
活动链接:{{ linkUrl }} 活动链接:{{ linkInfo.linkUrl }}
<span @click="handleSaveTxt(linkUrl)">复制</span> <span @click="handleSaveTxt(linkInfo.linkUrl)">复制</span>
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
...@@ -50,18 +66,28 @@ ...@@ -50,18 +66,28 @@
</template> </template>
<script> <script>
import { orderStatus, businessType, subscribe, downloadIamge } from '@/common/constant' import { orderStatus, businessType, subscribe, downloadIamge } from '@/common/constant'
import { cloneText } from '@/utils/index'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
export default { export default {
name: 'LiveIndex', name: 'LiveIndex',
data() { data() {
return { return {
orderStatus, orderStatus,
linkInfo: {},
attrToIcon: { attrToIcon: {
2: 'discount', 2: 'discount',
3: 'cash', 3: 'cash',
4: 'exchange', 4: 'exchange',
7: 'service' 7: 'service'
}, },
linkCode: [
{ title: '活动二维码', name: 'qrCodeUrl' },
{ title: '注册二维码', name: 'staffLoginQrCodeUrl' }
],
linkValue: [
{ title: '注册链接', name: 'staffLoginLinkUrl' },
{ title: '活动链接', name: 'linkUrl' }
],
qrCodeUrl: '', qrCodeUrl: '',
linkUrl: '', linkUrl: '',
dialogVisibleDel: false, dialogVisibleDel: false,
...@@ -133,14 +159,16 @@ export default { ...@@ -133,14 +159,16 @@ export default {
}, },
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName' prop: 'merchantName',
width: 200
}, },
{ {
label: '场景选择', label: '场景选择',
prop: 'subscribe', prop: 'subscribe',
formatter: cellValue => { formatter: cellValue => {
return subscribe.find(item => item.optionId == cellValue.subscribe)?.optionLabel return subscribe.find(item => item.optionId == cellValue.subscribe)?.optionLabel
} },
width: 120
}, },
{ {
label: '销量', label: '销量',
...@@ -151,7 +179,8 @@ export default { ...@@ -151,7 +179,8 @@ export default {
prop: 'activityPrice', prop: 'activityPrice',
formatter: cellValue => { formatter: cellValue => {
return cellValue.activityPrice / 100 return cellValue.activityPrice / 100
} },
width: 100
}, },
{ {
label: '库存', label: '库存',
...@@ -232,7 +261,7 @@ export default { ...@@ -232,7 +261,7 @@ export default {
// return row.status == 2 || row.status == 0 // return row.status == 2 || row.status == 0
// }, // },
listeners: { listeners: {
click: row => this.shareQrcode(row) click: row => this.shareQrcode(row, false)
} }
}, },
{ {
...@@ -258,6 +287,18 @@ export default { ...@@ -258,6 +287,18 @@ export default {
this.handleBoard(row) this.handleBoard(row)
} }
} }
},
{
type: 'el-button',
name: '活动链接',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.shareQrcode(row, true)
}
}
} }
], ],
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
...@@ -330,12 +371,12 @@ export default { ...@@ -330,12 +371,12 @@ export default {
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
shareQrcode(row) { shareQrcode(row, status) {
this.isQrcodeVisible = true this.isQrcodeVisible = true
this.isLink = status
this.$apis.activity.getShared({ id: row.id }).then(res => { this.$apis.activity.getShared({ id: row.id }).then(res => {
if (res) { if (res) {
this.linkUrl = res.linkUrl this.linkInfo = res
this.qrCodeUrl = res.qrCodeUrl
} }
}) })
}, },
...@@ -379,8 +420,9 @@ export default { ...@@ -379,8 +420,9 @@ export default {
params.id = row.id params.id = row.id
params.activityStatus = row.activityStatus params.activityStatus = row.activityStatus
} }
let path = this.loginpath ? '/activityLink/editActivity' : '/activityLink/marketingActivity'
this.$router.push({ this.$router.push({
path: `/activityLink/editActivity`, path,
query: params query: params
}) })
}, },
...@@ -431,9 +473,15 @@ export default { ...@@ -431,9 +473,15 @@ export default {
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun() this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun()
}, },
handleCancelConfirm() { handleCancelConfirm() {
downloadIamge(this.qrCodeUrl) this.downloadIamge(this.qrCodeUrl)
this.isQrcodeVisible = false this.isQrcodeVisible = false
}, },
downloadIamge(url) {
downloadIamge(url)
},
cloneText(text) {
cloneText(text)
},
handleSearch() { handleSearch() {
this.$refs.classifyRef.refreshTable() this.$refs.classifyRef.refreshTable()
}, },
...@@ -508,6 +556,49 @@ export default { ...@@ -508,6 +556,49 @@ export default {
} }
.qr-dialog { .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 { /deep/.el-dialog__body {
// padding: 20px; // padding: 20px;
.el-scrollbar__wrap { .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'
import { mapActions, mapMutations } from 'vuex'
export default {
components: {
importCustom,
scene,
marketing,
process
},
methods: {
...mapMutations('marketing', ['SET_STATUS']),
...mapActions('marketing', ['getMerchantInfo'])
},
mounted() {
this.getMerchantInfo({ merchantId: this.$globalState.session.merchantId })
this.SET_STATUS(this.$route.query.addOrEdit)
}
}
</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!