李志伟 3 年前
父节点
当前提交
f58bfaeeff
共有 69 个文件被更改,包括 1199 次插入0 次删除
  1. 12
    0
      .editorconfig
  2. 7
    0
      .eslintrc
  3. 9
    0
      .gitignore
  4. 1
    0
      .npmrc
  5. 10
    0
      babel.config.js
  6. 9
    0
      config/dev.js
  7. 80
    0
      config/index.js
  8. 18
    0
      config/prod.js
  9. 8
    0
      jsconfig.json
  10. 60
    0
      package.json
  11. 13
    0
      project.config.json
  12. 9
    0
      project.tt.json
  13. 16
    0
      src/app.config.js
  14. 55
    0
      src/app.js
  15. 42
    0
      src/app.less
  16. 二进制
      src/assets/bank/ABCbank.png
  17. 二进制
      src/assets/bank/BOCbank.png
  18. 二进制
      src/assets/bank/CCBbank.png
  19. 二进制
      src/assets/bank/addBank.png
  20. 二进制
      src/assets/bank/walletBgi.png
  21. 二进制
      src/assets/banner/1.jpg
  22. 二进制
      src/assets/banner/2.jpg
  23. 二进制
      src/assets/comm/borderImg.png
  24. 二进制
      src/assets/comm/goback.png
  25. 二进制
      src/assets/comm/index.png
  26. 二进制
      src/assets/comm/indexActive.png
  27. 二进制
      src/assets/comm/job.png
  28. 二进制
      src/assets/comm/jobActive.png
  29. 二进制
      src/assets/comm/orderList.png
  30. 二进制
      src/assets/comm/position.png
  31. 二进制
      src/assets/comm/search.png
  32. 二进制
      src/assets/comm/user.png
  33. 二进制
      src/assets/comm/userActive.png
  34. 二进制
      src/assets/goBack.png
  35. 二进制
      src/assets/job/positionImg.png
  36. 二进制
      src/assets/login/VerificationCode.png
  37. 二进制
      src/assets/login/loginImg.png
  38. 二进制
      src/assets/machinery/date.png
  39. 二进制
      src/assets/machinery/greenMachinery.png
  40. 二进制
      src/assets/machinery/mIcon.png
  41. 二进制
      src/assets/machinery/orangeMachiner.png
  42. 二进制
      src/assets/user/Feedback.png
  43. 二进制
      src/assets/user/aboutUs.png
  44. 二进制
      src/assets/user/account.png
  45. 二进制
      src/assets/user/bankCard.png
  46. 二进制
      src/assets/user/cancel.png
  47. 二进制
      src/assets/user/defaultAvatar.png
  48. 二进制
      src/assets/user/edit.png
  49. 二进制
      src/assets/user/machinery.png
  50. 二进制
      src/assets/user/right.png
  51. 二进制
      src/assets/user/update.png
  52. 二进制
      src/assets/user/userBgi.png
  53. 二进制
      src/assets/user/wallet.png
  54. 80
    0
      src/components/CustomNav/index.jsx
  55. 37
    0
      src/components/CustomNav/style.less
  56. 19
    0
      src/index.html
  57. 37
    0
      src/pages/index/components/OrderCard/index.jsx
  58. 75
    0
      src/pages/index/components/OrderCard/style.less
  59. 69
    0
      src/pages/index/components/order/index.jsx
  60. 104
    0
      src/pages/index/components/order/style.less
  61. 7
    0
      src/pages/index/index.config.js
  62. 54
    0
      src/pages/index/index.jsx
  63. 18
    0
      src/pages/index/index.less
  64. 7
    0
      src/pages/moreOrder/index.config.js
  65. 79
    0
      src/pages/moreOrder/index.jsx
  66. 57
    0
      src/pages/moreOrder/style.less
  67. 39
    0
      src/routes.js
  68. 78
    0
      src/utils/index.js
  69. 90
    0
      yarn-error.log

+ 12
- 0
.editorconfig 查看文件

@@ -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

+ 7
- 0
.eslintrc 查看文件

@@ -0,0 +1,7 @@
1
+{
2
+  "extends": ["taro/react"],
3
+  "rules": {
4
+    "react/jsx-uses-react": "off",
5
+    "react/react-in-jsx-scope": "off"
6
+  }
7
+}

+ 9
- 0
.gitignore 查看文件

@@ -0,0 +1,9 @@
1
+dist/
2
+deploy_versions/
3
+.temp/
4
+.rn_temp/
5
+node_modules/
6
+.DS_Store
7
+*.lock
8
+package-lock.json
9
+.vscode/

+ 1
- 0
.npmrc 查看文件

@@ -0,0 +1 @@
1
+registry=https://registry.npmmirror.com

+ 10
- 0
babel.config.js 查看文件

@@ -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: 'react',
7
+      ts: false
8
+    }]
9
+  ]
10
+}

+ 9
- 0
config/dev.js 查看文件

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

+ 80
- 0
config/index.js 查看文件

@@ -0,0 +1,80 @@
1
+import { resolve } from 'path'
2
+
3
+const config = {
4
+  projectName: 'machinery-person',
5
+  date: '2022-3-15',
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
+    ],
20
+    options: {
21
+    }
22
+  },
23
+  alias: {
24
+    '@/assets': resolve(__dirname, '..', 'src/assets'),
25
+    '@/components': resolve(__dirname, '..', 'src/components'),
26
+    '@/layouts': resolve(__dirname, '..', 'src/layouts'),
27
+    '@/utils': resolve(__dirname, '..', 'src/utils'),
28
+    '@/store': resolve(__dirname, '..', 'src/store'),
29
+    '@/services': resolve(__dirname, '..', 'src/services'),
30
+  },
31
+  framework: 'react',
32
+  mini: {
33
+    postcss: {
34
+      pxtransform: {
35
+        enable: true,
36
+        config: {
37
+
38
+        }
39
+      },
40
+      url: {
41
+        enable: true,
42
+        config: {
43
+          limit: 1024 // 设定转换尺寸上限
44
+        }
45
+      },
46
+      cssModules: {
47
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
48
+        config: {
49
+          namingPattern: 'module', // 转换模式,取值为 global/module
50
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
51
+        }
52
+      }
53
+    }
54
+  },
55
+  h5: {
56
+    publicPath: '/',
57
+    staticDirectory: 'static',
58
+    postcss: {
59
+      autoprefixer: {
60
+        enable: true,
61
+        config: {
62
+        }
63
+      },
64
+      cssModules: {
65
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
66
+        config: {
67
+          namingPattern: 'module', // 转换模式,取值为 global/module
68
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
69
+        }
70
+      }
71
+    }
72
+  }
73
+}
74
+
75
+export default function (merge) {
76
+  if (process.env.NODE_ENV === 'development') {
77
+    return merge({}, config, require('./dev'))
78
+  }
79
+  return merge({}, config, require('./prod'))
80
+}

+ 18
- 0
config/prod.js 查看文件

@@ -0,0 +1,18 @@
1
+module.exports = {
2
+  env: {
3
+    NODE_ENV: '"production"'
4
+  },
5
+  defineConstants: {
6
+  },
7
+  mini: {},
8
+  h5: {
9
+    /**
10
+     * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。
11
+     * 参考代码如下:
12
+     * webpackChain (chain) {
13
+     *   chain.plugin('analyzer')
14
+     *     .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
15
+     * }
16
+     */
17
+  }
18
+}

+ 8
- 0
jsconfig.json 查看文件

@@ -0,0 +1,8 @@
1
+{
2
+  "compilerOptions": {
3
+    "baseUrl": ".",
4
+    "paths": {
5
+      "@/*": ["./src/*"]
6
+    }
7
+  }
8
+}

+ 60
- 0
package.json 查看文件

@@ -0,0 +1,60 @@
1
+{
2
+  "name": "machinery-person",
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.3.15",
40
+    "@tarojs/react": "3.3.15",
41
+    "@tarojs/runtime": "3.3.15",
42
+    "@tarojs/taro": "3.3.15",
43
+    "react": "^17.0.0",
44
+    "react-dom": "^17.0.0"
45
+  },
46
+  "devDependencies": {
47
+    "@babel/core": "^7.8.0",
48
+    "@tarojs/mini-runner": "3.3.15",
49
+    "@tarojs/webpack-runner": "3.3.15",
50
+    "@types/react": "^17.0.2",
51
+    "@types/webpack-env": "^1.13.6",
52
+    "babel-preset-taro": "3.3.15",
53
+    "eslint": "^6.8.0",
54
+    "eslint-config-taro": "3.3.15",
55
+    "eslint-plugin-import": "^2.12.0",
56
+    "eslint-plugin-react": "^7.8.2",
57
+    "eslint-plugin-react-hooks": "^4.2.0",
58
+    "stylelint": "9.3.0"
59
+  }
60
+}

+ 13
- 0
project.config.json 查看文件

@@ -0,0 +1,13 @@
1
+{
2
+  "miniprogramRoot": "./dist",
3
+  "projectname": "machinery-person",
4
+  "description": "农机手小程序",
5
+  "appid": "wx835627a9b9b3932a",
6
+  "setting": {
7
+    "urlCheck": true,
8
+    "es6": false,
9
+    "postcss": false,
10
+    "minified": false
11
+  },
12
+  "compileType": "miniprogram"
13
+}

+ 9
- 0
project.tt.json 查看文件

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

+ 16
- 0
src/app.config.js 查看文件

@@ -0,0 +1,16 @@
1
+import { pages } from './routes'
2
+
3
+export default {
4
+  pages,
5
+  window: {
6
+    backgroundTextStyle: 'light',
7
+    navigationBarBackgroundColor: '#fff',
8
+    navigationBarTitleText: 'WeChat',
9
+    navigationBarTextStyle: 'black'
10
+  },
11
+  permission: {
12
+    'scope.userLocation': {
13
+      desc: '您的位置信息将方便您更好的小程序体验'
14
+    }
15
+  },
16
+}

+ 55
- 0
src/app.js 查看文件

@@ -0,0 +1,55 @@
1
+import { Component } from 'react'
2
+import Taro from '@tarojs/taro'
3
+// import preFetchData from '@/utils/preFetchData'
4
+// import store, { StoreRoot } from './store'
5
+import './app.less'
6
+
7
+class App extends Component {
8
+
9
+  componentDidShow(options) {
10
+    if (options.path === 'pages/index/index' && options.query?.tab === '1' && options.query?.roomId) {
11
+      // const { setRoomId } = store.getModel('hotel').getState()
12
+      // setRoomId(options.query?.roomId)
13
+    }
14
+  }
15
+
16
+  onLaunch(options) {
17
+    console.group('APP Launch')
18
+    console.debug(options)
19
+    console.groupEnd()
20
+
21
+    // const { login } = store.getModel('person').getState()
22
+
23
+    // 预拉取数据
24
+    // preFetchData().then((fetchData) => {
25
+    //   const { fromType, recommender, scene: qrCodeId, mpOpenId, ...leftParams } = options.query
26
+    //   Taro.setStorageSync({ key: 'scene', data: qrCodeId })
27
+
28
+    //   // // 登录获取人员信息
29
+    //   // Taro.login({
30
+    //   //   success: (res) => {
31
+    //   //     const { code } = res;
32
+    //   //     login({ code, personId: fetchData.personId, fromType, recommender, qrCodeId, mpOpenId, ...leftParams })
33
+    //   //   }
34
+    //   // })
35
+    // }).catch(() => {
36
+    //   Taro.showToast({
37
+    //     title: '网络异常, 请退出重试',
38
+    //     icon: 'none',
39
+    //   })
40
+    // })
41
+  }
42
+
43
+  // this.props.children 是将要会渲染的页面
44
+  render() {
45
+    return (
46
+      // <StoreRoot>
47
+      <>
48
+        {this.props.children}
49
+        </>
50
+      // </StoreRoot>
51
+    )
52
+  }
53
+}
54
+
55
+export default App

+ 42
- 0
src/app.less 查看文件

@@ -0,0 +1,42 @@
1
+.page-index {
2
+  display: flex;
3
+  flex-direction: column;
4
+  width: 100vw;
5
+  height: 100vh;
6
+  overflow: hidden;
7
+  box-sizing: border-box;
8
+  letter-spacing: 2px;
9
+  
10
+  .index-navbar {
11
+    flex: none;
12
+  }
13
+
14
+  .index-tabbar {
15
+    flex: none;
16
+    display: flex;
17
+    height: 130px;
18
+    text-align: center;
19
+    box-sizing: border-box;
20
+    padding: 14px 0 23px 0;
21
+    box-shadow: 0px -4px 6px 0px rgba(0, 0, 0, 0.08);
22
+  }
23
+
24
+  .index-container {
25
+    flex: 1;
26
+    overflow: hidden;
27
+    position: relative;
28
+  }
29
+}
30
+
31
+.purebtn {
32
+  margin: 0;
33
+  padding: 0;
34
+  background: transparent;
35
+  border: none;
36
+  outline: none;
37
+  line-height: 88px;
38
+
39
+  &::after {
40
+    border: none;
41
+  }
42
+}

二进制
src/assets/bank/ABCbank.png 查看文件


二进制
src/assets/bank/BOCbank.png 查看文件


二进制
src/assets/bank/CCBbank.png 查看文件


二进制
src/assets/bank/addBank.png 查看文件


二进制
src/assets/bank/walletBgi.png 查看文件


二进制
src/assets/banner/1.jpg 查看文件


二进制
src/assets/banner/2.jpg 查看文件


二进制
src/assets/comm/borderImg.png 查看文件


二进制
src/assets/comm/goback.png 查看文件


二进制
src/assets/comm/index.png 查看文件


二进制
src/assets/comm/indexActive.png 查看文件


二进制
src/assets/comm/job.png 查看文件


二进制
src/assets/comm/jobActive.png 查看文件


二进制
src/assets/comm/orderList.png 查看文件


二进制
src/assets/comm/position.png 查看文件


二进制
src/assets/comm/search.png 查看文件


二进制
src/assets/comm/user.png 查看文件


二进制
src/assets/comm/userActive.png 查看文件


二进制
src/assets/goBack.png 查看文件


二进制
src/assets/job/positionImg.png 查看文件


二进制
src/assets/login/VerificationCode.png 查看文件


二进制
src/assets/login/loginImg.png 查看文件


二进制
src/assets/machinery/date.png 查看文件


二进制
src/assets/machinery/greenMachinery.png 查看文件


二进制
src/assets/machinery/mIcon.png 查看文件


二进制
src/assets/machinery/orangeMachiner.png 查看文件


二进制
src/assets/user/Feedback.png 查看文件


二进制
src/assets/user/aboutUs.png 查看文件


二进制
src/assets/user/account.png 查看文件


二进制
src/assets/user/bankCard.png 查看文件


二进制
src/assets/user/cancel.png 查看文件


二进制
src/assets/user/defaultAvatar.png 查看文件


二进制
src/assets/user/edit.png 查看文件


二进制
src/assets/user/machinery.png 查看文件


二进制
src/assets/user/right.png 查看文件


二进制
src/assets/user/update.png 查看文件


二进制
src/assets/user/userBgi.png 查看文件


二进制
src/assets/user/wallet.png 查看文件


+ 80
- 0
src/components/CustomNav/index.jsx 查看文件

@@ -0,0 +1,80 @@
1
+
2
+import { useState, useEffect, useMemo } from 'react'
3
+import Taro from '@tarojs/taro'
4
+import goback from '@/assets/comm/goback.png'
5
+
6
+import './style.less'
7
+import { View } from '@tarojs/components'
8
+
9
+export default (props) => {
10
+  const { logo, title = '首页', home, noback } = props
11
+
12
+  // 菜单胶囊
13
+  const menuBound = useMemo(() => Taro.getMenuButtonBoundingClientRect(), [])
14
+  // 整体顶部导航
15
+  const navStyle = useMemo(() => {
16
+    return {
17
+      height: `${menuBound.bottom + 8}px`,
18
+    }
19
+  }, [menuBound.bottom])
20
+  // 导航栏
21
+  const navBarStyle = useMemo(() => {
22
+    return {
23
+      top: `${menuBound.top}px`,
24
+      height: `${menuBound.height}px`
25
+    }
26
+  }, [menuBound.top, menuBound.height])
27
+  // 导航栏按钮
28
+  const actionStyle = useMemo(() => {
29
+    return {
30
+      width: `${menuBound.width + 8}px`,
31
+      paddingLeft: '8px',
32
+      lineHeight: `${menuBound.height}px`,
33
+      height: `${menuBound.height}px`,
34
+    }
35
+  }, [menuBound.width, menuBound.height])
36
+  // 导航栏标题
37
+  const contentStyle = useMemo(() => {
38
+    const screenWidth = menuBound.right + 8;
39
+    return {
40
+      width: `${screenWidth - menuBound.width * 2 - 16}px`,
41
+      lineHeight: `${menuBound.height}px`,
42
+      height: `${menuBound.height}px`,
43
+      paddingLeft: '8px',
44
+      paddingRight: '8px',
45
+    }
46
+  }, [menuBound.width, menuBound.height, menuBound.right])
47
+
48
+  const handleAction = () => {
49
+    if (home || logo) return;
50
+
51
+    if (Taro.getCurrentPages().length > 1) {
52
+      Taro.navigateBack({ delta: 1 })
53
+    }
54
+  }
55
+
56
+  useEffect(() => {
57
+    if (title) {
58
+      Taro.setNavigationBarTitle({ title })
59
+    }
60
+  }, [title])
61
+
62
+  return (
63
+    <view className='custom-nav' style={navStyle}>
64
+      <view className='custom-nav-bar' style={navBarStyle}>
65
+        <view className='custom-nav-bar-action' style={actionStyle}>
66
+          {
67
+            !logo && !home && (
68
+              !noback && (
69
+                <View style={{ width: '100%', height: '100%' }} onClick={handleAction}>
70
+                  <image className='goback' src={goback} />
71
+                </View>
72
+              )
73
+            )
74
+          }
75
+        </view>
76
+        <view className='custom-nav-bar-content' style={contentStyle}>{title}</view>
77
+      </view>
78
+    </view>
79
+  )
80
+}

+ 37
- 0
src/components/CustomNav/style.less 查看文件

@@ -0,0 +1,37 @@
1
+.custom-nav {
2
+	display: block;
3
+	position: relative;
4
+
5
+  &-bar {
6
+    display: flex;
7
+    position: fixed;
8
+    width: 100%;
9
+    z-index: 1024;
10
+    left: 0;
11
+
12
+    &-action {
13
+      flex: none;
14
+      box-sizing: border-box;
15
+
16
+      .goback{
17
+        width: 19px;
18
+        height: 35px;
19
+        position: absolute;
20
+        left: 30px;
21
+        top: 14.5px;
22
+      }
23
+    }
24
+
25
+    &-content {
26
+      flex: none;
27
+      text-align: center;
28
+      font-size: 32px;
29
+      cursor: none;
30
+      pointer-events: none;
31
+      text-overflow: ellipsis;
32
+      white-space: nowrap;
33
+      overflow: hidden;
34
+      box-sizing: border-box;
35
+    }
36
+  }
37
+}

+ 19
- 0
src/index.html 查看文件

@@ -0,0 +1,19 @@
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></title>
12
+  <script>
13
+    !function(n){function e(){var e=n.document.documentElement,t=e.getBoundingClientRect().width;e.style.fontSize=t>=640?"40px":t<=320?"20px":t/320*20+"px"}n.addEventListener("resize",(function(){e()})),e()}(window);
14
+  </script>
15
+</head>
16
+<body>
17
+  <div id="app"></div>
18
+</body>
19
+</html>

+ 37
- 0
src/pages/index/components/OrderCard/index.jsx 查看文件

@@ -0,0 +1,37 @@
1
+import Taro from "@tarojs/taro"
2
+import { View, Text } from '@tarojs/components'
3
+import './style.less'
4
+
5
+export default (props) => {
6
+  return (
7
+    <View className='card'>
8
+      <View className='jianbian'>
9
+        <View className='text'>待作业</View>
10
+      </View>
11
+      <View className='cardHead'>
12
+        <View className='cell' style={{display:'inline-block'}}>
13
+          <Text className='label'>需求时间</Text>:
14
+          <Text className='data'>2022-06-02</Text>
15
+        </View>
16
+        <Text className='price'><Text style={{fontSize:'44rpx'}}>600</Text>元</Text>
17
+      </View>
18
+      <View className='line' />
19
+      <View className='content'>
20
+        <View className='cell'>
21
+          <Text className='label'>农机名称</Text>:<Text className='data'>收割机001</Text>
22
+        </View>
23
+        <View className='cell'>
24
+          <Text className='label'>下单人</Text>:<Text className='data'>张三</Text>
25
+        </View>
26
+        <View className='cell'>
27
+          <Text className='label'>订单时间</Text>:<Text className='data'>2022-03-08</Text>
28
+        </View>
29
+        <View className='cell'>
30
+          <Text className='label'>作业时间</Text>:<Text className='data'>上午06:00--晚上21:00</Text>
31
+        </View>
32
+      </View>
33
+      <View className='line' />
34
+      <View className='footer'>详情>></View>
35
+    </View>
36
+  )
37
+}

+ 75
- 0
src/pages/index/components/OrderCard/style.less 查看文件

@@ -0,0 +1,75 @@
1
+.card{
2
+  margin-top: 30px;
3
+  box-shadow: 0px 0px 44px 0px rgba(0, 0, 0, 0.08);
4
+  border-radius: 40px;
5
+  position: relative;
6
+  overflow: hidden;
7
+  padding: 40px;
8
+  .jianbian{
9
+    width: 225px;
10
+    height: 217px;
11
+    background: linear-gradient(-30deg, #FFAB8C, #FF703B);
12
+    border-radius: 137px;
13
+    border: 1px solid #FFC937;
14
+    position: absolute;
15
+    left: -134px;
16
+    top: -122px;
17
+    .text{
18
+      transform:rotate(-45deg);
19
+      font-size: 28px;
20
+      font-weight: bold;
21
+      color: #FFFFFF;
22
+      position: relative;
23
+      top: 92px;
24
+      left: 108px;
25
+    }
26
+  }
27
+  .cardHead{
28
+    width: 100%;
29
+    padding: 5px 0 0 38px;
30
+    position: relative;
31
+    .price{
32
+      line-height: 36px;
33
+      position: absolute;
34
+      right: 40px;
35
+      top: 22px;
36
+      font-size: 30px;
37
+      font-weight: bold;
38
+      color: #FF2525;
39
+    }
40
+  }
41
+  .line{
42
+    width: 100%;
43
+    border: 1px solid #000;
44
+    opacity: 0.1;
45
+    margin: 15px 0;
46
+  }
47
+  .content {
48
+    width: 100%;
49
+  }
50
+  .cell{
51
+    line-height: 32px;
52
+    padding: 25px 0;
53
+    font-size: 34px;
54
+    font-weight: bold;
55
+    color: #606060;
56
+    .label{
57
+      width: 24vw;
58
+      display: inline-block;
59
+      text-align: justify;
60
+      text-align-last: justify;
61
+    }
62
+    .data{
63
+      color: #101010;
64
+    }
65
+  }
66
+  .footer{
67
+    width: 100%;
68
+    text-align: center;
69
+    line-height: 32px;
70
+    font-size: 34px;
71
+    font-weight: bold;
72
+    color: #606060;
73
+    padding-top: 15px;
74
+  }
75
+}

+ 69
- 0
src/pages/index/components/order/index.jsx 查看文件

@@ -0,0 +1,69 @@
1
+import React, { useState } from "react"
2
+import Taro from "@tarojs/taro";
3
+import { View, Input, Swiper, Image, SwiperItem, Text,ScrollView } from "@tarojs/components"
4
+import positionImg from '@/assets/comm/position.png'
5
+import searchImg from '@/assets/comm/search.png'
6
+import orderImg from '@/assets/comm/orderList.png'
7
+import OrderCard from "../OrderCard";
8
+import './style.less'
9
+
10
+export default () => {
11
+
12
+  const [swiperImgHeightList, setSwiperImgHeightList] = useState([])
13
+  const [swiperImgWidthList, setSwiperImgWidthList] = useState([])
14
+  const imglist = [
15
+    {
16
+      url: require('@/assets/banner/1.jpg')
17
+    },
18
+    {
19
+      url: require('@/assets/banner/2.jpg')
20
+    },
21
+  ]
22
+  const handleSearch = (e) => {
23
+    console.log(e.detail.value)
24
+  }
25
+  const handleMore=()=>{
26
+    Taro.navigateTo({ url: '/pages/moreOrder/index' });
27
+  }
28
+  return (
29
+    <View className='orderIndex'>
30
+      <View className='top'>
31
+        <View className='left'>
32
+          <Image src={positionImg} className='pImg' />
33
+          <Text>邓州市</Text>
34
+          <View className='icon' />
35
+        </View>
36
+        <View className='searchClass'>
37
+          <Input type='text' className='searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
38
+          <Image src={searchImg} className='searchImg' />
39
+        </View>
40
+      </View>
41
+      <ScrollView scrollY style={{height:'calc(100% - 50px)'}}>
42
+      <View>
43
+        <Swiper
44
+          circular
45
+          autoplay
46
+          className='swiper'
47
+        >
48
+          {imglist.map((item, inx) => (
49
+            <SwiperItem key={inx}>
50
+              <Image src={item.url} mode='widthFix' className='storeImage' />
51
+            </SwiperItem>
52
+          ))}
53
+        </Swiper></View>
54
+      <View className='orderList'>
55
+        <View className='head'>
56
+          <Image className='headIcon' src={orderImg} />
57
+          <Text className='title'>订单列表</Text>
58
+          <Text className='more' onClick={handleMore}>更多>></Text>
59
+        </View>
60
+        
61
+        <OrderCard />
62
+        <OrderCard />
63
+        <View className='listBottom'>暂无更多~</View>
64
+        
65
+      </View>
66
+      </ScrollView>
67
+    </View>
68
+  )
69
+}

+ 104
- 0
src/pages/index/components/order/style.less 查看文件

@@ -0,0 +1,104 @@
1
+.orderIndex {
2
+  height: 100%;
3
+  .top {
4
+    display: flex;
5
+    margin: 30px;
6
+    margin-bottom: 0;
7
+    .left {
8
+      display: flex;
9
+      align-items: center;
10
+      justify-content: center;
11
+      margin-right: 30px;
12
+      font-size: 32px;
13
+      font-weight: bold;
14
+      color: #202020;
15
+      line-height: 68px;
16
+      .pImg{
17
+        width: 28px;
18
+        height: 34px;
19
+        margin-right: 9px;
20
+      }
21
+      .icon{
22
+        border-top: 11px solid #000;
23
+        border-left: 11px solid transparent;
24
+        border-right: 11px solid transparent;
25
+        height: 0;
26
+        width: 0;
27
+        margin-left: 10px;
28
+      }
29
+    }
30
+    .searchClass {
31
+      display: inline-block;
32
+      position: relative;
33
+      flex: 1;
34
+      .searchInput{
35
+        background: #F8F8F8;
36
+        border-radius: 34px;
37
+        padding-left: 68px;
38
+        padding-right: 34px;
39
+        font-size: 28px;
40
+        height: 68px;
41
+        line-height: 68px;
42
+      }
43
+      .searchImg{
44
+        width: 30px;
45
+        height: 30px;
46
+        position: absolute;
47
+        left: 31px;
48
+        top: 19px;
49
+      }
50
+    }
51
+  }
52
+  .swiper {
53
+    transition: all 0.3s linear;
54
+    height: calc( calc(100vw - 60px) * 0.62);
55
+    text-align: center;
56
+    margin: 30px;
57
+    .storeImage {
58
+      height: 100%;
59
+    }
60
+  }
61
+  .orderList{
62
+    margin: 30px;
63
+    padding-top: 30px;
64
+    .head{
65
+      font-size: 40px;
66
+      font-weight: 800;
67
+      color: #222222;
68
+      height: 41px;
69
+      line-height: 41px;      
70
+      display: flex;
71
+      align-items: center;
72
+      .headIcon{
73
+        width: 34px;
74
+        height: 38px;
75
+        vertical-align: middle;
76
+        margin-right: 20px;
77
+      }
78
+      .title{
79
+        height: 39px;
80
+        line-height: 39px;
81
+      }
82
+      .more{
83
+        font-size: 34px;
84
+        font-weight: 500;
85
+        height: 33px;
86
+        line-height: 33px;
87
+        position: absolute;
88
+        right: 30px;
89
+
90
+        color: #666666;
91
+      }
92
+    }
93
+    .listBottom{
94
+      line-height: 31px;
95
+      font-size: 32px;
96
+      font-weight: 500;
97
+      color: #666666;
98
+      margin-top: 64px;
99
+      padding-bottom: 30px;
100
+      text-align: center;
101
+    }
102
+  }
103
+}
104
+

+ 7
- 0
src/pages/index/index.config.js 查看文件

@@ -0,0 +1,7 @@
1
+export default {
2
+  navigationBarTitleText: '首页',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 54
- 0
src/pages/index/index.jsx 查看文件

@@ -0,0 +1,54 @@
1
+import Taro from "@tarojs/taro";
2
+import { useState } from "react";
3
+import { View, Image } from "@tarojs/components"
4
+import indexImg from "@/assets/comm/index.png";
5
+import indexActive from "@/assets/comm/indexActive.png";
6
+import job from "@/assets/comm/job.png";
7
+import jobActive from "@/assets/comm/jobActive.png";
8
+import user from "@/assets/comm/user.png";
9
+import userActive from "@/assets/comm/userActive.png";
10
+import CustomNav from "@/components/CustomNav";
11
+import Order from './components/order'
12
+import "./index.less";
13
+
14
+export default () => {
15
+  const [currentTab, setCurrentTab] = useState(0);
16
+  const handleClick = (val) => {
17
+    setCurrentTab(val);
18
+  };
19
+  return (
20
+    <View className='page-index'>
21
+      <View className='index-navbar'>
22
+        <CustomNav home />
23
+      </View>
24
+      <View className='index-container'>
25
+        {currentTab === 0 && <Order />}
26
+        {currentTab === 1 && <View>888</View>}
27
+        {currentTab === 2 && <View>999</View>}
28
+      </View>
29
+      <View className='index-tabbar'>
30
+        <View
31
+          className={['tabberItem', currentTab === 0 ? "activeTabber" : '']}
32
+          onClick={() => handleClick(0)}
33
+        >
34
+          <Image className='tabberImg' src={currentTab === 0 ? indexActive : indexImg}></Image>
35
+          <View className='text'>首页</View>
36
+        </View>
37
+        <View
38
+          className={['tabberItem', currentTab === 1 ? "activeTabber" : '']}
39
+          onClick={() => handleClick(1)}
40
+        >
41
+          <Image className='tabberImg' src={currentTab === 1 ? jobActive : job}></Image>
42
+          <View className='text'>作业管理</View>
43
+        </View>
44
+        <View
45
+          className={['tabberItem', currentTab === 2 ? "activeTabber" : '']}
46
+          onClick={() => handleClick(2)}
47
+        >
48
+          <Image className='tabberImg' src={currentTab === 2 ? userActive : user}></Image>
49
+          <View className='text'>个人中心</View>
50
+        </View>
51
+      </View>
52
+    </View>
53
+  );
54
+};

+ 18
- 0
src/pages/index/index.less 查看文件

@@ -0,0 +1,18 @@
1
+.tabberItem{
2
+  flex: 1;
3
+  font-size: 30px;
4
+  font-weight: bold;
5
+  .tabberImg{
6
+    width: 52px;
7
+    height: 52px;
8
+    display: block;
9
+    margin: auto;
10
+  }
11
+  .text{
12
+    line-height: 29px;
13
+    margin-top: 12px;
14
+  }
15
+}
16
+.activeTabber {
17
+  color: #17B540;
18
+}

+ 7
- 0
src/pages/moreOrder/index.config.js 查看文件

@@ -0,0 +1,7 @@
1
+export default {
2
+  navigationBarTitleText: '更多',
3
+  navigationStyle: 'custom',
4
+  styleIsolation: 'shared',
5
+  enableShareAppMessage: true,
6
+  disableScroll: true,
7
+}

+ 79
- 0
src/pages/moreOrder/index.jsx 查看文件

@@ -0,0 +1,79 @@
1
+import { View, Input, Image,Text } from "@tarojs/components"
2
+import CustomNav from "@/components/CustomNav";
3
+import searchImg from '@/assets/comm/search.png'
4
+import { useState } from "react";
5
+import './style.less'
6
+
7
+export default () => {
8
+  const [imageShow, setImageShow] = useState(true)
9
+  const [currentTab, setCurrentTab] = useState(0);
10
+  const handleSearch = (e) => {
11
+    if (e.detail.value) {
12
+      console.log(e.detail.value)
13
+      setImageShow(false)
14
+    } else {
15
+      setImageShow(true)
16
+    }
17
+  }
18
+  const handleClick = () => {
19
+    setImageShow(false)
20
+  }
21
+  const handleChange =(val)=>{
22
+    setCurrentTab(val)
23
+  }
24
+  return (
25
+    <View className='page-index'>
26
+      <View className='index-navbar'>
27
+        <CustomNav title='更多' />
28
+      </View>
29
+      <View className='searchClass'>
30
+        <Input type='text' className='searchInput' onClick={handleClick} onBlur={handleSearch} placeholder='搜索关键字查询订单' />
31
+        {
32
+          imageShow && (
33
+            <Image src={searchImg} className='searchImg' />
34
+          )
35
+        }
36
+      </View>
37
+      <View className='tabbar'>
38
+        <View
39
+          className={['tabberItem', currentTab === 0 ? "activeTabber" : '']}
40
+          onClick={() => handleChange(0)}
41
+        >
42
+          <View>
43
+            <Text className='text'>待付款</Text>
44
+            {
45
+              currentTab === 0&&<View className='line' />
46
+            }            
47
+          </View>
48
+        </View>
49
+        <View
50
+          className={['tabberItem', currentTab === 1 ? "activeTabber" : '']}
51
+          onClick={() => handleChange(1)}
52
+        >
53
+          <View>
54
+            <Text className='text'>进行中</Text>
55
+            {
56
+              currentTab === 1&&<View className='line' />
57
+            } 
58
+          </View>
59
+        </View>
60
+        <View
61
+          className={['tabberItem', currentTab === 2 ? "activeTabber" : '']}
62
+          onClick={() => handleChange(2)}
63
+        >
64
+          <View>
65
+            <Text className='text'>已完成</Text>
66
+            {
67
+              currentTab === 2&&<View className='line' />
68
+            } 
69
+          </View>
70
+        </View>
71
+      </View>
72
+      <View className='index-container'>
73
+        {currentTab === 0 && <View>777</View>}
74
+        {currentTab === 1 && <View>888</View>}
75
+        {currentTab === 2 && <View>999</View>}
76
+      </View>
77
+    </View>
78
+  )
79
+}

+ 57
- 0
src/pages/moreOrder/style.less 查看文件

@@ -0,0 +1,57 @@
1
+.searchClass {
2
+  position: relative;
3
+  padding: 30px;
4
+  text-align: center;
5
+  .searchInput{
6
+    background: #F8F8F8;
7
+    border-radius: 34px;
8
+    padding:0 34px;
9
+    font-size: 28px;
10
+    height: 68px;
11
+    line-height: 68px;
12
+  }
13
+  .searchImg{
14
+    width: 30px;
15
+    height: 30px;
16
+    position: absolute;
17
+    left: calc(50vw - 5.5em);
18
+    top: 50px;
19
+  }
20
+}
21
+.tabbar{
22
+  display: flex;
23
+  text-align: center;
24
+  box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.08);
25
+  height: 88px;
26
+  margin: 0 30px;
27
+  align-items: center;
28
+  .tabberItem{
29
+    flex: 1;
30
+    font-size: 32px;
31
+    font-weight: 500;
32
+    color: #999999;
33
+    height: 100%;
34
+    &>View{
35
+      height: 100%;
36
+      display: flex;
37
+      justify-content: center;
38
+      position: relative;
39
+      .text{
40
+        line-height: 29px;
41
+        align-self: center;
42
+      }
43
+      .line{
44
+        width: 12.8vw;
45
+        height: 6px;
46
+        background: #06B03B;
47
+        position: absolute;
48
+        bottom: 0;
49
+      }
50
+    }   
51
+    
52
+  }
53
+  .activeTabber {
54
+    color: #06B03B;
55
+    font-weight: 800;
56
+  }
57
+}

+ 39
- 0
src/routes.js 查看文件

@@ -0,0 +1,39 @@
1
+
2
+// 客户页面
3
+const mainPages = [
4
+  {
5
+    title: '首页',
6
+    page: 'pages/index/index',
7
+    isIndex: true,
8
+  },
9
+  {
10
+    title: '更多',
11
+    page: 'pages/moreOrder/index',
12
+  },
13
+  
14
+];
15
+
16
+// 所有的页面
17
+const routes = mainPages
18
+
19
+// 主包
20
+const pages = mainPages.map(x => x.page);
21
+
22
+
23
+// 获取路径对应页面
24
+function getPageBy(path) {
25
+  return routes.filter(x => path.indexOf(x.page) > -1)[0]
26
+}
27
+
28
+// 获取角色首页
29
+function getIndexPageOf(role) {
30
+  return routes.filter(x => x.root === role && x.isIndex)[0]
31
+}
32
+
33
+// eslint-disable-next-line import/no-commonjs
34
+module.exports = {
35
+  routes,
36
+  pages,
37
+  getPageBy,
38
+  getIndexPageOf
39
+}

+ 78
- 0
src/utils/index.js 查看文件

@@ -0,0 +1,78 @@
1
+
2
+/**
3
+ * queryString 转 object
4
+ * @param {*} queryStr 
5
+ * @returns 
6
+ */
7
+export function parseQueryString(queryStr) {
8
+  if (!queryStr) {
9
+    return;
10
+  }
11
+
12
+  const params = queryStr.split('&').reduce((acc, str) => {
13
+    if (!str) return acc;
14
+
15
+    const kv = str.split('=')
16
+    if (kv.length !== 2) return acc;
17
+
18
+    const key = decodeURIComponent(kv[0])
19
+    const val = decodeURIComponent(kv[1])
20
+
21
+    return {
22
+      ...acc,
23
+      [key]: val,
24
+    }
25
+  }, {});
26
+  return params;
27
+}
28
+
29
+/**
30
+ * object 转 queryStr
31
+ * @param {*} params 
32
+ * @returns 
33
+ */
34
+export function getQueryString(params) {
35
+  if (!params) return ;
36
+
37
+  const keys = Object.keys(params)
38
+  const arr = keys.map((key) => {
39
+    const val = params[key]
40
+    if (val === null || val === undefined) return false;
41
+
42
+    return `${key}=${encodeURIComponent(val)}`
43
+  })
44
+
45
+  return arr.filter(Boolean).join('&')
46
+}
47
+
48
+/**
49
+ * 随机串
50
+ * @param {*} prefix 
51
+ * @returns 
52
+ */
53
+export function random(prefix) {
54
+  const s = Math.random().toString(36).substring(2)
55
+
56
+  return prefix ? `${prefix}-${s}` : s
57
+}
58
+
59
+/**
60
+ * 压缩图片
61
+ * @param {*} url 
62
+ * @returns 
63
+ */
64
+export function compressImage(url, typ) {
65
+  if (!url) return url;
66
+
67
+  // GIF 不压缩
68
+  if (url.indexOf('.gif') > -1) return url;
69
+
70
+  const style = typ || 'cmp80'
71
+
72
+  // eslint-disable-next-line no-undef
73
+  if (url.indexOf(OSS) > -1) {
74
+    return `${url}?x-oss-process=style/${style}`.replace('http://', 'https://')
75
+  }
76
+
77
+  return url;
78
+}

+ 90
- 0
yarn-error.log 查看文件

@@ -0,0 +1,90 @@
1
+Arguments: 
2
+  C:\Program Files\nodejs\node.exe C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
3
+
4
+PATH: 
5
+  C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;D:\Git\cmd;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;;C:\Program Files (x86)\Tencent\微信web开发者工具\dll;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Administrator\AppData\Roaming\npm;D:\java8\bin;D:\apache-maven-3.8.4\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;
6
+
7
+Yarn version: 
8
+  1.22.17
9
+
10
+Node version: 
11
+  14.17.1
12
+
13
+Platform: 
14
+  win32 x64
15
+
16
+Trace: 
17
+  SyntaxError: E:\work\nanyang\machinery-mini\machinery-person\machinery-person\package.json: Unexpected token } in JSON at position 1372
18
+      at JSON.parse (<anonymous>)
19
+      at C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:1625:59
20
+      at Generator.next (<anonymous>)
21
+      at step (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:310:30)
22
+      at C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:321:13
23
+
24
+npm manifest: 
25
+  {
26
+    "name": "machinery-person",
27
+    "version": "1.0.0",
28
+    "private": true,
29
+    "description": "农机手小程序",
30
+    "templateInfo": {
31
+      "name": "default",
32
+      "typescript": false,
33
+      "css": "less"
34
+    },
35
+    "scripts": {
36
+      "build:weapp": "taro build --type weapp",
37
+      "build:swan": "taro build --type swan",
38
+      "build:alipay": "taro build --type alipay",
39
+      "build:tt": "taro build --type tt",
40
+      "build:h5": "taro build --type h5",
41
+      "build:rn": "taro build --type rn",
42
+      "build:qq": "taro build --type qq",
43
+      "build:jd": "taro build --type jd",
44
+      "build:quickapp": "taro build --type quickapp",
45
+      "dev:weapp": "npm run build:weapp -- --watch",
46
+      "dev:swan": "npm run build:swan -- --watch",
47
+      "dev:alipay": "npm run build:alipay -- --watch",
48
+      "dev:tt": "npm run build:tt -- --watch",
49
+      "dev:h5": "npm run build:h5 -- --watch",
50
+      "dev:rn": "npm run build:rn -- --watch",
51
+      "dev:qq": "npm run build:qq -- --watch",
52
+      "dev:jd": "npm run build:jd -- --watch",
53
+      "dev:quickapp": "npm run build:quickapp -- --watch"
54
+    },
55
+    "browserslist": [
56
+      "last 3 versions",
57
+      "Android >= 4.1",
58
+      "ios >= 8"
59
+    ],
60
+    "author": "",
61
+    "dependencies": {
62
+      "@babel/runtime": "^7.7.7",
63
+      "@tarojs/components": "3.3.15",
64
+      "@tarojs/react": "3.3.15",
65
+      "@tarojs/runtime": "3.3.15",
66
+      "@tarojs/taro": "3.3.15",
67
+      "react": "^17.0.0",
68
+      "react-dom": "^17.0.0",
69
+    },
70
+    "devDependencies": {
71
+      "@babel/core": "^7.8.0",
72
+      "@tarojs/mini-runner": "3.3.15",
73
+      "@tarojs/webpack-runner": "3.3.15",
74
+      "@types/react": "^17.0.2",
75
+      "@types/webpack-env": "^1.13.6",
76
+      "babel-preset-taro": "3.3.15",
77
+      "eslint": "^6.8.0",
78
+      "eslint-config-taro": "3.3.15",
79
+      "eslint-plugin-import": "^2.12.0",
80
+      "eslint-plugin-react": "^7.8.2",
81
+      "eslint-plugin-react-hooks": "^4.2.0",
82
+      "stylelint": "9.3.0"
83
+    }
84
+  }
85
+
86
+yarn manifest: 
87
+  No manifest
88
+
89
+Lockfile: 
90
+  No lockfile