Showing
4 changed files
with
38 additions
and
27 deletions
| @@ -25,7 +25,7 @@ export default class ArticleTemplate extends Component { | @@ -25,7 +25,7 @@ export default class ArticleTemplate extends Component { | ||
| 25 | style={{ marginRight: 13 }} | 25 | style={{ marginRight: 13 }} |
| 26 | onPress={() => state.params.share()} | 26 | onPress={() => state.params.share()} |
| 27 | > | 27 | > |
| 28 | - <Text>分享</Text> | 28 | + <Text style={{ fontSize: 16, color: "#0071E1" }}>分享</Text> |
| 29 | </TouchableOpacity> | 29 | </TouchableOpacity> |
| 30 | ) | 30 | ) |
| 31 | }; | 31 | }; |
| @@ -33,10 +33,11 @@ export default class ArticleTemplate extends Component { | @@ -33,10 +33,11 @@ export default class ArticleTemplate extends Component { | ||
| 33 | constructor(props) { | 33 | constructor(props) { |
| 34 | super(props); | 34 | super(props); |
| 35 | this.state = { | 35 | this.state = { |
| 36 | - IS_LOGIN: '', | 36 | + IS_LOGIN: "", |
| 37 | - USER_ID: '', | 37 | + USER_ID: "", |
| 38 | id: this.props.navigation.state.params.item.id, | 38 | id: this.props.navigation.state.params.item.id, |
| 39 | model: this.props.navigation.state.params.model, | 39 | model: this.props.navigation.state.params.model, |
| 40 | + type: this.props.navigation.state.params.type, | ||
| 40 | articleData: { | 41 | articleData: { |
| 41 | paragraph: [] | 42 | paragraph: [] |
| 42 | } | 43 | } |
| @@ -51,23 +52,26 @@ export default class ArticleTemplate extends Component { | @@ -51,23 +52,26 @@ export default class ArticleTemplate extends Component { | ||
| 51 | share: this.share.bind(this) | 52 | share: this.share.bind(this) |
| 52 | }); | 53 | }); |
| 53 | } | 54 | } |
| 54 | - componentDidMount() { | 55 | + componentDidMount() {} |
| 55 | - console.log(`https://devpay.brae.co/insurance.html?uid=${this.state.USER_ID}&sid=${this.state.id}`) | 56 | + |
| 56 | - } | ||
| 57 | share() { | 57 | share() { |
| 58 | const that = this; | 58 | const that = this; |
| 59 | - console.log("share") | 59 | + Share.share( |
| 60 | - Share.share({ | 60 | + { |
| 61 | - title: "保护神", | 61 | + title: "保护神", |
| 62 | - message: this.state.articleData.title, | 62 | + message: that.state.articleData.title, |
| 63 | - url: `https://devpay.brae.co/insurance.html?uid=${this.state.USER_ID}&sid=${this.state.id}` | 63 | + url: |
| 64 | - },{ | 64 | + that.state.type == "home" |
| 65 | - // dialogTitle: 'Share React Native website', | 65 | + ? `https://devpay.brae.co/insurance.html?uid=${this.state |
| 66 | - excludedActivityTypes: [ | 66 | + .USER_ID}&tid=${this.state.id}` |
| 67 | - 'com.apple.UIKit.activity.PostToTwitter' | 67 | + : `https://devpay.brae.co/insurance.html?uid=${this.state |
| 68 | - ], | 68 | + .USER_ID}&sid=${this.state.id}` |
| 69 | - tintColor: 'green' | 69 | + }, |
| 70 | - }) | 70 | + { |
| 71 | + excludedActivityTypes: ["com.apple.UIKit.activity.PostToTwitter"], | ||
| 72 | + tintColor: "green" | ||
| 73 | + } | ||
| 74 | + ) | ||
| 71 | .then(that._showResult) | 75 | .then(that._showResult) |
| 72 | .catch(error => this.setState({ result: "error: " + error.message })); | 76 | .catch(error => this.setState({ result: "error: " + error.message })); |
| 73 | } | 77 | } |
| @@ -96,7 +100,7 @@ export default class ArticleTemplate extends Component { | @@ -96,7 +100,7 @@ export default class ArticleTemplate extends Component { | ||
| 96 | } | 100 | } |
| 97 | }) | 101 | }) |
| 98 | .then(resp => { | 102 | .then(resp => { |
| 99 | - console.log("大爷",resp); | 103 | + console.log("大爷", resp); |
| 100 | if (resp.status === 200) { | 104 | if (resp.status === 200) { |
| 101 | return resp.json(); | 105 | return resp.json(); |
| 102 | } else { | 106 | } else { |
| @@ -135,12 +139,19 @@ export default class ArticleTemplate extends Component { | @@ -135,12 +139,19 @@ export default class ArticleTemplate extends Component { | ||
| 135 | ) : null} | 139 | ) : null} |
| 136 | {item.image ? ( | 140 | {item.image ? ( |
| 137 | <Image | 141 | <Image |
| 138 | - style={{width: item.width,height: item.height,alignSelf: "center",marginBottom: 20}} | 142 | + style={{ |
| 143 | + width: item.width, | ||
| 144 | + height: item.height, | ||
| 145 | + alignSelf: "center", | ||
| 146 | + marginBottom: 20 | ||
| 147 | + }} | ||
| 139 | resizeMode="contain" | 148 | resizeMode="contain" |
| 140 | source={{ uri: item.image }} | 149 | source={{ uri: item.image }} |
| 141 | /> | 150 | /> |
| 142 | ) : null} | 151 | ) : null} |
| 143 | - <Text style={styles.paragraphContent}>{" "+item.content}</Text> | 152 | + <Text style={styles.paragraphContent}> |
| 153 | + {" " + item.content} | ||
| 154 | + </Text> | ||
| 144 | </View> | 155 | </View> |
| 145 | ); | 156 | ); |
| 146 | })} | 157 | })} |
| @@ -194,7 +205,7 @@ const styles = StyleSheet.create({ | @@ -194,7 +205,7 @@ const styles = StyleSheet.create({ | ||
| 194 | fontSize: 15, | 205 | fontSize: 15, |
| 195 | marginBottom: 15, | 206 | marginBottom: 15, |
| 196 | lineHeight: 28, | 207 | lineHeight: 28, |
| 197 | - textAlign: "center", | 208 | + textAlign: "center" |
| 198 | // backgroundColor: "red", | 209 | // backgroundColor: "red", |
| 199 | }, | 210 | }, |
| 200 | paragraphImage: { | 211 | paragraphImage: { |
| @@ -206,7 +217,7 @@ const styles = StyleSheet.create({ | @@ -206,7 +217,7 @@ const styles = StyleSheet.create({ | ||
| 206 | paragraphContent: { | 217 | paragraphContent: { |
| 207 | color: "#555555", | 218 | color: "#555555", |
| 208 | fontSize: 15, | 219 | fontSize: 15, |
| 209 | - lineHeight: 25, | 220 | + lineHeight: 25 |
| 210 | // backgroundColor: "yellow", | 221 | // backgroundColor: "yellow", |
| 211 | } | 222 | } |
| 212 | }); | 223 | }); |
| @@ -259,7 +259,7 @@ export default class Home extends Component { | @@ -259,7 +259,7 @@ export default class Home extends Component { | ||
| 259 | <TouchableOpacity | 259 | <TouchableOpacity |
| 260 | style={styles.itemContainer} | 260 | style={styles.itemContainer} |
| 261 | onPress={() => | 261 | onPress={() => |
| 262 | - navigate("ArticleTemplate", { item: item, model: "topic" })} | 262 | + navigate("ArticleTemplate", { item: item, model: "topic",type: "home" })} |
| 263 | > | 263 | > |
| 264 | <View style={styles.itemImgWrapper}> | 264 | <View style={styles.itemImgWrapper}> |
| 265 | <Image | 265 | <Image |
| @@ -71,7 +71,7 @@ export default class InsuranceChurch extends Component { | @@ -71,7 +71,7 @@ export default class InsuranceChurch extends Component { | ||
| 71 | style={styles.itemContainer} | 71 | style={styles.itemContainer} |
| 72 | key={index} | 72 | key={index} |
| 73 | onPress={() => | 73 | onPress={() => |
| 74 | - navigate("ArticleTemplate", { item: item, model: "story" })} | 74 | + navigate("ArticleTemplate", { item: item, model: "story",type: "church" })} |
| 75 | > | 75 | > |
| 76 | <Image | 76 | <Image |
| 77 | style={styles.itemImgWrapper} | 77 | style={styles.itemImgWrapper} |
| @@ -124,14 +124,14 @@ export default class Discover extends Component { | @@ -124,14 +124,14 @@ export default class Discover extends Component { | ||
| 124 | /> | 124 | /> |
| 125 | <Text style={styles.btnText}>复制文案</Text> | 125 | <Text style={styles.btnText}>复制文案</Text> |
| 126 | </TouchableOpacity> | 126 | </TouchableOpacity> |
| 127 | - <TouchableOpacity | 127 | + {/* <TouchableOpacity |
| 128 | style={styles.shareContaier} | 128 | style={styles.shareContaier} |
| 129 | onPress={() => { | 129 | onPress={() => { |
| 130 | this.ShareSomething(); | 130 | this.ShareSomething(); |
| 131 | }} | 131 | }} |
| 132 | > | 132 | > |
| 133 | <Text style={styles.shareText}>分享</Text> | 133 | <Text style={styles.shareText}>分享</Text> |
| 134 | - </TouchableOpacity> | 134 | + </TouchableOpacity> */} |
| 135 | </Image> | 135 | </Image> |
| 136 | ); | 136 | ); |
| 137 | } | 137 | } |
-
Please register or login to post a comment