index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <!-- <view class=""> -->
  3. <!-- </view> -->
  4. <view class="page">
  5. <navBar :backType="navBarTitle" :title="navBarTitle?navBarTitle:'小程序使用指南'" :back="true" color="black"
  6. background="white" />
  7. <view class="content">
  8. <view class="title">
  9. {{content.title}}
  10. </view>
  11. <view class="p">
  12. <u-parse :content="content.content"></u-parse>
  13. </view>
  14. <image :src="picBase+content.image" mode=""></image>
  15. </view>
  16. <view class="btnBox" v-if="showBtn">
  17. <button open-type="share" class="rBtn">
  18. 一键分享
  19. </button>
  20. </view>
  21. <u-loading-page :loading="loading" image="/static/index/logo.png" loading-text="页面加载中..."></u-loading-page>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. getUserGuideReq,
  27. } from '@/api/my/index.js'
  28. export default {
  29. components: {
  30. },
  31. data() {
  32. return {
  33. picBase: this.$picBase,
  34. content: {
  35. title: ''
  36. },
  37. navBarTitle: '',
  38. showBtn: true,
  39. loading: true
  40. }
  41. },
  42. async onLoad(o) {
  43. // o.id = 16
  44. if (o.id) {
  45. this.showBtn = false
  46. this.navBarTitle = '首页'
  47. let res = await getUserGuideReq()
  48. if (res.code == 0) {
  49. this.content = res.data
  50. this.loading = false
  51. } else {
  52. uni.showToast({
  53. title: res.message,
  54. icon: 'none'
  55. })
  56. }
  57. } else {
  58. let res = await getUserGuideReq()
  59. if (res.code == 0) {
  60. this.content = res.data
  61. this.loading = false
  62. } else {
  63. uni.showToast({
  64. title: res.message,
  65. icon: 'none'
  66. })
  67. }
  68. }
  69. },
  70. onShareAppMessage(params) {
  71. if (params.from === 'button' || params.from === 'menu') {
  72. return {
  73. title: this.content.title,
  74. imageUrl: this.$picBase + this.content.image,
  75. path: '/pages/my/useLead/index?id=' + this.content.id,
  76. mpId: this.$appId,
  77. type: this.$shareType,
  78. }
  79. }
  80. },
  81. methods: {
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. @import "./index.scss";
  87. </style>