xujing před 5 roky
rodič
revize
4ab7ab171a
2 změnil soubory, kde provedl 8 přidání a 3 odebrání
  1. 1
    1
      src/pages/card/index.js
  2. 7
    2
      src/pages/card/poster.js

+ 1
- 1
src/pages/card/index.js Zobrazit soubor

@@ -513,7 +513,7 @@ export default class Index extends Component {
513 513
     return (
514 514
       <Block>
515 515
         {/* 生成海报 */}
516
-        {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
516
+        {makePosterStatus && (<Poster data={posterData} onCancel={() => this.setState({ makePosterStatus: false })} toggle={this.toggleVisiblePoster}></Poster>)}
517 517
 
518 518
         {
519 519
           grantPhoneVisible &&

+ 7
- 2
src/pages/card/poster.js Zobrazit soubor

@@ -263,7 +263,12 @@ export default class Index extends Component {
263 263
     Taro.hideLoading();
264 264
     this.props.toggle(false)
265 265
   }
266
-
266
+  onCancel = () => {
267
+    Taro.hideLoading();
268
+    if (typeof this.props.onCancel === 'function') {
269
+      this.props.onCancel()
270
+    }
271
+  }
267 272
   // 保存图片至本地
268 273
   saveToAlbum = (e) => {
269 274
     e.stopPropagation()
@@ -306,7 +311,7 @@ export default class Index extends Component {
306 311
               <View className="con">
307 312
                 <View className="con-head">
308 313
                   <Text>保存后分享图片</Text>
309
-                  <Text className="iconfont icon-buoumaotubiao20" onClick={this.hidePoster}></Text>
314
+                  <Text className="iconfont icon-buoumaotubiao20" onClick={this.onCancel}></Text>
310 315
                 </View>
311 316
                 <View className="con-body">
312 317
                   <Image className="result-img" mode="aspectFit" lazy-load src={this.state.shareImage} onClick={this.onPreview}></Image>