zhengxy месяцев назад: 7
Родитель
Сommit
f36f2789a0

+ 255 - 0
src/components/businessMoudle/batchGdt3/configArea/basicInfo/conversionTrack.vue

@@ -0,0 +1,255 @@
1
+<template>
2
+  <el-dialog class="gdt-dialog" v-model="dialogVisible" :destroy-on-close="true" key="conversionTrackDialog"
3
+    title="配置转化归因新链路" width="600px" :before-close="handleClose">
4
+
5
+    <div class="content-wrap" v-loading="loading">
6
+      <div class="form-item">
7
+        <div class="item-lable">监控链接</div>
8
+        <el-input class="input-wrap" v-model="form.feedback_url" placeholder="请输入监控链接" clearable />
9
+      </div>
10
+      <div class="form-item">
11
+        <div class="item-lable">小程序app_id</div>
12
+        <el-input class="input-wrap" v-model="form.wechat_app_id" placeholder="请输入小程序app_id" clearable />
13
+      </div>
14
+    </div>
15
+
16
+    <template #footer>
17
+      <span class="dialog-footer">
18
+        <el-button @click="handleClose"> 取 消 </el-button>
19
+        <el-button type="primary" @click="submitEvent"> 确 定 </el-button>
20
+      </span>
21
+    </template>
22
+  </el-dialog>
23
+</template>
24
+<script setup lang="ts">
25
+import { nextTick, reactive, ref, watch } from 'vue';
26
+import { ElMessage } from "element-plus";
27
+
28
+const props = defineProps({
29
+  visible: {
30
+    type: Boolean,
31
+    default: false
32
+  },
33
+  accIdsList: {
34
+    type: Array<{ id: string, name: string }>,
35
+    default: () => []
36
+  },
37
+  fillback: {
38
+    type: Object,
39
+  },
40
+  acc_plan_ad_count: {
41
+    type: Object,
42
+    default: () => { }
43
+  }
44
+})
45
+const emit = defineEmits<{
46
+  (event: "close", val?: any): void;
47
+}>();
48
+
49
+const loading = ref(false)
50
+const dialogVisible = ref(props.visible)
51
+
52
+const form = reactive({
53
+  feedback_url: '',
54
+  wechat_app_id: '',
55
+})
56
+
57
+/**关闭弹框 */
58
+const handleClose = () => {
59
+  emit('close')
60
+}
61
+
62
+/**确定提交 */
63
+const submitEvent = () => {
64
+
65
+  if (!form.feedback_url) {
66
+    ElMessage.warning('请输入监控链接')
67
+    return false
68
+  }
69
+
70
+  if (!form.wechat_app_id) {
71
+    ElMessage.warning('请输入小程序app_id')
72
+    return false
73
+  }
74
+
75
+  let obj = {};
76
+  emit('close', {
77
+    type: 'submit',
78
+    val: Object.keys(obj)?.length == 0 ? null : obj,
79
+    other: {
80
+      feedback_url: form.feedback_url,
81
+      wechat_app_id: form.wechat_app_id,
82
+    }
83
+  })
84
+}
85
+
86
+const handleClear = () => {
87
+  console.log('handleClear => ',)
88
+  form.feedback_url = ''
89
+  form.wechat_app_id = ''
90
+
91
+  emit('close', {
92
+    type: 'submit',
93
+    val: null,
94
+    other: {}
95
+  })
96
+}
97
+
98
+// 父组件共享值
99
+defineExpose({
100
+  handleClear,
101
+});
102
+
103
+/**弹框显隐监听 */
104
+watch(
105
+  () => props.visible,
106
+  async (newValue, oldValue) => {
107
+    dialogVisible.value = newValue
108
+    console.log('fillback => ', props.fillback)
109
+
110
+  }, { immediate: true })
111
+
112
+</script>
113
+<style lang="scss" scoped>
114
+@import "@/assets/style/batchDialogGdt.scss";
115
+@import './outer.scss';
116
+
117
+.tabelListBox {
118
+  margin-top: 15px;
119
+  height: 62vh !important;
120
+  padding-left: 0 !important;
121
+}
122
+
123
+.tabelCon {
124
+  padding: 10px;
125
+}
126
+
127
+.selectedList,
128
+.listCon {
129
+  box-sizing: border-box;
130
+  border: 1px solid #e8eaec;
131
+  border-radius: 4px;
132
+}
133
+
134
+.selectedList {
135
+  width: 200px;
136
+}
137
+
138
+.listCon {
139
+  flex: 1;
140
+}
141
+
142
+.operate {
143
+  height: 48px;
144
+  padding: 0 8px;
145
+  border-bottom: 1px solid #dcdfe6;
146
+}
147
+
148
+.infoTitle {
149
+  box-sizing: border-box;
150
+  display: flex;
151
+  padding-right: 10px;
152
+  padding-left: 10px;
153
+  line-height: 30px;
154
+  background-color: #f8f9fd;
155
+  border-bottom: 1px solid #dcdfe6;
156
+  font-size: 14px;
157
+  color: #333;
158
+}
159
+
160
+.infoBlock {
161
+  height: 45vh;
162
+  overflow: auto;
163
+  padding: 10px;
164
+
165
+  .okInfo {
166
+    display: flex;
167
+    align-items: center;
168
+    justify-content: space-between;
169
+    line-height: 32px;
170
+    color: #444;
171
+  }
172
+}
173
+
174
+.empty-block {
175
+  display: flex;
176
+  flex-direction: column;
177
+  align-items: center;
178
+  justify-content: center;
179
+  padding-top: 70px;
180
+
181
+  .empty-description {
182
+    margin-top: 25px;
183
+    font-size: 14px;
184
+    font-weight: 500;
185
+    line-height: 20px;
186
+    color: #808695;
187
+  }
188
+}
189
+
190
+.self_checkbox {
191
+  width: 14px;
192
+  height: 14px;
193
+  border: 1px solid #d9d9d9;
194
+  border-radius: 2px;
195
+  position: relative;
196
+  cursor: pointer;
197
+}
198
+
199
+.self_checkbox_active {
200
+  background-color: #3173FF;
201
+  border-color: #3173FF;
202
+
203
+  &::after {
204
+    box-sizing: content-box;
205
+    content: "";
206
+    border: 1px solid #ffffff;
207
+    border-left: 0;
208
+    border-top: 0;
209
+    height: 7px;
210
+    left: 4px;
211
+    position: absolute;
212
+    top: 1px;
213
+    transform: rotate(45deg) scaleY(1);
214
+    width: 3px;
215
+    transition: transform .15s ease-in 50ms;
216
+    transform-origin: center;
217
+  }
218
+}
219
+
220
+.self_checkbox_disabled {
221
+  background-color: #edf2fc;
222
+  border-color: #dcdfe6;
223
+  cursor: not-allowed;
224
+
225
+  &::after {
226
+    border: none;
227
+  }
228
+}
229
+
230
+.content-wrap {
231
+  padding: 40px 30px 0;
232
+  .form-item {
233
+    margin-bottom: 30px;
234
+    display: flex;
235
+    align-items: center;
236
+    .item-lable {
237
+      width: 90px;
238
+      margin-right: 20px;
239
+      font-size: 14px;
240
+      margin-bottom: 6px;
241
+    }
242
+
243
+    .input-wrap {
244
+      width: 300px;
245
+    }
246
+
247
+    .form-tips {
248
+      font-size: 12px;
249
+      color: #666;
250
+      margin-top: 6px;
251
+    }
252
+  }
253
+}
254
+
255
+</style>

+ 3 - 3
src/components/businessMoudle/batchGdt3/configArea/basicInfo/ts/information.ts

@@ -367,11 +367,11 @@ export const scheduleBid:any = {
367 367
     name: '转化场景',
368 368
     type: 'radio',
369 369
     data: {
370
-      defaultValue: 'CONVERSION_SCENE_WEB',
370
+      defaultValue: 'CONVERSION_SCENE_WECHAT_MINI_PROGRAM',
371 371
       list:[
372
-        { label: '网页', value: 'CONVERSION_SCENE_WEB' },
372
+        // { label: '网页', value: 'CONVERSION_SCENE_WEB' },
373 373
         { label: '微信小程序', value: 'CONVERSION_SCENE_WECHAT_MINI_PROGRAM'},
374
-        { label: '企业微信', value: 'CONVERSION_SCENE_WE_COM'},
374
+        // { label: '企业微信', value: 'CONVERSION_SCENE_WE_COM'},
375 375
       ],
376 376
     }
377 377
   },

+ 15 - 0
src/components/businessMoudle/batchGdt3/configArea/index.vue

@@ -207,6 +207,17 @@
207 207
   />
208 208
   <!-- E 推广产品 -->
209 209
 
210
+  <!-- S 转化归因新链路 -->
211
+  <conversionTrack
212
+    ref="conversionTrackRef"
213
+    :visible="basicInfoData.outerConfig.conversionTrack.visible"
214
+    :accIdsList="pageInfo.accIdsList"
215
+    :fillback="basicInfoData.outerConfig['conversionTrack']"
216
+    :acc_plan_ad_count="pageInfo.acc_plan_ad_count"
217
+    @close="(obj: IOuterConfigRule) => { basicOuterClose({ ...obj, key: 'conversionTrack' }) }"
218
+  />
219
+  <!-- E 转化归因新链路 -->
220
+
210 221
   <!-- 优量汇流量包 -->
211 222
   <UnionPosition :visible="basicInfoData.outerConfig.unionPosition.visible" :accIdsList="pageInfo.accIdsList"
212 223
     :infoSelect="basicInfoData.outerConfig.unionPosition.infoSelect"
@@ -237,6 +248,7 @@ import AttributionOuter from './basicInfo/attributionOuter.vue'
237 248
 import WeChatVideoAccount from './basicInfo/weChatVideoAccount.vue'
238 249
 import sellStrategy from './basicInfo/sellStrategy.vue'
239 250
 import marketingAsset from './basicInfo/marketingAsset.vue'
251
+import conversionTrack from './basicInfo/conversionTrack.vue'
240 252
 import UnionPosition from './basicInfo/unionPosition.vue'
241 253
 import OriginalityBasic from './originalityBasic/index.vue'
242 254
 import Copywriter from './copywriter/index.vue'
@@ -265,6 +277,7 @@ const NumberHandle = proxy.$NumberHandle
265 277
 
266 278
 const sellStrategyRef = ref()
267 279
 const marketingAssetRef = ref()
280
+const conversionTrackRef = ref()
268 281
 
269 282
 // S 参数声明
270 283
 const {
@@ -522,6 +535,8 @@ const updateHaveContent = ({ id, chooseNum, minusFlag, clearFlag, type }: IUpdat
522 535
         sellStrategyRef?.value?.handleClear()
523 536
         // 定向包变化 => 清空推广产品配置
524 537
         marketingAssetRef?.value?.handleClear()
538
+        // 定向包变化 => 清空转化归因新链路配置
539
+        conversionTrackRef?.value?.handleClear()
525 540
 
526 541
         pageInfo.directPacketChooseNum = chooseNum
527 542
         console.log('pageInfo.directPacketChooseNum => ', pageInfo.directPacketChooseNum)

+ 34 - 1
src/components/businessMoudle/batchGdt3/configArea/ts/adBasic.ts

@@ -43,6 +43,15 @@ export function basicInfoDeclare() {
43 43
         value: {},
44 44
         other: {}
45 45
       },
46
+      conversionTrack: {
47
+        enabled: false, //是否需要配置
48
+        visible: false, //对应弹框显隐
49
+        optional: false, //选填
50
+        isComplete: false, // 是否完成填写
51
+        name: '转化归因新链路',
52
+        value: {},
53
+        other: {}
54
+      },
46 55
       unionPosition: {
47 56
         enabled: false,
48 57
         visible: false,
@@ -214,7 +223,13 @@ export function handleAdBasic({
214 223
       res?.union_position_enabled == 1 && basicInfoData.outerConfig.unionPosition.infoSelect.push({ name: '定投流量包', id: 1 })
215 224
       res?.exclude_union_position_enabled == 1 && basicInfoData.outerConfig.unionPosition.infoSelect.push({ name: '屏蔽流量包', id: 2 })
216 225
     }
226
+
217 227
     basicInfoData.outerConfig.marketingAsset.enabled = true; // 推广产品
228
+
229
+    if (res?.conversion_tracking_enabled == 1) { // 转化归因新链路
230
+      basicInfoData.outerConfig.conversionTrack.enabled = true;
231
+    }
232
+
218 233
   }
219 234
   /**点击基础信息外层配置 */
220 235
   const basicOuterClick = (key) => {
@@ -232,6 +247,10 @@ export function handleAdBasic({
232 247
     if (key == 'marketingAsset') { // 推广产品 - 需要定向包完成填写
233 248
       if (!judgeEvent(7)) return
234 249
     }
250
+
251
+    if (key == 'conversionTrack') { // 转化归因新链路 - 需要定向包完成填写
252
+      if (!judgeEvent(7)) return
253
+    }
235 254
     basicInfoData.outerConfig[key].visible = true;
236 255
   }
237 256
   /** 外部配置回调 */
@@ -250,8 +269,13 @@ export function handleAdBasic({
250 269
         basicInfoData.outerConfig[key].other = other
251 270
       }
252 271
 
253
-      console.log('basicOuterClose() basicInfoData.outerConfig => ', basicInfoData.outerConfig)
272
+
273
+      if (key == 'conversionTrack') { // 转化归因新链路
274
+        basicInfoData.outerConfig[key].isComplete = isCompleteEventCT(basicInfoData.outerConfig[key]);
275
+      }
254 276
     }
277
+
278
+    console.log('basicOuterClose() basicInfoData.outerConfig => ', basicInfoData.outerConfig)
255 279
   }
256 280
 
257 281
   const isCompleteEvent = (data) => {
@@ -267,6 +291,15 @@ export function handleAdBasic({
267 291
     }
268 292
     return true
269 293
   }
294
+  const isCompleteEventCT = (data) => { // 转化归因新链路
295
+    const { other = {} } = data
296
+    if (!other.feedback_url || !other.wechat_app_id) {
297
+      return false
298
+    } else {
299
+      return true
300
+    }
301
+  }
302
+
270 303
   /**基础外部配置 - 获取对象公共数据 */
271 304
   const getCommonValue = (data) => {
272 305
     let obj = {}

+ 1 - 0
src/components/businessMoudle/batchGdt3/previewArea/api.ts

@@ -75,6 +75,7 @@ interface IAddTasksStrategy {
75 75
   union_position: string,
76 76
   sell_strategy: string,
77 77
   marketing_asset: string,
78
+  conversionTrack: string,
78 79
 }
79 80
 export function addTasksStrategy(params: IAddTasksStrategy) {
80 81
   return new Promise(async (resolve,reject)=>{

+ 14 - 0
src/components/businessMoudle/batchGdt3/previewArea/index.vue

@@ -441,6 +441,19 @@ const auditSubmitEvent = (dialogInfo) => {
441 441
   }
442 442
   // E 推广产品参数
443 443
 
444
+  // S 转化归因新链路
445
+  if (ad_common.conversion_tracking_enabled == 1) {
446
+    const { other = {} } = pageInfo.basicInfoData.outerConfig.conversionTrack
447
+    campaign_list.forEach((c: any) => {
448
+      c.ad_list.forEach(ad => {
449
+        ad['feedback_url'] = other['feedback_url']
450
+        ad['wechat_app_id'] = other['wechat_app_id']
451
+      })
452
+    })
453
+  }
454
+  // E 转化归因新链路
455
+
456
+
444 457
   let ad_outer = {
445 458
     user_action_sets: {},//数据源
446 459
     cold_start_audience: {},//扩量种子
@@ -661,6 +674,7 @@ const addTasksStrategyEvent = (task_id) => {
661 674
     'union_position': JSON.stringify(groupsInfo?.basicInfoData?.outerConfig?.unionPosition),
662 675
     'sell_strategy': JSON.stringify(groupsInfo?.basicInfoData?.outerConfig?.sellStrategy),
663 676
     'marketing_asset': JSON.stringify(groupsInfo?.basicInfoData?.outerConfig?.marketingAsset),
677
+    'conversionTrack': JSON.stringify(groupsInfo?.basicInfoData?.outerConfig?.conversionTrack),
664 678
   }).then((res)=>{
665 679
     console.log('添加广告任务策略',res)
666 680
   }).catch(()=>{})