|
|
|
@ -2,18 +2,18 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-03-26 14:32:03
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-05-21 19:10:58
|
|
|
|
|
* @LastEditTime: 2022-05-25 14:49:52
|
|
|
|
|
* @Description: file content
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view class="main">
|
|
|
|
|
<view class="msg-item" v-for="item in msgData" :key="item.id">
|
|
|
|
|
<view class="msg-item--title">
|
|
|
|
|
<text>{{item.payload.title }} {{item.id}}</text>
|
|
|
|
|
<text>{{item.payload.title }}</text>
|
|
|
|
|
<text class="msg-item--time">{{FormatDate(item.createTimeStamp, 'mm-dd hh:ii:ss')}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="msg-item--con">
|
|
|
|
|
<image class="msg-item--img" src="@/static/message/xt.png" mode="widthFix"/>
|
|
|
|
|
<view class="msg-item--con" @click="handleDetail(item)">
|
|
|
|
|
<image class="msg-item--img" :src="item.payload.productImageUrls ? item.payload.productImageUrls[0] : require('@/static/message/xt.png')" mode="widthFix"/>
|
|
|
|
|
<view class="msg-item--desc">{{item.payload.content}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -35,7 +35,8 @@ export default {
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
msgData (){
|
|
|
|
|
return this.curSessionData ? this.curSessionData.messageList : [];
|
|
|
|
|
let data = this.curSessionData ? this.curSessionData.messageList : [];
|
|
|
|
|
return Object.assign([],data).reverse();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
@ -68,7 +69,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
async getHistoryMsg(){
|
|
|
|
|
this.loading = true;
|
|
|
|
|
const lastMsg = this.msgData?.length ? this.msgData[0] : {};
|
|
|
|
|
const lastMsg = this.msgData?.length ? this.msgData[this.msgData.length - 1] : {};
|
|
|
|
|
await ToAsyncAwait(Im.getHistoryMsg({
|
|
|
|
|
content : {
|
|
|
|
|
sessionId : this.$route.query.sessionId,
|
|
|
|
@ -85,6 +86,23 @@ export default {
|
|
|
|
|
sessionId : this.$route.query.sessionId
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 点击详情跳转
|
|
|
|
|
*/
|
|
|
|
|
handleDetail(item){
|
|
|
|
|
if(['orderPay','orderDelivery','orderCancel'].includes(item.payload.customType)){
|
|
|
|
|
this.$Router.push(`/orderDetail?id=${item.payload.primaryId}`)
|
|
|
|
|
}else if(['refundFail','refundSuccess'].includes(item.payload.customType)){
|
|
|
|
|
this.$Router.push(`/saleAfterDetail?id=${item.payload.primaryId}`)
|
|
|
|
|
}else if(item.payload.linkJump){
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
window.location.href = item.payload.linkJump;
|
|
|
|
|
// #endif
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
plus.runtime.openURL(item.payload.linkJump);
|
|
|
|
|
// #endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|