Your Name 2 anni fa
commit
c66c0b1386

+ 12
- 0
.editorconfig Vedi File

@@ -0,0 +1,12 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+indent_style = space
6
+indent_size = 2
7
+charset = utf-8
8
+trim_trailing_whitespace = true
9
+insert_final_newline = true
10
+
11
+[*.md]
12
+trim_trailing_whitespace = false

+ 5
- 0
.eslintrc Vedi File

@@ -0,0 +1,5 @@
1
+// ESLint 检查 .vue 文件需要单独配置编辑器:
2
+// https://eslint.vuejs.org/user-guide/#editor-integrations
3
+{
4
+  "extends": ["taro/vue3"]
5
+}

+ 6
- 0
.gitignore Vedi File

@@ -0,0 +1,6 @@
1
+dist/
2
+deploy_versions/
3
+.temp/
4
+.rn_temp/
5
+node_modules/
6
+.DS_Store

+ 10
- 0
babel.config.js Vedi File

@@ -0,0 +1,10 @@
1
+// babel-preset-taro 更多选项和默认值:
2
+// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3
+module.exports = {
4
+  presets: [
5
+    ['taro', {
6
+      framework: 'vue3',
7
+      ts: false
8
+    }]
9
+  ]
10
+}

+ 9
- 0
config/dev.js Vedi File

@@ -0,0 +1,9 @@
1
+module.exports = {
2
+  env: {
3
+    NODE_ENV: '"development"'
4
+  },
5
+  defineConstants: {
6
+  },
7
+  mini: {},
8
+  h5: {}
9
+}

+ 82
- 0
config/index.js Vedi File

@@ -0,0 +1,82 @@
1
+const config = {
2
+  projectName: 'changeAvatar',
3
+  date: '2022-9-24',
4
+  designWidth: 750,
5
+  deviceRatio: {
6
+    640: 2.34 / 2,
7
+    750: 1,
8
+    828: 1.81 / 2
9
+  },
10
+  sourceRoot: 'src',
11
+  outputRoot: 'dist',
12
+  plugins: [],
13
+  defineConstants: {
14
+  },
15
+  copy: {
16
+    patterns: [
17
+    ],
18
+    options: {
19
+    }
20
+  },
21
+  framework: 'vue3',
22
+  compiler: 'webpack5',
23
+  cache: {
24
+    enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
25
+  },
26
+  mini: {
27
+    postcss: {
28
+      pxtransform: {
29
+        enable: true,
30
+        config: {
31
+
32
+        }
33
+      },
34
+      url: {
35
+        enable: true,
36
+        config: {
37
+          limit: 1024 // 设定转换尺寸上限
38
+        }
39
+      },
40
+      cssModules: {
41
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
42
+        config: {
43
+          namingPattern: 'module', // 转换模式,取值为 global/module
44
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
45
+        }
46
+      }
47
+    }
48
+  },
49
+  h5: {
50
+    publicPath: '/',
51
+    staticDirectory: 'static',
52
+    postcss: {
53
+      autoprefixer: {
54
+        enable: true,
55
+        config: {
56
+        }
57
+      },
58
+      cssModules: {
59
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
60
+        config: {
61
+          namingPattern: 'module', // 转换模式,取值为 global/module
62
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
63
+        }
64
+      }
65
+    }
66
+  },
67
+  rn: {
68
+    appName: 'taroDemo',
69
+    postcss: {
70
+      cssModules: {
71
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
72
+      }
73
+    }
74
+  }
75
+}
76
+
77
+module.exports = function (merge) {
78
+  if (process.env.NODE_ENV === 'development') {
79
+    return merge({}, config, require('./dev'))
80
+  }
81
+  return merge({}, config, require('./prod'))
82
+}

+ 37
- 0
config/prod.js Vedi File

@@ -0,0 +1,37 @@
1
+module.exports = {
2
+  env: {
3
+    NODE_ENV: '"production"'
4
+  },
5
+  defineConstants: {
6
+  },
7
+  mini: {},
8
+  h5: {
9
+    /**
10
+     * WebpackChain 插件配置
11
+     * @docs https://github.com/neutrinojs/webpack-chain
12
+     */
13
+    // webpackChain (chain) {
14
+    //   /**
15
+    //    * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
16
+    //    * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
17
+    //    */
18
+    //   chain.plugin('analyzer')
19
+    //     .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
20
+
21
+    //   /**
22
+    //    * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
23
+    //    * @docs https://github.com/chrisvfritz/prerender-spa-plugin
24
+    //    */
25
+    //   const path = require('path')
26
+    //   const Prerender = require('prerender-spa-plugin')
27
+    //   const staticDir = path.join(__dirname, '..', 'dist')
28
+    //   chain
29
+    //     .plugin('prerender')
30
+    //     .use(new Prerender({
31
+    //       staticDir,
32
+    //       routes: [ '/pages/index/index' ],
33
+    //       postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
34
+    //     }))
35
+    // }
36
+  }
37
+}

+ 72
- 0
package.json Vedi File

@@ -0,0 +1,72 @@
1
+{
2
+  "name": "changeAvatar",
3
+  "version": "1.0.0",
4
+  "private": true,
5
+  "description": "",
6
+  "templateInfo": {
7
+    "name": "default",
8
+    "typescript": false,
9
+    "css": "less"
10
+  },
11
+  "scripts": {
12
+    "build:weapp": "taro build --type weapp",
13
+    "build:swan": "taro build --type swan",
14
+    "build:alipay": "taro build --type alipay",
15
+    "build:tt": "taro build --type tt",
16
+    "build:h5": "taro build --type h5",
17
+    "build:rn": "taro build --type rn",
18
+    "build:qq": "taro build --type qq",
19
+    "build:jd": "taro build --type jd",
20
+    "build:quickapp": "taro build --type quickapp",
21
+    "dev:weapp": "npm run build:weapp -- --watch",
22
+    "dev:swan": "npm run build:swan -- --watch",
23
+    "dev:alipay": "npm run build:alipay -- --watch",
24
+    "dev:tt": "npm run build:tt -- --watch",
25
+    "dev:h5": "npm run build:h5 -- --watch",
26
+    "dev:rn": "npm run build:rn -- --watch",
27
+    "dev:qq": "npm run build:qq -- --watch",
28
+    "dev:jd": "npm run build:jd -- --watch",
29
+    "dev:quickapp": "npm run build:quickapp -- --watch"
30
+  },
31
+  "browserslist": [
32
+    "last 3 versions",
33
+    "Android >= 4.1",
34
+    "ios >= 8"
35
+  ],
36
+  "author": "",
37
+  "dependencies": {
38
+    "@babel/runtime": "^7.7.7",
39
+    "@tarojs/components": "3.5.6",
40
+    "@tarojs/helper": "3.5.6",
41
+    "@tarojs/plugin-platform-weapp": "3.5.6",
42
+    "@tarojs/plugin-platform-alipay": "3.5.6",
43
+    "@tarojs/plugin-platform-tt": "3.5.6",
44
+    "@tarojs/plugin-platform-swan": "3.5.6",
45
+    "@tarojs/plugin-platform-jd": "3.5.6",
46
+    "@tarojs/plugin-platform-qq": "3.5.6",
47
+    "@tarojs/router": "3.5.6",
48
+    "@tarojs/runtime": "3.5.6",
49
+    "@tarojs/shared": "3.5.6",
50
+    "@tarojs/taro": "3.5.6",
51
+    "@tarojs/taro-h5": "3.5.6",
52
+    "@tarojs/plugin-framework-vue3": "3.5.6",
53
+    "vue": "^3.0.0"
54
+  },
55
+  "devDependencies": {
56
+    "@babel/core": "^7.8.0",
57
+    "@tarojs/cli": "3.5.6",
58
+    "@types/webpack-env": "^1.13.6",
59
+    "webpack": "5.69.0",
60
+    "@tarojs/webpack5-runner": "3.5.6",
61
+    "babel-preset-taro": "3.5.6",
62
+    "css-loader": "3.4.2",
63
+    "style-loader": "1.3.0",
64
+    "@vue/babel-plugin-jsx": "^1.0.6",
65
+    "@vue/compiler-sfc": "^3.0.0",
66
+    "vue-loader": "^16.0.0-beta.8",
67
+    "eslint-plugin-vue": "^8.0.0",
68
+    "eslint-config-taro": "3.5.6",
69
+    "eslint": "^8.12.0",
70
+    "stylelint": "^14.4.0"
71
+  }
72
+}

+ 12579
- 0
pnpm-lock.yaml
File diff suppressed because it is too large
Vedi File


+ 15
- 0
project.config.json Vedi File

@@ -0,0 +1,15 @@
1
+{
2
+  "miniprogramRoot": "./dist",
3
+  "projectname": "changeAvatar",
4
+  "description": "",
5
+  "appid": "touristappid",
6
+  "setting": {
7
+    "urlCheck": true,
8
+    "es6": false,
9
+    "enhance": false,
10
+    "compileHotReLoad": false,
11
+    "postcss": false,
12
+    "minified": false
13
+  },
14
+  "compileType": "miniprogram"
15
+}

+ 9
- 0
project.tt.json Vedi File

@@ -0,0 +1,9 @@
1
+{
2
+  "miniprogramRoot": "./",
3
+  "projectname": "changeAvatar",
4
+  "appid": "testAppId",
5
+  "setting": {
6
+    "es6": false,
7
+    "minified": false
8
+  }
9
+}

BIN
public/images/1.png Vedi File


BIN
public/images/2.png Vedi File


BIN
public/images/3.png Vedi File


BIN
public/images/4.png Vedi File


+ 11
- 0
src/app.config.js Vedi File

@@ -0,0 +1,11 @@
1
+export default defineAppConfig({
2
+  pages: [
3
+    'pages/index/index'
4
+  ],
5
+  window: {
6
+    backgroundTextStyle: 'light',
7
+    navigationBarBackgroundColor: '#fff',
8
+    navigationBarTitleText: 'WeChat',
9
+    navigationBarTextStyle: 'black'
10
+  }
11
+})

+ 9
- 0
src/app.js Vedi File

@@ -0,0 +1,9 @@
1
+import { createApp } from 'vue'
2
+import './app.less'
3
+
4
+const App = createApp({
5
+  onShow (options) {},
6
+  // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
7
+})
8
+
9
+export default App

+ 4
- 0
src/app.less Vedi File

@@ -0,0 +1,4 @@
1
+.page {
2
+  width: 100vw;
3
+  height: 100vh;
4
+}

+ 17
- 0
src/index.html Vedi File

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
5
+  <meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
6
+  <meta name="apple-mobile-web-app-capable" content="yes">
7
+  <meta name="apple-touch-fullscreen" content="yes">
8
+  <meta name="format-detection" content="telephone=no,address=no">
9
+  <meta name="apple-mobile-web-app-status-bar-style" content="white">
10
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
11
+  <title>changeAvatar</title>
12
+  <script><%= htmlWebpackPlugin.options.script %></script>
13
+</head>
14
+<body>
15
+  <div id="app"></div>
16
+</body>
17
+</html>

+ 3
- 0
src/pages/index/index.config.js Vedi File

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

+ 0
- 0
src/pages/index/index.less Vedi File


+ 23
- 0
src/pages/index/index.vue Vedi File

@@ -0,0 +1,23 @@
1
+<template>
2
+  <view class="page">
3
+    <text>{{ msg }}</text>
4
+  </view>
5
+</template>
6
+
7
+<script>
8
+import { ref } from 'vue'
9
+import './index.less'
10
+
11
+export default {
12
+  setup () {
13
+    const msg = ref('Hello world')
14
+    return {
15
+      msg
16
+    }
17
+  }
18
+}
19
+</script>
20
+
21
+<style lang="less" scoped>
22
+
23
+</style>