<style>
.richtext {
  width: 100%;
  height: 100vh;
  background-color: #FFF;
}

</style>

<template>
  <view class="richtext">
	<jinEdit placeholder="开始输入..." @editOk="editOk" :uploadFileUrl="action" :html="Content"></jinEdit>
  </view>
</template>

<script>
import jinEdit from '../components/jin-edit.vue';
export default {
  components: {
    
	jinEdit
  },
  data() {
    return {
      pageTitle: "详情描述",
      mainColor: "",
	  action: this.host2 + "/api/File/UploadTencent",
	  Content:'',
	  showedit:false,
    };
  },
  created() {
    this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
    this.mainColor = this.$uiConfig.mainColor;
  },
  mounted() {
  
    uni.setNavigationBarTitle({
      title: this.pageTitle,
    });
	let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
	this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
  },
  onLoad: function (option) {    
	if(option && option.Content){
		this.Content = option.Content
	}
  },
  methods: {
   editOk(res){
	   let html = res.html
	   let pages = getCurrentPages(); // 当前页面
	  
	   let beforePage = pages[pages.length - 2]; // 前一个页面
	    console.log(53,beforePage)
	   setTimeout(()=>{
	   	 uni.navigateBack({
	   		 success: function() {
	   			 beforePage.$vm.Children(html); // 执行前一个页面的方法
	   		 }
	   	 });
	   },100)
   }


  },
};
</script>
