countryInformationDetails.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="" style="margin: 0 40upx;">
  3. <u-navbar :back-text="i18n('Back')" :back-text-style="backStyle"
  4. back-icon-color="#fff" title-color="#fff"
  5. :title="i18n('InformationDetails')"
  6. :background="background">
  7. </u-navbar>
  8. <view class="overFlow">
  9. {{initData.title}}
  10. </view>
  11. <view class="time">
  12. {{ formatDate(initData.publishDate) }} | {{$t('common.Source')}} {{initData.auther}}
  13. </view>
  14. <rich-text class="content" :nodes="initData.contentHtml"
  15. ></rich-text>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. baseEntityId:null,
  23. initData:{},
  24. background:{
  25. backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
  26. },
  27. backStyle:{
  28. color:'#fff'
  29. },
  30. }
  31. },
  32. onShow(){
  33. this.getinitData();
  34. },
  35. onLoad(option){
  36. this.baseEntityId = option.id;
  37. },
  38. methods:{
  39. i18n (data) {
  40. return this.$t('common.'+data);
  41. },
  42. async getinitData(){
  43. const res = await this.$myRequest({
  44. url: 'cms/cmsInformationViews/getInformationById',
  45. data: {
  46. baseId:this.baseEntityId,
  47. language:this.$i18n.locale.toUpperCase()
  48. }
  49. });
  50. if(res.data){
  51. this.initData = res.data.cmsInformationView;
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. page {
  59. background-color: #fff;
  60. }
  61. .overFlow {
  62. margin: 10upx 0upx;
  63. font-size:36upx;
  64. // text-align: center;
  65. font-weight: 700;
  66. }
  67. .time {
  68. margin: 0 0upx;
  69. }
  70. /deep/.u-line-1 {
  71. overflow: visible !important;
  72. }
  73. </style>