helpDetail.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view>
  3. <!-- <view class="helpTitle">{{ resultData.helpWordTitle }}</view> -->
  4. <view class="helpCon" v-html="content"></view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. helpWordId: '',
  12. resultData:[],
  13. content:''
  14. };
  15. },
  16. onLoad(options) {
  17. this.helpWordId = options.helpWordId
  18. uni.setNavigationBarTitle({
  19. title: options.title
  20. });
  21. if (this.helpWordId) {
  22. this.getContent()
  23. }
  24. },
  25. methods: {
  26. getContent() {
  27. let data = {
  28. helpWordId: this.helpWordId,
  29. }
  30. this.$Request.get("/app/helpWord/selectHelpWordDetails", data).then(res => {
  31. if (res.code == 0) {
  32. this.resultData = res.data
  33. this.content = res.data.helpWordContent.replace(new RegExp("img","g"),'img style="width:100%;height:auto;"')
  34. } else {
  35. uni.showToast({
  36. title: res.msg,
  37. icon: 'none'
  38. })
  39. }
  40. });
  41. }
  42. }
  43. };
  44. </script>
  45. <style>
  46. page {
  47. background-color: #FFFFFF;
  48. }
  49. .helpTitle {
  50. font-size: 40rpx;
  51. font-weight: bold;
  52. margin: 50rpx 30rpx 30rpx;
  53. color: #000;
  54. }
  55. .helpCon {
  56. font-size: 30rpx;
  57. margin: 30rpx 30rpx 50rpx;
  58. color: #000;
  59. line-height: 2em;
  60. }
  61. </style>