@nutui/nutui 4.0.11 → 4.0.12
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/nutui.es.js +1 -1
- package/dist/nutui.js +2 -2
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +111 -78
- package/dist/packages/_es/Address.js +375 -250
- package/dist/packages/_es/AddressList.js +354 -269
- package/dist/packages/_es/Animate.js +58 -41
- package/dist/packages/_es/Audio.js +197 -128
- package/dist/packages/_es/AudioOperate.js +71 -60
- package/dist/packages/_es/Avatar.js +89 -66
- package/dist/packages/_es/AvatarGroup.js +31 -23
- package/dist/packages/_es/Backtop.js +99 -59
- package/dist/packages/_es/Badge.js +47 -36
- package/dist/packages/_es/Barrage.js +147 -68
- package/dist/packages/_es/Button.js +66 -47
- package/dist/packages/_es/Calendar.js +157 -135
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +56 -42
- package/dist/packages/_es/Cascader.js +474 -315
- package/dist/packages/_es/Category.js +39 -29
- package/dist/packages/_es/CategoryPane.js +83 -57
- package/dist/packages/_es/Cell.js +71 -56
- package/dist/packages/_es/CellGroup.js +27 -19
- package/dist/packages/_es/Checkbox.js +156 -109
- package/dist/packages/_es/CheckboxGroup.js +59 -38
- package/dist/packages/_es/CircleProgress.js +96 -67
- package/dist/packages/_es/Col.js +31 -23
- package/dist/packages/_es/Collapse.js +58 -33
- package/dist/packages/_es/CollapseItem.js +108 -78
- package/dist/packages/_es/Comment.js +279 -207
- package/dist/packages/_es/ConfigProvider.js +55 -37
- package/dist/packages/_es/Countdown.js +212 -100
- package/dist/packages/_es/Countup.js +445 -232
- package/dist/packages/_es/DatePicker.js +265 -162
- package/dist/packages/_es/Dialog.js +213 -161
- package/dist/packages/_es/Divider.js +57 -42
- package/dist/packages/_es/Drag.js +153 -70
- package/dist/packages/_es/Ecard.js +104 -64
- package/dist/packages/_es/Elevator.js +219 -143
- package/dist/packages/_es/Ellipsis.js +178 -95
- package/dist/packages/_es/Empty.js +39 -23
- package/dist/packages/_es/FixedNav.js +116 -93
- package/dist/packages/_es/Form.js +178 -107
- package/dist/packages/_es/FormItem.js +61 -48
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +84 -58
- package/dist/packages/_es/Image.js +130 -90
- package/dist/packages/_es/ImagePreview.js +412 -256
- package/dist/packages/_es/Indicator.js +34 -30
- package/dist/packages/_es/InfiniteLoading.js +136 -83
- package/dist/packages/_es/Input.js +264 -160
- package/dist/packages/_es/InputNumber.js +117 -81
- package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
- package/dist/packages/_es/Invoice.js +130 -104
- package/dist/packages/_es/Layout.js +4 -3
- package/dist/packages/_es/List.js +215 -117
- package/dist/packages/_es/Menu.js +150 -95
- package/dist/packages/_es/MenuItem.js +154 -109
- package/dist/packages/_es/Navbar.js +119 -103
- package/dist/packages/_es/Noticebar.js +312 -197
- package/dist/packages/_es/Notify.js +166 -110
- package/dist/packages/_es/NumberKeyboard.js +202 -127
- package/dist/packages/_es/Overlay.js +80 -52
- package/dist/packages/_es/Pagination.js +100 -70
- package/dist/packages/_es/Picker.js +437 -275
- package/dist/packages/_es/Popover.js +225 -122
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +82 -44
- package/dist/packages/_es/Progress.js +79 -63
- package/dist/packages/_es/PullRefresh.js +173 -95
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +347 -204
- package/dist/packages/_es/Rate.js +141 -92
- package/dist/packages/_es/Row.js +27 -21
- package/dist/packages/_es/Searchbar.js +174 -123
- package/dist/packages/_es/ShortPassword.js +93 -69
- package/dist/packages/_es/SideNavbar.js +80 -49
- package/dist/packages/_es/SideNavbarItem.js +32 -22
- package/dist/packages/_es/Signature.js +146 -83
- package/dist/packages/_es/Skeleton.js +130 -110
- package/dist/packages/_es/Sku.js +343 -250
- package/dist/packages/_es/Step.js +86 -59
- package/dist/packages/_es/Steps.js +31 -26
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +74 -52
- package/dist/packages/_es/Swipe.js +155 -83
- package/dist/packages/_es/Swiper.js +311 -174
- package/dist/packages/_es/SwiperItem.js +44 -28
- package/dist/packages/_es/Switch.js +68 -55
- package/dist/packages/_es/TabPane.js +41 -30
- package/dist/packages/_es/Tabbar.js +52 -41
- package/dist/packages/_es/TabbarItem.js +82 -61
- package/dist/packages/_es/Table.js +165 -109
- package/dist/packages/_es/Tabs.js +388 -240
- package/dist/packages/_es/Tag.js +61 -44
- package/dist/packages/_es/Textarea.js +124 -80
- package/dist/packages/_es/TimeDetail.js +76 -49
- package/dist/packages/_es/TimePannel.js +48 -34
- package/dist/packages/_es/TimeSelect.js +68 -47
- package/dist/packages/_es/Toast.js +218 -144
- package/dist/packages/_es/Tour.js +192 -138
- package/dist/packages/_es/TrendArrow.js +77 -57
- package/dist/packages/_es/Uploader.js +359 -234
- package/dist/packages/_es/Video.js +316 -191
- package/dist/packages/_es/Watermark.js +117 -84
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
- package/dist/packages/_es/common-b9a5e726.js +145 -0
- package/dist/packages/_es/component-81a4c1d0.js +145 -0
- package/dist/packages/_es/index-29892cda.js +33 -0
- package/dist/packages/_es/index-43c34ac6.js +30 -0
- package/dist/packages/_es/index-54d03fc1.js +8 -0
- package/dist/packages/_es/index-79c5dc33.js +10 -0
- package/dist/packages/_es/index-7a7385e4.js +67 -0
- package/dist/packages/_es/index-87422be8.js +942 -0
- package/dist/packages/_es/index-da0a7662.js +259 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
- package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
- package/dist/packages/_es/raf-729dad54.js +25 -0
- package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
- package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
- package/dist/packages/locale/lang/en-US.js +39 -36
- package/dist/packages/locale/lang/id-ID.js +39 -36
- package/dist/packages/locale/lang/index.js +44 -22
- package/dist/packages/locale/lang/zh-CN.js +38 -35
- package/dist/packages/locale/lang/zh-TW.js +38 -35
- package/dist/resolver/index.js +26 -1
- package/dist/resolver/index.mjs +17 -14
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -48
- package/dist/styles/themes/jdb.scss +48 -48
- package/dist/styles/themes/jddkh.scss +48 -48
- package/dist/styles/themes/jdt.scss +48 -48
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -4
- package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
- package/dist/packages/_es/common-d218746f.js +0 -116
- package/dist/packages/_es/component-234624bc.js +0 -89
- package/dist/packages/_es/index-14dfadc4.js +0 -561
- package/dist/packages/_es/index-192a3ef6.js +0 -29
- package/dist/packages/_es/index-360c5092.js +0 -210
- package/dist/packages/_es/index-496e6e05.js +0 -24
- package/dist/packages/_es/index-50eed3d9.js +0 -7
- package/dist/packages/_es/index-53ec2d4d.js +0 -34
- package/dist/packages/_es/index-fadb0974.js +0 -8
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
- package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
- package/dist/packages/_es/pxCheck-38173291.js +0 -4
- package/dist/packages/_es/raf-a74f1a06.js +0 -16
- package/dist/packages/_es/renderIcon-47498b32.js +0 -5
- package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
|
|
21
|
+
import Price from "./Price.js";
|
|
22
|
+
import { c as createComponent, T as TypeOfFun } from "./component-81a4c1d0.js";
|
|
23
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
24
|
+
import InputNumber from "./InputNumber.js";
|
|
25
|
+
import { p as popupProps, P as Popup } from "./index-da0a7662.js";
|
|
19
26
|
import "../locale/lang";
|
|
20
|
-
import "./pxCheck-
|
|
27
|
+
import "./pxCheck-c6b9f6b7.js";
|
|
21
28
|
import "@nutui/icons-vue";
|
|
22
29
|
import "./Overlay.js";
|
|
23
|
-
const { componentName:
|
|
30
|
+
const { componentName: componentName$4, create: create$4, translate: translate$1 } = createComponent("sku-header");
|
|
31
|
+
const _sfc_main$4 = create$4({
|
|
24
32
|
props: {
|
|
25
33
|
goods: {
|
|
26
34
|
type: Object,
|
|
@@ -29,38 +37,45 @@ const { componentName: ze, create: K, translate: Q } = v("sku-header"), W = K({
|
|
|
29
37
|
},
|
|
30
38
|
emits: [],
|
|
31
39
|
components: {
|
|
32
|
-
[
|
|
40
|
+
[Price.name]: Price
|
|
33
41
|
},
|
|
34
|
-
setup(
|
|
42
|
+
setup(props, { emit, slots }) {
|
|
43
|
+
const getSlots = (name) => slots[name];
|
|
35
44
|
return {
|
|
36
|
-
getSlots
|
|
37
|
-
translate:
|
|
45
|
+
getSlots,
|
|
46
|
+
translate: translate$1
|
|
38
47
|
};
|
|
39
48
|
}
|
|
40
|
-
})
|
|
49
|
+
});
|
|
50
|
+
const _hoisted_1$4 = { class: "nut-sku-header" };
|
|
51
|
+
const _hoisted_2$4 = ["src"];
|
|
52
|
+
const _hoisted_3$3 = { class: "nut-sku-header-right" };
|
|
53
|
+
const _hoisted_4$3 = {
|
|
41
54
|
key: 3,
|
|
42
55
|
class: "nut-sku-header-right-extra"
|
|
43
56
|
};
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
|
|
57
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
58
|
+
const _component_nut_price = resolveComponent("nut-price");
|
|
59
|
+
return openBlock(), createElementBlock("view", _hoisted_1$4, [
|
|
60
|
+
createElementVNode("img", {
|
|
48
61
|
class: "nut-sku-header-img",
|
|
49
|
-
src:
|
|
50
|
-
}, null, 8,
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
src: _ctx.goods.imagePath
|
|
63
|
+
}, null, 8, _hoisted_2$4),
|
|
64
|
+
createElementVNode("view", _hoisted_3$3, [
|
|
65
|
+
_ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
|
|
53
66
|
key: 1,
|
|
54
|
-
price:
|
|
55
|
-
needSymbol:
|
|
56
|
-
thousands:
|
|
67
|
+
price: _ctx.goods.price,
|
|
68
|
+
needSymbol: true,
|
|
69
|
+
thousands: false
|
|
57
70
|
}, null, 8, ["price"])),
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
_ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
|
|
72
|
+
_ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, toDisplayString(_ctx.translate("skuId")) + " : " + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
|
|
60
73
|
])
|
|
61
74
|
]);
|
|
62
75
|
}
|
|
63
|
-
const
|
|
76
|
+
const SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
77
|
+
const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
|
|
78
|
+
const _sfc_main$3 = create$3({
|
|
64
79
|
props: {
|
|
65
80
|
sku: {
|
|
66
81
|
type: Array,
|
|
@@ -68,47 +83,65 @@ const se = /* @__PURE__ */ y(W, [["render", te]]), { componentName: qe, create:
|
|
|
68
83
|
}
|
|
69
84
|
},
|
|
70
85
|
emits: ["selectSku"],
|
|
71
|
-
setup(
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
() =>
|
|
75
|
-
(
|
|
76
|
-
|
|
86
|
+
setup(props, { emit }) {
|
|
87
|
+
const skuInfo = ref([]);
|
|
88
|
+
watch(
|
|
89
|
+
() => props.sku,
|
|
90
|
+
(value) => {
|
|
91
|
+
skuInfo.value = [].slice.call(value);
|
|
77
92
|
},
|
|
78
|
-
{ deep:
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
changeSaleChild: (p, d, n, l) => {
|
|
84
|
-
p.checkFlag || p.disable || t("selectSku", {
|
|
85
|
-
sku: p,
|
|
86
|
-
skuIndex: d,
|
|
87
|
-
parentSku: n,
|
|
88
|
-
parentIndex: l
|
|
89
|
-
});
|
|
93
|
+
{ deep: true }
|
|
94
|
+
);
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
if (props.sku.length > 0) {
|
|
97
|
+
skuInfo.value = [].slice.call(props.sku);
|
|
90
98
|
}
|
|
99
|
+
});
|
|
100
|
+
const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
|
|
101
|
+
if (attrItem.checkFlag || attrItem.disable) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
emit("selectSku", {
|
|
105
|
+
sku: attrItem,
|
|
106
|
+
skuIndex: index2,
|
|
107
|
+
parentSku: parentItem,
|
|
108
|
+
parentIndex
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
skuInfo,
|
|
113
|
+
changeSaleChild
|
|
91
114
|
};
|
|
92
115
|
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
});
|
|
117
|
+
const _hoisted_1$3 = { class: "nut-sku-select" };
|
|
118
|
+
const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
|
|
119
|
+
const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
|
|
120
|
+
const _hoisted_4$2 = ["onClick"];
|
|
121
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
122
|
+
return openBlock(), createElementBlock("view", _hoisted_1$3, [
|
|
123
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
|
|
124
|
+
return openBlock(), createElementBlock("view", {
|
|
125
|
+
class: "nut-sku-select-item",
|
|
126
|
+
key: item.id
|
|
127
|
+
}, [
|
|
128
|
+
createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
|
|
129
|
+
createElementVNode("view", _hoisted_3$2, [
|
|
130
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
|
|
131
|
+
return openBlock(), createElementBlock("view", {
|
|
132
|
+
class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
|
|
133
|
+
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
|
|
134
|
+
key: itemAttr.name
|
|
135
|
+
}, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
|
|
136
|
+
}), 128))
|
|
137
|
+
])
|
|
138
|
+
]);
|
|
139
|
+
}), 128))
|
|
109
140
|
]);
|
|
110
141
|
}
|
|
111
|
-
const
|
|
142
|
+
const SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
143
|
+
const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
|
|
144
|
+
const _sfc_main$2 = create$2({
|
|
112
145
|
props: {
|
|
113
146
|
// 购买数量最大值
|
|
114
147
|
stepperMax: {
|
|
@@ -122,7 +155,7 @@ const ie = /* @__PURE__ */ y(oe, [["render", le]]), { componentName: Ge, create:
|
|
|
122
155
|
// stepper 前文案提示
|
|
123
156
|
stepperExtraText: {
|
|
124
157
|
type: [Function, Boolean],
|
|
125
|
-
default:
|
|
158
|
+
default: false
|
|
126
159
|
},
|
|
127
160
|
// 数量选择左侧文案
|
|
128
161
|
stepperTitle: {
|
|
@@ -132,59 +165,76 @@ const ie = /* @__PURE__ */ y(oe, [["render", le]]), { componentName: Ge, create:
|
|
|
132
165
|
},
|
|
133
166
|
emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
|
|
134
167
|
components: {
|
|
135
|
-
[
|
|
168
|
+
[InputNumber.name]: InputNumber
|
|
136
169
|
},
|
|
137
|
-
setup(
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
overlimit: (o, g) => {
|
|
150
|
-
t("overLimit", {
|
|
151
|
-
action: g,
|
|
152
|
-
value: parseInt(s.value + "")
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
getExtraText: () => {
|
|
156
|
-
const { stepperExtraText: o } = e;
|
|
157
|
-
return o && G(o) == "function" ? o() : "";
|
|
158
|
-
},
|
|
159
|
-
changeStepper: (o) => {
|
|
160
|
-
s.value = o, t("changeStepper", o);
|
|
170
|
+
setup(props, { emit }) {
|
|
171
|
+
const goodsCount = ref(props.stepperMin);
|
|
172
|
+
onMounted(() => {
|
|
173
|
+
goodsCount.value = props.stepperMin;
|
|
174
|
+
});
|
|
175
|
+
const getExtraText = () => {
|
|
176
|
+
const { stepperExtraText } = props;
|
|
177
|
+
if (stepperExtraText && TypeOfFun(stepperExtraText) == "function") {
|
|
178
|
+
return stepperExtraText();
|
|
179
|
+
} else {
|
|
180
|
+
return "";
|
|
161
181
|
}
|
|
162
182
|
};
|
|
183
|
+
const add = (value) => {
|
|
184
|
+
emit("add", value);
|
|
185
|
+
};
|
|
186
|
+
const reduce = (value) => {
|
|
187
|
+
emit("reduce", value);
|
|
188
|
+
};
|
|
189
|
+
const overlimit = (e, action) => {
|
|
190
|
+
emit("overLimit", {
|
|
191
|
+
action,
|
|
192
|
+
value: parseInt(goodsCount.value + "")
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
const changeStepper = (value) => {
|
|
196
|
+
goodsCount.value = value;
|
|
197
|
+
emit("changeStepper", value);
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
goodsCount,
|
|
201
|
+
add,
|
|
202
|
+
reduce,
|
|
203
|
+
overlimit,
|
|
204
|
+
getExtraText,
|
|
205
|
+
changeStepper
|
|
206
|
+
};
|
|
163
207
|
}
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
208
|
+
});
|
|
209
|
+
const _hoisted_1$2 = { class: "nut-sku-stepper" };
|
|
210
|
+
const _hoisted_2$2 = { class: "nut-sku-stepper-title" };
|
|
211
|
+
const _hoisted_3$1 = ["innerHTML"];
|
|
212
|
+
const _hoisted_4$1 = { class: "nut-sku-stepper-count" };
|
|
213
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
214
|
+
const _component_nut_input_number = resolveComponent("nut-input-number");
|
|
215
|
+
return openBlock(), createElementBlock("view", _hoisted_1$2, [
|
|
216
|
+
createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
|
|
217
|
+
createElementVNode("view", {
|
|
170
218
|
class: "nut-sku-stepper-limit",
|
|
171
|
-
innerHTML:
|
|
172
|
-
}, null, 8,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue":
|
|
177
|
-
min:
|
|
178
|
-
max:
|
|
179
|
-
onAdd:
|
|
180
|
-
onReduce:
|
|
181
|
-
onOverlimit:
|
|
182
|
-
onChange:
|
|
219
|
+
innerHTML: _ctx.getExtraText()
|
|
220
|
+
}, null, 8, _hoisted_3$1),
|
|
221
|
+
createElementVNode("view", _hoisted_4$1, [
|
|
222
|
+
createVNode(_component_nut_input_number, {
|
|
223
|
+
modelValue: _ctx.goodsCount,
|
|
224
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.goodsCount = $event),
|
|
225
|
+
min: _ctx.stepperMin,
|
|
226
|
+
max: _ctx.stepperMax,
|
|
227
|
+
onAdd: _ctx.add,
|
|
228
|
+
onReduce: _ctx.reduce,
|
|
229
|
+
onOverlimit: _ctx.overlimit,
|
|
230
|
+
onChange: _ctx.changeStepper
|
|
183
231
|
}, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
|
|
184
232
|
])
|
|
185
233
|
]);
|
|
186
234
|
}
|
|
187
|
-
const
|
|
235
|
+
const SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
236
|
+
const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
|
|
237
|
+
const _sfc_main$1 = create$1({
|
|
188
238
|
props: {
|
|
189
239
|
// 底部按钮配置 confirm cart buy
|
|
190
240
|
btnOptions: {
|
|
@@ -211,44 +261,58 @@ const $e = /* @__PURE__ */ y(de, [["render", he]]), { componentName: Je, create:
|
|
|
211
261
|
}
|
|
212
262
|
},
|
|
213
263
|
emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
|
|
214
|
-
setup(
|
|
264
|
+
setup(props, { emit, slots }) {
|
|
265
|
+
const getBtnDesc = (type) => {
|
|
266
|
+
let mapD = {
|
|
267
|
+
confirm: props.confirmText,
|
|
268
|
+
cart: props.addCartText,
|
|
269
|
+
buy: props.buyText
|
|
270
|
+
};
|
|
271
|
+
return mapD[type];
|
|
272
|
+
};
|
|
273
|
+
const getSlots = (name) => slots[name];
|
|
274
|
+
const clickBtnOperate = (btn) => {
|
|
275
|
+
emit("clickBtnOperate", btn);
|
|
276
|
+
};
|
|
215
277
|
return {
|
|
216
|
-
getBtnDesc
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
buy: e.buyText
|
|
220
|
-
})[n],
|
|
221
|
-
clickBtnOperate: (n) => {
|
|
222
|
-
t("clickBtnOperate", n);
|
|
223
|
-
},
|
|
224
|
-
getSlots: (n) => s[n]
|
|
278
|
+
getBtnDesc,
|
|
279
|
+
clickBtnOperate,
|
|
280
|
+
getSlots
|
|
225
281
|
};
|
|
226
282
|
}
|
|
227
|
-
})
|
|
283
|
+
});
|
|
284
|
+
const _hoisted_1$1 = {
|
|
228
285
|
key: 0,
|
|
229
286
|
class: "nut-sku-operate"
|
|
230
|
-
}
|
|
287
|
+
};
|
|
288
|
+
const _hoisted_2$1 = {
|
|
231
289
|
key: 0,
|
|
232
290
|
class: "nut-sku-operate-desc"
|
|
233
|
-
}
|
|
291
|
+
};
|
|
292
|
+
const _hoisted_3 = {
|
|
234
293
|
key: 1,
|
|
235
294
|
class: "nut-sku-operate-btn"
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
295
|
+
};
|
|
296
|
+
const _hoisted_4 = ["onClick"];
|
|
297
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
298
|
+
return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
|
|
299
|
+
_ctx.btnExtraText ? (openBlock(), createElementBlock("view", _hoisted_2$1, toDisplayString(_ctx.btnExtraText), 1)) : createCommentVNode("", true),
|
|
300
|
+
renderSlot(_ctx.$slots, "operate-btn"),
|
|
301
|
+
!_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
|
|
302
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
|
|
303
|
+
return openBlock(), createElementBlock("view", {
|
|
304
|
+
class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
|
|
305
|
+
key: i,
|
|
306
|
+
onClick: ($event) => _ctx.clickBtnOperate(btn)
|
|
307
|
+
}, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
|
|
308
|
+
}), 128))
|
|
309
|
+
])) : createCommentVNode("", true)
|
|
310
|
+
])) : createCommentVNode("", true);
|
|
249
311
|
}
|
|
250
|
-
const
|
|
251
|
-
|
|
312
|
+
const SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
313
|
+
const { componentName, create, translate } = createComponent("sku");
|
|
314
|
+
const _sfc_main = create({
|
|
315
|
+
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
252
316
|
sku: {
|
|
253
317
|
type: Array,
|
|
254
318
|
default: []
|
|
@@ -280,7 +344,7 @@ const we = /* @__PURE__ */ y(ve, [["render", Oe]]), { componentName: Ke, create:
|
|
|
280
344
|
// stepper 前面文案
|
|
281
345
|
stepperExtraText: {
|
|
282
346
|
type: [Function, Boolean],
|
|
283
|
-
default:
|
|
347
|
+
default: false
|
|
284
348
|
},
|
|
285
349
|
btnExtraText: {
|
|
286
350
|
type: String,
|
|
@@ -315,132 +379,161 @@ const we = /* @__PURE__ */ y(ve, [["render", Oe]]), { componentName: Ke, create:
|
|
|
315
379
|
"over-limit"
|
|
316
380
|
],
|
|
317
381
|
components: {
|
|
318
|
-
SkuHeader
|
|
319
|
-
SkuSelect
|
|
320
|
-
SkuStepper
|
|
321
|
-
SkuOperate
|
|
322
|
-
[
|
|
382
|
+
SkuHeader,
|
|
383
|
+
SkuSelect,
|
|
384
|
+
SkuStepper,
|
|
385
|
+
SkuOperate,
|
|
386
|
+
[Popup.name]: Popup
|
|
323
387
|
},
|
|
324
|
-
setup(
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
(
|
|
329
|
-
|
|
388
|
+
setup(props, { emit, slots }) {
|
|
389
|
+
const showPopup = ref(props.visible);
|
|
390
|
+
const goodsCount = ref(props.stepperMin);
|
|
391
|
+
watch(
|
|
392
|
+
() => props.visible,
|
|
393
|
+
(value) => {
|
|
394
|
+
showPopup.value = value;
|
|
330
395
|
}
|
|
331
|
-
)
|
|
332
|
-
|
|
333
|
-
(
|
|
334
|
-
|
|
396
|
+
);
|
|
397
|
+
watch(
|
|
398
|
+
() => showPopup.value,
|
|
399
|
+
(value) => {
|
|
400
|
+
if (value == false) {
|
|
401
|
+
close();
|
|
402
|
+
}
|
|
335
403
|
}
|
|
336
|
-
)
|
|
404
|
+
);
|
|
405
|
+
onMounted(() => {
|
|
337
406
|
});
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
407
|
+
const getSlots = (name) => slots[name];
|
|
408
|
+
const selectSku = (skus) => {
|
|
409
|
+
emit("select-sku", skus);
|
|
410
|
+
};
|
|
411
|
+
const changeStepper = (value) => {
|
|
412
|
+
goodsCount.value = value;
|
|
413
|
+
emit("change-stepper", value);
|
|
414
|
+
};
|
|
415
|
+
const add = (value) => {
|
|
416
|
+
emit("add", value);
|
|
417
|
+
};
|
|
418
|
+
const reduce = (value) => {
|
|
419
|
+
emit("reduce", value);
|
|
420
|
+
};
|
|
421
|
+
const stepperOverLimit = (count) => {
|
|
422
|
+
emit("over-limit", count);
|
|
423
|
+
};
|
|
424
|
+
const clickBtnOperate = (btn) => {
|
|
425
|
+
emit("click-btn-operate", {
|
|
426
|
+
type: btn,
|
|
427
|
+
value: goodsCount.value
|
|
352
428
|
});
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
429
|
+
};
|
|
430
|
+
const closePopup = (type) => {
|
|
431
|
+
if (type == "icon") {
|
|
432
|
+
emit("click-close-icon");
|
|
433
|
+
}
|
|
434
|
+
if (type == "overlay") {
|
|
435
|
+
emit("click-overlay");
|
|
436
|
+
}
|
|
437
|
+
if (type == "close") {
|
|
438
|
+
emit("close");
|
|
439
|
+
}
|
|
440
|
+
showPopup.value = false;
|
|
441
|
+
};
|
|
442
|
+
const close = () => {
|
|
443
|
+
emit("update:visible", false);
|
|
357
444
|
};
|
|
358
445
|
return {
|
|
359
|
-
showPopup
|
|
360
|
-
closePopup
|
|
361
|
-
selectSku
|
|
362
|
-
changeStepper
|
|
363
|
-
stepperOverLimit
|
|
364
|
-
clickBtnOperate
|
|
365
|
-
add
|
|
366
|
-
reduce
|
|
367
|
-
getSlots
|
|
368
|
-
translate
|
|
446
|
+
showPopup,
|
|
447
|
+
closePopup,
|
|
448
|
+
selectSku,
|
|
449
|
+
changeStepper,
|
|
450
|
+
stepperOverLimit,
|
|
451
|
+
clickBtnOperate,
|
|
452
|
+
add,
|
|
453
|
+
reduce,
|
|
454
|
+
getSlots,
|
|
455
|
+
translate
|
|
369
456
|
};
|
|
370
457
|
}
|
|
371
|
-
})
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
458
|
+
});
|
|
459
|
+
const _hoisted_1 = { class: "nut-sku" };
|
|
460
|
+
const _hoisted_2 = { class: "nut-sku-content" };
|
|
461
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
462
|
+
const _component_sku_header = resolveComponent("sku-header");
|
|
463
|
+
const _component_SkuSelect = resolveComponent("SkuSelect");
|
|
464
|
+
const _component_sku_stepper = resolveComponent("sku-stepper");
|
|
465
|
+
const _component_sku_operate = resolveComponent("sku-operate");
|
|
466
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
467
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
375
468
|
position: "bottom",
|
|
376
469
|
closeable: "",
|
|
377
470
|
round: "",
|
|
378
|
-
visible:
|
|
379
|
-
"onUpdate:visible":
|
|
380
|
-
onClickCloseIcon:
|
|
381
|
-
onClickOverlay:
|
|
382
|
-
onClose:
|
|
383
|
-
style: { height: "75%" },
|
|
384
|
-
teleportDisable:
|
|
385
|
-
teleport:
|
|
471
|
+
visible: _ctx.showPopup,
|
|
472
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
|
|
473
|
+
onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
|
|
474
|
+
onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
|
|
475
|
+
onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
|
|
476
|
+
style: { "height": "75%" },
|
|
477
|
+
teleportDisable: _ctx.teleportDisable,
|
|
478
|
+
teleport: _ctx.teleport
|
|
386
479
|
}, {
|
|
387
|
-
default:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
480
|
+
default: withCtx(() => [
|
|
481
|
+
createElementVNode("view", _hoisted_1, [
|
|
482
|
+
renderSlot(_ctx.$slots, "sku-header"),
|
|
483
|
+
!_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
|
|
391
484
|
key: 0,
|
|
392
|
-
goods:
|
|
393
|
-
},
|
|
394
|
-
|
|
485
|
+
goods: _ctx.goods
|
|
486
|
+
}, createSlots({ _: 2 }, [
|
|
487
|
+
_ctx.getSlots("sku-header-price") ? {
|
|
395
488
|
name: "sku-header-price",
|
|
396
|
-
fn:
|
|
397
|
-
|
|
489
|
+
fn: withCtx(() => [
|
|
490
|
+
renderSlot(_ctx.$slots, "sku-header-price")
|
|
398
491
|
]),
|
|
399
492
|
key: "0"
|
|
400
493
|
} : void 0,
|
|
401
|
-
|
|
494
|
+
_ctx.getSlots("sku-header-extra") ? {
|
|
402
495
|
name: "sku-header-extra",
|
|
403
|
-
fn:
|
|
404
|
-
|
|
496
|
+
fn: withCtx(() => [
|
|
497
|
+
renderSlot(_ctx.$slots, "sku-header-extra")
|
|
405
498
|
]),
|
|
406
499
|
key: "1"
|
|
407
500
|
} : void 0
|
|
408
|
-
]), 1032, ["goods"])),
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
501
|
+
]), 1032, ["goods"])) : createCommentVNode("", true),
|
|
502
|
+
createElementVNode("view", _hoisted_2, [
|
|
503
|
+
renderSlot(_ctx.$slots, "sku-select-top"),
|
|
504
|
+
renderSlot(_ctx.$slots, "sku-select"),
|
|
505
|
+
!_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
|
|
413
506
|
key: 0,
|
|
414
|
-
sku:
|
|
415
|
-
onSelectSku:
|
|
416
|
-
}, null, 8, ["sku", "onSelectSku"])),
|
|
417
|
-
|
|
418
|
-
|
|
507
|
+
sku: _ctx.sku,
|
|
508
|
+
onSelectSku: _ctx.selectSku
|
|
509
|
+
}, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
|
|
510
|
+
renderSlot(_ctx.$slots, "sku-stepper"),
|
|
511
|
+
!_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
|
|
419
512
|
key: 1,
|
|
420
|
-
goods:
|
|
421
|
-
stepperTitle:
|
|
422
|
-
stepperMax:
|
|
423
|
-
stepperMin:
|
|
424
|
-
stepperExtraText:
|
|
425
|
-
onAdd:
|
|
426
|
-
onReduce:
|
|
427
|
-
onChangeStepper:
|
|
428
|
-
onOverLimit:
|
|
429
|
-
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])),
|
|
430
|
-
|
|
513
|
+
goods: _ctx.goods,
|
|
514
|
+
stepperTitle: _ctx.stepperTitle || _ctx.translate("buyNumber"),
|
|
515
|
+
stepperMax: _ctx.stepperMax,
|
|
516
|
+
stepperMin: _ctx.stepperMin,
|
|
517
|
+
stepperExtraText: _ctx.stepperExtraText,
|
|
518
|
+
onAdd: _ctx.add,
|
|
519
|
+
onReduce: _ctx.reduce,
|
|
520
|
+
onChangeStepper: _ctx.changeStepper,
|
|
521
|
+
onOverLimit: _ctx.stepperOverLimit
|
|
522
|
+
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
|
|
523
|
+
renderSlot(_ctx.$slots, "sku-stepper-bottom")
|
|
431
524
|
]),
|
|
432
|
-
|
|
433
|
-
btnOptions:
|
|
434
|
-
btnExtraText:
|
|
435
|
-
buyText:
|
|
436
|
-
addCartText:
|
|
437
|
-
confirmText:
|
|
438
|
-
onClickBtnOperate:
|
|
439
|
-
},
|
|
440
|
-
|
|
525
|
+
createVNode(_component_sku_operate, {
|
|
526
|
+
btnOptions: _ctx.btnOptions,
|
|
527
|
+
btnExtraText: _ctx.btnExtraText,
|
|
528
|
+
buyText: _ctx.buyText || _ctx.translate("buyNow"),
|
|
529
|
+
addCartText: _ctx.addCartText || _ctx.translate("addToCart"),
|
|
530
|
+
confirmText: _ctx.confirmText || _ctx.translate("confirm"),
|
|
531
|
+
onClickBtnOperate: _ctx.clickBtnOperate
|
|
532
|
+
}, createSlots({ _: 2 }, [
|
|
533
|
+
_ctx.getSlots("sku-operate") ? {
|
|
441
534
|
name: "operate-btn",
|
|
442
|
-
fn:
|
|
443
|
-
|
|
535
|
+
fn: withCtx(() => [
|
|
536
|
+
renderSlot(_ctx.$slots, "sku-operate")
|
|
444
537
|
]),
|
|
445
538
|
key: "0"
|
|
446
539
|
} : void 0
|
|
@@ -450,7 +543,7 @@ function _e(e, t, s, u, p, d) {
|
|
|
450
543
|
_: 3
|
|
451
544
|
}, 8, ["visible", "teleportDisable", "teleport"]);
|
|
452
545
|
}
|
|
453
|
-
const
|
|
546
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
454
547
|
export {
|
|
455
|
-
|
|
548
|
+
index as default
|
|
456
549
|
};
|