@nutui/nutui 3.1.22-beta.5 → 3.1.23-beta.1
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/CHANGELOG.md +48 -0
- package/README.md +3 -4
- package/dist/nutui.es.js +20412 -4214
- package/dist/nutui.umd.js +20518 -4216
- package/dist/packages/_es/ActionSheet.js +149 -17
- package/dist/packages/_es/Address.js +535 -110
- package/dist/packages/_es/AddressList.js +615 -113
- package/dist/packages/_es/Animate.js +59 -17
- package/dist/packages/_es/Audio.js +257 -53
- package/dist/packages/_es/AudioOperate.js +100 -13
- package/dist/packages/_es/Avatar.js +162 -38
- package/dist/packages/_es/AvatarGroup.js +73 -14
- package/dist/packages/_es/BackTop.js +156 -43
- package/dist/packages/_es/Badge.js +86 -14
- package/dist/packages/_es/Barrage.js +120 -41
- package/dist/packages/_es/Button.js +128 -23
- package/dist/packages/_es/Calendar.js +246 -30
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +107 -10
- package/dist/packages/_es/Cascader.js +496 -147
- package/dist/packages/_es/Category.js +58 -15
- package/dist/packages/_es/CategoryPane.js +111 -11
- package/dist/packages/_es/Cell.js +108 -21
- package/dist/packages/_es/CellGroup.js +44 -9
- package/dist/packages/_es/Checkbox.js +134 -29
- package/dist/packages/_es/CheckboxGroup.js +79 -29
- package/dist/packages/_es/CircleProgress.js +150 -28
- package/dist/packages/_es/Col.js +56 -14
- package/dist/packages/_es/Collapse.js +109 -32
- package/dist/packages/_es/CollapseItem.js +253 -59
- package/dist/packages/_es/Comment.js +434 -64
- package/dist/packages/_es/ConfigProvider.js +20 -8
- package/dist/packages/_es/CountDown.js +238 -56
- package/dist/packages/_es/CountUp.js +539 -140
- package/dist/packages/_es/DatePicker.js +315 -98
- package/dist/packages/_es/Dialog.js +289 -60
- package/dist/packages/_es/Divider.js +65 -13
- package/dist/packages/_es/Drag.js +197 -56
- package/dist/packages/_es/Ecard.js +159 -24
- package/dist/packages/_es/Elevator.js +255 -58
- package/dist/packages/_es/Ellipsis.js +200 -58
- package/dist/packages/_es/Empty.js +71 -12
- package/dist/packages/_es/FixedNav.js +122 -15
- package/dist/packages/_es/Form.js +151 -64
- package/dist/packages/_es/FormItem.js +114 -15
- package/dist/packages/_es/Grid.js +6 -5
- package/dist/packages/_es/GridItem.js +144 -33
- package/dist/packages/_es/Icon.js +40 -15
- package/dist/packages/_es/Image.js +137 -26
- package/dist/packages/_es/ImagePreview.js +547 -76
- package/dist/packages/_es/Indicator.js +62 -15
- package/dist/packages/_es/InfiniteLoading.js +249 -57
- package/dist/packages/_es/Input.js +433 -51
- package/dist/packages/_es/InputNumber.js +160 -41
- package/dist/packages/_es/Layout.js +5 -4
- package/dist/packages/_es/List.js +106 -18
- package/dist/packages/_es/Menu.js +168 -44
- package/dist/packages/_es/MenuItem.js +173 -37
- package/dist/packages/_es/Navbar.js +192 -30
- package/dist/packages/_es/NoticeBar.js +380 -74
- package/dist/packages/_es/Notify.js +227 -72
- package/dist/packages/_es/NumberKeyboard.js +272 -41
- package/dist/packages/_es/OldPicker.js +457 -130
- package/dist/packages/_es/OverLay.js +98 -24
- package/dist/packages/_es/Pagination.js +157 -39
- package/dist/packages/_es/Picker.js +454 -129
- package/dist/packages/_es/Popover.js +957 -318
- package/dist/packages/_es/Popup.js +299 -55
- package/dist/packages/_es/Price.js +118 -16
- package/dist/packages/_es/Progress.js +146 -14
- package/dist/packages/_es/PullRefresh.js +339 -84
- package/dist/packages/_es/Radio.js +90 -22
- package/dist/packages/_es/RadioGroup.js +37 -8
- package/dist/packages/_es/Range.js +408 -83
- package/dist/packages/_es/Rate.js +192 -36
- package/dist/packages/_es/Row.js +64 -22
- package/dist/packages/_es/SearchBar.js +238 -37
- package/dist/packages/_es/ShortPassword.js +225 -35
- package/dist/packages/_es/SideNavBar.js +81 -24
- package/dist/packages/_es/SideNavBarItem.js +46 -11
- package/dist/packages/_es/Signature.js +160 -41
- package/dist/packages/_es/Skeleton.js +136 -20
- package/dist/packages/_es/Sku.js +491 -84
- package/dist/packages/_es/Step.js +115 -20
- package/dist/packages/_es/Steps.js +53 -18
- package/dist/packages/_es/Sticky.js +138 -53
- package/dist/packages/_es/SubSideNavBar.js +82 -17
- package/dist/packages/_es/Swipe.js +178 -41
- package/dist/packages/_es/Swiper.js +433 -121
- package/dist/packages/_es/SwiperItem.js +53 -22
- package/dist/packages/_es/Switch.js +116 -21
- package/dist/packages/_es/TabPane.js +39 -12
- package/dist/packages/_es/Tabbar.js +72 -17
- package/dist/packages/_es/TabbarItem.js +151 -29
- package/dist/packages/_es/Table.js +178 -18
- package/dist/packages/_es/Tabs.js +202 -43
- package/dist/packages/_es/Tag.js +97 -20
- package/dist/packages/_es/TextArea.js +160 -42
- package/dist/packages/_es/TimeDetail.js +79 -18
- package/dist/packages/_es/TimePannel.js +48 -14
- package/dist/packages/_es/TimeSelect.js +112 -15
- package/dist/packages/_es/Toast.js +310 -71
- package/dist/packages/_es/Uploader.js +455 -104
- package/dist/packages/_es/Video.js +332 -74
- package/dist/packages/_es/common.js +128 -38
- package/dist/packages/_es/component.js +76 -35
- package/dist/packages/_es/index.js +6 -5
- package/dist/packages/_es/index2.js +30 -9
- package/dist/packages/_es/index3.js +8 -6
- package/dist/packages/_es/index4.js +64 -13
- package/dist/packages/_es/index5.js +780 -164
- package/dist/packages/_es/plugin-vue_export-helper.js +8 -7
- package/dist/packages/_es/pxCheck.js +5 -3
- package/dist/packages/_es/raf.js +15 -8
- package/dist/packages/imagepreview/index.scss +6 -1
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.js +105 -5
- package/dist/packages/locale/lang/id-ID.js +105 -5
- package/dist/packages/locale/lang/index.js +38 -16
- package/dist/packages/locale/lang/zh-CN.js +105 -5
- package/dist/packages/locale/lang/zh-TW.js +105 -5
- package/dist/packages/picker/index.scss +13 -0
- package/dist/smartips/attributes.json +8 -0
- package/dist/smartips/tags.json +3 -1
- package/dist/smartips/web-types.json +19 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +4 -1
- package/dist/styles/variables-jdt.scss +4 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +3 -3
- package/dist/types/__VUE/address/index.vue.d.ts +4 -4
- package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cascader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/cell/index.vue.d.ts +2 -2
- package/dist/types/__VUE/checkbox/index.vue.d.ts +2 -2
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +2 -2
- package/dist/types/__VUE/ecard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/fixednav/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +3 -3
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +23 -25
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/menu/index.vue.d.ts +4 -4
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +2 -2
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +3 -3
- package/dist/types/__VUE/popover/index.vue.d.ts +6 -6
- package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +1 -1
- package/dist/types/__VUE/sku/index.vue.d.ts +3 -3
- package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -2
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,92 +1,499 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.1 Mon Jun 27 2022 21:39:05 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { resolveComponent
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { popupProps
|
|
6
|
+
import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
|
|
7
|
+
import { c as createComponent, T as TypeOfFun } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
import { popupProps } from "./Popup.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
11
|
import "./OverLay.js";
|
|
12
12
|
import "./Icon.js";
|
|
13
13
|
import "./pxCheck.js";
|
|
14
|
-
const { componentName:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
14
|
+
const { componentName: componentName$4, create: create$4, translate: translate$1 } = createComponent("sku-header");
|
|
15
|
+
const _sfc_main$4 = create$4({
|
|
16
|
+
props: {
|
|
17
|
+
goods: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: {}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
emits: [],
|
|
23
|
+
setup(props, { emit, slots }) {
|
|
24
|
+
const getSlots = (name) => slots[name];
|
|
25
|
+
return {
|
|
26
|
+
getSlots,
|
|
27
|
+
translate: translate$1
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _hoisted_1$4 = { class: "nut-sku-header" };
|
|
32
|
+
const _hoisted_2$4 = ["src"];
|
|
33
|
+
const _hoisted_3$3 = { class: "nut-sku-header-right" };
|
|
34
|
+
const _hoisted_4$3 = {
|
|
35
|
+
key: 3,
|
|
36
|
+
class: "nut-sku-header-right-extra"
|
|
37
|
+
};
|
|
38
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
39
|
+
const _component_nut_price = resolveComponent("nut-price");
|
|
40
|
+
return openBlock(), createElementBlock("view", _hoisted_1$4, [
|
|
41
|
+
createElementVNode("img", {
|
|
42
|
+
src: _ctx.goods.imagePath
|
|
43
|
+
}, null, 8, _hoisted_2$4),
|
|
44
|
+
createElementVNode("view", _hoisted_3$3, [
|
|
45
|
+
_ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
|
|
46
|
+
key: 1,
|
|
47
|
+
price: _ctx.goods.price,
|
|
48
|
+
needSymbol: true,
|
|
49
|
+
thousands: false
|
|
50
|
+
}, null, 8, ["price"])),
|
|
51
|
+
_ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
|
|
52
|
+
_ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, toDisplayString(_ctx.translate("skuId")) + "\xA0:\xA0" + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
|
|
53
|
+
])
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
var SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
57
|
+
const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
|
|
58
|
+
const _sfc_main$3 = create$3({
|
|
59
|
+
props: {
|
|
60
|
+
sku: {
|
|
61
|
+
type: Array,
|
|
62
|
+
default: () => []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
emits: ["selectSku"],
|
|
66
|
+
setup(props, { emit }) {
|
|
67
|
+
const skuInfo = ref([]);
|
|
68
|
+
watch(() => props.sku, (value) => {
|
|
69
|
+
skuInfo.value = [].slice.call(value);
|
|
70
|
+
}, { deep: true });
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
if (props.sku.length > 0) {
|
|
73
|
+
skuInfo.value = [].slice.call(props.sku);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
|
|
77
|
+
if (attrItem.checkFlag || attrItem.disable) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
emit("selectSku", {
|
|
81
|
+
sku: attrItem,
|
|
82
|
+
skuIndex: index2,
|
|
83
|
+
parentSku: parentItem,
|
|
84
|
+
parentIndex
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
skuInfo,
|
|
89
|
+
changeSaleChild
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const _hoisted_1$3 = { class: "nut-sku-select" };
|
|
94
|
+
const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
|
|
95
|
+
const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
|
|
96
|
+
const _hoisted_4$2 = ["onClick"];
|
|
97
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
98
|
+
return openBlock(), createElementBlock("view", _hoisted_1$3, [
|
|
99
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
|
|
100
|
+
return openBlock(), createElementBlock("view", {
|
|
101
|
+
class: "nut-sku-select-item",
|
|
102
|
+
key: item.id
|
|
103
|
+
}, [
|
|
104
|
+
createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
|
|
105
|
+
createElementVNode("view", _hoisted_3$2, [
|
|
106
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
|
|
107
|
+
return openBlock(), createElementBlock("view", {
|
|
108
|
+
class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
|
|
109
|
+
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
|
|
110
|
+
key: itemAttr.name
|
|
111
|
+
}, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
|
|
112
|
+
}), 128))
|
|
113
|
+
])
|
|
114
|
+
]);
|
|
115
|
+
}), 128))
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
var SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
119
|
+
const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
|
|
120
|
+
const _sfc_main$2 = create$2({
|
|
121
|
+
props: {
|
|
122
|
+
stepperMax: {
|
|
123
|
+
type: [Number, String],
|
|
124
|
+
default: 99999
|
|
125
|
+
},
|
|
126
|
+
stepperMin: {
|
|
127
|
+
type: [Number, String],
|
|
128
|
+
default: 1
|
|
129
|
+
},
|
|
130
|
+
stepperExtraText: {
|
|
131
|
+
type: [Function, Boolean],
|
|
132
|
+
default: false
|
|
133
|
+
},
|
|
134
|
+
stepperTitle: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: "\u8D2D\u4E70\u6570\u91CF"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
|
|
140
|
+
setup(props, { emit }) {
|
|
141
|
+
const goodsCount = ref(props.stepperMin);
|
|
142
|
+
onMounted(() => {
|
|
143
|
+
goodsCount.value = props.stepperMin;
|
|
144
|
+
});
|
|
145
|
+
const getExtraText = () => {
|
|
146
|
+
const { stepperExtraText } = props;
|
|
147
|
+
if (stepperExtraText && TypeOfFun(stepperExtraText) == "function") {
|
|
148
|
+
return stepperExtraText();
|
|
149
|
+
} else {
|
|
150
|
+
return "";
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const add = (value) => {
|
|
154
|
+
emit("add", value);
|
|
155
|
+
};
|
|
156
|
+
const reduce = (value) => {
|
|
157
|
+
emit("reduce", value);
|
|
158
|
+
};
|
|
159
|
+
const overlimit = (e, action) => {
|
|
160
|
+
emit("overLimit", {
|
|
161
|
+
action,
|
|
162
|
+
value: parseInt(goodsCount.value + "")
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
const changeStepper = (value) => {
|
|
166
|
+
goodsCount.value = value;
|
|
167
|
+
emit("changeStepper", value);
|
|
168
|
+
};
|
|
169
|
+
return {
|
|
170
|
+
goodsCount,
|
|
171
|
+
add,
|
|
172
|
+
reduce,
|
|
173
|
+
overlimit,
|
|
174
|
+
getExtraText,
|
|
175
|
+
changeStepper
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
const _hoisted_1$2 = { class: "nut-sku-stepper" };
|
|
180
|
+
const _hoisted_2$2 = { class: "nut-sku-stepper-title" };
|
|
181
|
+
const _hoisted_3$1 = ["innerHTML"];
|
|
182
|
+
const _hoisted_4$1 = { class: "nut-sku-stepper-count" };
|
|
183
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
184
|
+
const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
|
|
185
|
+
return openBlock(), createElementBlock("view", _hoisted_1$2, [
|
|
186
|
+
createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
|
|
187
|
+
createElementVNode("view", {
|
|
188
|
+
class: "nut-sku-stepper-limit",
|
|
189
|
+
innerHTML: _ctx.getExtraText()
|
|
190
|
+
}, null, 8, _hoisted_3$1),
|
|
191
|
+
createElementVNode("view", _hoisted_4$1, [
|
|
192
|
+
createVNode(_component_nut_inputnumber, {
|
|
193
|
+
modelValue: _ctx.goodsCount,
|
|
194
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.goodsCount = $event),
|
|
195
|
+
min: _ctx.stepperMin,
|
|
196
|
+
max: _ctx.stepperMax,
|
|
197
|
+
onAdd: _ctx.add,
|
|
198
|
+
onReduce: _ctx.reduce,
|
|
199
|
+
onOverlimit: _ctx.overlimit,
|
|
200
|
+
onChange: _ctx.changeStepper
|
|
201
|
+
}, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
|
|
202
|
+
])
|
|
203
|
+
]);
|
|
204
|
+
}
|
|
205
|
+
var SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
206
|
+
const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
|
|
207
|
+
const _sfc_main$1 = create$1({
|
|
208
|
+
props: {
|
|
209
|
+
btnOptions: {
|
|
210
|
+
type: Array,
|
|
211
|
+
default: () => ["confirm"]
|
|
212
|
+
},
|
|
213
|
+
btnExtraText: {
|
|
214
|
+
type: String,
|
|
215
|
+
default: ""
|
|
216
|
+
},
|
|
217
|
+
buyText: {
|
|
218
|
+
type: String,
|
|
219
|
+
default: "\u7ACB\u5373\u8D2D\u4E70"
|
|
220
|
+
},
|
|
221
|
+
addCartText: {
|
|
222
|
+
type: String,
|
|
223
|
+
default: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
224
|
+
},
|
|
225
|
+
confirmText: {
|
|
226
|
+
type: String,
|
|
227
|
+
default: "\u786E\u5B9A"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
|
|
231
|
+
setup(props, { emit, slots }) {
|
|
232
|
+
const getBtnDesc = (type) => {
|
|
233
|
+
let mapD = {
|
|
234
|
+
confirm: props.confirmText,
|
|
235
|
+
cart: props.addCartText,
|
|
236
|
+
buy: props.buyText
|
|
237
|
+
};
|
|
238
|
+
return mapD[type];
|
|
239
|
+
};
|
|
240
|
+
const getSlots = (name) => slots[name];
|
|
241
|
+
const clickBtnOperate = (btn) => {
|
|
242
|
+
emit("clickBtnOperate", btn);
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
getBtnDesc,
|
|
246
|
+
clickBtnOperate,
|
|
247
|
+
getSlots
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const _hoisted_1$1 = {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: "nut-sku-operate"
|
|
254
|
+
};
|
|
255
|
+
const _hoisted_2$1 = ["innerHTML"];
|
|
256
|
+
const _hoisted_3 = {
|
|
257
|
+
key: 1,
|
|
258
|
+
class: "nut-sku-operate-btn"
|
|
259
|
+
};
|
|
260
|
+
const _hoisted_4 = ["onClick"];
|
|
261
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
262
|
+
return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
|
|
263
|
+
_ctx.btnExtraText ? (openBlock(), createElementBlock("view", {
|
|
264
|
+
key: 0,
|
|
265
|
+
class: "nut-sku-operate-desc",
|
|
266
|
+
innerHTML: _ctx.btnExtraText
|
|
267
|
+
}, null, 8, _hoisted_2$1)) : createCommentVNode("", true),
|
|
268
|
+
renderSlot(_ctx.$slots, "operate-btn"),
|
|
269
|
+
!_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
|
|
270
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
|
|
271
|
+
return openBlock(), createElementBlock("view", {
|
|
272
|
+
class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
|
|
273
|
+
key: i,
|
|
274
|
+
onClick: ($event) => _ctx.clickBtnOperate(btn)
|
|
275
|
+
}, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
|
|
276
|
+
}), 128))
|
|
277
|
+
])) : createCommentVNode("", true)
|
|
278
|
+
])) : createCommentVNode("", true);
|
|
279
|
+
}
|
|
280
|
+
var SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
281
|
+
const { componentName, create, translate } = createComponent("sku");
|
|
282
|
+
const _sfc_main = create({
|
|
283
|
+
props: {
|
|
284
|
+
...popupProps,
|
|
285
|
+
sku: {
|
|
286
|
+
type: Array,
|
|
287
|
+
default: []
|
|
288
|
+
},
|
|
289
|
+
goods: {
|
|
290
|
+
type: Object,
|
|
291
|
+
default: {}
|
|
292
|
+
},
|
|
293
|
+
stepperMax: {
|
|
294
|
+
type: [Number, String],
|
|
295
|
+
default: 99999
|
|
296
|
+
},
|
|
297
|
+
stepperMin: {
|
|
298
|
+
type: [Number, String],
|
|
299
|
+
default: 1
|
|
300
|
+
},
|
|
301
|
+
btnOptions: {
|
|
302
|
+
type: Array,
|
|
303
|
+
default: () => ["confirm"]
|
|
304
|
+
},
|
|
305
|
+
stepperTitle: {
|
|
306
|
+
type: String,
|
|
307
|
+
default: ""
|
|
308
|
+
},
|
|
309
|
+
stepperExtraText: {
|
|
310
|
+
type: [Function, Boolean],
|
|
311
|
+
default: false
|
|
312
|
+
},
|
|
313
|
+
btnExtraText: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: ""
|
|
316
|
+
},
|
|
317
|
+
buyText: {
|
|
318
|
+
type: String,
|
|
319
|
+
default: ""
|
|
320
|
+
},
|
|
321
|
+
addCartText: {
|
|
322
|
+
type: String,
|
|
323
|
+
default: ""
|
|
324
|
+
},
|
|
325
|
+
confirmText: {
|
|
326
|
+
type: String,
|
|
327
|
+
default: ""
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
emits: [
|
|
331
|
+
"update:visible",
|
|
332
|
+
"selectSku",
|
|
333
|
+
"changeStepper",
|
|
334
|
+
"clickBtnOperate",
|
|
335
|
+
"clickCloseIcon",
|
|
336
|
+
"clickOverlay",
|
|
337
|
+
"close",
|
|
338
|
+
"reduce",
|
|
339
|
+
"add",
|
|
340
|
+
"overLimit",
|
|
341
|
+
"clickOverlay"
|
|
342
|
+
],
|
|
343
|
+
components: {
|
|
344
|
+
SkuHeader,
|
|
345
|
+
SkuSelect,
|
|
346
|
+
SkuStepper,
|
|
347
|
+
SkuOperate
|
|
348
|
+
},
|
|
349
|
+
setup(props, { emit, slots }) {
|
|
350
|
+
const showPopup = ref(props.visible);
|
|
351
|
+
const goodsCount = ref(props.stepperMin);
|
|
352
|
+
watch(() => props.visible, (value) => {
|
|
353
|
+
showPopup.value = value;
|
|
354
|
+
});
|
|
355
|
+
watch(() => showPopup.value, (value) => {
|
|
356
|
+
if (value == false) {
|
|
357
|
+
close();
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
onMounted(() => {
|
|
361
|
+
});
|
|
362
|
+
const getSlots = (name) => slots[name];
|
|
363
|
+
const selectSku = (skus) => {
|
|
364
|
+
emit("selectSku", skus);
|
|
365
|
+
};
|
|
366
|
+
const changeStepper = (value) => {
|
|
367
|
+
goodsCount.value = value;
|
|
368
|
+
emit("changeStepper", value);
|
|
369
|
+
};
|
|
370
|
+
const add = (value) => {
|
|
371
|
+
emit("add", value);
|
|
372
|
+
};
|
|
373
|
+
const reduce = (value) => {
|
|
374
|
+
emit("reduce", value);
|
|
375
|
+
};
|
|
376
|
+
const stepperOverLimit = (count) => {
|
|
377
|
+
emit("overLimit", count);
|
|
378
|
+
};
|
|
379
|
+
const clickBtnOperate = (btn) => {
|
|
380
|
+
emit("clickBtnOperate", {
|
|
381
|
+
type: btn,
|
|
382
|
+
value: goodsCount.value
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
const closePopup = (type) => {
|
|
386
|
+
if (type == "icon") {
|
|
387
|
+
emit("click-close-icon");
|
|
388
|
+
}
|
|
389
|
+
if (type == "overlay") {
|
|
390
|
+
emit("click-overlay");
|
|
391
|
+
}
|
|
392
|
+
if (type == "close") {
|
|
393
|
+
emit("close");
|
|
394
|
+
}
|
|
395
|
+
showPopup.value = false;
|
|
396
|
+
};
|
|
397
|
+
const close = () => {
|
|
398
|
+
emit("update:visible", false);
|
|
399
|
+
};
|
|
400
|
+
return {
|
|
401
|
+
showPopup,
|
|
402
|
+
closePopup,
|
|
403
|
+
selectSku,
|
|
404
|
+
changeStepper,
|
|
405
|
+
stepperOverLimit,
|
|
406
|
+
clickBtnOperate,
|
|
407
|
+
add,
|
|
408
|
+
reduce,
|
|
409
|
+
getSlots,
|
|
410
|
+
translate
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
const _hoisted_1 = { class: "nut-sku" };
|
|
415
|
+
const _hoisted_2 = { class: "nut-sku-content" };
|
|
416
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
417
|
+
const _component_sku_header = resolveComponent("sku-header");
|
|
418
|
+
const _component_SkuSelect = resolveComponent("SkuSelect");
|
|
419
|
+
const _component_sku_stepper = resolveComponent("sku-stepper");
|
|
420
|
+
const _component_sku_operate = resolveComponent("sku-operate");
|
|
421
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
422
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
423
|
+
position: "bottom",
|
|
424
|
+
closeable: "",
|
|
425
|
+
round: "",
|
|
426
|
+
visible: _ctx.showPopup,
|
|
427
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
|
|
428
|
+
onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
|
|
429
|
+
onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
|
|
430
|
+
onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
|
|
431
|
+
style: { "height": "75%" },
|
|
432
|
+
isWrapTeleport: _ctx.isWrapTeleport,
|
|
433
|
+
teleport: _ctx.teleport
|
|
434
|
+
}, {
|
|
435
|
+
default: withCtx(() => [
|
|
436
|
+
createElementVNode("view", _hoisted_1, [
|
|
437
|
+
renderSlot(_ctx.$slots, "sku-header"),
|
|
438
|
+
!_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
|
|
439
|
+
key: 0,
|
|
440
|
+
goods: _ctx.goods
|
|
441
|
+
}, createSlots({ _: 2 }, [
|
|
442
|
+
_ctx.getSlots("sku-header-price") ? {
|
|
443
|
+
name: "sku-header-price",
|
|
444
|
+
fn: withCtx(() => [
|
|
445
|
+
renderSlot(_ctx.$slots, "sku-header-price")
|
|
446
|
+
])
|
|
447
|
+
} : void 0,
|
|
448
|
+
_ctx.getSlots("sku-header-extra") ? {
|
|
449
|
+
name: "sku-header-extra",
|
|
450
|
+
fn: withCtx(() => [
|
|
451
|
+
renderSlot(_ctx.$slots, "sku-header-extra")
|
|
452
|
+
])
|
|
453
|
+
} : void 0
|
|
454
|
+
]), 1032, ["goods"])) : createCommentVNode("", true),
|
|
455
|
+
createElementVNode("view", _hoisted_2, [
|
|
456
|
+
renderSlot(_ctx.$slots, "sku-select-top"),
|
|
457
|
+
renderSlot(_ctx.$slots, "sku-select"),
|
|
458
|
+
!_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
|
|
459
|
+
key: 0,
|
|
460
|
+
sku: _ctx.sku,
|
|
461
|
+
onSelectSku: _ctx.selectSku
|
|
462
|
+
}, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
|
|
463
|
+
renderSlot(_ctx.$slots, "sku-stepper"),
|
|
464
|
+
!_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
|
|
465
|
+
key: 1,
|
|
466
|
+
goods: _ctx.goods,
|
|
467
|
+
stepperTitle: _ctx.stepperTitle || _ctx.translate("buyNumber"),
|
|
468
|
+
stepperMax: _ctx.stepperMax,
|
|
469
|
+
stepperMin: _ctx.stepperMin,
|
|
470
|
+
stepperExtraText: _ctx.stepperExtraText,
|
|
471
|
+
onAdd: _ctx.add,
|
|
472
|
+
onReduce: _ctx.reduce,
|
|
473
|
+
onChangeStepper: _ctx.changeStepper,
|
|
474
|
+
onOverLimit: _ctx.stepperOverLimit
|
|
475
|
+
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
|
|
476
|
+
renderSlot(_ctx.$slots, "sku-stepper-bottom")
|
|
477
|
+
]),
|
|
478
|
+
createVNode(_component_sku_operate, {
|
|
479
|
+
btnOptions: _ctx.btnOptions,
|
|
480
|
+
btnExtraText: _ctx.btnExtraText,
|
|
481
|
+
buyText: _ctx.buyText || _ctx.translate("buyNow"),
|
|
482
|
+
addCartText: _ctx.addCartText || _ctx.translate("addToCart"),
|
|
483
|
+
confirmText: _ctx.confirmText || _ctx.translate("confirm"),
|
|
484
|
+
onClickBtnOperate: _ctx.clickBtnOperate
|
|
485
|
+
}, createSlots({ _: 2 }, [
|
|
486
|
+
_ctx.getSlots("sku-operate") ? {
|
|
487
|
+
name: "operate-btn",
|
|
488
|
+
fn: withCtx(() => [
|
|
489
|
+
renderSlot(_ctx.$slots, "sku-operate")
|
|
490
|
+
])
|
|
491
|
+
} : void 0
|
|
492
|
+
]), 1032, ["btnOptions", "btnExtraText", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])
|
|
493
|
+
])
|
|
494
|
+
]),
|
|
495
|
+
_: 3
|
|
496
|
+
}, 8, ["visible", "isWrapTeleport", "teleport"]);
|
|
497
|
+
}
|
|
498
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
499
|
+
export { index as default };
|