LocationMessageRender.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view @click="toDetails" class="location_message_container">
  3. <view class="desc_container">
  4. <view class="location_title">
  5. {{ locationDetails.name }}
  6. </view>
  7. <view class="location_subTitle">
  8. {{ locationDetails.addr }}
  9. </view>
  10. </view>
  11. <u--image
  12. :showLoading="true"
  13. :src="locationDetails.url"
  14. width="444rpx"
  15. height="222rpx"
  16. @click="toDetails"
  17. ></u--image>
  18. </view>
  19. </template>
  20. <script>
  21. import { PageEvents } from "../../../../../constant";
  22. export default {
  23. name: "LocationMessageRender",
  24. components: {},
  25. props: {
  26. message: Object,
  27. },
  28. computed: {
  29. locationDetails() {
  30. let info = {};
  31. try {
  32. info = JSON.parse(this.message.locationElem.description);
  33. } catch (e) {}
  34. return info;
  35. },
  36. },
  37. data() {
  38. return {};
  39. },
  40. methods: {
  41. toDetails() {
  42. uni.navigateTo({
  43. url: `/pages/conversation/previewLocation/index?latng=${this.locationDetails.latng}`,
  44. });
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .location_message_container {
  51. width: 444rpx;
  52. border-radius: 12rpx;
  53. border: 1px solid #e6e6e6;
  54. background-color: #fff !important;
  55. .location_title,
  56. .location_subTitle {
  57. @include nomalEllipsis();
  58. color: #0c1c33;
  59. }
  60. .location_subTitle {
  61. font-size: 24rpx;
  62. color: #999;
  63. }
  64. .desc_container {
  65. padding: 24rpx;
  66. }
  67. }
  68. </style>