xyvcard-channel-mp 0.1.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 (66) hide show
  1. package/.cache/wx-development-none__compiler1__/0.pack +0 -0
  2. package/.cache/wx-development-none__compiler1__/1.pack +0 -0
  3. package/.cache/wx-development-none__compiler1__/10.pack +0 -0
  4. package/.cache/wx-development-none__compiler1__/11.pack +0 -0
  5. package/.cache/wx-development-none__compiler1__/12.pack +0 -0
  6. package/.cache/wx-development-none__compiler1__/13.pack +0 -0
  7. package/.cache/wx-development-none__compiler1__/14.pack +0 -0
  8. package/.cache/wx-development-none__compiler1__/15.pack +0 -0
  9. package/.cache/wx-development-none__compiler1__/16.pack +0 -0
  10. package/.cache/wx-development-none__compiler1__/2.pack +0 -0
  11. package/.cache/wx-development-none__compiler1__/3.pack +0 -0
  12. package/.cache/wx-development-none__compiler1__/4.pack +0 -0
  13. package/.cache/wx-development-none__compiler1__/5.pack +0 -0
  14. package/.cache/wx-development-none__compiler1__/6.pack +0 -0
  15. package/.cache/wx-development-none__compiler1__/7.pack +0 -0
  16. package/.cache/wx-development-none__compiler1__/8.pack +0 -0
  17. package/.cache/wx-development-none__compiler1__/9.pack +0 -0
  18. package/.cache/wx-development-none__compiler1__/index.pack +0 -0
  19. package/.cache/wx-development-none__compiler1__/index.pack.old +0 -0
  20. package/.cache/wx-production-production__compiler1__/0.pack +0 -0
  21. package/.cache/wx-production-production__compiler1__/1.pack +0 -0
  22. package/.cache/wx-production-production__compiler1__/2.pack +0 -0
  23. package/.cache/wx-production-production__compiler1__/3.pack +0 -0
  24. package/.cache/wx-production-production__compiler1__/4.pack +0 -0
  25. package/.cache/wx-production-production__compiler1__/5.pack +0 -0
  26. package/.cache/wx-production-production__compiler1__/6.pack +0 -0
  27. package/.cache/wx-production-production__compiler1__/index.pack +0 -0
  28. package/.cache/wx-production-production__compiler1__/index.pack.old +0 -0
  29. package/.editorconfig +9 -0
  30. package/README.md +28 -0
  31. package/babel.config.json +34 -0
  32. package/eslint.config.mjs +7 -0
  33. package/mpx.config.js +45 -0
  34. package/package.json +63 -0
  35. package/postcss.config.js +11 -0
  36. package/public/index.html +15 -0
  37. package/src/api/channel/index.ts +107 -0
  38. package/src/api/channel/types.ts +310 -0
  39. package/src/api/channelConstant.ts +25 -0
  40. package/src/app.mpx +51 -0
  41. package/src/components/comman/balance-item.mpx +105 -0
  42. package/src/components/comman/earnings-item.mpx +137 -0
  43. package/src/components/comman/salsesman-item.mpx +84 -0
  44. package/src/components/home/earnings-list.mpx +99 -0
  45. package/src/components/home/my-performance.mpx +197 -0
  46. package/src/components/home/my-salesman.mpx +136 -0
  47. package/src/components/home/topInfo.mpx +229 -0
  48. package/src/global.d.ts +4 -0
  49. package/src/pages/home.mpx +210 -0
  50. package/src/pages/index.mpx +117 -0
  51. package/src/pages/joinUs.mpx +420 -0
  52. package/src/pages/order-detail.mpx +385 -0
  53. package/src/pages/performance.mpx +608 -0
  54. package/src/pages/salesman.mpx +132 -0
  55. package/src/pages/settlement-detail.mpx +102 -0
  56. package/src/pages/withdraw.mpx +246 -0
  57. package/src/styles/index.scss +38 -0
  58. package/src/styles/vars.scss +27 -0
  59. package/src/utils/config.ts +147 -0
  60. package/static/ali/mini.project.json +4 -0
  61. package/static/dd/project.config.json +15 -0
  62. package/static/swan/project.swan.json +14 -0
  63. package/static/tt/project.config.json +11 -0
  64. package/static/wx/project.config.json +41 -0
  65. package/tsconfig.json +29 -0
  66. package/uno.config.js +13 -0
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
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
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # mpx-project
2
+
3
+ ## Project setup
4
+
5
+ ```javascript
6
+ // 开发构建,默认输出微信小程序
7
+ npm run serve
8
+
9
+ // 开发构建,跨平台输出支付宝小程序
10
+ npm run serve:ali
11
+
12
+ // 开发构建,跨平台输出 Web
13
+ npm run serve:web
14
+
15
+ // 开发构建,跨平台输出其他平台小程序target = swan|tt|qq|jd|ks
16
+ npm run serve -- --targets={target}
17
+
18
+ // 开发构建,同时输出多平台产物
19
+ npm run serve -- --targets=wx,ali,web
20
+
21
+ // 生产构建,默认输出微信小程序
22
+ npm run build
23
+
24
+ // 生产构建,跨平台输出
25
+ npm run build:ali
26
+ npm run build:web
27
+ npm run build -- --targets=wx,ali,web
28
+ ```
@@ -0,0 +1,34 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "modules": false,
7
+ "shippedProposals": true
8
+ }
9
+ ],
10
+ ],
11
+ "plugins": [
12
+ [
13
+ "@babel/transform-runtime",
14
+ {
15
+ "corejs": 3,
16
+ "version": "^7.10.4"
17
+ }
18
+ ],
19
+ "@mpxjs/babel-plugin-inject-page-events",
20
+ ],
21
+ "sourceType": "unambiguous",
22
+ "env": {
23
+ "test": {
24
+ "presets": [
25
+ [
26
+ "@babel/env",
27
+ {
28
+ "shippedProposals": true
29
+ }
30
+ ]
31
+ ]
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ import { mpxConfig } from '@mpxjs/eslint-config'
2
+ export default mpxConfig(
3
+ {
4
+ mpx: true,
5
+ typescript: true
6
+ }
7
+ )
package/mpx.config.js ADDED
@@ -0,0 +1,45 @@
1
+ const { defineConfig } = require('@vue/cli-service')
2
+ module.exports = defineConfig({
3
+ transpileDependencies: [
4
+ 'jmash-core-mp',
5
+ 'xyvcard-mall-mp',
6
+ '@mpxjs/mpx-cube-ui',
7
+ 'pinia',
8
+ 'vue-demi',
9
+ ],
10
+ outputDir: `dist/${process.env.MPX_CURRENT_TARGET_MODE}`,
11
+ pluginOptions: {
12
+ mpx: {
13
+ plugin: {
14
+ srcMode: 'wx',
15
+ hackResolveBuildDependencies: ({ files, resolveDependencies }) => {
16
+ const path = require('path')
17
+ const packageJSONPath = path.resolve('package.json')
18
+ if (files.has(packageJSONPath)) files.delete(packageJSONPath)
19
+ if (resolveDependencies.files.has(packageJSONPath)) {
20
+ resolveDependencies.files.delete(packageJSONPath)
21
+ }
22
+ }
23
+ },
24
+ loader: {},
25
+ unocss: {}
26
+ }
27
+ },
28
+ chainWebpack(config) {
29
+ const rules = config.module.rules;
30
+ rules.store.forEach((rule) => {
31
+ if (!rule || !rule.uses) return;
32
+ const use = rule.uses.get("ts-loader");
33
+ if (!use) return;
34
+ use.tap((options = {}) => ({
35
+ ...options,
36
+ allowTsInNodeModules: true,
37
+ }));
38
+ });
39
+ },
40
+ /**
41
+ * 如果希望node_modules下的文件时对应的缓存可以失效,
42
+ * 可以将configureWebpack.snap.managedPaths修改为 []
43
+ */
44
+ configureWebpack(config) {}
45
+ })
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "xyvcard-channel-mp",
3
+ "version": "0.1.0",
4
+ "dependencies": {
5
+ "@mpxjs/api-proxy": "^2.10.0",
6
+ "@mpxjs/core": "^2.10.0",
7
+ "@mpxjs/fetch": "^2.10.0",
8
+ "@mpxjs/pinia": "^2.10.0",
9
+ "@mpxjs/store": "^2.10.0",
10
+ "@mpxjs/utils": "^2.10.0",
11
+ "@mpxjs/mpx-cube-ui": "^1.4.15",
12
+ "pinia": "^2.0.14",
13
+ "vue": "^2.7.0",
14
+ "vue-demi": "^0.14.6",
15
+ "vue-i18n": "^8.27.2",
16
+ "vue-i18n-bridge": "^9.2.2",
17
+ "vue-router": "^3.1.3",
18
+ "jmash-core-mp": "^0.1.28",
19
+ "jmash-diy-mp": "^0.1.8",
20
+ "xyvcard-mall-mp": "^0.1.42"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/core": "^7.10.4",
24
+ "@babel/plugin-transform-runtime": "^7.10.4",
25
+ "@babel/preset-env": "^7.10.4",
26
+ "@babel/runtime-corejs3": "^7.10.4",
27
+ "@mpxjs/babel-plugin-inject-page-events": "^2.9.0",
28
+ "@mpxjs/eslint-config": "^2.0.3",
29
+ "@mpxjs/mpx-cli-service": "^2.0.0",
30
+ "@mpxjs/size-report": "^2.10.0",
31
+ "@mpxjs/unocss-base": "^2.9.0",
32
+ "@mpxjs/unocss-plugin": "^2.9.0",
33
+ "@mpxjs/vue-cli-plugin-mpx": "^2.0.0",
34
+ "@mpxjs/vue-cli-plugin-mpx-eslint": "^2.0.0",
35
+ "@mpxjs/vue-cli-plugin-mpx-typescript": "^2.0.0",
36
+ "@mpxjs/vue-cli-plugin-mpx-utility-first-css": "^2.0.0",
37
+ "@mpxjs/webpack-plugin": "^2.10.0",
38
+ "@vue/cli-service": "~5.0.0",
39
+ "autoprefixer": "^10.2.4",
40
+ "eslint": "^9.0.0",
41
+ "postcss": "^8.2.6",
42
+ "process": "^0.11.10",
43
+ "sass": "^1.99.0",
44
+ "sass-loader": "^16.0.7",
45
+ "stylus": "^0.55.0",
46
+ "stylus-loader": "^6.1.0",
47
+ "typescript": "^4.1.3",
48
+ "webpack": "^5.43.0"
49
+ },
50
+ "browserslist": [
51
+ "ios >= 8",
52
+ "chrome >= 47"
53
+ ],
54
+ "scripts": {
55
+ "serve": "mpx-cli-service serve",
56
+ "build": "mpx-cli-service build",
57
+ "lint": "eslint --ext .js,.ts,.mpx src/",
58
+ "build:ali": "mpx-cli-service build --targets=ali",
59
+ "build:web": "mpx-cli-service build --targets=web",
60
+ "serve:ali": "mpx-cli-service serve --targets=ali",
61
+ "serve:web": "mpx-cli-service serve --targets=web"
62
+ }
63
+ }
@@ -0,0 +1,11 @@
1
+ const autoprefixer = require('autoprefixer')
2
+ const RN = ['android', 'ios', 'harmony']
3
+ const isRN = RN.includes(
4
+ process.env.MPX_CURRENT_TARGET_MODE
5
+ )
6
+ // RN环境下去除postcss的autoprefix插件
7
+ module.exports = {
8
+ plugins: [
9
+ !isRN && autoprefixer({ remove: false })
10
+ ].filter(Boolean)
11
+ }
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport"
6
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover">
7
+ <meta name="format-detection" content="telephone=no">
8
+ <meta name="x5-cache" content="disable">
9
+ <title></title>
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ <!-- built files will be auto injected -->
14
+ </body>
15
+ </html>
@@ -0,0 +1,107 @@
1
+ import mpx from "@mpxjs/core";
2
+ import { config, grpc, ResponseData } from "jmash-core-mp";
3
+ import {
4
+ ChannelParentSalesModel,
5
+ ChannelSalesApplyReq,
6
+ ChannelSalesKey,
7
+ ChannelSalesModel,
8
+ ChannelRevenueStatQuery,
9
+ ChannelChannelRevenueStatPage,
10
+ ChannelMySalesQuery,
11
+ ChannelMySalesPage,
12
+ ChannelRevenueStatByIdQuery,
13
+ ChannelChannelRevenueStatModel,
14
+ } from "./types";
15
+
16
+ class ChannelApiImpl {
17
+ // 查询我的业务员信息
18
+ findMyChannelSalesInfo(
19
+ data: ChannelSalesKey
20
+ ): Promise<ResponseData<ChannelSalesModel>> {
21
+ data.tenant = data.tenant || config.tenant;
22
+ grpc.clearEmpty(data);
23
+ return mpx.xfetch.fetch({
24
+ url: "/v1/front/channel/channel_sales/my/" + data.tenant,
25
+ method: "GET",
26
+ data: data,
27
+ });
28
+ }
29
+
30
+ // 获取渠道分享Token【token缓存】
31
+ getChannelToken(data: ChannelSalesKey): Promise<ResponseData<string>> {
32
+ data.tenant = data.tenant || config.tenant;
33
+ return mpx.xfetch.fetch({
34
+ url: "/v1/front/channel/token/" + data.tenant,
35
+ method: "GET",
36
+ });
37
+ }
38
+
39
+ // 通过邀请ChannelToken获取渠道信息
40
+ getChannelShareInfo(
41
+ data: ChannelSalesKey
42
+ ): Promise<ResponseData<ChannelParentSalesModel>> {
43
+ data.tenant = data.tenant || config.tenant;
44
+ return mpx.xfetch.fetch({
45
+ url: "/v1/front/channel/share/" + data.tenant + "/" + data.accessToken,
46
+ method: "GET",
47
+ });
48
+ }
49
+
50
+ // 申请加入成为渠道业务员
51
+ channelSalesApply(
52
+ data: ChannelSalesApplyReq
53
+ ): Promise<ResponseData<ChannelSalesModel>> {
54
+ data.tenant = data.tenant || config.tenant;
55
+ grpc.clearEmpty(data);
56
+ return mpx.xfetch.fetch({
57
+ url: "/v1/front/channel/channel_sales/apply",
58
+ method: "POST",
59
+ data: data,
60
+ });
61
+ }
62
+
63
+ // 查询我的收益翻页信息
64
+ getMyRevenueStatPage(
65
+ data: ChannelRevenueStatQuery
66
+ ): Promise<ResponseData<ChannelChannelRevenueStatPage>> {
67
+ data.tenant = data.tenant || config.tenant;
68
+ grpc.clearEmpty(data);
69
+ const { tenant, ...queryParams } = data;
70
+ return mpx.xfetch.fetch({
71
+ url: "/v1/front/channel/my_revenue_stat/page/" + tenant,
72
+ method: "GET",
73
+ data: queryParams,
74
+ });
75
+ }
76
+
77
+ // 查询我的业务员翻页信息
78
+ getMySalesPage(
79
+ data: ChannelMySalesQuery
80
+ ): Promise<ResponseData<ChannelMySalesPage>> {
81
+ data.tenant = data.tenant || config.tenant;
82
+ grpc.clearEmpty(data);
83
+ const { tenant, ...queryParams } = data;
84
+ return mpx.xfetch.fetch({
85
+ url: "/v1/front/channel/my_sales/page/" + tenant,
86
+ method: "GET",
87
+ data: queryParams,
88
+ });
89
+ }
90
+
91
+ // 查询收益统计详情
92
+ getChannelRevenueStatById(
93
+ data: ChannelRevenueStatByIdQuery
94
+ ): Promise<ResponseData<ChannelChannelRevenueStatModel>> {
95
+ data.tenant = data.tenant || config.tenant;
96
+ grpc.clearEmpty(data);
97
+ const { tenant, revenueStatId, ...queryParams } = data;
98
+ return mpx.xfetch.fetch({
99
+ url: "/v1/front/channel/channel_revenue_stat/id/" + tenant + "/" + revenueStatId,
100
+ method: "GET",
101
+ data: queryParams,
102
+ });
103
+ }
104
+ }
105
+
106
+ const channelApi = new ChannelApiImpl();
107
+ export { channelApi };