解决落地页预览页面回显白屏

This commit is contained in:
Apple 2022-09-23 16:36:25 +08:00
parent 1e7997b3ef
commit 3395cfc61a
1 changed files with 29 additions and 36 deletions

View File

@ -12,6 +12,12 @@ import PreviewEffect from '../previewEffect/main'
import { handelResponse, getThemeList, delTheme } from '../../../assets/api.js'
import menu from '../../../assets/enum.js'
var QRCode = require('qrcode.react')
let typeList={//1 白名单 3 兑换码 4优惠券 8 优惠券白名单
'1':'access_conf',
'3':'exchange',
'4':'coupon',
'8':'coupon',
}
const Column = [
{
title: '基本信息',
@ -219,10 +225,10 @@ export default class acclist extends React.Component {
Notify.success(msg)
self.getAccountFn()
},
(err) => {}
(err) => { }
)
})
.catch((err) => {})
.catch((err) => { })
},
onCancel: this.onCancel,
className: 'questModal',
@ -257,24 +263,12 @@ export default class acclist extends React.Component {
this.getTableList(data)
}, 10)
}
onPreview(e, row) {
let rowdata = {}
if (row.page == 1) {
//白名单
rowdata.model = row.access_conf.land
rowdata.product_list = row.access_conf.product_list
rowdata.product_detail = row.access_conf.product_detail
} else if (row.page == 3) {
rowdata.model = row.exchange.land
rowdata.product_list = row.exchange.product_list
rowdata.product_detail = row.exchange.product_detail
}
this.setState({
preview_visible: true
})
this.setState({ previewData: rowdata, showType: row.page })
this.setState({ preview_url: row.href })
}
onPreview(e,row) {
let previewInfo=row[typeList[row.page]];
this.setState({ preview_visible: true,previewData:previewInfo});
}
closePhone(e) {
this.setState({ preview_visible: false })
}
@ -313,7 +307,7 @@ export default class acclist extends React.Component {
<div id='dislist'>
<TabPage tabs={this.state.tabList} tabChange={(e) => this.tabChange(e)}>
<div className='distable dflexj'>
<div> </div>{' '}
<div> </div>
<Ipt
icon='search'
placeholder={'请输入关键字进行搜索'}
@ -335,8 +329,8 @@ export default class acclist extends React.Component {
wordSearch={(e) => {
this.sureFn()
}}
/>{' '}
</div>{' '}
/>
</div>
<div>
<Grid
isBorder={true}
@ -382,7 +376,7 @@ export default class acclist extends React.Component {
if (com == 'name') {
return (
<Switch size='small' checked={true}>
{' '}
</Switch>
)
}
@ -390,7 +384,7 @@ export default class acclist extends React.Component {
if (com == 'client') {
return (
<span>
{' '}
<font
className='icon'
style={{
@ -398,7 +392,7 @@ export default class acclist extends React.Component {
parseInt(rowData.client)
)
}}>
{' '}
</font>
{menu.pageStatus(parseInt(rowData.client))}
</span>
@ -407,7 +401,7 @@ export default class acclist extends React.Component {
if (com == 'page') {
return (
<span>
{' '}
<font
className='icon'
style={{
@ -415,7 +409,7 @@ export default class acclist extends React.Component {
parseInt(rowData.page)
)
}}>
{' '}
</font>
{menu.pageTypeStatus(parseInt(rowData.page))}
</span>
@ -429,16 +423,15 @@ export default class acclist extends React.Component {
onClick={(e) => {
this.editFn(e, rowData)
}}>
{' '}
编辑{' '}
</a>{' '}
编辑
</a>
<a
onClick={(e) => {
this.onPreview(e, rowData)
}}
className='grid-link'>
{' '}
预览{' '}
预览
</a>
</span>
)
@ -448,14 +441,14 @@ export default class acclist extends React.Component {
return (
<Pop trigger='hover' content={content}>
{' '}
<a href={rowData.href}>{rowData.href}</a>{' '}
<a href={rowData.href}>{rowData.href}</a>
</Pop>
)
}
}}
/>
</div>{' '}
</div>
</TabPage>
{this.state.preview_visible ? (
<PreviewEffect