Commit 31ec12a9 by 杨明

fixed

1 parent af4757b1
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-17 10:56:24
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 16:08:50
* @LastEditTime: 2023-05-18 16:52:06
* @FilePath: \scrm-micro-home\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -68,7 +68,17 @@ const getCalendarList = params => {
returnAll: true
})
}
// 营销日历列表
const getCalendarDatail = params => {
params.method = 'marketing.api.calendar.detail'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
findActivityInfo,
......@@ -76,5 +86,6 @@ export default {
exportCustomer,
listByPage,
activityDetail,
getCalendarList
getCalendarList,
getCalendarDatail
}
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2023-05-15 15:23:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 20:37:20
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
......@@ -13,9 +13,10 @@ import './public-path'
// import 'glsx-components/dist/glsx-components.css'
import '@/components'
import { start } from '@/setup'
import '@toast-ui/calendar/dist/toastui-calendar.min.css';
import '@toast-ui/calendar/dist/toastui-calendar.min.css'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.defaultLabelWidth = '154px'
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-19 15:30:28
* @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 } from 'vuex'
export default {
data() {
return {
gptList: null,
t1: 0, // 主标题下标
t2: 0 // 副标题下标
}
},
computed: {
...mapState('marketing', ['keywords'])
},
methods: {
async getGPTitle(type) {
if (!this.gptList) {
const json = await fetch('http://192.168.3.226:8080/openai/title?req.userPrompt=' + this.keywords, {
method: 'POST'
})
const gptList = await json.json()
this.gptList = JSON.parse(gptList.data.message)
}
if (type == 1) {
this.editForm.marketingTitle = this.gptList.mainTitles[this.t1].title
this.t1++
}
if (type == 2) {
this.editForm.marketingSubtitle = this.gptList.subTitles[this.t2].title
this.t2++
}
}
},
mounted() {}
}
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-07-22 18:15:13
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 15:25:49
* @LastEditTime: 2023-05-19 16:24:47
* @FilePath: \scrm-micro-home\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -33,8 +33,8 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: 'scrm-base-a2c6d759-92fa-43eb-83c9-4b5bed10d2bf-rop' } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: 'scrm-base-a2c6d759-92fa-43eb-83c9-4b5bed10d2bf-rop' } })
Vue.prototype.$http = new common.Http({ response, request, 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.$scene = scene
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......
......@@ -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-05-18 16:09:16
* @LastEditTime: 2023-05-19 16:14:49
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -17,7 +17,10 @@ export default {
activityDate: '',
activityProject: {},
customDetail: {},
calendarData: []
calendarData: [],
calendarDataAll: [],
schemeList: [],
keywords: ''
},
mutations: {
// 设置客户信息
......@@ -40,8 +43,18 @@ export default {
SET_ACTIVITY_PEOJECT(state, data) {
state.activityProject = data
},
// 设置活动项
SET_KET_WORDs(state, data) {
state.keywords = data
},
['SET_CALENDAR_DATA'](state, payload) {
state.calendarData = payload.calendarData
},
['SET_CALENDAR_DATA_ALL'](state, payload) {
state.calendarDataAll = payload
},
['SET_SCHEME_DATA'](state, payload) {
state.schemeList = payload
}
},
actions: {
......@@ -60,14 +73,34 @@ export default {
setActivityProject({ commit }, data) {
commit('SET_ACTIVITY_PEOJECT', data)
},
setKeyWords({ commit }, data) {
commit('SET_KET_WORDs', data)
},
//营销日历列表
getCalendarListData(conText,payload){
apis.activity.getCalendarList(payload).then(res=>{
getCalendarListData(conText, payload) {
apis.activity.getCalendarList(payload).then(res => {
console.log(res)
if(res.code == 0){
if (res.code == 0) {
conText.commit('SET_CALENDAR_DATA', { calendarData: res.data })
}
})
},
//营销方案列表
setSchemeListData(conText, payload) {
apis.activity.listByPage(payload).then(res => {
if (res.list) {
conText.commit('SET_SCHEME_DATA', res.list)
}
})
},
getCalendarListDataAll(conText, payload) {
apis.activity.getCalendarList({}).then(res => {
console.log(res)
if (res.code == 0) {
conText.commit('SET_CALENDAR_DATA_ALL', res.data)
}
})
}
}
}
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 14:44:16
* @LastEditTime: 2023-05-19 14:29:17
* @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
-->
......@@ -26,16 +26,20 @@
</div>
<div class="gpt-body">
<div class="error-tips flex-center" v-if="isError">
<i class="el-icon-error"></i>
<span>无法识别营销场景,请重新输入</span>
<i class="el-icon-close"></i>
</div>
<div class="chat-panel" ref="chatRef" v-else>
<div class="chat-panel" ref="chatRef">
<div class="chat-panel-b" ref="chatBRef">
<div :class="['chat-item', item.type == 2 ? 'is-left' : 'is-right']" v-for="(item, i) in chatItem" :key="i">
<div class="item-content left-item" v-if="item.type == 2">{{ item.content }}</div>
<div class="item-content right-item" v-else>{{ item.content }}</div>
<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>
......@@ -55,24 +59,16 @@
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
isError: false,
isError: true,
phrasesShow: false,
query: {},
contentHtml: '我需要制定一套<span>续保</span>营销方案,活动时间为<span>5月份</span>。',
phrases: ['创建一个<span>端午节</span>的营销活动,活动时间为<span>6月份</span>', '我需要一个<span>立夏</span>的节日关怀营销活动', '建立一个<span>父亲节</span>的节日关怀活动'],
chatItem: [
{
type: 1,
content: '我需要制定一套续保营销方案,活动时间为5月份'
},
{
type: 2,
content: '我们为您生成以下方案,请查看“营销模型解析”'
}
],
chatItem: [],
importItem: [
{
title: '基盘总客户数',
......@@ -89,6 +85,9 @@ export default {
]
}
},
computed: {
...mapState('marketing', ['calendarDataAll'])
},
watch: {
chatItem() {
const chatRef = this.$refs.chatRef
......@@ -99,18 +98,37 @@ export default {
}
},
methods: {
...mapActions('marketing', ['setActivityInfo','setKeyWords']),
selectText(html) {
this.contentHtml = html
this.phrasesShow = false
},
//发送消息
sendMsg() {
console.log(this.calendarDataAll)
const content = this.$refs.inputRef.textContent
if (!content.trim()) return
this.chatItem.push({
type: 1,
type: 'question',
content
})
const calendarData = this.calendarDataAll.find(item => content.includes(item.title))
if (calendarData) {
this.chatItem.push({
type: 'answer',
content: '我们为您生成以下方案,请查看“营销模型解析”'
})
this.setKeyWords('续保')
this.setActivityInfo({
id: calendarData.id,
type: 'calendar'
})
} else {
this.chatItem.push({
type: 'error',
content: '无法识别营销场景,请重新输入'
})
}
this.$refs.inputRef.textContent = ''
},
/**点击空白处隐藏下拉框 */
......@@ -166,7 +184,7 @@ export default {
height: 40px;
background: #fce3e3;
border-radius: 4px;
margin: 32px auto;
margin: 0px auto;
font-size: 14px;
color: #000000a6;
span {
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 15:33:07
* @LastEditTime: 2023-05-19 16:16:07
* @FilePath: \scrm-micro-home\src\views\home\components\marketing\MarketingLeft.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -17,7 +17,7 @@
<div class="scheme-wrap">
<div class="scrm-ml6 scrm-c3 scrm-f14 weight-6">营销方案:</div>
<div class="scheme-list">
<template v-for="(item, index) in schemeList">
<template v-for="(item, index) in schemeListData">
<div class="scheme-line scrm-c3 scrm-f14 flex" :class="{ select: item.hovering }" :key="index" @mouseenter="item.hovering = true" @mouseleave="item.hovering = false">
<div class="scheme-text one-line-ellipsis">{{ item.activityName }}</div>
<div class="flex txt-blue" v-show="item.hovering">
......@@ -58,7 +58,7 @@ export default {
},
data() {
return {
schemeList: [],
schemeListData: [],
themeList: [
{
text: '5月定保营销种草',
......@@ -78,32 +78,34 @@ export default {
},
computed: {
...mapState({
calendarData: state => state.marketing.calendarData
calendarData: state => state.marketing.calendarData,
schemeList: state => state.marketing.schemeList
})
},
watch: {
calendarData(newVal) {
this.getThemeData(newVal)
},
schemeList(val) {
this.getSchemeList(val)
}
},
mounted() {
this.getSchemeList()
this.setSchemeListData({ merchantId: 44211227, pageSize: 5, currentPage: 1 })
},
methods: {
...mapActions('marketing', ['setActivityInfo']),
getSchemeList() {
const { merchantId } = this.merchantInfo
this.$apis.activity.listByPage({ merchantId: 44211227, pageSize: 5, currentPage: 1 }).then(res => {
const schemeList = res.list || []
this.schemeList = schemeList.map(item => {
return {
hovering: false,
activityName: item.activityName,
id: item.id,
subscribe: item.subscribe,
type: 'programme' //方案
}
})
...mapActions('marketing', ['setActivityInfo', 'setSchemeListData']),
getSchemeList(val) {
if(!val)return
this.schemeListData = val.map(item => {
return {
hovering: false,
activityName: item.activityName,
id: item.id,
subscribe: item.subscribe,
type: 'programme' //方案
}
})
},
//设置活动详情
......
......@@ -13,6 +13,8 @@ export default {
data() {
return {}
},
componentsName: 'marketingMiddle',
name: 'marketingMiddle',
components: {
ChatGpt,
GPTAnalysis
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-16 17:10:29
* @LastEditTime: 2023-05-19 11:50:44
* @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
-->
......@@ -12,12 +12,37 @@
<div class="review-body">
<img src="@/assets/img/phone.png" alt="" />
</div>
<div class="review-refresh">更新预览图</div>
<div class="review-save">保存方案</div>
<div class="review-refresh" @click="renewImg">更新预览图</div>
<div class="review-save" @click="handleSave">保存方案</div>
</div>
</template>
<script>
export default {}
export default {
data() {
return {}
},
methods: {
renewImg() {
const detail = this.getCouponInfoParams()
console.log(detail)
},
handleSave() {
let children = this.$parent.$children
findComponent(children)
function findComponent(children) {
for (let i = 0; i < children.length; i++) {
if (children[i].$options.componentsName == 'analysis') {
children[i].handleConfirm()
return
}
if (children[i].$children) {
findComponent(children[i].$children)
}
}
}
}
}
}
</script>
<style lang="scss" scoped>
.review-box {
......@@ -46,8 +71,10 @@ export default {}
font-size: 14px;
color: #ffffff;
border-radius: 4px;
cursor: pointer;
}
.review-save {
cursor: pointer;
margin: 8px auto;
width: 274px;
height: 36px;
......
......@@ -227,7 +227,7 @@ export default {
...this.searchForm,
status: 2,
discountType: this.selectedGiftList[this.activeName].discountType,
merchantId: this.merchantId,
merchantId: this.$globalState.session.merchantId,
pageNum: isResetPage ? 1 : this.$refs[this.activeName + 'Ref'].page.pageNum,
pageSize: isResetPage ? 10 : this.$refs[this.activeName + 'Ref'].page.pageSize
}
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-11 18:32:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 13:44:41
* @LastEditTime: 2023-05-19 10:45:51
* @FilePath: \scrm-micro-home\src\views\home\marketing.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -58,10 +58,12 @@ export default {
},
mounted() {
this.getCalendarListData({})
this.getCalendarListDataAll()
},
methods: {
...mapActions({
getCalendarListData: 'marketing/getCalendarListData'
getCalendarListData: 'marketing/getCalendarListData',
getCalendarListDataAll: 'marketing/getCalendarListDataAll',
}),
handleShowCalendar(value) {
this.showCalendar = Boolean(value)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!