bjq.vue 932 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="content">
  3. <jinEdit placeholder="请输入企业简介" @editOk="editOk" uploadFileUrl="/api/upload/image" :header="{'Authori-zation': AuthoriZation}" :showImgSize="true" :html="content"></jinEdit>
  4. </view>
  5. </template>
  6. <script>
  7. import jinEdit from '@/components/jin-edit/jin-edit.vue';
  8. export default {
  9. components: {
  10. jinEdit
  11. },
  12. data() {
  13. return {
  14. AuthoriZation: '',
  15. content: ''
  16. }
  17. },
  18. onLoad() {
  19. this.content = this.$api.prePage().content
  20. this.AuthoriZation = 'Bearer ' + uni.getStorageSync('token')
  21. },
  22. methods: {
  23. editOk(res) {
  24. let obj = this
  25. console.log(res);
  26. // 保存富文本转出的html
  27. let html = res.html
  28. console.log(obj.$api.prePage().content,'obj.$api.prePage().data')
  29. obj.$api.prePage().content = html.replace(/<img/g,"<img style='max-width:100%;height:auto;'")
  30. uni.navigateBack({})
  31. }
  32. }
  33. }
  34. </script>
  35. <style>
  36. </style>