@nutui/nutui 3.1.10-beta.1 → 3.1.11-beta.0
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 +26 -0
- package/README.md +2 -2
- package/dist/nutui.d.ts +6 -6
- package/dist/nutui.es.js +1643 -1116
- package/dist/nutui.umd.js +1708 -1181
- package/dist/packages/_es/ActionSheet.js +10 -12
- package/dist/packages/_es/Address.js +31 -33
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +5 -4
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +9 -8
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +14 -16
- package/dist/packages/_es/Cell.js +5 -4
- package/dist/packages/_es/CellGroup.js +8 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +5 -4
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +8 -7
- package/dist/packages/_es/CollapseItem.js +6 -8
- package/dist/packages/_es/CountDown.js +5 -7
- package/dist/packages/_es/CountUp.js +26 -28
- package/dist/packages/_es/DatePicker.js +11 -13
- package/dist/packages/_es/Dialog.js +14 -25
- package/dist/packages/_es/Divider.js +5 -4
- package/dist/packages/_es/Drag.js +5 -4
- package/dist/packages/_es/Elevator.js +19 -21
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +12 -13
- package/dist/packages/_es/InfiniteLoading.js +5 -7
- package/dist/packages/_es/Input.js +10 -9
- package/dist/packages/_es/InputNumber.js +8 -15
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +203 -0
- package/dist/packages/_es/MenuItem.js +18 -171
- package/dist/packages/_es/Navbar.js +7 -6
- package/dist/packages/_es/NoticeBar.js +9 -11
- package/dist/packages/_es/Notify.js +10 -12
- package/dist/packages/_es/NumberKeyboard.js +5 -4
- package/dist/packages/_es/OverLay.js +5 -7
- package/dist/packages/_es/Pagination.js +7 -6
- package/dist/packages/_es/Picker.js +12 -14
- package/dist/packages/_es/Popover.js +10 -12
- package/dist/packages/_es/Popup.js +9 -11
- package/dist/packages/_es/Price.js +33 -14
- package/dist/packages/_es/Progress.js +5 -4
- package/dist/packages/_es/Radio.js +20 -7
- package/dist/packages/_es/RadioGroup.js +7 -3
- package/dist/packages/_es/Range.js +13 -15
- package/dist/packages/_es/Rate.js +8 -7
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +56 -55
- package/dist/packages/_es/ShortPassword.js +8 -7
- package/dist/packages/_es/Signature.js +5 -4
- package/dist/packages/_es/Sku.js +533 -0
- package/dist/packages/_es/Step.js +14 -11
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +5 -7
- package/dist/packages/_es/Swiper.js +12 -11
- package/dist/packages/_es/SwiperItem.js +5 -4
- package/dist/packages/_es/Switch.js +5 -4
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Tabs.js +43 -18
- package/dist/packages/_es/Tag.js +16 -18
- package/dist/packages/_es/TextArea.js +6 -5
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +5 -4
- package/dist/packages/_es/Toast.js +10 -12
- package/dist/packages/_es/Uploader.js +165 -89
- package/dist/packages/_es/Video.js +5 -7
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/plugin-vue_export-helper.js +12 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +160 -0
- package/dist/packages/button/index.scss +3 -0
- package/dist/packages/checkbox/index.scss +2 -0
- package/dist/packages/dialog/index.scss +2 -1
- package/dist/packages/menu/index.scss +70 -4
- package/dist/packages/price/index.scss +40 -3
- package/dist/packages/progress/index.scss +2 -0
- package/dist/packages/radio/index.scss +34 -4
- package/dist/packages/radiogroup/index.scss +20 -0
- package/dist/packages/searchbar/index.scss +35 -30
- package/dist/packages/sku/index.scss +147 -0
- package/dist/packages/tabs/index.scss +47 -19
- package/dist/packages/tag/index.scss +2 -1
- package/dist/packages/uploader/index.scss +94 -8
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/mixins/index.scss +0 -4
- package/dist/styles/themes/default.scss +29 -30
- package/dist/styles/variables.scss +46 -6
- package/package.json +1 -1
- package/dist/packages/_es/Tab.js +0 -178
- package/dist/packages/_es/TabPanel.js +0 -29
- package/dist/packages/_es/index.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/tab/index.scss +0 -182
- package/dist/packages/tabpanel/index.scss +0 -2
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.11-beta.0 Sat Nov 13 2021 21:43:55 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
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 } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const { componentName: componentName$4, create: create$4 } = createComponent("sku-header");
|
|
10
|
+
const _sfc_main$4 = create$4({
|
|
11
|
+
props: {
|
|
12
|
+
goods: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: {}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: [],
|
|
18
|
+
setup(props, { emit, slots }) {
|
|
19
|
+
const getSlots = (name) => slots[name];
|
|
20
|
+
return {
|
|
21
|
+
getSlots
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _hoisted_1$4 = { class: "nut-sku-header" };
|
|
26
|
+
const _hoisted_2$4 = ["src"];
|
|
27
|
+
const _hoisted_3$3 = { class: "nut-sku-header-right" };
|
|
28
|
+
const _hoisted_4$3 = {
|
|
29
|
+
key: 3,
|
|
30
|
+
class: "nut-sku-header-right-extra"
|
|
31
|
+
};
|
|
32
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33
|
+
const _component_nut_price = resolveComponent("nut-price");
|
|
34
|
+
return openBlock(), createElementBlock("view", _hoisted_1$4, [
|
|
35
|
+
createElementVNode("img", {
|
|
36
|
+
src: _ctx.goods.imagePath
|
|
37
|
+
}, null, 8, _hoisted_2$4),
|
|
38
|
+
createElementVNode("view", _hoisted_3$3, [
|
|
39
|
+
_ctx.getSlots("sku-header-price") ? renderSlot(_ctx.$slots, "sku-header-price", { key: 0 }) : (openBlock(), createBlock(_component_nut_price, {
|
|
40
|
+
key: 1,
|
|
41
|
+
price: _ctx.goods.price,
|
|
42
|
+
needSymbol: true,
|
|
43
|
+
thousands: false
|
|
44
|
+
}, null, 8, ["price"])),
|
|
45
|
+
_ctx.getSlots("sku-header-extra") ? renderSlot(_ctx.$slots, "sku-header-extra", { key: 2 }) : createCommentVNode("", true),
|
|
46
|
+
_ctx.goods.skuId && !_ctx.getSlots("sku-header-extra") ? (openBlock(), createElementBlock("view", _hoisted_4$3, "\u5546\u54C1\u7F16\u53F7\uFF1A" + toDisplayString(_ctx.goods.skuId), 1)) : createCommentVNode("", true)
|
|
47
|
+
])
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
var SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
51
|
+
const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
|
|
52
|
+
const _sfc_main$3 = create$3({
|
|
53
|
+
props: {
|
|
54
|
+
sku: {
|
|
55
|
+
type: Array,
|
|
56
|
+
default: () => []
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
emits: ["selectSku"],
|
|
60
|
+
setup(props, { emit }) {
|
|
61
|
+
const skuInfo = ref([]);
|
|
62
|
+
watch(() => props.sku, (value) => {
|
|
63
|
+
skuInfo.value = [].slice.call(value);
|
|
64
|
+
}, { deep: true });
|
|
65
|
+
onMounted(() => {
|
|
66
|
+
if (props.sku.length > 0) {
|
|
67
|
+
skuInfo.value = [].slice.call(props.sku);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const changeSaleChild = (attrItem, index2, parentItem, parentIndex) => {
|
|
71
|
+
if (attrItem.checkFlag || attrItem.disable) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
emit("selectSku", {
|
|
75
|
+
sku: attrItem,
|
|
76
|
+
skuIndex: index2,
|
|
77
|
+
parentSku: parentItem,
|
|
78
|
+
parentIndex
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
skuInfo,
|
|
83
|
+
changeSaleChild
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const _hoisted_1$3 = { class: "nut-sku-select" };
|
|
88
|
+
const _hoisted_2$3 = { class: "nut-sku-select-item-title" };
|
|
89
|
+
const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
|
|
90
|
+
const _hoisted_4$2 = ["onClick"];
|
|
91
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
92
|
+
return openBlock(), createElementBlock("view", _hoisted_1$3, [
|
|
93
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index2) => {
|
|
94
|
+
return openBlock(), createElementBlock("view", {
|
|
95
|
+
class: "nut-sku-select-item",
|
|
96
|
+
key: item.id
|
|
97
|
+
}, [
|
|
98
|
+
createElementVNode("view", _hoisted_2$3, toDisplayString(item.name), 1),
|
|
99
|
+
createElementVNode("view", _hoisted_3$2, [
|
|
100
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
|
|
101
|
+
return openBlock(), createElementBlock("view", {
|
|
102
|
+
class: normalizeClass(["nut-sku-select-item-skus-sku", [{ active: !itemAttr.disable && itemAttr.active }, { disable: itemAttr.disable }]]),
|
|
103
|
+
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index2),
|
|
104
|
+
key: itemAttr.name
|
|
105
|
+
}, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
|
|
106
|
+
}), 128))
|
|
107
|
+
])
|
|
108
|
+
]);
|
|
109
|
+
}), 128))
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
var SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
113
|
+
const TypeOfFun = (value) => {
|
|
114
|
+
if (value === null) {
|
|
115
|
+
return "null";
|
|
116
|
+
}
|
|
117
|
+
const type = typeof value;
|
|
118
|
+
if (type === "undefined" || type === "string") {
|
|
119
|
+
return type;
|
|
120
|
+
}
|
|
121
|
+
const typeString = toString.call(value);
|
|
122
|
+
switch (typeString) {
|
|
123
|
+
case "[object Array]":
|
|
124
|
+
return "array";
|
|
125
|
+
case "[object Date]":
|
|
126
|
+
return "date";
|
|
127
|
+
case "[object Boolean]":
|
|
128
|
+
return "boolean";
|
|
129
|
+
case "[object Number]":
|
|
130
|
+
return "number";
|
|
131
|
+
case "[object Function]":
|
|
132
|
+
return "function";
|
|
133
|
+
case "[object RegExp]":
|
|
134
|
+
return "regexp";
|
|
135
|
+
case "[object Object]":
|
|
136
|
+
if (value.nodeType !== void 0) {
|
|
137
|
+
if (value.nodeType == 3) {
|
|
138
|
+
return /\S/.test(value.nodeValue) ? "textnode" : "whitespace";
|
|
139
|
+
} else {
|
|
140
|
+
return "element";
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
return "object";
|
|
144
|
+
}
|
|
145
|
+
default:
|
|
146
|
+
return "unknow";
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
|
|
150
|
+
const _sfc_main$2 = create$2({
|
|
151
|
+
props: {
|
|
152
|
+
stepperMax: {
|
|
153
|
+
type: [Number, String],
|
|
154
|
+
default: 99999
|
|
155
|
+
},
|
|
156
|
+
stepperMin: {
|
|
157
|
+
type: [Number, String],
|
|
158
|
+
default: 1
|
|
159
|
+
},
|
|
160
|
+
stepperExtraText: {
|
|
161
|
+
type: [Function, Boolean],
|
|
162
|
+
default: false
|
|
163
|
+
},
|
|
164
|
+
stepperTitle: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: "\u8D2D\u4E70\u6570\u91CF"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
emits: ["click", "changeSku", "changeStepper", "clickBtnOptions", "overLimit", "reduce", "add"],
|
|
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 "";
|
|
181
|
+
}
|
|
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
|
+
};
|
|
207
|
+
}
|
|
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_inputnumber = resolveComponent("nut-inputnumber");
|
|
215
|
+
return openBlock(), createElementBlock("view", _hoisted_1$2, [
|
|
216
|
+
createElementVNode("view", _hoisted_2$2, toDisplayString(_ctx.stepperTitle), 1),
|
|
217
|
+
createElementVNode("view", {
|
|
218
|
+
class: "nut-sku-stepper-limit",
|
|
219
|
+
innerHTML: _ctx.getExtraText()
|
|
220
|
+
}, null, 8, _hoisted_3$1),
|
|
221
|
+
createElementVNode("view", _hoisted_4$1, [
|
|
222
|
+
createVNode(_component_nut_inputnumber, {
|
|
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
|
|
231
|
+
}, null, 8, ["modelValue", "min", "max", "onAdd", "onReduce", "onOverlimit", "onChange"])
|
|
232
|
+
])
|
|
233
|
+
]);
|
|
234
|
+
}
|
|
235
|
+
var 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({
|
|
238
|
+
props: {
|
|
239
|
+
btnOptions: {
|
|
240
|
+
type: Array,
|
|
241
|
+
default: () => ["confirm"]
|
|
242
|
+
},
|
|
243
|
+
btnExtraText: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: ""
|
|
246
|
+
},
|
|
247
|
+
buyText: {
|
|
248
|
+
type: String,
|
|
249
|
+
default: "\u7ACB\u5373\u8D2D\u4E70"
|
|
250
|
+
},
|
|
251
|
+
addCartText: {
|
|
252
|
+
type: String,
|
|
253
|
+
default: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
254
|
+
},
|
|
255
|
+
confirmText: {
|
|
256
|
+
type: String,
|
|
257
|
+
default: "\u786E\u5B9A"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
emits: ["click", "changeSku", "changeBuyCount", "clickBtnOperate"],
|
|
261
|
+
setup(props, { emit, slots }) {
|
|
262
|
+
const getBtnDesc = (type) => {
|
|
263
|
+
let mapD = {
|
|
264
|
+
confirm: props.confirmText,
|
|
265
|
+
cart: props.addCartText,
|
|
266
|
+
buy: props.buyText
|
|
267
|
+
};
|
|
268
|
+
return mapD[type];
|
|
269
|
+
};
|
|
270
|
+
onMounted(() => {
|
|
271
|
+
console.log(slots);
|
|
272
|
+
});
|
|
273
|
+
const getSlots = (name) => slots[name];
|
|
274
|
+
const clickBtnOperate = (btn) => {
|
|
275
|
+
emit("clickBtnOperate", btn);
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
getBtnDesc,
|
|
279
|
+
clickBtnOperate,
|
|
280
|
+
getSlots
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
const _hoisted_1$1 = {
|
|
285
|
+
key: 0,
|
|
286
|
+
class: "nut-sku-operate"
|
|
287
|
+
};
|
|
288
|
+
const _hoisted_2$1 = ["innerHTML"];
|
|
289
|
+
const _hoisted_3 = {
|
|
290
|
+
key: 1,
|
|
291
|
+
class: "nut-sku-operate-btn"
|
|
292
|
+
};
|
|
293
|
+
const _hoisted_4 = ["onClick"];
|
|
294
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
295
|
+
return _ctx.btnOptions.length > 0 ? (openBlock(), createElementBlock("view", _hoisted_1$1, [
|
|
296
|
+
_ctx.btnExtraText ? (openBlock(), createElementBlock("view", {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: "nut-sku-operate-desc",
|
|
299
|
+
innerHTML: _ctx.btnExtraText
|
|
300
|
+
}, null, 8, _hoisted_2$1)) : createCommentVNode("", true),
|
|
301
|
+
renderSlot(_ctx.$slots, "operate-btn"),
|
|
302
|
+
!_ctx.getSlots("operate-btn") ? (openBlock(), createElementBlock("view", _hoisted_3, [
|
|
303
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.btnOptions, (btn, i) => {
|
|
304
|
+
return openBlock(), createElementBlock("view", {
|
|
305
|
+
class: normalizeClass([`nut-sku-operate-btn-${btn}`, "nut-sku-operate-btn-item"]),
|
|
306
|
+
key: i,
|
|
307
|
+
onClick: ($event) => _ctx.clickBtnOperate(btn)
|
|
308
|
+
}, toDisplayString(_ctx.getBtnDesc(btn)), 11, _hoisted_4);
|
|
309
|
+
}), 128))
|
|
310
|
+
])) : createCommentVNode("", true)
|
|
311
|
+
])) : createCommentVNode("", true);
|
|
312
|
+
}
|
|
313
|
+
var SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
314
|
+
const { componentName, create } = createComponent("sku");
|
|
315
|
+
const _sfc_main = create({
|
|
316
|
+
props: {
|
|
317
|
+
visible: {
|
|
318
|
+
type: Boolean,
|
|
319
|
+
default: false
|
|
320
|
+
},
|
|
321
|
+
sku: {
|
|
322
|
+
type: Array,
|
|
323
|
+
default: []
|
|
324
|
+
},
|
|
325
|
+
goods: {
|
|
326
|
+
type: Object,
|
|
327
|
+
default: {}
|
|
328
|
+
},
|
|
329
|
+
stepperMax: {
|
|
330
|
+
type: [Number, String],
|
|
331
|
+
default: 99999
|
|
332
|
+
},
|
|
333
|
+
stepperMin: {
|
|
334
|
+
type: [Number, String],
|
|
335
|
+
default: 1
|
|
336
|
+
},
|
|
337
|
+
btnOptions: {
|
|
338
|
+
type: Array,
|
|
339
|
+
default: () => ["confirm"]
|
|
340
|
+
},
|
|
341
|
+
stepperTitle: {
|
|
342
|
+
type: String,
|
|
343
|
+
default: "\u8D2D\u4E70\u6570\u91CF"
|
|
344
|
+
},
|
|
345
|
+
stepperExtraText: {
|
|
346
|
+
type: [Function, Boolean],
|
|
347
|
+
default: false
|
|
348
|
+
},
|
|
349
|
+
btnExtraText: {
|
|
350
|
+
type: String,
|
|
351
|
+
default: ""
|
|
352
|
+
},
|
|
353
|
+
buyText: {
|
|
354
|
+
type: String,
|
|
355
|
+
default: "\u7ACB\u5373\u8D2D\u4E70"
|
|
356
|
+
},
|
|
357
|
+
addCartText: {
|
|
358
|
+
type: String,
|
|
359
|
+
default: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
360
|
+
},
|
|
361
|
+
confirmText: {
|
|
362
|
+
type: String,
|
|
363
|
+
default: "\u786E\u5B9A"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
emits: [
|
|
367
|
+
"update:visible",
|
|
368
|
+
"selectSku",
|
|
369
|
+
"changeStepper",
|
|
370
|
+
"clickBtnOperate",
|
|
371
|
+
"clickCloseIcon",
|
|
372
|
+
"clickOverlay",
|
|
373
|
+
"close",
|
|
374
|
+
"reduce",
|
|
375
|
+
"add",
|
|
376
|
+
"overLimit",
|
|
377
|
+
"clickOverlay"
|
|
378
|
+
],
|
|
379
|
+
components: {
|
|
380
|
+
SkuHeader,
|
|
381
|
+
SkuSelect,
|
|
382
|
+
SkuStepper,
|
|
383
|
+
SkuOperate
|
|
384
|
+
},
|
|
385
|
+
setup(props, { emit, slots }) {
|
|
386
|
+
const showPopup = ref(props.visible);
|
|
387
|
+
const goodsCount = ref(props.stepperMin);
|
|
388
|
+
watch(() => props.visible, (value) => {
|
|
389
|
+
showPopup.value = value;
|
|
390
|
+
});
|
|
391
|
+
watch(() => showPopup.value, (value) => {
|
|
392
|
+
if (value == false) {
|
|
393
|
+
close();
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
onMounted(() => {
|
|
397
|
+
console.log("\u66F4\u65B0\u53C2\u6570");
|
|
398
|
+
});
|
|
399
|
+
const getSlots = (name) => slots[name];
|
|
400
|
+
const selectSku = (skus) => {
|
|
401
|
+
emit("selectSku", skus);
|
|
402
|
+
};
|
|
403
|
+
const changeStepper = (value) => {
|
|
404
|
+
goodsCount.value = value;
|
|
405
|
+
emit("changeStepper", value);
|
|
406
|
+
};
|
|
407
|
+
const add = (value) => {
|
|
408
|
+
emit("add", value);
|
|
409
|
+
};
|
|
410
|
+
const reduce = (value) => {
|
|
411
|
+
emit("reduce", value);
|
|
412
|
+
};
|
|
413
|
+
const stepperOverLimit = (count) => {
|
|
414
|
+
emit("overLimit", count);
|
|
415
|
+
};
|
|
416
|
+
const clickBtnOperate = (btn) => {
|
|
417
|
+
emit("clickBtnOperate", {
|
|
418
|
+
type: btn,
|
|
419
|
+
value: goodsCount.value
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
const closePopup = (type) => {
|
|
423
|
+
if (type == "icon") {
|
|
424
|
+
emit("click-close-icon");
|
|
425
|
+
}
|
|
426
|
+
if (type == "overlay") {
|
|
427
|
+
emit("click-overlay");
|
|
428
|
+
}
|
|
429
|
+
if (type == "close") {
|
|
430
|
+
emit("close");
|
|
431
|
+
}
|
|
432
|
+
showPopup.value = false;
|
|
433
|
+
};
|
|
434
|
+
const close = () => {
|
|
435
|
+
emit("update:visible", false);
|
|
436
|
+
};
|
|
437
|
+
return {
|
|
438
|
+
showPopup,
|
|
439
|
+
closePopup,
|
|
440
|
+
selectSku,
|
|
441
|
+
changeStepper,
|
|
442
|
+
stepperOverLimit,
|
|
443
|
+
clickBtnOperate,
|
|
444
|
+
add,
|
|
445
|
+
reduce,
|
|
446
|
+
getSlots
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
const _hoisted_1 = { class: "nut-sku" };
|
|
451
|
+
const _hoisted_2 = { class: "nut-sku-content" };
|
|
452
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
453
|
+
const _component_sku_header = resolveComponent("sku-header");
|
|
454
|
+
const _component_SkuSelect = resolveComponent("SkuSelect");
|
|
455
|
+
const _component_sku_stepper = resolveComponent("sku-stepper");
|
|
456
|
+
const _component_sku_operate = resolveComponent("sku-operate");
|
|
457
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
458
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
459
|
+
position: "bottom",
|
|
460
|
+
closeable: "",
|
|
461
|
+
round: "",
|
|
462
|
+
visible: _ctx.showPopup,
|
|
463
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPopup = $event),
|
|
464
|
+
onClickCloseIcon: _cache[1] || (_cache[1] = ($event) => _ctx.closePopup("icon")),
|
|
465
|
+
onClickOverlay: _cache[2] || (_cache[2] = ($event) => _ctx.closePopup("overlay")),
|
|
466
|
+
onClose: _cache[3] || (_cache[3] = ($event) => _ctx.closePopup("close")),
|
|
467
|
+
style: { "height": "75%" }
|
|
468
|
+
}, {
|
|
469
|
+
default: withCtx(() => [
|
|
470
|
+
createElementVNode("view", _hoisted_1, [
|
|
471
|
+
renderSlot(_ctx.$slots, "sku-header"),
|
|
472
|
+
!_ctx.getSlots("sku-header") ? (openBlock(), createBlock(_component_sku_header, {
|
|
473
|
+
key: 0,
|
|
474
|
+
goods: _ctx.goods
|
|
475
|
+
}, createSlots({ _: 2 }, [
|
|
476
|
+
_ctx.getSlots("sku-header-price") ? {
|
|
477
|
+
name: "sku-header-price",
|
|
478
|
+
fn: withCtx(() => [
|
|
479
|
+
renderSlot(_ctx.$slots, "sku-header-price")
|
|
480
|
+
])
|
|
481
|
+
} : void 0,
|
|
482
|
+
_ctx.getSlots("sku-header-extra") ? {
|
|
483
|
+
name: "sku-header-extra",
|
|
484
|
+
fn: withCtx(() => [
|
|
485
|
+
renderSlot(_ctx.$slots, "sku-header-extra")
|
|
486
|
+
])
|
|
487
|
+
} : void 0
|
|
488
|
+
]), 1032, ["goods"])) : createCommentVNode("", true),
|
|
489
|
+
createElementVNode("view", _hoisted_2, [
|
|
490
|
+
renderSlot(_ctx.$slots, "sku-select-top"),
|
|
491
|
+
renderSlot(_ctx.$slots, "sku-select"),
|
|
492
|
+
!_ctx.getSlots("sku-select") ? (openBlock(), createBlock(_component_SkuSelect, {
|
|
493
|
+
key: 0,
|
|
494
|
+
sku: _ctx.sku,
|
|
495
|
+
onSelectSku: _ctx.selectSku
|
|
496
|
+
}, null, 8, ["sku", "onSelectSku"])) : createCommentVNode("", true),
|
|
497
|
+
renderSlot(_ctx.$slots, "sku-stepper"),
|
|
498
|
+
!_ctx.getSlots("sku-stepper") ? (openBlock(), createBlock(_component_sku_stepper, {
|
|
499
|
+
key: 1,
|
|
500
|
+
goods: _ctx.goods,
|
|
501
|
+
stepperTitle: _ctx.stepperTitle,
|
|
502
|
+
stepperMax: _ctx.stepperMax,
|
|
503
|
+
stepperMin: _ctx.stepperMin,
|
|
504
|
+
stepperExtraText: _ctx.stepperExtraText,
|
|
505
|
+
onAdd: _ctx.add,
|
|
506
|
+
onReduce: _ctx.reduce,
|
|
507
|
+
onChangeStepper: _ctx.changeStepper,
|
|
508
|
+
onOverLimit: _ctx.stepperOverLimit
|
|
509
|
+
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "stepperExtraText", "onAdd", "onReduce", "onChangeStepper", "onOverLimit"])) : createCommentVNode("", true),
|
|
510
|
+
renderSlot(_ctx.$slots, "sku-stepper-bottom")
|
|
511
|
+
]),
|
|
512
|
+
createVNode(_component_sku_operate, {
|
|
513
|
+
btnOptions: _ctx.btnOptions,
|
|
514
|
+
btnExtraText: _ctx.btnExtraText,
|
|
515
|
+
buyText: _ctx.buyText,
|
|
516
|
+
addCartText: _ctx.addCartText,
|
|
517
|
+
confirmText: _ctx.confirmText,
|
|
518
|
+
onClickBtnOperate: _ctx.clickBtnOperate
|
|
519
|
+
}, createSlots({ _: 2 }, [
|
|
520
|
+
_ctx.getSlots("sku-operate") ? {
|
|
521
|
+
name: "operate-btn",
|
|
522
|
+
fn: withCtx(() => [
|
|
523
|
+
renderSlot(_ctx.$slots, "sku-operate")
|
|
524
|
+
])
|
|
525
|
+
} : void 0
|
|
526
|
+
]), 1032, ["btnOptions", "btnExtraText", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])
|
|
527
|
+
])
|
|
528
|
+
]),
|
|
529
|
+
_: 3
|
|
530
|
+
}, 8, ["visible"]);
|
|
531
|
+
}
|
|
532
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
533
|
+
export { index as default };
|
|
@@ -17,18 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.11-beta.0 Sat Nov 13 2021 21:43:55 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
25
|
import { getCurrentInstance, inject, reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, Fragment, toDisplayString, createCommentVNode } from "vue";
|
|
29
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
28
|
const { create, componentName } = createComponent("step");
|
|
31
|
-
|
|
29
|
+
const _sfc_main = create({
|
|
32
30
|
props: {
|
|
33
31
|
title: {
|
|
34
32
|
type: String,
|
|
@@ -42,6 +40,10 @@ var _sfc_main = create({
|
|
|
42
40
|
type: String,
|
|
43
41
|
default: null
|
|
44
42
|
},
|
|
43
|
+
iconColor: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
45
47
|
size: {
|
|
46
48
|
type: [String, Number],
|
|
47
49
|
default: "12px"
|
|
@@ -54,9 +56,9 @@ var _sfc_main = create({
|
|
|
54
56
|
const state = reactive({
|
|
55
57
|
dot: parent.props.progressDot
|
|
56
58
|
});
|
|
57
|
-
const
|
|
59
|
+
const index2 = computed(() => parent.state.children.indexOf(proxy) + 1);
|
|
58
60
|
const getCurrentStatus = () => {
|
|
59
|
-
const activeIndex =
|
|
61
|
+
const activeIndex = index2.value;
|
|
60
62
|
if (activeIndex < +parent.props.current)
|
|
61
63
|
return "finish";
|
|
62
64
|
return activeIndex === +parent.props.current ? "process" : "wait";
|
|
@@ -72,7 +74,7 @@ var _sfc_main = create({
|
|
|
72
74
|
};
|
|
73
75
|
});
|
|
74
76
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
75
|
-
index,
|
|
77
|
+
index: index2,
|
|
76
78
|
classes
|
|
77
79
|
});
|
|
78
80
|
}
|
|
@@ -99,9 +101,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
99
101
|
_ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
|
|
100
102
|
key: 0,
|
|
101
103
|
class: "nut-step-icon-inner",
|
|
104
|
+
color: _ctx.iconColor,
|
|
102
105
|
name: _ctx.icon,
|
|
103
106
|
size: _ctx.size
|
|
104
|
-
}, null, 8, ["name", "size"])) : _ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [], 64)) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.index), 1))
|
|
107
|
+
}, null, 8, ["color", "name", "size"])) : _ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [], 64)) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.index), 1))
|
|
105
108
|
], 2)
|
|
106
109
|
]),
|
|
107
110
|
createElementVNode("view", _hoisted_4, [
|
|
@@ -114,5 +117,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
114
117
|
])
|
|
115
118
|
], 2);
|
|
116
119
|
}
|
|
117
|
-
_sfc_main
|
|
118
|
-
export {
|
|
120
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
121
|
+
export { index as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11-beta.0 Sat Nov 13 2021 21:43:55 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { reactive, computed, provide, h } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
const { create, componentName } = createComponent("steps");
|
|
9
|
-
|
|
9
|
+
const _sfc_main = create({
|
|
10
10
|
props: {
|
|
11
11
|
direction: {
|
|
12
12
|
type: String,
|
|
@@ -17,19 +17,17 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
-
};
|
|
23
20
|
/*!
|
|
24
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.11-beta.0 Sat Nov 13 2021 21:43:55 GMT+0800 (中国标准时间)
|
|
25
22
|
* (c) 2021 @jdf2e.
|
|
26
23
|
* Released under the MIT License.
|
|
27
24
|
*/
|
|
28
25
|
import { u as useTouch } from "./index.js";
|
|
29
26
|
import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
30
27
|
import { c as createComponent } from "./component.js";
|
|
28
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
31
29
|
const { componentName, create } = createComponent("swipe");
|
|
32
|
-
|
|
30
|
+
const _sfc_main = create({
|
|
33
31
|
props: {
|
|
34
32
|
name: {
|
|
35
33
|
type: String,
|
|
@@ -204,5 +202,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
204
202
|
], 512)
|
|
205
203
|
], 38);
|
|
206
204
|
}
|
|
207
|
-
_sfc_main
|
|
208
|
-
export {
|
|
205
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
206
|
+
export { index as default };
|