<template>
 <!-- <view
    :class="[
      'user_card_msg_container',
      isSelf ? 'user_card_msg_container_mine' : 'user_card_msg_container_other',
    ]"
  > -->
  <view>
   <!-- <view class="user_card_content">
      <view class="user_card_content_header">
        <u-avatar shape="square" :src="avatarUrl" size="30"></u-avatar>
        <text class="nickName">{{ msgBody.nickName }} {{msgBody}}</text>
      </view>
      <u-line></u-line>
      <text class="user_card_footer">商品卡片</text>
    </view> -->
	<view class="user_card_content">
			<view class="title">商品名称:{{msgBody.customExts.title}}</view>
			<view>商品价格：¥{{msgBody.customExts.price}}</view>
			<view class="img">
				<img :src="msgBody.customExts.image" alt="">
			</view>
			<!-- <view class="">
				msgBody.from:{{msgBody.from}}
			</view> -->
	</view>
  </view>
</template>

<script>
export default {
  props: {
    msgBody: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      defaultAvatar: 'https://app.bjtdba.com/uploads/logo.jpg', //默认头像
    };
  },
  computed: {
    // isSelf() {
    //   const { from } = this.msgBody;
    //   return (
    //     from === this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
    //   );
    // },
    // avatarUrl() {
    //   return this.msgBody?.customExts?.avatarurl || this.defaultAvatar;
    // },
    // nickName() {
    //   return (
    //     this.msgBody?.customExts?.nickname || this.msgBody?.customExts?.uid
    //   );
    // },
  },
};
</script>

<style scoped>
.user_card_msg_container {
  width: 245px;
  height: 60px;
  padding: 5px 8px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
}
.user_card_msg_container_mine {
  flex-direction: row-reverse;
  color: #f9fafa;
  background-color: #009eff;
  border-radius: 16px 12px 4px 16px;
}
.user_card_msg_container_other {
  color: #171a1c;
  background-color: #e5f5ff;
  border-radius: 12px 16px 16px 4px;
}
.user_card_content {
  width:100%;
  height: 100%;
  display: flex;
  box-sizing: border-box;
  padding:10px;
  flex-direction: column;
  justify-content: space-around;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
  background: #eee;
}
.title{
	margin-bottom: 10px;
}
.img{
	width: 200px;
}
.img img{
	width:100%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
	margin-top: 10px;
}
.user_card_content_header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.user_card_content_header text {
  font-family: 'PingFang SC';
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  margin: 0 4px;
}
.user_card_footer {
  font-size: 12px;
}
</style>
