You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/pages/account/message/list.vue

93 lines
1.9 KiB

<!--
* @Author: ch
* @Date: 2022-03-26 14:32:03
* @LastEditors: ch
3 years ago
* @LastEditTime: 2022-04-26 16:57:20
* @Description: file content
-->
<template>
<view>
3 years ago
<view class="msgItem" v-for="item in msgData" :key="item.id">
<view class="msgItem--title">
3 years ago
<text>{{item.payload.title}}</text>
<text class="msgItem--time">{{item.createTimeStamp}}</text>
</view>
<view class="msgItem--con">
3 years ago
<image class="msgItem--img" src="@/static/message/xt.png" mode="widthFix"/>
<view class="msgItem--desc">{{item.payload.content}}</view>
</view>
</view>
</view>
</template>
<script>
3 years ago
import {MsbWebSkt, createUUID} from '@/common/utils';
export default {
3 years ago
computed:{
msgData (){
// console.log(this.$store.state.sessionData,'---',this.$Route.query.id);
const sessionData = this.$store.state.sessionData.find(i =>i.id == this.$Route.query.id)
return sessionData ? sessionData.messageList : [];
}
},
onShow(){
this.getHistoryMsg();
},
methods:{
getHistoryMsg(){
// MsbWebSkt.onOpen(()=>{
MsbWebSkt.send({
data : JSON.stringify({
traceId : createUUID(),
traceType : "2",
content: { sessionId : this.$Route.query.id}
}),
success(){
console.log('suxx');
},
fail(e){
console.log('fxx',e);
}
})
// })
},
xx(){
console.log(this.$store.state.sessionData);
}
}
}
</script>
<style lang="scss" scoped>
.msgItem{
padding: 40rpx 0 0 40rpx;
&--title{
display: flex;
justify-content: space-between;
align-items: center;
padding-right: 40rpx;
font-size: $font-size-lg;
color: $color-grey6;
}
&--time{
font-size: $font-size-sm;
color: $color-grey4;
}
&--con{
display: flex;
border-bottom: 1px solid $color-grey2;
padding: 40rpx 0;
}
&--img{
width: 140rpx;
height: 140rpx;
border-radius: 12rpx;
margin-right: 40rpx;
}
&--desc{
width: 455rpx;
font-size: $font-size-base;
line-height: 39rpx;
color: $color-grey5;
}
}
</style>