系统消息跳转

fix/0523-ch
ch 3 years ago
parent 5100284312
commit 742b847a45

@ -2,18 +2,18 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-26 14:32:03 * @Date: 2022-03-26 14:32:03
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-21 19:10:58 * @LastEditTime: 2022-05-25 14:49:52
* @Description: file content * @Description: file content
--> -->
<template> <template>
<view class="main"> <view class="main">
<view class="msg-item" v-for="item in msgData" :key="item.id"> <view class="msg-item" v-for="item in msgData" :key="item.id">
<view class="msg-item--title"> <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> <text class="msg-item--time">{{FormatDate(item.createTimeStamp, 'mm-dd hh:ii:ss')}}</text>
</view> </view>
<view class="msg-item--con"> <view class="msg-item--con" @click="handleDetail(item)">
<image class="msg-item--img" src="@/static/message/xt.png" mode="widthFix"/> <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 class="msg-item--desc">{{item.payload.content}}</view>
</view> </view>
</view> </view>
@ -35,7 +35,8 @@ export default {
return data; return data;
}, },
msgData (){ msgData (){
return this.curSessionData ? this.curSessionData.messageList : []; let data = this.curSessionData ? this.curSessionData.messageList : [];
return Object.assign([],data).reverse();
} }
}, },
watch:{ watch:{
@ -68,7 +69,7 @@ export default {
}, },
async getHistoryMsg(){ async getHistoryMsg(){
this.loading = true; 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({ await ToAsyncAwait(Im.getHistoryMsg({
content : { content : {
sessionId : this.$route.query.sessionId, sessionId : this.$route.query.sessionId,
@ -85,6 +86,23 @@ export default {
sessionId : this.$route.query.sessionId 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
}
} }
} }
} }

Loading…
Cancel
Save