Browse Source

第一版

黎海 2 years ago
parent
commit
a3318e21bb

+ 14 - 0
app_list.json

@@ -0,0 +1,14 @@
1
+{
2
+  "taroConfig": {
3
+    "version": "1.3.3",
4
+    "desc": "添加广告"
5
+  },
6
+  "app_list": [
7
+    {
8
+      "projectname": "AI绘画练习生",
9
+      "description": "AI绘画练习生",
10
+      "appid": "wxcf756553cfb65cb8",
11
+      "path_name": "project.config.json"
12
+    }
13
+  ]
14
+}

+ 94 - 0
auto_pack.py

@@ -0,0 +1,94 @@
1
+#!/usr/bin/python3
2
+# -*- coding:utf-8 -*-
3
+# __author__ = '__spring__'
4
+
5
+'''
6
+归因上报抖音数据的脚本
7
+
8
+'''
9
+
10
+import json
11
+import os
12
+
13
+
14
+class Handle:
15
+
16
+    def __init__(self):
17
+        pass
18
+    
19
+    """
20
+    将替换的字符串写到一个新的文件中,然后将原文件删除,新文件改为原来文件的名字
21
+    :param file: 文件路径
22
+    :param old_str: 需要替换的字符串
23
+    :param new_str: 替换的字符串
24
+    :return: None
25
+    """
26
+    def updateFile(self,file,old_str,new_str):
27
+        with open(file, "r", encoding="utf-8") as f1,open("%s.bak" % file, "w", encoding="utf-8") as f2:
28
+            for line in f1:
29
+                if old_str in line:
30
+                    line = line.replace(old_str, new_str)
31
+                f2.write(line)
32
+        os.remove(file)
33
+        os.rename("%s.bak" % file, file)
34
+    
35
+    def main(self):
36
+        # 读取需要打包的app 列表
37
+        with open('./app_list.json','r') as f :
38
+            data =  f.read()
39
+        data = json.loads(data)
40
+        app_list = data["app_list"]
41
+        tar_ver = data["taroConfig"]
42
+        
43
+        #读取版本号
44
+        with open('./package.json','r') as f :
45
+            package = f.read()
46
+            package =  json.loads(package)
47
+        
48
+        #更新版本号
49
+        with open('./package.json','w') as f :
50
+            package["taroConfig"] = tar_ver
51
+            json.dump(package,f,indent=4,ensure_ascii=False)
52
+            
53
+        
54
+        #遍历需要打包的应用
55
+        for app_info in app_list:
56
+            path_name = app_info["path_name"]
57
+            #读取配置文件
58
+            with open(path_name,'r') as f:
59
+                pro_data =  f.read()
60
+                pro_data = json.loads(pro_data)
61
+            #修改配置文件
62
+            with open(path_name,'w') as f:
63
+                pro_data["appid"] = app_info["appid"]
64
+                pro_data["projectname"] = app_info["projectname"]
65
+                pro_data["description"] = app_info["description"]
66
+                json.dump(pro_data,f,indent=4,ensure_ascii=False)
67
+            
68
+            #修改抖音自定义导航栏的样式
69
+            # self.updateFile("./src/pages/albums_play/index.config.js","custom","default")
70
+            if app_info["appid"].find("wx") > -1:
71
+                #修改打包插件的appid
72
+                self.updateFile("./config/index.js","__APPID__",app_info["appid"])
73
+                #修改抖音自定义导航栏的样式
74
+                # self.updateFile("./src/pages/albums_play/index.config.js","default","custom")
75
+                
76
+                #自己添加打包插件
77
+            self.updateFile("./config/index.js","plugins:[]",'plugins:[["@tarojs/plugin-mini-ci", CIPluginOpt]]')
78
+            
79
+            #开始运行打包命令
80
+            cmd = "npm run build:weapp_upload"
81
+            if path_name.find("tt") > 0:
82
+                cmd = "npm run build:tt_upload"
83
+            os.system(cmd) #执行命令
84
+            
85
+            if app_info["appid"].find("wx") > -1:
86
+                #修改打包插件的appid
87
+                self.updateFile("./config/index.js",app_info["appid"],"__APPID__")
88
+                
89
+            self.updateFile("./config/index.js",'plugins:[["@tarojs/plugin-mini-ci", CIPluginOpt]]',"plugins:[]")
90
+            
91
+        pass
92
+
93
+if __name__=='__main__':
94
+    Handle().main()

+ 18 - 2
config/index.js

@@ -1,3 +1,19 @@
1
+
2
+const appid_weapp = '__APPID__'
3
+const CIPluginOpt = {
4
+  // 微信小程序
5
+  weapp: {
6
+    appid: appid_weapp,
7
+    privateKeyPath: `./private/private.${appid_weapp}.key`
8
+  },
9
+  // 字节跳动小程序
10
+  tt: {
11
+    email: "lh243434798981008@163.com",
12
+    password: "lihai1243434798"
13
+  },
14
+}
15
+
16
+
1
 const config = {
17
 const config = {
2
   projectName: 'myApp',
18
   projectName: 'myApp',
3
   date: '2023-3-2',
19
   date: '2023-3-2',
@@ -9,7 +25,7 @@ const config = {
9
   },
25
   },
10
   sourceRoot: 'src',
26
   sourceRoot: 'src',
11
   outputRoot: `dist/${process.env.TARO_ENV}`,
27
   outputRoot: `dist/${process.env.TARO_ENV}`,
12
-  plugins: [],
28
+  plugins:[],
13
   defineConstants: {
29
   defineConstants: {
14
   },
30
   },
15
   copy: {
31
   copy: {
@@ -28,7 +44,7 @@ const config = {
28
       pxtransform: {
44
       pxtransform: {
29
         enable: true,
45
         enable: true,
30
         config: {
46
         config: {
31
-
47
+          selectorBlackList: [/van-/],
32
         }
48
         }
33
       },
49
       },
34
       url: {
50
       url: {

File diff suppressed because it is too large
+ 4111 - 1409
package-lock.json


+ 83 - 74
package.json

@@ -1,75 +1,84 @@
1
 {
1
 {
2
-  "name": "myApp",
2
+    "name": "myApp",
3
-  "version": "1.0.0",
3
+    "version": "1.0.0",
4
-  "private": true,
4
+    "private": true,
5
-  "description": "liaotian ",
5
+    "description": "liaotian ",
6
-  "templateInfo": {
6
+    "templateInfo": {
7
-    "name": "redux",
7
+        "name": "redux",
8
-    "typescript": false,
8
+        "typescript": false,
9
-    "css": "less"
9
+        "css": "less"
10
-  },
10
+    },
11
-  "scripts": {
11
+    "scripts": {
12
-    "build:weapp": "taro build --type weapp",
12
+        "build:weapp": "taro build --type weapp",
13
-    "build:swan": "taro build --type swan",
13
+        "build:weapp_upload": "taro build --type weapp  --upload",
14
-    "build:alipay": "taro build --type alipay",
14
+        "build:swan": "taro build --type swan",
15
-    "build:tt": "taro build --type tt",
15
+        "build:alipay": "taro build --type alipay",
16
-    "build:h5": "taro build --type h5",
16
+        "build:tt": "taro build --type tt",
17
-    "build:rn": "taro build --type rn",
17
+        "build:tt_upload": "taro build --type tt  --upload",
18
-    "build:qq": "taro build --type qq",
18
+        "build:h5": "taro build --type h5",
19
-    "build:jd": "taro build --type jd",
19
+        "build:rn": "taro build --type rn",
20
-    "build:quickapp": "taro build --type quickapp",
20
+        "build:qq": "taro build --type qq",
21
-    "dev:weapp": "npm run build:weapp -- --watch",
21
+        "build:jd": "taro build --type jd",
22
-    "dev:swan": "npm run build:swan -- --watch",
22
+        "build:quickapp": "taro build --type quickapp",
23
-    "dev:alipay": "npm run build:alipay -- --watch",
23
+        "dev:weapp": "npm run build:weapp -- --watch",
24
-    "dev:tt": "npm run build:tt -- --watch",
24
+        "dev:swan": "npm run build:swan -- --watch",
25
-    "dev:h5": "npm run build:h5 -- --watch",
25
+        "dev:alipay": "npm run build:alipay -- --watch",
26
-    "dev:rn": "npm run build:rn -- --watch",
26
+        "dev:tt": "npm run build:tt -- --watch",
27
-    "dev:qq": "npm run build:qq -- --watch",
27
+        "dev:h5": "npm run build:h5 -- --watch",
28
-    "dev:jd": "npm run build:jd -- --watch",
28
+        "dev:rn": "npm run build:rn -- --watch",
29
-    "dev:quickapp": "npm run build:quickapp -- --watch",
29
+        "dev:qq": "npm run build:qq -- --watch",
30
-    "deploy": "gh-pages -d dist"
30
+        "dev:jd": "npm run build:jd -- --watch",
31
-  },
31
+        "dev:quickapp": "npm run build:quickapp -- --watch",
32
-  "browserslist": [
32
+        "deploy": "gh-pages -d dist"
33
-    "last 3 versions",
33
+    },
34
-    "Android >= 4.1",
34
+    "browserslist": [
35
-    "ios >= 8"
35
+        "last 3 versions",
36
-  ],
36
+        "Android >= 4.1",
37
-  "author": "",
37
+        "ios >= 8"
38
-  "dependencies": {
38
+    ],
39
-    "@babel/runtime": "^7.7.7",
39
+    "author": "",
40
-    "@tarojs/components": "3.5.7",
40
+    "dependencies": {
41
-    "@tarojs/helper": "3.5.7",
41
+        "@babel/runtime": "^7.7.7",
42
-    "@tarojs/plugin-framework-react": "3.5.7",
42
+        "@tarojs/components": "3.5.7",
43
-    "@tarojs/plugin-platform-alipay": "3.5.7",
43
+        "@tarojs/helper": "3.5.7",
44
-    "@tarojs/plugin-platform-jd": "3.5.7",
44
+        "@tarojs/plugin-framework-react": "3.5.7",
45
-    "@tarojs/plugin-platform-qq": "3.5.7",
45
+        "@tarojs/plugin-platform-alipay": "3.5.7",
46
-    "@tarojs/plugin-platform-swan": "3.5.7",
46
+        "@tarojs/plugin-platform-jd": "3.5.7",
47
-    "@tarojs/plugin-platform-tt": "3.5.7",
47
+        "@tarojs/plugin-platform-qq": "3.5.7",
48
-    "@tarojs/plugin-platform-weapp": "3.5.7",
48
+        "@tarojs/plugin-platform-swan": "3.5.7",
49
-    "@tarojs/react": "3.5.7",
49
+        "@tarojs/plugin-platform-tt": "3.5.7",
50
-    "@tarojs/router": "3.5.7",
50
+        "@tarojs/plugin-platform-weapp": "3.5.7",
51
-    "@tarojs/runtime": "3.5.7",
51
+        "@tarojs/react": "3.5.7",
52
-    "@tarojs/shared": "3.5.7",
52
+        "@tarojs/router": "3.5.7",
53
-    "@tarojs/taro": "3.5.7",
53
+        "@tarojs/runtime": "3.5.7",
54
-    "@tarojs/taro-h5": "3.5.7",
54
+        "@tarojs/shared": "3.5.7",
55
-    "react": "^18.0.0",
55
+        "@tarojs/taro": "3.5.7",
56
-    "react-dom": "^18.0.0"
56
+        "@tarojs/taro-h5": "3.5.7",
57
-  },
57
+        "@vant/weapp": "^1.10.14",
58
-  "devDependencies": {
58
+        "postcss": "^8.2.1",
59
-    "@babel/core": "^7.8.0",
59
+        "react": "^18.0.0",
60
-    "@tarojs/cli": "3.5.7",
60
+        "react-dom": "^18.0.0"
61
-    "@types/webpack-env": "^1.13.6",
61
+    },
62
-    "@types/react": "^18.0.0",
62
+    "devDependencies": {
63
-    "webpack": "5.69.0",
63
+        "@babel/core": "^7.8.0",
64
-    "@tarojs/webpack5-runner": "3.5.7",
64
+        "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
65
-    "babel-preset-taro": "3.5.7",
65
+        "@tarojs/cli": "3.5.7",
66
-    "eslint-config-taro": "3.5.7",
66
+        "@tarojs/plugin-mini-ci": "3.5.7",
67
-    "eslint": "^8.12.0",
67
+        "@tarojs/webpack5-runner": "3.5.7",
68
-    "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
68
+        "@types/react": "^18.0.0",
69
-    "react-refresh": "^0.11.0",
69
+        "@types/webpack-env": "^1.13.6",
70
-    "eslint-plugin-react": "^7.8.2",
70
+        "babel-preset-taro": "3.5.7",
71
-    "eslint-plugin-import": "^2.12.0",
71
+        "eslint": "^8.12.0",
72
-    "eslint-plugin-react-hooks": "^4.2.0",
72
+        "eslint-config-taro": "3.5.7",
73
-    "stylelint": "^14.4.0"
73
+        "eslint-plugin-import": "^2.12.0",
74
-  }
74
+        "eslint-plugin-react": "^7.8.2",
75
-}
75
+        "eslint-plugin-react-hooks": "^4.2.0",
76
+        "react-refresh": "^0.11.0",
77
+        "stylelint": "^14.4.0",
78
+        "webpack": "5.69.0"
79
+    },
80
+    "taroConfig": {
81
+        "version": "1.3.3",
82
+        "desc": "添加广告"
83
+    }
84
+}

+ 26 - 26
project.config.json

@@ -1,29 +1,29 @@
1
 {
1
 {
2
-  "miniprogramRoot": "dist/weapp/",
2
+    "miniprogramRoot": "dist/weapp/",
3
-  "projectname": "畅享短剧",
3
+    "projectname": "AI绘画练习生",
4
-  "description": "畅享短剧 ",
4
+    "description": "AI绘画练习生",
5
-  "appid": "wxe7aa01162d73df1f",
5
+    "appid": "wxcf756553cfb65cb8",
6
-  "setting": {
6
+    "setting": {
7
-    "urlCheck": true,
7
+        "urlCheck": true,
8
-    "es6": false,
8
+        "es6": false,
9
-    "postcss": false,
9
+        "postcss": false,
10
-    "minified": false,
10
+        "minified": false,
11
-    "babelSetting": {
11
+        "babelSetting": {
12
+            "ignore": [],
13
+            "disablePlugins": [],
14
+            "outputPath": ""
15
+        }
16
+    },
17
+    "compileType": "miniprogram",
18
+    "libVersion": "2.26.0",
19
+    "srcMiniprogramRoot": "dist/",
20
+    "packOptions": {
12
         "ignore": [],
21
         "ignore": [],
13
-        "disablePlugins": [],
22
+        "include": []
14
-        "outputPath": ""
23
+    },
24
+    "condition": {},
25
+    "editorSetting": {
26
+        "tabIndent": "insertSpaces",
27
+        "tabSize": 2
15
     }
28
     }
16
-},
29
+}
17
-"compileType": "miniprogram",
18
-"libVersion": "2.26.0",
19
-"srcMiniprogramRoot": "dist/",
20
-"packOptions": {
21
-    "ignore": [],
22
-    "include": []
23
-},
24
-"condition": {},
25
-"editorSetting": {
26
-    "tabIndent": "insertSpaces",
27
-    "tabSize": 2
28
-}
29
-}

+ 9 - 8
project.tt.json

@@ -1,9 +1,10 @@
1
 {
1
 {
2
-  "miniprogramRoot": "./",
2
+    "miniprogramRoot": "./",
3
-  "projectname": "AI智能助手",
3
+    "projectname": "未来智囊",
4
-  "appid": "tt6e291894f116667e01",
4
+    "appid": "tt6e291894f116667e01",
5
-  "setting": {
5
+    "setting": {
6
-    "es6": false,
6
+        "es6": false,
7
-    "minified": false
7
+        "minified": false
8
-  }
8
+    },
9
-}
9
+    "description": "未来智囊"
10
+}

+ 10 - 1
src/api/request.js

@@ -1,4 +1,6 @@
1
 import Taro from '@tarojs/taro';
1
 import Taro from '@tarojs/taro';
2
+import ttappid from '../../project.tt.json'
3
+import wxappid from '../../project.config.json'
2
 import {
4
 import {
3
   baseUrl
5
   baseUrl
4
 } from './config';
6
 } from './config';
@@ -8,9 +10,16 @@ export default (options = {
8
   method: 'GET',
10
   method: 'GET',
9
   data: {}
11
   data: {}
10
 }) => {
12
 }) => {
11
-
12
   const request_data = {
13
   const request_data = {
14
+    session_key: Taro.getStorageSync('session_key') || '',
15
+    channel_name: Taro.getStorageSync('channel_name') || 'channel_name',
16
+    source_name: Taro.getStorageSync('source_name') || 'source_name',
13
   };
17
   };
18
+  if (process.env.TARO_ENV === 'weapp') {
19
+    request_data['appid'] = wxappid.appid
20
+  } else if (process.env.TARO_ENV === 'tt') {
21
+    request_data['appid'] = ttappid.appid
22
+  }
14
   return Taro.request({
23
   return Taro.request({
15
     url: baseUrl + options.url,
24
     url: baseUrl + options.url,
16
     data: {
25
     data: {

+ 15 - 22
src/app.config.js

@@ -1,48 +1,41 @@
1
 export default defineAppConfig({
1
 export default defineAppConfig({
2
   pages: [
2
   pages: [
3
     'pages/index/index',
3
     'pages/index/index',
4
-    'pages/chat/index',
5
     'pages/collection/index',
4
     'pages/collection/index',
6
-    "pages/task/index",
5
+    "pages/darwDetail/index",
7
     "pages/mine/index"
6
     "pages/mine/index"
8
   ],
7
   ],
9
   window: {
8
   window: {
10
     backgroundTextStyle: 'light',
9
     backgroundTextStyle: 'light',
11
-    navigationBarBackgroundColor: '#fff',
10
+    navigationBarBackgroundColor: '#041129',
12
-    navigationBarTitleText: 'WeChat',
11
+    navigationBarTitleText: 'AI绘画',
13
-    navigationBarTextStyle: 'black'
12
+    navigationBarTextStyle: 'white'
14
-  },
15
-  plugins: {
16
-    "WechatSI": {
17
-      version: '0.3.5',
18
-      provider: 'wx069ba97219f66d99'
19
-    }
20
   },
13
   },
21
   tabBar: {
14
   tabBar: {
22
-    color: "#000000",
15
+    color: "#C6C6C6",
23
-    selectedColor: "#1E1E1E",
16
+    selectedColor: "#0F84EC",
24
     borderStyle: "white",
17
     borderStyle: "white",
25
-    backgroundColor: "#fff",
18
+    backgroundColor: "#041129",
26
     list: [
19
     list: [
27
       {
20
       {
28
         pagePath: "pages/collection/index",
21
         pagePath: "pages/collection/index",
29
         iconPath: "images/nav/like.png",
22
         iconPath: "images/nav/like.png",
30
         selectedIconPath: "images/nav/like_pin.png",
23
         selectedIconPath: "images/nav/like_pin.png",
31
-        text: "收藏"
24
+        text: "拓展"
32
 
25
 
33
       },
26
       },
34
       {
27
       {
35
         pagePath: "pages/index/index",
28
         pagePath: "pages/index/index",
36
         iconPath: "images/nav/play.png",
29
         iconPath: "images/nav/play.png",
37
         selectedIconPath: "images/nav/play_pin.png",
30
         selectedIconPath: "images/nav/play_pin.png",
38
-        text: "首页"
31
+        text: "创作"
39
-      },
40
-      {
41
-        pagePath: "pages/task/index",
42
-        iconPath: "images/nav/task.png",
43
-        selectedIconPath: "images/nav/task_pin.png",
44
-        text: "领福利"
45
       },
32
       },
33
+      // {
34
+      //   pagePath: "pages/task/index",
35
+      //   iconPath: "images/nav/task.png",
36
+      //   selectedIconPath: "images/nav/task_pin.png",
37
+      //   text: "任务"
38
+      // },
46
       {
39
       {
47
         pagePath: "pages/mine/index",
40
         pagePath: "pages/mine/index",
48
         iconPath: "images/nav/my.png",
41
         iconPath: "images/nav/my.png",

+ 36 - 3
src/app.js

@@ -1,15 +1,48 @@
1
 import { Component } from 'react'
1
 import { Component } from 'react'
2
+import tool from './common/tool'
3
+import Taro, { getCurrentInstance } from '@tarojs/taro'
2
 import './app.less'
4
 import './app.less'
3
 
5
 
4
 class App extends Component {
6
 class App extends Component {
5
-
7
+  $instance = getCurrentInstance()
6
-  componentDidMount () {}
8
+  componentDidMount () { }
7
 
9
 
8
   componentDidShow () {
10
   componentDidShow () {
9
     console.log('app启动');
11
     console.log('app启动');
12
+    if (!Taro.getStorageSync('session_key')) {
13
+      tool.toLogin();
14
+    }
15
+  }
16
+  onLaunch () {
17
+    // if (wx.getStorageSync('channel_name') == '') {
18
+    //   wx.setStorageSync('channel_name', "channel_name")
19
+    // }
20
+
21
+    // 保持屏幕常亮
22
+    Taro.setKeepScreenOn({
23
+      keepScreenOn: true
24
+    })
25
+    // 获取路由参数
26
+    let params = this.$instance.router.params
27
+    console.log(params, 'params');
28
+    let item = params
29
+    if (params.channel_name) {
30
+      Taro.setStorageSync('channel_name', item.channel_name)
31
+    }
32
+    if (params.source_name) {
33
+      Taro.setStorageSync('source_name', item.source_name)
34
+    }
35
+
36
+    Taro.setKeepScreenOn({
37
+      keepScreenOn: true
38
+    })
39
+
40
+
41
+
42
+
10
   }
43
   }
11
 
44
 
12
-  componentDidHide () {}
45
+  componentDidHide () { }
13
 
46
 
14
   render () {
47
   render () {
15
     // this.props.children 是将要会渲染的页面
48
     // this.props.children 是将要会渲染的页面

+ 32 - 0
src/common/tool.js

@@ -1,5 +1,25 @@
1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
+import * as api from '../service/index'
2
 const tool = {
3
 const tool = {
4
+  //去登录
5
+  toLogin: function (rescallback = () => { }) {
6
+    Taro.login({
7
+      success: function (res) {
8
+        let params = {
9
+          code: res.code,
10
+        }
11
+        if (res.code) {
12
+          api.login(params).then(item => {
13
+            Taro.setStorage({
14
+              key: "session_key",
15
+              data: item.data.session_key
16
+            })
17
+          })
18
+        } else {
19
+        }
20
+      }
21
+    })
22
+  },
3
   // 生成四位随机数的函数
23
   // 生成四位随机数的函数
4
   generateRandomNumber () {
24
   generateRandomNumber () {
5
     // 生成一个 0 到 9999 之间的随机整数
25
     // 生成一个 0 到 9999 之间的随机整数
@@ -18,6 +38,18 @@ const tool = {
18
     const userID = timestamp + randomNumber;
38
     const userID = timestamp + randomNumber;
19
     console.log(userID,'userID');
39
     console.log(userID,'userID');
20
     return userID;
40
     return userID;
41
+  },
42
+   /**
43
+ * 限制字符串长度
44
+ * value:字符串对象
45
+ * lmit:展示的长度
46
+ */
47
+   ellipsis: function (value, lmit) {
48
+    if (!value) return ''
49
+    if (value.length > lmit) {
50
+      return value.slice(0, lmit) + '...'
51
+    }
52
+    return value
21
   }
53
   }
22
 }
54
 }
23
 export default tool
55
 export default tool

BIN
src/images/nav/like.png


BIN
src/images/nav/like_pin.png


BIN
src/images/nav/my.png


BIN
src/images/nav/my_pin.png


BIN
src/images/nav/play.png


BIN
src/images/nav/play_pin.png


BIN
src/images/nav/task.png


BIN
src/images/nav/task_pin.png


+ 0 - 5
src/pages/chat/index.config.js

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

+ 0 - 342
src/pages/chat/index.jsx

@@ -1,342 +0,0 @@
1
-import { Component } from 'react'
2
-import { View, Text, Button, Image, ScrollView, Input, Textarea } from '@tarojs/components'
3
-import Taro, { requirePlugin,getCurrentInstance } from '@tarojs/taro'
4
-import * as api from '../../service/index'
5
-import './index.less'
6
-import tool from '../../common/tool'
7
-
8
-export default class Albums_play extends Component {
9
-  $instance = getCurrentInstance()
10
-  plugin = process.env.TARO_ENV == 'weapp' ? requirePlugin("WechatSI") : '';
11
-  manager = process.env.TARO_ENV == 'weapp' ? this.plugin.getRecordRecognitionManager() : '';
12
-  options = {
13
-    sampleRate: 44100,
14
-    numberOfChannels: 1,
15
-    encodeBitRate: 192000,
16
-    format: 'aac'
17
-  }
18
-
19
-  state = {
20
-    login: false,
21
-    sendDisabled: true,//是否禁用发送按钮
22
-    value: '',
23
-    height: 63,
24
-    userId: tool.generateUserID(),
25
-    isAnswer: true,//机器人是否已经回答
26
-    isRecognize: false,
27
-    showResult: false,
28
-    isSpeechSounds: false,//是否是语音写入
29
-    conversations: [
30
-      {
31
-        name: 'other',
32
-        userImage: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1677832835490.png",
33
-        userTexts: '您好,我是智能助手,一个由AI训练的聊天机器人。作为一名智能助手,我可以帮助您回答问题,提供建议,分享知识和技能等等。我拥有处理多种自然语言任务的能力,包括自然语言理解和生成,语言翻译,文本摘要和语言生成等等。无论您需要寻求帮助还是只是想进行友好的聊天,我都很乐意与您交流。'
34
-      },
35
-    ]
36
-  }
37
-
38
-  componentDidShow () {
39
-    let routers = this.$instance.router.params
40
-    console.log(routers,'routers');
41
-     Taro.setNavigationBarTitle({
42
-        title: routers.title
43
-      })
44
-    console.log('页面启动', this.state.userId);
45
-    if (process.env.TARO_ENV == 'weapp') {
46
-      this.initRecord()
47
-    }
48
-    // this.setState({
49
-    //   userId: this.generateUserID()
50
-    // })
51
-  }
52
-  // useShareAppMessage((res) => {
53
-  //   console.log(res, 'ressss');
54
-  //   let shareData = {
55
-  //     title: `海量好剧,你爱看的都在这里!`,
56
-  //     path: `pages/theatre/index`,  // 分享的路径
57
-  //     // imageUrl: this.props.albums.video.img,  // 分享的图片链接
58
-  //   }
59
-  //   return shareData;
60
-  // })
61
-
62
-  // /**
63
-  //  * 分享朋友圈
64
-  //  * */
65
-  // useShareTimeline((res) => {
66
-  //   let shareData = {
67
-  //     title: `海量好剧,你爱看的都在这里!`,
68
-  //     path: `pages/theatre/index`,  // 分享的路径
69
-  //     // imageUrl: this.props.albums.video.img,  // 分享的图片链接
70
-  //   }
71
-  //   return shareData;
72
-  // })
73
-
74
-  componentDidHide () { }
75
-
76
-  // 提交文字
77
-  submitTo () {
78
-    let inputHtml = document.getElementById('advice_textarea').props.value
79
-    if (inputHtml.length == 0) return
80
-    this.sendText(inputHtml)
81
-
82
-  }
83
-  sendText (inputHtml) {
84
-    console.log(inputHtml, 'inputHtml');
85
-    let textObj = {
86
-      name: 'mine',
87
-      userImage: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1677833953396.jpeg",
88
-      userTexts: inputHtml
89
-    }
90
-    this.state.conversations.push(textObj)
91
-    this.setState({
92
-      sendDisabled: true,
93
-      value: '',
94
-      isAnswer: false
95
-    })
96
-    let params = {
97
-      user_id: this.state.userId,
98
-      text: inputHtml
99
-    }
100
-    if (process.env.TARO_ENV == 'tt') {
101
-      params['app_id'] = 'tt6e291894f116667e01'
102
-    }
103
-
104
-    api.getAsk(params).then(res => {
105
-      if (res.code == 200) {
106
-        let otherInfo = {
107
-          name: 'other',
108
-          userImage: "https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1677832835490.png",
109
-          userTexts: res.data
110
-        }
111
-        this.state.conversations.push(otherInfo)
112
-        this.setState({
113
-          isAnswer: true,
114
-          value: ''
115
-        })
116
-      } else {
117
-        this.setState({
118
-          sendDisabled: true,//是否禁用发送按钮
119
-          value: '',
120
-          height: 63,
121
-          userId: 0,
122
-          isAnswer: true,//机器人是否已经回答
123
-          isRecognize: false,
124
-          showResult: false,
125
-          isSpeechSounds: false,//是否是语音写入
126
-        })
127
-      }
128
-    })
129
-      .catch(res => {
130
-        console.log("请求超时");
131
-        this.setState({
132
-          sendDisabled: true,//是否禁用发送按钮
133
-          value: '',
134
-          height: 63,
135
-          userId: 0,
136
-          isAnswer: true,//机器人是否已经回答
137
-          isRecognize: false,
138
-          showResult: false,
139
-          isSpeechSounds: false,//是否是语音写入
140
-        })
141
-      })
142
-  }
143
-  //文字输入
144
-  focus (e) {
145
-    let inputHtml = document.getElementById('advice_textarea').props.value
146
-    this.setState({
147
-      sendDisabled: false,
148
-      value: inputHtml
149
-    })
150
-  }
151
-  blur (e) {
152
-    // this.setState({
153
-    //   sendDisabled: true
154
-    // })
155
-  }
156
-  //键盘高度发生变换时
157
-  onKeyboardHeightChange (e) {
158
-    console.log(e, 'onKeyboardHeightChange');
159
-  }
160
-  onLineChange (e) {
161
-    console.log(e, 'onLineChange');
162
-  }
163
-  changeSpeak () {
164
-    if (!this.state.isAnswer) return
165
-    this.setState({
166
-      isSpeechSounds: !this.state.isSpeechSounds
167
-    })
168
-  }
169
-  // 初始化语音识别
170
-  initRecord () {
171
-    let that = this
172
-    console.log('initRecord');
173
-    this.manager.onRecognize = (res) => {
174
-      console.log("current result", res.result);
175
-    };
176
-    // 识别错误事件
177
-    this.manager.onError = function (res) {
178
-      Taro.hideLoading();
179
-    }
180
-    this.manager.onStop = (res) => {
181
-      Taro.hideLoading();
182
-      // 去除语音识别出的特殊符号
183
-      const text = res.result.replace(
184
-        /[`~%!@#^=''?~《》!@#¥……&——‘”“'?*()(),,。.、<>]/g,
185
-        ""
186
-      );
187
-      console.log(text, 'text');
188
-      if (text) {
189
-        that.sendText(text)
190
-        that.setState({
191
-          value: text
192
-        })
193
-        // 识别结果展示1.5秒后收起                               
194
-        setTimeout(() => {
195
-          that.setState({
196
-            isRecognize: false,
197
-            showResult: false,
198
-          })
199
-
200
-        }, 1500);
201
-      } else {
202
-
203
-        setTimeout(() => {
204
-          that.setState({
205
-            isRecognize: false,
206
-            showResult: false,
207
-          })
208
-        }, 1500);
209
-      }
210
-      that.setState({
211
-        showResult: true
212
-      })
213
-    };
214
-    this.manager.onError = (res) => {
215
-      Taro.hideLoading();
216
-      if (res.msg) {
217
-        Taro.showToast({ title: res.msg, icon: "none" });
218
-      }
219
-    };
220
-  };
221
-  // 开始录音
222
-  startRecognize = () => {
223
-    wx.vibrateShort()
224
-    Taro.showLoading({ title: "录音中..." });
225
-    this.setState({
226
-      isRecognize: true,
227
-      value: '',
228
-    })
229
-    this.manager.start({ duration: 30000, lang: "zh_CN" });
230
-  };
231
-  // 结束录音
232
-  endRecognize = () => {
233
-    console.log("endRecognize");
234
-    Taro.hideLoading();
235
-    Taro.showLoading({ title: "识别中..." });
236
-    this.manager.stop();
237
-
238
-  };
239
-
240
-  render () {
241
-    return (
242
-      <View className='mine'>
243
-        <ScrollView
244
-          className='scrollview'
245
-          style={`max-height: calc(100vh - ${this.state.height}px);`}
246
-          scrollY
247
-          scrollIntoView={`scrollIntoView_${this.state.conversations.length}`}
248
-          scrollWithAnimation
249
-          lowerThreshold="20"
250
-          upperThreshold="20"
251
-
252
-        >
253
-          {
254
-            this.state.conversations.map((item, index) => (
255
-              <View key={index} id={`scrollIntoView_${index + 1}`}>
256
-                {
257
-                  item.name == 'mine' &&
258
-                  <View className='mine-speak-info'>
259
-                    <View className='mine-text'>
260
-                      <Text selectable userSelect className='mine-text-content'>
261
-                        {item.userTexts}
262
-                      </Text>
263
-                      <View className='mine-text-tip'></View>
264
-                    </View>
265
-                    <Image className='mine-image' src={item.userImage}></Image>
266
-                  </View>
267
-                }
268
-                {
269
-                  item.name == 'other' &&
270
-                  <View className='other-speak-info'>
271
-                    <Image className='other-image' src={item.userImage}></Image>
272
-                    <View className='other-text'>
273
-                      <Text selectable userSelect className='other-text-content'>
274
-                        {item.userTexts}
275
-                      </Text>
276
-                      <View className='other-text-tip'></View>
277
-                    </View>
278
-                  </View>
279
-                }
280
-              </View>
281
-
282
-            ))
283
-          }
284
-
285
-        </ScrollView>
286
-        <View className="in_voice_icon">
287
-          {
288
-            !this.state.isAnswer &&
289
-            <View className='in_voice_icon_tips'>机器人思考中...</View>
290
-          }
291
-          <View className="sendmessage" style={`bottom:${this.state.input_bottom}px`}>
292
-            {
293
-              process.env.TARO_ENV=='weapp'&&
294
-            <Image className='add_icon' style={!this.state.isAnswer ? 'opacity: .3;' : ''} onClick={e => (this.changeSpeak(e))} id='1' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1677739244529.png'></Image>
295
-            }
296
-            {
297
-              this.state.isSpeechSounds ?
298
-                <View
299
-                  className="recognize-btn view-center"
300
-                  onClick={() => {
301
-                    // 按住按钮时间过短只会触发点击事件
302
-                    Taro.hideLoading();
303
-                    Taro.showToast({ title: "请长按说话", icon: "error" });
304
-                  }}
305
-                  onLongPress={e => (this.startRecognize())}
306
-                  onTouchEnd={e => (this.endRecognize())}
307
-                >
308
-                  <View>
309
-                    {this.state.isRecognize
310
-                      ? "松开发送"
311
-                      : "按住说话"}
312
-                  </View>
313
-                </View>
314
-                :
315
-                <Input
316
-                  autoHeight
317
-                  disabled={!this.state.isAnswer}
318
-                  id='advice_textarea'
319
-                  className='advice_textarea'
320
-                  cursorSpacing='5'
321
-                  showConfirmBar=''
322
-                  confirmType='send'
323
-                  onConfirm={e => (this.submitTo(e))}
324
-                  adjustPosition
325
-                  value={this.state.value}
326
-                  onFocus={e => (this.focus(e))}
327
-                  onBlur={e => (this.blur(e))}
328
-                  onKeyboardHeightChange={e => (this.onKeyboardHeightChange(e))}
329
-                  onLineChange={e => (this.onLineChange(e))}
330
-                  placeholder="请输入您要咨询的问题" />
331
-            }
332
-
333
-            <Button onClick={e => (this.submitTo(e))}
334
-              disabled={this.state.sendDisabled}
335
-              style={this.state.sendDisabled ? 'opacity: .3;' : ''}
336
-              className='user_input_Text'>发送</Button>
337
-          </View>
338
-        </View>
339
-      </View>
340
-    )
341
-  }
342
-}

+ 0 - 144
src/pages/chat/index.less

@@ -1,144 +0,0 @@
1
-page {
2
-  background-color: #f2f2f2;
3
-  position: relative;
4
-  height: 100vh;
5
-  padding: 0 auto;
6
-  margin: 0 auto;
7
-}
8
-.mine{
9
-  height: 100vh;
10
-}
11
-.in_voice_icon {
12
-  position: absolute;
13
-  bottom: 0;
14
-  transform: translateY(0%);
15
-  width: 100%;
16
-  background-color: #F2F2F2;
17
-  min-height: 53px;
18
-  border-top: 2px solid #b5b0b0ad;
19
-}
20
-.in_voice_icon_tips{
21
-  position: absolute;
22
-  color: #F2F2F2;
23
-  top: -70px;
24
-  font-size: 28px;
25
-  padding: 10px 50px 20px 50px;
26
-  background-color: #948c8c94;
27
-  border-radius: 5px;
28
-  // background: url(https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1677810251249.png);
29
-}
30
-
31
-.sendmessage {
32
-  margin: 20px 20px 40px 20px;
33
-  z-index: 2;
34
-  display: flex;
35
-  align-items: flex-end;
36
-  flex-direction: row;
37
-}
38
-.add_icon {
39
-  width: 60px;
40
-  height: 60px;
41
-  margin: 0 auto;
42
-}
43
-
44
-.sendmessage .advice_textarea {
45
-  flex: 1;
46
-  padding: 10px;
47
-  height: 60px;
48
-  border-radius: 10px;
49
-  // max-height: 150px;
50
-  background-color: #f8f8f8;
51
-  font-size: 32px;
52
-  margin-left: 20px;
53
-  padding-left: 20px;
54
-}
55
-.recognize-btn{
56
-  flex: 1;
57
-  padding: 10px;
58
-  height: 60px;
59
-  border-radius: 10px;
60
-  // max-height: 150px;
61
-  background-color: #f8f8f8;
62
-  font-size: 32px;
63
-  margin-left: 20px;
64
-  padding-left: 20px;
65
-  display: flex;
66
-  justify-content: center;
67
-  align-items: center;
68
-}
69
-
70
-.sendmessage button {
71
-  border: 1px solid white;
72
-  height: 60px;
73
-  margin-left: 20px;
74
-  background: #0c0;
75
-  color: white;
76
-  line-height: 60px;
77
-  font-size: 28px;
78
-}
79
-.scrollview{
80
- 
81
-}
82
-.mine-speak-info{
83
-  display: flex;
84
-  padding:  20px;
85
-  justify-content: flex-end;
86
-  .mine-text{
87
-    background-color: #9EE770;
88
-    border-radius: 10px;
89
-    padding: 20px;
90
-    max-width: 485px;
91
-    position: relative;
92
-    margin-right: 20px;
93
-    .mine-text-content{
94
-
95
-    }
96
-    .mine-text-tip{
97
-      position: absolute;
98
-      right: -36px;
99
-      top: 20px;
100
-      width: 0;
101
-      height: 0;
102
-      border-top: 20px solid transparent;
103
-      border-left: 20px solid #9EE770;
104
-      border-right: 20px solid transparent;
105
-      border-bottom: 20px solid transparent;
106
-    }
107
-  }
108
-  .mine-image{
109
-    width: 80px;
110
-    height: 80px;
111
-    border-radius: 10px;
112
-  }
113
-}
114
-.other-speak-info{
115
-  display: flex;
116
-  padding:  20px;
117
-  .other-text{
118
-    background-color: #f8f8f8;
119
-    border-radius: 10px;
120
-    padding: 20px;
121
-    max-width: 485px;
122
-    position: relative;
123
-    margin-left: 20px;
124
-    .other-text-content{
125
-
126
-    }
127
-    .other-text-tip{
128
-      position: absolute;
129
-      left: -36px;
130
-      top: 20px;
131
-      width: 0;
132
-      height: 0;
133
-      border-top: 20px solid transparent;
134
-      border-left: 20px solid transparent;
135
-      border-right: 20px solid #f8f8f8;
136
-      border-bottom: 20px solid transparent;
137
-    }
138
-  }
139
-  .other-image{
140
-    width: 80px;
141
-    height: 80px;
142
-    border-radius: 10px;
143
-  }
144
-}

+ 3 - 0
src/pages/darwDetail/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '作品详情'
3
+})

+ 227 - 0
src/pages/darwDetail/index.jsx

@@ -0,0 +1,227 @@
1
+import { Component } from 'react'
2
+import { View, Swiper, SwiperItem, Image, Textarea } from '@tarojs/components'
3
+import Taro, { getCurrentInstance } from '@tarojs/taro'
4
+import * as api from '../../service/index'
5
+import './index.less'
6
+
7
+export default class Task extends Component {
8
+  $instance = getCurrentInstance()
9
+  state = {
10
+    draw_status: 0,
11
+    draw_data: {},
12
+    draw_infos: [],
13
+    que_cnt: 0,
14
+    default_img: '',
15
+    interval: null
16
+
17
+  }
18
+
19
+  componentWillMount () {
20
+    this.getDrawTaskStatus()
21
+  }
22
+  getDrawTaskStatus () {
23
+    let routers = this.$instance.router.params
24
+    api.getDrawTaskStatus({ task_id: routers.task_id }).then(res => {
25
+      //定时器不要轻易改,避免造成服务器攻击
26
+      if (res.code == 200) {
27
+        let draw_infos = res.data.draw_infos
28
+        if (res.data.draw_status != 2) {
29
+          let params = {}
30
+          params['img'] = res.data.default_img
31
+          draw_infos.push(params)
32
+        }
33
+        console.log(draw_infos, 'draw_infos');
34
+        if (res.data.draw_status != 2 && res.data.que_cnt > 1) {
35
+          this.state.interval = setInterval(() => {
36
+            this.getDrawTaskStatus()
37
+          }, 1000 * 30)
38
+        } else if (res.data.draw_status != 2 && res.data.que_cnt <= 1) {
39
+          clearInterval(this.state.interval)
40
+          this.state.interval = setInterval(() => {
41
+            this.getDrawTaskStatus()
42
+          }, 1000 * 5)
43
+        } else {
44
+          clearInterval(this.state.interval)
45
+        }
46
+        this.setState({
47
+          draw_status: res.data.draw_status,
48
+          draw_data: res.data.draw_data,
49
+          que_cnt: res.data.que_cnt,
50
+          draw_infos: draw_infos
51
+        })
52
+      }
53
+    })
54
+  }
55
+  download () {
56
+    // Taro.downloadFile({
57
+    //   url: this.state.draw_infos[0].img, //仅为示例,并非真实的资源
58
+    //   success: function (res) {
59
+    //     // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
60
+    //     if (res.statusCode === 200) {
61
+    //       Taro.playVoice({
62
+    //         filePath: res.tempFilePath
63
+    //       })
64
+    //     }
65
+    //   }
66
+    // })
67
+    this.downImg()
68
+  }
69
+  // 鉴权操作 判断是否有保存到相册的权限
70
+  // 有就直接下载 没有就弹窗提示给权限
71
+  downImg () {
72
+    Taro.getSetting({
73
+      success: res => {
74
+        if (!res.authSetting['scope.writePhotosAlbum']) {
75
+          Taro.authorize({
76
+            scope: 'scope.writePhotosAlbum',
77
+            success: () => {
78
+              this.doSaveImg()
79
+            },
80
+            fail: () => {
81
+              this.openConfirm()
82
+            }
83
+          })
84
+        } else {
85
+          this.doSaveImg()
86
+        }
87
+      }
88
+    })
89
+  }
90
+  // 生成临时路径 保存图片到手机
91
+  doSaveImg () {
92
+    Taro.downloadFile({
93
+      url: this.state.draw_infos[0].img,
94
+      success: res => {
95
+        Taro.saveImageToPhotosAlbum({
96
+          filePath: res.tempFilePath,
97
+          success: () => {
98
+            Taro.showToast({ title: '已保存到相册', icon: 'success' })
99
+          },
100
+          fail: () => {
101
+            Taro.showToast({ title: '保存失败', icon: 'none' })
102
+          }
103
+        })
104
+      }
105
+    })
106
+  }
107
+  // 权限弹窗
108
+  openConfirm () {
109
+    Taro.showModal({
110
+      content: '检测到您没有打开小程序相册权限,是否取设置打开?',
111
+      showCancel: true,
112
+      success: res => {
113
+        if (res.confirm) {
114
+          // 打开权限
115
+          Taro.openSetting({
116
+            success: res => {
117
+              this.doSaveImg()
118
+            }
119
+          })
120
+        }
121
+      }
122
+    })
123
+  }
124
+
125
+
126
+  componentDidMount () { }
127
+  //页面销毁之前调用
128
+  componentWillUnmount () {
129
+    //避免服务器攻击
130
+    clearInterval(this.state.interval)
131
+  }
132
+
133
+
134
+  render () {
135
+    return (
136
+      <View className='mine'>
137
+        <Swiper
138
+          className='banner'
139
+          indicatorColor='#121D34'
140
+          indicatorActiveColor='#0F84EC'
141
+          circular
142
+          adjustHeight='first'
143
+          indicatorDots
144
+          autoplay>
145
+          {
146
+            this.state.draw_infos.map((item, index) => (
147
+              <SwiperItem key={index}>
148
+                <View className='banner-info'>
149
+                  <Image className='banner-image' mode='aspectFit' src={item.img}></Image>
150
+                </View>
151
+              </SwiperItem>
152
+            ))
153
+          }
154
+          {
155
+            this.state.draw_status != 2 &&
156
+            <View className='banner-tips'>
157
+              预计等待{this.state.que_cnt + 1}分钟...
158
+            </View>
159
+          }
160
+          {/* <SwiperItem>
161
+            <View className='demo-text-2'><Image ></Image></View>
162
+          </SwiperItem>
163
+          <SwiperItem>
164
+            <View className='demo-text-3'><Image ></Image></View>
165
+          </SwiperItem> */}
166
+        </Swiper>
167
+        <View className='content'>
168
+          <View className='draw-title'>绘画描述</View>
169
+          <View className='draw-text'>
170
+            <Textarea
171
+              value={this.state.draw_data.prompt}
172
+              className='draw-taxtarea'
173
+              placeholder='| 请输入相关描述,也可以输入关键词~'
174
+              showCount
175
+              disabled
176
+            />
177
+            
178
+          </View>
179
+          <View className='draw-content'>
180
+            <View className='draw-info'>
181
+              <View className='info-title'>模型</View>
182
+              <View className='info-text'>{this.state.draw_data.model_name} </View>
183
+            </View>
184
+            <View className='draw-info'>
185
+              <View className='info-title'>风格</View>
186
+              <View className='info-text'>{ } </View>
187
+            </View>
188
+            <View className='draw-info'>
189
+              <View className='info-title'>图片尺寸</View>
190
+              <View className='info-text'>{this.state.draw_data.img_size} </View>
191
+            </View>
192
+            {/* <View className='draw-info'>
193
+              <View className='info-title'>图片质量</View>
194
+              <View className='info-text'>{} </View>
195
+            </View> */}
196
+          </View>
197
+          <View className='draw-title'>绘画不要的元素</View>
198
+          <View className='draw-text'>
199
+            <Textarea
200
+              value={this.state.draw_data.negative_prompt}
201
+              className='draw-taxtarea'
202
+              placeholder='| 请输入相关描述,也可以输入关键词~'
203
+              showCount
204
+              disabled
205
+            />
206
+          </View>
207
+        </View>
208
+        <View className='func'>
209
+          <View className='func-list'>
210
+            {/* <View className='func-info'>
211
+              <Image className='func-image' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678952380367.png'></Image>
212
+              <View>发布</View>
213
+            </View> */}
214
+            <View className='func-info'>
215
+              <Image className='func-image' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678952396973.png'></Image>
216
+              <View>分享</View>
217
+            </View>
218
+            <View className='func-info' onClick={e => (this.download())}>
219
+              <Image className='func-image' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678952411029.png'></Image>
220
+              <View>下载</View>
221
+            </View>
222
+          </View>
223
+        </View>
224
+      </View>
225
+    )
226
+  }
227
+}

+ 112 - 0
src/pages/darwDetail/index.less

@@ -0,0 +1,112 @@
1
+.mine {
2
+  min-height: 100vh;
3
+  background-color: #041129;
4
+  padding-bottom: 120px;
5
+
6
+  .banner {
7
+    width: 750px;
8
+    height: 750px;
9
+    position: relative;
10
+
11
+    .banner-tips {
12
+      position: absolute;
13
+      top: 50px;
14
+      left: 10px;
15
+      font-family: PingFangSC-Regular;
16
+      font-size: 32px;
17
+      color: rgba(255, 255, 255, .75);
18
+    }
19
+
20
+    .banner-info {
21
+      width: 100%;
22
+      height: 100%;
23
+
24
+      .banner-image {
25
+        width: 100%;
26
+        height: 100%;
27
+      }
28
+    }
29
+  }
30
+
31
+  .content {
32
+    padding: 0 30px;
33
+
34
+    .draw-title {
35
+      margin-top: 48px;
36
+      font-family: PingFangSC-Regular;
37
+      font-size: 32px;
38
+      color: #FFFFFF;
39
+    }
40
+
41
+    .draw-text {
42
+      margin-top: 20px;
43
+
44
+      .draw-taxtarea {
45
+        width: 642px;
46
+        background-color: rgba(255, 255, 255, .05);
47
+        color: rgba(255, 255, 255, .5);
48
+        min-height: 240px;
49
+        padding: 24px;
50
+      }
51
+    }
52
+
53
+    .draw-content {
54
+      margin-top: 48px;
55
+
56
+      .draw-info {
57
+        margin-top: 1px;
58
+        background: #0F1A2F;
59
+
60
+        padding: 0 30px;
61
+        display: flex;
62
+        justify-content: space-between;
63
+        align-items: center;
64
+        height: 112px;
65
+        font-family: PingFangSC-Regular;
66
+        font-size: 32px;
67
+        color: rgba(255, 255, 255, .75);
68
+      }
69
+
70
+      .draw-info:first-child {
71
+        border-radius: 16px 16px 0 0;
72
+      }
73
+
74
+      .draw-info:last-child {
75
+        border-radius: 0 0 16px 16px;
76
+      }
77
+    }
78
+
79
+  }
80
+
81
+  .func {
82
+    width: 100%;
83
+    margin-top: 76px;
84
+
85
+    .func-list {
86
+      padding: 0 30px;
87
+      display: flex;
88
+      justify-content: space-evenly;
89
+    }
90
+
91
+    .func-info {
92
+      display: flex;
93
+      justify-content: center;
94
+      align-items: center;
95
+      width: 218px;
96
+      height: 80px;
97
+      border-radius: 8px;
98
+      border: 2px solid rgba(16, 133, 237, 1);
99
+      font-family: PingFangSC-Regular;
100
+      font-size: 32px;
101
+      color: #38ADF4;
102
+      letter-spacing: 0;
103
+      text-align: center;
104
+
105
+      .func-image {
106
+        margin-right: 22px;
107
+        width: 48px;
108
+        height: 48px;
109
+      }
110
+    }
111
+  }
112
+}

+ 1 - 1
src/pages/index/index.config.js

@@ -1,3 +1,3 @@
1
 export default definePageConfig({
1
 export default definePageConfig({
2
-  navigationBarTitleText: '首页'
2
+  navigationBarTitleText: 'AI创作'
3
 })
3
 })

+ 258 - 46
src/pages/index/index.jsx

@@ -1,69 +1,281 @@
1
 import { Component } from 'react'
1
 import { Component } from 'react'
2
-import { View, Text, Button, Image, scrollView, Input } from '@tarojs/components'
2
+import { View, Text, Button, Image, scrollView, Input, Textarea, Slider } from '@tarojs/components'
3
-import Taro, {getCurrentInstance} from '@tarojs/taro'
3
+import Taro, { getCurrentInstance } from '@tarojs/taro'
4
+import * as api from '../../service/index'
4
 
5
 
5
 import './index.less'
6
 import './index.less'
6
 
7
 
7
 export default class Mine extends Component {
8
 export default class Mine extends Component {
8
-  
9
+
9
   state = {
10
   state = {
10
-    classList: [
11
+    models: [],//模板
11
-      {
12
+    imgSize: [],//图片尺寸
12
-        name: '美食家',
13
+    sampling: [],//采样方式
13
-        tips: '你想吃的美食我都会做哟',
14
+    samplingIndex: 0,//当前选择的采样方式
14
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
15
+    loraIndex: 0,//当前选择的lora
15
-      },
16
+    sizeIndex: 0,//当前选择的尺寸
16
-      {
17
+    isOpen: false,
17
-        name: '作者',
18
+    value: '',//绘画描述
18
-        tips: '你想吃的美食我都会做哟',
19
+    negativeValue: '',//不要的元素
19
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
20
+    modelIndex: 0,//当前选择的模型
20
-      },
21
+    sliderNum: 7,//色彩丰富度
21
-      {
22
+    drawNum: 1,//图片数量
22
-        name: '美食家',
23
-        tips: '你想吃的美食我都会做哟',
24
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
25
-      },
26
-      {
27
-        name: '美食家',
28
-        tips: '你想吃的美食我都会做哟',
29
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
30
-      },
31
-      {
32
-        name: '美食家',
33
-        tips: '你想吃的美食我都会做哟',
34
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
35
-      },
36
-    ]
37
   }
23
   }
38
 
24
 
39
-  componentWillMount () { }
25
+  componentDidShow () {
26
+    this.getDrawIndex()
27
+  }
40
 
28
 
41
   componentDidMount () { }
29
   componentDidMount () { }
42
 
30
 
43
-  componentWillUnmount () { }
31
+  getMyDraw () {
44
-
32
+    api.getMyDraw({ page_size: 100 })
45
-  componentDidShow () { }
33
+  }
46
-
34
+  getDrawIndex () {
47
-  componentDidHide () { }
35
+    api.getDrawIndex().then(res => {
48
-  toChat (e) {
36
+      if (res.code == 200) {
49
-    Taro.navigateTo({
37
+        this.setState({
50
-      url: `/pages/chat/index?title=${e.name}`
38
+          models: res.data.models,
39
+          imgSize: res.data.img_size,
40
+          sampling: res.data.Sampler
41
+        })
42
+      }
43
+    })
44
+  }
45
+  getRadomPrompt () {
46
+    api.getRadomPrompt().then(res => {
47
+      if (res.code == 200) {
48
+        this.setState({
49
+          value: res.data.prompt,
50
+          negativeValue: res.data.negative_prompt
51
+        })
52
+        document.getElementById('textarea-num').innerHTML = res.data.prompt.length + "/1000";
53
+        document.getElementById('negative_prompt').innerHTML = res.data.negative_prompt.length + "/1000";
54
+      }
55
+    })
56
+  }
57
+  onInput (e) {
58
+    console.log(e, 'e')
59
+    var num = e.detail.cursor;
60
+    document.getElementById('textarea-num').innerHTML = num + "/1000";
61
+  }
62
+  onBlur (e) {
63
+    this.setState({
64
+      value: e.detail.value
65
+    })
66
+    console.log(e, 'onBlur');
67
+  }
68
+  onInputNegative (e) {
69
+    console.log(e, 'e');
70
+    var num = e.detail.cursor;
71
+    document.getElementById('negative_prompt').innerHTML = num + "/1000";
72
+  }
73
+  onBlurNegative(e){
74
+    this.setState({
75
+      negativeValue: e.detail.value
76
+    })
77
+  }
78
+  changeOpen () {
79
+    this.setState({
80
+      isOpen: !this.state.isOpen
81
+    })
82
+  }
83
+  selectModel (item, index) {
84
+    this.setState({
85
+      modelIndex: index,
86
+      loraIndex: 0
87
+    })
88
+  }
89
+  subNum () {
90
+    if (this.state.drawNum <= 1) return
91
+    this.setState({
92
+      drawNum: this.state.drawNum - 1
93
+    })
94
+  }
95
+  addNum () {
96
+    if (this.state.drawNum >= 4) return
97
+    this.setState({
98
+      drawNum: this.state.drawNum + 1
99
+    })
100
+  }
101
+  changeMeasurement (item, index) {
102
+    this.setState({
103
+      sizeIndex: index
104
+    })
105
+  }
106
+  changeSampling (item, index) {
107
+    this.setState({
108
+      samplingIndex: index
51
     })
109
     })
52
   }
110
   }
111
+  changeLora (item, index) {
112
+    this.setState({
113
+      loraIndex: index
114
+    })
115
+  }
116
+  //生成图片
117
+  generatePictures () {
118
+    console.log('生成图片');
119
+    console.log();
120
+    setTimeout(() => {
121
+      if (this.state.value.length == 0) {
122
+        Taro.showToast({
123
+          title: `请填写绘画描述`,
124
+          icon: 'error',
125
+        });
126
+        return
127
+      }
128
+      let pramas = {
129
+        model_name: this.state.models[this.state.modelIndex].model_name,
130
+        file_name: this.state.models[this.state.modelIndex].lora_infos.length > 0 ? this.state.models[this.state.modelIndex].lora_infos[this.state.loraIndex].file_name : '',
131
+        img_size: this.state.imgSize[this.state.sizeIndex].name,
132
+        img_cnt: this.state.drawNum,
133
+        cfg_scale: this.state.sliderNum,
134
+        sampler: this.state.sampling[this.state.samplingIndex],
135
+        prompt: this.state.value,
136
+        negative_prompt: this.state.negativeValue
137
+      }
138
+      api.drawTxt2img(pramas).then(res => {
139
+        if (res.code == 200) {
140
+          Taro.navigateTo({
141
+            url: `/pages/darwDetail/index?task_id=${res.data.task_id}`
142
+          })
143
+        }
144
+      })
145
+    },1000)
146
+  }
147
+  toChat (e) {
148
+  }
53
 
149
 
54
   render () {
150
   render () {
55
     return (
151
     return (
56
       <View className='mine'>
152
       <View className='mine'>
57
-        <View className='food'>
153
+        {/* <View className='banner'>
154
+          <Image className='banner-image' src=''></Image>
155
+        </View> */}
156
+        <View className='draw-content'>
157
+          <View className='draw-brack'>
158
+            <View className='draw-tab'>
159
+              <View className='tab-text' style={'background: #0F84EC;color: #FFFFFF;'}>AI绘画</View>
160
+              <View className='tab-text'>人物头像</View>
161
+              <View className='tab-text'>风景头像</View>
162
+            </View>
163
+          </View>
164
+          <View className='draw-title'>绘画描述</View>
165
+          <View className='draw-text'>
166
+            <View className='recommend'>
167
+              <Image className='recommend-img' src='https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678934357612.png'></Image>
168
+              <View className='recommend-text' onClick={e => (this.getRadomPrompt())}>使用推荐词</View>
169
+            </View>
170
+            <Textarea
171
+              value={this.state.value}
172
+              className='draw-taxtarea'
173
+              placeholder='| 请输入相关描述,也可以输入关键词~'
174
+              showCount
175
+              onInput={e => (this.onInput(e))}
176
+              onBlur={e => (this.onBlur(e))}
177
+
178
+              maxlength='1000' />
179
+            <View className='textarea-num' id='textarea-num'>{this.state.value.length}/1000</View>
180
+          </View>
181
+          <View className='draw-title'>选择模型</View>
182
+          <View className='model-list'>
183
+            {
184
+              !this.state.isOpen ?
185
+                this.state.models.slice(0, 6).map((item, index) => (
186
+                  <View className='model-info'
187
+                    style={this.state.modelIndex == index ? `border: 2px solid #0F84EC; background:url(${item.img});background-size: 100% 100%;` : `background:url(${item.img});background-size: 100% 100%;`}
188
+                    key={index}
189
+                    onClick={e => (this.selectModel(item, index))}>
190
+                    <View className='model-info-bottom'>
191
+                      {item.name}
192
+                    </View>
193
+                  </View>
194
+                )) :
195
+                this.state.models.map((item, index) => (
196
+                  <View className='model-info'
197
+                    style={this.state.modelIndex == index ? `border: 2px solid #0F84EC; background:url(${item.img});background-size: 100% 100%;` : `background:url(${item.img});background-size: 100% 100%;`}
198
+                    key={index}
199
+                    onClick={e => (this.selectModel(item, index))}>
200
+                    <View className='model-info-bottom'>
201
+                      {item.name}
202
+                    </View>
203
+                  </View>
204
+                ))
205
+            }
206
+          </View>
207
+          <View className='isOpen'>
208
+            <View className='open-content' onClick={e => (this.changeOpen())}>
209
+              <View className='open-title'>{!this.state.isOpen ? '展开' : '收起'}</View>
210
+              <Image className='open-img' src={!this.state.isOpen ? 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678935050487.png' : 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678935114571.png'}></Image>
211
+            </View>
212
+          </View>
58
           {
213
           {
59
-            this.state.classList.map((item, index) => (
214
+            this.state.models[this.state.modelIndex] &&
60
-              <View className='food-info' key={index} onClick={e => (this.toChat(item))}>
215
+            this.state.models[this.state.modelIndex].lora_infos.length > 0 &&
61
-                <Image className='food-img' src={item.image}> </Image>
216
+            <View>
62
-                <View className='food-name'>{item.name}</View>
217
+              <View className='draw-title'>风格</View>
63
-                <View className='food-tips'>{item.tips}</View>
218
+              <View className='model-style-list'>
219
+                {
220
+                  this.state.models[this.state.modelIndex].lora_infos.map((item, index) => (
221
+                    <View className='model-style-info' key={index} style={this.state.loraIndex == index ? `border: 2px solid #0F84EC;background:url(${item.img});background-size: 100% 100%;` : `background:url(${item.img});background-size: 100% 100%;`} onClick={e => (this.changeLora(item, index))}>
222
+                      <View className='model-style-info-name'>{item.name}</View>
223
+                    </View>
224
+                  ))
225
+                }
226
+
64
               </View>
227
               </View>
65
-            ))
228
+            </View>
66
           }
229
           }
230
+          <View className='draw-title'>色彩丰富度</View>
231
+          <View className='components-page'>
232
+            <Slider style={'margin: 10px 0;'} showValue step={1} max={15} min={1} activeColor='#0F84EC' value={this.state.sliderNum} />
233
+          </View>
234
+          <View className='draw-title'>图片尺寸</View>
235
+          <View className='measurement-list'>
236
+            {
237
+              this.state.imgSize.map((item, index) => (
238
+                <View className='measurement-info' style={this.state.sizeIndex == index ? 'border: 2px solid #0F84EC;' : ''} key={index} onClick={e => (this.changeMeasurement(item, index))}>
239
+                  <Image className='measurement-img' src=''></Image>
240
+                  <View className='measurement-title'>{item.name}</View>
241
+                </View>
242
+              ))
243
+            }
244
+          </View>
245
+          <View className='draw-title'>生成数量</View>
246
+          <View className='draw-num'>
247
+            <View className='subtract' onClick={e => (this.subNum())}>-</View>
248
+            <View className='num'>{this.state.drawNum}</View>
249
+            <View className='add' onClick={e => (this.addNum())}>+</View>
250
+          </View>
251
+          <View className='draw-title'>图片质量</View>
252
+          <View className='draw-mass'>
253
+            <View className='mass-same'>一般</View>
254
+            <View className='mass-high'>高清</View>
255
+          </View>
256
+          <View className='draw-title'>采样方式</View>
257
+          <View className='draw-sampling'>
258
+            {
259
+              this.state.sampling.map((item, index) => (
260
+                <View className='sampling-same' style={this.state.samplingIndex == index ? 'border: 2px solid #0F84EC;' : ''} key={index} onClick={e => (this.changeSampling(item, index))}>{item}</View>
261
+              ))
262
+            }
263
+          </View>
264
+          <View className='draw-title'>绘画不要的元素</View>
265
+          <View className='draw-text'>
266
+            <Textarea
267
+              value={this.state.negativeValue}
268
+              className='draw-taxtarea'
269
+              placeholder='| 请输入相关描述,也可以输入关键词~'
270
+              showCount
271
+              onInput={e => (this.onInputNegative(e))}
272
+              onBlur={e => (this.onBlurNegative(e))}
273
+              maxlength='1000' />
274
+            <View className='textarea-num' id='negative_prompt'>{this.state.negativeValue.length}/1000</View>
275
+          </View>
276
+        </View>
277
+        <View className='generate-pictures' onClick={e => (this.generatePictures(e))} >
278
+          生成图片(消耗2积分)
67
         </View>
279
         </View>
68
       </View>
280
       </View>
69
     )
281
     )

+ 316 - 29
src/pages/index/index.less

@@ -1,37 +1,324 @@
1
-page {
2
-  background-color: #f2f2f2;
3
-  height: 100%;
4
-  padding: 0 auto;
5
-  margin: 0 auto;
6
-}
7
-
8
 .mine {
1
 .mine {
9
-  .food {
2
+  min-height: 100vh;
10
-    margin: 20px;
3
+  background-color: #041129;
11
-    display: flex;
4
+
12
-    justify-content: space-between;
5
+  .draw-content {
13
-    flex-wrap: wrap;
6
+    padding: 48px 30px;
14
-
7
+
15
-    .food-info {
8
+    .draw-brack {
16
-      width: 43%;
9
+      display: flex;
17
-      border-radius: 10px;
10
+      justify-content: center;
18
-      background-color: #FFFFFF;
11
+      margin-bottom: 10px;
19
-      margin: 10px;
12
+
20
-      padding: 10px;
13
+      .draw-tab {
21
-      box-shadow: 0px 0px 10px rgb(139, 138, 138);
14
+        width: 654px;
22
-
15
+        display: flex;
23
-      .food-img {
16
+        height: 64px;
24
-        width: 100px;
17
+        justify-content: space-around;
25
-        height: 100px;
18
+        border-radius: 16px;
26
-        border-radius: 50%;
19
+        background-color: rgba(255, 255, 255, .05);
20
+        font-family: PingFangSC-Regular;
21
+        font-size: 28px;
22
+        color: rgba(255, 255, 255, .5);
23
+        letter-spacing: 0;
24
+        text-align: center;
25
+
26
+        .tab-text {
27
+          height: 64px;
28
+          line-height: 64px;
29
+          flex: 1;
30
+        }
31
+
32
+        .tab-text:nth-child(1) {
33
+          border-radius: 8px 0 0 8px;
34
+        }
35
+
36
+        .tab-text:nth-child(3) {
37
+          border-radius: 0 8px 8px 0;
38
+        }
39
+      }
40
+    }
41
+
42
+    .draw-title {
43
+      margin-top: 48px;
44
+      font-family: PingFangSC-Regular;
45
+      font-size: 32px;
46
+      color: #FFFFFF;
47
+    }
48
+
49
+    .draw-text {
50
+      margin-top: 30px;
51
+      position: relative;
52
+
53
+      .recommend {
54
+        position: absolute;
55
+        right: 0;
56
+        top: -84px;
57
+        width: 222px;
58
+        height: 64px;
59
+        display: flex;
60
+        align-items: center;
61
+        border-radius: 16px;
62
+        justify-content: center;
63
+        background-color: rgba(255, 255, 255, .05);
64
+        color: rgba(255, 255, 255, .5);
65
+
66
+        .recommend-img {
67
+          width: 48px;
68
+          height: 48px;
69
+          display: block;
70
+        }
71
+
72
+        .recommend-text {
73
+          font-family: PingFangSC-Regular;
74
+          font-size: 24px;
75
+          letter-spacing: 0;
76
+          text-align: center;
77
+        }
78
+      }
79
+
80
+      .draw-taxtarea {
81
+        width: 642px;
82
+        background-color: rgba(255, 255, 255, .05);
83
+        color: rgba(255, 255, 255, .5);
84
+        min-height: 240px;
85
+        padding: 24rpx;
86
+      }
87
+
88
+      .textarea-num {
89
+        margin-top: 20px;
90
+        text-align: end;
91
+        color: rgba(255, 255, 255, .5);
92
+      }
93
+
94
+
95
+    }
96
+
97
+    .model-list {
98
+      margin-top: 20px;
99
+      display: flex;
100
+      flex-wrap: wrap;
101
+
102
+      .model-info {
103
+        position: relative;
104
+        background-size: 100% 100%;
105
+        margin-bottom: 16px;
106
+        width: 220px;
107
+        margin-left: 10px;
108
+        height: 220px;
109
+        display: block;
110
+        -webkit-box-sizing: border-box;
111
+        -moz-box-sizing: border-box;
112
+        box-sizing: border-box;
113
+
114
+        background-color: rgba(255, 255, 255, .05);
115
+        border-radius: 16px;
116
+
117
+        .model-info-bottom {
118
+          position: absolute;
119
+          bottom: 0;
120
+          left: 0;
121
+          width: 100%;
122
+          font-size: 32px;
123
+          background-color: rgba(0, 0, 0, 0.4);
124
+          ;
125
+          color: #FFFFFF;
126
+          text-align: center;
127
+        }
27
       }
128
       }
28
-      .food-name{
129
+    }
29
-        font-size: 32px;
130
+
131
+    .isOpen {
132
+      display: flex;
133
+      justify-content: center;
134
+
135
+      .open-content {
136
+        width: 174px;
137
+        height: 80px;
138
+        background-color: rgba(255, 255, 255, .05);
139
+        border-radius: 16px;
140
+        display: flex;
141
+        justify-content: center;
142
+        align-items: center;
143
+
144
+        .open-title {
145
+          font-family: PingFangSC-Regular;
146
+          font-size: 32px;
147
+          color: #0F84EC;
148
+          letter-spacing: 0;
149
+          text-align: center;
150
+        }
151
+
152
+        .open-img {
153
+          width: 40px;
154
+          height: 40px;
155
+          margin-left: 5px;
156
+          display: block;
157
+        }
158
+      }
159
+    }
160
+
161
+    .model-style-list {
162
+      margin-top: 20px;
163
+      display: flex;
164
+      flex-wrap: wrap;
165
+
166
+      .model-style-info {
167
+        position: relative;
168
+        margin-top: 10px;
169
+        margin-left: 14rpx;
170
+        width: 160px;
171
+        height: 160px;
172
+        -webkit-box-sizing: border-box;
173
+        -moz-box-sizing: border-box;
174
+        box-sizing: border-box;
175
+        display: block;
176
+        background-color: rgba(255, 255, 255, .05);
177
+        border-radius: 16px;
30
       }
178
       }
31
-      .food-tips{
179
+
180
+      .model-style-info-name {
181
+        position: absolute;
182
+        bottom: 0;
183
+        left: 0;
184
+        width: 100%;
32
         font-size: 28px;
185
         font-size: 28px;
33
-        color: #656363;
186
+        background-color: rgba(0, 0, 0, 0.4);
187
+        ;
188
+        color: #FFFFFF;
189
+        text-align: center;
190
+      }
191
+    }
192
+
193
+    .components-page {
194
+      margin-top: 40px;
195
+    }
196
+
197
+    .measurement-list {
198
+      margin-top: 20px;
199
+      display: flex;
200
+      flex-wrap: wrap;
201
+
202
+      .measurement-info {
203
+        margin: 0 20px;
204
+        width: 116px;
205
+        height: 116px;
206
+        background-color: rgba(255, 255, 255, .05);
207
+        border-radius: 16px;
208
+      }
209
+
210
+      .measurement-img {
211
+        width: 100px;
212
+        height: 60px;
213
+      }
214
+
215
+      .measurement-title {
216
+        text-align: center;
217
+        font-family: PingFangSC-Regular;
218
+        font-size: 20px;
219
+        color: #0F84EC;
220
+      }
221
+    }
222
+
223
+    .draw-num {
224
+      margin-top: 20px;
225
+      display: flex;
226
+      font-family: PingFangSC-Regular;
227
+      font-size: 32px;
228
+      color: #FFFFFF;
229
+
230
+      .subtract {
231
+        width: 102px;
232
+        height: 80px;
233
+        line-height: 80px;
234
+        text-align: center;
235
+        background-color: rgba(255, 255, 255, .05);
236
+        border-radius: 16px;
237
+      }
238
+
239
+      .num {
240
+        margin: 0 8px;
241
+        width: 102px;
242
+        height: 80px;
243
+        line-height: 80px;
244
+        text-align: center;
245
+      }
246
+
247
+      .add {
248
+        width: 102px;
249
+        height: 80px;
250
+        line-height: 80px;
251
+        text-align: center;
252
+        background-color: rgba(255, 255, 255, .05);
253
+        border-radius: 16px;
254
+      }
255
+    }
256
+
257
+    .draw-mass {
258
+      margin-top: 20px;
259
+      display: flex;
260
+      opacity: 0.5;
261
+      font-family: PingFangSC-Regular;
262
+      font-size: 28px;
263
+      color: rgba(255, 255, 255, .5);
264
+
265
+      .mass-same {
266
+        width: 150px;
267
+        height: 80px;
268
+        line-height: 80px;
269
+        text-align: center;
270
+        background-color: rgba(255, 255, 255, .05);
271
+        border-radius: 16px;
272
+      }
273
+
274
+      .mass-high {
275
+        width: 150px;
276
+        height: 80px;
277
+        line-height: 80px;
278
+        text-align: center;
279
+        background-color: rgba(255, 255, 255, .05);
280
+        border-radius: 16px;
281
+        margin-left: 24px;
34
       }
282
       }
35
     }
283
     }
284
+
285
+    .draw-sampling {
286
+      margin-top: 20px;
287
+      display: flex;
288
+      flex-wrap: wrap;
289
+      font-family: PingFangSC-Regular;
290
+      font-size: 28px;
291
+      color: rgba(255, 255, 255, .5);
292
+
293
+      .sampling-same {
294
+
295
+        margin-top: 20px;
296
+        margin-right: 20px;
297
+        padding: 0 40px;
298
+        height: 80px;
299
+        line-height: 80px;
300
+        text-align: center;
301
+        background-color: rgba(255, 255, 255, .05);
302
+        border-radius: 16px;
303
+      }
304
+
305
+    }
306
+  }
307
+
308
+  .generate-pictures {
309
+    width: 382px;
310
+    height: 96px;
311
+    border-radius: 96px;
312
+    line-height: 96px;
313
+    text-align: center;
314
+    position: fixed;
315
+    bottom: 40px;
316
+    left: 50%;
317
+    z-index: 1000;
318
+    transform: translateX(-50%);
319
+    background-image: linear-gradient(-49deg, #5D81FF 0%, #0F84EC 100%);
320
+    font-family: PingFangSC-Regular;
321
+    font-size: 28px;
322
+    color: #FFFFFF;
36
   }
323
   }
37
 }
324
 }

+ 1 - 1
src/pages/mine/index.config.js

@@ -1,3 +1,3 @@
1
 export default definePageConfig({
1
 export default definePageConfig({
2
-  navigationBarTitleText: '首页'
2
+  navigationBarTitleText: '我的'
3
 })
3
 })

+ 89 - 41
src/pages/mine/index.jsx

@@ -1,60 +1,108 @@
1
 import { Component } from 'react'
1
 import { Component } from 'react'
2
 import { View, Text, Button, Image, scrollView, Input } from '@tarojs/components'
2
 import { View, Text, Button, Image, scrollView, Input } from '@tarojs/components'
3
+import Taro, { } from '@tarojs/taro'
4
+import tool from '../../common/tool'
5
+import * as api from '../../service/index'
3
 import './index.less'
6
 import './index.less'
4
 
7
 
5
 export default class Mine extends Component {
8
 export default class Mine extends Component {
6
 
9
 
7
   state = {
10
   state = {
8
-    classList: [
11
+    userInfo: {},
9
-      {
12
+    type: 0,
10
-        name: '美食家',
13
+    infos: [],
11
-        tips: '你想吃的美食我都会做哟',
14
+    total: 20,
12
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
15
+    page: 1,
13
-      },
16
+    page_size: 20,
14
-      {
15
-        name: '美食家',
16
-        tips: '你想吃的美食我都会做哟',
17
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
18
-      },
19
-      {
20
-        name: '美食家',
21
-        tips: '你想吃的美食我都会做哟',
22
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
23
-      },
24
-      {
25
-        name: '美食家',
26
-        tips: '你想吃的美食我都会做哟',
27
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
28
-      },
29
-      {
30
-        name: '美食家',
31
-        tips: '你想吃的美食我都会做哟',
32
-        image: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/total_picture/1678353807082.png',
33
-      },
34
-    ]
35
   }
17
   }
36
 
18
 
37
-  componentWillMount () { }
19
+  componentDidShow () {
20
+    this.getUserInfo()
21
+    this.getMyDraw(1)
22
+  }
23
+  getUserInfo () {
24
+    api.getUserInfo().then(res => {
25
+      if (res.code == 200) {
26
+        this.setState({
27
+          userInfo: res.data
28
+        })
29
+      }
30
+    })
31
+  }
32
+  getMyDraw (page) {
33
+    let params = {
34
+      page: page,
35
+      page_size: this.state.page_size,
36
+    }
37
+    api.getMyDraw(params).then(res => {
38
+      if (res.code == 200) {
39
+        let infos = this.state.infos.concat(res.data.infos)
40
+        this.setState({
41
+          infos: infos,
42
+          total: res.data.total
43
+        })
44
+      }
45
+    })
46
+  }
47
+  onReachBottom () {
48
+    if (this.state.infos.length < this.state.total) {
49
+      this.setState({
50
+        page: this.state.page + 1
51
+      })
52
+      this.getMyDraw(this.state.page + 1)
53
+    }
54
+    console.log('onReachBottom()');
55
+  }
56
+  changeType (index) {
57
+    this.setState({
58
+      type: index
59
+    })
60
+  }
61
+  toDetail(item){
62
+    Taro.navigateTo({
63
+      url: `/pages/darwDetail/index?task_id=${item.task_id}`
64
+    })
65
+  }
38
 
66
 
39
   componentDidMount () { }
67
   componentDidMount () { }
40
 
68
 
41
-  componentWillUnmount () { }
42
-
43
-  componentDidShow () { }
44
-
45
-  componentDidHide () { }
46
-
47
   render () {
69
   render () {
48
     return (
70
     return (
49
       <View className='mine'>
71
       <View className='mine'>
50
-        <View className='food'>
72
+        <View className='user-info'>
51
-          {
73
+          <View className='user-top'>
52
-            this.state.classList.map((item, index) => (
74
+            <Image className='user-img' src={this.state.userInfo.head_img}></Image>
53
-              <View className='food-info'>
75
+            <View className='user-info-text'>
54
-                
76
+              <View className='info-top'>
77
+                <View className='user-name'>{this.state.userInfo.user_name}</View>
55
               </View>
78
               </View>
56
-            ))
79
+              <View className='info-bottom'>
57
-          }
80
+                <View className='integral'>积分:~</View>
81
+              </View>
82
+            </View>
83
+          </View>
84
+          <View className='get-integral'>
85
+            <View className='inte-button'>获取积分</View>
86
+          </View>
87
+        </View>
88
+        <View className='type'>
89
+          <View className='type-content'>
90
+            <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>
91
+            <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>
92
+          </View>
93
+        </View>
94
+        <View className='work-list'>
95
+          <View className='work-num'>作品数量:{this.state.total}/1000</View>
96
+          <View className='work-list-info' >
97
+            {
98
+              this.state.infos.map((item, index) => (
99
+                <View className='work-info' key={index} onClick={e=>(this.toDetail(item))}>
100
+                  <Image className='work-img' mode='widthFix' src={item.img}></Image>
101
+                  <View className='work-name'>{tool.ellipsis(item.img_info, 20)}</View>
102
+                </View>
103
+              ))
104
+            }
105
+          </View>
58
         </View>
106
         </View>
59
       </View>
107
       </View>
60
     )
108
     )

+ 128 - 9
src/pages/mine/index.less

@@ -1,14 +1,133 @@
1
 .mine {
1
 .mine {
2
-  .food {
2
+  min-height: 100vh;
3
-    margin: 20px;
3
+  background-color: #041129;
4
+  padding-bottom: 120px;
5
+
6
+  .user-info {
7
+    height: 326px;
8
+    background: #0F1A2F;
9
+    border-radius: 28px 28px 0 0;
10
+    padding: 30px;
11
+
12
+    .user-top {
13
+      display: flex;
14
+      align-items: center;
15
+
16
+      .user-img {
17
+        width: 120px;
18
+        height: 120px;
19
+        border-radius: 50%;
20
+      }
21
+
22
+      .user-info-text {
23
+        margin-left: 16px;
24
+        flex: 1;
25
+
26
+        .info-top {
27
+          .user-name {
28
+            font-family: PingFangSC-Medium;
29
+            font-size: 32px;
30
+            color: #FFFFFF;
31
+          }
32
+        }
33
+
34
+        .info-bottom {
35
+          display: flex;
36
+
37
+          .integral {
38
+            font-family: PingFangSC-Regular;
39
+            font-size: 28px;
40
+            color: #FFFFFF;
41
+          }
42
+        }
43
+      }
44
+    }
45
+
46
+    .get-integral {
47
+      margin-top: 66px;
48
+      display: flex;
49
+      justify-content: center;
50
+
51
+      .inte-button {
52
+        width: 216px;
53
+        height: 80px;
54
+        line-height: 80px;
55
+        border: 2px solid #1489ED;
56
+        font-family: PingFangSC-Regular;
57
+        font-size: 32px;
58
+        color: #C6C6C6;
59
+        text-align: center;
60
+
61
+      }
62
+    }
63
+  }
64
+
65
+  .type {
66
+    margin-top: 48px;
4
     display: flex;
67
     display: flex;
5
-    justify-content: space-around;
68
+    justify-content: center;
6
-    .food-info{
69
+
7
-      width: 40%;
70
+    .type-content {
8
-      border-radius: 10px;
71
+      display: flex;
9
-      background-color: #FFFFFF;
72
+      background: #0F1A2F;
10
-      padding: 10px;
73
+      font-family: PingFangSC-Regular;
11
-      box-shadow:0px 0px 5px rgb(139, 138, 138) ;
74
+      font-size: 28px;
75
+      color: rgba(255, 255, 255, .5);
76
+      letter-spacing: 0;
77
+      border-radius: 8px;
78
+
79
+      .works {
80
+
81
+        width: 218px;
82
+        height: 64px;
83
+        line-height: 64px;
84
+        text-align: center;
85
+        border-radius: 8px 0 0 8px;
86
+      }
87
+
88
+      .like {
89
+        border-radius: 0 8px 8px 0;
90
+        width: 218px;
91
+        height: 64px;
92
+        line-height: 64px;
93
+        text-align: center;
94
+      }
95
+    }
96
+  }
97
+
98
+  .work-list {
99
+    margin-top: 70px;
100
+    padding: 0 30px;
101
+
102
+    .work-num {
103
+      font-family: PingFangSC-Regular;
104
+      font-size: 32px;
105
+      color: #FFFFFF;
106
+    }
107
+    .work-list-info{
108
+      margin-top: 40px;
109
+      display: flex;
110
+      flex-wrap: wrap;
111
+      justify-content: space-between;
112
+      .work-info{
113
+        position: relative;
114
+        margin-top: 10px;
115
+        width: 45%;
116
+        .work-img{
117
+          width: 100%;
118
+        }
119
+        .work-name{
120
+          position: absolute;
121
+          bottom: 0;
122
+          left: 0;
123
+          width: 100%;
124
+          font-size: 32rpx;
125
+          background-color: rgba(0, 0, 0, 0.4);
126
+          color: #FFFFFF;
127
+          text-align: center;
128
+
129
+        }
130
+      }
12
     }
131
     }
13
   }
132
   }
14
 }
133
 }

+ 0 - 3
src/pages/task/index.config.js

@@ -1,3 +0,0 @@
1
-export default definePageConfig({
2
-  navigationBarTitleText: '首页'
3
-})

+ 0 - 24
src/pages/task/index.jsx

@@ -1,24 +0,0 @@
1
-import { Component } from 'react'
2
-import { View, Text, Button, Image, scrollView, Input } from '@tarojs/components'
3
-import './index.less'
4
-
5
-export default class Task extends Component {
6
-
7
-  componentWillMount() { }
8
-
9
-  componentDidMount() { }
10
-
11
-  componentWillUnmount() { }
12
-
13
-  componentDidShow() { }
14
-
15
-  componentDidHide() { }
16
-
17
-  render() {
18
-    return (
19
-      <View>
20
-        task
21
-      </View>
22
-    )
23
-  }
24
-}

+ 0 - 379
src/pages/task/index.less

@@ -1,379 +0,0 @@
1
-page {
2
-  background-color: #f2f2f2;
3
-  height: 100%;
4
-  padding: 0 auto;
5
-  margin: 0 auto;
6
-}
7
-.login{
8
-  z-index: 999;
9
-  position: fixed;
10
-  top: 300rpx;
11
-  height: 100rpx;
12
-  text-align: center;
13
-  line-height: 100rpx;
14
-  width: 400rpx;
15
-  left: 50%;
16
-  margin-left: -200rpx;
17
-  background: white;
18
-}
19
-.Phone{
20
-  top: 500rpx;
21
-  width: 400rpx;
22
-}
23
-.login_zz{
24
-  position: fixed;
25
-  left: 0;
26
-  top: 0;
27
-  width: 100%;
28
-  height: 100%;
29
-  z-index: 998;
30
-  
31
-background-color: rgba(0,0,0,0.5);
32
-}
33
-swiper {
34
-  height: 180rpx;
35
-}
36
- 
37
-swiper swiper-item .slide-image {
38
-  width: 100%;
39
-  height: 180rpx;
40
-}
41
- 
42
-.jia_img {
43
-  height: 80rpx;
44
-  width: 90rpx;
45
-}
46
- 
47
-.time {
48
-  text-align: center;
49
-  padding: 5rpx 20rpx 5rpx 20rpx;
50
-  border-radius: 10rpx;
51
-  display: block;
52
-  height: 38rpx;
53
-  line-height: 38rpx;
54
-  position: relative;
55
-  margin: 0 auto;
56
-  margin-bottom: 20rpx;
57
-  width: 90rpx;
58
-  color: white;
59
-  font-size: 26rpx;
60
-  background-color: #dedede;
61
-}
62
- 
63
-.tab {
64
-  bottom: 120rpx;
65
-}
66
- 
67
-.tab_1 {
68
-  position: fixed;
69
-  bottom: 50rpx;
70
-  width: 200rpx;
71
-  font-size: 26rpx;
72
-  left: 50%;
73
-  margin-left: -45rpx;
74
-  height: 100rpx;
75
-}
76
- 
77
-.tab_2 {
78
-  right: 30rpx;
79
-  position: fixed;
80
-}
81
- 
82
-/* 聊天 */
83
- 
84
-.my_right {
85
-  float: right;
86
-  margin-top: 30rpx;
87
-  position: relative;
88
-}
89
- 
90
-.my_audio {
91
-  height: 60rpx;
92
-  width: 60rpx;
93
-  z-index: 2;
94
-  position: relative;
95
-  top: 10rpx;
96
-  left: 20rpx;
97
-}
98
- 
99
-.you_left {
100
-  margin-top: 30rpx;
101
-  float: left;
102
-  position: relative;
103
-  padding-left: 5rpx;
104
-}
105
- 
106
-.new_img {
107
-  width: 85rpx;
108
-  height: 85rpx;
109
-  overflow: hidden;
110
-}
111
- 
112
-.page_r {
113
-  float: right;
114
-}
115
- 
116
-.new_txt {
117
-  min-width: 380rpx;
118
-  width: 460rpx;
119
-  word-break: break-all;
120
-}
121
- 
122
-.new_txt_my {
123
-  border-radius: 7rpx;
124
-  background: #9fe75a;
125
-  position: relative;
126
-  right: 30rpx;
127
-  padding: 17rpx 30rpx 17rpx 30rpx;
128
-  float: right;
129
-  border: 1px solid #d0d0d0;
130
-}
131
- 
132
-.new_txt_my .arrow {
133
-  position: absolute;
134
-  z-index: 2;
135
-  width: 40rpx;
136
-  right: -38rpx;
137
-}
138
- 
139
-.new_txt_my .arrow em {
140
-  position: absolute;
141
-  border-style: solid;
142
-  border-width: 15rpx;
143
-  border-color: transparent transparent transparent #d0d0d0;
144
-  top: 1rpx;
145
-}
146
- 
147
-.new_txt_my .arrow span {
148
-  position: absolute;
149
-  top: 5rpx;
150
-  border-style: solid;
151
-  border-width: 15rpx;
152
-  border-color: transparent transparent transparent #9fe75a;
153
-}
154
- 
155
-.new_txt_my_2 {
156
-  word-break: break-all;
157
-  border-radius: 7rpx;
158
-  background: #9fe75a;
159
-  min-width: 330rpx;
160
-  max-width: 530rpx;
161
-  padding: 17rpx 30rpx 17rpx 30rpx;
162
-  float: right;
163
-}
164
- 
165
-.new_txt_ai {
166
-  border-radius: 7rpx;
167
-  left: 20rpx;
168
-  background-color: #fff;
169
-  position: relative;
170
-  border: 1px solid #d0d0d0;
171
-  float: left;
172
-}
173
- 
174
-.new_txt_ai .arrow {
175
-  position: relative;
176
-  width: 40rpx;
177
-  left: -30rpx;
178
-}
179
- 
180
-.new_txt_ai .arrow em {
181
-  position: absolute;
182
-  border-style: solid;
183
-  border-width: 15rpx;
184
-  top: 20rpx;
185
-  border-color: transparent #d0d0d0 transparent transparent;
186
-}
187
- 
188
-.new_txt_ai .arrow span {
189
-  position: absolute;
190
-  top: 20rpx;
191
-  border-style: solid;
192
-  border-width: 15rpx;
193
-  border-color: transparent #fff transparent transparent;
194
-  left: 2rpx;
195
-}
196
- 
197
-.ai_content {
198
-  word-break: break-all;
199
-  padding: 17rpx 30rpx 17rpx 30rpx;
200
-}
201
- 
202
-.sanjiao {
203
-  top: 25rpx;
204
-  position: relative;
205
-  width: 0px;
206
-  height: 0px;
207
-  border-width: 15rpx;
208
-  border-style: solid;
209
-}
210
- 
211
-.my {
212
-  border-color: transparent transparent transparent #9fe75a;
213
-}
214
- 
215
-.you {
216
-  border-color: transparent #fff transparent transparent;
217
-}
218
- 
219
-._span {
220
-  border-color: #fff transparent transparent;
221
-  top: -17px;
222
-}
223
- 
224
-.is_ai_btn {
225
-  border-radius: 0 0 7px 7px;
226
-  border-top: 1px solid #d0d0d0;
227
-  background: white;
228
-  position: relative;
229
-  bottom: 0;
230
-  left: 0;
231
-  width: 100%;
232
-  height: 80rpx;
233
-  line-height: 80rpx;
234
-  display: flex;
235
-  flex-direction: row;
236
-  text-align: center;
237
-}
238
- 
239
-.is_ai_btn view {
240
-  width: 50%;
241
-}
242
- 
243
-.is_ai_btn image {
244
-  width: 32rpx;
245
-  position: relative;
246
-  top: 4rpx;
247
-  height: 32rpx;
248
-}
249
- 
250
-.is_ai_btn .two {
251
-  border-left: 1px solid #d0d0d0;
252
-}
253
- 
254
-.yes_problem_log {
255
-  border-top: 1px solid #d0d0d0;
256
-  height: 80rpx;
257
-  text-align: center;
258
-  line-height: 80rpx;
259
-}
260
- 
261
-.voice_icon {
262
-  width: 60rpx;
263
-  height: 60rpx;
264
-  margin: 0 auto;
265
-  padding: 10rpx 10rpx 10rpx 10rpx;
266
-}
267
- 
268
-.add_icon {
269
-  width: 70rpx;
270
-  height: 70rpx;
271
-  margin: 0 auto;
272
-  padding: 20rpx 10rpx 10rpx 15rpx;
273
-}
274
- 
275
-.voice_ing {
276
-  width: 90%;
277
-  height: 75rpx;
278
-  line-height: 85rpx;
279
-  text-align: center;
280
-  border-radius: 15rpx;
281
-  border: 1px solid #d0d0d0;
282
-}
283
- 
284
-.zezhao {
285
-  height: 100%;
286
-  position: absolute;
287
-  top: 0;
288
-  left: 0;
289
-  z-index: 2;
290
-  width: 100%;
291
-  background: rgba(0, 0, 0, 0.5);
292
-}
293
- 
294
-.in_voice_icon {
295
-  z-index: 3;
296
-  left: 0;
297
-  bottom: 0;
298
-  width: 100%;
299
-  position: absolute;
300
-  height: 500rpx;
301
-  background: #f8f8f8;
302
-}
303
- 
304
-.in_voice_icon .item {
305
-  position: relative;
306
-  margin-top: 50rpx;
307
-  margin-left: 50rpx;
308
-  text-align: center;
309
-  width: 140rpx;
310
-}
311
- 
312
-.in_voice_icon .img {
313
-  width: 80rpx;
314
-  height: 80rpx;
315
-  border-radius: 15rpx;
316
-}
317
- 
318
-.in_voice_icon .text {
319
-  font-size: 32rpx;
320
-  margin-top: 20rpx;
321
-}
322
- 
323
-.sendmessage {
324
-  width: 100%;
325
-  z-index: 2;
326
-  display: flex;
327
-  position: fixed;
328
-  bottom: 0px;
329
-  background-color: #f8f8f8;
330
-  flex-direction: row;
331
-  height: 100rpx;
332
-}
333
- 
334
-.sendmessage input {
335
-  width: 78%;
336
-  height: 80rpx;
337
-  line-height: 80rpx;
338
-  font-size: 28rpx;
339
-  margin-top: 10rpx;
340
-  margin-left: 20rpx;
341
-  border-bottom: 1px solid #d0d0d0;
342
-  padding-left: 20rpx;
343
-}
344
- 
345
-.sendmessage button {
346
-  border: 1px solid white;
347
-  width: 18%;
348
-  height: 80rpx;
349
-  background: #0c0;
350
-  color: white;
351
-  line-height: 80rpx;
352
-  margin-top: 10rpx;
353
-  font-size: 28rpx;
354
-}
355
- 
356
-.hei {
357
-  height: 20rpx;
358
-}
359
- 
360
-.history {
361
-  height: 88%;
362
-  display: flex;
363
-  font-size: 14px;
364
-  line-height: 50rpx;
365
-  position: relative;
366
-  top: 20rpx;
367
-}
368
- 
369
-.icno_kf {
370
-  position: fixed;
371
-  bottom: 160rpx;
372
-  margin: 0 auto;
373
-  text-align: center;
374
-  left: 50%;
375
-  margin-left: -40rpx;
376
-  width: 100rpx;
377
-  height: 100rpx;
378
-  border-radius: 50%;
379
-}

+ 44 - 4
src/service/index.js

@@ -1,13 +1,53 @@
1
 //首页js接口
1
 //首页js接口
2
 import Request from '../api/request';
2
 import Request from '../api/request';
3
 
3
 
4
-
5
-
6
 //获取机器人的回答
4
 //获取机器人的回答
7
-export const getAsk = data =>
5
+export const login = data =>
8
   Request({
6
   Request({
9
-    url: '/api/ask',
7
+    url: '/api/login',
10
     method: 'POST',
8
     method: 'POST',
11
     data,
9
     data,
12
   });
10
   });
13
 
11
 
12
+//获取绘画数据
13
+export const getDrawIndex = data =>
14
+  Request({
15
+    url: '/api/get_draw_index',
16
+    method: 'POST',
17
+    data,
18
+  });
19
+//获取绘画描述
20
+export const getRadomPrompt = data =>
21
+  Request({
22
+    url: '/api/get_radom_prompt',
23
+    method: 'POST',
24
+    data,
25
+  });
26
+//画图
27
+export const drawTxt2img = data =>
28
+  Request({
29
+    url: '/api/draw_txt2img',
30
+    method: 'POST',
31
+    data,
32
+  });
33
+//获取我的作品
34
+export const getMyDraw = data =>
35
+  Request({
36
+    url: '/api/get_my_draw',
37
+    method: 'POST',
38
+    data,
39
+  });
40
+//获取画图详情页
41
+export const getDrawTaskStatus = data =>
42
+  Request({
43
+    url: '/api/get_draw_task_status',
44
+    method: 'POST',
45
+    data,
46
+  });
47
+//获取画图详情页
48
+export const getUserInfo = data =>
49
+  Request({
50
+    url: '/api/get_user_info',
51
+    method: 'POST',
52
+    data,
53
+  });