|
|
|
@ -3,97 +3,113 @@
|
|
|
|
|
class="message-item"
|
|
|
|
|
:class="{
|
|
|
|
|
[`--${messageType[props.message.type]}`]: true,
|
|
|
|
|
'--notify': messageType[props.message.type] === 'custom' && content.type === 'transferWaiterSession',
|
|
|
|
|
'--self': props.message.fromId !== props.session.fromId,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<!-- -->
|
|
|
|
|
<div v-if="!['revoke', 'notify'].includes(messageType[props.message.type])" class="avatar">
|
|
|
|
|
<el-avatar :src="props.message.fromAvatar" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="message-body">
|
|
|
|
|
<div v-if="!['revoke', 'notify'].includes(messageType[props.message.type])" class="name">
|
|
|
|
|
{{ props.message.fromNickname }}
|
|
|
|
|
<template v-if="['notify', 'revoke'].includes(messageType[props.message.type])">
|
|
|
|
|
<div class="content shadow">
|
|
|
|
|
{{ store.getters['chat/parseText'](props.message) }}
|
|
|
|
|
</div>
|
|
|
|
|
<template v-if="messageType[props.message.type] === 'custom'">
|
|
|
|
|
<a v-if="content.type === 'link'" class="content shadow" :href="content.linkJump" target="_blank">
|
|
|
|
|
{{ content.content }}
|
|
|
|
|
</a>
|
|
|
|
|
<el-card v-if="content.type === 'product'" class="shadow">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="left">商品编号:{{ content.id }}</div>
|
|
|
|
|
<el-button type="text" @click="$copy(content.id)">复制</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="flex product" @click="handleProductDetail(content.id)">
|
|
|
|
|
<el-image :alt="content.name" height="64px" :src="content.productImageUrl" width="64px" />
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div class="name">{{ content.name }}</div>
|
|
|
|
|
<div class="price">¥{{ content.startingPrice }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<el-button @click="handleProduct(content.id)">商品规格属性</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-card v-if="content.type === 'order'" class="shadow">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="status">{{ content.orderStatusDesc }}</div>
|
|
|
|
|
<div class="service"></div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="messageType[props.message.type] === 'custom' && content.type === 'transferWaiterSession'">
|
|
|
|
|
<div class="message-body">
|
|
|
|
|
<div v-if="content.type === 'transferWaiterSession'" class="content shadow">
|
|
|
|
|
{{ store.getters['chat/parseText'](props.message) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="avatar">
|
|
|
|
|
<el-avatar :src="props.message.fromAvatar" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="message-body">
|
|
|
|
|
<div class="name">
|
|
|
|
|
{{ props.message.fromNickname }}
|
|
|
|
|
</div>
|
|
|
|
|
<template v-if="messageType[props.message.type] === 'custom'">
|
|
|
|
|
<a v-if="content.type === 'link'" class="content shadow" :href="content.linkJump" target="_blank">
|
|
|
|
|
{{ content.content }}
|
|
|
|
|
</a>
|
|
|
|
|
<el-card v-if="content.type === 'product'" class="shadow">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="left">商品编号:{{ content.id }}</div>
|
|
|
|
|
<el-button type="text" @click="$copy(content.id)">复制</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="flex product" @click="handleProductDetail(content.id)">
|
|
|
|
|
<el-image :alt="content.name" height="64px" :src="content.productImageUrl" width="64px" />
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div class="name">{{ content.name }}</div>
|
|
|
|
|
<div class="price">¥{{ content.startingPrice }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="no">订单编号:{{ content.orderNo }}</div>
|
|
|
|
|
<el-button type="text" @click="$copy(content.orderNo)">复制</el-button>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<el-button @click="handleProduct(content.id)">商品规格属性</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<el-image
|
|
|
|
|
:alt="content.productName"
|
|
|
|
|
height="64px"
|
|
|
|
|
:src="content.productImageUrl"
|
|
|
|
|
width="64px"
|
|
|
|
|
/>
|
|
|
|
|
<div class="right">
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-card v-if="content.type === 'order'" class="shadow">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="name">{{ content.productName }}</div>
|
|
|
|
|
<div class="price">¥{{ content.payAmount }}</div>
|
|
|
|
|
<div class="status">{{ content.orderStatusDesc }}</div>
|
|
|
|
|
<div class="service"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="sku">{{ content.skuDescribe || '默认规格' }}</div>
|
|
|
|
|
<div class="count">x{{ content.quantity || 1 }}</div>
|
|
|
|
|
<div class="no">订单编号:{{ content.orderNo }}</div>
|
|
|
|
|
<el-button type="text" @click="$copy(content.orderNo)">复制</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<el-image
|
|
|
|
|
:alt="content.productName"
|
|
|
|
|
height="64px"
|
|
|
|
|
:src="content.productImageUrl"
|
|
|
|
|
width="64px"
|
|
|
|
|
/>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="name">{{ content.productName }}</div>
|
|
|
|
|
<div class="price">¥{{ content.payAmount }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<div class="sku">{{ content.skuDescribe || '默认规格' }}</div>
|
|
|
|
|
<div class="count">x{{ content.quantity || 1 }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<el-button @click="handleOrder(content.orderId)">查看详情</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
<div v-else-if="messageType[props.message.type] === 'image'" class="content shadow">
|
|
|
|
|
<el-image
|
|
|
|
|
alt="[图片消息]"
|
|
|
|
|
:src="store.getters['chat/parseImage'](props.message.payload)"
|
|
|
|
|
style="max-width: 240px"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="messageType[props.message.type] === 'video'" class="shadow">
|
|
|
|
|
<video controls width="240">
|
|
|
|
|
<source :src="store.getters['chat/parseVideo'](props.message.payload)" type="video/mp4" />
|
|
|
|
|
<object
|
|
|
|
|
:data="store.getters['chat/parseVideo'](props.message.payload)"
|
|
|
|
|
height="240"
|
|
|
|
|
width="320"
|
|
|
|
|
></object>
|
|
|
|
|
</video>
|
|
|
|
|
<div class="footer">
|
|
|
|
|
<el-button @click="handleOrder(content.orderId)">查看详情</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
<div v-else-if="messageType[props.message.type] === 'image'" class="content shadow">
|
|
|
|
|
<el-image
|
|
|
|
|
alt="[图片消息]"
|
|
|
|
|
:src="store.getters['chat/parseImage'](props.message.payload)"
|
|
|
|
|
style="max-width: 240px"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="messageType[props.message.type] === 'video'" class="shadow">
|
|
|
|
|
<video controls width="240">
|
|
|
|
|
<source :src="store.getters['chat/parseVideo'](props.message.payload)" type="video/mp4" />
|
|
|
|
|
<object
|
|
|
|
|
:data="store.getters['chat/parseVideo'](props.message.payload)"
|
|
|
|
|
height="240"
|
|
|
|
|
width="320"
|
|
|
|
|
></object>
|
|
|
|
|
</video>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="content shadow">
|
|
|
|
|
{{ store.getters['chat/parseText'](props.message) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="content shadow">
|
|
|
|
|
{{ store.getters['chat/parseText'](props.message) }}
|
|
|
|
|
<div class="time">
|
|
|
|
|
{{ store.getters['chat/parseTime'](props.message.createTimeStamp) }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="!['revoke', 'notify'].includes(messageType[props.message.type])" class="time">
|
|
|
|
|
{{ store.getters['chat/parseTime'](props.message.createTimeStamp) }}
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|