Commit 296ca5ff by 杨明

fixed

1 parent 18980e2a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33 * @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-30 17:14:49 * @LastEditTime: 2023-05-31 15:20:25
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js * @FilePath: \scrm-micro-home\src\store\modules\marketing.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
*/ */
...@@ -25,7 +25,8 @@ export default { ...@@ -25,7 +25,8 @@ export default {
mergeImg: {}, mergeImg: {},
keywords: '', keywords: '',
GPTList: null, GPTList: null,
merchantInfo: {} merchantInfo: {},
isCover: false
}, },
mutations: { mutations: {
// 设置客户信息 // 设置客户信息
...@@ -70,6 +71,9 @@ export default { ...@@ -70,6 +71,9 @@ export default {
}, },
['SET_GPT_LIST'](state, payload) { ['SET_GPT_LIST'](state, payload) {
state.GPTList = payload state.GPTList = payload
},
['SET_COVER'](state, payload) {
state.isCover = payload
} }
}, },
actions: { actions: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01 * @Date: 2023-05-16 10:20:01
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-30 17:09:12 * @LastEditTime: 2023-05-31 15:46:53
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue * @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 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState('marketing', ['calendarDataAll', 'activityInfo', 'keywords']) ...mapState('marketing', ['calendarDataAll', 'activityInfo', 'keywords', 'GPTList'])
}, },
watch: { watch: {
chatItem() { chatItem() {
...@@ -98,13 +98,15 @@ export default { ...@@ -98,13 +98,15 @@ export default {
}, },
activityInfo(val) { activityInfo(val) {
if (!val) return if (!val) return
if (!this.keywords) this.chatItem = [] if (val.type != 'chatgpt') this.chatItem = []
} }
}, },
methods: { methods: {
...mapActions('marketing', ['setActivityInfo', 'setKeyWords']), ...mapActions('marketing', ['setActivityInfo', 'setKeyWords']),
selectText(html) { selectText(html) {
this.$nextTick(() => {
this.contentHtml = html this.contentHtml = html
})
this.phrasesShow = false this.phrasesShow = false
}, },
jumpUrl() { jumpUrl() {
...@@ -129,7 +131,7 @@ export default { ...@@ -129,7 +131,7 @@ export default {
this.setKeyWords(calendarData.keywords) this.setKeyWords(calendarData.keywords)
this.setActivityInfo({ this.setActivityInfo({
id: calendarData.id, id: calendarData.id,
type: 'calendar' type: 'chatgpt'
}) })
} else { } else {
this.chatItem.push({ this.chatItem.push({
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 10:23:52 * @Date: 2023-05-16 10:23:52
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-31 09:44:42 * @LastEditTime: 2023-05-31 15:42:43
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\GPTAnalysis.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\GPTAnalysis.vue
* @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
--> -->
...@@ -196,7 +196,7 @@ import selectGoodsDialog from './selectGoodsDialog' ...@@ -196,7 +196,7 @@ import selectGoodsDialog from './selectGoodsDialog'
import selectEquityDialog from './selectEquityDialog' import selectEquityDialog from './selectEquityDialog'
import selectEmpDialog from './selectEmpDialog' import selectEmpDialog from './selectEmpDialog'
import getUploadImgColor from '@/utils/color' import getUploadImgColor from '@/utils/color'
import { mapState, mapActions } from 'vuex' import { mapState, mapActions, mapMutations } from 'vuex'
import gpt from '@/mixins/gpt' import gpt from '@/mixins/gpt'
import draw from '@/mixins/draw' import draw from '@/mixins/draw'
import util from '@/utils/util' import util from '@/utils/util'
...@@ -444,6 +444,7 @@ export default { ...@@ -444,6 +444,7 @@ export default {
}, },
methods: { methods: {
...mapActions('marketing', ['setActivityInfo', 'setSchemeListData', 'setMergeImg']), ...mapActions('marketing', ['setActivityInfo', 'setSchemeListData', 'setMergeImg']),
...mapMutations('marketing', ['SET_GPT_LIST', 'SET_COVER']),
//获取优惠券模板 //获取优惠券模板
couponTemplate() { couponTemplate() {
this.$apis.giftBag.couponTemplate({ pageSize: 10000, pageNum: 1 }).then(res => { this.$apis.giftBag.couponTemplate({ pageSize: 10000, pageNum: 1 }).then(res => {
...@@ -704,10 +705,12 @@ export default { ...@@ -704,10 +705,12 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getTemplateInfo() { getTemplateInfo(type) {
if (type != 'chatgpt') {
this.SET_GPT_LIST()
}
const { id } = this.activityInfo const { id } = this.activityInfo
this.$apis.activity.getCalendarDatail({ id }).then(res => { this.$apis.activity.getCalendarDatail({ id }).then(res => {
this.setActivityInfo()
const { title, subTitle, startTime, endTime, couponItemList, backgroundImg, captionImg } = this.$common.utils.deepClone(res.data || {}) const { title, subTitle, startTime, endTime, couponItemList, backgroundImg, captionImg } = this.$common.utils.deepClone(res.data || {})
this.editForm.templateId = id this.editForm.templateId = id
this.editForm.marketingTitle = title this.editForm.marketingTitle = title
...@@ -723,15 +726,20 @@ export default { ...@@ -723,15 +726,20 @@ export default {
}, },
// isGetList =true 创建成功初始化 // isGetList =true 创建成功初始化
init(isGetList = true) { init(isGetList = true) {
this.SET_GPT_LIST()
isGetList && this.setSchemeListData({ merchantId: this.editForm.merchantId, pageSize: 5, currentPage: 1 }) isGetList && this.setSchemeListData({ merchantId: this.editForm.merchantId, pageSize: 5, currentPage: 1 })
this.editForm = { mainColor: '', activityPrice: '', marketingTitle: '', bigImage: '', marketingSubtitle: '', activityTime: [], superMarketingCouponRelRequestList: [], backgroundImage: '', detailImage: '', merchantLog: '', merchantname: this.merchantInfo.merchantName, merchantAddress: this.merchantInfo.merchantAddress, merchantId: this.merchantInfo.merchantNo } this.editForm = this.initValue()
this.selectedGoodsList = [] this.selectedGoodsList = []
this.selectedEquityList = [] this.selectedEquityList = []
this.exportUrl = '' this.exportUrl = ''
this.importNum = 0 this.importNum = 0
}, },
initValue() {
return { mainColor: '', activityPrice: '', marketingTitle: '', bigImage: '', marketingSubtitle: '', activityTime: [], superMarketingCouponRelRequestList: [], backgroundImage: '', detailImage: '', merchantLog: '', merchantname: this.merchantInfo.merchantName, merchantAddress: this.merchantInfo.merchantAddress, merchantId: this.merchantInfo.merchantNo }
},
getInfo() { getInfo() {
this.loading = true this.loading = true
this.SET_GPT_LIST()
let { id, subscribe } = this.activityInfo, let { id, subscribe } = this.activityInfo,
param = { param = {
activityId: id activityId: id
...@@ -745,12 +753,11 @@ export default { ...@@ -745,12 +753,11 @@ export default {
} }
this.$apis.activity[activityAPi](param) this.$apis.activity[activityAPi](param)
.then(res => { .then(res => {
this.setActivityInfo()
var info = res var info = res
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info this.activityInfo = info
if (info.activityName) { if (info.activityName) {
this.editForm.marketingTitle = info.activityName this.$set(this.editForm, 'marketingTitle', info.activityName)
} }
if (info.starttime) { if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')]) this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')])
...@@ -759,14 +766,15 @@ export default { ...@@ -759,14 +766,15 @@ export default {
this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')]) this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')])
} }
if (info.merchantName) { if (info.merchantName) {
this.editForm.merchantname = info.merchantName this.$set(this.editForm, 'merchantname', info.merchantName)
this.editForm = Object.assign(this.initValue(), this.editForm)
} }
// 地图 // 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) { if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName) this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
} }
if (info.activityPrice) { if (info.activityPrice) {
this.editForm.activityPrice = info.activityPrice / 100 this.$set(this.editForm, 'activityPrice', info.activityPrice / 100)
} }
if (info.serviceMerchantPackageConfigDTOList && info.serviceMerchantPackageConfigDTOList.length) { if (info.serviceMerchantPackageConfigDTOList && info.serviceMerchantPackageConfigDTOList.length) {
this.selectedEquityList = info.serviceMerchantPackageConfigDTOList.map(item => { this.selectedEquityList = info.serviceMerchantPackageConfigDTOList.map(item => {
...@@ -805,7 +813,8 @@ export default { ...@@ -805,7 +813,8 @@ export default {
if (!val.id) { if (!val.id) {
return this.init(false) return this.init(false)
} }
val.type == 'programme' ? this.getInfo() : this.getTemplateInfo() val.type == 'programme' ? this.getInfo() : this.getTemplateInfo(val.type)
this.setActivityInfo()
}) })
.catch(() => { .catch(() => {
this.setActivityInfo() this.setActivityInfo()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!