component-shipinlv 2.3.1 → 2.3.2
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.
- package/dist/ActiveAccountMode/setting.js +3 -3
- package/dist/active-code/index.js +6 -4
- package/dist/active-code/user-vip.d.ts +3 -0
- package/dist/active-code/user-vip.js +84 -0
- package/dist/active-code/user-vip.less +3 -0
- package/dist/component/product-type.d.ts +1 -0
- package/dist/component/product-type.js +4 -3
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/types/User.d.ts +1 -0
- package/package.json +1 -1
@@ -132,13 +132,13 @@ var ActiveAccountModeSetting = function ActiveAccountModeSetting(_ref) {
|
|
132
132
|
autoComplete: "off",
|
133
133
|
initialValues: _objectSpread({}, formData),
|
134
134
|
onFinish: onFinish,
|
135
|
-
children: [notVip
|
136
|
-
label: "\
|
135
|
+
children: [notVip ? /*#__PURE__*/_jsx(Form.Item, {
|
136
|
+
label: "\u542F\u7528",
|
137
137
|
children: /*#__PURE__*/_jsx(Alert, {
|
138
138
|
type: "error",
|
139
139
|
message: "\u4E0D\u662F\u4F1A\u5458\uFF0C\u6B64\u529F\u80FD\u7981\u7528"
|
140
140
|
})
|
141
|
-
})
|
141
|
+
}) : /*#__PURE__*/_jsx(Form.Item, {
|
142
142
|
label: "\u542F\u7528",
|
143
143
|
name: "enabled",
|
144
144
|
children: /*#__PURE__*/_jsx(Switch, {
|
@@ -6,7 +6,9 @@ import { useRequest } from '@umijs/hooks';
|
|
6
6
|
import * as VipCardController from "../service/api/VipCardController";
|
7
7
|
import updateUserInfo from "../lib/updateUserInfo";
|
8
8
|
import Tool from "../lib/Tool";
|
9
|
+
import UserProfileUserVip from "./user-vip";
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
12
|
var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
11
13
|
var env = _ref.env,
|
12
14
|
onActive = _ref.onActive;
|
@@ -34,7 +36,7 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
|
34
36
|
error = _useRequest.error;
|
35
37
|
var onFinish = function onFinish(postData) {
|
36
38
|
var _postData$vipCardCode;
|
37
|
-
var vipCardCode = (_postData$vipCardCode = postData.vipCardCode) === null || _postData$vipCardCode === void 0 ? void 0 : _postData$vipCardCode.replace(
|
39
|
+
var vipCardCode = (_postData$vipCardCode = postData.vipCardCode) === null || _postData$vipCardCode === void 0 ? void 0 : _postData$vipCardCode.replace(/^[\s0-9a-z]+-/i, '').replace(/\s+/g, '').toLocaleUpperCase();
|
38
40
|
if (!vipCardCode) {
|
39
41
|
return;
|
40
42
|
}
|
@@ -43,8 +45,8 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
|
43
45
|
var onupdateUserInfo = function onupdateUserInfo() {
|
44
46
|
updateUserInfo();
|
45
47
|
};
|
46
|
-
return /*#__PURE__*/
|
47
|
-
children: /*#__PURE__*/_jsx(Form, {
|
48
|
+
return /*#__PURE__*/_jsxs("div", {
|
49
|
+
children: [/*#__PURE__*/_jsx(Form, {
|
48
50
|
form: form,
|
49
51
|
disabled: loading,
|
50
52
|
onFinish: onFinish,
|
@@ -70,7 +72,7 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
|
|
70
72
|
placeholder: "\u7C7B\u4F3C: AI-AAAA-BBBB-CCCC"
|
71
73
|
})
|
72
74
|
})
|
73
|
-
})
|
75
|
+
}), /*#__PURE__*/_jsx(UserProfileUserVip, {})]
|
74
76
|
});
|
75
77
|
};
|
76
78
|
export default UserProfileVipCard;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
+
import React, { useEffect, useState } from 'react';
|
3
|
+
import { Divider, Table } from 'antd';
|
4
|
+
import { useRequest } from '@umijs/hooks';
|
5
|
+
import "./user-vip.less";
|
6
|
+
import * as UserController from "../service/api/UserController";
|
7
|
+
import ProductType from "../component/product-type";
|
8
|
+
import Time from "../UI/Time";
|
9
|
+
import PageContentWarp from "../UI/PageContentWarp";
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
+
var UserProfileUserVip = function UserProfileUserVip() {
|
13
|
+
var _useState = useState([]),
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
15
|
+
listData = _useState2[0],
|
16
|
+
setListData = _useState2[1];
|
17
|
+
var _useRequest = useRequest(function () {
|
18
|
+
return UserController.userVipInfo();
|
19
|
+
}, {
|
20
|
+
manual: true,
|
21
|
+
onSuccess: function onSuccess(result) {
|
22
|
+
setListData(result);
|
23
|
+
}
|
24
|
+
}),
|
25
|
+
run = _useRequest.run,
|
26
|
+
loading = _useRequest.loading,
|
27
|
+
error = _useRequest.error;
|
28
|
+
var columns = [{
|
29
|
+
title: '名称',
|
30
|
+
dataIndex: 'productName',
|
31
|
+
key: 'productName',
|
32
|
+
render: function render(productName, record) {
|
33
|
+
return /*#__PURE__*/_jsx(ProductType, {
|
34
|
+
productType: (record === null || record === void 0 ? void 0 : record.productType) || '',
|
35
|
+
productName: productName
|
36
|
+
});
|
37
|
+
}
|
38
|
+
}, {
|
39
|
+
title: '等级',
|
40
|
+
dataIndex: 'vipLevelName',
|
41
|
+
key: 'vipLevelName',
|
42
|
+
render: function render(vipLevelName, record) {
|
43
|
+
return /*#__PURE__*/_jsx("div", {
|
44
|
+
children: vipLevelName
|
45
|
+
});
|
46
|
+
}
|
47
|
+
}, {
|
48
|
+
title: '过期时间',
|
49
|
+
dataIndex: 'expired',
|
50
|
+
key: 'expired',
|
51
|
+
render: function render(expired, record) {
|
52
|
+
return /*#__PURE__*/_jsx(Time, {
|
53
|
+
time: expired
|
54
|
+
});
|
55
|
+
}
|
56
|
+
}];
|
57
|
+
useEffect(function () {
|
58
|
+
run();
|
59
|
+
}, []);
|
60
|
+
return listData.length > 0 ? /*#__PURE__*/_jsxs("div", {
|
61
|
+
className: "userVip",
|
62
|
+
children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(PageContentWarp
|
63
|
+
// title="我的会员等级"
|
64
|
+
, {
|
65
|
+
loading: loading,
|
66
|
+
error: error,
|
67
|
+
onReload: function onReload() {
|
68
|
+
return run();
|
69
|
+
},
|
70
|
+
children: /*#__PURE__*/_jsx(Table, {
|
71
|
+
size: "small",
|
72
|
+
bordered: true,
|
73
|
+
rowKey: function rowKey(record) {
|
74
|
+
return "".concat(record.productType);
|
75
|
+
},
|
76
|
+
loading: loading,
|
77
|
+
columns: columns,
|
78
|
+
dataSource: listData,
|
79
|
+
pagination: false
|
80
|
+
})
|
81
|
+
})]
|
82
|
+
}) : null;
|
83
|
+
};
|
84
|
+
export default UserProfileUserVip;
|
@@ -3,17 +3,18 @@ import ProductTypeDict from "./product-dict";
|
|
3
3
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
4
4
|
var ProductType = function ProductType(_ref) {
|
5
5
|
var _ref$productType = _ref.productType,
|
6
|
-
productType = _ref$productType === void 0 ? '' : _ref$productType
|
6
|
+
productType = _ref$productType === void 0 ? '' : _ref$productType,
|
7
|
+
productName = _ref.productName;
|
7
8
|
var itemData = ProductTypeDict[productType] || {
|
8
9
|
color: '',
|
9
10
|
icon: '',
|
10
|
-
title:
|
11
|
+
title: ''
|
11
12
|
};
|
12
13
|
return /*#__PURE__*/_jsxs("span", {
|
13
14
|
style: {
|
14
15
|
color: itemData.color
|
15
16
|
},
|
16
|
-
children: [itemData.icon, " ", itemData.title]
|
17
|
+
children: [itemData.icon, " ", itemData.title || productName || productType]
|
17
18
|
});
|
18
19
|
};
|
19
20
|
export default ProductType;
|
package/dist/lib/Tool.d.ts
CHANGED
@@ -162,7 +162,7 @@ declare const Tool: {
|
|
162
162
|
getTitleByPath(path: string): string;
|
163
163
|
getDirByPath(path: string): string;
|
164
164
|
h5Pay(query: Pay.H5PayQuery): void;
|
165
|
-
notification(type: "
|
165
|
+
notification(type: "error" | "success" | "info" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
166
166
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
167
167
|
notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
168
168
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
package/dist/types/User.d.ts
CHANGED