Commit b617615d by hank

区分

parent a7981077
export const FETCH_TIME_OUT = 5000
export const BASE_URL = 'https://server.bdideal.com'
// export const BASE_URL = 'https://server.bdideal.com'
export const BASE_URL = 'https://dev-server.bdideal.com'
export const WEBVIEW_URL = 'https://dev-visual.bdideal.com'
// export const BASE_URL = 'http://172.16.4.219:8090'
/** 蓝牙的服务 uuid */
......
......@@ -32,12 +32,14 @@ class DerailTop extends Component {
public sendState = false
componentWillMount() {
const { templateId } = this.props
api.common.getCollectionState(String(templateId)).then(res => {
this.setState({
collectionId: res.data,
collectionState: !!res.data
if (templateId) {
api.common.getCollectionState(String(templateId)).then(res => {
this.setState({
collectionId: res.data,
collectionState: !!res.data
})
})
})
}
}
toggleCollection() {
const { collectionState, collectionId } = this.state
......@@ -84,7 +86,7 @@ class DerailTop extends Component {
}
}
render() {
let { templateUrl, templateName, templateDescribe, templateShow } = this.props
let { templateUrl, templateName, templateDescribe, templateShow, templateId } = this.props
templateUrl = templateUrl || ''
const { collectionState } = this.state
let collectionUrl = collectionState
......@@ -122,13 +124,15 @@ class DerailTop extends Component {
<View>
<Text className="temp-top-describe">{templateDescribe}</Text>
</View>
<Image
className="temp-top-collection"
onClick={() => {
this.toggleCollection()
}}
src={collectionUrl}
/>
{templateId ? (
<Image
className="temp-top-collection"
onClick={() => {
this.toggleCollection()
}}
src={collectionUrl}
/>
) : null}
</View>
</View>
<View className="temp-top-info-bar" />
......
......@@ -6,7 +6,7 @@ import DeviceItem from '@/conpoments/device_item'
import { showMyToast } from '@/common/utils'
import Modal from '@/conpoments/modal'
import token from '@/common/token'
import { WEBVIEW_URL } from '@/common/index'
import './scss/film_detail.scss'
import api from '@/api/index'
......@@ -207,7 +207,7 @@ class FilmDetail extends Component {
</Modal>
) : null}
<WebView
src={`https://visual.bdideal.com/#/tempaltes/filmdetail?filmId=${filmId}&token=${token.getToken()}`}
src={`${WEBVIEW_URL}/#/tempaltes/filmdetail?filmId=${filmId}&token=${token.getToken()}`}
/>
</View>
)
......
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