prodetail.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="sub">
  3. <view class="gpd">
  4. <view class="guidtit" v-if="detail.noticeTitle">
  5. {{detail.noticeTitle}}
  6. </view>
  7. <!-- <view class="guidtime" v-if="detail.createTime">{{detail.createTime}}</view> -->
  8. <rich-text v-if="noticeContent" :nodes="noticeContent"></rich-text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import url from "@/util/url";
  14. let {imgDomain} = url
  15. export default{
  16. data(){
  17. return{
  18. string:'',
  19. detail:{},
  20. noticeContent:'',
  21. id:''
  22. }
  23. },
  24. onLoad(e) {
  25. this.type=e.type
  26. this.getDataFn(e.id)
  27. },
  28. methods:{
  29. getDataFn(e){
  30. var that=this;
  31. that.$http.get("boman-system/notice/"+e).then(res => {
  32. if (res.code == 200) {
  33. if(res.data.noticeContent){
  34. var t='<img style="max-width: 100%;" src="';
  35. var newhtml=res.data.noticeContent.replace(/\<img src="/gi, t);
  36. that.noticeContent=newhtml;
  37. }
  38. that.detail=res.data
  39. } else {
  40. uni.showToast({
  41. title: res.msg,
  42. duration: 1000,
  43. icon: 'none'
  44. });
  45. }
  46. })
  47. },
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .sub{box-sizing: border-box;width: 100%;min-height: 100vh;}
  53. .gpd{padding:30rpx 26rpx;}
  54. .guidtit{font-size: 30rpx;font-weight: bold;color: #222222;margin-bottom: 32rpx;}
  55. .guidtime{font-size: 20rpx;color: #676767;margin-bottom: 60rpx;}
  56. </style>