Commit a637768c by 杨明

fixed

1 parent cbaf032f
......@@ -2,7 +2,7 @@
* @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
* @LastEditTime: 2023-07-20 10:46:23
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -32,12 +32,12 @@ export default {
async createBig(info, logoInfo, titleStyle, subTitleStyle) {
console.log(info)
this.loading = true
const { backgroundImage, detailImage, merchantLog, marketingTitle, marketingSubtitle } = info
const { backgroundImage, detailImage, merchantLogo, marketingTitle, marketingSubtitle } = info
if (!backgroundImage) return
try {
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLog)])
const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLogo)])
const h = (res[0].dh / res[0].dw) * WIDTH + (res[1].dh / res[1].dw) * WIDTH
this.logoInfo = { url: merchantLog, ...logoInfo }
this.logoInfo = { url: merchantLogo, ...logoInfo }
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
height: h
......@@ -104,22 +104,34 @@ export default {
console.log(e)
}
},
async createMain(h, url, draggableList) {
async createMain(info, draggableList) {
const style1 = draggableList[0]
const style2 = draggableList[1]
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
height: h
height: info.backgroundHeight + info.detailHeight
})
const imageList = [
{
url,
url: info.backgroundImage,
x: 0,
y: 0,
width: WIDTH,
height: h
height: info.backgroundHeight
}
]
if (info.detailImage) {
imageList.push({
url: info.detailImage,
x: 0,
y: info.backgroundHeight,
width: WIDTH,
height: info.detailHeight
})
}
if (info.merchantLogo) {
imageList.push({ ...info.logoInfo, url: info.merchantLogo })
}
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 }
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-13 09:23:57
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 20:56:07
* @LastEditTime: 2023-07-19 17:32:17
* @FilePath: \scrm-micro-link\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -20,13 +20,14 @@ let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState }) {
const { response, request, sign, secret, sign_common, request_common, request_gpt, request_merchant } = await fetchConfig(common)
const { response, request, sign, secret, sign_common, request_common, request_gpt, request_merchant, messageModel } = await fetchConfig(common)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$messageModel = messageModel
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 } })
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-18 15:17:25
* @LastEditTime: 2023-07-20 10:07:34
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -46,10 +46,6 @@ export default {
},
// 设置活动信息
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) {
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 21:24:27
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-18 23:51:09
* @LastEditTime: 2023-07-20 13:35:26
* @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -13,7 +13,7 @@
<el-button :size="size" icon="el-icon-plus" @click="modelVisible = true">选择模板</el-button>
</div>
<div slot="marketingTitle" class="input-slot">
<el-input placeholder="请输入营销主题" v-model="editForm.marketingTitle" style="width:400px" maxlength="12" show-word-limit></el-input>
<el-input placeholder="请输入营销主题" v-model="editForm.marketingTitle" style="width:400px" maxlength="10" show-word-limit></el-input>
<label @click="getGPTitle(1)" v-if="GPTList">ChatGPT重新生成</label>
<label v-else class="disabled-label">ChatGPT重新生成</label>
</div>
......@@ -58,7 +58,7 @@ export default {
activityTime: [],
backgroundImage: '',
detailImage: '',
merchantLog: ''
merchantLogo: ''
},
editFormData: [
{
......@@ -71,7 +71,7 @@ export default {
name: 'marketingTitle',
addHtml: 'marketingTitle',
type: 'input',
maxlength: 12
maxlength: 10
},
{
label: '营销副标题',
......@@ -165,14 +165,14 @@ export default {
},
{
label: '门店Logo',
name: 'merchantLog',
name: 'merchantLogo',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大1M,尺寸216*60',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'merchantLog',
suffixSlot: 'merchantLogo',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -278,7 +278,7 @@ export default {
activityTime: [],
backgroundImage: '',
detailImage: '',
merchantLog: '',
merchantLogo: '',
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress
}
......@@ -300,13 +300,16 @@ export default {
return
}
console.log(888)
this.editForm = Object.assign({ merchantLog: '' }, info)
this.editForm = Object.assign({ merchantLogo: '' }, info)
if (info.activityName) {
this.$set(this.editForm, 'marketingTitle', info.activityName)
}
if (info.subTitle) {
this.$set(this.editForm, 'marketingSubtitle', info.subTitle)
}
this.editForm.backgroundImage = info.mainImage || info.activityBigImg
this.editForm.merchantAddress = info.activityAddressDetailName
if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')])
}
......@@ -326,7 +329,7 @@ export default {
...info,
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress,
merchantLog: '',
merchantLogo: '',
mainColor: ''
}
console.log(this.editForm, 9)
......@@ -343,6 +346,7 @@ export default {
param.starttime = d[0]
param.endtime = d[1]
}
param.mainImage = param.backgroundImage
delete param.createdTime
delete param.activityPrice
delete param.giftId
......
......@@ -117,7 +117,7 @@
</el-select>
</el-form-item>
<el-form-item label="营销短信:" :size="size">
<el-input v-model="configForm.messageContent" type="textarea" :disabled="true"></el-input>
<el-input v-model="configForm.messageContent" type="textarea" :disabled="true" rows="3"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -126,10 +126,6 @@
</template>
<script>
const config = Object.freeze({
talkId: '',
messageContent: '【广汇汽车】诚邀您参与{0},请尽快点击链接参与,谨防错过哦! {1} 谨防错过退订回T。'
})
const taskData = { tableData: [], expand: true, assignType: 0, customerNumTotal: 0, lastFollowStaffList: [], staffList: [], excelUrl: '', isFinish: false }
import { mapActions, mapState, mapMutations } from 'vuex'
export default {
......@@ -146,7 +142,14 @@ export default {
},
isQrcodeVisible: false,
configVisible: false,
configForm: config,
config: {
talkId: '',
messageContent: this.$messageModel
},
configForm: {
talkId: '',
messageContent: this.$messageModel
},
tableData: [],
roobList: []
}
......@@ -295,8 +298,8 @@ export default {
this.roobList = res.list || []
this.$nextTick(() => {
this.configForm = {
talkId: row.row.talkId ? row.row.talkId : config.talkId,
messageContent: row.row.messageContent ? row.row.messageContent : config.messageContent
talkId: row.row.talkId ? row.row.talkId : this.config.talkId,
messageContent: row.row.messageContent ? row.row.messageContent : this.config.messageContent
}
})
})
......@@ -356,7 +359,7 @@ export default {
merchantId: i.merchantNo,
staffPhone: i.staffPhone,
staffName: i.staffName,
messageContent: i.messageContent ? i.messageContent.replace(/广汇汽车/, this.$globalState.session.merchantName) : '',
messageContent: i.messageContent ? i.messageContent.replace(/^【\S+?】/, `【${this.$globalState.session.merchantName}】`) : '',
registerStatus: i.registerStatus,
talkId: i.talkId,
createdBy: i.createdBy
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-17 17:47:36
* @LastEditTime: 2023-07-20 11:46:14
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -13,34 +13,42 @@
<img src="@/assets/seckillActivity/phone.png" class="review-phone" />
<div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div>
<div class="review-content">
<div class="review-main" v-if="backgroundHeight" :style="{ height: backgroundHeight + 'px' }">
<template v-for="item in draggableList">
<vue-draggable-resizable
:customId="item.customId"
:key="item.customId"
v-if="item.type == 'text'"
:w="item.width"
:h="item.height"
:x="item.x"
:y="item.y"
:style="{
'font-size': item.size + 'px',
'font-family': item.font,
color: item.color
}"
class="img_cl"
parent=".review-main"
@dragging="onDrag"
@resizing="onResize"
@activated="onActivated"
>
{{ item.content }}
</vue-draggable-resizable>
</template>
<div class="review-bg-img">
<img :src="detail.backgroundImage" v-if="detail.backgroundImage" />
<template v-if="backgroundHeight">
<div class="review-main" :style="{ height: backgroundHeight + 'px' }">
<template v-for="item in draggableList">
<vue-draggable-resizable
:customId="item.customId"
:key="item.customId"
v-if="item.type == 'text'"
:w="item.width"
:h="item.height"
:x="item.x"
:y="item.y"
:style="{
'font-size': item.size + 'px',
'font-family': item.font,
color: item.color
}"
class="img_cl"
parent=".review-main"
@dragging="onDrag"
@resizing="onResize"
@activated="onActivated"
>
{{ item.content }}
</vue-draggable-resizable>
</template>
<div class="review-bg-img">
<img :src="detail.backgroundImage || detail.mainImage" v-if="detail.backgroundImage || detail.mainImage" />
</div>
<div class="review-logo-img" :style="{ height: logoInfo.height + 'px', width: logoInfo.width + 'px', top: logoInfo.y + 'px', left: logoInfo.x + 'px' }">
<img :src="detail.merchantLogo" v-if="detail.merchantLogo" />
</div>
</div>
</div>
<div class="review-main-img">
<img :src="detail.detailImage" v-if="detail.detailImage" />
</div>
</template>
<div class="review-main" v-else>
<div class="review-bg-img">
<img :src="detail.activityBigImg" v-if="detail.activityBigImg" />
......@@ -128,7 +136,7 @@
<img :src="detail.detailImage" v-if="detail.detailImage" />
</div>
<div class="review-logo-img" :style="{ height: logoInfo.height + 'px', width: logoInfo.width + 'px', top: logoInfo.y + 'px', left: logoInfo.x + 'px' }">
<img :src="detail.merchantLog" v-if="detail.merchantLog" />
<img :src="detail.merchantLogo" v-if="detail.merchantLogo" />
</div>
</template>
</div>
......@@ -306,6 +314,7 @@ export default {
data() {
return {
backgroundHeight: 0,
detailHeight: 0,
logoHeight: 0,
currentIndex: 0,
isFestival: false,
......@@ -404,7 +413,9 @@ export default {
handler(val) {
const info = this.$common.utils.deepClone(val)
if (this.routerInfo.addOrEdit == 'edit') {
this.showActivity(info)
info.marketingTitle = info.activityName
info.marketingSubtitle = info.subTitle
this.validActivity(info)
}
},
deep: true,
......@@ -412,6 +423,7 @@ export default {
},
process: {
handler(val) {
this.detailHeight = 0
const detail = { ...this.detail, ...val[2] }
detail.activityPrice = val[1].activityPrice
if (this.routerInfo.addOrEdit == 'edit') {
......@@ -449,7 +461,8 @@ export default {
if (RENEWAL.includes(this.detail.codeId)) {
this.modelNum = this.detail.codeId
this.isRenewal = true
this.backgroundHeight = await this.getImgH(this.detail.backgroundImage)
this.backgroundHeight = await this.getImgH(this.detail.backgroundImage || this.detail.mainImage)
if (this.detail.detailImage) this.detailHeight = await this.getImgH(this.detail.detailImage)
const style1 = JSON.parse(this.detail.titleStyle)
const style2 = JSON.parse(this.detail.subTitleStyle)
const styles = [style1, style2]
......@@ -459,8 +472,8 @@ export default {
style.size = parseInt(style.size * RATIO)
style.width = parseInt(style.width * RATIO)
}
Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, color: style1.style.color, font: style1.font })
Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, color: style2.style.color, font: style2.font })
Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, color: style1.style.color, font: style1.font, height: 'auto' })
Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, color: style2.style.color, font: style2.font, height: 'auto' })
}
if (FESTIVAL.includes(this.detail.codeId)) {
const style1 = JSON.parse(this.detail.titleStyle)
......@@ -497,8 +510,8 @@ export default {
})
})
this.isFestival = true
this.logoInfo = await this.getImgWH(this.detail.merchantLog)
}
if (this.detail.merchantLogo) this.logoInfo = await this.getImgWH(this.detail.merchantLogo)
})
},
formatPrice(val) {
......
......@@ -36,6 +36,8 @@
<script>
const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8]
const FESTIVAL = [9, 10]
const WIDTH = 244
const RATIO = 375 / WIDTH
import { mapState, mapMutations } from 'vuex'
import phoneView from './PhoneView'
import draw from '@/mixins/draw'
......@@ -133,12 +135,27 @@ export default {
this.loading = true
const {
backgroundHeight,
detail: { backgroundImage, titleStyle, subTitleStyle },
detailHeight,
logoInfo,
detail: { backgroundImage, detailImage, merchantLogo, 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 (RENEWAL.includes(params.codeId)) {
url = await this.createMain({ backgroundHeight, detailHeight, logoInfo, backgroundImage, detailImage, merchantLogo }, draggableList) //合并主图、文字
const style1 = draggableList[0]
const style2 = draggableList[1]
const titleStyle = JSON.parse(params.titleStyle)
const subTitleStyle = JSON.parse(params.subTitleStyle)
const styles = [style1, style2]
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)
}
params.titleStyle = JSON.stringify(Object.assign(titleStyle, { x: style1.x, y: style1.y, size: style1.size, width: style1.width }))
params.subTitleStyle = JSON.stringify(Object.assign(subTitleStyle, { x: style2.x, y: style2.y, size: style2.size, width: style2.width }))
}
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、文字
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!