helpDetail.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. console.log(this.helpWordId ,options.helpWordId)
  19. console.log(options)
  20. if (this.helpWordId) {
  21. this.getContent()
  22. }
  23. },
  24. methods: {
  25. getContent() {
  26. let data = {
  27. helpWordId: this.helpWordId,
  28. }
  29. this.$Request.get("/app/helpWord/selectHelpWordDetails", data).then(res => {
  30. if (res.code == 0) {
  31. this.resultData = res.data
  32. uni.setNavigationBarTitle({
  33. title:this.resultData.helpWordTitle
  34. });
  35. this.content = res.data.helpWordContent.replace(new RegExp("img","g"),'img style="width:100%;height:auto;"')
  36. } else {
  37. uni.showToast({
  38. title: res.msg,
  39. icon: 'none'
  40. })
  41. }
  42. });
  43. }
  44. }
  45. };
  46. </script>
  47. <style>
  48. page {
  49. background-color: #FFFFFF;
  50. }
  51. .helpTitle {
  52. font-size: 40rpx;
  53. font-weight: bold;
  54. margin: 50rpx 30rpx 30rpx;
  55. color: #000;
  56. }
  57. .helpCon {
  58. font-size: 30rpx;
  59. margin: 30rpx 30rpx 50rpx;
  60. color: #000;
  61. line-height: 2em;
  62. }
  63. </style>