details.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class="phone-tongzhi-page">
  3. <view class="icon-title-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <text class="nav-bar-title">{{tzData.name}}</text>
  6. </view>
  7. <view class="tongzhi-body-box">
  8. <!-- <view class="tongzhi-name">{{tzData.name}}</view> -->
  9. <view class="tongzhi-time">{{tzData.time}}</view>
  10. <rich-text :nodes="tzData.content" class="tongzhi-content"></rich-text>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. import {onLoad,onShow} from '@dcloudio/uni-app';
  16. import {getAppNoticeInfo} from '@/api/shouye.js'
  17. import {ref,reactive} from "vue"
  18. const tzData = reactive({
  19. name: '',
  20. time: '',
  21. content: '',
  22. })
  23. onLoad((options) => {
  24. console.log(options,'options');
  25. initPage(options);
  26. })
  27. function goUpPage(){
  28. uni.redirectTo({
  29. url: '/pages/admin/tongzhi/list'
  30. })
  31. }
  32. function initPage(options) {
  33. const opt = {
  34. noticeId: options.noticeId,
  35. }
  36. getAppNoticeInfo(opt).then(res => {
  37. tzData.name = res.data.name;
  38. tzData.time = res.data.createTime;
  39. tzData.content = res.data.content;
  40. })
  41. }
  42. </script>
  43. <style>
  44. </style>