xujing преди 5 години
родител
ревизия
4ab7ab171a
променени са 2 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 1
    1
      src/pages/card/index.js
  2. 7
    2
      src/pages/card/poster.js

+ 1
- 1
src/pages/card/index.js Целия файл

513
     return (
513
     return (
514
       <Block>
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
           grantPhoneVisible &&
519
           grantPhoneVisible &&

+ 7
- 2
src/pages/card/poster.js Целия файл

263
     Taro.hideLoading();
263
     Taro.hideLoading();
264
     this.props.toggle(false)
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
   saveToAlbum = (e) => {
273
   saveToAlbum = (e) => {
269
     e.stopPropagation()
274
     e.stopPropagation()
306
               <View className="con">
311
               <View className="con">
307
                 <View className="con-head">
312
                 <View className="con-head">
308
                   <Text>保存后分享图片</Text>
313
                   <Text>保存后分享图片</Text>
309
-                  <Text className="iconfont icon-buoumaotubiao20" onClick={this.hidePoster}></Text>
314
+                  <Text className="iconfont icon-buoumaotubiao20" onClick={this.onCancel}></Text>
310
                 </View>
315
                 </View>
311
                 <View className="con-body">
316
                 <View className="con-body">
312
                   <Image className="result-img" mode="aspectFit" lazy-load src={this.state.shareImage} onClick={this.onPreview}></Image>
317
                   <Image className="result-img" mode="aspectFit" lazy-load src={this.state.shareImage} onClick={this.onPreview}></Image>