Commit 0ca202a3 by hank

预览

parent 3640c563
......@@ -50,6 +50,7 @@ class App extends Component {
'pages/home/device/my_film/index',
'pages/home/tempaltes/film_detail',
'pages/home/tempaltes/film_page',
'pages/home/tempaltes/film_preview',
'pages/home/tempaltes/film_edit',
'pages/home/tempaltes/detail',
'pages/home/tempaltes/template_type',
......
......@@ -110,6 +110,12 @@ class FilmDetail extends Component {
})
}
}
goPreview() {
const { filmInfo } = this.state
Taro.navigateTo({
url: `/pages/home/tempaltes/film_preview?frameUrl=${filmInfo.frameUrl}&filmId=${filmInfo.filmId}`
})
}
componentWillMount() {
this.getData()
}
......@@ -283,7 +289,7 @@ class FilmDetail extends Component {
<EditMenu {...pageList[pageIndex]} frameUrl={filmInfo.frameUrl} setValue={this.setValue} />
</View>
<View className="film-detail-bottom-bar">
<Button type="primary" className="film-detail-bottom-bar-btn">
<Button type="primary" className="film-detail-bottom-bar-btn" onClick={this.goPreview}>
预览视片
</Button>
<Button type="primary" className="film-detail-bottom-bar-btn" onClick={this.updateFilm}>
......
type PageOwnProps = {}
import { ComponentClass } from 'react'
import Taro, { Component, Config } from '@tarojs/taro'
import { getWindiwHeight } from '@/common/utils'
import { WebView } from '@tarojs/components'
type PageState = {
count: number
page: number
windowHeight: number
typeList: any[]
frameUrl: string
filmId: string
}
interface FilmPreview {
state: PageState
}
class FilmPreview extends Component {
config: Config = {
navigationBarTitleText: '全部类型'
}
protected page = 1
constructor(props: any) {
super(props)
const { frameUrl, filmId } = this.$router.params
this.state = {
count: 0,
typeList: [],
page: 1,
frameUrl: frameUrl,
filmId: filmId,
windowHeight: getWindiwHeight()
}
}
componentWillMount() {
// this.getData()
// console.log('object', Taro.get)
}
render() {
const { frameUrl, filmId } = this.state
return <WebView style="width: 100%" src={frameUrl + `?filmId=${filmId}&isPreview=1`} />
}
}
export default FilmPreview as ComponentClass<PageOwnProps, PageState>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment