<template>
  <view class="content">
    <view class="main">
      <u-parse :html="richContent.content"></u-parse>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        title: '',
        richContent: {},
        option: {},
        /**
         * url,title,param,
         * */
      }
    },
    onLoad(options) {
		console.log(options);
      // if (options.id) {
      //   this.$http.post(options.url, {
      //     id: options.id
      //   }).then(res => {
      //     if (res.code == 1) {
      //       this.title = '激活流程'
      //       this.richContent = {
      //         content: res.data.content
      //       }
      //     }
      //   })
      //   return
      // }
      if (options.option) {
        this.option = JSON.parse(decodeURIComponent(options.option));
		this.getContent();
      }
    },
    methods: {
      getContent() {
		console.log(this.option.param)
        this.title = this.option.title;
		uni.setNavigationBarTitle({
			title:this.option.title
		})
        // this.$http.post(this.option.url, this.option.param).then(res => {
        //   if (res.code == 1 && res.data) {
        //     this.title = res.data.title || this.option.title
        //     this.richContent = {
        //       content: res.data.content
        //     }
        //   }
        // })
		this.$u.api.getArticleListAjax(this.option.param).then(({code,data})=>{
			if (code == 1 && data) {
				console.log(code,data)
				// this.title = data.title || this.option.title
				this.richContent = {
					content: data.content
				}
			}
		})
		
		
      }
    }
  }
</script>

<style lang="scss" scoped>
  .content {
    background-color: #fff;
    min-height: 100vh;
	border-top: 1rpx solid $app-theme-border-color;
    .main {
      padding: 29rpx 30rpx;
    }
  }
</style>
