Kaynağa Gözat

添加AI绘画

黎海 1 yıl önce
ebeveyn
işleme
d7997a7cea
38 değiştirilmiş dosya ile 2255 ekleme ve 619 silme
  1. 1 1
      project.tt.json
  2. 13 7
      src/app.config.js
  3. 1 1
      src/common/tool.js
  4. 17 2
      src/moduleA/pages/communityDetail/index.jsx
  5. 2 0
      src/moduleA/pages/communityDetail/index.less
  6. 120 15
      src/moduleA/pages/darwDetail/index.jsx
  7. 26 3
      src/moduleA/pages/darwDetail/index.less
  8. 82 2
      src/moduleA/pages/earnPoints/index.jsx
  9. 3 1
      src/moduleA/pages/upload/index.jsx
  10. 5 0
      src/moduleB/pages/comic/index.config.js
  11. 132 0
      src/moduleB/pages/comic/index.jsx
  12. 106 0
      src/moduleB/pages/comic/index.less
  13. 5 0
      src/moduleB/pages/faceChanging/index.config.js
  14. 214 0
      src/moduleB/pages/faceChanging/index.jsx
  15. 97 0
      src/moduleB/pages/faceChanging/index.less
  16. 5 0
      src/moduleB/pages/like/index.config.js
  17. 173 0
      src/moduleB/pages/like/index.jsx
  18. 132 0
      src/moduleB/pages/like/index.less
  19. 5 0
      src/moduleB/pages/point/index.config.js
  20. 32 0
      src/moduleB/pages/point/index.jsx
  21. 132 0
      src/moduleB/pages/point/index.less
  22. 5 0
      src/moduleB/pages/real/index.config.js
  23. 90 0
      src/moduleB/pages/real/index.jsx
  24. 40 0
      src/moduleB/pages/real/index.less
  25. 5 0
      src/moduleB/pages/realDetail/index.config.js
  26. 47 0
      src/moduleB/pages/realDetail/index.jsx
  27. 13 0
      src/moduleB/pages/realDetail/index.less
  28. 5 0
      src/moduleB/pages/works/index.config.js
  29. 272 0
      src/moduleB/pages/works/index.jsx
  30. 132 0
      src/moduleB/pages/works/index.less
  31. 68 82
      src/pages/activity/index.jsx
  32. 37 91
      src/pages/activity/index.less
  33. 1 1
      src/pages/collection/index.less
  34. 67 42
      src/pages/index/index.jsx
  35. 24 14
      src/pages/index/index.less
  36. 61 247
      src/pages/mine/index.jsx
  37. 41 102
      src/pages/mine/index.less
  38. 44 8
      src/service/index.js

+ 1 - 1
project.tt.json

@@ -1,7 +1,7 @@
1 1
 {
2 2
     "miniprogramRoot": "./",
3 3
     "projectname": "AI绘画练习生",
4
-    "appid": "tt6e291894f116667e01",
4
+    "appid": "tt8534f3891a0bf12e01",
5 5
     "setting": {
6 6
         "es6": false,
7 7
         "minified": false

+ 13 - 7
src/app.config.js

@@ -21,13 +21,19 @@ export default defineAppConfig({
21 21
         "pages/earnPoints/index",
22 22
       ]
23 23
     },
24
-    // {
25
-    //   root: "moduleB",
26
-    //   name: "分包B",
27
-    //   pages: [
28
-       
29
-    //   ]
30
-    // },
24
+    {
25
+      root: "moduleB",
26
+      name: "分包B",
27
+      pages: [
28
+        "pages/works/index",//我的作品
29
+        "pages/like/index",//我的喜欢
30
+        "pages/comic/index",//人物动漫画
31
+        "pages/faceChanging/index",//AI换脸
32
+        "pages/point/index",//新手指引
33
+        "pages/real/index",//资讯
34
+        "pages/realDetail/index",//资讯
35
+      ]
36
+    },
31 37
     
32 38
   ],
33 39
   window: {

+ 1 - 1
src/common/tool.js

@@ -2,7 +2,7 @@ import Taro from '@tarojs/taro'
2 2
 import * as api from '../service/index'
3 3
 const tool = {
4 4
   shareTitle:'一款属于自己的AI绘画小程序,快来创作属于自己的独家作品吧。',
5
-  shareImg:'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679623995925.png',
5
+  shareImg:'http://video-img.fyshark.com/1680599995457%E5%88%86%E4%BA%AB%E5%9B%BE%20200-200.png',
6 6
   //去登录
7 7
   toLogin: function (rescallback = () => { }) {
8 8
     Taro.login({

+ 17 - 2
src/moduleA/pages/communityDetail/index.jsx

@@ -284,15 +284,21 @@ export default class Task extends Component {
284 284
   // 鉴权操作 判断是否有保存到相册的权限
285 285
   // 有就直接下载 没有就弹窗提示给权限
286 286
   downImg () {
287
+    if (process.env.TARO_ENV == 'tt') {
288
+      this.doSaveImg()
289
+      return
290
+    }
287 291
     Taro.getSetting({
288 292
       success: res => {
289 293
         if (!res.authSetting['scope.writePhotosAlbum']) {
290 294
           Taro.authorize({
291 295
             scope: 'scope.writePhotosAlbum',
292 296
             success: () => {
297
+              console.log('成功');
293 298
               this.doSaveImg()
294 299
             },
295 300
             fail: () => {
301
+              console.log('失败');
296 302
               this.openConfirm()
297 303
             }
298 304
           })
@@ -304,6 +310,7 @@ export default class Task extends Component {
304 310
   }
305 311
   // 生成临时路径 保存图片到手机
306 312
   doSaveImg () {
313
+
307 314
     Taro.downloadFile({
308 315
       url: this.state.img_info.img,
309 316
       success: res => {
@@ -343,6 +350,11 @@ export default class Task extends Component {
343 350
       url: `/pages/index/index?task_id=${routers.task_id}`
344 351
     })
345 352
   }
353
+  copyPromptAI () {
354
+    Taro.reLaunch({
355
+      url: `/moduleB/pages/faceChanging/index?img=${this.state.img_info.img}`
356
+    })
357
+  }
346 358
 
347 359
   copyNegativePrompt () {
348 360
     Taro.setClipboardData({
@@ -404,6 +416,9 @@ export default class Task extends Component {
404 416
               maxlength='1000'
405 417
             />
406 418
             <View className='copy'>
419
+              <View className='copy-button' onClick={e => (this.copyPromptAI())}>
420
+                <View>AI换脸</View>
421
+              </View>
407 422
               <View className='copy-button' onClick={e => (this.copyPrompt())}>
408 423
                 <View>画同款</View>
409 424
               </View>
@@ -425,7 +440,7 @@ export default class Task extends Component {
425 440
             </View>
426 441
             <View className='draw-info'>
427 442
               <View className='info-title'>图片质量</View>
428
-              <View className='info-text'>{this.state.task_info.img_type==0?'普通':'高清'} </View>
443
+              <View className='info-text'>{this.state.task_info.img_type == 0 ? '普通' : '高清'} </View>
429 444
             </View>
430 445
             <View className='draw-info'>
431 446
               <View className='info-title'>采样方式</View>
@@ -457,7 +472,7 @@ export default class Task extends Component {
457 472
               <View>发布</View>
458 473
             </View> */}
459 474
             {
460
-              this.state.qrCodeImg.length > 0 &&
475
+              this.state.qrCodeImg.length > 0 && process.env.TARO_ENV != 'tt' &&
461 476
               <View className='func-info' onClick={e => (this.openFill())}>
462 477
                 <Image className='func-image' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678952396973.png'></Image>
463 478
                 <View>分享</View>

+ 2 - 0
src/moduleA/pages/communityDetail/index.less

@@ -63,6 +63,7 @@
63 63
 
64 64
       .draw-taxtarea {
65 65
         width: 642px;
66
+        font-size: 28px;
66 67
         background-color: rgba(255, 255, 255, .05);
67 68
         color: rgba(255, 255, 255, .5);
68 69
         min-height: 240px;
@@ -75,6 +76,7 @@
75 76
         justify-content: flex-end;
76 77
 
77 78
         .copy-button {
79
+          margin-left: 20px;
78 80
           display: flex;
79 81
           align-items: center;
80 82
           color: #FFFFFF;

+ 120 - 15
src/moduleA/pages/darwDetail/index.jsx

@@ -27,17 +27,33 @@ export default class Task extends Component {
27 27
     // TaroCanvasDrawer 组件状态
28 28
     canvasStatus: false,
29 29
     isFill: false,//是否画海报
30
+    lastTime: 0,
31
+    jumpurl: '',//广告id
32
+    task_id: 0,//任务id
33
+    repeat: 0,//广告次数
30 34
   }
31 35
 
32
-  componentDidMount () {
33
-
36
+  componentDidShow () {
37
+    this.getCoinTaskAd()
34 38
   }
35 39
 
36 40
   componentWillMount () {
37 41
     this.getWxCodeImg()
38 42
     this.getDrawTaskStatus()
43
+
39 44
     // this.getWxCodeImg ()
40 45
   }
46
+  getCoinTaskAd () {
47
+    api.getCoinTaskAd().then(res => {
48
+      if (res.code == 200) {
49
+        this.setState({
50
+          jumpurl: res.data[0].jumpurl,//广告id
51
+          task_id: res.data[0].id,//任务id
52
+          repeat: res.data[0].repeat
53
+        })
54
+      }
55
+    })
56
+  }
41 57
   getWxCodeImg () {
42 58
     api.getWxCodeImg({ code_from: 'bill' }).then(res => {
43 59
       this.dataURLtoFile(res.data)
@@ -97,6 +113,7 @@ export default class Task extends Component {
97 113
         if (res.data.draw_status != 2) {
98 114
           let params = {}
99 115
           params['img'] = res.data.default_img
116
+          params['id'] = -1
100 117
           draw_infos.push(params)
101 118
         }
102 119
         console.log(draw_infos, 'draw_infos');
@@ -209,6 +226,11 @@ export default class Task extends Component {
209 226
       }
210 227
     })
211 228
   }
229
+  copyPromptAI () {
230
+    Taro.reLaunch({
231
+      url: `/moduleB/pages/faceChanging/index?img=${this.state.draw_infos[this.state.current].img}`
232
+    })
233
+  }
212 234
 
213 235
   copyNegativePrompt () {
214 236
     Taro.setClipboardData({
@@ -360,7 +382,7 @@ export default class Task extends Component {
360 382
           path: tempFilePath
361 383
         })
362 384
       })
363
-       //画图成功之后打开分享
385
+      //画图成功之后打开分享
364 386
       //  Taro.downloadFile({
365 387
       //   url: tempFilePath,
366 388
       //   success: (res) => {
@@ -411,14 +433,85 @@ export default class Task extends Component {
411 433
       });
412 434
     }
413 435
   }
436
+  //激励广告
437
+  playVideo () {
438
+    let lastTime = this.state.lastTime;
439
+    let now = new Date().getTime();
440
+    if (now - lastTime < 2000) return
441
+    this.setState({
442
+      lastTime: now
443
+    })
444
+    // 在页面中定义激励视频广告
445
+    let adUnitId = this.state.jumpurl
446
+    // 在页面中定义激励视频广告
447
+    let videoAd = null
448
+    let that = this
449
+    console.log(videoAd, 'videoAd');
450
+    // 在页面onLoad回调事件中创建激励视频广告实例
451
+    if (wx.createRewardedVideoAd) {
452
+      videoAd = wx.createRewardedVideoAd({
453
+        adUnitId: adUnitId
454
+      })
455
+      videoAd.onLoad(() => { })
456
+      videoAd.onError((err) => { })
457
+      try {
458
+        if (videoAd.closeHandler) {
459
+          videoAd.offClose(videoAd.closeHandler);
460
+          console.log("videoAd.offClose卸载成功");
461
+        }
462
+      } catch (e) {
463
+        console.log("videoAd.offClose 卸载失败");
464
+        console.error(e);
465
+      }
466
+      videoAd.closeHandler = function (res) {
467
+        // 用户点击了【关闭广告】按钮
468
+        if (res && res.isEnded || res === undefined) {
469
+          // 正常播放结束,可以下发游戏奖励
470
+          api.finishTask({ task_id: that.state.task_id }).then(res => {
471
+            if (res.code == 200) {
472
+              that.getCoinTaskAd()
473
+              Taro.showToast({
474
+                title: '点券+4',
475
+                icon: 'none',
476
+                duration: 2000
477
+              })
478
+            }
479
+          })
480
+        } else {
481
+          that.getCoinTaskAd()
482
+          //提前关闭小程序
483
+        }
484
+      };
485
+      videoAd.onClose(videoAd.closeHandler);
486
+
487
+    }
488
+
489
+    // 用户触发广告后,显示激励视频广告
490
+    if (videoAd) {
491
+      videoAd.show().catch(() => {
492
+        // 失败重试
493
+        videoAd.load()
494
+          .then(() => videoAd.show())
495
+          .catch(err => {
496
+            Taro.showToast({
497
+              title: '暂无广告',
498
+              icon: 'none',
499
+              duration: 2000
500
+            })
501
+            console.log('激励视频 广告显示失败')
502
+          })
503
+      })
504
+    }
505
+
506
+  }
414 507
   openFill () {
415 508
     this.canvasDrawFunc()
416 509
   }
417
-  changeCurrent(e){
510
+  changeCurrent (e) {
418 511
     this.setState({
419
-      current:e.detail.current
512
+      current: e.detail.current
420 513
     })
421
-    console.log(e,'eeee');
514
+    console.log(e, 'eeee');
422 515
   }
423 516
 
424 517
 
@@ -432,24 +525,32 @@ export default class Task extends Component {
432 525
           circular
433 526
           current={this.state.current}
434 527
           adjustHeight='first'
435
-          onChange={e=>(this.changeCurrent(e))}
528
+          onChange={e => (this.changeCurrent(e))}
436 529
           indicatorDots
437
-          >
530
+        >
438 531
           {
439 532
             this.state.draw_infos.map((item, index) => (
440 533
               <SwiperItem key={index}>
441 534
                 <View className='banner-info'>
442 535
                   <Image className='banner-image' mode='aspectFit' src={item.img} onClick={e => (this.previewImage(item, index))}></Image>
443 536
                 </View>
537
+                {
538
+                  this.state.draw_status != 2 && item.id == -1 &&
539
+                  <View className='banner-tips'>
540
+                    <View className='tips-left'>
541
+                      预计等待{Math.ceil((this.state.que_cnt - 1) * 0.2 + 1)}分钟...
542
+                    </View>
543
+                    {
544
+                      this.state.repeat <= 10 && process.env.TARO_ENV != 'tt' &&
545
+                      <View className='tips-right' onClick={e => (this.playVideo())}>
546
+                        点击观看广告领取积分
547
+                      </View>
548
+                    }
549
+                  </View>
550
+                }
444 551
               </SwiperItem>
445 552
             ))
446 553
           }
447
-          {
448
-            this.state.draw_status != 2 &&
449
-            <View className='banner-tips'>
450
-              预计等待{Math.ceil((this.state.que_cnt - 1)*0.2+1)}分钟...
451
-            </View>
452
-          }
453 554
         </Swiper>
454 555
         <View className='content'>
455 556
           <View className='draw-title'>绘画描述</View>
@@ -463,6 +564,9 @@ export default class Task extends Component {
463 564
               disabled
464 565
             />
465 566
             <View className='copy'>
567
+              <View className='copy-button-AI' onClick={e => (this.copyPromptAI())}>
568
+                <View>AI换脸</View>
569
+              </View>
466 570
               <View className='copy-button' onClick={e => (this.copyPrompt())}>
467 571
                 <Image className='copy-icon' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679017836200.png'></Image>
468 572
                 <View>复制</View>
@@ -485,7 +589,7 @@ export default class Task extends Component {
485 589
             </View>
486 590
             <View className='draw-info'>
487 591
               <View className='info-title'>图片质量</View>
488
-              <View className='info-text'>{this.state.draw_data.img_type==0?'普通':'高清'} </View>
592
+              <View className='info-text'>{this.state.draw_data.img_type == 0 ? '普通' : '高清'} </View>
489 593
             </View>
490 594
             <View className='draw-info'>
491 595
               <View className='info-title'>采样方式</View>
@@ -503,6 +607,7 @@ export default class Task extends Component {
503 607
               maxlength='1000'
504 608
             />
505 609
             <View className='copy'>
610
+
506 611
               <View className='copy-button' onClick={e => (this.copyNegativePrompt())}>
507 612
                 <Image className='copy-icon' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679017836200.png'></Image>
508 613
                 <View>复制</View>

+ 26 - 3
src/moduleA/pages/darwDetail/index.less

@@ -9,12 +9,22 @@
9 9
     position: relative;
10 10
 
11 11
     .banner-tips {
12
-      position: absolute;
13
-      top: 50px;
14
-      left: 10px;
15 12
       font-family: PingFangSC-Regular;
16 13
       font-size: 32px;
17 14
       color: rgba(255, 255, 255, .75);
15
+
16
+      .tips-left {
17
+        position: absolute;
18
+        top: 50px;
19
+        left: 10px;
20
+      }
21
+
22
+      .tips-right {
23
+        position: absolute;
24
+        top: 50px;
25
+        right: 10px;
26
+        text-decoration: underline
27
+      }
18 28
     }
19 29
 
20 30
     .banner-info {
@@ -43,6 +53,7 @@
43 53
 
44 54
       .draw-taxtarea {
45 55
         width: 642px;
56
+        font-size: 28px;
46 57
         background-color: rgba(255, 255, 255, .05);
47 58
         color: rgba(255, 255, 255, .5);
48 59
         min-height: 240px;
@@ -54,7 +65,19 @@
54 65
         display: flex;
55 66
         justify-content: flex-end;
56 67
 
68
+        .copy-button-AI {
69
+          display: flex;
70
+          align-items: center;
71
+          color: #FFFFFF;
72
+          background-image: linear-gradient(-45deg, #4EC3F8 0%, #0F84EC 100%);
73
+          font-size: 24px;
74
+          padding: 5px 20px;
75
+          border-radius: 30px;
76
+
77
+        }
78
+
57 79
         .copy-button {
80
+          margin-left: 20px;
58 81
           display: flex;
59 82
           align-items: center;
60 83
           border: 2px solid #0F84EC;

+ 82 - 2
src/moduleA/pages/earnPoints/index.jsx

@@ -14,6 +14,7 @@ export default class Task extends Component {
14 14
     shop_list: [],//充值列表
15 15
     ext_info: {},//注意事项
16 16
     isIos: false,
17
+    lastTime: 0,
17 18
   }
18 19
 
19 20
   componentWillMount () {
@@ -25,6 +26,7 @@ export default class Task extends Component {
25 26
     this.getCoinTaskList()
26 27
     this.getShopList()
27 28
     this.getUserInfo()
29
+   
28 30
   }
29 31
   onShareAppMessage = (res) => {
30 32
     let shareData = {
@@ -34,6 +36,7 @@ export default class Task extends Component {
34 36
     }
35 37
     return shareData;
36 38
   }
39
+
37 40
   //获取任务列表
38 41
   getCoinTaskList () {
39 42
     api.getCoinTaskList().then(res => {
@@ -64,6 +67,11 @@ export default class Task extends Component {
64 67
   }
65 68
   finishTask (item, index) {
66 69
     if (item.status != 0) return
70
+    if (item.btn_title == '观看') {
71
+      console.log('观看');
72
+      this.playVideo(item)
73
+      return
74
+    }
67 75
     if (item.btn_title == '去点赞') {
68 76
       Taro.switchTab({
69 77
         url: '/pages/collection/index'
@@ -83,6 +91,78 @@ export default class Task extends Component {
83 91
       }
84 92
     })
85 93
   }
94
+  //激励广告
95
+  playVideo (item) {
96
+    let lastTime = this.state.lastTime;
97
+    let now = new Date().getTime();
98
+    if (now - lastTime < 2000) return
99
+    console.log(item, 'itehndodjd');
100
+    this.setState({
101
+      lastTime: now
102
+    })
103
+    // 在页面中定义激励视频广告
104
+    let adUnitId = item.jumpurl
105
+    // 在页面中定义激励视频广告
106
+    let videoAd = null
107
+    let that = this
108
+    console.log(videoAd, 'videoAd');
109
+    // 在页面onLoad回调事件中创建激励视频广告实例
110
+    if (wx.createRewardedVideoAd) {
111
+      videoAd = wx.createRewardedVideoAd({
112
+        adUnitId: adUnitId
113
+      })
114
+      videoAd.onLoad(() => { })
115
+      videoAd.onError((err) => { })
116
+      try {
117
+        if (videoAd.closeHandler) {
118
+          videoAd.offClose(videoAd.closeHandler);
119
+          console.log("videoAd.offClose卸载成功");
120
+        }
121
+      } catch (e) {
122
+        console.log("videoAd.offClose 卸载失败");
123
+        console.error(e);
124
+      }
125
+      videoAd.closeHandler = function (res) {
126
+        // 用户点击了【关闭广告】按钮
127
+        if (res && res.isEnded || res === undefined) {
128
+          // 正常播放结束,可以下发游戏奖励
129
+          api.finishTask({ task_id: item.id }).then(res => {
130
+            if (res.code == 200) {
131
+              that.getUserInfo()
132
+              that.getCoinTaskList()
133
+              Taro.showToast({
134
+                title: '领取点券成功',
135
+                icon: 'none',
136
+                duration: 2000
137
+              })
138
+            }
139
+          })
140
+        } else {
141
+          //提前关闭小程序
142
+        }
143
+      };
144
+      videoAd.onClose(videoAd.closeHandler);
145
+
146
+    }
147
+
148
+    // 用户触发广告后,显示激励视频广告
149
+    if (videoAd) {
150
+      videoAd.show().catch(() => {
151
+        // 失败重试
152
+        videoAd.load()
153
+          .then(() => videoAd.show())
154
+          .catch(err => {
155
+            Taro.showToast({
156
+              title: '暂无广告',
157
+              icon: 'none',
158
+              duration: 2000
159
+            })
160
+            console.log('激励视频 广告显示失败')
161
+          })
162
+      })
163
+    }
164
+
165
+  }
86 166
   toShareCnt () {
87 167
     Taro.navigateTo({
88 168
       url: '/moduleA/pages/shareCnt/index'
@@ -210,7 +290,7 @@ export default class Task extends Component {
210 290
             </View>
211 291
           }
212 292
           {
213
-            !this.state.isIos &&
293
+            !this.state.isIos &&process.env.TARO_ENV!='tt'&&
214 294
             < View >
215 295
               <View className='contact-title'>
216 296
                 点券充值
@@ -255,7 +335,7 @@ export default class Task extends Component {
255 335
             </View>
256 336
           }
257 337
           {
258
-            this.state.isIos &&
338
+            this.state.isIos &&process.env.TARO_ENV!='tt'&&
259 339
             <View className='ios-tips'>
260 340
               ios暂不支持充值
261 341
             </View>

+ 3 - 1
src/moduleA/pages/upload/index.jsx

@@ -85,6 +85,8 @@ export default class Mine extends Component {
85 85
             Taro.navigateBack({delta: 1}); //返回上一个页面
86 86
           })
87 87
         }
88
+      }else{
89
+        Taro.showToast({ title: res.msg, icon: 'none' })
88 90
       }
89 91
     })
90 92
     console.log(e,'cut');
@@ -119,7 +121,7 @@ export default class Mine extends Component {
119 121
             // src='https://video-h5.fyshark.com/tmp/10581_168007502299.png'
120 122
             cropperWidth={this.state.cropperWidth}
121 123
             cropperHeight={this.state.cropperHeight}
122
-            height={'1300'}
124
+            height={'1100'}
123 125
             hideCancelText={false}
124 126
             themeColor='#1084EC'
125 127
             onCut={res => {

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

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

+ 132 - 0
src/moduleB/pages/comic/index.jsx

@@ -0,0 +1,132 @@
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 Taro, { } from '@tarojs/taro'
6
+import './index.less'
7
+
8
+export default class collection extends Component {
9
+  state = {
10
+    consultImg: 'http://video-img.fyshark.com/1680144082044%E7%BC%96%E7%BB%84.png',
11
+    sizeIndex: 0,
12
+    mass:0,
13
+    isImage: false
14
+  }
15
+
16
+  componentWillMount () {
17
+  }
18
+  componentDidShow () {
19
+    //接收裁剪图片
20
+    let pages = Taro.getCurrentPages();
21
+    let currentPage = pages[pages.length - 1]; // 获取当前页面
22
+    console.log(currentPage,'currentPage');
23
+    if (process.env.TARO_ENV == 'weapp') {
24
+      if (currentPage.__data__.consultImg) { // 获取值
25
+        this.setState({
26
+          consultImg: currentPage.__data__.consultImg,
27
+          sizeIndex: currentPage.__data__.sizeIndex,
28
+          isImage: true
29
+        })
30
+      }
31
+    } else if (process.env.TARO_ENV == 'tt') {
32
+      if (currentPage.data.consultImg) { // 获取值
33
+        this.setState({
34
+          consultImg: currentPage.data.consultImg,
35
+          sizeIndex: currentPage.data.sizeIndex,
36
+          isImage: true
37
+        })
38
+      }
39
+    }
40
+  }
41
+  upLode () {
42
+    let that = this
43
+    Taro.chooseMedia({
44
+      count: 1, // 默认
45
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
46
+      sourceType: ['album', 'camera'],
47
+      success: function (res) {
48
+        console.log(res, 'res');
49
+        const file = res.tempFiles[0].tempFilePath
50
+        if (res.tempFiles[0].size > 2000000) {
51
+          Taro.showToast({ title: '图片大小不能超过2M', icon: 'none' })
52
+          return
53
+        }
54
+        Taro.showLoading({
55
+          title: '图片上传中',
56
+        })
57
+        Taro.hideLoading()
58
+        Taro.navigateTo({
59
+          url: `/moduleA/pages/upload/index?image=${file}`
60
+        })
61
+      }
62
+    })
63
+  }
64
+  generatePictures () {
65
+    if (!this.state.isImage) {
66
+      Taro.showToast({ title: '请先上传图片', icon: 'none' })
67
+      return
68
+    }
69
+    api.drawGcImg({ img_url: this.state.consultImg,img_type:this.state.mass }).then(res => {
70
+      if (res.code == 200) {
71
+        Taro.navigateTo({
72
+          url: `/moduleA/pages/darwDetail/index?task_id=${res.data.task_id}`
73
+        })
74
+      }else {
75
+        Taro.hideLoading()
76
+        if (res.code == 4001) {
77
+          Taro.showModal({
78
+            title: '您的余额不足',
79
+            content: '是否前往获取点券?',
80
+            success: function (res) {
81
+              if (res.confirm) {
82
+                Taro.navigateTo({
83
+                  url: `/moduleA/pages/earnPoints/index`
84
+                })
85
+              } else if (res.cancel) {
86
+                console.log('用户点击取消')
87
+              }
88
+            }
89
+          })
90
+        } else {
91
+          Taro.showToast({ icon: 'none', title: res.msg })
92
+        }
93
+      }
94
+    })
95
+  }
96
+  changeMass (e) {
97
+    this.setState({
98
+      mass: e
99
+    })
100
+  }
101
+
102
+  render () {
103
+    return (
104
+      <View className='mine'>
105
+        <View className='title'>人物动漫化</View>
106
+        <View className='content' onClick={e => (this.upLode())}>
107
+          <Image className='content-img'
108
+            mode='aspectFit'
109
+            src={this.state.consultImg}
110
+          ></Image>
111
+          {
112
+            !this.state.isImage &&
113
+            <View className='add-content'>
114
+              <Image className='add-img' src='http://video-img.fyshark.com/1680144257329%2B.png'></Image>
115
+              <View className='add-tips'>上传图片</View>
116
+            </View>
117
+          }
118
+        </View>
119
+        <View className='img-tips'>绝美的动漫头像,上传图片一件生成</View>
120
+        <View className='draw-title'>图片质量</View>
121
+          <View className='draw-mass'>
122
+            <View className='mass-same' style={this.state.mass == 0 ? 'border: 2px solid #0F84EC;' : ''} onClick={e => (this.changeMass(0))}>普通</View>
123
+            <View className='mass-high' style={this.state.mass == 1 ? 'border: 2px solid #0F84EC;' : ''} onClick={e => (this.changeMass(1))}>高清</View>
124
+          </View>
125
+        
126
+        <View className='generate-pictures' onClick={e => (this.generatePictures(e))} >
127
+          生成图片(消耗{2*(this.state.mass+1)}点券)
128
+        </View>
129
+      </View>
130
+    )
131
+  }
132
+}

+ 106 - 0
src/moduleB/pages/comic/index.less

@@ -0,0 +1,106 @@
1
+.mine {
2
+  padding: 48px 32px;
3
+  min-height: 100vh;
4
+  background-color: #041129;
5
+
6
+  .title {
7
+    margin-top: 48px;
8
+    font-family: PingFangSC-Regular;
9
+    font-size: 32px;
10
+    color: #FFFFFF;
11
+  }
12
+
13
+  .content {
14
+    position: relative;
15
+    margin-top: 20px;
16
+
17
+    .add-content {
18
+      position: absolute;
19
+      left: 50%;
20
+      top: 50%;
21
+      transform: translate(-50%,-50%);
22
+      // display: flex;
23
+      // justify-content: center;
24
+
25
+      .add-img {
26
+        position: relative;
27
+        left: 50%;
28
+        transform: translateX(-50%);
29
+        width: 80px;
30
+        height: 80px;
31
+      }
32
+
33
+      .add-tips {
34
+        margin-top: 12px;
35
+        font-family: PingFangSC-Regular;
36
+        font-size: 28px;
37
+        color: #FFFFFF;
38
+        text-align: center;
39
+      }
40
+    }
41
+
42
+    .content-img {
43
+      width: 100%;
44
+      max-height: 760px;
45
+    }
46
+  }
47
+
48
+  .generate-pictures {
49
+    width: 382px;
50
+    height: 96px;
51
+    border-radius: 96px;
52
+    line-height: 96px;
53
+    text-align: center;
54
+    position: fixed;
55
+    bottom: 40px;
56
+    left: 50%;
57
+    z-index: 100;
58
+    transform: translateX(-50%);
59
+    background-image: linear-gradient(-49deg, #5D81FF 0%, #0F84EC 100%);
60
+    font-family: PingFangSC-Regular;
61
+    font-size: 28px;
62
+    color: #FFFFFF;
63
+  }
64
+
65
+  .img-tips {
66
+    margin-top: 20px;
67
+    font-family: PingFangSC-Regular;
68
+    font-size: 24px;
69
+    color: #FFFFFF;
70
+  }
71
+  .draw-title {
72
+    margin-top: 48px;
73
+    font-family: PingFangSC-Regular;
74
+    font-size: 32px;
75
+    color: #FFFFFF;
76
+  }
77
+  .draw-mass {
78
+    margin-top: 20px;
79
+    display: flex;
80
+    font-family: PingFangSC-Regular;
81
+    font-size: 28px;
82
+    color: rgba(255, 255, 255, .5);
83
+
84
+    .mass-same {
85
+      width: 150px;
86
+      box-sizing: border-box;
87
+      height: 80px;
88
+      line-height: 80px;
89
+      text-align: center;
90
+      background-color: rgba(255, 255, 255, .05);
91
+      border-radius: 16px;
92
+    }
93
+
94
+    .mass-high {
95
+      width: 150px;
96
+      height: 80px;
97
+      box-sizing: border-box;
98
+      line-height: 80px;
99
+      text-align: center;
100
+      background-color: rgba(255, 255, 255, .05);
101
+      border-radius: 16px;
102
+      margin-left: 24px;
103
+    }
104
+  }
105
+
106
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: 'AI换脸',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 214 - 0
src/moduleB/pages/faceChanging/index.jsx

@@ -0,0 +1,214 @@
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 Taro, { getCurrentInstance } from '@tarojs/taro'
6
+import './index.less'
7
+
8
+export default class collection extends Component {
9
+  $instance = getCurrentInstance()
10
+  state = {
11
+    consultImg: 'https://video-h5.fyshark.com/1680752646217.png',
12
+    consultImgOther: 'https://video-h5.fyshark.com/1680778269657.png',
13
+    resultImage: '',
14
+    mass: 0,
15
+    isModelImage: false,
16
+    isUserImage: false,
17
+    isRsoutImage: false,
18
+    isChangeButton: false,
19
+    type: ''
20
+  }
21
+
22
+  componentWillMount () {
23
+    let routers = this.$instance.router.params
24
+    console.log(routers, 'routers');
25
+    if (routers.img) {
26
+      this.setState({
27
+        consultImg: routers.img,
28
+        isModelImage: true,
29
+      })
30
+    }
31
+  }
32
+  componentDidShow () {
33
+    //接收裁剪图片
34
+    let pages = Taro.getCurrentPages();
35
+    let currentPage = pages[pages.length - 1]; // 获取当前页面
36
+    if (process.env.TARO_ENV == 'weapp') {
37
+      if (currentPage.__data__.consultImg) { // 获取值
38
+        if (this.state.type == 'demol') {
39
+          this.setState({
40
+            consultImg: currentPage.__data__.consultImg,
41
+            isModelImage: true
42
+          })
43
+        } else {
44
+          this.setState({
45
+            consultImgOther: currentPage.__data__.consultImg,
46
+            isUserImage: true
47
+          })
48
+        }
49
+
50
+      }
51
+    } else if (process.env.TARO_ENV == 'tt') {
52
+      if (currentPage.data.consultImg) { // 获取值
53
+        if (this.state.type == 'demol') {
54
+          this.setState({
55
+            consultImg: currentPage.data.consultImg,
56
+            isModelImage: true
57
+          })
58
+        } else {
59
+          this.setState({
60
+            consultImgOther: currentPage.data.consultImg,
61
+            isUserImage: true
62
+          })
63
+        }
64
+      }
65
+    }
66
+  }
67
+  upLode (type) {
68
+    let that = this
69
+    this.setState({
70
+      type: type
71
+    })
72
+    if (type == 'demol') {
73
+      this.setState({
74
+        isRsoutImage: false,
75
+        isChangeButton:false
76
+      })
77
+    }
78
+    Taro.chooseMedia({
79
+      count: 1, // 默认
80
+      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
81
+      sourceType: ['album', 'camera'],
82
+      success: function (res) {
83
+        console.log(res, 'res');
84
+        const file = res.tempFiles[0].tempFilePath
85
+        if (res.tempFiles[0].size > 2000000) {
86
+          Taro.showToast({ title: '图片大小不能超过2M', icon: 'none' })
87
+          return
88
+        }
89
+        Taro.showLoading({
90
+          title: '图片上传中',
91
+        })
92
+        Taro.hideLoading()
93
+        Taro.navigateTo({
94
+          url: `/moduleA/pages/upload/index?image=${file}`
95
+        })
96
+      }
97
+    })
98
+  }
99
+  generatePictures () {
100
+    if (!this.state.isModelImage) {
101
+      Taro.showToast({ title: '请先上传模板图', icon: 'none' })
102
+      return
103
+    }
104
+    if (this.state.isRsoutImage) {
105
+      Taro.showToast({ title: '请重新上传模板图', icon: 'none' })
106
+      return
107
+    }
108
+    if (!this.state.isUserImage) {
109
+      Taro.showToast({ title: '请先上传人脸图', icon: 'none' })
110
+      return
111
+    }
112
+    Taro.showLoading({
113
+      title: '加载中...',
114
+    })
115
+    let params = { 
116
+      image_template: this.state.consultImg, 
117
+      image_target: this.state.consultImgOther,
118
+    }
119
+    api.aiFaceMege(params).then(res => {
120
+      if (res.code == 200) {
121
+        Taro.hideLoading()
122
+        console.log(`data:image/png;base64,${res.data.imgdata}`, '1111');
123
+        this.setState({
124
+          resultImage: `data:image/png;base64,${res.data.imgdata}`,
125
+          isRsoutImage: true,
126
+          isChangeButton:true
127
+        })
128
+      } else {
129
+        Taro.hideLoading()
130
+        if (res.code == 4001) {
131
+          Taro.showModal({
132
+            title: '您的余额不足',
133
+            content: '是否前往获取点券?',
134
+            success: function (res) {
135
+              if (res.confirm) {
136
+                Taro.navigateTo({
137
+                  url: `/moduleA/pages/earnPoints/index`
138
+                })
139
+              } else if (res.cancel) {
140
+                console.log('用户点击取消')
141
+              }
142
+            }
143
+          })
144
+        } else {
145
+          Taro.showToast({ icon: 'none', title: res.msg })
146
+        }
147
+      }
148
+    })
149
+  }
150
+  previewImage () {
151
+    Taro.previewImage({
152
+      current: this.state.isRsoutImage ? this.state.resultImage : this.state.consultImg, // 当前显示图片的http链接  
153
+      urls: [`${this.state.isRsoutImage ? this.state.resultImage : this.state.consultImg}`] // 需要预览的图片http链接列表  
154
+    })
155
+  }
156
+  previewUserImage () {
157
+    Taro.previewImage({
158
+      current: this.state.consultImgOther, // 当前显示图片的http链接  
159
+      urls: [`${this.state.consultImgOther}`] // 需要预览的图片http链接列表  
160
+    })
161
+  }
162
+  changeMass (e) {
163
+    this.setState({
164
+      mass: e
165
+    })
166
+  }
167
+  onTouchStart () {
168
+    this.setState({
169
+      isRsoutImage:false
170
+    })
171
+  }
172
+  onTouchEnd () {
173
+    this.setState({
174
+      isRsoutImage:true
175
+    })
176
+  }
177
+
178
+  render () {
179
+    return (
180
+      <View className='mine'>
181
+        <View className='demo'>
182
+          <Image className='demo-img' mode='aspectFit' onClick={e => (this.previewImage())} src={this.state.isRsoutImage ? this.state.resultImage : this.state.consultImg}></Image>
183
+          <View className='update' onClick={e => (this.upLode('demol'))}>
184
+            <Image className='updata-img' src='http://video-img.fyshark.com/1680849432427%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87.png'></Image>
185
+            <View className='updata-title'>上传模板图</View>
186
+          </View>
187
+          {
188
+            this.state.isChangeButton &&
189
+            <View className='changeImg'
190
+              onTouchStart={e => (this.onTouchStart())}
191
+              onTouchEnd={e => (this.onTouchEnd())}>
192
+              <Image className='change-img' src='http://video-img.fyshark.com/1680851265492%E5%88%87%E6%8D%A2%20(1).png'></Image>
193
+            </View>
194
+          }
195
+        </View>
196
+        <View className='demo'>
197
+          <Image className='demo-img' mode='aspectFit' onClick={e => (this.previewUserImage())} src={this.state.consultImgOther}></Image>
198
+          <View className='update' onClick={e => (this.upLode('user'))}>
199
+            <Image className='updata-img' src='http://video-img.fyshark.com/1680849432427%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87.png'></Image>
200
+            <View className='updata-title'>上传人脸图</View>
201
+          </View>
202
+        </View>
203
+        <View className='tips'>
204
+          <View>注意:</View>
205
+          <View>1、图片生成成功后会保存在自己到作品,可前往作品下载。</View>
206
+          <View>2、人脸图尽量不要有遮挡物,比如眼镜、手部遮挡等。</View>
207
+        </View>
208
+        <View className='generate-pictures' onClick={e => (this.generatePictures(e))} >
209
+          生成图片(消耗{4}点券)
210
+        </View>
211
+      </View>
212
+    )
213
+  }
214
+}

+ 97 - 0
src/moduleB/pages/faceChanging/index.less

@@ -0,0 +1,97 @@
1
+.mine {
2
+  padding: 48px 32px 100px 32px;
3
+  min-height: 100vh;
4
+  background-color: #041129;
5
+
6
+  .demo {
7
+    position: relative;
8
+    margin-bottom: 40px;
9
+    width: 100%;
10
+    border-radius: 30px;
11
+    border: 2px dashed #FFFFFF;
12
+
13
+    .demo-img {
14
+      border-top-left-radius: 30px;
15
+      border-top-right-radius: 30px;
16
+      width: 100%;
17
+      background-color: #4a4a4c;
18
+      min-height: 500px;
19
+    }
20
+
21
+    .update {
22
+      padding: 20px 0;
23
+      display: flex;
24
+      justify-content: center;
25
+      align-items: center;
26
+      color: #FFFFFF;
27
+      font-size: 28px;
28
+
29
+      .updata-img {
30
+        width: 36px;
31
+        height: 36px;
32
+        margin-right: 10px;
33
+      }
34
+    }
35
+
36
+    .changeImg {
37
+      position: absolute;
38
+      top: 20px;
39
+      right: 20px;
40
+      width: 50px;
41
+      height: 50px;
42
+
43
+      .change-img {
44
+        width: 100%;
45
+        height: 100%;
46
+      }
47
+    }
48
+
49
+    .add-content {
50
+      position: absolute;
51
+      left: 50%;
52
+      top: 50%;
53
+      transform: translate(-50%, -50%);
54
+      // display: flex;
55
+      // justify-content: center;
56
+
57
+      .add-img {
58
+        position: relative;
59
+        left: 50%;
60
+        transform: translateX(-50%);
61
+        width: 80px;
62
+        height: 80px;
63
+      }
64
+
65
+      .add-tips {
66
+        margin-top: 12px;
67
+        font-family: PingFangSC-Regular;
68
+        font-size: 28px;
69
+        color: #FFFFFF;
70
+        text-align: center;
71
+      }
72
+    }
73
+  }
74
+  .tips{
75
+    font-family: PingFangSC-Regular;
76
+    line-height: 44px;
77
+    font-size: 24px;
78
+    color: #FFFFFF;
79
+  }
80
+
81
+  .generate-pictures {
82
+    width: 382px;
83
+    height: 96px;
84
+    border-radius: 96px;
85
+    line-height: 96px;
86
+    text-align: center;
87
+    position: fixed;
88
+    bottom: 40px;
89
+    left: 50%;
90
+    z-index: 100;
91
+    transform: translateX(-50%);
92
+    background-image: linear-gradient(-49deg, #5D81FF 0%, #0F84EC 100%);
93
+    font-family: PingFangSC-Regular;
94
+    font-size: 28px;
95
+    color: #FFFFFF;
96
+  }
97
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '我的喜欢',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 173 - 0
src/moduleB/pages/like/index.jsx

@@ -0,0 +1,173 @@
1
+import { Component } from 'react'
2
+import { View, Swiper, SwiperItem, Image, Textarea, Canvas, Button } from '@tarojs/components'
3
+import Taro, { getCurrentInstance, CanvasContext } from '@tarojs/taro'
4
+import tool from '../../../common/tool'
5
+import * as api from '../../../service/index'
6
+import './index.less'
7
+
8
+export default class Task extends Component {
9
+  state = {
10
+    userInfo: {},
11
+    type: 0,
12
+    cardinalInfos: [],//基数
13
+    evenInfos: [],//偶数
14
+    total: 0,
15
+    page: 1,
16
+    page_size: 20,
17
+    selection: false,
18
+    cardinalSelectedNum: 0,
19
+
20
+  }
21
+
22
+  componentDidShow () {
23
+    this.getInit(1)
24
+  }
25
+  getInit () {
26
+    this.setState({
27
+      cardinalInfos: [],//基数
28
+      evenInfos: [],//偶数
29
+      total: 0,
30
+      page: 1,
31
+      page_size: 20,
32
+      selection: false,
33
+      cardinalSelectedNum: 0,
34
+      evenSelectedNum: 0,
35
+    })
36
+    this.getMyDraw(1)
37
+  }
38
+  getMyDraw (page) {
39
+    Taro.showLoading({
40
+      title: '加载中',
41
+    })
42
+    let params = {
43
+      page: page,
44
+      page_size: this.state.page_size,
45
+    }
46
+   let getInit = api.getLikeList(params)
47
+    getInit.then(res => {
48
+      if (res.code == 200) {
49
+        Taro.hideLoading()
50
+        res.data.infos.forEach((item, index) => {
51
+          item['select'] = false
52
+        })
53
+        let infos = res.data.infos
54
+        let _evenInfos = res.data.infos.filter((item, index) => {
55
+          return index % 2 == 1
56
+        })
57
+        let _cardinalInfos = res.data.infos.filter((item, index) => {
58
+          return index % 2 == 0
59
+        })
60
+        console.log(_cardinalInfos, '_cardinalInfos');
61
+        let cardinalInfos = this.state.cardinalInfos.concat(_cardinalInfos)
62
+        let evenInfos = this.state.evenInfos.concat(_evenInfos)
63
+        this.setState({
64
+          cardinalInfos: cardinalInfos,//基数
65
+          evenInfos: evenInfos,//偶数
66
+          total: res.data.total
67
+        })
68
+      }
69
+    })
70
+  }
71
+  onReachBottom () {
72
+    if ((this.state.cardinalInfos.length + this.state.evenInfos.length) < this.state.total) {
73
+      this.setState({
74
+        page: this.state.page + 1
75
+      })
76
+      this.getMyDraw(this.state.page + 1)
77
+    }
78
+    console.log('onReachBottom()');
79
+  }
80
+  //选中||详情页
81
+  toDetail (item, index, type) {
82
+    Taro.navigateTo({
83
+      url: `/moduleA/pages/communityDetail/index?task_id=${item.id}`
84
+    })
85
+  }
86
+  delectiImg () {
87
+    let that = this
88
+    Taro.showModal({
89
+      title: '提示',
90
+      content: `确定删除这${this.state.cardinalSelectedNum + this.state.evenSelectedNum}张图片吗`,
91
+      success: function (res) {
92
+        if (res.confirm) {
93
+          that.deleteImg()
94
+        } else if (res.cancel) {
95
+          console.log('用户点击取消')
96
+        }
97
+      }
98
+    })
99
+  }
100
+  deleteImg () {
101
+    let deleteObj = []
102
+    this.state.cardinalInfos.forEach(res => {
103
+      if (res.select) {
104
+        console.log(res.id, 'res.id', res.select);
105
+        deleteObj.push(res.id)
106
+      }
107
+    })
108
+    this.state.evenInfos.forEach(res => {
109
+      if (res.select) {
110
+        console.log(res.id, 'res.id', res.select);
111
+        deleteObj.push(res.id)
112
+      }
113
+    })
114
+    console.log(deleteObj.join(','), 'deleteObj');
115
+    api.userDelImg({ img_ids: deleteObj.join(',') }).then(res => {
116
+      if (res.code == 200) {
117
+        Taro.showToast({
118
+          title: `删除成功`,
119
+          icon: 'none',
120
+        });
121
+        this.getInit(1)
122
+        this.getUserInfo()
123
+      }
124
+    })
125
+  }
126
+  onShareAppMessage = (res) => {
127
+    let shareData = {
128
+      title: tool.shareTitle,
129
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
130
+      imageUrl: tool.shareImg
131
+    }
132
+    return shareData;
133
+  }
134
+
135
+  render () {
136
+    return (
137
+      <View className='mine'>
138
+        <View className='work-list'>
139
+          <View className='work-list-info' >
140
+            <View className='selection-left'>
141
+              {
142
+                this.state.cardinalInfos.map((item, index) => (
143
+                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'cardinal'))}>
144
+                    {
145
+                      this.state.selection &&
146
+                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
147
+                    }
148
+                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img ? item.img : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679305142417.png'}></Image>
149
+                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
150
+                  </View>
151
+                ))
152
+              }
153
+            </View>
154
+            <View className='selection-right'>
155
+              {
156
+                this.state.evenInfos.map((item, index) => (
157
+                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'even'))}>
158
+                    {
159
+                      this.state.selection &&
160
+                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
161
+                    }
162
+                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img}></Image>
163
+                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
164
+                  </View>
165
+                ))
166
+              }
167
+            </View>
168
+          </View>
169
+        </View>
170
+      </View>
171
+    )
172
+  }
173
+}

+ 132 - 0
src/moduleB/pages/like/index.less

@@ -0,0 +1,132 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #000000;
4
+
5
+  .work-list {
6
+    min-height: 100vh;
7
+    background: #0F1A2F;
8
+    box-shadow: 12px 0 30px 0 #1E376D;
9
+    padding: 28px 30px;
10
+
11
+    .work-num {
12
+      margin-top: 48px;
13
+      font-family: PingFangSC-Regular;
14
+      font-size: 32px;
15
+      color: #FFFFFF;
16
+    }
17
+
18
+    .work-list-info {
19
+      width: 100%;
20
+      position: relative;
21
+      margin-top: 40px;
22
+      column-gap: 5rpx;
23
+      column-count: 2;
24
+      /*每一格的高度*/
25
+
26
+      display: flex;
27
+      justify-content: space-between;
28
+
29
+      .selection {
30
+        position: absolute;
31
+        right: 0;
32
+        top: -94px;
33
+        width: 178px;
34
+        height: 64px;
35
+        line-height: 64px;
36
+        border-radius: 40px;
37
+        border: 2px solid #1489ED;
38
+        color: #1489ED;
39
+        font-family: PingFangSC-Regular;
40
+        font-size: 32px;
41
+        text-align: center;
42
+
43
+      }
44
+
45
+      .selection-left {
46
+        width: 330px;
47
+      }
48
+
49
+      .selection-right {
50
+        width: 330px;
51
+      }
52
+
53
+      .work-info {
54
+        position: relative;
55
+        margin-top: 10px;
56
+
57
+        // width: 45%;
58
+
59
+        .select {
60
+          position: absolute;
61
+          background-color: white;
62
+          border-radius: 8px;
63
+          left: 20px;
64
+          top: 20px;
65
+          width: 40px;
66
+          height: 40px;
67
+        }
68
+
69
+        .work-img {
70
+          width: 100%;
71
+          min-height: 180px;
72
+          display: block;
73
+          // height: 100%;
74
+        }
75
+
76
+        .work-name {
77
+          position: absolute;
78
+          bottom: 0;
79
+          left: 0;
80
+          width: 100%;
81
+          font-size: 32rpx;
82
+          background-color: rgba(0, 0, 0, 0.4);
83
+          color: #FFFFFF;
84
+          text-align: center;
85
+
86
+        }
87
+      }
88
+    }
89
+  }
90
+
91
+  @media only screen and (max-width: 768px) {
92
+    .work-info {
93
+      width: calc(50% - 10px);
94
+    }
95
+  }
96
+
97
+  @media only screen and (max-width: 480px) {
98
+    .work-info {
99
+      width: 100%;
100
+    }
101
+  }
102
+
103
+  .select-content {
104
+    width: 100%;
105
+    padding: 20px 0;
106
+    background: rgba(11, 19, 37, .8);
107
+    position: fixed;
108
+    bottom: 0;
109
+    left: 0;
110
+    display: flex;
111
+    justify-content: space-between;
112
+    font-family: PingFangSC-Regular;
113
+    font-size: 32px;
114
+    color: #FFFFFF;
115
+
116
+    .cancel {
117
+      margin-left: 40px;
118
+    }
119
+
120
+    .delect {
121
+      margin-right: 40px;
122
+      display: flex;
123
+      align-items: center;
124
+
125
+      .delect-icon {
126
+        margin-right: 10px;
127
+        width: 40px;
128
+        height: 40px;
129
+      }
130
+    }
131
+  }
132
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '新手指引',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 32 - 0
src/moduleB/pages/point/index.jsx

@@ -0,0 +1,32 @@
1
+import { Component } from 'react'
2
+import { View, Swiper, SwiperItem, Image, Textarea, Canvas, Button } from '@tarojs/components'
3
+import Taro, { getCurrentInstance, CanvasContext } from '@tarojs/taro'
4
+import tool from '../../../common/tool'
5
+import * as api from '../../../service/index'
6
+import './index.less'
7
+
8
+export default class Task extends Component {
9
+  state = {
10
+
11
+  }
12
+
13
+  componentDidShow () {
14
+  }
15
+ 
16
+  onShareAppMessage = (res) => {
17
+    let shareData = {
18
+      title: tool.shareTitle,
19
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
20
+      imageUrl: tool.shareImg
21
+    }
22
+    return shareData;
23
+  }
24
+
25
+  render () {
26
+    return (
27
+      <View className='mine'>
28
+      
29
+      </View>
30
+    )
31
+  }
32
+}

+ 132 - 0
src/moduleB/pages/point/index.less

@@ -0,0 +1,132 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #000000;
4
+
5
+  .work-list {
6
+    min-height: 100vh;
7
+    background: #0F1A2F;
8
+    box-shadow: 12px 0 30px 0 #1E376D;
9
+    padding: 28px 30px;
10
+
11
+    .work-num {
12
+      margin-top: 48px;
13
+      font-family: PingFangSC-Regular;
14
+      font-size: 32px;
15
+      color: #FFFFFF;
16
+    }
17
+
18
+    .work-list-info {
19
+      width: 100%;
20
+      position: relative;
21
+      margin-top: 40px;
22
+      column-gap: 5rpx;
23
+      column-count: 2;
24
+      /*每一格的高度*/
25
+
26
+      display: flex;
27
+      justify-content: space-between;
28
+
29
+      .selection {
30
+        position: absolute;
31
+        right: 0;
32
+        top: -94px;
33
+        width: 178px;
34
+        height: 64px;
35
+        line-height: 64px;
36
+        border-radius: 40px;
37
+        border: 2px solid #1489ED;
38
+        color: #1489ED;
39
+        font-family: PingFangSC-Regular;
40
+        font-size: 32px;
41
+        text-align: center;
42
+
43
+      }
44
+
45
+      .selection-left {
46
+        width: 330px;
47
+      }
48
+
49
+      .selection-right {
50
+        width: 330px;
51
+      }
52
+
53
+      .work-info {
54
+        position: relative;
55
+        margin-top: 10px;
56
+
57
+        // width: 45%;
58
+
59
+        .select {
60
+          position: absolute;
61
+          background-color: white;
62
+          border-radius: 8px;
63
+          left: 20px;
64
+          top: 20px;
65
+          width: 40px;
66
+          height: 40px;
67
+        }
68
+
69
+        .work-img {
70
+          width: 100%;
71
+          min-height: 180px;
72
+          display: block;
73
+          // height: 100%;
74
+        }
75
+
76
+        .work-name {
77
+          position: absolute;
78
+          bottom: 0;
79
+          left: 0;
80
+          width: 100%;
81
+          font-size: 32rpx;
82
+          background-color: rgba(0, 0, 0, 0.4);
83
+          color: #FFFFFF;
84
+          text-align: center;
85
+
86
+        }
87
+      }
88
+    }
89
+  }
90
+
91
+  @media only screen and (max-width: 768px) {
92
+    .work-info {
93
+      width: calc(50% - 10px);
94
+    }
95
+  }
96
+
97
+  @media only screen and (max-width: 480px) {
98
+    .work-info {
99
+      width: 100%;
100
+    }
101
+  }
102
+
103
+  .select-content {
104
+    width: 100%;
105
+    padding: 20px 0;
106
+    background: rgba(11, 19, 37, .8);
107
+    position: fixed;
108
+    bottom: 0;
109
+    left: 0;
110
+    display: flex;
111
+    justify-content: space-between;
112
+    font-family: PingFangSC-Regular;
113
+    font-size: 32px;
114
+    color: #FFFFFF;
115
+
116
+    .cancel {
117
+      margin-left: 40px;
118
+    }
119
+
120
+    .delect {
121
+      margin-right: 40px;
122
+      display: flex;
123
+      align-items: center;
124
+
125
+      .delect-icon {
126
+        margin-right: 10px;
127
+        width: 40px;
128
+        height: 40px;
129
+      }
130
+    }
131
+  }
132
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '资讯',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 90 - 0
src/moduleB/pages/real/index.jsx

@@ -0,0 +1,90 @@
1
+import { Component } from 'react'
2
+import { View, Swiper, SwiperItem, Image, Textarea, Canvas, Button } from '@tarojs/components'
3
+import Taro, { getCurrentInstance, CanvasContext } from '@tarojs/taro'
4
+import tool from '../../../common/tool'
5
+import * as api from '../../../service/index'
6
+import './index.less'
7
+
8
+export default class Task extends Component {
9
+  state = {
10
+    list: [
11
+    ],
12
+    total: false,
13
+    page: 1,
14
+    page_size: 20,
15
+  }
16
+
17
+  componentDidMount () {
18
+    this.init()
19
+  }
20
+  init () {
21
+    this.setState({
22
+      list: [],
23
+      total: false,
24
+      page: 1,
25
+      page_size: 20,
26
+    }, () => {
27
+      this.getInformationList()
28
+    })
29
+  }
30
+  getInformationList () {
31
+    let params = {
32
+      page: this.state.page,
33
+      page_size: this.state.page_size,
34
+    }
35
+    api.getInformationList(params).then(res => {
36
+      if (res.code == 200) {
37
+        let total = true
38
+        if (res.data.length < this.state.page_size) {
39
+          total = false
40
+        }
41
+        let walletList = this.state.list.concat(res.data)
42
+        this.setState({
43
+          list: walletList,
44
+          total: total,
45
+          share: res.data.share
46
+        })
47
+      }
48
+    })
49
+  }
50
+  toRealDetail (item) {
51
+    Taro.navigateTo({
52
+      url: `/moduleB/pages/realDetail/index?task_id=${item.id}`
53
+    })
54
+  }
55
+  onReachBottom () {
56
+    if (!this.state.total) return
57
+    this.setState({
58
+      page: this.state.page + 1
59
+    }, () => {
60
+      this.getUserShareCnt()
61
+    })
62
+  }
63
+  onShareAppMessage = (res) => {
64
+    let shareData = {
65
+      title: tool.shareTitle,
66
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
67
+      imageUrl: tool.shareImg
68
+    }
69
+    return shareData;
70
+  }
71
+
72
+  render () {
73
+    return (
74
+      <View className='mine'>
75
+        {
76
+          this.state.list.map((item, index) => (
77
+            <View className='real-info' key={index} onClick={e => (this.toRealDetail(item))}>
78
+              <Image className='real-img' src={item.img}></Image>
79
+              <View className='real-content'>
80
+                <View className='real-title'>{item.title}</View>
81
+                <View className='real-text'>{tool.ellipsis(item.sub_title, 27)}</View>
82
+                <View className='real-date'>{item.time}</View>
83
+              </View>
84
+            </View>
85
+          ))
86
+        }
87
+      </View>
88
+    )
89
+  }
90
+}

+ 40 - 0
src/moduleB/pages/real/index.less

@@ -0,0 +1,40 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #041129;
4
+  padding: 0 30px;
5
+
6
+  .real-info {
7
+    padding: 30px 0;
8
+    display: flex;
9
+    align-items: center;
10
+    border-bottom: 2px solid #0F1A2F;
11
+
12
+    .real-img {
13
+      width: 200px;
14
+      height: 200px;
15
+    }
16
+
17
+    .real-content {
18
+      margin-left: 30px;
19
+      flex: 1;
20
+      font-family: PingFangSC-Medium;
21
+      font-size: 32px;
22
+      color: #FFFFFF;
23
+      display: flex;
24
+      flex-direction:column;
25
+
26
+      .real-text {
27
+        margin-top: 4px;
28
+        min-height: 80px;
29
+        color: rgba(255, 255, 255, .75);
30
+        font-size: 28px;
31
+      }
32
+
33
+      .real-date {
34
+        margin-top: 18px;
35
+        color: rgba(255, 255, 255, .75);
36
+        font-size: 28px;
37
+      }
38
+    }
39
+  }
40
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '资讯详情',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 47 - 0
src/moduleB/pages/realDetail/index.jsx

@@ -0,0 +1,47 @@
1
+import { Component } from 'react'
2
+import { View, RichText } from '@tarojs/components'
3
+import Taro, { getCurrentInstance, CanvasContext } from '@tarojs/taro'
4
+import tool from '../../../common/tool'
5
+import * as api from '../../../service/index'
6
+import './index.less'
7
+
8
+export default class Task extends Component {
9
+  $instance = getCurrentInstance()
10
+  state = {
11
+    info: {}
12
+  }
13
+
14
+  componentDidShow () {
15
+    this.getInformationDetails()
16
+  }
17
+  getInformationDetails () {
18
+    let routers = this.$instance.router.params
19
+    let params = {
20
+      detail_id: routers.task_id
21
+    }
22
+    api.getInformationDetails(params).then(res => {
23
+      if (res.code == 200) {
24
+        this.setState({
25
+          info: res.data
26
+        })
27
+      }
28
+    })
29
+  }
30
+
31
+  onShareAppMessage = (res) => {
32
+    let shareData = {
33
+      title: tool.shareTitle,
34
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
35
+      imageUrl: tool.shareImg
36
+    }
37
+    return shareData;
38
+  }
39
+
40
+  render () {
41
+    return (
42
+      <View className='mine'>
43
+        <RichText className='member-title' nodes={this.state.info.content}></RichText>
44
+      </View>
45
+    )
46
+  }
47
+}

+ 13 - 0
src/moduleB/pages/realDetail/index.less

@@ -0,0 +1,13 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #041129;
4
+  padding: 0 30px;
5
+  .member-title{
6
+    color: rgba(255,255,255,.75);
7
+  }
8
+  h1,h2,h3,h4,h5,h6{
9
+    color: #FFFFFF;
10
+  }
11
+ 
12
+ 
13
+}

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

@@ -0,0 +1,5 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '我的作品',
3
+  enableShareAppMessage: true,
4
+  enableShareTimeline: true ,
5
+})

+ 272 - 0
src/moduleB/pages/works/index.jsx

@@ -0,0 +1,272 @@
1
+import { Component } from 'react'
2
+import { View, Swiper, SwiperItem, Image, Textarea, Canvas, Button } from '@tarojs/components'
3
+import Taro, { getCurrentInstance, CanvasContext } from '@tarojs/taro'
4
+import tool from '../../../common/tool'
5
+import * as api from '../../../service/index'
6
+import './index.less'
7
+
8
+export default class Task extends Component {
9
+  $instance = getCurrentInstance()
10
+  state = {
11
+    userInfo: {},
12
+    cardinalInfos: [],//基数
13
+    evenInfos: [],//偶数
14
+    total: 0,
15
+    page: 1,
16
+    page_size: 20,
17
+    selection: false,
18
+    cardinalSelectedNum: 0,
19
+
20
+  }
21
+
22
+  componentDidShow () {
23
+    this.getInit(1)
24
+    this.getUserInfo()
25
+  }
26
+  getInit () {
27
+    this.setState({
28
+      cardinalInfos: [],//基数
29
+      evenInfos: [],//偶数
30
+      total: 0,
31
+      page: 1,
32
+      page_size: 20,
33
+      selection: false,
34
+      cardinalSelectedNum: 0,
35
+      evenSelectedNum: 0,
36
+    })
37
+    this.getMyDraw(1)
38
+  }
39
+  getUserInfo () {
40
+    api.getUserInfo().then(res => {
41
+      if (res.code == 200) {
42
+        this.setState({
43
+          userInfo: res.data
44
+        })
45
+      }
46
+    })
47
+  }
48
+  getMyDraw (page) {
49
+    Taro.showLoading({
50
+      title: '加载中',
51
+    })
52
+    let params = {
53
+      page: page,
54
+      page_size: this.state.page_size,
55
+    }
56
+    let getInit = api.getMyDraw(params)
57
+    getInit.then(res => {
58
+      if (res.code == 200) {
59
+        Taro.hideLoading()
60
+        res.data.infos.forEach((item, index) => {
61
+          item['select'] = false
62
+        })
63
+        let infos = res.data.infos
64
+        let _evenInfos = res.data.infos.filter((item, index) => {
65
+          return index % 2 == 1
66
+        })
67
+        let _cardinalInfos = res.data.infos.filter((item, index) => {
68
+          return index % 2 == 0
69
+        })
70
+        console.log(_cardinalInfos, '_cardinalInfos');
71
+        let cardinalInfos = this.state.cardinalInfos.concat(_cardinalInfos)
72
+        let evenInfos = this.state.evenInfos.concat(_evenInfos)
73
+        this.setState({
74
+          cardinalInfos: cardinalInfos,//基数
75
+          evenInfos: evenInfos,//偶数
76
+          total: res.data.total
77
+        })
78
+      }
79
+    })
80
+  }
81
+  onReachBottom () {
82
+    if ((this.state.cardinalInfos.length + this.state.evenInfos.length) < this.state.total) {
83
+      this.setState({
84
+        page: this.state.page + 1
85
+      })
86
+      this.getMyDraw(this.state.page + 1)
87
+    }
88
+    console.log('onReachBottom()');
89
+  }
90
+   //选中||详情页
91
+   toDetail (item, index, type) {
92
+    if (this.state.selection) {
93
+      if (type == 'cardinal') {
94
+        let _infos = this.state.cardinalInfos
95
+        _infos[index].select = !this.state.cardinalInfos[index].select
96
+        let infosSelect = _infos.filter(res => {
97
+          return res.select == true
98
+        })
99
+        console.log(infosSelect.length, 'infosSelect');
100
+        this.setState({
101
+          cardinalInfos: _infos,
102
+          cardinalSelectedNum: infosSelect.length
103
+        })
104
+      } else {
105
+        let _infos = this.state.evenInfos
106
+        _infos[index].select = !this.state.evenInfos[index].select
107
+        let infosSelect = _infos.filter(res => {
108
+          return res.select == true
109
+        })
110
+        console.log(infosSelect.length, 'infosSelect');
111
+        this.setState({
112
+          evenInfos: _infos,
113
+          evenSelectedNum: infosSelect.length
114
+        })
115
+      }
116
+
117
+    } else {
118
+        Taro.navigateTo({
119
+          url: `/moduleA/pages/darwDetail/index?task_id=${item.task_id}&img_id=${item.id}`
120
+        })
121
+      
122
+    }
123
+  }
124
+  cancelDelect () {
125
+    let _evenInfos = this.state.evenInfos
126
+    _evenInfos.forEach((item, index) => {
127
+      item.select = false
128
+    })
129
+    let _cardinalInfos = this.state.cardinalInfos
130
+    _cardinalInfos.forEach((item, index) => {
131
+      item.select = false
132
+    })
133
+    this.setState({
134
+      cardinalInfos: _cardinalInfos,
135
+      evenInfos: _evenInfos,
136
+      cardinalSelectedNum: 0,
137
+      evenSelectedNum: 0,
138
+      selection: !this.state.selection
139
+    })
140
+  }
141
+  delectiImg () {
142
+    let that = this
143
+    Taro.showModal({
144
+      title: '提示',
145
+      content: `确定删除这${this.state.cardinalSelectedNum + this.state.evenSelectedNum}张图片吗`,
146
+      success: function (res) {
147
+        if (res.confirm) {
148
+          that.deleteImg()
149
+        } else if (res.cancel) {
150
+          console.log('用户点击取消')
151
+        }
152
+      }
153
+    })
154
+  }
155
+  deleteImg () {
156
+    let deleteObj = []
157
+    this.state.cardinalInfos.forEach(res => {
158
+      if (res.select) {
159
+        console.log(res.id, 'res.id', res.select);
160
+        deleteObj.push(res.id)
161
+      }
162
+    })
163
+    this.state.evenInfos.forEach(res => {
164
+      if (res.select) {
165
+        console.log(res.id, 'res.id', res.select);
166
+        deleteObj.push(res.id)
167
+      }
168
+    })
169
+    console.log(deleteObj.join(','), 'deleteObj');
170
+    api.userDelImg({ img_ids: deleteObj.join(',') }).then(res => {
171
+      if (res.code == 200) {
172
+        Taro.showToast({
173
+          title: `删除成功`,
174
+          icon: 'none',
175
+        });
176
+        this.getInit(1)
177
+        this.getUserInfo()
178
+      }
179
+    })
180
+  }
181
+  //批量选择
182
+  changeSelection () {
183
+    if (this.state.selection) {
184
+      let _evenInfos = this.state.evenInfos
185
+      _evenInfos.forEach((item, index) => {
186
+        item.select = false
187
+      })
188
+      let _cardinalInfos = this.state.cardinalInfos
189
+      _cardinalInfos.forEach((item, index) => {
190
+        item.select = false
191
+      })
192
+      this.setState({
193
+        cardinalInfos: _cardinalInfos,
194
+        evenInfos: _evenInfos,
195
+        cardinalSelectedNum: 0,
196
+        evenSelectedNum: 0,
197
+        selection: !this.state.selection
198
+      })
199
+    } else {
200
+      this.setState({
201
+        selection: !this.state.selection
202
+      })
203
+    }
204
+  }
205
+
206
+  getEarnPoints () {
207
+    Taro.navigateTo({
208
+      url: `/moduleA/pages/earnPoints/index`
209
+    })
210
+  }
211
+  onShareAppMessage = (res) => {
212
+    let shareData = {
213
+      title: tool.shareTitle,
214
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
215
+      imageUrl: tool.shareImg
216
+    }
217
+    return shareData;
218
+  }
219
+
220
+  render () {
221
+    return (
222
+      <View className='mine'>
223
+        <View className='work-list'>
224
+          <View className='work-num'>作品数量:{this.state.total}/{this.state.userInfo.stock_cnt}</View>
225
+          <View className='work-list-info' >
226
+              <View className='selection' onClick={e => (this.changeSelection())}>{!this.state.selection ? '批量选择' : '取消'}</View>
227
+            
228
+            <View className='selection-left'>
229
+              {
230
+                this.state.cardinalInfos.map((item, index) => (
231
+                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'cardinal'))}>
232
+                    {
233
+                      this.state.selection &&
234
+                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
235
+                    }
236
+                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img ? item.img : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679305142417.png'}></Image>
237
+                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
238
+                  </View>
239
+                ))
240
+              }
241
+            </View>
242
+            <View className='selection-right'>
243
+              {
244
+                this.state.evenInfos.map((item, index) => (
245
+                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'even'))}>
246
+                    {
247
+                      this.state.selection &&
248
+                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
249
+                    }
250
+                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img}></Image>
251
+                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
252
+                  </View>
253
+                ))
254
+              }
255
+            </View>
256
+          </View>
257
+        </View>
258
+        {
259
+          this.state.selection &&
260
+          <View className='select-content'>
261
+            <View className='cancel' onClick={e => (this.cancelDelect())}>取消</View>
262
+            <View >当前已选中{this.state.cardinalSelectedNum + this.state.evenSelectedNum}张</View>
263
+            <View className='delect' onClick={e => (this.delectiImg())}>
264
+              <Image className='delect-icon' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679037709270.png'></Image>
265
+              <View className='delect-text'>删除</View>
266
+            </View>
267
+          </View>
268
+        }
269
+      </View>
270
+    )
271
+  }
272
+}

+ 132 - 0
src/moduleB/pages/works/index.less

@@ -0,0 +1,132 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #000000;
4
+
5
+  .work-list {
6
+    min-height: 100vh;
7
+    background: #0F1A2F;
8
+    box-shadow: 12px 0 30px 0 #1E376D;
9
+    padding: 28px 30px;
10
+
11
+    .work-num {
12
+      margin-top: 48px;
13
+      font-family: PingFangSC-Regular;
14
+      font-size: 32px;
15
+      color: #FFFFFF;
16
+    }
17
+
18
+    .work-list-info {
19
+      width: 100%;
20
+      position: relative;
21
+      margin-top: 40px;
22
+      column-gap: 5rpx;
23
+      column-count: 2;
24
+      /*每一格的高度*/
25
+
26
+      display: flex;
27
+      justify-content: space-between;
28
+
29
+      .selection {
30
+        position: absolute;
31
+        right: 0;
32
+        top: -94px;
33
+        width: 178px;
34
+        height: 64px;
35
+        line-height: 64px;
36
+        border-radius: 40px;
37
+        border: 2px solid #1489ED;
38
+        color: #1489ED;
39
+        font-family: PingFangSC-Regular;
40
+        font-size: 32px;
41
+        text-align: center;
42
+
43
+      }
44
+
45
+      .selection-left {
46
+        width: 330px;
47
+      }
48
+
49
+      .selection-right {
50
+        width: 330px;
51
+      }
52
+
53
+      .work-info {
54
+        position: relative;
55
+        margin-top: 10px;
56
+
57
+        // width: 45%;
58
+
59
+        .select {
60
+          position: absolute;
61
+          background-color: white;
62
+          border-radius: 8px;
63
+          left: 20px;
64
+          top: 20px;
65
+          width: 40px;
66
+          height: 40px;
67
+        }
68
+
69
+        .work-img {
70
+          width: 100%;
71
+          min-height: 180px;
72
+          display: block;
73
+          // height: 100%;
74
+        }
75
+
76
+        .work-name {
77
+          position: absolute;
78
+          bottom: 0;
79
+          left: 0;
80
+          width: 100%;
81
+          font-size: 32rpx;
82
+          background-color: rgba(0, 0, 0, 0.4);
83
+          color: #FFFFFF;
84
+          text-align: center;
85
+
86
+        }
87
+      }
88
+    }
89
+  }
90
+
91
+  @media only screen and (max-width: 768px) {
92
+    .work-info {
93
+      width: calc(50% - 10px);
94
+    }
95
+  }
96
+
97
+  @media only screen and (max-width: 480px) {
98
+    .work-info {
99
+      width: 100%;
100
+    }
101
+  }
102
+
103
+  .select-content {
104
+    width: 100%;
105
+    padding: 20px 0;
106
+    background: rgba(11, 19, 37, .8);
107
+    position: fixed;
108
+    bottom: 0;
109
+    left: 0;
110
+    display: flex;
111
+    justify-content: space-between;
112
+    font-family: PingFangSC-Regular;
113
+    font-size: 32px;
114
+    color: #FFFFFF;
115
+
116
+    .cancel {
117
+      margin-left: 40px;
118
+    }
119
+
120
+    .delect {
121
+      margin-right: 40px;
122
+      display: flex;
123
+      align-items: center;
124
+
125
+      .delect-icon {
126
+        margin-right: 10px;
127
+        width: 40px;
128
+        height: 40px;
129
+      }
130
+    }
131
+  }
132
+}

+ 68 - 82
src/pages/activity/index.jsx

@@ -7,110 +7,96 @@ import './index.less'
7 7
 
8 8
 export default class collection extends Component {
9 9
   state = {
10
-    consultImg: 'http://video-img.fyshark.com/1680144082044%E7%BC%96%E7%BB%84.png',
11
-    sizeIndex: 0,
12
-    mass:0,
13
-    isImage: false
10
+    list: [],
11
+    page: 1,
12
+    page_size: 20,
13
+    total: false
14 14
   }
15 15
 
16 16
   componentWillMount () {
17 17
   }
18 18
   componentDidShow () {
19
-    //接收裁剪图片
20
-    let pages = Taro.getCurrentPages();
21
-    let currentPage = pages[pages.length - 1]; // 获取当前页面
22
-    if (currentPage.__data__.consultImg) { // 获取值
23
-      this.setState({
24
-        consultImg: currentPage.__data__.consultImg,
25
-        sizeIndex: currentPage.__data__.sizeIndex,
26
-        isImage: true
27
-      })
28
-    }
19
+    this.init()
29 20
   }
30
-  upLode () {
31
-    let that = this
32
-    Taro.chooseMedia({
33
-      count: 1, // 默认
34
-      sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
35
-      sourceType: ['album', 'camera'],
36
-      success: function (res) {
37
-        console.log(res, 'res');
38
-        const file = res.tempFiles[0].tempFilePath
39
-        if (res.tempFiles[0].size > 2000000) {
40
-          Taro.showToast({ title: '图片大小不能超过2M', icon: 'none' })
41
-          return
42
-        }
43
-        Taro.showLoading({
44
-          title: '图片上传中',
45
-        })
46
-        Taro.hideLoading()
47
-        Taro.navigateTo({
48
-          url: `/moduleA/pages/upload/index?image=${file}`
49
-        })
50
-      }
21
+  init () {
22
+    this.setState({
23
+      list: [],
24
+      page: 1,
25
+      page_size: 20,
26
+      total: false
27
+    }, () => {
28
+
29
+      this.aiInformationIndex()
51 30
     })
52 31
   }
53
-  generatePictures () {
54
-    if (!this.state.isImage) {
55
-      Taro.showToast({ title: '请先上传图片', icon: 'none' })
56
-      return
32
+  aiInformationIndex () {
33
+    Taro.showLoading({
34
+      title: '加载中...'
35
+    })
36
+    let params = {
37
+      page: this.state.page,
38
+      page_size: this.state.page_size
57 39
     }
58
-    api.drawGcImg({ img_url: this.state.consultImg,img_type:this.state.mass }).then(res => {
40
+    api.aiInformationIndex(params).then(res => {
41
+      Taro.hideLoading();
59 42
       if (res.code == 200) {
60
-        Taro.navigateTo({
61
-          url: `/moduleA/pages/darwDetail/index?task_id=${res.data.task_id}`
62
-        })
63
-      }else {
64
-        Taro.hideLoading()
65
-        Taro.showModal({
66
-          title: '您的余额不足',
67
-          content: '是否前往获取点券?',
68
-          success: function (res) {
69
-            if (res.confirm) {
70
-              Taro.navigateTo({
71
-                url: `/moduleA/pages/earnPoints/index`
72
-              })
73
-            } else if (res.cancel) {
74
-              console.log('用户点击取消')
75
-            }
76
-          }
43
+        let total = true
44
+        if (res.data.length < this.state.page_size) {
45
+          total = false
46
+        }
47
+        let walletList = this.state.list.concat(res.data)
48
+        this.setState({
49
+          list: walletList,
50
+          total: total,
77 51
         })
78 52
       }
79 53
     })
80 54
   }
81
-  changeMass (e) {
55
+  onShareAppMessage = (res) => {
56
+    let shareData = {
57
+      title: tool.shareTitle,
58
+      path: `/pages/index/index?c=${Taro.getStorageSync('user_id')}&s=rightTap`,
59
+      imageUrl: tool.shareImg
60
+    }
61
+    return shareData;
62
+  }
63
+  onReachBottom () {
64
+    if (!this.state.total) return
82 65
     this.setState({
83
-      mass: e
66
+      page: this.state.page + 1
67
+    }, () => {
68
+      this.getUserShareCnt()
69
+    })
70
+  }
71
+  toActInfo (item) {
72
+    let url = `${item.jump_url}`
73
+    Taro.navigateTo({
74
+      url: url
84 75
     })
85 76
   }
86 77
 
87 78
   render () {
88 79
     return (
89 80
       <View className='mine'>
90
-        <View className='title'>人物动漫化</View>
91
-        <View className='content' onClick={e => (this.upLode())}>
92
-          <Image className='content-img'
93
-            mode='aspectFit'
94
-            src={this.state.consultImg}
95
-          ></Image>
96
-          {
97
-            !this.state.isImage &&
98
-            <View className='add-content'>
99
-              <Image className='add-img' src='http://video-img.fyshark.com/1680144257329%2B.png'></Image>
100
-              <View className='add-tips'>上传图片</View>
81
+        {
82
+          this.state.list.map((item, index) => (
83
+            <View className='act-info' key={index} onClick={e => (this.toActInfo(item))}>
84
+              <View className='info-content'>
85
+                {
86
+                  item.type == 1 &&
87
+                  <View className='tips' style={`background-color: ${item.label_background};`}>
88
+                    {item.label_text}
89
+                  </View>
90
+                }
91
+                <View className='info-left'>
92
+                  <View className='left-title'>{item.title}</View>
93
+                  <View className='left-content'>{tool.ellipsis(item.sub_title, 35)}</View>
94
+                </View>
95
+                <Image className='info-right' src={item.img}></Image>
96
+              </View>
101 97
             </View>
102
-          }
103
-        </View>
104
-        <View className='img-tips'>绝美的动漫头像,上传图片一件生成</View>
105
-        <View className='draw-title'>图片质量</View>
106
-          <View className='draw-mass'>
107
-            <View className='mass-same' style={this.state.mass == 0 ? 'border: 2px solid #0F84EC;' : ''} onClick={e => (this.changeMass(0))}>普通</View>
108
-            <View className='mass-high' style={this.state.mass == 1 ? 'border: 2px solid #0F84EC;' : ''} onClick={e => (this.changeMass(1))}>高清</View>
109
-          </View>
110
-        
111
-        <View className='generate-pictures' onClick={e => (this.generatePictures(e))} >
112
-          生成图片(消耗{2*(this.state.mass+1)}点券)
113
-        </View>
98
+          ))
99
+        }
114 100
       </View>
115 101
     )
116 102
   }

+ 37 - 91
src/pages/activity/index.less

@@ -1,106 +1,52 @@
1 1
 .mine {
2
-  padding: 48px 32px;
2
+  padding: 0 30px;
3 3
   min-height: 100vh;
4 4
   background-color: #041129;
5 5
 
6
-  .title {
7
-    margin-top: 48px;
8
-    font-family: PingFangSC-Regular;
9
-    font-size: 32px;
10
-    color: #FFFFFF;
11
-  }
12
-
13
-  .content {
14
-    position: relative;
15
-    margin-top: 20px;
16
-
17
-    .add-content {
18
-      position: absolute;
19
-      left: 50%;
20
-      top: 50%;
21
-      transform: translate(-50%,-50%);
22
-      // display: flex;
23
-      // justify-content: center;
24
-
25
-      .add-img {
26
-        position: relative;
27
-        left: 50%;
28
-        transform: translateX(-50%);
29
-        width: 80px;
30
-        height: 80px;
31
-      }
6
+  .act-info {
7
+    padding: 30px 0;
8
+    border-bottom: 2px solid #0F1A2F;
32 9
 
33
-      .add-tips {
34
-        margin-top: 12px;
35
-        font-family: PingFangSC-Regular;
36
-        font-size: 28px;
37
-        color: #FFFFFF;
38
-        text-align: center;
10
+    .info-content {
11
+      position: relative;
12
+      padding: 24px 30px;
13
+      display: flex;
14
+      align-items: center;
15
+      background: #0F1A2F;
16
+      border-radius: 16px;
17
+      font-family: PingFangSC-Medium;
18
+      font-size: 32px;
19
+      color: #FFFFFF;
20
+
21
+      .tips {
22
+        position: absolute;
23
+        top: 0;
24
+        left: 0;
25
+        font-family: PingFangSC-Medium;
26
+        font-size: 20px;
27
+        padding: 6px 16px;
28
+        border-top-left-radius: 22px;
29
+        border-bottom-right-radius: 22px;
39 30
       }
40 31
     }
41 32
 
42
-    .content-img {
43
-      width: 100%;
44
-      max-height: 760px;
45
-    }
46
-  }
47
-
48
-  .generate-pictures {
49
-    width: 382px;
50
-    height: 96px;
51
-    border-radius: 96px;
52
-    line-height: 96px;
53
-    text-align: center;
54
-    position: fixed;
55
-    bottom: 40px;
56
-    left: 50%;
57
-    z-index: 100;
58
-    transform: translateX(-50%);
59
-    background-image: linear-gradient(-49deg, #5D81FF 0%, #0F84EC 100%);
60
-    font-family: PingFangSC-Regular;
61
-    font-size: 28px;
62
-    color: #FFFFFF;
63
-  }
33
+    .info-left {
34
+      flex: 1;
64 35
 
65
-  .img-tips {
66
-    margin-top: 20px;
67
-    font-family: PingFangSC-Regular;
68
-    font-size: 24px;
69
-    color: #FFFFFF;
70
-  }
71
-  .draw-title {
72
-    margin-top: 48px;
73
-    font-family: PingFangSC-Regular;
74
-    font-size: 32px;
75
-    color: #FFFFFF;
76
-  }
77
-  .draw-mass {
78
-    margin-top: 20px;
79
-    display: flex;
80
-    font-family: PingFangSC-Regular;
81
-    font-size: 28px;
82
-    color: rgba(255, 255, 255, .5);
36
+      .left-title {}
83 37
 
84
-    .mass-same {
85
-      width: 150px;
86
-      box-sizing: border-box;
87
-      height: 80px;
88
-      line-height: 80px;
89
-      text-align: center;
90
-      background-color: rgba(255, 255, 255, .05);
91
-      border-radius: 16px;
38
+      .left-content {
39
+        margin-top: 10px;
40
+        height: 120px;
41
+        font-size: 28px;
42
+        color: rgba(255, 255, 255, .75);
43
+      }
92 44
     }
93 45
 
94
-    .mass-high {
95
-      width: 150px;
96
-      height: 80px;
97
-      box-sizing: border-box;
98
-      line-height: 80px;
99
-      text-align: center;
100
-      background-color: rgba(255, 255, 255, .05);
101
-      border-radius: 16px;
102
-      margin-left: 24px;
46
+    .info-right {
47
+      margin-left: 58px;
48
+      width: 222px;
49
+      height: 222px;
103 50
     }
104 51
   }
105
-
106 52
 }

+ 1 - 1
src/pages/collection/index.less

@@ -40,7 +40,7 @@
40 40
 
41 41
         .info-img {
42 42
           width: 100%;
43
-          min-height: 360px;
43
+          min-height: 300px;
44 44
           display: block;
45 45
         }
46 46
       }

+ 67 - 42
src/pages/index/index.jsx

@@ -18,7 +18,7 @@ export default class Mine extends Component {
18 18
     loraIndex: 0,//当前选择的风格
19 19
     sizeIndex: 0,//当前选择的尺寸
20 20
     isOpen: false,
21
-    value: '',//绘画描述
21
+    value: '杰作,顶级质量,女孩',//绘画描述
22 22
     negativeValue: '',//不要的元素
23 23
     modelIndex: 0,//当前选择的模型
24 24
     sliderNum: 7,//色彩丰富度
@@ -35,11 +35,21 @@ export default class Mine extends Component {
35 35
     //接收裁剪图片
36 36
     let pages = Taro.getCurrentPages();
37 37
     let currentPage = pages[pages.length - 1]; // 获取当前页面
38
-    if (currentPage.__data__.consultImg) { // 获取值
39
-      this.setState({
40
-        consultImg: currentPage.__data__.consultImg,
41
-        sizeIndex: currentPage.__data__.sizeIndex
42
-      })
38
+    console.log(currentPage, 'currentPage');
39
+    if (process.env.TARO_ENV == 'weapp') {
40
+      if (currentPage.__data__.consultImg) { // 获取值
41
+        this.setState({
42
+          consultImg: currentPage.__data__.consultImg,
43
+          sizeIndex: currentPage.__data__.sizeIndex
44
+        })
45
+      }
46
+    } else if (process.env.TARO_ENV == 'tt') {
47
+      if (currentPage.data.consultImg) { // 获取值
48
+        this.setState({
49
+          consultImg: currentPage.data.consultImg,
50
+          sizeIndex: currentPage.data.sizeIndex
51
+        })
52
+      }
43 53
     }
44 54
     this.getDrawIndex()
45 55
     this.getWxTemplate()
@@ -157,14 +167,18 @@ export default class Mine extends Component {
157 167
     })
158 168
   }
159 169
   deleteDrawText () {
160
-    this.setState({
161
-      value: ''
162
-    })
170
+    setTimeout(() => {
171
+      this.setState({
172
+        value: ''
173
+      })
174
+    }, 200)
163 175
   }
164 176
   deleteNegativeValue () {
165
-    this.setState({
166
-      negativeValue: ''
167
-    })
177
+    setTimeout(() => {
178
+      this.setState({
179
+        negativeValue: ''
180
+      })
181
+    }, 200)
168 182
   }
169 183
   onInput (e) {
170 184
     var num = e.detail.cursor;
@@ -317,25 +331,31 @@ export default class Mine extends Component {
317 331
     api.drawTxt2img(pramas).then(res => {
318 332
       if (res.code == 200) {
319 333
         Taro.hideLoading()
320
-        this.subscribe(res.data.task_id)
334
+        if (process.env.TARO_ENV == 'weapp') {
335
+          this.subscribe(res.data.task_id)
336
+        }
321 337
         Taro.navigateTo({
322 338
           url: `/moduleA/pages/darwDetail/index?task_id=${res.data.task_id}`
323 339
         })
324 340
       } else {
325 341
         Taro.hideLoading()
326
-        Taro.showModal({
327
-          title: '您的余额不足',
328
-          content: '是否前往获取点券?',
329
-          success: function (res) {
330
-            if (res.confirm) {
331
-              Taro.navigateTo({
332
-                url: `/moduleA/pages/earnPoints/index`
333
-              })
334
-            } else if (res.cancel) {
335
-              console.log('用户点击取消')
342
+        if (res.code == 4001) {
343
+          Taro.showModal({
344
+            title: '您的余额不足',
345
+            content: '是否前往获取点券?',
346
+            success: function (res) {
347
+              if (res.confirm) {
348
+                Taro.navigateTo({
349
+                  url: `/moduleA/pages/earnPoints/index`
350
+                })
351
+              } else if (res.cancel) {
352
+                console.log('用户点击取消')
353
+              }
336 354
             }
337
-          }
338
-        })
355
+          })
356
+        } else {
357
+          Taro.showToast({ icon: 'none', title: res.msg })
358
+        }
339 359
       }
340 360
     })
341 361
     // }, 1000)
@@ -412,24 +432,32 @@ export default class Mine extends Component {
412 432
       }
413 433
     })
414 434
   }
415
-  deleteImg(){
435
+  deleteImg () {
416 436
     this.setState({
417
-      consultImg:''
437
+      consultImg: ''
438
+    })
439
+  }
440
+  toRealDetail () {
441
+    Taro.navigateTo({
442
+      url: `/moduleB/pages/realDetail/index?task_id=${23}`
418 443
     })
419 444
   }
420 445
 
421 446
   render () {
422 447
     return (
423 448
       <View className='mine'>
424
-        {/* <View className='banner'>
425
-          <Image className='banner-image' src=''></Image>
426
-        </View> */}
449
+        <View className='banner'>
450
+          <Image className='banner-image' onClick={e => (this.toRealDetail())} mode='aspectFit' src='http://video-img.fyshark.com/1680600043693banner-02.png'></Image>
451
+        </View>
427 452
         <View className='draw-content'>
428 453
           <View className='draw-title'>绘画描述</View>
429 454
           <View className='draw-text'>
430
-            <View className='recommend'>
431
-              <Image className='recommend-img' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678934357612.png'></Image>
432
-              <View className='recommend-text' onClick={e => (this.getRadomPrompt())}>使用推荐词</View>
455
+            <View className='draw-content-func'>
456
+              <View className='recommend'>
457
+                <Image className='recommend-img' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678934357612.png'></Image>
458
+                <View className='recommend-text' onClick={e => (this.getRadomPrompt())}>使用推荐词</View>
459
+              </View>
460
+              <View className='delete-draw-text' onClick={e => (this.deleteDrawText())}>清空</View>
433 461
             </View>
434 462
             <Textarea
435 463
               value={this.state.value}
@@ -439,10 +467,7 @@ export default class Mine extends Component {
439 467
               onInput={e => (this.onInput(e))}
440 468
               onBlur={e => (this.onBlur(e))}
441 469
               maxlength='1000' />
442
-            {
443
-              this.state.value.length > 0 &&
444
-              <Image className='delete-draw-text' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679637370560.png' onClick={e => (this.deleteDrawText())}></Image>
445
-            }
470
+
446 471
             <View className='textarea-num' id='textarea-num'>{this.state.value.length}/1000</View>
447 472
           </View>
448 473
           <View className='draw-title'>选择标签</View>
@@ -548,7 +573,7 @@ export default class Mine extends Component {
548 573
                 :
549 574
                 <View className='consult-model'>
550 575
                   <Image className='consult-img' mode='aspectFit' onClick={e => (this.upLode())} src={this.state.consultImg}></Image>
551
-                  <Image className='delete' src='http://video-img.fyshark.com/1680147210173guanbi.png' onClick={e=>(this.deleteImg())}></Image>
576
+                  <Image className='delete' src='http://video-img.fyshark.com/1680147210173guanbi.png' onClick={e => (this.deleteImg())}></Image>
552 577
                 </View>
553 578
             }
554 579
           </View>
@@ -588,6 +613,9 @@ export default class Mine extends Component {
588 613
           </View>
589 614
           <View className='draw-title'>绘画不要的元素</View>
590 615
           <View className='draw-text'>
616
+            <View className='draw-content-func'>
617
+              <View className='delete-draw-text' onClick={e => (this.deleteNegativeValue())}>清空</View>
618
+            </View>
591 619
             <Textarea
592 620
               value={this.state.negativeValue}
593 621
               className='draw-taxtarea'
@@ -596,10 +624,7 @@ export default class Mine extends Component {
596 624
               onInput={e => (this.onInputNegative(e))}
597 625
               onBlur={e => (this.onBlurNegative(e))}
598 626
               maxlength='1000' />
599
-            {
600
-              this.state.negativeValue.length > 0 &&
601
-              <Image className='delete-draw-text' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679637370560.png' onClick={e => (this.deleteNegativeValue())}></Image>
602
-            }
627
+
603 628
             <View className='textarea-num' id='negative_prompt'>{this.state.negativeValue.length}/1000</View>
604 629
           </View>
605 630
         </View>

+ 24 - 14
src/pages/index/index.less

@@ -1,7 +1,11 @@
1 1
 .mine {
2 2
   min-height: 100vh;
3 3
   background-color: #041129;
4
-
4
+.banner{
5
+  .banner-image{
6
+    width: 100%;
7
+  }
8
+}
5 9
   .draw-content {
6 10
     padding: 48px 30px;
7 11
 
@@ -110,11 +114,26 @@
110 114
     .draw-text {
111 115
       margin-top: 30px;
112 116
       position: relative;
113
-
114
-      .recommend {
117
+      .draw-content-func{
118
+        display: flex;
115 119
         position: absolute;
116 120
         right: 0;
117 121
         top: -84px;
122
+      }
123
+      .delete-draw-text{
124
+        padding: 0 20px;
125
+        height: 64px;
126
+        line-height: 64px;
127
+        font-family: PingFangSC-Regular;
128
+        font-size: 24px;
129
+        letter-spacing: 0;
130
+        text-align: center;
131
+        background-color: rgba(255, 255, 255, .05);
132
+        color: rgba(255, 255, 255, .5);
133
+      }
134
+
135
+      .recommend {
136
+        margin-right: 20px;
118 137
         width: 222px;
119 138
         height: 64px;
120 139
         display: flex;
@@ -141,8 +160,9 @@
141 160
       .draw-taxtarea {
142 161
         width: 642px;
143 162
         background-color: rgba(255, 255, 255, .05);
163
+        font-size: 28px;
144 164
         color: rgba(255, 255, 255, .5);
145
-        min-height: 240px;
165
+        height: 150px;
146 166
         padding: 24rpx 24rpx 44rpx 24rpx;
147 167
       }
148 168
 
@@ -151,16 +171,6 @@
151 171
         text-align: end;
152 172
         color: rgba(255, 255, 255, .5);
153 173
       }
154
-
155
-      .delete-draw-text {
156
-        position: absolute;
157
-        right: 5px;
158
-        bottom: 65px;
159
-        width: 40px;
160
-        height: 40px;
161
-      }
162
-
163
-
164 174
     }
165 175
 
166 176
     .model-list {

+ 61 - 247
src/pages/mine/index.jsx

@@ -9,19 +9,10 @@ export default class Mine extends Component {
9 9
 
10 10
   state = {
11 11
     userInfo: {},
12
-    type: 0,
13
-    cardinalInfos: [],//基数
14
-    evenInfos: [],//偶数
15
-    total: 0,
16
-    page: 1,
17
-    page_size: 20,
18
-    selection: false,
19
-    cardinalSelectedNum: 0,
20 12
 
21 13
   }
22 14
 
23 15
   componentDidShow () {
24
-    this.getInit(1)
25 16
     this.getUserInfo()
26 17
   }
27 18
   onShareAppMessage = (res) => {
@@ -32,19 +23,6 @@ export default class Mine extends Component {
32 23
     }
33 24
     return shareData;
34 25
   }
35
-  getInit () {
36
-    this.setState({
37
-      cardinalInfos: [],//基数
38
-      evenInfos: [],//偶数
39
-      total: 0,
40
-      page: 1,
41
-      page_size: 20,
42
-      selection: false,
43
-      cardinalSelectedNum: 0,
44
-      evenSelectedNum: 0,
45
-    })
46
-    this.getMyDraw(1)
47
-  }
48 26
   getUserInfo () {
49 27
     api.getUserInfo().then(res => {
50 28
       if (res.code == 200) {
@@ -54,190 +32,48 @@ export default class Mine extends Component {
54 32
       }
55 33
     })
56 34
   }
57
-  getMyDraw (page) {
58
-    Taro.showLoading({
59
-      title: '加载中',
60
-    })
61
-    let params = {
62
-      page: page,
63
-      page_size: this.state.page_size,
64
-    }
65
-    let getInit = api.getMyDraw(params)
66
-    if (this.state.type == 1) {
67
-      getInit = api.getLikeList(params)
68
-    }
69
-    getInit.then(res => {
70
-      if (res.code == 200) {
71
-        Taro.hideLoading()
72
-        res.data.infos.forEach((item, index) => {
73
-          item['select'] = false
74
-        })
75
-        let infos = res.data.infos
76
-        let _evenInfos = res.data.infos.filter((item, index) => {
77
-          return index % 2 == 1
78
-        })
79
-        let _cardinalInfos = res.data.infos.filter((item, index) => {
80
-          return index % 2 == 0
81
-        })
82
-        console.log(_cardinalInfos, '_cardinalInfos');
83
-        let cardinalInfos = this.state.cardinalInfos.concat(_cardinalInfos)
84
-        let evenInfos = this.state.evenInfos.concat(_evenInfos)
85
-        this.setState({
86
-          cardinalInfos: cardinalInfos,//基数
87
-          evenInfos: evenInfos,//偶数
88
-          total: res.data.total
89
-        })
90
-      }
35
+
36
+  getEarnPoints () {
37
+    Taro.navigateTo({
38
+      url: `/moduleA/pages/earnPoints/index`
91 39
     })
92 40
   }
93
-  onReachBottom () {
94
-    if ((this.state.cardinalInfos.length + this.state.evenInfos.length) < this.state.total) {
95
-      this.setState({
96
-        page: this.state.page + 1
97
-      })
98
-      this.getMyDraw(this.state.page + 1)
99
-    }
100
-    console.log('onReachBottom()');
101
-  }
102
-  changeType (index) {
103
-    this.setState({
104
-      type: index
105
-    }, () => {
106
-      this.getInit()
41
+  wallet () {
42
+    Taro.navigateTo({
43
+      url: `/moduleA/pages/wallet/index`
107 44
     })
108 45
   }
109
-  //选中||详情页
110
-  toDetail (item, index, type) {
111
-    if (this.state.selection) {
112
-      if (type == 'cardinal') {
113
-        let _infos = this.state.cardinalInfos
114
-        _infos[index].select = !this.state.cardinalInfos[index].select
115
-        let infosSelect = _infos.filter(res => {
116
-          return res.select == true
117
-        })
118
-        console.log(infosSelect.length, 'infosSelect');
119
-        this.setState({
120
-          cardinalInfos: _infos,
121
-          cardinalSelectedNum: infosSelect.length
122
-        })
123
-      } else {
124
-        let _infos = this.state.evenInfos
125
-        _infos[index].select = !this.state.evenInfos[index].select
126
-        let infosSelect = _infos.filter(res => {
127
-          return res.select == true
46
+  toDetail (index) {
47
+    switch (index) {
48
+      case 0:
49
+        Taro.navigateTo({
50
+          url: `/moduleB/pages/works/index`
128 51
         })
129
-        console.log(infosSelect.length, 'infosSelect');
130
-        this.setState({
131
-          evenInfos: _infos,
132
-          evenSelectedNum: infosSelect.length
52
+        break;
53
+      case 1:
54
+        Taro.navigateTo({
55
+          url: `/moduleB/pages/like/index`
133 56
         })
134
-      }
135
-
136
-    } else {
137
-      if (this.state.type == 1) {
57
+        break;
58
+      case 2:
138 59
         Taro.navigateTo({
139
-          url: `/moduleA/pages/communityDetail/index?task_id=${item.id}`
60
+          url: `/moduleA/pages/invite/index`
140 61
         })
141
-      }else{
62
+        break;
63
+      case 3:
142 64
         Taro.navigateTo({
143
-          url: `/moduleA/pages/darwDetail/index?task_id=${item.task_id}&img_id=${item.id}`
65
+          url: `/moduleA/pages/shareCnt/index`
144 66
         })
145
-      }
146
-    }
147
-  }
148
-  cancelDelect () {
149
-    let _evenInfos = this.state.evenInfos
150
-    _evenInfos.forEach((item, index) => {
151
-      item.select = false
152
-    })
153
-    let _cardinalInfos = this.state.cardinalInfos
154
-    _cardinalInfos.forEach((item, index) => {
155
-      item.select = false
156
-    })
157
-    this.setState({
158
-      cardinalInfos: _cardinalInfos,
159
-      evenInfos: _evenInfos,
160
-      cardinalSelectedNum: 0,
161
-      evenSelectedNum: 0,
162
-      selection: !this.state.selection
163
-    })
164
-  }
165
-  delectiImg () {
166
-    let that = this
167
-    Taro.showModal({
168
-      title: '提示',
169
-      content: `确定删除这${this.state.cardinalSelectedNum + this.state.evenSelectedNum}张图片吗`,
170
-      success: function (res) {
171
-        if (res.confirm) {
172
-          that.deleteImg()
173
-        } else if (res.cancel) {
174
-          console.log('用户点击取消')
175
-        }
176
-      }
177
-    })
178
-  }
179
-  deleteImg () {
180
-    let deleteObj = []
181
-    this.state.cardinalInfos.forEach(res => {
182
-      if (res.select) {
183
-        console.log(res.id, 'res.id', res.select);
184
-        deleteObj.push(res.id)
185
-      }
186
-    })
187
-    this.state.evenInfos.forEach(res => {
188
-      if (res.select) {
189
-        console.log(res.id, 'res.id', res.select);
190
-        deleteObj.push(res.id)
191
-      }
192
-    })
193
-    console.log(deleteObj.join(','), 'deleteObj');
194
-    api.userDelImg({ img_ids: deleteObj.join(',') }).then(res => {
195
-      if (res.code == 200) {
196
-        Taro.showToast({
197
-          title: `删除成功`,
198
-          icon: 'none',
199
-        });
200
-        this.getInit(1)
201
-        this.getUserInfo()
202
-      }
203
-    })
204
-  }
205
-  //批量选择
206
-  changeSelection () {
207
-    if (this.state.selection) {
208
-      let _evenInfos = this.state.evenInfos
209
-      _evenInfos.forEach((item, index) => {
210
-        item.select = false
211
-      })
212
-      let _cardinalInfos = this.state.cardinalInfos
213
-      _cardinalInfos.forEach((item, index) => {
214
-        item.select = false
215
-      })
216
-      this.setState({
217
-        cardinalInfos: _cardinalInfos,
218
-        evenInfos: _evenInfos,
219
-        cardinalSelectedNum: 0,
220
-        evenSelectedNum: 0,
221
-        selection: !this.state.selection
222
-      })
223
-    } else {
224
-      this.setState({
225
-        selection: !this.state.selection
226
-      })
67
+        break;
68
+      case 4:
69
+        Taro.previewImage({
70
+          current: this.state.userInfo.kf_img, // 当前显示图片的http链接  
71
+          urls: [`${this.state.userInfo.kf_img}`] // 需要预览的图片http链接列表  
72
+        })
73
+        break;
227 74
     }
228 75
   }
229 76
 
230
-  getEarnPoints () {
231
-    Taro.navigateTo({
232
-      url: `/moduleA/pages/earnPoints/index`
233
-    })
234
-  }
235
-  wallet(){
236
-    Taro.navigateTo({
237
-      url: `/moduleA/pages/wallet/index`
238
-    })
239
-  }
240
-
241 77
   componentDidMount () { }
242 78
 
243 79
   render () {
@@ -251,9 +87,9 @@ export default class Mine extends Component {
251 87
                 <View className='info-top'>
252 88
                   <View className='user-name'>{this.state.userInfo.user_name}</View>
253 89
                 </View>
254
-                <View className='info-bottom' onClick={e=>(this.wallet())}>
90
+                <View className='info-bottom' >
255 91
                   <View className='integral'>点券:{this.state.userInfo.total_coin}</View>
256
-                  <Image className='integral-img' src='http://video-img.fyshark.com/1680055380074%E7%A7%AF%E5%88%86%E6%98%8E%E7%BB%86.png'></Image>
92
+                  {/* <Image className='integral-img' src='http://video-img.fyshark.com/1680055380074%E7%A7%AF%E5%88%86%E6%98%8E%E7%BB%86.png'></Image> */}
257 93
                 </View>
258 94
               </View>
259 95
             </View>
@@ -264,63 +100,41 @@ export default class Mine extends Component {
264 100
         </View>
265 101
 
266 102
         <View className='work-list'>
267
-          <View className='type'>
268
-            <View className='type-content'>
269
-              <View className='works' style={this.state.type == 0 ? ' background-image: linear-gradient(-45deg, #4EC3F8 0%, #0F84EC 100%);color: #FFFFFF;' : ''} onClick={e => (this.changeType(0))}>作品</View>
270
-              <View className='like' style={this.state.type == 1 ? ' background-image: linear-gradient(-45deg, #4EC3F8 0%, #0F84EC 100%);color: #FFFFFF;' : ''} onClick={e => (this.changeType(1))}>喜欢</View>
271
-            </View>
103
+          <View className='work-info' onClick={e => (this.toDetail(0))}>
104
+            <Image className='work-img' src='http://video-img.fyshark.com/1680506115183icon-%E6%88%91%E7%9A%84%E4%BD%9C%E5%93%81.png'></Image>
105
+            <View className='work-title'>我的作品</View>
106
+          </View>
107
+          <View className='work-info' onClick={e => (this.toDetail(1))}>
108
+            <Image className='work-img' src='http://video-img.fyshark.com/1680506124768icon-%E9%82%80%E8%AF%B7%E5%A5%BD%E5%8F%8B.png'></Image>
109
+            <View className='work-title'>我的喜欢</View>
110
+          </View>
111
+          <View className='work-info' onClick={e => (this.wallet())}>
112
+            <Image className='work-img' src='http://video-img.fyshark.com/1680055380074%E7%A7%AF%E5%88%86%E6%98%8E%E7%BB%86.png'></Image>
113
+            <View className='work-title'>点券详情</View>
272 114
           </View>
273 115
           {
274
-            this.state.type == 0 &&
275
-            <View className='work-num'>作品数量:{this.state.total}/{this.state.userInfo.stock_cnt}</View>
276
-          }
277
-          <View className='work-list-info' >
278
-            {
279
-              this.state.type == 0 &&
280
-              <View className='selection' onClick={e => (this.changeSelection())}>{!this.state.selection ? '批量选择' : '取消'}</View>
281
-            }
282
-            <View className='selection-left'>
283
-              {
284
-                this.state.cardinalInfos.map((item, index) => (
285
-                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'cardinal'))}>
286
-                    {
287
-                      this.state.selection &&
288
-                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
289
-                    }
290
-                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img ? item.img : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679305142417.png'}></Image>
291
-                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
292
-                  </View>
293
-                ))
294
-              }
116
+            process.env.TARO_ENV != 'tt' &&
117
+            <View className='work-info' onClick={e => (this.toDetail(2))}>
118
+              <Image className='work-img' src='http://video-img.fyshark.com/1680506104131icon-%E6%88%91%E7%9A%84%E5%96%9C%E6%AC%A2.png'></Image>
119
+              <View className='work-title'>邀请好友</View>
295 120
             </View>
296
-            <View className='selection-right'>
297
-              {
298
-                this.state.evenInfos.map((item, index) => (
299
-                  <View className='work-info' key={index} onClick={e => (this.toDetail(item, index, 'even'))}>
300
-                    {
301
-                      this.state.selection &&
302
-                      <Image className='select' src={item.select ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033915899.jpg' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679033897198.jpg'}></Image>
303
-                    }
304
-                    <Image className='work-img' lazyLoad mode='widthFix' src={item.img}></Image>
305
-                    <View className='work-name'>{tool.ellipsis(item.img_info, 8)}</View>
306
-                  </View>
307
-                ))
308
-              }
309
-            </View>
310
-
121
+          }
122
+          <View className='work-info' onClick={e => (this.toDetail(3))}>
123
+            <Image className='work-img' src='http://video-img.fyshark.com/1680505725946icon-%E5%88%86%E9%94%80%E8%AE%A1%E5%88%92.png'></Image>
124
+            <View className='work-title'>分销计划</View>
311 125
           </View>
312
-        </View>
313
-        {
314
-          this.state.selection &&
315
-          <View className='select-content'>
316
-            <View className='cancel' onClick={e => (this.cancelDelect())}>取消</View>
317
-            <View >当前已选中{this.state.cardinalSelectedNum + this.state.evenSelectedNum}张</View>
318
-            <View className='delect' onClick={e => (this.delectiImg())}>
319
-              <Image className='delect-icon' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1679037709270.png'></Image>
320
-              <View className='delect-text'>删除</View>
126
+          {
127
+            process.env.TARO_ENV != 'tt' &&
128
+            <View className='work-info work-info-only' onClick={e => (this.toDetail(4))}>
129
+              <Image className='work-img' src='http://video-img.fyshark.com/1680505998515icon-%E5%8A%A0%E5%85%A5%E4%BA%A4%E5%8F%8B%E7%BE%A4.png'></Image>
130
+              <View className='work-title'>加入交友群</View>
321 131
             </View>
322
-          </View>
323
-        }
132
+          }
133
+          <Button className='button work-info work-info-only' type='default' open-type='contact'>
134
+            <Image className='work-img' src='http://video-img.fyshark.com/1680506053680icon-%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC.png'></Image>
135
+            <View className='work-title'>联系客服</View>
136
+          </Button>
137
+        </View>
324 138
       </View>
325 139
     )
326 140
   }

+ 41 - 102
src/pages/mine/index.less

@@ -110,93 +110,46 @@
110 110
   }
111 111
 
112 112
   .work-list {
113
-    min-height: 100vh;
114
-    background: #0F1A2F;
115
-    box-shadow: 12px 0 30px 0 #1E376D;
116
-    border-radius: 28px 28px 0 0;
117 113
     margin-top: -150px;
118 114
     padding: 28px 30px;
119 115
 
120
-    .work-num {
121
-      margin-top: 48px;
122
-      font-family: PingFangSC-Regular;
123
-      font-size: 32px;
124
-      color: #FFFFFF;
125
-    }
126
-
127
-    .work-list-info {
128
-      width: 100%;
129
-      position: relative;
130
-      margin-top: 40px;
131
-      column-gap: 5rpx;
132
-      column-count: 2;
133
-      /*每一格的高度*/
134
-
116
+    .work-info {
117
+      background: #0F1A2F;
118
+      margin-top: 2px;
135 119
       display: flex;
136
-      justify-content: space-between;
137
-
138
-      .selection {
139
-        position: absolute;
140
-        right: 0;
141
-        top: -94px;
142
-        width: 178px;
143
-        height: 64px;
144
-        line-height: 64px;
145
-        border-radius: 40px;
146
-        border: 2px solid #1489ED;
147
-        color: #1489ED;
148
-        font-family: PingFangSC-Regular;
149
-        font-size: 32px;
150
-        text-align: center;
151
-
152
-      }
120
+      align-items: center;
121
+      padding: 30px 0;
153 122
 
154
-      .selection-left {
155
-        width: 330px;
123
+      .work-img {
124
+        margin-left: 30px;
125
+        width: 48px;
126
+        height: 48px;
156 127
       }
157 128
 
158
-      .selection-right {
159
-        width: 330px;
129
+      .work-title {
130
+        margin-left: 20px;
131
+        font-family: PingFangSC-Regular;
132
+        font-size: 32px;
133
+        color: #FFFFFF;
134
+        letter-spacing: 0;
160 135
       }
136
+    }
161 137
 
162
-      .work-info {
163
-        position: relative;
164
-        margin-top: 10px;
165
-
166
-        // width: 45%;
167
-
168
-        .select {
169
-          position: absolute;
170
-          background-color: white;
171
-          border-radius: 8px;
172
-          left: 20px;
173
-          top: 20px;
174
-          width: 40px;
175
-          height: 40px;
176
-        }
177
-
178
-        .work-img {
179
-          width: 100%;
180
-          min-height: 180px;
181
-          display: block;
182
-          // height: 100%;
183
-        }
138
+    .work-info:first-child {
139
+      border-radius: 16px 16px 0 0;
140
+    }
184 141
 
185
-        .work-name {
186
-          position: absolute;
187
-          bottom: 0;
188
-          left: 0;
189
-          width: 100%;
190
-          font-size: 32rpx;
191
-          background-color: rgba(0, 0, 0, 0.4);
192
-          color: #FFFFFF;
193
-          text-align: center;
142
+    .work-info:nth-child(5) {
143
+      border-radius: 0 0 16px 16px;
144
+    }
194 145
 
195
-        }
196
-      }
146
+    .work-info-only {
147
+      margin-top: 24px;
148
+      border-radius: 16px;
197 149
     }
198 150
   }
199 151
 
152
+
200 153
   @media only screen and (max-width: 768px) {
201 154
     .work-info {
202 155
       width: calc(50% - 10px);
@@ -209,33 +162,19 @@
209 162
     }
210 163
   }
211 164
 
212
-  .select-content {
213
-    width: 100%;
214
-    padding: 20px 0;
215
-    background: rgba(11, 19, 37, .8);
216
-    position: fixed;
217
-    bottom: 0;
218
-    left: 0;
219
-    display: flex;
220
-    justify-content: space-between;
221
-    font-family: PingFangSC-Regular;
222
-    font-size: 32px;
223
-    color: #FFFFFF;
224
-
225
-    .cancel {
226
-      margin-left: 40px;
227
-    }
228
-
229
-    .delect {
230
-      margin-right: 40px;
231
-      display: flex;
232
-      align-items: center;
233
-
234
-      .delect-icon {
235
-        margin-right: 10px;
236
-        width: 40px;
237
-        height: 40px;
238
-      }
239
-    }
240
-  }
165
+}
166
+.button {
167
+  margin: 24px 0 0 0 !important;
168
+  padding: 30px 0 !important;
169
+  border: none !important;
170
+  line-height: normal !important;
171
+  outline: none !important;
172
+  background-color: #0F1A2F !important;
173
+  border-radius: 16px;
174
+  display: flex;
175
+  align-items: center;
176
+}
177
+
178
+button::after {
179
+  border: none;
241 180
 }

+ 44 - 8
src/service/index.js

@@ -158,20 +158,56 @@ export const getUserCoinDetail = data =>
158 158
     method: 'POST',
159 159
     data,
160 160
   });
161
-  //获取用户分销明细
161
+//获取用户分销明细
162 162
 export const getUserShareCnt = data =>
163
-Request({
164
-  url: '/api/get_user_share_cnt',
165
-  method: 'POST',
166
-  data,
167
-});
168
-  //获取用户分销明细
169
-  export const drawGcImg = data =>
163
+  Request({
164
+    url: '/api/get_user_share_cnt',
165
+    method: 'POST',
166
+    data,
167
+  });
168
+//获取用户分销明细
169
+export const drawGcImg = data =>
170 170
   Request({
171 171
     url: '/api/draw_gc_img',
172 172
     method: 'POST',
173 173
     data,
174 174
   });
175
+//获取资讯列表
176
+export const getInformationList = data =>
177
+  Request({
178
+    url: '/api/get_information_list',
179
+    method: 'POST',
180
+    data,
181
+  });
182
+//获取资讯详情
183
+export const getInformationDetails = data =>
184
+  Request({
185
+    url: '/api/get_information_details',
186
+    method: 'POST',
187
+    data,
188
+  });
189
+//获取活动列表
190
+export const aiInformationIndex = data =>
191
+  Request({
192
+    url: '/api/ai_information_index',
193
+    method: 'POST',
194
+    data,
195
+  });
196
+//获取广告任务
197
+export const getCoinTaskAd = data =>
198
+  Request({
199
+    url: '/api/get_coin_task_ad',
200
+    method: 'POST',
201
+    data,
202
+  });
203
+//AI换脸
204
+export const aiFaceMege = data =>
205
+  Request({
206
+    url: '/api/ai_face_mege',
207
+    method: 'POST',
208
+    data,
209
+  });
210
+
175 211
 
176 212
 
177 213