Explorar o código

商品详情显示功能

chenzhfa %!s(int64=2) %!d(string=hai) anos
pai
achega
7dd8c38ab7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      app/containers/commodity/commoditydetail/Details.js

+ 5 - 1
app/containers/commodity/commoditydetail/Details.js

@@ -34,6 +34,10 @@ class Details extends Component {
         )
       : ''
     let html5 = `<!DOCTYPE html> <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no"><html><head><meta charset="utf-8"></head><body>${html}</body></html>`
+    let source = {html: html5}
+    if(Platform.OS !== 'ios'){
+      source.baseUrl = ''
+    }
     return (
       <View style={{ flex: 1, padding: 10 }}>
         {/* <View style={styles.card}> */}
@@ -47,7 +51,7 @@ class Details extends Component {
             width: width - 20,
             marginTop: 10,
           }}
-          source={{ html: html5, baseUrl: '' }}
+          source={source}
           scalesPageToFit={Platform.OS === 'ios' ? true : false}
           saveFormDataDisabled={true}
           contentInset={{ top: 0, left: 0, right: 0, bottom: 0 }}