vant 4.8.9 → 4.8.10
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/coupon-cell/CouponCell.d.ts +11 -11
- package/es/coupon-cell/CouponCell.mjs +22 -29
- package/es/coupon-cell/index.d.ts +3 -3
- package/es/coupon-list/CouponList.d.ts +26 -16
- package/es/coupon-list/CouponList.mjs +14 -13
- package/es/coupon-list/index.d.ts +9 -2
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/lib/coupon-cell/CouponCell.d.ts +11 -11
- package/lib/coupon-cell/CouponCell.js +22 -29
- package/lib/coupon-cell/index.d.ts +3 -3
- package/lib/coupon-list/CouponList.d.ts +26 -16
- package/lib/coupon-list/CouponList.js +13 -12
- package/lib/coupon-list/index.d.ts +9 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/vant.cjs.js +40 -46
- package/lib/vant.es.js +40 -46
- package/lib/vant.js +40 -46
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
@@ -1,16 +1,16 @@
|
|
1
|
-
import { type ExtractPropTypes } from 'vue';
|
1
|
+
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
2
|
import { CouponInfo } from '../coupon';
|
3
3
|
export declare const couponListProps: {
|
4
4
|
code: {
|
5
|
-
type:
|
5
|
+
type: PropType<string>;
|
6
6
|
default: string;
|
7
7
|
};
|
8
8
|
coupons: {
|
9
|
-
type:
|
9
|
+
type: PropType<CouponInfo[]>;
|
10
10
|
default: () => never[];
|
11
11
|
};
|
12
12
|
currency: {
|
13
|
-
type:
|
13
|
+
type: PropType<string>;
|
14
14
|
default: string;
|
15
15
|
};
|
16
16
|
showCount: {
|
@@ -18,11 +18,10 @@ export declare const couponListProps: {
|
|
18
18
|
default: true;
|
19
19
|
};
|
20
20
|
emptyImage: StringConstructor;
|
21
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
22
21
|
enabledTitle: StringConstructor;
|
23
22
|
disabledTitle: StringConstructor;
|
24
23
|
disabledCoupons: {
|
25
|
-
type:
|
24
|
+
type: PropType<CouponInfo[]>;
|
26
25
|
default: () => never[];
|
27
26
|
};
|
28
27
|
showExchangeBar: {
|
@@ -46,19 +45,23 @@ export declare const couponListProps: {
|
|
46
45
|
};
|
47
46
|
exchangeButtonLoading: BooleanConstructor;
|
48
47
|
exchangeButtonDisabled: BooleanConstructor;
|
48
|
+
chosenCoupon: {
|
49
|
+
type: PropType<number | number[]>;
|
50
|
+
default: number;
|
51
|
+
};
|
49
52
|
};
|
50
53
|
export type CouponListProps = ExtractPropTypes<typeof couponListProps>;
|
51
54
|
declare const _default: import("vue").DefineComponent<{
|
52
55
|
code: {
|
53
|
-
type:
|
56
|
+
type: PropType<string>;
|
54
57
|
default: string;
|
55
58
|
};
|
56
59
|
coupons: {
|
57
|
-
type:
|
60
|
+
type: PropType<CouponInfo[]>;
|
58
61
|
default: () => never[];
|
59
62
|
};
|
60
63
|
currency: {
|
61
|
-
type:
|
64
|
+
type: PropType<string>;
|
62
65
|
default: string;
|
63
66
|
};
|
64
67
|
showCount: {
|
@@ -66,11 +69,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
66
69
|
default: true;
|
67
70
|
};
|
68
71
|
emptyImage: StringConstructor;
|
69
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
70
72
|
enabledTitle: StringConstructor;
|
71
73
|
disabledTitle: StringConstructor;
|
72
74
|
disabledCoupons: {
|
73
|
-
type:
|
75
|
+
type: PropType<CouponInfo[]>;
|
74
76
|
default: () => never[];
|
75
77
|
};
|
76
78
|
showExchangeBar: {
|
@@ -94,17 +96,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
94
96
|
};
|
95
97
|
exchangeButtonLoading: BooleanConstructor;
|
96
98
|
exchangeButtonDisabled: BooleanConstructor;
|
99
|
+
chosenCoupon: {
|
100
|
+
type: PropType<number | number[]>;
|
101
|
+
default: number;
|
102
|
+
};
|
97
103
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
98
104
|
code: {
|
99
|
-
type:
|
105
|
+
type: PropType<string>;
|
100
106
|
default: string;
|
101
107
|
};
|
102
108
|
coupons: {
|
103
|
-
type:
|
109
|
+
type: PropType<CouponInfo[]>;
|
104
110
|
default: () => never[];
|
105
111
|
};
|
106
112
|
currency: {
|
107
|
-
type:
|
113
|
+
type: PropType<string>;
|
108
114
|
default: string;
|
109
115
|
};
|
110
116
|
showCount: {
|
@@ -112,11 +118,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
112
118
|
default: true;
|
113
119
|
};
|
114
120
|
emptyImage: StringConstructor;
|
115
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
116
121
|
enabledTitle: StringConstructor;
|
117
122
|
disabledTitle: StringConstructor;
|
118
123
|
disabledCoupons: {
|
119
|
-
type:
|
124
|
+
type: PropType<CouponInfo[]>;
|
120
125
|
default: () => never[];
|
121
126
|
};
|
122
127
|
showExchangeBar: {
|
@@ -140,6 +145,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
140
145
|
};
|
141
146
|
exchangeButtonLoading: BooleanConstructor;
|
142
147
|
exchangeButtonDisabled: BooleanConstructor;
|
148
|
+
chosenCoupon: {
|
149
|
+
type: PropType<number | number[]>;
|
150
|
+
default: number;
|
151
|
+
};
|
143
152
|
}>> & {
|
144
153
|
onChange?: ((...args: any[]) => any) | undefined;
|
145
154
|
onExchange?: ((...args: any[]) => any) | undefined;
|
@@ -148,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
148
157
|
code: string;
|
149
158
|
currency: string;
|
150
159
|
coupons: CouponInfo[];
|
160
|
+
chosenCoupon: number | number[];
|
151
161
|
showCount: boolean;
|
152
162
|
disabledCoupons: CouponInfo[];
|
153
163
|
showExchangeBar: boolean;
|
@@ -39,7 +39,6 @@ const couponListProps = {
|
|
39
39
|
currency: (0, import_utils.makeStringProp)("\xA5"),
|
40
40
|
showCount: import_utils.truthProp,
|
41
41
|
emptyImage: String,
|
42
|
-
chosenCoupon: [Number, Array],
|
43
42
|
enabledTitle: String,
|
44
43
|
disabledTitle: String,
|
45
44
|
disabledCoupons: (0, import_utils.makeArrayProp)(),
|
@@ -51,7 +50,11 @@ const couponListProps = {
|
|
51
50
|
exchangeButtonText: String,
|
52
51
|
displayedCouponIndex: (0, import_utils.makeNumberProp)(-1),
|
53
52
|
exchangeButtonLoading: Boolean,
|
54
|
-
exchangeButtonDisabled: Boolean
|
53
|
+
exchangeButtonDisabled: Boolean,
|
54
|
+
chosenCoupon: {
|
55
|
+
type: [Number, Array],
|
56
|
+
default: -1
|
57
|
+
}
|
55
58
|
};
|
56
59
|
var stdin_default = (0, import_vue2.defineComponent)({
|
57
60
|
name,
|
@@ -119,18 +122,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
119
122
|
};
|
120
123
|
const renderCouponTab = () => {
|
121
124
|
const {
|
122
|
-
coupons
|
125
|
+
coupons,
|
126
|
+
chosenCoupon
|
123
127
|
} = props;
|
124
128
|
const count = props.showCount ? ` (${coupons.length})` : "";
|
125
129
|
const title = (props.enabledTitle || t("enable")) + count;
|
126
|
-
const
|
127
|
-
|
128
|
-
|
129
|
-
if (index === -1) {
|
130
|
-
return [...unrefChosenCoupon, value];
|
130
|
+
const updateChosenCoupon = (currentValues = [], value = 0) => {
|
131
|
+
if (currentValues.includes(value)) {
|
132
|
+
return currentValues.filter((item) => item !== value);
|
131
133
|
}
|
132
|
-
|
133
|
-
return [...unrefChosenCoupon];
|
134
|
+
return [...currentValues, value];
|
134
135
|
};
|
135
136
|
return (0, import_vue.createVNode)(import_tab.Tab, {
|
136
137
|
"title": title
|
@@ -148,9 +149,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
148
149
|
"key": coupon.id,
|
149
150
|
"ref": setCouponRefs(index),
|
150
151
|
"coupon": coupon,
|
151
|
-
"chosen": Array.isArray(
|
152
|
+
"chosen": Array.isArray(chosenCoupon) ? chosenCoupon.includes(index) : index === chosenCoupon,
|
152
153
|
"currency": props.currency,
|
153
|
-
"onClick": () => emit("change", Array.isArray(
|
154
|
+
"onClick": () => emit("change", Array.isArray(chosenCoupon) ? updateChosenCoupon(chosenCoupon, index) : index)
|
154
155
|
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
|
155
156
|
}
|
156
157
|
});
|
@@ -16,7 +16,6 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
emptyImage: StringConstructor;
|
19
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
20
19
|
enabledTitle: StringConstructor;
|
21
20
|
disabledTitle: StringConstructor;
|
22
21
|
disabledCoupons: {
|
@@ -44,6 +43,10 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
44
43
|
};
|
45
44
|
exchangeButtonLoading: BooleanConstructor;
|
46
45
|
exchangeButtonDisabled: BooleanConstructor;
|
46
|
+
chosenCoupon: {
|
47
|
+
type: import("vue").PropType<number | number[]>;
|
48
|
+
default: number;
|
49
|
+
};
|
47
50
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "exchange" | "update:code")[], "change" | "exchange" | "update:code", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
48
51
|
code: {
|
49
52
|
type: import("vue").PropType<string>;
|
@@ -62,7 +65,6 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
62
65
|
default: true;
|
63
66
|
};
|
64
67
|
emptyImage: StringConstructor;
|
65
|
-
chosenCoupon: (NumberConstructor | ArrayConstructor)[];
|
66
68
|
enabledTitle: StringConstructor;
|
67
69
|
disabledTitle: StringConstructor;
|
68
70
|
disabledCoupons: {
|
@@ -90,6 +92,10 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
90
92
|
};
|
91
93
|
exchangeButtonLoading: BooleanConstructor;
|
92
94
|
exchangeButtonDisabled: BooleanConstructor;
|
95
|
+
chosenCoupon: {
|
96
|
+
type: import("vue").PropType<number | number[]>;
|
97
|
+
default: number;
|
98
|
+
};
|
93
99
|
}>> & {
|
94
100
|
onChange?: ((...args: any[]) => any) | undefined;
|
95
101
|
onExchange?: ((...args: any[]) => any) | undefined;
|
@@ -98,6 +104,7 @@ export declare const CouponList: import("../utils").WithInstall<import("vue").De
|
|
98
104
|
code: string;
|
99
105
|
currency: string;
|
100
106
|
coupons: import("..").CouponInfo[];
|
107
|
+
chosenCoupon: number | number[];
|
101
108
|
showCount: boolean;
|
102
109
|
disabledCoupons: import("..").CouponInfo[];
|
103
110
|
showExchangeBar: boolean;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -226,7 +226,7 @@ __reExport(stdin_exports, require("./toast"), module.exports);
|
|
226
226
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
227
227
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
228
228
|
__reExport(stdin_exports, require("./watermark"), module.exports);
|
229
|
-
const version = "4.8.
|
229
|
+
const version = "4.8.10";
|
230
230
|
function install(app) {
|
231
231
|
const components = [
|
232
232
|
import_action_bar.ActionBar,
|
package/lib/vant.cjs.js
CHANGED
@@ -8637,44 +8637,37 @@ const couponCellProps = {
|
|
8637
8637
|
default: -1
|
8638
8638
|
}
|
8639
8639
|
};
|
8640
|
+
const getValue = (coupon) => {
|
8641
|
+
const {
|
8642
|
+
value,
|
8643
|
+
denominations
|
8644
|
+
} = coupon;
|
8645
|
+
if (isDef(value)) {
|
8646
|
+
return value;
|
8647
|
+
}
|
8648
|
+
if (isDef(denominations)) {
|
8649
|
+
return denominations;
|
8650
|
+
}
|
8651
|
+
return 0;
|
8652
|
+
};
|
8640
8653
|
function formatValue({
|
8641
8654
|
coupons,
|
8642
8655
|
chosenCoupon,
|
8643
8656
|
currency
|
8644
8657
|
}) {
|
8645
|
-
|
8646
|
-
|
8647
|
-
|
8648
|
-
|
8649
|
-
denominations
|
8650
|
-
} = coupon;
|
8651
|
-
if (isDef(coupon.value)) {
|
8652
|
-
value2 = couponValue;
|
8653
|
-
} else if (isDef(coupon.denominations)) {
|
8654
|
-
value2 = denominations;
|
8655
|
-
}
|
8656
|
-
return value2;
|
8657
|
-
};
|
8658
|
-
let value = 0, isExist = false;
|
8659
|
-
if (Array.isArray(chosenCoupon)) {
|
8660
|
-
chosenCoupon.forEach((i) => {
|
8661
|
-
const coupon = coupons[+i];
|
8662
|
-
if (coupon) {
|
8663
|
-
isExist = true;
|
8664
|
-
value += getValue(coupon);
|
8665
|
-
}
|
8666
|
-
});
|
8667
|
-
} else {
|
8668
|
-
const coupon = coupons[+chosenCoupon];
|
8658
|
+
let value = 0;
|
8659
|
+
let isExist = false;
|
8660
|
+
(Array.isArray(chosenCoupon) ? chosenCoupon : [chosenCoupon]).forEach((i) => {
|
8661
|
+
const coupon = coupons[+i];
|
8669
8662
|
if (coupon) {
|
8670
8663
|
isExist = true;
|
8671
|
-
value
|
8664
|
+
value += getValue(coupon);
|
8672
8665
|
}
|
8666
|
+
});
|
8667
|
+
if (isExist) {
|
8668
|
+
return `-${currency} ${(value / 100).toFixed(2)}`;
|
8673
8669
|
}
|
8674
|
-
|
8675
|
-
return coupons.length === 0 ? t$a("noCoupon") : t$a("count", coupons.length);
|
8676
|
-
}
|
8677
|
-
return `-${currency} ${(value / 100).toFixed(2)}`;
|
8670
|
+
return coupons.length === 0 ? t$a("noCoupon") : t$a("count", coupons.length);
|
8678
8671
|
}
|
8679
8672
|
var stdin_default$_ = vue.defineComponent({
|
8680
8673
|
name: name$R,
|
@@ -9019,7 +9012,6 @@ const couponListProps = {
|
|
9019
9012
|
currency: makeStringProp("¥"),
|
9020
9013
|
showCount: truthProp,
|
9021
9014
|
emptyImage: String,
|
9022
|
-
chosenCoupon: [Number, Array],
|
9023
9015
|
enabledTitle: String,
|
9024
9016
|
disabledTitle: String,
|
9025
9017
|
disabledCoupons: makeArrayProp(),
|
@@ -9031,7 +9023,11 @@ const couponListProps = {
|
|
9031
9023
|
exchangeButtonText: String,
|
9032
9024
|
displayedCouponIndex: makeNumberProp(-1),
|
9033
9025
|
exchangeButtonLoading: Boolean,
|
9034
|
-
exchangeButtonDisabled: Boolean
|
9026
|
+
exchangeButtonDisabled: Boolean,
|
9027
|
+
chosenCoupon: {
|
9028
|
+
type: [Number, Array],
|
9029
|
+
default: -1
|
9030
|
+
}
|
9035
9031
|
};
|
9036
9032
|
var stdin_default$Y = vue.defineComponent({
|
9037
9033
|
name: name$P,
|
@@ -9099,18 +9095,16 @@ var stdin_default$Y = vue.defineComponent({
|
|
9099
9095
|
};
|
9100
9096
|
const renderCouponTab = () => {
|
9101
9097
|
const {
|
9102
|
-
coupons
|
9098
|
+
coupons,
|
9099
|
+
chosenCoupon
|
9103
9100
|
} = props2;
|
9104
9101
|
const count = props2.showCount ? ` (${coupons.length})` : "";
|
9105
9102
|
const title = (props2.enabledTitle || t$9("enable")) + count;
|
9106
|
-
const
|
9107
|
-
|
9108
|
-
|
9109
|
-
if (index === -1) {
|
9110
|
-
return [...unrefChosenCoupon, value];
|
9103
|
+
const updateChosenCoupon = (currentValues = [], value = 0) => {
|
9104
|
+
if (currentValues.includes(value)) {
|
9105
|
+
return currentValues.filter((item) => item !== value);
|
9111
9106
|
}
|
9112
|
-
|
9113
|
-
return [...unrefChosenCoupon];
|
9107
|
+
return [...currentValues, value];
|
9114
9108
|
};
|
9115
9109
|
return vue.createVNode(Tab, {
|
9116
9110
|
"title": title
|
@@ -9128,9 +9122,9 @@ var stdin_default$Y = vue.defineComponent({
|
|
9128
9122
|
"key": coupon.id,
|
9129
9123
|
"ref": setCouponRefs(index),
|
9130
9124
|
"coupon": coupon,
|
9131
|
-
"chosen": Array.isArray(
|
9125
|
+
"chosen": Array.isArray(chosenCoupon) ? chosenCoupon.includes(index) : index === chosenCoupon,
|
9132
9126
|
"currency": props2.currency,
|
9133
|
-
"onClick": () => emit("change", Array.isArray(
|
9127
|
+
"onClick": () => emit("change", Array.isArray(chosenCoupon) ? updateChosenCoupon(chosenCoupon, index) : index)
|
9134
9128
|
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
|
9135
9129
|
}
|
9136
9130
|
});
|
@@ -9232,7 +9226,7 @@ var stdin_default$X = vue.defineComponent({
|
|
9232
9226
|
const isMaxYear = (year) => year === props2.maxDate.getFullYear();
|
9233
9227
|
const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
|
9234
9228
|
const isMaxMonth = (month) => month === props2.maxDate.getMonth() + 1;
|
9235
|
-
const
|
9229
|
+
const getValue2 = (type) => {
|
9236
9230
|
const {
|
9237
9231
|
minDate,
|
9238
9232
|
columnsType
|
@@ -9252,14 +9246,14 @@ var stdin_default$X = vue.defineComponent({
|
|
9252
9246
|
}
|
9253
9247
|
};
|
9254
9248
|
const genMonthOptions = () => {
|
9255
|
-
const year =
|
9249
|
+
const year = getValue2("year");
|
9256
9250
|
const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
|
9257
9251
|
const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
|
9258
9252
|
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
|
9259
9253
|
};
|
9260
9254
|
const genDayOptions = () => {
|
9261
|
-
const year =
|
9262
|
-
const month =
|
9255
|
+
const year = getValue2("year");
|
9256
|
+
const month = getValue2("month");
|
9263
9257
|
const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
|
9264
9258
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
|
9265
9259
|
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
|
@@ -16873,7 +16867,7 @@ const Lazyload = {
|
|
16873
16867
|
});
|
16874
16868
|
}
|
16875
16869
|
};
|
16876
|
-
const version = "4.8.
|
16870
|
+
const version = "4.8.10";
|
16877
16871
|
function install(app) {
|
16878
16872
|
const components = [
|
16879
16873
|
ActionBar,
|
package/lib/vant.es.js
CHANGED
@@ -8635,44 +8635,37 @@ const couponCellProps = {
|
|
8635
8635
|
default: -1
|
8636
8636
|
}
|
8637
8637
|
};
|
8638
|
+
const getValue = (coupon) => {
|
8639
|
+
const {
|
8640
|
+
value,
|
8641
|
+
denominations
|
8642
|
+
} = coupon;
|
8643
|
+
if (isDef(value)) {
|
8644
|
+
return value;
|
8645
|
+
}
|
8646
|
+
if (isDef(denominations)) {
|
8647
|
+
return denominations;
|
8648
|
+
}
|
8649
|
+
return 0;
|
8650
|
+
};
|
8638
8651
|
function formatValue({
|
8639
8652
|
coupons,
|
8640
8653
|
chosenCoupon,
|
8641
8654
|
currency
|
8642
8655
|
}) {
|
8643
|
-
|
8644
|
-
|
8645
|
-
|
8646
|
-
|
8647
|
-
denominations
|
8648
|
-
} = coupon;
|
8649
|
-
if (isDef(coupon.value)) {
|
8650
|
-
value2 = couponValue;
|
8651
|
-
} else if (isDef(coupon.denominations)) {
|
8652
|
-
value2 = denominations;
|
8653
|
-
}
|
8654
|
-
return value2;
|
8655
|
-
};
|
8656
|
-
let value = 0, isExist = false;
|
8657
|
-
if (Array.isArray(chosenCoupon)) {
|
8658
|
-
chosenCoupon.forEach((i) => {
|
8659
|
-
const coupon = coupons[+i];
|
8660
|
-
if (coupon) {
|
8661
|
-
isExist = true;
|
8662
|
-
value += getValue(coupon);
|
8663
|
-
}
|
8664
|
-
});
|
8665
|
-
} else {
|
8666
|
-
const coupon = coupons[+chosenCoupon];
|
8656
|
+
let value = 0;
|
8657
|
+
let isExist = false;
|
8658
|
+
(Array.isArray(chosenCoupon) ? chosenCoupon : [chosenCoupon]).forEach((i) => {
|
8659
|
+
const coupon = coupons[+i];
|
8667
8660
|
if (coupon) {
|
8668
8661
|
isExist = true;
|
8669
|
-
value
|
8662
|
+
value += getValue(coupon);
|
8670
8663
|
}
|
8664
|
+
});
|
8665
|
+
if (isExist) {
|
8666
|
+
return `-${currency} ${(value / 100).toFixed(2)}`;
|
8671
8667
|
}
|
8672
|
-
|
8673
|
-
return coupons.length === 0 ? t$a("noCoupon") : t$a("count", coupons.length);
|
8674
|
-
}
|
8675
|
-
return `-${currency} ${(value / 100).toFixed(2)}`;
|
8668
|
+
return coupons.length === 0 ? t$a("noCoupon") : t$a("count", coupons.length);
|
8676
8669
|
}
|
8677
8670
|
var stdin_default$_ = defineComponent({
|
8678
8671
|
name: name$R,
|
@@ -9017,7 +9010,6 @@ const couponListProps = {
|
|
9017
9010
|
currency: makeStringProp("¥"),
|
9018
9011
|
showCount: truthProp,
|
9019
9012
|
emptyImage: String,
|
9020
|
-
chosenCoupon: [Number, Array],
|
9021
9013
|
enabledTitle: String,
|
9022
9014
|
disabledTitle: String,
|
9023
9015
|
disabledCoupons: makeArrayProp(),
|
@@ -9029,7 +9021,11 @@ const couponListProps = {
|
|
9029
9021
|
exchangeButtonText: String,
|
9030
9022
|
displayedCouponIndex: makeNumberProp(-1),
|
9031
9023
|
exchangeButtonLoading: Boolean,
|
9032
|
-
exchangeButtonDisabled: Boolean
|
9024
|
+
exchangeButtonDisabled: Boolean,
|
9025
|
+
chosenCoupon: {
|
9026
|
+
type: [Number, Array],
|
9027
|
+
default: -1
|
9028
|
+
}
|
9033
9029
|
};
|
9034
9030
|
var stdin_default$Y = defineComponent({
|
9035
9031
|
name: name$P,
|
@@ -9097,18 +9093,16 @@ var stdin_default$Y = defineComponent({
|
|
9097
9093
|
};
|
9098
9094
|
const renderCouponTab = () => {
|
9099
9095
|
const {
|
9100
|
-
coupons
|
9096
|
+
coupons,
|
9097
|
+
chosenCoupon
|
9101
9098
|
} = props2;
|
9102
9099
|
const count = props2.showCount ? ` (${coupons.length})` : "";
|
9103
9100
|
const title = (props2.enabledTitle || t$9("enable")) + count;
|
9104
|
-
const
|
9105
|
-
|
9106
|
-
|
9107
|
-
if (index === -1) {
|
9108
|
-
return [...unrefChosenCoupon, value];
|
9101
|
+
const updateChosenCoupon = (currentValues = [], value = 0) => {
|
9102
|
+
if (currentValues.includes(value)) {
|
9103
|
+
return currentValues.filter((item) => item !== value);
|
9109
9104
|
}
|
9110
|
-
|
9111
|
-
return [...unrefChosenCoupon];
|
9105
|
+
return [...currentValues, value];
|
9112
9106
|
};
|
9113
9107
|
return createVNode(Tab, {
|
9114
9108
|
"title": title
|
@@ -9126,9 +9120,9 @@ var stdin_default$Y = defineComponent({
|
|
9126
9120
|
"key": coupon.id,
|
9127
9121
|
"ref": setCouponRefs(index),
|
9128
9122
|
"coupon": coupon,
|
9129
|
-
"chosen": Array.isArray(
|
9123
|
+
"chosen": Array.isArray(chosenCoupon) ? chosenCoupon.includes(index) : index === chosenCoupon,
|
9130
9124
|
"currency": props2.currency,
|
9131
|
-
"onClick": () => emit("change", Array.isArray(
|
9125
|
+
"onClick": () => emit("change", Array.isArray(chosenCoupon) ? updateChosenCoupon(chosenCoupon, index) : index)
|
9132
9126
|
}, null)), !coupons.length && renderEmpty(), (_a = slots["list-footer"]) == null ? void 0 : _a.call(slots)])];
|
9133
9127
|
}
|
9134
9128
|
});
|
@@ -9230,7 +9224,7 @@ var stdin_default$X = defineComponent({
|
|
9230
9224
|
const isMaxYear = (year) => year === props2.maxDate.getFullYear();
|
9231
9225
|
const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
|
9232
9226
|
const isMaxMonth = (month) => month === props2.maxDate.getMonth() + 1;
|
9233
|
-
const
|
9227
|
+
const getValue2 = (type) => {
|
9234
9228
|
const {
|
9235
9229
|
minDate,
|
9236
9230
|
columnsType
|
@@ -9250,14 +9244,14 @@ var stdin_default$X = defineComponent({
|
|
9250
9244
|
}
|
9251
9245
|
};
|
9252
9246
|
const genMonthOptions = () => {
|
9253
|
-
const year =
|
9247
|
+
const year = getValue2("year");
|
9254
9248
|
const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
|
9255
9249
|
const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
|
9256
9250
|
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
|
9257
9251
|
};
|
9258
9252
|
const genDayOptions = () => {
|
9259
|
-
const year =
|
9260
|
-
const month =
|
9253
|
+
const year = getValue2("year");
|
9254
|
+
const month = getValue2("month");
|
9261
9255
|
const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
|
9262
9256
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
|
9263
9257
|
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
|
@@ -16871,7 +16865,7 @@ const Lazyload = {
|
|
16871
16865
|
});
|
16872
16866
|
}
|
16873
16867
|
};
|
16874
|
-
const version = "4.8.
|
16868
|
+
const version = "4.8.10";
|
16875
16869
|
function install(app) {
|
16876
16870
|
const components = [
|
16877
16871
|
ActionBar,
|