Bläddra i källkod

添加发布视频到抖音

黎海 2 år sedan
förälder
incheckning
6972c6a5cd

+ 1 - 1
app_list.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "taroConfig": {
3
-    "version": "1.4.3",
3
+    "version": "1.4.9",
4 4
     "desc": "更改人物动漫化"
5 5
   },
6 6
   "app_list": [

+ 1 - 1
package.json

@@ -81,7 +81,7 @@
81 81
         "webpack": "5.69.0"
82 82
     },
83 83
     "taroConfig": {
84
-        "version": "1.4.3",
84
+        "version": "1.4.9",
85 85
         "desc": "更改人物动漫化"
86 86
     }
87 87
 }

+ 2 - 2
src/api/config.js

@@ -1,7 +1,7 @@
1 1
 // 配置请求对象
2 2
 // 本地调试 dev 开发阶段
3
-// export const baseUrl = "https://test-openai.fyshark.com";//测试
4
-export const baseUrl = "https://openai.fyshark.com";//正式
3
+export const baseUrl = "https://test-openai.fyshark.com";//测试
4
+// export const baseUrl = "https://openai.fyshark.com";//正式
5 5
 // product 阶段
6 6
 // https://www.fastmock.site/mock/3f112f6cb2f621fc9c2dd6a14be19f38/beers/
7 7
 // 设计模式

+ 2 - 0
src/app.config.js

@@ -36,6 +36,8 @@ export default defineAppConfig({
36 36
         "pages/realDetail/index",//资讯
37 37
         "pages/comicActivity/index",//人物动漫画活动页
38 38
         "pages/comicActivityDetail/index",//人物动漫画活动详情页
39
+        "pages/comicActivityCurrent/index",//人物动漫画(通用)活动页
40
+        "pages/comicActivityCurrentDetail/index",//人物动漫画(通用)活动详情页
39 41
       ]
40 42
     },
41 43
     

+ 32 - 8
src/moduleB/pages/comic/index.jsx

@@ -19,11 +19,26 @@ export default class collection extends Component {
19 19
     repeat: 0,//广告次数
20 20
     drawTaskId: 0,//任务id
21 21
     is_week: 0,//是否是周卡
22
+    isIos: false,
22 23
   }
23 24
 
24 25
   componentWillMount () {
26
+    let that = this
27
+    Taro.getSystemInfo({
28
+      success: function (res) {
29
+        if (res.platform != "android") {
30
+          that.setState({
31
+            isIos: true
32
+          })
33
+        }
34
+      }
35
+    })
25 36
     this.getDrawGcImgIndex()
26 37
     this.getCoinTaskAd()
38
+    setTimeout(() => {
39
+      this.getDrawGcImgIndex()
40
+      this.getCoinTaskAd()
41
+    }, 1000);
27 42
   }
28 43
   componentDidShow () {
29 44
     //接收裁剪图片
@@ -78,7 +93,7 @@ export default class collection extends Component {
78 93
   updateButton () {
79 94
     if (!this.state.isImage) {
80 95
       this.upLode()
81
-    } else if ( this.state.creatInfo.is_week == 0) {
96
+    } else if (this.state.creatInfo.is_week == 0) {
82 97
       this.playVideoGeneratePictures()
83 98
     } else {
84 99
       this.generatePictures()
@@ -95,7 +110,7 @@ export default class collection extends Component {
95 110
       success: function (res) {
96 111
         console.log(res, 'res');
97 112
         const file = res.tempFiles[0].tempFilePath
98
-        console.log(res.tempFiles[0].size,'res.tempFiles[0].size');
113
+        console.log(res.tempFiles[0].size, 'res.tempFiles[0].size');
99 114
         if (res.tempFiles[0].size > 2000000) {
100 115
           Taro.showToast({ title: '图片大小不能超过2M', icon: 'none' })
101 116
           return
@@ -104,13 +119,13 @@ export default class collection extends Component {
104 119
         Taro.showLoading({
105 120
           title: '图片检测中...',
106 121
         })
107
-        api.imageDetection({ img_data: base64Img }).then(item=>{
108
-          if (item.code==200) {
122
+        api.imageDetection({ img_data: base64Img }).then(item => {
123
+          if (item.code == 200) {
109 124
             Taro.hideLoading()
110 125
             Taro.navigateTo({
111 126
               url: `/moduleA/pages/upload/index?image=${file}`
112 127
             })
113
-          }else{
128
+          } else {
114 129
             Taro.hideLoading()
115 130
             Taro.showToast({ title: item.msg, icon: 'none' })
116 131
           }
@@ -291,6 +306,14 @@ export default class collection extends Component {
291 306
   }
292 307
   //充值
293 308
   toOrder () {
309
+    if (this.state.isIos) {
310
+      Taro.showToast({
311
+        title: 'ios暂不支持充值',
312
+        icon: 'none',
313
+        duration: 2000
314
+      })
315
+      return
316
+    }
294 317
     let that = this
295 318
     if (process.env.TARO_ENV === 'tt') {
296 319
       Taro.showLoading({
@@ -440,8 +463,9 @@ export default class collection extends Component {
440 463
               onClick={e => (tool.throttle(this.toOrder()), 2000)}
441 464
             >
442 465
               <View className='result-recharge-button-content'>
443
-                <View className='result-recharge-button-top'>无广告急速制作</View>
444
-                <View className='result-recharge-button-bottom'>一周/{this.state.creatInfo.money_week / 100}元</View>
466
+                <View className='result-recharge-button-top'>【限时抢购】无广告!</View>
467
+                <View className='result-recharge-button-bottom'>9.9元→{this.state.models.money_week / 100}元/周!
468
+                </View>
445 469
               </View>
446 470
             </View>
447 471
           }
@@ -455,7 +479,7 @@ export default class collection extends Component {
455 479
 
456 480
         </View>
457 481
         <View className='tip-img'>
458
-          <Image className='ps-image' src='http://video-img.fyshark.com/1681720619915%E4%B8%8B%E5%9B%BE.png'></Image>
482
+          <Image className='ps-image' src='http://video-img.fyshark.com/1683188943973000000dhk.png'></Image>
459 483
         </View>
460 484
       </View>
461 485
     )

+ 31 - 7
src/moduleB/pages/comicActivity/index.jsx

@@ -1,5 +1,5 @@
1 1
 import { Component } from 'react'
2
-import { View, Text, Button, Image, scrollView, Input } from '@tarojs/components'
2
+import { View, Text, Button, Image, scrollView, Video, Input } from '@tarojs/components'
3 3
 import * as api from '../../../service/index'
4 4
 import tool from '../../../common/tool'
5 5
 import Taro, { } from '@tarojs/taro'
@@ -19,11 +19,26 @@ export default class collection extends Component {
19 19
     drawTaskId: 0,//任务id
20 20
     is_week: 0,//是否是周卡用户
21 21
     models: {},//活动数据
22
+    isIos: false,
22 23
   }
23 24
 
24 25
   componentWillMount () {
26
+    let that = this
27
+    Taro.getSystemInfo({
28
+      success: function (res) {
29
+        if (res.platform != "android") {
30
+          that.setState({
31
+            isIos: true
32
+          })
33
+        }
34
+      }
35
+    })
25 36
     this.getCoinTaskAd()
26 37
     this.getDraw51ImgIndex()
38
+    setTimeout(() => {
39
+      this.getCoinTaskAd()
40
+      this.getDraw51ImgIndex()
41
+    }, 1000);
27 42
   }
28 43
   componentDidShow () {
29 44
     //接收裁剪图片
@@ -96,13 +111,13 @@ export default class collection extends Component {
96 111
         Taro.showLoading({
97 112
           title: '图片检测中...',
98 113
         })
99
-        api.imageDetection({ img_data: base64Img }).then(item=>{
100
-          if (item.code==200) {
114
+        api.imageDetection({ img_data: base64Img }).then(item => {
115
+          if (item.code == 200) {
101 116
             Taro.hideLoading()
102 117
             Taro.navigateTo({
103 118
               url: `/moduleA/pages/upload/index?image=${file}`
104 119
             })
105
-          }else{
120
+          } else {
106 121
             Taro.hideLoading()
107 122
             Taro.showToast({ title: item.msg, icon: 'none' })
108 123
           }
@@ -273,6 +288,14 @@ export default class collection extends Component {
273 288
   }
274 289
   //充值
275 290
   toOrder () {
291
+    if (this.state.isIos) {
292
+      Taro.showToast({
293
+        title: 'ios暂不支持充值',
294
+        icon: 'none',
295
+        duration: 2000
296
+      })
297
+      return
298
+    }
276 299
     let that = this
277 300
     if (process.env.TARO_ENV === 'tt') {
278 301
       Taro.showLoading({
@@ -372,7 +395,7 @@ export default class collection extends Component {
372 395
                   ></Image>
373 396
                 </View>
374 397
                 <View className='step'>
375
-                  <Image className='step-img' src='http://video-img.fyshark.com/1682475185108123.png'>
398
+                  <Image className='step-img' src='http://video-img.fyshark.com/1683196371096123.png'>
376 399
                   </Image>
377 400
                 </View>
378 401
               </View>
@@ -412,8 +435,9 @@ export default class collection extends Component {
412 435
                     onClick={e => (tool.throttle(this.toOrder()), 2000)}
413 436
                   >
414 437
                     <View className='result-recharge-button-content'>
415
-                      <View className='result-recharge-button-top'>无广告急速制作</View>
416
-                      <View className='result-recharge-button-bottom'>一周/{this.state.models.money_week / 100}元</View>
438
+                      <View className='result-recharge-button-top'>【限时抢购】无广告!</View>
439
+                      <View className='result-recharge-button-bottom'>9.9元→{this.state.models.money_week / 100}元/周!
440
+                      </View>
417 441
                     </View>
418 442
                   </View>
419 443
                 }

+ 5 - 1
src/moduleB/pages/comicActivity/index.less

@@ -1,6 +1,6 @@
1 1
 .mine {
2 2
   padding: 48px 20px;
3
-  min-height: 100vh;
3
+  // min-height: 100vh;
4 4
   background-color: #041129;
5 5
 
6 6
   .before-painting {
@@ -33,6 +33,10 @@
33 33
         width: 100%;
34 34
         height: 100%;
35 35
       }
36
+      .album_swiper_video{
37
+        width: 100%;
38
+        height: 100%;
39
+      }
36 40
 
37 41
       .delete {
38 42
         position: absolute;

+ 5 - 0
src/moduleB/pages/comicActivityCurrent/index.config.js

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '人物动漫化',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 485 - 0
src/moduleB/pages/comicActivityCurrent/index.jsx

@@ -0,0 +1,485 @@
1
+import { Component } from 'react'
2
+import { View, Text, Button, Image, scrollView,Video, Input } from '@tarojs/components'
3
+import * as api from '../../../service/index'
4
+import tool from '../../../common/tool'
5
+import Taro, { getCurrentInstance } from '@tarojs/taro'
6
+import './index.less'
7
+
8
+export default class collection extends Component {
9
+  $instance = getCurrentInstance()
10
+  state = {
11
+    consultImg: '',
12
+    active_title: '',
13
+    sizeIndex: 0,
14
+    mass: 0,
15
+    modelIndex: 0,
16
+    isImage: false,
17
+    isOpen: false,
18
+    jumpurl: '',//广告id
19
+    task_id: 0,//任务id
20
+    repeat: 0,//广告次数
21
+    drawTaskId: 0,//任务id
22
+    is_week: 0,//是否是周卡用户
23
+    models: {},//活动数据
24
+    isIos: false,
25
+  }
26
+
27
+  componentWillMount () {
28
+    let that = this
29
+    Taro.getSystemInfo({
30
+      success: function (res) {
31
+        if (res.platform != "android") {
32
+          that.setState({
33
+            isIos: true
34
+          })
35
+        }
36
+      }
37
+    })
38
+    this.getCoinTaskAd()
39
+    this.getDrawAloneImgIndex()
40
+    setTimeout(() => {
41
+      this.getCoinTaskAd()
42
+      this.getDrawAloneImgIndex()
43
+    }, 1000);
44
+  }
45
+  componentDidShow () {
46
+    //接收裁剪图片
47
+    let pages = Taro.getCurrentPages();
48
+    let currentPage = pages[pages.length - 1]; // 获取当前页面
49
+    console.log(currentPage, 'currentPage');
50
+    if (process.env.TARO_ENV == 'weapp') {
51
+      if (currentPage.__data__.consultImg) { // 获取值
52
+        this.setState({
53
+          consultImg: currentPage.__data__.consultImg,
54
+          sizeIndex: currentPage.__data__.sizeIndex,
55
+          isImage: true
56
+        })
57
+        currentPage.__data__.consultImg = ''
58
+      }
59
+    } else if (process.env.TARO_ENV == 'tt') {
60
+      if (currentPage.data.consultImg) { // 获取值
61
+        this.setState({
62
+          consultImg: currentPage.data.consultImg,
63
+          sizeIndex: currentPage.data.sizeIndex,
64
+          isImage: true
65
+        })
66
+        currentPage.data.consultImg = ''
67
+      }
68
+    }
69
+  }
70
+  getDrawAloneImgIndex () {
71
+    let routers = this.$instance.router.params
72
+    api.getDrawAloneImgIndex({ style_id: routers.style_id }).then(res => {
73
+      if (res.code == 200) {
74
+        this.setState({
75
+          is_week: res.data.is_week,
76
+          models: res.data,
77
+          consultImg: res.data.img,
78
+          active_title: res.data.active_title
79
+        })
80
+      }
81
+    })
82
+  }
83
+  getCoinTaskAd () {
84
+    api.getCoinTaskAd().then(res => {
85
+      if (res.code == 200) {
86
+        this.setState({
87
+          jumpurl: res.data[0].jumpurl,//广告id
88
+          task_id: res.data[0].id,//任务id
89
+          repeat: res.data[0].repeat
90
+        })
91
+      }
92
+    })
93
+  }
94
+  changeOpen () {
95
+    this.setState({
96
+      isOpen: !this.state.isOpen
97
+    })
98
+  }
99
+  //上传图片
100
+  upLode () {
101
+    let that = this
102
+    Taro.chooseMedia({
103
+      count: 1, // 默认
104
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
105
+      mediaType: ['image'],
106
+      sourceType: ['album', 'camera'],
107
+      success: function (res) {
108
+        console.log(res, 'res');
109
+        const file = res.tempFiles[0].tempFilePath
110
+        if (res.tempFiles[0].size > 2000000) {
111
+          Taro.showToast({ title: '图片大小不能超过2M', icon: 'none' })
112
+          return
113
+        }
114
+        let base64Img = Taro.getFileSystemManager().readFileSync(file, 'base64')
115
+        Taro.showLoading({
116
+          title: '图片检测中...',
117
+        })
118
+        api.imageDetection({ img_data: base64Img }).then(item => {
119
+          if (item.code == 200) {
120
+            Taro.hideLoading()
121
+            Taro.navigateTo({
122
+              url: `/moduleA/pages/upload/index?image=${file}`
123
+            })
124
+          } else {
125
+            Taro.hideLoading()
126
+            Taro.showToast({ title: item.msg, icon: 'none' })
127
+          }
128
+        })
129
+      }
130
+    })
131
+  }
132
+  //看广告画图
133
+  playVideoGeneratePictures () {
134
+
135
+    if (!this.state.isImage) {
136
+      Taro.showToast({ title: '请先上传图片', icon: 'none' })
137
+      return
138
+    }
139
+    api.drawGcImg({ img_url: this.state.consultImg, style_id: this.state.models.style_id }).then(res => {
140
+      if (res.code == 200) {
141
+        if (this.state.is_week == 1) {
142
+          Taro.navigateTo({
143
+            url: `/moduleB/pages/comicActivityCurrentDetail/index?task_id=${res.data.task_id}`
144
+          })
145
+        } else {
146
+          this.setState({
147
+            drawTaskId: res.data.task_id
148
+          }, () => {
149
+            this.playVideo()
150
+
151
+          })
152
+        }
153
+
154
+      } else {
155
+        Taro.hideLoading()
156
+        Taro.showToast({ icon: 'none', title: res.msg })
157
+      }
158
+    })
159
+  }
160
+
161
+  //观看广告
162
+  playVideo () {
163
+    if (process.env.TARO_ENV == 'tt') {
164
+      this.playVideoTT()
165
+    } else {
166
+      this.playVideoWeapp()
167
+    }
168
+  }
169
+  //抖音激励广告
170
+  playVideoTT () {
171
+    let that = this
172
+    Taro.showLoading({
173
+      title: '加载中...',
174
+    })
175
+    const videoAd = tt.createRewardedVideoAd({ adUnitId: this.state.jumpurl });
176
+    videoAd.show()
177
+    videoAd.onError((err) => {
178
+      Taro.hideLoading()
179
+      switch (err.errCode) {
180
+        case 1004:
181
+          // 无合适的广告
182
+          break;
183
+        default:
184
+        // 更多请参考错误码文档
185
+      }
186
+    });
187
+    try {
188
+      if (videoAd.closeHandler) {
189
+        videoAd.offClose(videoAd.closeHandler);
190
+        console.log("videoAd.offClose卸载成功");
191
+      }
192
+    } catch (e) {
193
+      console.log("videoAd.offClose 卸载失败");
194
+      console.error(e);
195
+    }
196
+    videoAd.closeHandler = function (data) {
197
+      Taro.hideLoading()
198
+      if (data.isEnded) {
199
+        Taro.navigateTo({
200
+          url: `/moduleB/pages/comicActivityDetail/index?task_id=${that.state.drawTaskId}`
201
+        })
202
+      } else {
203
+
204
+      }
205
+    }
206
+    // 监听视频播放完成
207
+    videoAd.onClose(videoAd.closeHandler);
208
+  }
209
+  //激励广告
210
+  playVideoWeapp () {
211
+    // 在页面中定义激励视频广告
212
+    let adUnitId = this.state.jumpurl
213
+    // 在页面中定义激励视频广告
214
+    let videoAd = null
215
+    let that = this
216
+    console.log(videoAd, 'videoAd');
217
+    // 在页面onLoad回调事件中创建激励视频广告实例
218
+    if (wx.createRewardedVideoAd) {
219
+      videoAd = wx.createRewardedVideoAd({
220
+        adUnitId: adUnitId
221
+      })
222
+      videoAd.onLoad(() => { })
223
+      videoAd.onError((err) => { })
224
+      try {
225
+        if (videoAd.closeHandler) {
226
+          videoAd.offClose(videoAd.closeHandler);
227
+          console.log("videoAd.offClose卸载成功");
228
+        }
229
+      } catch (e) {
230
+        console.log("videoAd.offClose 卸载失败");
231
+        console.error(e);
232
+      }
233
+      videoAd.closeHandler = function (res) {
234
+        // 用户点击了【关闭广告】按钮
235
+        if (res && res.isEnded || res === undefined) {
236
+          // 正常播放结束,可以下发游戏奖励
237
+          Taro.navigateTo({
238
+            url: `/moduleB/pages/comicActivityDetail/index?task_id=${that.state.drawTaskId}`
239
+          })
240
+        } else {
241
+          //提前关闭小程序
242
+        }
243
+      };
244
+      videoAd.onClose(videoAd.closeHandler);
245
+    }
246
+
247
+    // 用户触发广告后,显示激励视频广告
248
+    if (videoAd) {
249
+      videoAd.show().catch(() => {
250
+        // 失败重试
251
+        videoAd.load()
252
+          .then(() => videoAd.show())
253
+          .catch(err => {
254
+            Taro.showToast({
255
+              title: '暂无广告',
256
+              icon: 'none',
257
+              duration: 2000
258
+            })
259
+            console.log('激励视频 广告显示失败')
260
+          })
261
+      })
262
+    }
263
+
264
+  }
265
+  deleteImg () {
266
+    this.setState({
267
+      consultImg: this.state.models.img,
268
+      isImage: false,
269
+    })
270
+  }
271
+  onShareAppMessage = (res) => {
272
+    let path = `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`
273
+    if (process.env.TARO_ENV == 'tt') {
274
+      path = `/moduleB/pages/comic/index?c=channel_name&s=neibuguazai`
275
+    }
276
+    let shareData = {
277
+      title: tool.shareTitle,
278
+      path: path,
279
+      imageUrl: tool.shareImg
280
+    }
281
+    return shareData;
282
+  }
283
+  changeMass (e) {
284
+    this.setState({
285
+      mass: e
286
+    })
287
+  }
288
+  selectModel (item, index) {
289
+    this.setState({
290
+      modelIndex: index,
291
+    })
292
+  }
293
+  //充值
294
+  toOrder () {
295
+    if (this.state.isIos) {
296
+      Taro.showToast({
297
+        title: 'ios暂不支持充值',
298
+        icon: 'none',
299
+        duration: 2000
300
+      })
301
+      return
302
+    }
303
+    let that = this
304
+    if (process.env.TARO_ENV === 'tt') {
305
+      Taro.showLoading({
306
+        title: '加载中...',
307
+      })
308
+      api.ttCreateOrder({ pay_info_id: this.state.models.shop_id }).then(res => {
309
+        if (res.code == 200) {
310
+          Taro.hideLoading()
311
+          tt.pay({
312
+            orderInfo: {
313
+              order_id: res.data.order_id,
314
+              order_token: res.data.order_token
315
+            },
316
+            service: 5,
317
+            success (item) {
318
+              if (item.code == 0) {
319
+                Taro.showToast({
320
+                  title: '购买成功',
321
+                  icon: 'none',
322
+                  duration: 2000
323
+                })
324
+                that.getDraw51ImgIndex()
325
+                setTimeout(() => {
326
+                  that.getDraw51ImgIndex()
327
+                }, 2000);
328
+                // 支付成功处理逻辑,只有res.code=0时,才表示支付成功
329
+                // 但是最终状态要以商户后端结果为准
330
+              }
331
+            },
332
+            fail (item) {
333
+              // 调起收银台失败处理逻辑
334
+            },
335
+          });
336
+        }
337
+      })
338
+    } else if (process.env.TARO_ENV === 'weapp') {
339
+      Taro.getSystemInfo({
340
+        success: function (res) {
341
+          Taro.showLoading({
342
+            title: '加载中...',
343
+          })
344
+          api.createOrder({ shop_id: that.state.models.shop_id }).then(res => {
345
+            if (res.code == 200) {
346
+              Taro.hideLoading()
347
+              Taro.requestPayment({
348
+                timeStamp: res.data.timeStamp,
349
+                nonceStr: res.data.nonceStr,
350
+                package: res.data.package,
351
+                signType: res.data.signType,
352
+                paySign: res.data.paySign,
353
+                success: function (res) {
354
+                  // console.log(res);
355
+                  //添加2s延迟在刷新数据
356
+                  setTimeout(() => {
357
+                    that.getDraw51ImgIndex()
358
+                    Taro.showToast({
359
+                      title: '购买成功',
360
+                      icon: 'none',
361
+                      duration: 2000
362
+                    })
363
+                  }, 2000);
364
+                },
365
+                fail: function (err) {
366
+                  try {
367
+                    const res = Taro.getSystemInfoSync()
368
+                    console.log(res, 'iphone=====');
369
+                  } catch (e) {
370
+                  }
371
+                }
372
+              })
373
+            }
374
+          })
375
+        }
376
+      })
377
+    }
378
+  }
379
+  toComic () {
380
+    Taro.navigateTo({
381
+      url: `/moduleB/pages/comic/index`
382
+    })
383
+  }
384
+
385
+  render () {
386
+    return (
387
+      <View className='mine'>
388
+        {
389
+          !this.state.isImage ?
390
+            <View className='before-painting'>
391
+              <View className='title'>
392
+                <Image className='tips-img' src='http://video-img.fyshark.com/1683190761038e2e0bc9b83ddbbc667fd037e9126b39bd948c66921fe-TiYNnw%402x.png'></Image>
393
+                <View className='tips-title'>{this.state.active_title}</View>
394
+                <Image className='tips-title-img' src='http://video-img.fyshark.com/1683190784437%E7%BB%84%2052%402x.png'></Image>
395
+                <Image className='tips-img' src='http://video-img.fyshark.com/1683190773745e2e0bc9b83ddbbc667fd037e9126b39bd948c66921fe-TiYNnw%20%E6%8B%B7%E8%B4%9D%402x.png'></Image>
396
+              </View>
397
+              <View className='banner'>
398
+                <View className='banner-content'>
399
+                  {/* <Image className='content-img'
400
+                    mode='aspectFit'
401
+                    src={this.state.consultImg}
402
+                  ></Image> */}
403
+                   <Video
404
+                    className='album_swiper_video'
405
+                    src={'http://video-img.fyshark.com/16832726796725%E6%9C%885%E6%97%A5(1).mp4'}
406
+                    showCenterPlayBtn={false}
407
+                    showPlayBtn={false}
408
+                    showFullscreenBtn={false}
409
+                    autoplay
410
+                    objectFit='cover'
411
+                    loop
412
+                    controls={false}
413
+                    muted={false}
414
+                    x5-video-player-type='h5-page'
415
+                    webkit-playsinline='true'
416
+                    x5-playsinline='true'
417
+                    x5-video-orientation='portraint'
418
+                  ></Video>
419
+                </View>
420
+                <View className='step'>
421
+                  <Image className='step-img' src='http://video-img.fyshark.com/1683196371096123.png'>
422
+                  </Image>
423
+                </View>
424
+              </View>
425
+              <View className='update' >
426
+                <View className='update-button-more'
427
+                  onClick={e => (this.toComic())}
428
+                >
429
+                  更多风格
430
+                </View>
431
+                <View className='update-button'
432
+                  onClick={e => (this.upLode())}
433
+                >
434
+                  上传图片
435
+                </View>
436
+              </View>
437
+
438
+            </View>
439
+            :
440
+            <View className='after-painting'>
441
+              <View className='result-banner'>
442
+                <View className='result-banner-content'>
443
+                  <Image className='result-content-img'
444
+                    mode='widthFix'
445
+                    src={this.state.consultImg}
446
+                  ></Image>
447
+                  {
448
+                    this.state.isImage &&
449
+                    <Image className='delete' src='http://video-img.fyshark.com/1680147210173guanbi.png' onClick={e => (this.deleteImg())}></Image>
450
+                  }
451
+                </View>
452
+              </View>
453
+              <View className='after-tips'>照片已上传,还差最后一步</View>
454
+              <View className='result-update' >
455
+                {
456
+                  this.state.is_week == 0 &&
457
+                  <View className='result-recharge-button update-active'
458
+                    onClick={e => (tool.throttle(this.toOrder()), 2000)}
459
+                  >
460
+                    <View className='result-recharge-button-content'>
461
+                      <View className='result-recharge-button-top'>【限时抢购】无广告!</View>
462
+                      <View className='result-recharge-button-bottom'>9.9元→{this.state.models.money_week / 100}元/周!
463
+                      </View>
464
+                    </View>
465
+                  </View>
466
+                }
467
+                <View className='result-update-button'
468
+                  onClick={e => (tool.throttle(this.playVideoGeneratePictures()), 2000)}
469
+                >
470
+                  {
471
+                    this.state.is_week == 0 &&
472
+                    <Image className='result-update-img' src='http://video-img.fyshark.com/1682414441783aghidjnl.png'></Image>
473
+                  }
474
+                  {
475
+                    this.state.is_week == 1 ? '开始制作' : '看广告免费制作'
476
+                  }
477
+
478
+                </View>
479
+              </View>
480
+            </View>
481
+        }
482
+      </View>
483
+    )
484
+  }
485
+}

+ 268 - 0
src/moduleB/pages/comicActivityCurrent/index.less

@@ -0,0 +1,268 @@
1
+.mine {
2
+  padding: 48px 20px;
3
+  min-height: 100vh;
4
+  background-color: #041129;
5
+
6
+  .before-painting {
7
+    padding: 0 20px;
8
+  }
9
+
10
+  .title {
11
+    width: 100%;
12
+    display: flex;  
13
+    justify-content: center;
14
+    align-items: center;
15
+
16
+    .tips-img {
17
+      width: 56px;
18
+      height: 56px;
19
+    }
20
+
21
+    .tips-title {
22
+      margin: 0 10px;
23
+      font-size: 44px;
24
+      font-family: PingFang SC;
25
+      font-weight: bold;
26
+      color: #FDFDFD;
27
+      background: linear-gradient(0deg, #26FFFF 0%, #90C3FE 50%, #E9A2FF 100%);
28
+      -webkit-background-clip: text;
29
+      -webkit-text-fill-color: transparent;
30
+    }
31
+    .tips-title-img{
32
+      width: 148px;
33
+      height: 72px;
34
+    }
35
+  }
36
+
37
+  .banner {
38
+    position: relative;
39
+    margin-top: 60px;
40
+
41
+    .banner-content {
42
+      position: relative;
43
+      left: 50%;
44
+      transform: translateX(-50%);
45
+      width: 100%;
46
+      height: 700px;
47
+
48
+      .content-img {
49
+        width: 100%;
50
+        height: 100%;
51
+      }
52
+      .album_swiper_video{
53
+        width: 100%;
54
+        height: 100%;
55
+      }
56
+      .delete {
57
+        position: absolute;
58
+        right: -20px;
59
+        top: -20px;
60
+        width: 40px;
61
+        height: 40px;
62
+      }
63
+    }
64
+
65
+
66
+    .banner-tips {
67
+      margin-top: 20px;
68
+      text-align: center;
69
+      font-size: 28px;
70
+      font-family: PingFang SC;
71
+      font-weight: bold;
72
+      color: #FDFDFD;
73
+      line-height: 40px;
74
+    }
75
+  }
76
+
77
+  .step {
78
+    margin-top: 60px;
79
+    width: 100%;
80
+    display: flex;
81
+    justify-content: center;
82
+
83
+    .step-img {
84
+      width: 536px;
85
+      height: 76px;
86
+    }
87
+  }
88
+
89
+  .update {
90
+    margin-top: 40px;
91
+    width: 100%;
92
+    display: flex;
93
+    justify-content: space-between;
94
+
95
+    .update-button-more {
96
+      width: 206px;
97
+      height: 94px;
98
+      display: flex;
99
+      justify-content: center;
100
+      align-items: center;
101
+      background: #2C2C2C;
102
+      border-radius: 46px;
103
+      font-size: 32px;
104
+      font-family: PingFang SC;
105
+      font-weight: bold;
106
+      color: #FDFDFD;
107
+    }
108
+
109
+    .update-button {
110
+      width: 418px;
111
+      height: 94px;
112
+      background: linear-gradient(90deg, #0F83FE, #01FBCD);
113
+      display: flex;
114
+      justify-content: center;
115
+      align-items: center;
116
+      font-size: 32px;
117
+      border-radius: 46px;
118
+      font-family: PingFang SC;
119
+      font-weight: bold;
120
+      color: #FDFDFD;
121
+
122
+    }
123
+
124
+    .update-button:active {
125
+      opacity: 0.5;
126
+    }
127
+  }
128
+
129
+  .tip-img {
130
+    margin-top: 54px;
131
+    width: 100%;
132
+    display: flex;
133
+    justify-content: center;
134
+
135
+    .ps-image {
136
+      width: 566px;
137
+      height: 194px;
138
+    }
139
+  }
140
+
141
+  .after-painting {
142
+    padding: 0 60px;
143
+
144
+    .result-banner {
145
+      position: relative;
146
+      margin-top: 20px;
147
+
148
+      .result-banner-content {
149
+        position: relative;
150
+        left: 50%;
151
+        transform: translateX(-50%);
152
+        width: 440px;
153
+
154
+        .result-content-img {
155
+          width: 100%;
156
+          min-height: 440px;
157
+        }
158
+
159
+        .delete {
160
+          position: absolute;
161
+          right: -20px;
162
+          top: -20px;
163
+          width: 40px;
164
+          height: 40px;
165
+        }
166
+      }
167
+
168
+      .banner-tips {
169
+        margin-top: 20px;
170
+        text-align: center;
171
+        font-size: 28px;
172
+        font-family: PingFang SC;
173
+        font-weight: bold;
174
+        color: #FDFDFD;
175
+        line-height: 40px;
176
+      }
177
+    }
178
+
179
+    .after-tips {
180
+      margin-top: 60px;
181
+      text-align: center;
182
+      font-size: 36px;
183
+      font-family: PingFang SC;
184
+      font-weight: bold;
185
+      color: #FFFFFF;
186
+    }
187
+
188
+    .result-update {
189
+      margin-top: 40px;
190
+
191
+      .result-recharge-button {
192
+        background: linear-gradient(90deg, #C367DE, #3342FF);
193
+        border-radius: 46px;
194
+        width: 100%;
195
+        height: 94px;
196
+        display: flex;
197
+        align-items: center;
198
+        justify-content: center;
199
+
200
+        .result-recharge-button-content {
201
+
202
+          .result-recharge-button-top {
203
+            font-size: 32px;
204
+            font-family: PingFang SC;
205
+            font-weight: bold;
206
+            text-align: center;
207
+            color: #FFFFFF;
208
+            line-height: 40px;
209
+          }
210
+
211
+          .result-recharge-button-bottom {
212
+            font-size: 24px;
213
+            font-family: PingFang SC;
214
+            font-weight: bold;
215
+            text-align: center;
216
+            color: rgba(255, 255, 255, .7);
217
+            line-height: 40px;
218
+          }
219
+        }
220
+
221
+      }
222
+
223
+      .result-update-button {
224
+        margin-top: 38px;
225
+        border-radius: 46px;
226
+        width: 100%;
227
+        height: 94px;
228
+        display: flex;
229
+        align-items: center;
230
+        justify-content: center;
231
+        font-size: 28px;
232
+        font-family: PingFang SC;
233
+        font-weight: bold;
234
+        color: #FDFDFD;
235
+        border: 2px solid #FFFFFF;
236
+
237
+        .result-update-img {
238
+          width: 52px;
239
+          height: 52px;
240
+          display: block;
241
+          margin-right: 10px;
242
+        }
243
+      }
244
+
245
+      .result-update-button:active {
246
+        opacity: 0.5;
247
+      }
248
+    }
249
+  }
250
+
251
+  /* 定义动画 */
252
+  @keyframes shrink {
253
+
254
+    0%,
255
+    100% {
256
+      transform: translateY(0) scale(1);
257
+    }
258
+
259
+    50% {
260
+      transform: translateY(0px) scale(0.95);
261
+    }
262
+  }
263
+
264
+  /* 应用动画 */
265
+  .update-active {
266
+    animation: shrink 1.2s ease-in-out infinite;
267
+  }
268
+}

+ 5 - 0
src/moduleB/pages/comicActivityCurrentDetail/index.config.js

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '人物动漫化详情',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 459 - 0
src/moduleB/pages/comicActivityCurrentDetail/index.jsx

@@ -0,0 +1,459 @@
1
+import { Component } from 'react'
2
+import { View, Text, Button, Image, ScrollView, Input } from '@tarojs/components'
3
+import * as api from '../../../service/index'
4
+import tool from '../../../common/tool'
5
+import ttappid from '../../../../project.tt.json'
6
+import Taro, { getCurrentInstance } from '@tarojs/taro'
7
+import './index.less'
8
+
9
+export default class collection extends Component {
10
+  $instance = getCurrentInstance()
11
+  state = {
12
+    jumpurl: '',//广告id
13
+    task_id: 0,//任务id
14
+    repeat: 0,//广告次数
15
+    current: 0,
16
+    interval: null,
17
+    draw_status: 0,
18
+    draw_infos: [],
19
+    que_cnt: 0,
20
+    default_img: '',
21
+    wallet_balance: 0,//用户当前余额
22
+    is_week: 0,//是否是会员
23
+  }
24
+
25
+  componentWillMount () {
26
+
27
+  }
28
+  componentDidShow () {
29
+    let routers = this.$instance.router.params
30
+    this.getCoinTaskAd()
31
+    api.unlockGcImg({ task_id: routers.task_id }).then(res => {
32
+      console.log('解锁');
33
+      if (res.code == 200) {
34
+        this.getDrawTaskStatus(routers.task_id)
35
+      }
36
+    })
37
+  }
38
+  //页面销毁之前调用
39
+  componentWillUnmount () {
40
+    //避免服务器攻击
41
+    clearInterval(this.state.interval)
42
+  }
43
+  getCoinTaskAd () {
44
+    api.getCoinTaskAd().then(res => {
45
+      if (res.code == 200) {
46
+        this.setState({
47
+          jumpurl: res.data[0].jumpurl,//广告id
48
+          task_id: res.data[0].id,//任务id
49
+          repeat: res.data[0].repeat
50
+        })
51
+      }
52
+    })
53
+  }
54
+  //解锁成功
55
+  unlockGcImg (item, index) {
56
+    console.log('解锁002');
57
+    api.unlockGcImg({ task_id: item.task_id }).then(res => {
58
+      if (res.code == 200) {
59
+        this.setState({
60
+          current: index
61
+        })
62
+        this.getDrawTaskStatus(item.task_id)
63
+      }
64
+    })
65
+  }
66
+
67
+  selectedLabel (item, index) {
68
+    let that = this
69
+    console.log(item, 'itemitem');
70
+    if (item.unlock_status == 0) {
71
+      if (this.state.is_week == 0) {
72
+
73
+        Taro.showModal({
74
+          title: '提示',
75
+          content: '是否观看广告解锁?',
76
+          success: function (res) {
77
+            if (res.confirm) {
78
+              if (item.status == 4) {
79
+                that.generatePictures(item, index)
80
+              }
81
+              that.playVideo(item, index)
82
+            } else if (res.cancel) {
83
+              console.log('用户点击取消')
84
+            }
85
+          }
86
+        })
87
+      } else {
88
+        Taro.showToast({
89
+          title: '解锁成功',
90
+          icon: 'none',
91
+          duration: 2000
92
+        })
93
+        that.unlockGcImg(item, index)
94
+        if (item.status == 4) {
95
+          that.generatePictures(item, index)
96
+        }
97
+      }
98
+    } else {
99
+      this.setState({
100
+        current: index
101
+      })
102
+    }
103
+
104
+  }
105
+  //观看广告
106
+  playVideo (item, index) {
107
+    if (process.env.TARO_ENV == 'tt') {
108
+      this.playVideoTT(item, index)
109
+    } else {
110
+      this.playVideoWeapp(item, index)
111
+    }
112
+  }
113
+  //抖音激励广告
114
+  playVideoTT (item, index) {
115
+    let that = this
116
+    Taro.showLoading({
117
+      title: '加载中...',
118
+    })
119
+    const videoAd = tt.createRewardedVideoAd({ adUnitId: this.state.jumpurl });
120
+    videoAd.show()
121
+    videoAd.onError((err) => {
122
+      Taro.hideLoading()
123
+      switch (err.errCode) {
124
+        case 1004:
125
+          // 无合适的广告
126
+          break;
127
+        default:
128
+        // 更多请参考错误码文档
129
+      }
130
+    });
131
+    try {
132
+      if (videoAd.closeHandler) {
133
+        videoAd.offClose(videoAd.closeHandler);
134
+        console.log("videoAd.offClose卸载成功");
135
+      }
136
+    } catch (e) {
137
+      console.log("videoAd.offClose 卸载失败");
138
+      console.error(e);
139
+    }
140
+    videoAd.closeHandler = function (data) {
141
+      Taro.hideLoading()
142
+      if (data.isEnded) {
143
+        Taro.showToast({
144
+          title: '解锁成功',
145
+          icon: 'none',
146
+          duration: 2000
147
+        })
148
+        that.unlockGcImg(item, index)
149
+      } else {
150
+        that.getDrawTaskStatus(item.task_id)
151
+        Taro.showToast({
152
+          title: '解锁失败',
153
+          icon: 'none',
154
+          duration: 2000
155
+        })
156
+      }
157
+    }
158
+    // 监听视频播放完成
159
+    videoAd.onClose(videoAd.closeHandler);
160
+  }
161
+  //激励广告
162
+  playVideoWeapp (item, index) {
163
+    console.log(item, 'guanggao');
164
+    // 在页面中定义激励视频广告
165
+    let adUnitId = this.state.jumpurl
166
+    // 在页面中定义激励视频广告
167
+    let videoAd = null
168
+    let that = this
169
+    // 在页面onLoad回调事件中创建激励视频广告实例
170
+    if (wx.createRewardedVideoAd) {
171
+      videoAd = wx.createRewardedVideoAd({
172
+        adUnitId: adUnitId
173
+      })
174
+      videoAd.onLoad(() => {
175
+      })
176
+      videoAd.onError((err) => { })
177
+      try {
178
+        if (videoAd.closeHandler) {
179
+          videoAd.offClose(videoAd.closeHandler);
180
+          console.log("videoAd.offClose卸载成功");
181
+        }
182
+      } catch (e) {
183
+        console.log("videoAd.offClose 卸载失败");
184
+        console.error(e);
185
+      }
186
+      videoAd.closeHandler = function (res) {
187
+        Taro.hideLoading()
188
+        // 用户点击了【关闭广告】按钮
189
+        if (res && res.isEnded || res === undefined) {
190
+          // 正常播放结束,可以下发游戏奖励
191
+          Taro.showToast({
192
+            title: '解锁成功',
193
+            icon: 'none',
194
+            duration: 2000
195
+          })
196
+          console.log(item, '关闭');
197
+          that.unlockGcImg(item, index)
198
+        } else {
199
+          console.log(item, '关闭1');
200
+          //提前关闭小程序
201
+          that.getDrawTaskStatus(item.task_id)
202
+          Taro.showToast({
203
+            title: '解锁失败',
204
+            icon: 'none',
205
+            duration: 2000
206
+          })
207
+        }
208
+      };
209
+      videoAd.onClose(videoAd.closeHandler);
210
+
211
+    }
212
+
213
+    // 用户触发广告后,显示激励视频广告
214
+    if (videoAd) {
215
+      videoAd.show().catch(() => {
216
+        // 失败重试
217
+        videoAd.load()
218
+          .then(() => videoAd.show())
219
+          .catch(err => {
220
+            Taro.showToast({
221
+              title: '暂无广告',
222
+              icon: 'none',
223
+              duration: 2000
224
+            })
225
+            console.log('激励视频 广告显示失败')
226
+          })
227
+      })
228
+    }
229
+
230
+  }
231
+  //画画
232
+  generatePictures (item, index) {
233
+    console.log(item, '画画');
234
+    api.drawGcImgTask({ task_id: item.task_id }).then(res => {
235
+      if (res.code == 200) {
236
+        this.getDrawTaskStatus(item.task_id)
237
+      }
238
+    })
239
+  }
240
+  getDrawTaskStatus (task_id) {
241
+    api.getDrawTaskStatusGc({ task_id: task_id }).then(res => {
242
+      //定时器不要轻易改,避免造成服务器攻击
243
+      if (res.code == 200) {
244
+        let draw_infos = res.data.draw_infos
245
+        // if (res.data.draw_status != 2) {
246
+        //   let params = {}
247
+        //   params['img'] = res.data.default_img
248
+        //   params['id'] = -1
249
+        //   draw_infos.push(params)
250
+        // }
251
+        console.log(draw_infos, 'draw_infos');
252
+        if (res.data.draw_status != 2 && res.data.que_cnt > 1) {
253
+          this.state.interval = setInterval(() => {
254
+            clearInterval(this.state.interval)
255
+            this.getDrawTaskStatus(task_id)
256
+          }, 1000 * 10)
257
+        } else if (res.data.draw_status != 2 && res.data.que_cnt <= 1) {
258
+          clearInterval(this.state.interval)
259
+          this.state.interval = setInterval(() => {
260
+            this.getDrawTaskStatus(task_id)
261
+          }, 1000 * 5)
262
+        } else {
263
+          clearInterval(this.state.interval)
264
+        }
265
+        this.setState({
266
+          draw_status: res.data.draw_status,
267
+          que_cnt: res.data.que_cnt,
268
+          draw_infos: draw_infos,
269
+          is_week: res.data.is_week,
270
+          wallet_balance: res.data.wallet_balance
271
+        })
272
+      }
273
+    })
274
+  }
275
+
276
+  download () {
277
+    this.downImg()
278
+  }
279
+  // 鉴权操作 判断是否有保存到相册的权限
280
+  // 有就直接下载 没有就弹窗提示给权限
281
+  downImg () {
282
+    Taro.getSetting({
283
+      success: res => {
284
+        if (!res.authSetting['scope.writePhotosAlbum']) {
285
+          Taro.authorize({
286
+            scope: 'scope.writePhotosAlbum',
287
+            success: () => {
288
+              this.doSaveImg()
289
+            },
290
+            fail: () => {
291
+              this.openConfirm()
292
+            }
293
+          })
294
+        } else {
295
+          this.doSaveImg()
296
+        }
297
+      }
298
+    })
299
+  }
300
+  // 生成临时路径 保存图片到手机
301
+  doSaveImg () {
302
+    Taro.downloadFile({
303
+      url: this.state.draw_infos[this.state.current].img,
304
+      success: res => {
305
+        Taro.saveImageToPhotosAlbum({
306
+          filePath: res.tempFilePath,
307
+          success: () => {
308
+            Taro.showToast({ title: '已保存到相册', icon: 'success' })
309
+          },
310
+          fail: () => {
311
+            Taro.showToast({ title: '保存失败', icon: 'none' })
312
+          }
313
+        })
314
+      }
315
+    })
316
+  }
317
+  // 权限弹窗
318
+  openConfirm () {
319
+    Taro.showModal({
320
+      content: '检测到您没有打开小程序相册权限,是否取设置打开?',
321
+      showCancel: true,
322
+      success: res => {
323
+        if (res.confirm) {
324
+          // 打开权限
325
+          Taro.openSetting({
326
+            success: res => {
327
+              this.doSaveImg()
328
+            }
329
+          })
330
+        }
331
+      }
332
+    })
333
+  }
334
+  toIndex () {
335
+    // Taro.reLaunch({
336
+    //   url: `/pages/index/index`
337
+    // })
338
+  }
339
+  previewImage () {
340
+    Taro.previewImage({
341
+      current: this.state.draw_infos[this.state.current].img, // 当前显示图片的http链接  
342
+      urls: [`${this.state.draw_infos[this.state.current].img}`] // 需要预览的图片http链接列表  
343
+    })
344
+  }
345
+  onUploadDouyinVideo  () {
346
+    // 通过 uploadOptions 可以拿到 button target 上的一些信息
347
+    // 如这里的 demo 可以拿到 id: "1",hello: "world"
348
+    console.log("onUploadDouyinVideoOptions: ", uploadOptions);
349
+
350
+    // 可以利用异步能力配合其他 API 获取必要的字段信息
351
+    const videoPath = this.chooseVideo();
352
+    console.log("videoPath:", videoPath);
353
+    // 返回值(文档中称之为 uploadParams)将被当作发布参数传入视频发布器,发布视频
354
+    return {
355
+      videoPath,
356
+      stickersConfig: {
357
+        text: [
358
+          {
359
+            text: "这是文字贴图",
360
+            color: "#ffffff",
361
+            fontSize: 28,
362
+            scale: 1,
363
+            x: 0.5,
364
+            y: 0.5,
365
+          },
366
+        ],
367
+      },
368
+      success: function (callback) {
369
+        // 只有当发布成功且挂载成功时,success callback 才会有 videoId
370
+        console.log("success: ", callback);
371
+      },
372
+      fail: function (callback) {
373
+        console.log("fail: ", callback);
374
+      },
375
+      complete: function (callback) {
376
+        console.log("complete: ", callback);
377
+      },
378
+    };
379
+  }
380
+  // chooseVideo () {
381
+  //   return new Promise((resolve) => {
382
+  //     tt.chooseVideo({
383
+  //       sourceType: ["album", "camera"],
384
+  //       compressed: true,
385
+  //       success: (res) => {
386
+  //         resolve(res.tempFilePath);
387
+  //       },
388
+  //       fail: (err) => {
389
+  //         let errType = err.errMsg.includes("chooseVideo:fail cancel")
390
+  //           ? "取消选择"
391
+  //           : "选择失败";
392
+  //         tt.showModal({
393
+  //           title: errType,
394
+  //           content: err.errMsg,
395
+  //           showCancel: false,
396
+  //         });
397
+  //         resolve("");
398
+  //       },
399
+  //     });
400
+  //   });
401
+  // }
402
+
403
+
404
+  render () {
405
+    return (
406
+      <View className='mine'>
407
+        {
408
+          this.state.draw_infos.length > 0 &&
409
+          <View className='banner'>
410
+            <View className='banner-content'>
411
+              <Image className='content-img'
412
+                mode='aspectFit'
413
+                onClick={e => (this.previewImage())}
414
+                src={this.state.draw_infos[this.state.current].img}
415
+              ></Image>
416
+            </View>
417
+          </View>
418
+        }
419
+        <ScrollView
420
+          className='recharge'
421
+          scrollX
422
+        >
423
+          {
424
+            this.state.draw_infos.map((item, index) => (
425
+              <View className='recharge-info'
426
+                key={index}
427
+                onClick={e => (this.selectedLabel(item, index))}>
428
+                <Image className='recharge-image' mode='aspectFit' src={item.img}></Image>
429
+                {
430
+                  item.unlock_status == 0 &&
431
+                  <View className='lock'>
432
+                    <View className='lock-content'>
433
+                      <Image className='lock-img' src='http://video-img.fyshark.com/1681733630830%E8%A7%A3%E9%94%81%402x.png'></Image>
434
+                      <View className='lock-title'>{item.model_name}</View>
435
+                    </View>
436
+                  </View>
437
+                }
438
+              </View>
439
+            ))
440
+          }
441
+        </ScrollView>
442
+        <View className='tips'>作品可在「绘画作品」中查看</View>
443
+        {/* <View className='send'>
444
+          <View className='sendTT'>一键发抖音</View>
445
+        </View> */}
446
+        <View className='control'>
447
+          <View className='download' onClick={e => (this.download())}>保存图片</View>
448
+          <View className='toIndex' onClick={e => (this.toIndex())}>前往探索更多玩法</View>
449
+        </View>
450
+        <Button openType="uploadDouyinVideo">
451
+          uploadDouyinVideo
452
+        </Button>
453
+        <button open-type="uploadDouyinVideo" id="1" data-hello="world">
454
+          发布
455
+        </button>
456
+      </View>
457
+    )
458
+  }
459
+}

+ 216 - 0
src/moduleB/pages/comicActivityCurrentDetail/index.less

@@ -0,0 +1,216 @@
1
+.mine {
2
+  padding: 1px 40px;
3
+  min-height: 100vh;
4
+  position: relative;
5
+  background-color: #041129;
6
+
7
+
8
+  .banner {
9
+    position: relative;
10
+    border-radius: 20px;
11
+    width: 100%;
12
+
13
+    .banner-content {
14
+      position: relative;
15
+      border-radius: 20px;
16
+      left: 50%;
17
+      transform: translateX(-50%);
18
+      width: 100%;
19
+      height: 740px;
20
+    }
21
+
22
+    .content-img {
23
+      // background-color: #545353;
24
+      border-radius: 20px;
25
+      width: 100%;
26
+      height: 100%;
27
+    }
28
+
29
+    .content-wait {
30
+      border-radius: 20px;
31
+      position: absolute;
32
+      top: 0;
33
+      left: 0;
34
+      width: 100%;
35
+      height: 100%;
36
+      background: rgba(0, 0, 0, 0.6);
37
+
38
+      .wait-date {
39
+        margin-top: 12px;
40
+        margin-left: 16px;
41
+        font-size: 36px;
42
+        font-family: PingFang SC;
43
+        font-weight: bold;
44
+        color: #FFFFFF;
45
+      }
46
+
47
+      .wait-middle {
48
+        position: absolute;
49
+        top: 50%;
50
+        left: 50%;
51
+        transform: translate(-50%, -50%);
52
+        font-size: 40px;
53
+        font-family: PingFang SC;
54
+        font-weight: 800;
55
+        color: #FFFFFF;
56
+      }
57
+
58
+      .wait-bottom {
59
+        width: 100%;
60
+        position: absolute;
61
+        bottom: 40px;
62
+        left: 0;
63
+        font-size: 40px;
64
+        font-family: PingFang SC;
65
+        font-weight: 500;
66
+        color: #FFFFFF;
67
+
68
+        .wait-num {
69
+          text-align: center;
70
+        }
71
+
72
+        .wait-get-num {
73
+          text-align: center;
74
+          margin-top: 16px;
75
+          text-decoration: underline
76
+        }
77
+      }
78
+    }
79
+
80
+  }
81
+
82
+  .recharge {
83
+    margin-top: 30px;
84
+    width: 100%;
85
+    white-space: nowrap;
86
+
87
+    .recharge-info {
88
+      position: relative;
89
+      border-radius: 10px;
90
+      margin-right: 20px;
91
+      display: inline-block;
92
+
93
+      .recharge-image {
94
+        width: 130px;
95
+        height: 230px;
96
+        display: block;
97
+        background-color: #545353;
98
+        border-radius: 10px;
99
+      }
100
+
101
+      .lock {
102
+        border-radius: 10px;
103
+        position: absolute;
104
+        top: 0;
105
+        left: 0;
106
+        width: 100%;
107
+        height: 100%;
108
+        background: rgba(0, 0, 0, 0.6);
109
+
110
+
111
+        .lock-content {
112
+          position: relative;
113
+          top: 50%;
114
+          transform: translateY(-50%);
115
+
116
+          .lock-img {
117
+            position: relative;
118
+            left: 50%;
119
+            transform: translateX(-50%);
120
+            width: 36px;
121
+            display: block;
122
+            height: 36px;
123
+          }
124
+
125
+          .lock-title {
126
+            text-align: center;
127
+            margin-top: 10px;
128
+            font-size: 26px;
129
+            font-family: PingFang SC;
130
+            font-weight: 500;
131
+            color: #FFFFFF;
132
+          }
133
+        }
134
+      }
135
+    }
136
+
137
+  }
138
+
139
+  .tips {
140
+    margin-top: 30px;
141
+    font-size: 26px;
142
+    font-family: PingFang SC;
143
+    font-weight: 500;
144
+    color: #c7c5c5;
145
+    text-align: center;
146
+  }
147
+
148
+  .send {
149
+    width: 100%;
150
+    display: flex;
151
+    justify-content: center;
152
+  }
153
+
154
+  .sendTT {
155
+    margin-top: 100px;
156
+    width: 460px;
157
+    height: 80px;
158
+    line-height: 80px;
159
+    text-align: center;
160
+    font-size: 28px;
161
+    font-family: PingFang SC;
162
+    font-weight: 500;
163
+    color: #FFFFFF;
164
+    background: linear-gradient(90deg, #1cbd67, #13c027);
165
+    border-radius: 14px;
166
+  }
167
+
168
+  /* 定义动画 */
169
+  @keyframes shrink {
170
+
171
+    0%,
172
+    100% {
173
+      transform: translateY(0) scale(1);
174
+    }
175
+
176
+    50% {
177
+      transform: translateY(0px) scale(0.95);
178
+    }
179
+  }
180
+
181
+  /* 应用动画 */
182
+  .sendTT {
183
+    animation: shrink 1.2s ease-in-out infinite;
184
+  }
185
+
186
+  .control {
187
+    width: 100%;
188
+    margin-top: 100px;
189
+    display: flex;
190
+    justify-content: space-between;
191
+    align-items: center;
192
+    font-size: 28px;
193
+    font-family: PingFang SC;
194
+    font-weight: 500;
195
+    color: #FFFFFF;
196
+
197
+    .download {
198
+      width: 260px;
199
+      height: 80px;
200
+      line-height: 80px;
201
+      text-align: center;
202
+      background: linear-gradient(90deg, #038EFF, #3342FF);
203
+      border-radius: 14px;
204
+    }
205
+
206
+    .toIndex {
207
+      width: 260px;
208
+      height: 80px;
209
+      line-height: 80px;
210
+      text-align: center;
211
+      background: linear-gradient(90deg, #038EFF, #3342FF);
212
+      border-radius: 14px;
213
+    }
214
+  }
215
+
216
+}

+ 8 - 0
src/service/index.js

@@ -277,6 +277,14 @@ export const imageDetection = data =>
277 277
     method: 'POST',
278 278
     data,
279 279
   });
280
+//通用活动
281
+export const getDrawAloneImgIndex = data =>
282
+  Request({
283
+    url: '/api/get_draw_alone_img_index',
284
+    method: 'POST',
285
+    data,
286
+  });
287
+
280 288
 
281 289
 
282 290