|
@@ -97,7 +97,7 @@ class Index extends Component {
|
|
|
getWeChatShareDetails({type:1}).then(v=>{
|
|
|
if(v.error.length === 0){
|
|
|
this.setState({
|
|
|
- weChatShareDetails:v.data
|
|
|
+ weChatShareDetails:v.data || {}
|
|
|
})
|
|
|
}else{
|
|
|
Taro.showToast({title:v.error[0].message,icon:'none'})
|
|
@@ -106,18 +106,24 @@ class Index extends Component {
|
|
|
}
|
|
|
|
|
|
onShareAppMessage(){
|
|
|
- return {
|
|
|
- title: this.state.weChatShareDetails.title,
|
|
|
- imageUrl: resourceAddress + this.state.weChatShareDetails.shareUrl
|
|
|
+ let data = {
|
|
|
+ title: this.state.weChatShareDetails.title || '科德高企培育',
|
|
|
}
|
|
|
+ if(this.state.weChatShareDetails.shareUrl){
|
|
|
+ data.imageUrl = resourceAddress + this.state.weChatShareDetails.shareUrl
|
|
|
+ }
|
|
|
+ return data
|
|
|
}
|
|
|
|
|
|
//朋友圈分享
|
|
|
onShareTimeline(){
|
|
|
- return {
|
|
|
- title: this.state.weChatShareDetails.title,
|
|
|
- imageUrl: resourceAddress + this.state.weChatShareDetails.momentsUrl
|
|
|
+ let data = {
|
|
|
+ title: this.state.weChatShareDetails.title || '科德高企培育',
|
|
|
+ }
|
|
|
+ if(this.state.weChatShareDetails.momentsUrl){
|
|
|
+ data.imageUrl = resourceAddress + this.state.weChatShareDetails.momentsUrl
|
|
|
}
|
|
|
+ return data
|
|
|
}
|
|
|
|
|
|
render () {
|