@fonixtree/magic-design 0.1.80 → 0.1.81
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/es/assets/fonts/magic-box-iconfont.css +8 -4
- package/es/assets/fonts/magic-box-iconfont.css.bak +8 -4
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/common/MagicLink/index.js +2 -2
- package/es/common/UrlPicker/AnchorModal/index.js +170 -0
- package/es/common/UrlPicker/AnchorModal/index.less +21 -0
- package/es/common/UrlPicker/index.js +61 -11
- package/es/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
- package/es/composite-comp/bol/components/Wallet/mobile/index.less +1 -1
- package/es/composite-comp/bol/components/Wallet/pc/index.js +2 -0
- package/es/composite-comp/bol/components/Wallet/pc/index.less +40 -1
- package/es/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
- package/es/constants/index.js +3 -2
- package/es/decorator/metaDecorator.js +1 -1
- package/es/locale/en/en.json +3 -0
- package/es/locale/es/es.json +3 -0
- package/es/locale/id/id.json +3 -0
- package/es/utils/businessUtil.js +11 -0
- package/es/utils/coreUtil.js +43 -2
- package/lib/assets/fonts/magic-box-iconfont.css +8 -4
- package/lib/assets/fonts/magic-box-iconfont.css.bak +8 -4
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/common/MagicLink/index.js +2 -2
- package/lib/common/UrlPicker/AnchorModal/index.js +170 -0
- package/lib/common/UrlPicker/AnchorModal/index.less +21 -0
- package/lib/common/UrlPicker/index.js +61 -11
- package/lib/composite-comp/bol/components/Wallet/mobile/index.js +1 -1
- package/lib/composite-comp/bol/components/Wallet/mobile/index.less +1 -1
- package/lib/composite-comp/bol/components/Wallet/pc/index.js +2 -0
- package/lib/composite-comp/bol/components/Wallet/pc/index.less +40 -1
- package/lib/composite-comp/bol/second-config-panels/WalletSecondConfig/index.js +1 -1
- package/lib/constants/index.js +3 -2
- package/lib/decorator/metaDecorator.js +1 -1
- package/lib/locale/en/en.json +3 -0
- package/lib/locale/es/es.json +3 -0
- package/lib/locale/id/id.json +3 -0
- package/lib/utils/businessUtil.js +11 -0
- package/lib/utils/coreUtil.js +43 -2
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
|
|
12
|
+
var _locale = require("../../../locale");
|
|
13
|
+
|
|
14
|
+
var _mobx = require("../../../mobx");
|
|
15
|
+
|
|
16
|
+
var _constants = require("../../../constants");
|
|
17
|
+
|
|
18
|
+
require("./index.less");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
23
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
24
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
25
|
+
__proto__: []
|
|
26
|
+
} instanceof Array && function (d, b) {
|
|
27
|
+
d.__proto__ = b;
|
|
28
|
+
} || function (d, b) {
|
|
29
|
+
for (var p in b) {
|
|
30
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return _extendStatics(d, b);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return function (d, b) {
|
|
38
|
+
_extendStatics(d, b);
|
|
39
|
+
|
|
40
|
+
function __() {
|
|
41
|
+
this.constructor = d;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
45
|
+
};
|
|
46
|
+
}();
|
|
47
|
+
|
|
48
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
49
|
+
__assign = Object.assign || function (t) {
|
|
50
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
51
|
+
s = arguments[i];
|
|
52
|
+
|
|
53
|
+
for (var p in s) {
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return __assign.apply(this, arguments);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var AnchorModal =
|
|
65
|
+
/** @class */
|
|
66
|
+
function (_super) {
|
|
67
|
+
__extends(AnchorModal, _super);
|
|
68
|
+
|
|
69
|
+
function AnchorModal() {
|
|
70
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
71
|
+
|
|
72
|
+
_this.state = {
|
|
73
|
+
selectedValue: ''
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
_this.onAnchorChange = function (e) {
|
|
77
|
+
var selectedAnchor = _mobx.store.MPageData.find(function (m) {
|
|
78
|
+
return m.id === e.target.value;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
console.log('store.MPageData: ', JSON.parse(JSON.stringify(_mobx.store.MPageData)));
|
|
82
|
+
|
|
83
|
+
_this.setState({
|
|
84
|
+
selectedValue: selectedAnchor.id
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
_this.onOk = function () {
|
|
89
|
+
var initData = _this.props.initData;
|
|
90
|
+
var selectedValue = _this.state.selectedValue;
|
|
91
|
+
|
|
92
|
+
var selectedAnchorIndex = _mobx.store.MPageData.findIndex(function (m) {
|
|
93
|
+
return m.id === selectedValue;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
var selectedAnchor = _mobx.store.MPageData[selectedAnchorIndex];
|
|
97
|
+
|
|
98
|
+
var value = __assign({}, initData.value);
|
|
99
|
+
|
|
100
|
+
if (selectedAnchor.activeTerminal === 'ALL') {
|
|
101
|
+
value.pcNodeId = selectedAnchor.id;
|
|
102
|
+
value.mobileNodeId = selectedAnchor.id;
|
|
103
|
+
} else if (selectedAnchor.activeTerminal === 'MOBILE') {
|
|
104
|
+
value.mobileNodeId = selectedAnchor.id;
|
|
105
|
+
} else if (selectedAnchor.activeTerminal === 'PC') {
|
|
106
|
+
value.pcNodeId = selectedAnchor.id;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
var data = {
|
|
110
|
+
type: _constants.urlTypeMap.ANCHOR,
|
|
111
|
+
value: value
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
_this.props.onConfirm(data);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return _this;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
AnchorModal.prototype.render = function () {
|
|
121
|
+
var _a = this.props,
|
|
122
|
+
visible = _a.visible,
|
|
123
|
+
onClose = _a.onClose;
|
|
124
|
+
var selectedValue = this.state.selectedValue;
|
|
125
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Modal, {
|
|
126
|
+
cancelText: (0, _locale.i18n)('CANCEL'),
|
|
127
|
+
draggable: false,
|
|
128
|
+
footer: null,
|
|
129
|
+
okText: "OK",
|
|
130
|
+
onCancel: onClose,
|
|
131
|
+
title: (0, _locale.i18n)('ANCHOR'),
|
|
132
|
+
visible: visible,
|
|
133
|
+
width: "400px",
|
|
134
|
+
wrapClassName: "magicAnchorModal"
|
|
135
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
|
|
136
|
+
onChange: this.onAnchorChange,
|
|
137
|
+
value: selectedValue
|
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Space, {
|
|
139
|
+
direction: "vertical"
|
|
140
|
+
}, _mobx.store.MPageData.map(function (page, i) {
|
|
141
|
+
var _a;
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Radio, {
|
|
144
|
+
value: page.id
|
|
145
|
+
}, i + 1, "\u3001", (_a = _constants.compInfoMap[page.type]) === null || _a === void 0 ? void 0 : _a.name);
|
|
146
|
+
})))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
+
className: "footer"
|
|
148
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
149
|
+
className: "btn-cancel",
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return onClose && onClose();
|
|
152
|
+
}
|
|
153
|
+
}, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement(_antd.Button, {
|
|
154
|
+
className: "btn-confirm",
|
|
155
|
+
onClick: this.onOk,
|
|
156
|
+
type: "primary"
|
|
157
|
+
}, (0, _locale.i18n)('OK'))));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
AnchorModal.defaultProps = {
|
|
161
|
+
visible: false,
|
|
162
|
+
onClose: function onClose() {},
|
|
163
|
+
onConfirm: function onConfirm() {},
|
|
164
|
+
initData: null
|
|
165
|
+
};
|
|
166
|
+
return AnchorModal;
|
|
167
|
+
}(_react["default"].Component);
|
|
168
|
+
|
|
169
|
+
var _default = AnchorModal;
|
|
170
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.magicAnchorModal {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.footer {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: flex-end;
|
|
8
|
+
padding-top: 20px;
|
|
9
|
+
|
|
10
|
+
.btn-cancel {
|
|
11
|
+
margin-right: 12px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.btn-confirm {
|
|
15
|
+
background: #2F54EB;
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
// margin-left: 20px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -7,16 +7,24 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
require("./index.less");
|
|
11
|
-
|
|
12
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
11
|
|
|
12
|
+
var _AnchorModal = _interopRequireDefault(require("./AnchorModal"));
|
|
13
|
+
|
|
14
|
+
var _coreUtil = require("../../utils/coreUtil");
|
|
15
|
+
|
|
14
16
|
var _locale = require("../../locale");
|
|
15
17
|
|
|
16
18
|
var _LinkModal = _interopRequireDefault(require("../LinkModal"));
|
|
17
19
|
|
|
18
20
|
var _Iconfont = _interopRequireDefault(require("../Iconfont"));
|
|
19
21
|
|
|
22
|
+
var _constants = require("../../constants");
|
|
23
|
+
|
|
24
|
+
var _mobx = require("../../mobx");
|
|
25
|
+
|
|
26
|
+
require("./index.less");
|
|
27
|
+
|
|
20
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
29
|
|
|
22
30
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -44,6 +52,8 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
44
52
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
45
53
|
};
|
|
46
54
|
}();
|
|
55
|
+
/* eslint-disable max-len */
|
|
56
|
+
|
|
47
57
|
|
|
48
58
|
var UrlPicker =
|
|
49
59
|
/** @class */
|
|
@@ -54,7 +64,8 @@ function (_super) {
|
|
|
54
64
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
55
65
|
|
|
56
66
|
_this.state = {
|
|
57
|
-
visible: false
|
|
67
|
+
visible: false,
|
|
68
|
+
anchorModalVisible: false
|
|
58
69
|
};
|
|
59
70
|
return _this;
|
|
60
71
|
}
|
|
@@ -62,14 +73,29 @@ function (_super) {
|
|
|
62
73
|
UrlPicker.prototype.render = function () {
|
|
63
74
|
var _this = this;
|
|
64
75
|
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
var _a;
|
|
77
|
+
|
|
78
|
+
var _b = this.state,
|
|
79
|
+
visible = _b.visible,
|
|
80
|
+
anchorModalVisible = _b.anchorModalVisible;
|
|
81
|
+
var _c = this.props,
|
|
82
|
+
value = _c.value,
|
|
83
|
+
_onChange = _c.onChange,
|
|
84
|
+
disabled = _c.disabled,
|
|
85
|
+
onlySpecificCode = _c.onlySpecificCode; // 弹框选择url不可编辑,需要先清除
|
|
71
86
|
|
|
72
87
|
var editable = !value || !value.type;
|
|
88
|
+
var inputName = (value === null || value === void 0 ? void 0 : value.name) || '';
|
|
89
|
+
|
|
90
|
+
if ((value === null || value === void 0 ? void 0 : value.type) === _constants.urlTypeMap.ANCHOR) {
|
|
91
|
+
var selectedAnchorIndex = _mobx.store.MPageData.findIndex(function (m) {
|
|
92
|
+
return m.id === ((0, _coreUtil.isPc)() ? value.value.pcNodeId : value.value.mobileNodeId);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var selectedAnchor = _mobx.store.MPageData[selectedAnchorIndex];
|
|
96
|
+
inputName = selectedAnchorIndex + 1 + "\u3001" + ((_a = _constants.compInfoMap[selectedAnchor.type]) === null || _a === void 0 ? void 0 : _a.name);
|
|
97
|
+
}
|
|
98
|
+
|
|
73
99
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
100
|
className: "m-url-picker"
|
|
75
101
|
}, disabled && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -88,10 +114,19 @@ function (_super) {
|
|
|
88
114
|
},
|
|
89
115
|
placeholder: (0, _locale.i18n)('PLEASE_ADD_A_LINK'),
|
|
90
116
|
type: "text",
|
|
91
|
-
value:
|
|
117
|
+
value: inputName
|
|
92
118
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
93
119
|
className: "icon-btns"
|
|
94
|
-
},
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
121
|
+
color: "#000",
|
|
122
|
+
onClick: function onClick() {
|
|
123
|
+
return _this.setState({
|
|
124
|
+
anchorModalVisible: true
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
size: "20px",
|
|
128
|
+
type: "icon-anchor"
|
|
129
|
+
}), window.magicDesign.outputType != 'html' && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
95
130
|
color: "#000",
|
|
96
131
|
onClick: function onClick() {
|
|
97
132
|
return _this.setState({
|
|
@@ -122,6 +157,21 @@ function (_super) {
|
|
|
122
157
|
},
|
|
123
158
|
onlySpecificCode: onlySpecificCode,
|
|
124
159
|
visible: visible
|
|
160
|
+
}), anchorModalVisible && /*#__PURE__*/_react["default"].createElement(_AnchorModal["default"], {
|
|
161
|
+
initData: value,
|
|
162
|
+
onClose: function onClose() {
|
|
163
|
+
return _this.setState({
|
|
164
|
+
anchorModalVisible: false
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
onConfirm: function onConfirm(value) {
|
|
168
|
+
_onChange(value);
|
|
169
|
+
|
|
170
|
+
_this.setState({
|
|
171
|
+
anchorModalVisible: false
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
visible: anchorModalVisible
|
|
125
175
|
}));
|
|
126
176
|
};
|
|
127
177
|
|
|
@@ -290,7 +290,7 @@ function (_super) {
|
|
|
290
290
|
show: true
|
|
291
291
|
}, _b[_constants.walletType.CENDUIT] = {
|
|
292
292
|
amount: userPoint === null ? '****' : userPoint,
|
|
293
|
-
btnText: userPoint ? '
|
|
293
|
+
btnText: userPoint ? 'Cenduit Mall' : '',
|
|
294
294
|
show: true
|
|
295
295
|
}, _b)
|
|
296
296
|
}, function () {
|
|
@@ -17,6 +17,8 @@ var _currencyUtil = require("../../../../../utils/currencyUtil");
|
|
|
17
17
|
|
|
18
18
|
var _ConfigPanel = require("../../../../../core/Designer/ConfigPanel");
|
|
19
19
|
|
|
20
|
+
require("./index.less");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
23
|
|
|
22
24
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
.m-Wallet-pc {
|
|
1
|
+
.m-Wallet-pc {
|
|
2
|
+
|
|
3
|
+
.headline {
|
|
4
|
+
margin-bottom: 20px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.content {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
|
|
11
|
+
&.column_3 {
|
|
12
|
+
.item-wrap {
|
|
13
|
+
.title {
|
|
14
|
+
top: 24%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.amount {
|
|
18
|
+
bottom: 14%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.item-wrap {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
position: relative;
|
|
28
|
+
border-radius: 10px;
|
|
29
|
+
|
|
30
|
+
.image {
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.text-content {
|
|
36
|
+
position: absolute;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -136,7 +136,7 @@ function (_super) {
|
|
|
136
136
|
value: _constants.walletType.B2B
|
|
137
137
|
}, (0, _locale.i18n)('B2B PayLater')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
138
138
|
value: _constants.walletType.CENDUIT
|
|
139
|
-
}, (0, _locale.i18n)('
|
|
139
|
+
}, (0, _locale.i18n)('Cenduit')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
140
140
|
value: _constants.walletType.BNPL
|
|
141
141
|
}, (0, _locale.i18n)('BNPL')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
142
142
|
value: _constants.walletType.CREDIT
|
package/es/constants/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var walletType = {
|
|
|
42
42
|
BNPL: 'BNPL',
|
|
43
43
|
B2B: 'B2B PayLater',
|
|
44
44
|
BALANCE: 'Balance',
|
|
45
|
-
CENDUIT: '
|
|
45
|
+
CENDUIT: 'Cenduit'
|
|
46
46
|
};
|
|
47
47
|
exports.walletType = walletType;
|
|
48
48
|
var urlType = {
|
|
@@ -68,7 +68,8 @@ var urlTypeMap = {
|
|
|
68
68
|
SHARE_URL: 'ShareURL',
|
|
69
69
|
MINI_APP: 'MiniApp',
|
|
70
70
|
STORE: 'Store',
|
|
71
|
-
AFFILIATE_PRODUCT: 'AffiliateProduct'
|
|
71
|
+
AFFILIATE_PRODUCT: 'AffiliateProduct',
|
|
72
|
+
ANCHOR: 'Anchor'
|
|
72
73
|
};
|
|
73
74
|
exports.urlTypeMap = urlTypeMap;
|
|
74
75
|
var respCodeMap = {
|
|
@@ -95,7 +95,7 @@ function metaDecorator(WrappedComponent) {
|
|
|
95
95
|
GAData = _c.GAData;
|
|
96
96
|
(0, _commonUtil.pushGA)(__assign(__assign({}, GAData), {
|
|
97
97
|
elementId: data.id,
|
|
98
|
-
elementName: data.text || GAData.groupName
|
|
98
|
+
elementName: data.text || (GAData === null || GAData === void 0 ? void 0 : GAData.groupName)
|
|
99
99
|
}));
|
|
100
100
|
return;
|
|
101
101
|
} // 组织冒泡
|
package/es/locale/en/en.json
CHANGED
package/es/locale/es/es.json
CHANGED
package/es/locale/id/id.json
CHANGED
package/es/utils/businessUtil.js
CHANGED
|
@@ -31,7 +31,18 @@ var newParseUrl = function newParseUrl(urlObj) {
|
|
|
31
31
|
productId = urlObj.productId;
|
|
32
32
|
|
|
33
33
|
switch (type) {
|
|
34
|
+
// 锚点跳转
|
|
35
|
+
case _constants.urlTypeMap.ANCHOR:
|
|
36
|
+
params = {
|
|
37
|
+
action: 'operation',
|
|
38
|
+
params: {
|
|
39
|
+
type: 'ANCHOR',
|
|
40
|
+
data: value
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
break;
|
|
34
44
|
// 商品详情
|
|
45
|
+
|
|
35
46
|
case _constants.urlTypeMap.PRODUCT_DETAIL_PAGE:
|
|
36
47
|
if (offerId) {
|
|
37
48
|
link = "/product/detail/" + offerId + "?productId=" + (productId !== null && productId !== void 0 ? productId : '');
|
package/es/utils/coreUtil.js
CHANGED
|
@@ -286,6 +286,22 @@ var getCoupon = function getCoupon(couponId) {
|
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
+
function isUrl(string) {
|
|
290
|
+
// var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
|
|
291
|
+
// '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
|
|
292
|
+
// '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
|
|
293
|
+
// '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
|
|
294
|
+
// '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
|
|
295
|
+
// '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
|
|
296
|
+
// return !!pattern.test(string);
|
|
297
|
+
try {
|
|
298
|
+
new URL(string);
|
|
299
|
+
return true;
|
|
300
|
+
} catch (_) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
289
305
|
var clickUrl = function clickUrl(url) {
|
|
290
306
|
if (url === void 0) {
|
|
291
307
|
url = '';
|
|
@@ -310,6 +326,17 @@ var clickUrl = function clickUrl(url) {
|
|
|
310
326
|
url: params.link
|
|
311
327
|
}
|
|
312
328
|
});
|
|
329
|
+
/** 锚点跳转 */
|
|
330
|
+
|
|
331
|
+
if (params.type === 'ANCHOR') {
|
|
332
|
+
(0, _commonUtil.ensure)(function () {
|
|
333
|
+
var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
|
|
334
|
+
document.querySelector("#node-" + nodeId).scrollIntoView({
|
|
335
|
+
behavior: 'smooth'
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
313
340
|
|
|
314
341
|
if ((0, _androidUtil.browserVersion)().isAshitaApp) {
|
|
315
342
|
(0, _androidUtil.sendToApp)(data);
|
|
@@ -342,9 +369,23 @@ var clickUrl = function clickUrl(url) {
|
|
|
342
369
|
}
|
|
343
370
|
|
|
344
371
|
return;
|
|
372
|
+
} // 输入的是完整的跳转地址
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
if (isUrl(link)) {
|
|
376
|
+
if (!link.includes(window.location.host)) {
|
|
377
|
+
// 跳转外链 需要把userToken带上
|
|
378
|
+
if (link.includes('?')) {
|
|
379
|
+
var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
|
|
380
|
+
window.open(a);
|
|
381
|
+
} else {
|
|
382
|
+
var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
|
|
383
|
+
window.open(a);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
(0, _commonUtil.navigateTo)(link);
|
|
345
388
|
}
|
|
346
|
-
|
|
347
|
-
(0, _commonUtil.navigateTo)(link);
|
|
348
389
|
}
|
|
349
390
|
};
|
|
350
391
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1704245006151') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1704245006151') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1704245006151') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.magic-box-icon-anchor:before {
|
|
17
|
+
content: "\e642";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.magic-box-icon-circle-down:before {
|
|
17
21
|
content: "\e686";
|
|
18
22
|
}
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
content: "\e687";
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
.magic-box-icon-
|
|
28
|
+
.magic-box-icon-template:before {
|
|
25
29
|
content: "\e685";
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "magic-box-iconfont"; /* Project id 3317752 */
|
|
3
|
-
src: url('magic-box-iconfont.woff2?t=
|
|
4
|
-
url('magic-box-iconfont.woff?t=
|
|
5
|
-
url('magic-box-iconfont.ttf?t=
|
|
3
|
+
src: url('magic-box-iconfont.woff2?t=1704245006151') format('woff2'),
|
|
4
|
+
url('magic-box-iconfont.woff?t=1704245006151') format('woff'),
|
|
5
|
+
url('magic-box-iconfont.ttf?t=1704245006151') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.magic-box-iconfont {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-anchor:before {
|
|
17
|
+
content: "\e642";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.icon-circle-down:before {
|
|
17
21
|
content: "\e686";
|
|
18
22
|
}
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
content: "\e687";
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
.icon-
|
|
28
|
+
.icon-template:before {
|
|
25
29
|
content: "\e685";
|
|
26
30
|
}
|
|
27
31
|
|