Sfoglia il codice sorgente

动画头像生成添加高清

黎海 2 anni fa
parent
commit
9e84839034
3 ha cambiato i file con 49 aggiunte e 5 eliminazioni
  1. 14 2
      src/pages/activity/index.jsx
  2. 35 0
      src/pages/activity/index.less
  3. 0 3
      src/pages/index/index.jsx

+ 14 - 2
src/pages/activity/index.jsx

@@ -9,6 +9,7 @@ export default class collection extends Component {
9 9
   state = {
10 10
     consultImg: 'http://video-img.fyshark.com/1680144082044%E7%BC%96%E7%BB%84.png',
11 11
     sizeIndex: 0,
12
+    mass:0,
12 13
     isImage: false
13 14
   }
14 15
 
@@ -54,7 +55,7 @@ export default class collection extends Component {
54 55
       Taro.showToast({ title: '请先上传图片', icon: 'none' })
55 56
       return
56 57
     }
57
-    api.drawGcImg({ img_url: this.state.consultImg }).then(res => {
58
+    api.drawGcImg({ img_url: this.state.consultImg,img_type:this.state.mass }).then(res => {
58 59
       if (res.code == 200) {
59 60
         Taro.navigateTo({
60 61
           url: `/moduleA/pages/darwDetail/index?task_id=${res.data.task_id}`
@@ -77,6 +78,11 @@ export default class collection extends Component {
77 78
       }
78 79
     })
79 80
   }
81
+  changeMass (e) {
82
+    this.setState({
83
+      mass: e
84
+    })
85
+  }
80 86
 
81 87
   render () {
82 88
     return (
@@ -96,8 +102,14 @@ export default class collection extends Component {
96 102
           }
97 103
         </View>
98 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
+        
99 111
         <View className='generate-pictures' onClick={e => (this.generatePictures(e))} >
100
-          生成图片(消耗2点券)
112
+          生成图片(消耗{2*(this.state.mass+1)}点券)
101 113
         </View>
102 114
       </View>
103 115
     )

+ 35 - 0
src/pages/activity/index.less

@@ -68,4 +68,39 @@
68 68
     font-size: 24px;
69 69
     color: #FFFFFF;
70 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
+
71 106
 }

+ 0 - 3
src/pages/index/index.jsx

@@ -167,7 +167,6 @@ export default class Mine extends Component {
167 167
     })
168 168
   }
169 169
   onInput (e) {
170
-    console.log(e, 'e')
171 170
     var num = e.detail.cursor;
172 171
     document.getElementById('textarea-num').innerHTML = num + "/1000";
173 172
   }
@@ -175,10 +174,8 @@ export default class Mine extends Component {
175 174
     this.setState({
176 175
       value: e.detail.value
177 176
     })
178
-    console.log(e, 'onBlur');
179 177
   }
180 178
   onInputNegative (e) {
181
-    console.log(e, 'e');
182 179
     var num = e.detail.cursor;
183 180
     document.getElementById('negative_prompt').innerHTML = num + "/1000";
184 181
   }