|
@@ -124,14 +124,14 @@
|
124
|
124
|
|
125
|
125
|
<van-action-sheet v-model:show="actionShow" title="修改发送">
|
126
|
126
|
<div class="actionContent">
|
127
|
|
- <div style="font-size: 13px">
|
|
127
|
+ <div style="font-size: 13px;text-align: center;">
|
128
|
128
|
<van-icon name="bell" color="#00b38a" />
|
129
|
129
|
可对话术进行修改,【发送】后不会影响原有话术
|
130
|
130
|
</div>
|
131
|
131
|
<div class="textAreaBox">
|
132
|
132
|
<div>
|
133
|
|
- <span class="c-00b38a">[插入用户昵称]</span>
|
134
|
|
- <span class="c-00b38a" style="margin-left: 10px;">[插入备注名]</span>
|
|
133
|
+ <span class="c-00b38a" @click="appendCon(1)">[插入用户昵称]</span>
|
|
134
|
+ <span class="c-00b38a" style="margin-left: 10px;" @click="appendCon(2)">[插入备注名]</span>
|
135
|
135
|
</div>
|
136
|
136
|
<div class="splitLine"></div>
|
137
|
137
|
<van-cell-group inset>
|
|
@@ -169,13 +169,11 @@ export default {
|
169
|
169
|
},
|
170
|
170
|
setup() {
|
171
|
171
|
const { proxy } = getCurrentInstance();
|
172
|
|
- const router = useRouter();
|
173
|
172
|
const configInfo = reactive({
|
174
|
173
|
corpid:'',
|
175
|
174
|
user_id:'',
|
176
|
175
|
external_userid:''
|
177
|
176
|
})
|
178
|
|
-
|
179
|
177
|
const list = ref([]);
|
180
|
178
|
const radarlist = ref([]);
|
181
|
179
|
const radarGrouplist = ref([]);
|
|
@@ -185,11 +183,17 @@ export default {
|
185
|
183
|
const finished = ref(true);
|
186
|
184
|
const activeName = ref();
|
187
|
185
|
const key_word = ref('');
|
|
186
|
+ const active = ref(0);
|
|
187
|
+ const sendMes = ref({});
|
188
|
188
|
const actionedit_obj = reactive({
|
189
|
189
|
actioneditCon:'',
|
190
|
190
|
rule_id:'',
|
191
|
191
|
msg_id:''
|
192
|
192
|
});
|
|
193
|
+ const user_nick = reactive({
|
|
194
|
+ name:'',
|
|
195
|
+ remark:'',
|
|
196
|
+ });
|
193
|
197
|
const onSearch = () => {getRadarlist(activeName.value)};
|
194
|
198
|
const editSend_Btn = () => {send(actionedit_obj.rule_id,actionedit_obj.msg_id,actionedit_obj.actioneditCon)};
|
195
|
199
|
const editBoxShow = (rule_id,msg_id,content) => {
|
|
@@ -197,11 +201,43 @@ export default {
|
197
|
201
|
actionedit_obj.rule_id = rule_id
|
198
|
202
|
actionedit_obj.msg_id = msg_id
|
199
|
203
|
actionShow.value = true
|
|
204
|
+ if(configInfo.user_id&&configInfo.external_userid){
|
|
205
|
+ get_nick()
|
|
206
|
+ }else{
|
|
207
|
+ if(!configInfo.user_id){
|
|
208
|
+ getWxConfig('',(authInfo)=>{url_pin(authInfo)});
|
|
209
|
+ }
|
|
210
|
+ if(!configInfo.external_userid){
|
|
211
|
+ getWxConfig(()=>{get_external_userid()});
|
|
212
|
+ }
|
|
213
|
+ get_nick()
|
|
214
|
+ }
|
200
|
215
|
};
|
201
|
|
-
|
|
216
|
+ const get_nick=()=>{ //获取用户昵称和备注
|
|
217
|
+ (proxy as any).$axios.get("/api/h5/chatMenuPage/customerInfo", {
|
|
218
|
+ corpid: configInfo.corpid,
|
|
219
|
+ user_id:configInfo.user_id,
|
|
220
|
+ external_userid:configInfo.external_userid,
|
|
221
|
+ }, true).then((res) => {
|
|
222
|
+ let data = res.rst.user_info;
|
|
223
|
+ user_nick.name = data.name
|
|
224
|
+ user_nick.remark = data.remark
|
|
225
|
+ }).catch(err => {
|
|
226
|
+ Toast.loading({
|
|
227
|
+ duration:0,
|
|
228
|
+ message: err,
|
|
229
|
+ forbidClick: true,
|
|
230
|
+ });
|
|
231
|
+ })
|
|
232
|
+ }
|
|
233
|
+ const appendCon = (type)=>{
|
|
234
|
+ if(type==1){
|
|
235
|
+ actionedit_obj.actioneditCon+= ' ' + user_nick.name + ' '
|
|
236
|
+ }else if(type==2){
|
|
237
|
+ actionedit_obj.actioneditCon+= ' ' + user_nick.remark + ' '
|
|
238
|
+ }
|
|
239
|
+ }
|
202
|
240
|
const switchGroup = (val) => val&&getRadarlist(val);
|
203
|
|
- const active = ref(0);
|
204
|
|
- const sendMes = ref({});
|
205
|
241
|
const onClickTab = ({ title }) =>{
|
206
|
242
|
if(title == '分组话术'){
|
207
|
243
|
getRadarGrouplist()
|
|
@@ -233,7 +269,6 @@ export default {
|
233
|
269
|
link.click();
|
234
|
270
|
document.body.removeChild(link);
|
235
|
271
|
}
|
236
|
|
-
|
237
|
272
|
function get_external_userid () {//获取external_userid
|
238
|
273
|
wx.invoke('getCurExternalContact', {
|
239
|
274
|
}, function(res){
|
|
@@ -347,6 +382,7 @@ export default {
|
347
|
382
|
}
|
348
|
383
|
|
349
|
384
|
const send=(rule_id,msg_id,editCon)=>{
|
|
385
|
+ actionShow.value = false;
|
350
|
386
|
overshow.value = true;
|
351
|
387
|
getmesBody(rule_id,msg_id,editCon)//直接发送,因为发送不需要user_id he external_userid
|
352
|
388
|
if(configInfo.user_id && configInfo.external_userid){//如果有user_id he external_userid,直接上报数据
|
|
@@ -361,7 +397,6 @@ export default {
|
361
|
397
|
dataReport(rule_id,msg_id)
|
362
|
398
|
}
|
363
|
399
|
}
|
364
|
|
-
|
365
|
400
|
const getmesBody=(rule_id,msg_id,editCon)=>{
|
366
|
401
|
// alert(`${'corpid_getmesBody:'+configInfo.corpid}`);
|
367
|
402
|
// alert(`${'user_id_getmesBody:'+configInfo.user_id}`);
|
|
@@ -396,7 +431,6 @@ export default {
|
396
|
431
|
});
|
397
|
432
|
})
|
398
|
433
|
}
|
399
|
|
-
|
400
|
434
|
const dataReport=(rule_id,msg_id)=>{
|
401
|
435
|
(proxy as any).$axios.get("/api/h5/chatMenuPage/report", {
|
402
|
436
|
corpid: configInfo.corpid,
|
|
@@ -416,7 +450,6 @@ export default {
|
416
|
450
|
|
417
|
451
|
})
|
418
|
452
|
}
|
419
|
|
-
|
420
|
453
|
const sendRadar=()=>{
|
421
|
454
|
let enterChat_obj={enterChat: true}
|
422
|
455
|
let synthetic_obj = {...enterChat_obj,...sendMes.value}
|
|
@@ -427,6 +460,7 @@ export default {
|
427
|
460
|
}
|
428
|
461
|
})
|
429
|
462
|
}
|
|
463
|
+
|
430
|
464
|
const onLoad = () => {
|
431
|
465
|
// 异步更新数据
|
432
|
466
|
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
|
|
@@ -457,13 +491,15 @@ export default {
|
457
|
491
|
finished,
|
458
|
492
|
radarlist,
|
459
|
493
|
radarGrouplist,
|
|
494
|
+ user_nick,
|
460
|
495
|
onLoad,
|
461
|
496
|
onSearch,
|
462
|
497
|
onClickTab,
|
463
|
498
|
switchGroup,
|
464
|
499
|
send,
|
465
|
500
|
editBoxShow,
|
466
|
|
- editSend_Btn
|
|
501
|
+ editSend_Btn,
|
|
502
|
+ appendCon
|
467
|
503
|
|
468
|
504
|
};
|
469
|
505
|
}
|