component-shipinlv 0.1.10 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/AuthClient/qr/h5-we-public-login.js +5 -16
- package/dist/Buy/index.d.ts +1 -0
- package/dist/Buy/index.js +4 -0
- package/dist/UI/DialogDrawer.js +6 -4
- package/dist/UI/Money/index.css.d.ts +5 -0
- package/dist/UI/Money/index.css.js +6 -0
- package/dist/UI/Money/index.d.ts +11 -0
- package/dist/UI/Money/index.js +36 -0
- package/dist/VipList/index.css.d.ts +5 -0
- package/dist/VipList/index.css.js +6 -0
- package/dist/VipList/index.d.ts +12 -0
- package/dist/VipList/index.js +342 -0
- package/dist/config/apiUrls.js +1 -1
- package/dist/global.less +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/lib/Tool.js +12 -5
- package/dist/lib/moneySimple.d.ts +2 -0
- package/dist/lib/moneySimple.js +27 -0
- package/dist/service/api/VipPowerController.d.ts +3 -0
- package/dist/service/api/VipPowerController.js +27 -0
- package/dist/types/VipList.d.ts +8 -0
- package/dist/types/VipList.js +0 -0
- package/dist/types/VipPower.d.ts +45 -0
- package/dist/types/VipPower.js +0 -0
- package/dist/typings.d.ts +4 -1
- package/package.json +2 -3
@@ -9,27 +9,16 @@ var h5WePublicLogin = /*#__PURE__*/function () {
|
|
9
9
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
10
10
|
while (1) switch (_context.prev = _context.next) {
|
11
11
|
case 0:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
inviteUserId = Tool.getInviteUserId();
|
16
|
-
_context.next = 5;
|
17
|
-
return WechatController.h5WePublicLogin({
|
18
|
-
redirectUrl: redirectUrl,
|
19
|
-
inviteUserId: inviteUserId
|
20
|
-
}).catch(function () {});
|
21
|
-
case 5:
|
12
|
+
document.location.replace("https://auth.shanren.wang/auth/wechat/login?url=".concat(document.location.href));
|
13
|
+
return _context.abrupt("return");
|
14
|
+
case 7:
|
22
15
|
loginResult = _context.sent;
|
23
16
|
if (loginResult) {
|
24
|
-
_context.next =
|
17
|
+
_context.next = 10;
|
25
18
|
break;
|
26
19
|
}
|
27
20
|
return _context.abrupt("return");
|
28
|
-
case
|
29
|
-
// 因为 微信 会校验跳转域名,所以 用制定 中转;
|
30
|
-
|
31
|
-
document.location.href = loginResult.redirectUrl;
|
32
|
-
case 9:
|
21
|
+
case 10:
|
33
22
|
case "end":
|
34
23
|
return _context.stop();
|
35
24
|
}
|
package/dist/Buy/index.d.ts
CHANGED
package/dist/Buy/index.js
CHANGED
@@ -17,6 +17,8 @@ var Buy = function Buy(_ref) {
|
|
17
17
|
productCount = _ref$productCount === void 0 ? 1 : _ref$productCount,
|
18
18
|
_ref$disabled = _ref.disabled,
|
19
19
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
20
|
+
_ref$onBuySuccess = _ref.onBuySuccess,
|
21
|
+
onBuySuccess = _ref$onBuySuccess === void 0 ? function () {} : _ref$onBuySuccess,
|
20
22
|
children = _ref.children;
|
21
23
|
var onBuy = /*#__PURE__*/function () {
|
22
24
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
@@ -72,10 +74,12 @@ var Buy = function Buy(_ref) {
|
|
72
74
|
vipId: vipId,
|
73
75
|
productCount: productCount,
|
74
76
|
onHandlePaySuccess: function onHandlePaySuccess() {
|
77
|
+
onBuySuccess();
|
75
78
|
dialog.destroy();
|
76
79
|
Tool.toast('^_^,谢谢购买,祝您发财');
|
77
80
|
}
|
78
81
|
}),
|
82
|
+
zIndex: 5000,
|
79
83
|
width: Math.min(520, ((_ref3 = global || window) === null || _ref3 === void 0 ? void 0 : _ref3.innerWidth) * 0.95)
|
80
84
|
});
|
81
85
|
// 广播,点击了 购买;
|
package/dist/UI/DialogDrawer.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
3
|
import { Drawer, ConfigProvider } from 'antd';
|
3
4
|
import React, { useState, useEffect } from 'react';
|
@@ -52,18 +53,19 @@ var DialogDrawer = function DialogDrawer(props) {
|
|
52
53
|
}
|
53
54
|
},
|
54
55
|
children: /*#__PURE__*/_jsx(styles.DrawerDialog, {
|
55
|
-
children: /*#__PURE__*/_jsx(Drawer, {
|
56
|
-
className: "ktv-ai-drawerDialog ".concat(state.bgTheme, " ")
|
56
|
+
children: /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
57
|
+
className: "ktv-ai-drawerDialog ".concat(state.bgTheme, " ")
|
58
|
+
}, state), {}, {
|
57
59
|
title: state.title,
|
58
60
|
placement: state.placement,
|
59
61
|
closable: state.closable,
|
60
62
|
onClose: function onClose() {
|
61
63
|
return _onClose();
|
62
64
|
},
|
63
|
-
|
65
|
+
open: visible,
|
64
66
|
width: state.width,
|
65
67
|
children: props.content
|
66
|
-
})
|
68
|
+
}))
|
67
69
|
})
|
68
70
|
});
|
69
71
|
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const _default: {
|
3
|
+
money: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
4
|
+
};
|
5
|
+
export default _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
2
|
+
var _templateObject;
|
3
|
+
import styled from 'styled-components';
|
4
|
+
export default {
|
5
|
+
money: styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n .yen{\n font-size: smaller;\n opacity: 0.8;\n font-weight: 300;\n }\n .value{\n font-weight: bold;\n padding-left: 2px;\n padding-right: 1px;\n &.zero{\n font-weight: 300;\n }\n }\n "])))
|
6
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import styles from "./index.css";
|
2
|
+
import React from "react";
|
3
|
+
import moneySimple from "../../lib/moneySimple";
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
|
+
var Money = function Money(_ref) {
|
8
|
+
var _ref$pre = _ref.pre,
|
9
|
+
pre = _ref$pre === void 0 ? /*#__PURE__*/_jsx(_Fragment, {
|
10
|
+
children: "\xA5"
|
11
|
+
}) : _ref$pre,
|
12
|
+
_ref$end = _ref.end,
|
13
|
+
end = _ref$end === void 0 ? '元' : _ref$end,
|
14
|
+
value = _ref.value,
|
15
|
+
_ref$precision = _ref.precision,
|
16
|
+
precision = _ref$precision === void 0 ? 2 : _ref$precision,
|
17
|
+
color = _ref.color,
|
18
|
+
_ref$disabledMoneySim = _ref.disabledMoneySimple,
|
19
|
+
disabledMoneySimple = _ref$disabledMoneySim === void 0 ? false : _ref$disabledMoneySim;
|
20
|
+
return /*#__PURE__*/_jsxs(styles.money, {
|
21
|
+
style: {
|
22
|
+
color: color
|
23
|
+
},
|
24
|
+
children: [/*#__PURE__*/_jsx("span", {
|
25
|
+
className: "yen",
|
26
|
+
children: pre
|
27
|
+
}), /*#__PURE__*/_jsx("span", {
|
28
|
+
className: "value ".concat(value === 0 ? 'zero' : '', " "),
|
29
|
+
children: typeof value === 'number' ? disabledMoneySimple ? value.toFixed(precision) : moneySimple(value, false, precision) : ''
|
30
|
+
}), /*#__PURE__*/_jsx("span", {
|
31
|
+
className: "yen",
|
32
|
+
children: end
|
33
|
+
})]
|
34
|
+
});
|
35
|
+
};
|
36
|
+
export default Money;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const _default: {
|
3
|
+
pricingCompare: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
4
|
+
};
|
5
|
+
export default _default;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
2
|
+
var _templateObject;
|
3
|
+
import styled from 'styled-components';
|
4
|
+
export default {
|
5
|
+
pricingCompare: styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n th{\n font-size: 20px;\n padding: 20px 0 !important;\n font-weight: 400 !important;\n text-align: center !important;\n }\n\n .classifyKind{\n font-size: 18px;\n }\n\n .onBuy{\n padding: 16px 0;\n }\n\n .title{\n font-size: 16px;\n }\n .subtitle{\n margin: 1px 0 0;\n font-size: 12px;\n color: #999;\n font-weight: 300;\n }\n .value{\n text-align: center;\n font-size: 16px;\n .allow{\n color: #00b70d;\n font-size: 18px;\n }\n .notAllow{\n color: #C00;\n font-size: 18px;\n }\n small{\n color: #999;\n padding-left: 2px;\n }\n }\n "])))
|
6
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from "react";
|
2
|
+
interface Props {
|
3
|
+
disabledPrice?: boolean;
|
4
|
+
disabledBuy?: boolean;
|
5
|
+
applyDemoWechatUrl?: string;
|
6
|
+
applyDemoTitle?: string;
|
7
|
+
tableOffsetHeader?: number;
|
8
|
+
tableScrollY?: number | string;
|
9
|
+
onBuySuccess?: () => void;
|
10
|
+
}
|
11
|
+
declare const VipList: React.FC<Props>;
|
12
|
+
export default VipList;
|
@@ -0,0 +1,342 @@
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
+
import * as VipPowerController from "../service/api/VipPowerController";
|
4
|
+
import { useRequest } from "@umijs/hooks";
|
5
|
+
import { getApiEnv } from "../lib/getApiUrl";
|
6
|
+
import React, { useState } from "react";
|
7
|
+
import styles from "./index.css";
|
8
|
+
import { Buy } from "./..";
|
9
|
+
import { Button, ConfigProvider, Table } from "antd";
|
10
|
+
import { CheckCircleFilled, CloseCircleFilled, ShoppingCartOutlined, XFilled } from "@ant-design/icons";
|
11
|
+
import Tool from "../lib/Tool";
|
12
|
+
import PageContentWarp from "../UI/PageContentWarp";
|
13
|
+
import Money from "../UI/Money";
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
15
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
|
+
var ApplyColorDict = {
|
18
|
+
1: {
|
19
|
+
color: '#34b9fe'
|
20
|
+
},
|
21
|
+
100: {
|
22
|
+
color: '#3688FF'
|
23
|
+
},
|
24
|
+
200: {
|
25
|
+
color: '#5B53FF'
|
26
|
+
},
|
27
|
+
300: {
|
28
|
+
color: '#724822'
|
29
|
+
},
|
30
|
+
1000: {
|
31
|
+
color: ''
|
32
|
+
}
|
33
|
+
};
|
34
|
+
var VipList = function VipList(_ref) {
|
35
|
+
var _ref$disabledPrice = _ref.disabledPrice,
|
36
|
+
disabledPrice = _ref$disabledPrice === void 0 ? false : _ref$disabledPrice,
|
37
|
+
_ref$disabledBuy = _ref.disabledBuy,
|
38
|
+
disabledBuy = _ref$disabledBuy === void 0 ? false : _ref$disabledBuy,
|
39
|
+
_ref$applyDemoWechatU = _ref.applyDemoWechatUrl,
|
40
|
+
applyDemoWechatUrl = _ref$applyDemoWechatU === void 0 ? '' : _ref$applyDemoWechatU,
|
41
|
+
_ref$applyDemoTitle = _ref.applyDemoTitle,
|
42
|
+
applyDemoTitle = _ref$applyDemoTitle === void 0 ? '预约演示' : _ref$applyDemoTitle,
|
43
|
+
_ref$tableScrollY = _ref.tableScrollY,
|
44
|
+
tableScrollY = _ref$tableScrollY === void 0 ? '65vh' : _ref$tableScrollY,
|
45
|
+
_ref$tableOffsetHeade = _ref.tableOffsetHeader,
|
46
|
+
tableOffsetHeader = _ref$tableOffsetHeade === void 0 ? 56 : _ref$tableOffsetHeade,
|
47
|
+
_ref$onBuySuccess = _ref.onBuySuccess,
|
48
|
+
onBuySuccess = _ref$onBuySuccess === void 0 ? function () {} : _ref$onBuySuccess;
|
49
|
+
var _useState = useState([]),
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
51
|
+
listData = _useState2[0],
|
52
|
+
setListData = _useState2[1];
|
53
|
+
var _useState3 = useState([{
|
54
|
+
title: '功能',
|
55
|
+
dataIndex: 'title',
|
56
|
+
key: 'title',
|
57
|
+
onCell: function onCell(record, index) {
|
58
|
+
return {
|
59
|
+
colSpan: index > 0 && record.onlyShowTitle ? 5 : 1
|
60
|
+
};
|
61
|
+
},
|
62
|
+
render: function render(title, record) {
|
63
|
+
return title === ':buy' ? '' : /*#__PURE__*/_jsxs(_Fragment, {
|
64
|
+
children: [/*#__PURE__*/_jsx("div", {
|
65
|
+
className: "title",
|
66
|
+
children: title
|
67
|
+
}), /*#__PURE__*/_jsx("div", {
|
68
|
+
className: "subtitle",
|
69
|
+
children: record === null || record === void 0 ? void 0 : record.subtitle
|
70
|
+
})]
|
71
|
+
});
|
72
|
+
}
|
73
|
+
}]),
|
74
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
75
|
+
columns = _useState4[0],
|
76
|
+
setColumns = _useState4[1];
|
77
|
+
var _useRequest = useRequest(function () {
|
78
|
+
return VipPowerController.list({
|
79
|
+
dealerId: Tool.getLocalSiteInfo().dealerId || 0
|
80
|
+
}, {
|
81
|
+
env: getApiEnv()
|
82
|
+
});
|
83
|
+
}, {
|
84
|
+
onSuccess: function onSuccess(result) {
|
85
|
+
var list = [];
|
86
|
+
var listLen = result.vipList.length;
|
87
|
+
result.vipList.forEach(function (item) {
|
88
|
+
var dataIndex = "vipLevel".concat(item.vipLevel);
|
89
|
+
var colorPrimary = ApplyColorDict[item.vipLevel].color || '#722ED1';
|
90
|
+
list.push({
|
91
|
+
title: /*#__PURE__*/_jsxs("div", {
|
92
|
+
children: [/*#__PURE__*/_jsx("div", {
|
93
|
+
style: {
|
94
|
+
color: colorPrimary
|
95
|
+
},
|
96
|
+
children: item.title
|
97
|
+
}), applyDemoWechatUrl && /*#__PURE__*/_jsx(ConfigProvider, {
|
98
|
+
theme: {
|
99
|
+
components: {
|
100
|
+
Button: {
|
101
|
+
colorPrimary: colorPrimary
|
102
|
+
}
|
103
|
+
}
|
104
|
+
},
|
105
|
+
children: /*#__PURE__*/_jsx(Button, {
|
106
|
+
size: "middle",
|
107
|
+
type: "primary",
|
108
|
+
onClick: onApplyDemo,
|
109
|
+
children: applyDemoTitle
|
110
|
+
})
|
111
|
+
})]
|
112
|
+
}),
|
113
|
+
dataIndex: dataIndex,
|
114
|
+
key: dataIndex,
|
115
|
+
width: "".concat(70 / listLen, "%"),
|
116
|
+
onCell: sharedOnCell,
|
117
|
+
render: function render(value, record) {
|
118
|
+
return /*#__PURE__*/_jsx("div", {
|
119
|
+
className: "value",
|
120
|
+
children: (record === null || record === void 0 ? void 0 : record.title) === ':buy' ? /*#__PURE__*/_jsx("div", {
|
121
|
+
className: "onBuy",
|
122
|
+
children: /*#__PURE__*/_jsx(ConfigProvider, {
|
123
|
+
theme: {
|
124
|
+
components: {
|
125
|
+
Button: {
|
126
|
+
colorPrimary: '#722ED1'
|
127
|
+
}
|
128
|
+
}
|
129
|
+
},
|
130
|
+
children: (item === null || item === void 0 ? void 0 : item.price) > 0 && /*#__PURE__*/_jsx(Buy, {
|
131
|
+
env: getApiEnv(),
|
132
|
+
productKind: "vip",
|
133
|
+
vipId: (item === null || item === void 0 ? void 0 : item.id) || 0,
|
134
|
+
productCount: 1,
|
135
|
+
onBuySuccess: onBuySuccess,
|
136
|
+
children: /*#__PURE__*/_jsx(Button, {
|
137
|
+
type: "primary",
|
138
|
+
icon: /*#__PURE__*/_jsx(ShoppingCartOutlined, {}),
|
139
|
+
children: "\u8D2D\u4E70"
|
140
|
+
})
|
141
|
+
})
|
142
|
+
})
|
143
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
144
|
+
children: ['true', 'false'].includes(value) ? /*#__PURE__*/_jsxs(_Fragment, {
|
145
|
+
children: [value === 'true' && /*#__PURE__*/_jsx(CheckCircleFilled, {
|
146
|
+
className: "allow"
|
147
|
+
}), value === 'false' && /*#__PURE__*/_jsx(CloseCircleFilled, {
|
148
|
+
className: "notAllow"
|
149
|
+
})]
|
150
|
+
}) : value
|
151
|
+
})
|
152
|
+
});
|
153
|
+
}
|
154
|
+
});
|
155
|
+
});
|
156
|
+
columns.push.apply(columns, list);
|
157
|
+
setColumns(_toConsumableArray(columns));
|
158
|
+
|
159
|
+
// 先做字典
|
160
|
+
var listDict = {};
|
161
|
+
result.list.forEach(function (items) {
|
162
|
+
if (!listDict[items.name]) {
|
163
|
+
listDict[items.name] = {
|
164
|
+
name: items.name,
|
165
|
+
classifySubtitle: items.classifyInfo.subtitle,
|
166
|
+
classifyTitle: items.classifyInfo.title,
|
167
|
+
classifyIndex: items.classifyInfo.index,
|
168
|
+
classifyKind: items.classifyInfo.kind,
|
169
|
+
list: []
|
170
|
+
};
|
171
|
+
}
|
172
|
+
listDict[items.name].list.push(items);
|
173
|
+
});
|
174
|
+
var listDataValues = Object.values(listDict);
|
175
|
+
listDataValues.sort(function (a, b) {
|
176
|
+
return b.classifyIndex - a.classifyIndex;
|
177
|
+
});
|
178
|
+
|
179
|
+
// 购买
|
180
|
+
if (!disabledPrice) {
|
181
|
+
listDataValues.push({
|
182
|
+
name: ':price',
|
183
|
+
classifyTitle: '价格',
|
184
|
+
classifySubtitle: '',
|
185
|
+
classifyIndex: -1,
|
186
|
+
classifyKind: '购买',
|
187
|
+
list: result.vipList.map(function (item) {
|
188
|
+
return {
|
189
|
+
id: item.id,
|
190
|
+
dealerId: 0,
|
191
|
+
vipLevel: item.vipLevel,
|
192
|
+
name: ':price',
|
193
|
+
value: "".concat(item.price),
|
194
|
+
classifyInfo: {
|
195
|
+
title: '购买',
|
196
|
+
subtitle: '',
|
197
|
+
index: -1,
|
198
|
+
kind: '购买'
|
199
|
+
}
|
200
|
+
};
|
201
|
+
})
|
202
|
+
});
|
203
|
+
}
|
204
|
+
if (!disabledBuy) {
|
205
|
+
listDataValues.push({
|
206
|
+
name: ':buy',
|
207
|
+
classifyTitle: ':buy',
|
208
|
+
classifySubtitle: '',
|
209
|
+
classifyIndex: -1,
|
210
|
+
classifyKind: '购买',
|
211
|
+
list: []
|
212
|
+
});
|
213
|
+
}
|
214
|
+
var listData = [];
|
215
|
+
listDataValues.forEach(function (items, index) {
|
216
|
+
var onlyShowTitle = false;
|
217
|
+
var preRecord = listData[listData.length - 1];
|
218
|
+
if (preRecord && items.classifyKind && preRecord.classifyKind !== items.classifyKind) {
|
219
|
+
onlyShowTitle = true;
|
220
|
+
}
|
221
|
+
if (onlyShowTitle) {
|
222
|
+
listData.push({
|
223
|
+
title: /*#__PURE__*/_jsxs("strong", {
|
224
|
+
className: "classifyKind",
|
225
|
+
children: [/*#__PURE__*/_jsx(XFilled, {}), " ", items.classifyKind]
|
226
|
+
}),
|
227
|
+
subtitle: '',
|
228
|
+
classifyKind: items.classifyKind,
|
229
|
+
onlyShowTitle: true
|
230
|
+
});
|
231
|
+
}
|
232
|
+
var itemData = {
|
233
|
+
title: items.classifyTitle,
|
234
|
+
subtitle: items.classifySubtitle,
|
235
|
+
onlyShowTitle: false,
|
236
|
+
classifyKind: items.classifyKind
|
237
|
+
};
|
238
|
+
items.list.forEach(function (item) {
|
239
|
+
var value = item.value;
|
240
|
+
switch (item.name) {
|
241
|
+
case 'mixed-cut-video-count':
|
242
|
+
value = /*#__PURE__*/_jsx(Money, {
|
243
|
+
value: parseInt(item.value),
|
244
|
+
pre: "",
|
245
|
+
precision: 0,
|
246
|
+
end: "\u6761"
|
247
|
+
});
|
248
|
+
break;
|
249
|
+
case 'media-space-size':
|
250
|
+
value = /*#__PURE__*/_jsx(Money, {
|
251
|
+
value: parseInt(item.value),
|
252
|
+
pre: "",
|
253
|
+
precision: 0,
|
254
|
+
end: "GB"
|
255
|
+
});
|
256
|
+
break;
|
257
|
+
case 'gpt3.5':
|
258
|
+
value = /*#__PURE__*/_jsx(Money, {
|
259
|
+
value: parseInt(item.value),
|
260
|
+
pre: "",
|
261
|
+
precision: 0,
|
262
|
+
end: "\u6BCF\u65E5"
|
263
|
+
});
|
264
|
+
break;
|
265
|
+
case 'gpt4.0':
|
266
|
+
value = /*#__PURE__*/_jsx(Money, {
|
267
|
+
value: parseInt(item.value),
|
268
|
+
pre: "",
|
269
|
+
precision: 0,
|
270
|
+
end: ""
|
271
|
+
});
|
272
|
+
break;
|
273
|
+
}
|
274
|
+
console.log('result.items.name :', items.name);
|
275
|
+
|
276
|
+
// 价格
|
277
|
+
if (items.name === ':price') {
|
278
|
+
console.log('result.vipList:', result.vipList);
|
279
|
+
var price = getPrice(result.vipList, item.id);
|
280
|
+
value = /*#__PURE__*/_jsx(Money, {
|
281
|
+
value: price,
|
282
|
+
precision: 0
|
283
|
+
});
|
284
|
+
}
|
285
|
+
itemData["vipLevel".concat(item.vipLevel)] = value;
|
286
|
+
});
|
287
|
+
listData.push(itemData);
|
288
|
+
});
|
289
|
+
setListData([].concat(listData));
|
290
|
+
}
|
291
|
+
}),
|
292
|
+
loading = _useRequest.loading,
|
293
|
+
run = _useRequest.run,
|
294
|
+
error = _useRequest.error,
|
295
|
+
data = _useRequest.data;
|
296
|
+
var onApplyDemo = function onApplyDemo() {
|
297
|
+
if (!applyDemoWechatUrl) {
|
298
|
+
return;
|
299
|
+
}
|
300
|
+
Tool.pageDialog({
|
301
|
+
title: applyDemoTitle,
|
302
|
+
content: Tool.makeQr(applyDemoWechatUrl, '#29ae67', 220),
|
303
|
+
width: 320,
|
304
|
+
zIndex: 9999
|
305
|
+
});
|
306
|
+
};
|
307
|
+
var getPrice = function getPrice(vipList, id) {
|
308
|
+
var _vipList$filter;
|
309
|
+
return ((_vipList$filter = vipList.filter(function (item) {
|
310
|
+
return item.id === id;
|
311
|
+
})) === null || _vipList$filter === void 0 ? void 0 : _vipList$filter[0].price) || 0;
|
312
|
+
};
|
313
|
+
var sharedOnCell = function sharedOnCell(record, index) {
|
314
|
+
return {
|
315
|
+
colSpan: record.onlyShowTitle ? 0 : 1
|
316
|
+
};
|
317
|
+
};
|
318
|
+
return /*#__PURE__*/_jsx(PageContentWarp, {
|
319
|
+
loading: loading,
|
320
|
+
error: error,
|
321
|
+
onReload: run,
|
322
|
+
children: /*#__PURE__*/_jsx(styles.pricingCompare, {
|
323
|
+
children: /*#__PURE__*/_jsx(Table, {
|
324
|
+
bordered: true,
|
325
|
+
scroll: {
|
326
|
+
y: tableScrollY // '60vh',
|
327
|
+
},
|
328
|
+
|
329
|
+
rowKey: function rowKey(record, index) {
|
330
|
+
return "".concat(index, "-").concat(record.id);
|
331
|
+
},
|
332
|
+
columns: columns,
|
333
|
+
dataSource: listData,
|
334
|
+
pagination: false,
|
335
|
+
sticky: {
|
336
|
+
offsetHeader: tableOffsetHeader
|
337
|
+
}
|
338
|
+
})
|
339
|
+
})
|
340
|
+
});
|
341
|
+
};
|
342
|
+
export default VipList;
|
package/dist/config/apiUrls.js
CHANGED
package/dist/global.less
ADDED
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
import './global.less';
|
1
2
|
export { default as VipCompare } from './VipCompare';
|
2
3
|
export { default as Buy } from './Buy';
|
3
4
|
export { default as Login } from './Login';
|
4
5
|
export { default as AuthClient } from './AuthClient';
|
5
6
|
export { default as Product } from './Product';
|
6
7
|
export { default as JoinClient } from './join-client';
|
8
|
+
export { default as VipList } from './VipList';
|
7
9
|
export { default as fileSelect } from './base/fileSelect';
|
8
10
|
export { default as folderOpen } from './base/folderOpen';
|
9
11
|
export { default as folderSelect } from './base/folderSelect';
|
package/dist/index.js
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
// import soundInfo from "component-shipinlv/base/soundInfo";
|
2
|
+
// import fileList from "component-shipinlv/base/fileList";
|
3
|
+
import "./global.less";
|
1
4
|
export { default as VipCompare } from "./VipCompare";
|
2
5
|
export { default as Buy } from "./Buy";
|
3
6
|
export { default as Login } from "./Login";
|
4
7
|
export { default as AuthClient } from "./AuthClient";
|
5
8
|
export { default as Product } from "./Product";
|
6
9
|
export { default as JoinClient } from "./join-client";
|
10
|
+
export { default as VipList } from "./VipList";
|
7
11
|
export { default as fileSelect } from "./base/fileSelect";
|
8
12
|
export { default as folderOpen } from "./base/folderOpen";
|
9
13
|
export { default as folderSelect } from "./base/folderSelect";
|
package/dist/lib/Tool.js
CHANGED
@@ -1037,12 +1037,19 @@ var Tool = _objectSpread(_objectSpread({
|
|
1037
1037
|
});
|
1038
1038
|
},
|
1039
1039
|
makeQr: function makeQr(url) {
|
1040
|
-
var fgColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#
|
1040
|
+
var fgColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#29ae67';
|
1041
1041
|
var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 600;
|
1042
|
-
return /*#__PURE__*/_jsx(
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1042
|
+
return /*#__PURE__*/_jsx("div", {
|
1043
|
+
style: {
|
1044
|
+
width: size,
|
1045
|
+
height: size,
|
1046
|
+
margin: '12px auto'
|
1047
|
+
},
|
1048
|
+
children: /*#__PURE__*/_jsx(QRCode, {
|
1049
|
+
value: url,
|
1050
|
+
fgColor: fgColor,
|
1051
|
+
size: size
|
1052
|
+
})
|
1046
1053
|
});
|
1047
1054
|
},
|
1048
1055
|
onLogin: function onLogin() {
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Tooltip } from "antd";
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
var moneySimple = function moneySimple() {
|
4
|
+
var money = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
5
|
+
var isTip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
6
|
+
var toFixed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
7
|
+
var out = '';
|
8
|
+
var unit = '';
|
9
|
+
if (money >= 100000) {
|
10
|
+
out = (money / 10000).toFixed(toFixed);
|
11
|
+
unit = '万';
|
12
|
+
} else if (money >= 10000) {
|
13
|
+
out = (money / 10000).toFixed(toFixed);
|
14
|
+
unit = '万';
|
15
|
+
} else {
|
16
|
+
out = money.toFixed(toFixed);
|
17
|
+
}
|
18
|
+
var outData = out.split('.');
|
19
|
+
if (isTip) {
|
20
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
21
|
+
title: money + '元',
|
22
|
+
children: out + unit
|
23
|
+
});
|
24
|
+
}
|
25
|
+
return out + ' ' + unit;
|
26
|
+
};
|
27
|
+
export default moneySimple;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
|
+
import request from "../../lib/request";
|
5
|
+
export function list(_x, _x2) {
|
6
|
+
return _list.apply(this, arguments);
|
7
|
+
}
|
8
|
+
function _list() {
|
9
|
+
_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
10
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
12
|
+
case 0:
|
13
|
+
return _context.abrupt("return", request("vipPower/list", _objectSpread({
|
14
|
+
method: 'POST',
|
15
|
+
headers: {
|
16
|
+
'Content-Type': 'application/json'
|
17
|
+
},
|
18
|
+
data: _objectSpread({}, body)
|
19
|
+
}, options || {})));
|
20
|
+
case 1:
|
21
|
+
case "end":
|
22
|
+
return _context.stop();
|
23
|
+
}
|
24
|
+
}, _callee);
|
25
|
+
}));
|
26
|
+
return _list.apply(this, arguments);
|
27
|
+
}
|
File without changes
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare namespace VipPower {
|
3
|
+
interface ListResult {
|
4
|
+
list: List[];
|
5
|
+
vipList: VipList.List[];
|
6
|
+
}
|
7
|
+
interface List {
|
8
|
+
id: number;
|
9
|
+
dealerId: number;
|
10
|
+
vipLevel: number;
|
11
|
+
name: string;
|
12
|
+
value: string;
|
13
|
+
classifyInfo: {
|
14
|
+
title: string;
|
15
|
+
subtitle: string;
|
16
|
+
index: number;
|
17
|
+
kind: string;
|
18
|
+
};
|
19
|
+
}
|
20
|
+
interface ListDict {
|
21
|
+
[name: string]: {
|
22
|
+
name: string;
|
23
|
+
classifyTitle: string;
|
24
|
+
classifySubtitle: string;
|
25
|
+
classifyIndex: number;
|
26
|
+
classifyKind: string;
|
27
|
+
list: List[];
|
28
|
+
};
|
29
|
+
}
|
30
|
+
interface TypeCompare {
|
31
|
+
title: React.ReactNode;
|
32
|
+
classifyKind: React.ReactNode;
|
33
|
+
subtitle: React.ReactNode;
|
34
|
+
onlyShowTitle: boolean;
|
35
|
+
vipLevel1?: TypeCompareVipLevel;
|
36
|
+
vipLevel12?: TypeCompareVipLevel;
|
37
|
+
vipLevel100?: TypeCompareVipLevel;
|
38
|
+
vipLevel200?: TypeCompareVipLevel;
|
39
|
+
vipLevel300?: TypeCompareVipLevel;
|
40
|
+
vipLevel400?: TypeCompareVipLevel;
|
41
|
+
vipLevel1000?: TypeCompareVipLevel;
|
42
|
+
[vipLevel: string]: TypeCompareVipLevel;
|
43
|
+
}
|
44
|
+
type TypeCompareVipLevel = boolean | React.ReactNode;
|
45
|
+
}
|
File without changes
|
package/dist/typings.d.ts
CHANGED
@@ -9,10 +9,13 @@ declare namespace Global {
|
|
9
9
|
data?: any;
|
10
10
|
}
|
11
11
|
interface Columns<T>{
|
12
|
-
title:
|
12
|
+
title: React.ReactNode;
|
13
13
|
dataIndex?: string;
|
14
14
|
key: string;
|
15
15
|
width?: string | number;
|
16
|
+
onCell?: ( record, rowIndex) => ({
|
17
|
+
colSpan: number;
|
18
|
+
});
|
16
19
|
render?: ( filed?: any, record?: T , index?: number ) => React.ReactNode;
|
17
20
|
}
|
18
21
|
interface Pagination {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "component-shipinlv",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.12",
|
4
4
|
"description": "",
|
5
5
|
"module": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -51,7 +51,6 @@
|
|
51
51
|
"@types/react": "^18.x",
|
52
52
|
"@types/react-dom": "^18.2.1",
|
53
53
|
"@umijs/lint": "^4.0.0",
|
54
|
-
"antd": "^5.4.6",
|
55
54
|
"css-loader": "^6.7.3",
|
56
55
|
"dumi": "^2.2.16",
|
57
56
|
"eslint": "^8.23.0",
|
@@ -67,7 +66,7 @@
|
|
67
66
|
"stylelint": "^14.9.1"
|
68
67
|
},
|
69
68
|
"dependencies": {
|
70
|
-
"@ant-design/icons": "^5.
|
69
|
+
"@ant-design/icons": "^5.x",
|
71
70
|
"@babel/runtime": "^7.23.6",
|
72
71
|
"@umijs/hooks": "^1.9.3",
|
73
72
|
"jr-qrcode": "^1.1.4",
|