This commit is contained in:
wtq
2026-02-04 10:41:06 +08:00
parent 3d1e6d762d
commit 4e59aec9f5
3 changed files with 74 additions and 36 deletions

View File

@@ -317,9 +317,10 @@
prop="pricePercentage"
v-if="!(addStore.vendorID === 16 && !vendorQuery.isBind)"
>
<!-- :disabled="isDisableByBrand" -->
<el-radio-group
v-model="addStore.createDeliveryType"
:disabled="isDisableByBrand"
:disabled="deliveryTypeDisable"
>
<el-radio :label="0">品牌发单</el-radio>
<el-radio :label="1">门店发单</el-radio>
@@ -1359,8 +1360,11 @@ export default {
// (this.vendorQuery.isBind && this.addStore.isSync === 1)
// ? true
// : false
// : false;
// : false;
// },
deliveryTypeDisable(){
return localStorage.getItem('mobile') === '18981810340' ? false : this.isDisableByBrand
},
supplierID() {
return this.createEbaiForm.supplierID

View File

@@ -38,7 +38,8 @@
<el-badge
:value="+item.NewMessageNum"
:max="99"
style=" margin-top: 10px; margin-right: 40px;" :hidden="false"
style=" margin-top: 10px; margin-right: 40px;"
:hidden="!item.NewMessageNum ? true : false"
>
<!-- <span >门店聊天</span> -->
<div
@@ -219,13 +220,13 @@
<!-- 图片 -->
<el-popover
placement="right"
width="300"
width="1000"
trigger="hover"
v-else-if="item.msg_type == 2 || item.msg_type == 12">
<div>
<img :src="item.msg_content" alt="缩略图..." width="100%" />
</div>
<img slot="reference" :src="item.msg_content" alt="略缩图" style="width:100px;height:240px" />
<img slot="reference" :src="item.msg_content" alt="略缩图" style="width:200px;height:240px" />
</el-popover>
<!-- 视频 -->
@@ -313,6 +314,10 @@ export default {
isGetDetail:{
type:Boolean,
default:false
},
value:{
type:Number,
default:0
}
},
data() {
@@ -353,11 +358,14 @@ export default {
let mt = this.allUserList.mt
let elm = this.allUserList.elm
let jd = this.allUserList.jd
return mt.concat(elm).concat(jd) || []
let arr = mt.concat(elm).concat(jd) || []
if(arr.length>0) this.$emit("input", arr.length)
// console.log(this.allUserList,'1111111111,allUser',arr)
return arr
}
},
created(){
return
// return
this.getChatUsersList()
// this.platInfo()
},
@@ -391,20 +399,20 @@ export default {
let arr = []
res.forEach(item => {
let brr = item.vendorStoreList || []
// this.personalStore.push({...item})
this.personalStore.push({
address: "四川省成都市新都区三河场江陵路市场内16-19号摊位老向蔬菜店",
cityName: "成都市",
id: 100296,
name: "谢卫路店",
payeeName: "向文祥",
status: 1,
tel1: "13658078848",
tel2: "13658078848",
elmStoreID:"",
jdStoreID:"",
mtStoreID:"7026352"
})
this.personalStore.push({...item})
// this.personalStore.push({
// address: "四川省成都市新都区三河场江陵路市场内16-19号摊位老向蔬菜店",
// cityName: "成都市",
// id: 100296,
// name: "谢卫路店",
// payeeName: "向文祥",
// status: 1,
// tel1: "13658078848",
// tel2: "13658078848",
// elmStoreID:"",
// jdStoreID:"",
// mtStoreID:"7026352"
// })
// console.log('item',item,'brr',brr)
if(brr.length>0){
brr.map(i => {
@@ -431,23 +439,24 @@ export default {
}
})
// console.log(arr,'this.personalStore',this.personalStore)
// return arr
return arr
// return [{"vendorStoreID":"7290541","vendorID":"1","appID":"589"},{"vendorStoreID":"2233065983","vendorID":"3","appID":"34665"},{"vendorStoreID":"11998833","vendorID":"0","appID":"320406"}]
return [{"vendorStoreID":"7026352","vendorID":"1","appID":"589"}]
// return [{"vendorStoreID":"7026352","vendorID":"1","appID":"589"}]
},
async getUser(flag){
let res = await getChatUserList(this.paramsData,true)
// console.log('1111111111,获取用户列表',res)
if(JSON.stringify(res) === '{}') return
let keys = Object.keys(res)
this.platArr = keys
this.allUserList['mt'] = []
this.allUserList['elm'] = []
this.allUserList['jd'] = []
// this.platInfo(this.platArr)
keys.forEach(i => {
let userArr = i.split(':')
// this.allUserList[userArr[0]] = {}
this.allUserList['mt'] = []
this.allUserList['elm'] = []
this.allUserList['jd'] = []
if(userArr[2] === '1'){
// 美团
// this.allUserList['mt'] = []
@@ -479,12 +488,21 @@ export default {
})
}else if(userArr[2] === '3'){
// 淘宝闪购
this.allUserList['elm'] = []
res[i].reverse().forEach.forEach(element => {
// this.allUserList['elm'] = []
// console.log('i,iiiiiiiiiiiiiii',i,'res,,,翻转arr')
// debugger
res[i].reverse().forEach(element => {
let resData = JSON.parse(element)
let findIndex = this.allUserList['elm'].findIndex(item => item.payLoad.groupId === resData.payLoad.groupId)
// debugger
let findIndex = this.allUserList['elm'].findIndex(item => item.userID === resData.userID)
if(findIndex === -1){
let latestMsgHandler = resData.latestMsg
// let latestMsgHandler = resData.latestMsg
let latestMsgHandler = JSON.parse(resData.latestMsg).text ? JSON.parse(resData.latestMsg).text : JSON.parse(resData.latestMsg).duration ? '【语音】' : '【图片】'
if (JSON.parse(resData.latestMsg).elements && JSON.parse(resData.latestMsg).elements.length > 0) {
let findItem = JSON.parse(resData.latestMsg).elements.filter(item => item.elementType === 1)
latestMsgHandler = findItem && findItem.length > 0 ? JSON.parse(findItem[0].elementContent).text.replace('@商家', '') : latestMsgHandler
}
let find = this.personalStore.find(i => i.mtStoreID === userArr[1])
this.allUserList['elm'].push({
...resData,
@@ -496,8 +514,22 @@ export default {
vendorStoreID:userArr[1],
storeInfo:find || ""
})
console.log('111111111,,饿了么',this.allUserList['elm'])
}else{
// this.allUserList['elm'][findIndex] = {
// ...resData,
// latestMsg: latestMsgHandler,
// latestTime: timeFormatDHM(+new Date(resData.latestTime )),
// orderInfo: {},
// orderDesc: '',
// platformID:userArr[0],
// vendorStoreID:userArr[1],
// storeInfo:find || ""
// }
}
})
console.log('1111111111,获取用户列表,,, this.allUserList饿了么', this.allUserList)
// debugger
}else if(userArr[2] === '0'){
// 京东
this.allUserList['JD'][userArr[1]] = []
@@ -523,7 +555,7 @@ export default {
})
if(this.isGetDetail) this.queryDetailFirst(flag)
// console.log('allUserList,,,allUserList',this.allUserList)
console.log('allUserList,,,allUserList',this.allUserList)
},
queryDetailFirst(flag){
if(!this.currentUser){
@@ -572,9 +604,9 @@ export default {
queryDetailBut:debounce(
function name(query,falg,type) {
if(type && type === 'click'){
console.log('11111111111,,聊天记里',query)
console.log(this.currentUser,'11111111111,,聊天记里',query)
if(query.userID === this.currentUser.userID) return // 不用重复点击
return
// return
}
if(query.userID !== this.currentUser.userID) this.chatDetail = [] // 清空聊天记录
if(this.detailTimer) clearInterval(this.detailTimer)

View File

@@ -507,11 +507,12 @@
</el-tab-pane>
<el-tab-pane name="storechat">
<span slot="label">
<el-badge value="new" style=" margin-top: 10px; margin-right: 40px;" :hidden="false">
<span >门店聊天</span>
<el-badge value="new" style=" margin-top: 10px; margin-right: 40px;" :hidden="allUser ? false: true">
<!-- <span></span> -->
<div style="margin-top:-10px">门店聊天</div>
</el-badge>
</span>
<ChatDetail :isGetDetail="isGetDetail"></ChatDetail>
<ChatDetail :isGetDetail="isGetDetail" v-model="allUser"></ChatDetail>
</el-tab-pane>
</el-tabs>
@@ -621,6 +622,7 @@ export default {
},
data() {
return {
allUser:0, // 聊天详情,所有用户信息条数
isGetDetail:false,
newFeatures: [],
html: '',