张涛 1 år sedan
förälder
incheckning
a76c372bfc

Binär
.swc/plugins/v7_windows_x86_64_0.104.8/650403a8464e272c42781043014b0c4a7852b23c2ea43daf240d37a42b026a56 Visa fil


+ 3
- 1
babel.config.js Visa fil

@@ -4,7 +4,9 @@ module.exports = {
4 4
   presets: [
5 5
     ['taro', {
6 6
       framework: 'react',
7
-      ts: false
7
+      ts: false,
8
+      // hot:false,
9
+      // 'dynamic-import-node': true,
8 10
     }]
9 11
   ],
10 12
   plugins: [

+ 1
- 0
config/dev.js Visa fil

@@ -10,6 +10,7 @@ module.exports = {
10 10
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
11 11
     VERSION: '"1.1.13-20230325"',
12 12
   },
13
+  // isWatch:true,
13 14
   mini: {},
14 15
   h5: {},
15 16
 };

+ 99
- 54
config/index.js Visa fil

@@ -1,59 +1,104 @@
1
-const path = require('path');
1
+import { defineConfig } from "@tarojs/cli";
2 2
 
3
-const config = {
4
-  projectName: 'civilized-miniapp',
5
-  date: '2022-12-12',
6
-  designWidth: 750,
7
-  deviceRatio: {
8
-    640: 2.34 / 2,
9
-    750: 1,
10
-    828: 1.81 / 2
11
-  },
12
-  sourceRoot: 'src',
13
-  outputRoot: 'dist',
14
-  plugins: [],
15
-  defineConstants: {
16
-  },
17
-  copy: {
18
-    patterns: [
19
-      { from: 'src/assets/tabbar/', to: 'dist/assets/tabbar/' },
20
-    ],
21
-    options: {
22
-    }
23
-  },
24
-  framework: 'react',
25
-  compiler: 'webpack4',
26
-  alias: {
27
-    '@': path.resolve(__dirname, '..', 'src'),
28
-  },
29
-  mini: {
30
-    postcss: {
31
-      pxtransform: {
32
-        enable: true,
33
-        config: {
3
+const path = require("path");
34 4
 
35
-        }
5
+import devConfig from "./dev";
6
+import prodConfig from "./prod";
7
+
8
+export default defineConfig(async (merge, { command, mode }) => {
9
+  const config = {
10
+    projectName: "civilized-miniapp",
11
+    date: "2024-03-21",
12
+    designWidth: 750,
13
+    deviceRatio: {
14
+      640: 2.34 / 2,
15
+      750: 1,
16
+      828: 1.81 / 2,
17
+    },
18
+
19
+    sourceRoot: "src",
20
+    outputRoot: "dist",
21
+    plugins: [],
22
+    defineConstants: {},
23
+    copy: {
24
+      patterns: [{ from: "src/assets/tabbar/", to: "dist/assets/tabbar/" }],
25
+      options: {},
26
+    },
27
+    framework: "react",
28
+    compiler: "webpack4",
29
+    alias: {
30
+      "@": path.resolve(__dirname, "..", "src"),
31
+    },
32
+  
33
+    mini: {
34
+      postcss: {
35
+        pxtransform: {
36
+          enable: true,
37
+          config: {},
38
+        },
39
+        url: {
40
+          enable: true,
41
+          config: {
42
+            limit: 1024, // 设定转换尺寸上限
43
+          },
44
+        },
45
+        cssModules: {
46
+          enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
47
+          config: {
48
+            namingPattern: "module", // 转换模式,取值为 global/module
49
+            generateScopedName: "[name]__[local]___[hash:base64:5]",
50
+          },
51
+        },
36 52
       },
37
-      url: {
38
-        enable: true,
39
-        config: {
40
-          limit: 1024 // 设定转换尺寸上限
41
-        }
53
+    },
54
+    h5: {
55
+      publicPath: "/",
56
+      staticDirectory: "static",
57
+      outputDir: 'dist',
58
+      router : {
59
+        mode : "hash",
60
+        // base : "./"
42 61
       },
43
-      cssModules: {
44
-        enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
45
-        config: {
46
-          namingPattern: 'module', // 转换模式,取值为 global/module
47
-          generateScopedName: '[name]__[local]___[hash:base64:5]'
48
-        }
49
-      }
50
-    }
51
-  },
52
-}
53
-
54
-module.exports = function (merge) {
55
-  if (process.env.NODE_ENV === 'development') {
56
-    return merge({}, config, require('./dev'))
62
+      // output: {
63
+      //   filename: "js/[name].[hash:8].js",
64
+      //   chunkFilename: "js/[name].[chunkhash:8].js",
65
+      // },
66
+      miniCssExtractPluginOption: {
67
+        ignoreOrder: true,
68
+        filename: "css/[name].[hash].css",
69
+        chunkFilename: "css/[name].[chunkhash].css",
70
+      },
71
+      postcss: {
72
+        autoprefixer: {
73
+          enable: true,
74
+          config: {},
75
+        },
76
+        cssModules: {
77
+          enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
78
+          config: {
79
+            namingPattern: "module", // 转换模式,取值为 global/module
80
+            generateScopedName: "[name]__[local]___[hash:base64:5]",
81
+          },
82
+        },
83
+      },
84
+      // devServer: {
85
+      //   host: "0.0.0.0",
86
+      //   // port: ,
87
+      //   proxy: {
88
+      //     "/api": {
89
+      //       target: "http://127.0.0.1:9087", // 服务端地址
90
+      //       pathRewrite: {
91
+      //         '/api': ''
92
+      //       },
93
+      //       changeOrigin: true,
94
+      //     },
95
+      //   },
96
+      // },
97
+    },
98
+ 
99
+  };
100
+  if (process.env.NODE_ENV === "development") {
101
+    return merge({}, config, devConfig);
57 102
   }
58
-  return merge({}, config, require('./prod'))
59
-}
103
+  return merge({}, config, prodConfig);
104
+});

+ 26
- 20
config/prod.js Visa fil

@@ -1,13 +1,13 @@
1 1
 module.exports = {
2 2
   env: {
3
-    NODE_ENV: '"production"'
3
+    NODE_ENV: '"production"',
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"http://192.168.89.147:9087"',
7
-    // HOST: '"https://wmcj.huoshannews.com"',
6
+    // HOST: '"http://192.168.89.147:9087"',
7
+    HOST: '"https://wmcj.huoshannews.com"',
8 8
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9 9
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
10
-    VERSION: '"1.1.27-20230612"',
10
+    VERSION: '"1.1.29-20240224"',
11 11
   },
12 12
   mini: {},
13 13
   h5: {
@@ -15,28 +15,34 @@ module.exports = {
15 15
      * WebpackChain 插件配置
16 16
      * @docs https://github.com/neutrinojs/webpack-chain
17 17
      */
18
-    webpackChain (chain) {
18
+    // webpackChain(chain) {
19 19
       /**
20 20
        * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
21 21
        * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
22 22
        */
23
-      chain.plugin('analyzer')
24
-        .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
23
+      // chain
24
+      //   .plugin("analyzer")
25
+      //   .use(require("webpack-bundle-analyzer").BundleAnalyzerPlugin, []);
25 26
 
26 27
       /**
27 28
        * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
28 29
        * @docs https://github.com/chrisvfritz/prerender-spa-plugin
29 30
        */
30
-      const path = require('path')
31
-      const Prerender = require('prerender-spa-plugin')
32
-      const staticDir = path.join(__dirname, '..', 'dist')
33
-      chain
34
-        .plugin('prerender')
35
-        .use(new Prerender({
36
-          staticDir,
37
-          routes: [ '/pages/index/index' ],
38
-          postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
39
-        }))
40
-    }
41
-  }
42
-}
31
+      // const path = require("path");
32
+      // const Prerender = require("prerender-spa-plugin");
33
+      // const staticDir = path.join(__dirname, "..", "dist");
34
+      // chain.plugin("prerender").use(
35
+      //   new Prerender({
36
+      //     staticDir,
37
+      //     routes: ["/pages/index/index"],
38
+      //     postProcess: (context) => ({
39
+      //       ...context,
40
+      //       outputPath: path.join(staticDir, "index.html"),
41
+      //     }),
42
+      //   })
43
+      // );
44
+    },
45
+  // },
46
+
47
+
48
+};

+ 10
- 6
jsconfig.json Visa fil

@@ -2,9 +2,13 @@
2 2
   "compilerOptions": {
3 3
     "baseUrl": ".",
4 4
     "paths": {
5
-      "@/*": [
6
-        "./src/*"
7
-      ]
8
-    }
9
-  }
10
-}
5
+      "@/*": ["./src/*"]
6
+    },
7
+    // 解决prettier对于装饰器语法的警告
8
+    "experimentalDecorators": true,
9
+    // 解决.jsx文件无法快速跳转的问题
10
+    "jsx": "preserve"
11
+  },
12
+  //提高  性能
13
+  "exclude": ["node_modules", "dist", "build"]
14
+}

+ 0
- 19208
package-lock.json
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 27
- 17
package.json Visa fil

@@ -35,43 +35,53 @@
35 35
   ],
36 36
   "author": "",
37 37
   "dependencies": {
38
-    "@antmjs/vantui": "^2.3.5",
38
+    "@antmjs/vantui": "2.5.0",
39 39
     "@babel/runtime": "^7.7.7",
40
-    "@tarojs/components": "3.5.7",
41
-    "@tarojs/helper": "3.5.7",
42
-    "@tarojs/plugin-framework-react": "3.5.7",
43
-    "@tarojs/plugin-platform-weapp": "3.5.7",
44
-    "@tarojs/react": "3.5.7",
40
+    "@tarojs/components": "3.6.25",
41
+    "@tarojs/helper": "3.6.25",
42
+    "@tarojs/plugin-framework-react": "3.6.25",
43
+    "@tarojs/plugin-platform-h5": "3.6.25",
44
+    "@tarojs/plugin-platform-weapp": "3.6.25",
45
+    "@tarojs/plugin-platform-harmony-hybrid": "3.6.25",
46
+    "@tarojs/shared": "3.6.25",
47
+    "@tarojs/react": "3.6.25",
45 48
     "@tarojs/router": "3.5.7",
46
-    "@tarojs/runtime": "3.5.7",
47
-    "@tarojs/shared": "3.5.7",
48
-    "@tarojs/taro": "3.5.7",
49
-    "@tarojs/taro-h5": "3.5.7",
49
+    "@tarojs/runtime": "3.6.25",
50
+    "@tarojs/taro": "3.6.25",
50 51
     "@zjxpcyc/js_event": "^1.0.0",
51 52
     "@zjxpcyc/react-tiny-store": "^2.0.1",
52 53
     "echarts": "5.4.1",
53 54
     "echarts-for-weixin": "^1.0.2",
54 55
     "md5": "^2.3.0",
56
+    "postcss-modules": "^6.0.0",
55 57
     "react": "^18.0.0",
56
-    "react-dom": "^18.0.0"
58
+    "react-dom": "^18.0.0",
59
+    "taro": "^0.0.7",
60
+    "taro-ui": "^3.3.0"
57 61
   },
58 62
   "devDependencies": {
59 63
     "@babel/core": "^7.8.0",
60 64
     "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
61
-    "@tarojs/cli": "3.5.7",
62
-    "@tarojs/mini-runner": "3.5.7",
63
-    "@tarojs/webpack-runner": "3.5.7",
65
+    "react-refresh": "^0.11.0",
66
+    "@tarojs/cli": "3.6.25",
67
+    "@tarojs/test-utils-react": "^0.1.1",
68
+    "@tarojs/mini-runner": "3.6.25",
69
+    "@tarojs/webpack-runner": "3.6.25",
64 70
     "@types/react": "^18.0.0",
65 71
     "@types/webpack-env": "^1.13.6",
66 72
     "babel-plugin-import": "^1.13.5",
67
-    "babel-preset-taro": "3.5.7",
73
+    "babel-preset-taro": "3.6.25",
68 74
     "eslint": "^8.12.0",
69
-    "eslint-config-taro": "3.5.7",
75
+    "eslint-config-taro": "3.6.25",
70 76
     "eslint-plugin-import": "^2.12.0",
71 77
     "eslint-plugin-react": "^7.8.2",
72 78
     "eslint-plugin-react-hooks": "^4.2.0",
73
-    "react-refresh": "^0.11.0",
79
+    "@types/node": "^18.15.11",
80
+    "@types/jest": "^29.3.1",
81
+    "jest": "^29.3.1",
82
+    "jest-environment-jsdom": "^29.5.0",
74 83
     "stylelint": "^14.4.0",
84
+    "postcss": "^8.4.18",
75 85
     "webpack": "4.46.0"
76 86
   }
77 87
 }

+ 7
- 5
src/pages/login/components/Bottom.jsx Visa fil

@@ -1,7 +1,8 @@
1 1
 import React from 'react';
2 2
 import { View, Image, Button } from '@tarojs/components';
3
-import Icon from '@/assets/image/WeChat.png';
3
+// import Icon from '@/assets/image/WeChat.png';
4 4
 import { useModel } from '@/store';
5
+import { Icon } from '@antmjs/vantui';
5 6
 import style from './bottom.module.less';
6 7
 
7 8
 export default (props) => {
@@ -16,15 +17,16 @@ export default (props) => {
16 17
 
17 18
   return (
18 19
     <View>
19
-      <View className={style['txt-box2']}>—— 没有账号?微信登录 ——</View>
20
+      <View className={style['txt-box2']}>—— 没有账号?手机号快捷登录 ——</View>
20 21
       <View className={style['img-box2']}>
21 22
         <Button openType="getPhoneNumber" onGetPhoneNumber={onGetPhoneNumber}>
22
-          <Image className={style['img-wechat']}
23
+          {/* <Image className={style['img-wechat']}
23 24
             src={Icon}
24
-          />
25
+          /> */}
26
+          <Icon name="phone" size="32px" color='green' style={{ marginTop: '10px' }} />
25 27
         </Button>
26 28
       </View>
27
-      <View className={style['wechat-login']}>微信登录</View>
29
+      <View className={style['wechat-login']}>手机号快捷登录</View>
28 30
     </View>
29 31
   )
30 32
 }

+ 3687
- 3903
yarn.lock
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil