LocationMessageRender.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. this.$emit('enterSubPage');
  43. uni.navigateTo({
  44. url: `/pages/conversation/previewLocation/index?latng=${this.locationDetails.latng}`,
  45. });
  46. },
  47. },
  48. };
  49. </script>
  50. <style lang="scss" scoped>
  51. .location_message_container {
  52. width: 444rpx;
  53. border-radius: 12rpx;
  54. border-width: 1px;
  55. border-style: solid;
  56. border-color: #e6e6e6;
  57. background-color: #fff !important;
  58. }
  59. .location_title {
  60. lines: 1;
  61. text-overflow: ellipsis;
  62. overflow: hidden;
  63. color: #0c1c33;
  64. }
  65. .location_subTitle {
  66. lines: 1;
  67. text-overflow: ellipsis;
  68. overflow: hidden;
  69. color: #999;
  70. font-size: 24rpx;
  71. }
  72. .desc_container {
  73. padding: 24rpx;
  74. }
  75. </style>