business_tms_program 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.editorconfig +12 -0
  2. package/.eslintrc-auto-import.json +113 -0
  3. package/.eslintrc.js +121 -0
  4. package/.prettierrc.js +9 -0
  5. package/.stylelintignore +4 -0
  6. package/README.md +43 -0
  7. package/components.d.ts +23 -0
  8. package/index.html +20 -0
  9. package/package.json +70 -0
  10. package/shims-uni.d.ts +10 -0
  11. package/src/App.vue +81 -0
  12. package/src/api/afterSale.ts +184 -0
  13. package/src/api/context.ts +26 -0
  14. package/src/api/device.ts +134 -0
  15. package/src/api/index.ts +80 -0
  16. package/src/api/installtion.ts +155 -0
  17. package/src/api/model/index.ts +15 -0
  18. package/src/api/model/userModel.ts +62 -0
  19. package/src/api/order.ts +49 -0
  20. package/src/api/system.ts +19 -0
  21. package/src/api/user.ts +171 -0
  22. package/src/auto-imports.d.ts +108 -0
  23. package/src/components/ConfirmDialog.vue +101 -0
  24. package/src/components/DaySelect.vue +212 -0
  25. package/src/components/Drawer.vue +104 -0
  26. package/src/components/DrawerSelect.vue +105 -0
  27. package/src/components/DropMenu.vue +144 -0
  28. package/src/components/Empty.vue +49 -0
  29. package/src/components/Loading.vue +41 -0
  30. package/src/components/RippleBtn.vue +159 -0
  31. package/src/components/SinglePick.vue +120 -0
  32. package/src/components/Skeleton.vue +43 -0
  33. package/src/components/Timeline.vue +85 -0
  34. package/src/components/Upload.vue +217 -0
  35. package/src/config/app.ts +32 -0
  36. package/src/config/env.ts +29 -0
  37. package/src/dict/afterSale.ts +161 -0
  38. package/src/dict/device.ts +29 -0
  39. package/src/dict/installtion.ts +141 -0
  40. package/src/dict/systems.ts +4 -0
  41. package/src/env.d.ts +8 -0
  42. package/src/hooks/useForm.ts +222 -0
  43. package/src/hooks/useUpload.ts +80 -0
  44. package/src/main.ts +8 -0
  45. package/src/manifest.json +39 -0
  46. package/src/pages/acceptance/DeviceInfo.vue +132 -0
  47. package/src/pages/acceptance/list.vue +276 -0
  48. package/src/pages/afterSale/DeviceInfo.vue +128 -0
  49. package/src/pages/afterSale/Step.vue +0 -0
  50. package/src/pages/afterSale/faultReport.vue +552 -0
  51. package/src/pages/afterSale/orderDetail.vue +327 -0
  52. package/src/pages/afterSale/orderFinish.vue +517 -0
  53. package/src/pages/afterSale/orderList.vue +305 -0
  54. package/src/pages/afterSale/returnVisit.vue +288 -0
  55. package/src/pages/afterSale/searchDeviceList.vue +148 -0
  56. package/src/pages/device/Search.vue +201 -0
  57. package/src/pages/device/acceptance.vue +270 -0
  58. package/src/pages/device/detail.vue +165 -0
  59. package/src/pages/device/index.vue +322 -0
  60. package/src/pages/device/info.vue +140 -0
  61. package/src/pages/device/list.vue +219 -0
  62. package/src/pages/device/materialTowerCode.vue +589 -0
  63. package/src/pages/device/searchList.vue +224 -0
  64. package/src/pages/installtion/Record.vue +145 -0
  65. package/src/pages/installtion/StatusTimeline.vue +85 -0
  66. package/src/pages/installtion/addAcceptance.vue +409 -0
  67. package/src/pages/installtion/addRecord.vue +338 -0
  68. package/src/pages/installtion/orderDetail.vue +220 -0
  69. package/src/pages/installtion/orderList.vue +100 -0
  70. package/src/pages/user/component/PersonAgree.vue +226 -0
  71. package/src/pages/user/component/PrivayAgree.vue +221 -0
  72. package/src/pages/user/component/SliderCode.vue +173 -0
  73. package/src/pages/user/forgetPassword.vue +249 -0
  74. package/src/pages/user/index.vue +139 -0
  75. package/src/pages/user/login.vue +342 -0
  76. package/src/pages/user/register.vue +348 -0
  77. package/src/pages/user/repassword.vue +329 -0
  78. package/src/pages/user/utils/mcaptcha.js +75 -0
  79. package/src/pages/user/utils/verifyCode.ts +41 -0
  80. package/src/pages/workspace/index.vue +225 -0
  81. package/src/pages.json +203 -0
  82. package/src/shime-uni.d.ts +6 -0
  83. package/src/static/icon/system/breeder_icon.png +0 -0
  84. package/src/static/icon/system/check.png +0 -0
  85. package/src/static/icon/system/factory_icon.png +0 -0
  86. package/src/static/icon/system/plus.png +0 -0
  87. package/src/static/icon/system/right.png +0 -0
  88. package/src/static/icon/system/unCheck.png +0 -0
  89. package/src/static/icon/tab/search.png +0 -0
  90. package/src/static/icon/tab/user.png +0 -0
  91. package/src/static/icon/tab/user_active.png +0 -0
  92. package/src/static/icon/tab/workspace.png +0 -0
  93. package/src/static/icon/tab/workspace_active.png +0 -0
  94. package/src/static/img/active_dot.png +0 -0
  95. package/src/static/img/afterSale_icon.png +0 -0
  96. package/src/static/img/check.png +0 -0
  97. package/src/static/img/close.png +0 -0
  98. package/src/static/img/confirm.png +0 -0
  99. package/src/static/img/empty.png +0 -0
  100. package/src/static/img/equipment_icon.png +0 -0
  101. package/src/static/img/fault_icon.png +0 -0
  102. package/src/static/img/install_icon.png +0 -0
  103. package/src/static/img/login_bg2.png +0 -0
  104. package/src/static/img/movable_right.png +0 -0
  105. package/src/static/img/navigation.png +0 -0
  106. package/src/static/img/psw_off.png +0 -0
  107. package/src/static/img/psw_on.png +0 -0
  108. package/src/static/img/scan.png +0 -0
  109. package/src/static/img/scan_icon.png +0 -0
  110. package/src/static/img/search.png +0 -0
  111. package/src/static/img/turn_right.png +0 -0
  112. package/src/static/img/unActive_dot.png +0 -0
  113. package/src/static/img/verifyBg.png +0 -0
  114. package/src/stores/index.ts +11 -0
  115. package/src/stores/modules/customer.ts +146 -0
  116. package/src/stores/modules/installtion.ts +30 -0
  117. package/src/stores/modules/system.ts +56 -0
  118. package/src/stores/modules/user.ts +133 -0
  119. package/src/stores/types.ts +16 -0
  120. package/src/stores/utils.ts +6 -0
  121. package/src/styles/index.less +63 -0
  122. package/src/types/chengyiApi.d.ts +36 -0
  123. package/src/types/index.d.ts +95 -0
  124. package/src/utils/address.ts +17 -0
  125. package/src/utils/cipher.ts +61 -0
  126. package/src/utils/form.ts +155 -0
  127. package/src/utils/httpEnum.ts +31 -0
  128. package/src/utils/image.ts +21 -0
  129. package/src/utils/index.ts +111 -0
  130. package/src/utils/request.ts +139 -0
  131. package/src/utils/requestCancelHandle.ts +67 -0
  132. package/stylelint.config.js +87 -0
  133. package/tsconfig.docs.json +11 -0
  134. package/tsconfig.json +30 -0
  135. package/typedoc.json +6 -0
  136. package/vite.config.ts +55 -0
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
@@ -0,0 +1,113 @@
1
+ {
2
+ "globals": {
3
+ "Component": true,
4
+ "ComponentPublicInstance": true,
5
+ "ComputedRef": true,
6
+ "DirectiveBinding": true,
7
+ "EffectScope": true,
8
+ "ExtractDefaultPropTypes": true,
9
+ "ExtractPropTypes": true,
10
+ "ExtractPublicPropTypes": true,
11
+ "InjectionKey": true,
12
+ "MaybeRef": true,
13
+ "MaybeRefOrGetter": true,
14
+ "PropType": true,
15
+ "Ref": true,
16
+ "Slot": true,
17
+ "Slots": true,
18
+ "VNode": true,
19
+ "WritableComputedRef": true,
20
+ "acceptHMRUpdate": true,
21
+ "computed": true,
22
+ "createApp": true,
23
+ "createPinia": true,
24
+ "customRef": true,
25
+ "defineAsyncComponent": true,
26
+ "defineComponent": true,
27
+ "defineStore": true,
28
+ "effectScope": true,
29
+ "getActivePinia": true,
30
+ "getCurrentInstance": true,
31
+ "getCurrentScope": true,
32
+ "h": true,
33
+ "inject": true,
34
+ "isProxy": true,
35
+ "isReactive": true,
36
+ "isReadonly": true,
37
+ "isRef": true,
38
+ "mapActions": true,
39
+ "mapGetters": true,
40
+ "mapState": true,
41
+ "mapStores": true,
42
+ "mapWritableState": true,
43
+ "markRaw": true,
44
+ "nextTick": true,
45
+ "onActivated": true,
46
+ "onAddToFavorites": true,
47
+ "onBackPress": true,
48
+ "onBeforeMount": true,
49
+ "onBeforeUnmount": true,
50
+ "onBeforeUpdate": true,
51
+ "onDeactivated": true,
52
+ "onError": true,
53
+ "onErrorCaptured": true,
54
+ "onHide": true,
55
+ "onLaunch": true,
56
+ "onLoad": true,
57
+ "onMounted": true,
58
+ "onNavigationBarButtonTap": true,
59
+ "onNavigationBarSearchInputChanged": true,
60
+ "onNavigationBarSearchInputClicked": true,
61
+ "onNavigationBarSearchInputConfirmed": true,
62
+ "onNavigationBarSearchInputFocusChanged": true,
63
+ "onPageNotFound": true,
64
+ "onPageScroll": true,
65
+ "onPullDownRefresh": true,
66
+ "onReachBottom": true,
67
+ "onReady": true,
68
+ "onRenderTracked": true,
69
+ "onRenderTriggered": true,
70
+ "onResize": true,
71
+ "onScopeDispose": true,
72
+ "onServerPrefetch": true,
73
+ "onShareAppMessage": true,
74
+ "onShareTimeline": true,
75
+ "onShow": true,
76
+ "onTabItemTap": true,
77
+ "onThemeChange": true,
78
+ "onUnhandledRejection": true,
79
+ "onUnload": true,
80
+ "onUnmounted": true,
81
+ "onUpdated": true,
82
+ "onWatcherCleanup": true,
83
+ "provide": true,
84
+ "reactive": true,
85
+ "readonly": true,
86
+ "ref": true,
87
+ "resolveComponent": true,
88
+ "setActivePinia": true,
89
+ "setMapStoreSuffix": true,
90
+ "shallowReactive": true,
91
+ "shallowReadonly": true,
92
+ "shallowRef": true,
93
+ "storeToRefs": true,
94
+ "toRaw": true,
95
+ "toRef": true,
96
+ "toRefs": true,
97
+ "toValue": true,
98
+ "triggerRef": true,
99
+ "unref": true,
100
+ "useAttrs": true,
101
+ "useCssModule": true,
102
+ "useCssVars": true,
103
+ "useId": true,
104
+ "useModel": true,
105
+ "useSlots": true,
106
+ "useStore": true,
107
+ "useTemplateRef": true,
108
+ "watch": true,
109
+ "watchEffect": true,
110
+ "watchPostEffect": true,
111
+ "watchSyncEffect": true
112
+ }
113
+ }
package/.eslintrc.js ADDED
@@ -0,0 +1,121 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ browser: true,
6
+ es2020: true
7
+ },
8
+ globals: {
9
+ $: 'readonly',
10
+ $$: 'readonly',
11
+ $ref: 'readonly',
12
+ $shallowRef: 'readonly',
13
+ $computed: 'readonly',
14
+ Fn: 'readonly',
15
+ PromiseFn: 'readonly',
16
+ RefType: 'readonly',
17
+ LabelValueOptions: 'readonly',
18
+ EmitType: 'readonly',
19
+ TargetContext: 'readonly',
20
+ ComponentElRef: 'readonly',
21
+ ComponentRef: 'readonly',
22
+ ElRef: 'readonly',
23
+ global: 'readonly',
24
+ ForDataType: 'readonly',
25
+ ComponentRoutes: 'readonly',
26
+ defineProps: 'readonly',
27
+ defineEmits: 'readonly',
28
+ defineExpose: 'readonly',
29
+ withDefaults: 'readonly',
30
+ },
31
+ extends: [
32
+ 'eslint:recommended',
33
+ 'plugin:vue/vue3-recommended', // 使用vue3-recommended替代vue3-essential
34
+ '@vue/typescript/recommended',
35
+ 'plugin:@typescript-eslint/recommended',
36
+ 'plugin:prettier/recommended'
37
+ ],
38
+ parserOptions: {
39
+ ecmaVersion: 2020,
40
+ sourceType: 'module',
41
+ ecmaFeatures: {
42
+ jsx: false
43
+ }
44
+ },
45
+ overrides: [
46
+ {
47
+ files: ['*.ts', '*.vue'],
48
+ rules: {
49
+ 'no-undef': 'off',
50
+ },
51
+ },
52
+ {
53
+ files: ['*.vue'],
54
+ parser: 'vue-eslint-parser',
55
+ parserOptions: {
56
+ parser: '@typescript-eslint/parser',
57
+ extraFileExtensions: ['.vue'],
58
+ ecmaVersion: 'latest',
59
+ ecmaFeatures: {
60
+ jsx: false,
61
+ },
62
+ },
63
+ rules: {
64
+ 'no-undef': 'off',
65
+ },
66
+ },
67
+ ],
68
+ rules: {
69
+ // 确保这些基础规则开启
70
+ 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
71
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
72
+
73
+ // Vue相关规则
74
+ 'vue/multi-word-component-names': 'off',
75
+ 'vue/no-v-html': 'off',
76
+ 'vue/require-default-prop': 'off',
77
+ 'vue/require-explicit-emits': 'off',
78
+
79
+ // TypeScript相关规则
80
+ '@typescript-eslint/no-explicit-any': 'off',
81
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
82
+ '@typescript-eslint/no-non-null-assertion': 'off',
83
+
84
+ 'vue/html-self-closing': [
85
+ 'error',
86
+ {
87
+ html: {
88
+ void: 'always',
89
+ normal: 'always',
90
+ component: 'always',
91
+ },
92
+ svg: 'always',
93
+ math: 'always',
94
+ },
95
+ ],
96
+ '@typescript-eslint/no-unused-vars': [
97
+ 'error',
98
+ {
99
+ argsIgnorePattern: '^_',
100
+ varsIgnorePattern: '^_',
101
+ },
102
+ ],
103
+ 'no-unused-vars': [
104
+ 'error',
105
+ {
106
+ argsIgnorePattern: '^_',
107
+ varsIgnorePattern: '^_',
108
+ },
109
+ ],
110
+ 'prettier/prettier': [
111
+ 'error',
112
+ {
113
+ semi: false,
114
+ singleQuote: true,
115
+ trailingComma: 'all',
116
+ },
117
+ ],
118
+ 'linebreak-style': ['error', 'windows'],
119
+ 'prettier/prettier': ['error', { endOfLine: 'auto' }]
120
+ },
121
+ }
package/.prettierrc.js ADDED
@@ -0,0 +1,9 @@
1
+ // @ts-check
2
+
3
+ /** @type {import("prettier").Config} */
4
+ export default {
5
+ bracketSpacing: true,
6
+ singleQuote: false,
7
+ arrowParens: "avoid",
8
+ trailingComma: "none"
9
+ };
@@ -0,0 +1,4 @@
1
+ /dist/*
2
+ /public/*
3
+ public/*
4
+ src/style/reset.scss
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # chengyi-weixinapp-web
2
+
3
+
4
+ ## 项目简介
5
+
6
+ 主要使用 uni-app 开发,微信小程序作为平台。
7
+
8
+ UI 框架使用 vant-weapp + uni内置组件。
9
+
10
+ ## 开发环境
11
+
12
+ - 微信开发者工具 v3.1.10
13
+ - Node.js v20
14
+ - npm v10.2.3
15
+
16
+ ## 项目运行
17
+
18
+ 1. 克隆项目到本地
19
+
20
+ ```bash
21
+ ## 项目运行
22
+
23
+ 1. 克隆项目到本地
24
+
25
+ ```bash
26
+ git clone URL_ADDRESSgit clone https://github.com/chengyi001/chengyi-weixinapp-web.git
27
+ ```
28
+
29
+ 2. 安装依赖
30
+
31
+ ```bash
32
+ npm install
33
+ ```
34
+
35
+ 3. 运行项目
36
+
37
+ ```bash
38
+ npm run dev:mp-weixin
39
+ ```
40
+
41
+ 4. 打开微信开发者工具,导入项目
42
+
43
+ 5. 运行项目
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // Generated by vite-plugin-uni-components
5
+ // Read more: https://github.com/vuejs/core/pull/3399
6
+ export {}
7
+
8
+ declare module 'vue' {
9
+ export interface GlobalComponents {
10
+ ConfirmDialog: typeof import('./src/components/ConfirmDialog.vue')['default']
11
+ DaySelect: typeof import('./src/components/DaySelect.vue')['default']
12
+ Drawer: typeof import('./src/components/Drawer.vue')['default']
13
+ DrawerSelect: typeof import('./src/components/DrawerSelect.vue')['default']
14
+ DropMenu: typeof import('./src/components/DropMenu.vue')['default']
15
+ Empty: typeof import('./src/components/Empty.vue')['default']
16
+ Loading: typeof import('./src/components/Loading.vue')['default']
17
+ RippleBtn: typeof import('./src/components/RippleBtn.vue')['default']
18
+ SinglePick: typeof import('./src/components/SinglePick.vue')['default']
19
+ Skeleton: typeof import('./src/components/Skeleton.vue')['default']
20
+ Timeline: typeof import('./src/components/Timeline.vue')['default']
21
+ Upload: typeof import('./src/components/Upload.vue')['default']
22
+ }
23
+ }
package/index.html ADDED
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <script>
6
+ var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
7
+ CSS.supports('top: constant(a)'))
8
+ document.write(
9
+ '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
10
+ (coverSupport ? ', viewport-fit=cover' : '') + '" />')
11
+ </script>
12
+ <title></title>
13
+ <!--preload-links-->
14
+ <!--app-context-->
15
+ </head>
16
+ <body>
17
+ <div id="app"><!--app-html--></div>
18
+ <script type="module" src="/src/main.ts"></script>
19
+ </body>
20
+ </html>
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "business_tms_program",
3
+ "version": "0.0.0",
4
+ "scripts": {
5
+ "dev:custom": "uni -p",
6
+ "dev:h5": "uni",
7
+ "dev:mp-weixin": "uni -p mp-weixin",
8
+ "build:h5": "uni build",
9
+ "build:mp-weixin": "uni build -p mp-weixin",
10
+ "type-check": "vue-tsc --noEmit",
11
+ "lint": "eslint --ext .js,.ts,.vue src",
12
+ "lint:fix": "eslint --fix --ext .js,.ts,.vue src",
13
+ "docs": "typedoc --tsconfig tsconfig.docs.json --options typedoc.json"
14
+ },
15
+ "dependencies": {
16
+ "@dcloudio/uni-app": "3.0.0-4060620250520001",
17
+ "@dcloudio/uni-app-harmony": "3.0.0-4060620250520001",
18
+ "@dcloudio/uni-app-plus": "3.0.0-4060620250520001",
19
+ "@dcloudio/uni-components": "3.0.0-4060620250520001",
20
+ "@dcloudio/uni-h5": "3.0.0-4060620250520001",
21
+ "@dcloudio/uni-mp-alipay": "3.0.0-4060620250520001",
22
+ "@dcloudio/uni-mp-baidu": "3.0.0-4060620250520001",
23
+ "@dcloudio/uni-mp-harmony": "3.0.0-4060620250520001",
24
+ "@dcloudio/uni-mp-jd": "3.0.0-4060620250520001",
25
+ "@dcloudio/uni-mp-kuaishou": "3.0.0-4060620250520001",
26
+ "@dcloudio/uni-mp-lark": "3.0.0-4060620250520001",
27
+ "@dcloudio/uni-mp-qq": "3.0.0-4060620250520001",
28
+ "@dcloudio/uni-mp-toutiao": "3.0.0-4060620250520001",
29
+ "@dcloudio/uni-mp-weixin": "3.0.0-4060620250520001",
30
+ "@dcloudio/uni-mp-xhs": "3.0.0-4060620250520001",
31
+ "@dcloudio/uni-quickapp-webview": "3.0.0-4060620250520001",
32
+ "@dcloudio/uni-ui": "^1.4.20",
33
+ "chengyi-frondend-monitor-sdk": "1.0.37",
34
+ "crypto-js": "^4.2.0",
35
+ "less": "^4.3.0",
36
+ "lodash-es": "^4.17.21",
37
+ "pinia": "^3.0.2",
38
+ "pinia-plugin-persist-uni": "^1.3.1",
39
+ "tslib": "^2.8.1",
40
+ "uuid": "^11.1.0",
41
+ "vue": "^3.4.21",
42
+ "vue-i18n": "^9.1.9"
43
+ },
44
+ "devDependencies": {
45
+ "@dcloudio/types": "^3.4.8",
46
+ "@dcloudio/uni-automator": "3.0.0-4060620250520001",
47
+ "@dcloudio/uni-cli-shared": "3.0.0-4060620250520001",
48
+ "@dcloudio/uni-stacktracey": "3.0.0-4060620250520001",
49
+ "@dcloudio/vite-plugin-uni": "3.0.0-4060620250520001",
50
+ "@types/crypto-js": "^4.2.2",
51
+ "@types/lodash-es": "^4.17.12",
52
+ "@uni-helper/vite-plugin-uni-components": "^0.2.0",
53
+ "@vue/runtime-core": "^3.4.21",
54
+ "@vue/tsconfig": "^0.1.3",
55
+ "sass": "^1.71.0",
56
+ "sass-loader": "10.1.1",
57
+ "stylelint": "^16.18.0",
58
+ "stylelint-config-recess-order": "^6.0.0",
59
+ "stylelint-config-recommended-vue": "^1.6.0",
60
+ "stylelint-config-standard-scss": "^14.0.0",
61
+ "stylelint-prettier": "^5.0.3",
62
+ "typedoc": "^0.25.0",
63
+ "typedoc-plugin-markdown": "^3.16.0",
64
+ "typescript": "5.1.6",
65
+ "unplugin-auto-import": "^19.1.2",
66
+ "unplugin-vue-components": "0.26.0",
67
+ "vite": "5.2.8",
68
+ "vue-tsc": "^1.0.24"
69
+ }
70
+ }
package/shims-uni.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /// <reference types='@dcloudio/types' />
2
+ import 'vue'
3
+
4
+ declare module '@vue/runtime-core' {
5
+ type Hooks = App.AppInstance & Page.PageInstance;
6
+
7
+ interface ComponentCustomOptions extends Hooks {
8
+
9
+ }
10
+ }
package/src/App.vue ADDED
@@ -0,0 +1,81 @@
1
+ <script setup lang="ts">
2
+ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app';
3
+ import { useUserStore } from '@/stores/modules/user';
4
+ import { initMonitor, getMonitor } from 'chengyi-frondend-monitor-sdk';
5
+ import { APPID } from '@/config/app';
6
+ import context from '@/api/context'
7
+ const useStore = useUserStore();
8
+ function checkUpdate() {
9
+ const updateManager = uni.getUpdateManager()
10
+
11
+ updateManager.onCheckForUpdate(function (res) {
12
+ // 请求完新版本信息的回调
13
+ // console.log({ res })
14
+ })
15
+
16
+ updateManager.onUpdateReady(function () {
17
+ uni.showModal({
18
+ title: '更新提示',
19
+ content: '新版本已经准备好,是否重启应用?',
20
+ success(res) {
21
+ if (res.confirm) {
22
+ // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
23
+ updateManager.applyUpdate()
24
+ }
25
+ },
26
+ })
27
+ })
28
+
29
+ updateManager.onUpdateFailed(function (err) {
30
+ // 新的版本下载失败
31
+ console.warn({ err })
32
+ })
33
+ }
34
+ // 检查登录状态
35
+ // onShow(() => {
36
+ // const token = useStore.getToken
37
+ // if (!token) {
38
+ // uni.navigateTo({ url: '/pages/user/login' })
39
+ // } else {
40
+ // useStore.getLoginInfo()
41
+ // }
42
+ // })
43
+ onLaunch(() => {
44
+ checkUpdate()
45
+ const token = useStore.getToken
46
+ if (!token) {
47
+ uni.navigateTo({ url: '/pages/user/login' })
48
+ } else {
49
+ useStore.getLoginInfo()
50
+ }
51
+ initMonitor({
52
+ appId: APPID,
53
+ reportUrl: context.generalApi + '/frondMonitor/send',
54
+ environment: "production",
55
+ headers: {
56
+ "X-APP-ID": APPID,
57
+ "X-Perms": "oms:general:frondMonitor:send",
58
+ Authorization: uni.getStorageSync('token') || ""
59
+ },
60
+ performanceSampleRate: 1,
61
+ enablePerformance: false,
62
+ enableError: true
63
+ })
64
+ });
65
+ onError((err: any) => {
66
+ const monitor = getMonitor()
67
+ const msg = err?.message || String(err)
68
+ const router = getCurrentPages() || []
69
+ monitor.error(msg, {
70
+ type: 'app_error',
71
+ message: err?.message || String(err),
72
+ stack: err?.stack,
73
+ resource: router[0]?.__route__ || ''
74
+ })
75
+ })
76
+ onHide(() => {});
77
+ </script>
78
+
79
+ <style lang="less">
80
+ @import '@/styles/index.less';
81
+ </style>
@@ -0,0 +1,184 @@
1
+ import context from "@/api/context";
2
+ import http from "@/utils/request";
3
+ import type {
4
+ orderStatus,
5
+ workForm,
6
+ isCollectMaterials,
7
+ isSolveOnce,
8
+ workFormEnum,
9
+ } from "@/dict/afterSale";
10
+ const orderApi = context.basicApi + "/after/order/applet";
11
+
12
+ type orderParams = {
13
+ size: number;
14
+ current: number;
15
+ userCode?: string;
16
+ status?: number;
17
+ };
18
+
19
+ export type orderRecord = {
20
+ id: number;
21
+ orderCode: string;
22
+ deviceCode: string;
23
+ customerName: string;
24
+ responsiblePerson: string;
25
+ executionMemberList: [string];
26
+ statusDescription: string;
27
+ orderStatus: orderStatus;
28
+ serviceType: number;
29
+ workForm: workForm;
30
+ problemsAnalysis: string;
31
+ processingResult: string;
32
+ isCollectMaterials: isCollectMaterials;
33
+ isSolveOnce: isSolveOnce;
34
+ acceptanceTime: string;
35
+ completionTime: string;
36
+ contactsName: string;
37
+ contactsMobile: string;
38
+ deviceAddress: string;
39
+ deviceName: string;
40
+ };
41
+ type orderRes = {
42
+ current: number;
43
+ size: number;
44
+ total: number;
45
+ pages: number;
46
+ records: [orderRecord];
47
+ };
48
+
49
+ export function getOrderList(data: orderParams): Promise<orderRes> {
50
+ return http.post({
51
+ url: `${orderApi}/pageListByUserOrder`,
52
+ data: { ...data }, // 展开参数对象
53
+ }, {
54
+ permActionName: 'getAfterSaleOrderList'
55
+ });
56
+ }
57
+
58
+ interface detailRes {
59
+ orderCode: string;
60
+ deviceCode: string;
61
+ customerName: string;
62
+ deviceName: string;
63
+ deviceAddress: string;
64
+ contactsName: string;
65
+ contactsMobile: string;
66
+ regionDictLabelName: string;
67
+ responsiblePersonInfo: any;
68
+ executionMemberList: [string];
69
+ statusDescription: string;
70
+ imageList: any[];
71
+ orderStatus: number;
72
+ workNodeStatus: number;
73
+ finishNodeVO: {
74
+ id: 0;
75
+ workNode: 0;
76
+ serviceType: 0;
77
+ workForm: number | undefined;
78
+ arrivalTime: "2025-05-12T01:53:51.439Z";
79
+ problemsAnalysis: string;
80
+ processingResult: string;
81
+ workOrderProblemClassification: string;
82
+ materialsReceived: string;
83
+ materialImageUrlVO: [string];
84
+ completionTime: "2025-05-12T01:53:51.439Z";
85
+ isSolveOnce: 0;
86
+ arrivalWatermarkPhotoVO: [string];
87
+ completionWatermarkPhotoVO: [string];
88
+ };
89
+ orderNodeVO: {
90
+ acceptDate: "2025-05-12T01:53:51.439Z";
91
+ };
92
+ returnNodeVO: {
93
+ id: 0;
94
+ isResolve: 0;
95
+ isSatisfied: 0;
96
+ isOverdue: 0;
97
+ remark: string;
98
+ imageListVO: [string];
99
+ };
100
+ orderNode: {
101
+ acceptDate: "2025-05-12T01:53:51.439Z";
102
+ };
103
+ }
104
+
105
+ export function getOrderDetail(data: {
106
+ id: number | string;
107
+ }): Promise<detailRes> {
108
+ return http.post({
109
+ url: `${orderApi}/detail`,
110
+ data: { ...data }, // 展开参数对象
111
+ }, {
112
+ permActionName: 'getAfterSaleOrderDetail'
113
+ });
114
+ }
115
+
116
+ export function handleOrder(data: { id: number | string }): Promise<boolean> {
117
+ return http.post({
118
+ url: `${orderApi}/afterSalesOrder`,
119
+ data: { ...data }, // 展开参数对象
120
+ },{
121
+ permActionName: 'handleAfterSaleOrder'
122
+ });
123
+ }
124
+
125
+ export interface addFinishRecordParams {
126
+ id: number | string;
127
+ workNode: number;
128
+ serviceType: string;
129
+ workForm: workFormEnum;
130
+ arrivalTime: string;
131
+ problemsAnalysis: string;
132
+ processingResult: string;
133
+ workOrderProblemClassification: string;
134
+ materialsReceived: string;
135
+ materialImageUrl: string[];
136
+ completionTime: string;
137
+ isSolveOnce: number;
138
+ arrivalWatermarkPhoto: string[];
139
+ completionWatermarkPhoto: string[];
140
+ }
141
+ export function addFinishRecord(data: addFinishRecordParams): Promise<boolean> {
142
+ return http.post({
143
+ url: `${orderApi}/addFinishRecord`,
144
+ data: { ...data }, // 展开参数对象
145
+ }, {
146
+ permActionName: 'addFinishRecord'
147
+ });
148
+ }
149
+
150
+ export interface addReturnRecordParams {
151
+ id: number | string;
152
+ isResolve: number;
153
+ isSatisfied: number;
154
+ isOverdue: number;
155
+ remark?: string;
156
+ imageList?: string[];
157
+ returnTime: string;
158
+ }
159
+ export function addReturnRecord(data: addReturnRecordParams): Promise<boolean> {
160
+ return http.post({
161
+ url: `${orderApi}/addReturnRecord`,
162
+ data: { ...data }, // 展开参数对象
163
+ }, {
164
+ permActionName: 'addReturnRecord'
165
+ });
166
+ }
167
+
168
+ export type addOrderParams = {
169
+ orderCode?: string;
170
+ deviceCode: string;
171
+ customerName: string;
172
+ responsiblePerson: string;
173
+ executionMemberList: Array<string>;
174
+ statusDescription: string;
175
+ imageUploadList?: Array<string>;
176
+ orderStatus?: 0;
177
+ createBy?: 0;
178
+ };
179
+ export function addOrder(data: addOrderParams): Promise<{ id: boolean }> {
180
+ return http.post({
181
+ url: `${context.basicApi}/after/order/add`,
182
+ data: { ...data }, // 展开参数对象
183
+ });
184
+ }