|
@@ -7,6 +7,7 @@ import { getWindowHeight } from '@utils/style'
|
|
|
import ImagePicker from '../../components/imagePicker'
|
|
|
import RuiEditor from '../../components/editor'
|
|
|
import './reportdetail.scss'
|
|
|
+import { marked } from "marked"
|
|
|
|
|
|
@connect(state => state.home, { ...actions, })
|
|
|
class ReportDetail extends Component {
|
|
@@ -100,10 +101,10 @@ class ReportDetail extends Component {
|
|
|
})
|
|
|
|
|
|
this.props.generatePlus(payload).then((res) => {
|
|
|
+ console.log(res)
|
|
|
Taro.hideLoading()
|
|
|
chapters.forEach(item => {
|
|
|
- console.log(item)
|
|
|
- item.content = res[item.title];
|
|
|
+ item.content = marked.parse(res[item.title])
|
|
|
});
|
|
|
|
|
|
this.setState({ chapters });
|
|
@@ -128,13 +129,13 @@ class ReportDetail extends Component {
|
|
|
const chaplist = this.state.data.chapters
|
|
|
chaplist.forEach(function (item, index) {
|
|
|
if (index == i) {
|
|
|
- const paragraphs = res.split('\n').map((paragraph) =>
|
|
|
- !!paragraph
|
|
|
- ? `<p>${paragraph.trim()}</p>`
|
|
|
- : `\n`
|
|
|
- );
|
|
|
- item.content = paragraphs.join('');
|
|
|
- // item.content = res
|
|
|
+ // const paragraphs = res.split('\n').map((paragraph) =>
|
|
|
+ // !!paragraph
|
|
|
+ // ? `<p>${paragraph.trim()}</p>`
|
|
|
+ // : `\n`
|
|
|
+ // );
|
|
|
+ // item.content = paragraphs.join('');
|
|
|
+ item.content = marked.parse(res)
|
|
|
}
|
|
|
})
|
|
|
this.setState({
|
|
@@ -523,7 +524,7 @@ class ReportDetail extends Component {
|
|
|
/>
|
|
|
</View>
|
|
|
<View className='home-item-vals-bt'>
|
|
|
- <Button size='mini' type='primary' onClick={this.getGeneratePlus}>Al一键生成</Button>
|
|
|
+ <Button size='mini' type='primary' onClick={this.getGeneratePlus}>AI一键生成</Button>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|