@nutui/nutui 3.1.12-beta.0 → 3.1.12-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/dist/nutui.d.ts +4 -1
- package/dist/nutui.es.js +3943 -4130
- package/dist/nutui.umd.js +3947 -4201
- package/dist/packages/_es/ActionSheet.js +13 -12
- package/dist/packages/_es/Address.js +63 -49
- package/dist/packages/_es/Avatar.js +4 -5
- package/dist/packages/_es/BackTop.js +72 -109
- package/dist/packages/_es/Badge.js +4 -5
- package/dist/packages/_es/Barrage.js +63 -57
- package/dist/packages/_es/Button.js +5 -6
- package/dist/packages/_es/Calendar.js +27 -18
- package/dist/packages/_es/Card.js +104 -0
- package/dist/packages/_es/Cell.js +5 -13
- package/dist/packages/_es/CellGroup.js +4 -5
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +9 -4
- package/dist/packages/_es/CircleProgress.js +142 -46
- package/dist/packages/_es/Col.js +4 -5
- package/dist/packages/_es/Collapse.js +35 -10
- package/dist/packages/_es/CollapseItem.js +80 -35
- package/dist/packages/_es/CountDown.js +7 -5
- package/dist/packages/_es/CountUp.js +34 -31
- package/dist/packages/_es/DatePicker.js +451 -219
- package/dist/packages/_es/Dialog.js +24 -89
- package/dist/packages/_es/Divider.js +5 -6
- package/dist/packages/_es/Drag.js +76 -50
- package/dist/packages/_es/Elevator.js +81 -52
- package/dist/packages/_es/FixedNav.js +8 -9
- package/dist/packages/_es/Form.js +137 -0
- package/dist/packages/_es/FormItem.js +109 -0
- package/dist/packages/_es/Icon.js +6 -40
- package/dist/packages/_es/ImagePreview.js +23 -21
- package/dist/packages/_es/InfiniteLoading.js +95 -109
- package/dist/packages/_es/Input.js +22 -21
- package/dist/packages/_es/InputNumber.js +24 -18
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +16 -14
- package/dist/packages/_es/MenuItem.js +9 -11
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +39 -26
- package/dist/packages/_es/Notify.js +30 -166
- package/dist/packages/_es/NumberKeyboard.js +10 -6
- package/dist/packages/_es/OverLay.js +22 -29
- package/dist/packages/_es/Pagination.js +8 -9
- package/dist/packages/_es/Picker.js +61 -447
- package/dist/packages/_es/Popover.js +146 -25
- package/dist/packages/_es/Popup.js +17 -77
- package/dist/packages/_es/Price.js +18 -7
- package/dist/packages/_es/Progress.js +23 -12
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +37 -30
- package/dist/packages/_es/Rate.js +16 -20
- package/dist/packages/_es/Row.js +4 -5
- package/dist/packages/_es/SearchBar.js +7 -5
- package/dist/packages/_es/ShortPassword.js +89 -59
- package/dist/packages/_es/Signature.js +70 -71
- package/dist/packages/_es/Sku.js +54 -79
- package/dist/packages/_es/Step.js +10 -8
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +42 -27
- package/dist/packages/_es/Swiper.js +17 -418
- package/dist/packages/_es/SwiperItem.js +14 -39
- package/dist/packages/_es/Switch.js +4 -5
- package/dist/packages/_es/TabPane.js +4 -5
- package/dist/packages/_es/Tabbar.js +4 -5
- package/dist/packages/_es/TabbarItem.js +8 -9
- package/dist/packages/_es/Tabs.js +22 -16
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +16 -12
- package/dist/packages/_es/TimeDetail.js +7 -5
- package/dist/packages/_es/TimePannel.js +7 -5
- package/dist/packages/_es/TimeSelect.js +12 -7
- package/dist/packages/_es/Toast.js +41 -163
- package/dist/packages/_es/Uploader.js +109 -149
- package/dist/packages/_es/commonProps.js +30 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
- package/dist/packages/_es/index2.js +40 -27
- package/dist/packages/_es/index3.js +413 -7
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +47 -0
- package/dist/packages/button/index.scss +6 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/checkbox/index.scss +1 -1
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +60 -0
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/switch/index.scss +1 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -2
- package/dist/styles/themes/default.scss +35 -32
- package/dist/styles/variables.scss +11 -1
- package/package.json +2 -2
- package/dist/packages/_es/Video.js +0 -405
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -13
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import Taro from "@tarojs/taro";
|
|
7
|
+
import { computed, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
7
8
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
const { componentName, create } = createComponent("signature");
|
|
10
|
-
|
|
10
|
+
var _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
customClass: {
|
|
13
13
|
type: String,
|
|
@@ -33,8 +33,6 @@ const _sfc_main = create({
|
|
|
33
33
|
components: {},
|
|
34
34
|
emits: ["confirm", "clear"],
|
|
35
35
|
setup(props, { emit }) {
|
|
36
|
-
const canvas = ref(null);
|
|
37
|
-
const wrap = ref(null);
|
|
38
36
|
const classes = computed(() => {
|
|
39
37
|
const prefixCls = componentName;
|
|
40
38
|
return {
|
|
@@ -43,125 +41,126 @@ const _sfc_main = create({
|
|
|
43
41
|
};
|
|
44
42
|
});
|
|
45
43
|
const state = reactive({
|
|
44
|
+
canvas: null,
|
|
46
45
|
canvasHeight: 0,
|
|
47
46
|
canvasWidth: 0,
|
|
48
|
-
ctx: null
|
|
49
|
-
isSupportTouch: "ontouchstart" in window,
|
|
50
|
-
events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
|
|
47
|
+
ctx: null
|
|
51
48
|
});
|
|
52
|
-
const isCanvasSupported = () => {
|
|
53
|
-
let elem = document.createElement("canvas");
|
|
54
|
-
return !!(elem.getContext && elem.getContext("2d"));
|
|
55
|
-
};
|
|
56
|
-
const addEvent = () => {
|
|
57
|
-
canvas.value.addEventListener(state.events[0], startEventHandler, false);
|
|
58
|
-
};
|
|
59
49
|
const startEventHandler = (event) => {
|
|
60
50
|
event.preventDefault();
|
|
61
51
|
state.ctx.beginPath();
|
|
62
52
|
state.ctx.lineWidth = props.lineWidth;
|
|
63
53
|
state.ctx.strokeStyle = props.strokeStyle;
|
|
64
|
-
canvas.value.addEventListener(state.events[1], moveEventHandler, false);
|
|
65
|
-
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
66
|
-
canvas.value.addEventListener(state.events[3], leaveEventHandler, false);
|
|
67
54
|
};
|
|
68
55
|
const moveEventHandler = (event) => {
|
|
69
56
|
event.preventDefault();
|
|
70
|
-
let evt =
|
|
71
|
-
let
|
|
72
|
-
let
|
|
73
|
-
let mouseY = evt.clientY - coverPos.top;
|
|
57
|
+
let evt = event.changedTouches[0];
|
|
58
|
+
let mouseX = evt.x;
|
|
59
|
+
let mouseY = evt.y;
|
|
74
60
|
state.ctx.lineTo(mouseX, mouseY);
|
|
75
61
|
state.ctx.stroke();
|
|
76
62
|
};
|
|
77
63
|
const endEventHandler = (event) => {
|
|
78
64
|
event.preventDefault();
|
|
79
|
-
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
80
|
-
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
81
65
|
};
|
|
82
66
|
const leaveEventHandler = (event) => {
|
|
83
67
|
event.preventDefault();
|
|
84
|
-
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
85
|
-
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
86
68
|
};
|
|
87
69
|
const clear = () => {
|
|
88
|
-
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
89
70
|
state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
|
|
90
71
|
state.ctx.closePath();
|
|
91
72
|
emit("clear");
|
|
92
73
|
};
|
|
93
74
|
const confirm = () => {
|
|
94
|
-
onSave(
|
|
75
|
+
onSave();
|
|
95
76
|
};
|
|
96
|
-
const onSave = (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
case "png":
|
|
100
|
-
dataurl = canvas2.toDataURL("image/png");
|
|
101
|
-
break;
|
|
102
|
-
case "jpg":
|
|
103
|
-
dataurl = canvas2.toDataURL("image/jpeg", 0.8);
|
|
104
|
-
break;
|
|
77
|
+
const onSave = () => {
|
|
78
|
+
if (!state.canvas) {
|
|
79
|
+
return;
|
|
105
80
|
}
|
|
106
|
-
|
|
107
|
-
|
|
81
|
+
Taro.createSelectorQuery().select("#spcanvas").fields({
|
|
82
|
+
node: true,
|
|
83
|
+
size: true
|
|
84
|
+
}).exec(async (res) => {
|
|
85
|
+
Taro.canvasToTempFilePath({
|
|
86
|
+
canvas: res[0].node,
|
|
87
|
+
fileType: props.type
|
|
88
|
+
}).then((res2) => {
|
|
89
|
+
emit("confirm", res2.tempFilePath);
|
|
90
|
+
}).catch((e) => {
|
|
91
|
+
emit("confirm", e);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
108
94
|
};
|
|
109
95
|
onMounted(() => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
Taro.createSelectorQuery().select("#spcanvas").fields({
|
|
98
|
+
node: true,
|
|
99
|
+
size: true
|
|
100
|
+
}, function(res) {
|
|
101
|
+
const canvas = res.node;
|
|
102
|
+
const ctx = canvas.getContext("2d");
|
|
103
|
+
state.canvas = canvas;
|
|
104
|
+
state.ctx = ctx;
|
|
105
|
+
state.canvasWidth = res.width;
|
|
106
|
+
state.canvasHeight = res.height;
|
|
107
|
+
}).exec();
|
|
108
|
+
}, 500);
|
|
116
109
|
});
|
|
117
|
-
return {
|
|
110
|
+
return {
|
|
111
|
+
confirm,
|
|
112
|
+
clear,
|
|
113
|
+
classes,
|
|
114
|
+
startEventHandler,
|
|
115
|
+
moveEventHandler,
|
|
116
|
+
endEventHandler,
|
|
117
|
+
leaveEventHandler
|
|
118
|
+
};
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
const _hoisted_1 = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
const _hoisted_2 = ["height", "width"];
|
|
125
|
-
const _hoisted_3 = {
|
|
126
|
-
key: 1,
|
|
127
|
-
class: "nut-signature-unsopport"
|
|
128
|
-
};
|
|
129
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u91CD\u7B7E");
|
|
130
|
-
const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u786E\u8BA4");
|
|
121
|
+
const _hoisted_1 = { class: "nut-signature-inner" };
|
|
122
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u91CD\u7B7E");
|
|
123
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u786E\u8BA4");
|
|
131
124
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
132
125
|
const _component_nut_button = resolveComponent("nut-button");
|
|
133
126
|
return openBlock(), createElementBlock("div", {
|
|
134
127
|
class: normalizeClass(_ctx.classes)
|
|
135
128
|
}, [
|
|
136
129
|
createElementVNode("div", _hoisted_1, [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
createElementVNode("canvas", {
|
|
131
|
+
class: "spcanvas",
|
|
132
|
+
id: "spcanvas",
|
|
133
|
+
canvasId: "spcanvas",
|
|
134
|
+
"canvas-id": "spcanvas",
|
|
135
|
+
type: "2d",
|
|
136
|
+
"disable-scroll": "true",
|
|
137
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.startEventHandler && _ctx.startEventHandler(...args)),
|
|
138
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.moveEventHandler && _ctx.moveEventHandler(...args)),
|
|
139
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.endEventHandler && _ctx.endEventHandler(...args)),
|
|
140
|
+
onTouchleave: _cache[3] || (_cache[3] = (...args) => _ctx.leaveEventHandler && _ctx.leaveEventHandler(...args))
|
|
141
|
+
}, null, 32)
|
|
142
|
+
]),
|
|
144
143
|
createVNode(_component_nut_button, {
|
|
145
144
|
class: "nut-signature-btn",
|
|
146
145
|
type: "default",
|
|
147
|
-
onClick: _cache[
|
|
146
|
+
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.clear())
|
|
148
147
|
}, {
|
|
149
148
|
default: withCtx(() => [
|
|
150
|
-
|
|
149
|
+
_hoisted_2
|
|
151
150
|
]),
|
|
152
151
|
_: 1
|
|
153
152
|
}),
|
|
154
153
|
createVNode(_component_nut_button, {
|
|
155
154
|
class: "nut-signature-btn",
|
|
156
155
|
type: "primary",
|
|
157
|
-
onClick: _cache[
|
|
156
|
+
onClick: _cache[5] || (_cache[5] = ($event) => _ctx.confirm())
|
|
158
157
|
}, {
|
|
159
158
|
default: withCtx(() => [
|
|
160
|
-
|
|
159
|
+
_hoisted_3
|
|
161
160
|
]),
|
|
162
161
|
_: 1
|
|
163
162
|
})
|
|
164
163
|
], 2);
|
|
165
164
|
}
|
|
166
|
-
|
|
167
|
-
export {
|
|
165
|
+
_sfc_main.render = _sfc_render;
|
|
166
|
+
export { _sfc_main as default };
|
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import {
|
|
8
|
+
import { T as TypeOfFun } from "./util.js";
|
|
9
9
|
const { componentName: componentName$4, create: create$4 } = createComponent("sku-header");
|
|
10
|
-
|
|
10
|
+
var _sfc_main$4 = create$4({
|
|
11
11
|
props: {
|
|
12
12
|
goods: {
|
|
13
13
|
type: Object,
|
|
@@ -47,9 +47,9 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
47
47
|
])
|
|
48
48
|
]);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
_sfc_main$4.render = _sfc_render$4;
|
|
51
51
|
const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
|
|
52
|
-
|
|
52
|
+
var _sfc_main$3 = create$3({
|
|
53
53
|
props: {
|
|
54
54
|
sku: {
|
|
55
55
|
type: Array,
|
|
@@ -67,13 +67,13 @@ const _sfc_main$3 = create$3({
|
|
|
67
67
|
skuInfo.value = [].slice.call(props.sku);
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
const changeSaleChild = (attrItem,
|
|
70
|
+
const changeSaleChild = (attrItem, index, parentItem, parentIndex) => {
|
|
71
71
|
if (attrItem.checkFlag || attrItem.disable) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
emit("selectSku", {
|
|
75
75
|
sku: attrItem,
|
|
76
|
-
skuIndex:
|
|
76
|
+
skuIndex: index,
|
|
77
77
|
parentSku: parentItem,
|
|
78
78
|
parentIndex
|
|
79
79
|
});
|
|
@@ -90,7 +90,7 @@ const _hoisted_3$2 = { class: "nut-sku-select-item-skus" };
|
|
|
90
90
|
const _hoisted_4$2 = ["onClick"];
|
|
91
91
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
92
92
|
return openBlock(), createElementBlock("view", _hoisted_1$3, [
|
|
93
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item,
|
|
93
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.skuInfo, (item, index) => {
|
|
94
94
|
return openBlock(), createElementBlock("view", {
|
|
95
95
|
class: "nut-sku-select-item",
|
|
96
96
|
key: item.id
|
|
@@ -100,7 +100,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
100
100
|
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (itemAttr, itemAttrIndex) => {
|
|
101
101
|
return openBlock(), createElementBlock("view", {
|
|
102
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,
|
|
103
|
+
onClick: ($event) => _ctx.changeSaleChild(itemAttr, itemAttrIndex, item, index),
|
|
104
104
|
key: itemAttr.name
|
|
105
105
|
}, toDisplayString(itemAttr.name), 11, _hoisted_4$2);
|
|
106
106
|
}), 128))
|
|
@@ -109,45 +109,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
109
109
|
}), 128))
|
|
110
110
|
]);
|
|
111
111
|
}
|
|
112
|
-
|
|
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
|
-
};
|
|
112
|
+
_sfc_main$3.render = _sfc_render$3;
|
|
149
113
|
const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
|
|
150
|
-
|
|
114
|
+
var _sfc_main$2 = create$2({
|
|
151
115
|
props: {
|
|
152
116
|
stepperMax: {
|
|
153
117
|
type: [Number, String],
|
|
@@ -232,9 +196,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
232
196
|
])
|
|
233
197
|
]);
|
|
234
198
|
}
|
|
235
|
-
|
|
199
|
+
_sfc_main$2.render = _sfc_render$2;
|
|
236
200
|
const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
|
|
237
|
-
|
|
201
|
+
var _sfc_main$1 = create$1({
|
|
238
202
|
props: {
|
|
239
203
|
btnOptions: {
|
|
240
204
|
type: Array,
|
|
@@ -310,9 +274,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
310
274
|
])) : createCommentVNode("", true)
|
|
311
275
|
])) : createCommentVNode("", true);
|
|
312
276
|
}
|
|
313
|
-
|
|
277
|
+
_sfc_main$1.render = _sfc_render$1;
|
|
314
278
|
const { componentName, create } = createComponent("sku");
|
|
315
|
-
|
|
279
|
+
var _sfc_main = create({
|
|
316
280
|
props: {
|
|
317
281
|
visible: {
|
|
318
282
|
type: Boolean,
|
|
@@ -326,6 +290,10 @@ const _sfc_main = create({
|
|
|
326
290
|
type: Object,
|
|
327
291
|
default: {}
|
|
328
292
|
},
|
|
293
|
+
showSaleLimit: {
|
|
294
|
+
type: Boolean,
|
|
295
|
+
default: false
|
|
296
|
+
},
|
|
329
297
|
stepperMax: {
|
|
330
298
|
type: [Number, String],
|
|
331
299
|
default: 99999
|
|
@@ -334,6 +302,14 @@ const _sfc_main = create({
|
|
|
334
302
|
type: [Number, String],
|
|
335
303
|
default: 1
|
|
336
304
|
},
|
|
305
|
+
purchased: {
|
|
306
|
+
type: [Number, String],
|
|
307
|
+
default: 0
|
|
308
|
+
},
|
|
309
|
+
showSaleLowest: {
|
|
310
|
+
type: Boolean,
|
|
311
|
+
default: false
|
|
312
|
+
},
|
|
337
313
|
btnOptions: {
|
|
338
314
|
type: Array,
|
|
339
315
|
default: () => ["confirm"]
|
|
@@ -342,13 +318,17 @@ const _sfc_main = create({
|
|
|
342
318
|
type: String,
|
|
343
319
|
default: "\u8D2D\u4E70\u6570\u91CF"
|
|
344
320
|
},
|
|
345
|
-
|
|
321
|
+
saleLowestText: {
|
|
346
322
|
type: [Function, Boolean],
|
|
347
323
|
default: false
|
|
348
324
|
},
|
|
349
|
-
|
|
350
|
-
type:
|
|
351
|
-
default:
|
|
325
|
+
saleLimitText: {
|
|
326
|
+
type: [Function, Boolean],
|
|
327
|
+
default: false
|
|
328
|
+
},
|
|
329
|
+
purchasedText: {
|
|
330
|
+
type: [Function, Boolean],
|
|
331
|
+
default: false
|
|
352
332
|
},
|
|
353
333
|
buyText: {
|
|
354
334
|
type: String,
|
|
@@ -373,14 +353,13 @@ const _sfc_main = create({
|
|
|
373
353
|
"close",
|
|
374
354
|
"reduce",
|
|
375
355
|
"add",
|
|
376
|
-
"overLimit"
|
|
377
|
-
"clickOverlay"
|
|
356
|
+
"overLimit"
|
|
378
357
|
],
|
|
379
358
|
components: {
|
|
380
|
-
SkuHeader,
|
|
381
|
-
SkuSelect,
|
|
382
|
-
SkuStepper,
|
|
383
|
-
SkuOperate
|
|
359
|
+
SkuHeader: _sfc_main$4,
|
|
360
|
+
SkuSelect: _sfc_main$3,
|
|
361
|
+
SkuStepper: _sfc_main$2,
|
|
362
|
+
SkuOperate: _sfc_main$1
|
|
384
363
|
},
|
|
385
364
|
setup(props, { emit, slots }) {
|
|
386
365
|
const showPopup = ref(props.visible);
|
|
@@ -393,9 +372,6 @@ const _sfc_main = create({
|
|
|
393
372
|
close();
|
|
394
373
|
}
|
|
395
374
|
});
|
|
396
|
-
onMounted(() => {
|
|
397
|
-
console.log("\u66F4\u65B0\u53C2\u6570");
|
|
398
|
-
});
|
|
399
375
|
const getSlots = (name) => slots[name];
|
|
400
376
|
const selectSku = (skus) => {
|
|
401
377
|
emit("selectSku", skus);
|
|
@@ -501,33 +477,32 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
501
477
|
stepperTitle: _ctx.stepperTitle,
|
|
502
478
|
stepperMax: _ctx.stepperMax,
|
|
503
479
|
stepperMin: _ctx.stepperMin,
|
|
504
|
-
|
|
480
|
+
purchased: _ctx.purchased,
|
|
481
|
+
showSaleLimit: _ctx.showSaleLimit,
|
|
482
|
+
showSaleLowest: _ctx.showSaleLowest,
|
|
483
|
+
saleLowestText: _ctx.saleLowestText,
|
|
484
|
+
saleLimitText: _ctx.saleLimitText,
|
|
485
|
+
purchasedText: _ctx.purchasedText,
|
|
505
486
|
onAdd: _ctx.add,
|
|
506
487
|
onReduce: _ctx.reduce,
|
|
507
488
|
onChangeStepper: _ctx.changeStepper,
|
|
508
|
-
|
|
509
|
-
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "
|
|
489
|
+
onStepperOverLimit: _ctx.stepperOverLimit
|
|
490
|
+
}, null, 8, ["goods", "stepperTitle", "stepperMax", "stepperMin", "purchased", "showSaleLimit", "showSaleLowest", "saleLowestText", "saleLimitText", "purchasedText", "onAdd", "onReduce", "onChangeStepper", "onStepperOverLimit"])) : createCommentVNode("", true),
|
|
510
491
|
renderSlot(_ctx.$slots, "sku-stepper-bottom")
|
|
511
492
|
]),
|
|
512
|
-
|
|
493
|
+
renderSlot(_ctx.$slots, "sku-operate"),
|
|
494
|
+
!_ctx.getSlots("sku-operate") ? (openBlock(), createBlock(_component_sku_operate, {
|
|
495
|
+
key: 1,
|
|
513
496
|
btnOptions: _ctx.btnOptions,
|
|
514
|
-
btnExtraText: _ctx.btnExtraText,
|
|
515
497
|
buyText: _ctx.buyText,
|
|
516
498
|
addCartText: _ctx.addCartText,
|
|
517
499
|
confirmText: _ctx.confirmText,
|
|
518
500
|
onClickBtnOperate: _ctx.clickBtnOperate
|
|
519
|
-
},
|
|
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"])
|
|
501
|
+
}, null, 8, ["btnOptions", "buyText", "addCartText", "confirmText", "onClickBtnOperate"])) : createCommentVNode("", true)
|
|
527
502
|
])
|
|
528
503
|
]),
|
|
529
504
|
_: 3
|
|
530
505
|
}, 8, ["visible"]);
|
|
531
506
|
}
|
|
532
|
-
|
|
533
|
-
export {
|
|
507
|
+
_sfc_main.render = _sfc_render;
|
|
508
|
+
export { _sfc_main as default };
|
|
@@ -17,16 +17,18 @@ 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
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
28
|
import { getCurrentInstance, inject, reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, Fragment, toDisplayString, createCommentVNode } from "vue";
|
|
26
29
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
30
|
const { create, componentName } = createComponent("step");
|
|
29
|
-
|
|
31
|
+
var _sfc_main = create({
|
|
30
32
|
props: {
|
|
31
33
|
title: {
|
|
32
34
|
type: String,
|
|
@@ -56,9 +58,9 @@ const _sfc_main = create({
|
|
|
56
58
|
const state = reactive({
|
|
57
59
|
dot: parent.props.progressDot
|
|
58
60
|
});
|
|
59
|
-
const
|
|
61
|
+
const index = computed(() => parent.state.children.indexOf(proxy) + 1);
|
|
60
62
|
const getCurrentStatus = () => {
|
|
61
|
-
const activeIndex =
|
|
63
|
+
const activeIndex = index.value;
|
|
62
64
|
if (activeIndex < +parent.props.current)
|
|
63
65
|
return "finish";
|
|
64
66
|
return activeIndex === +parent.props.current ? "process" : "wait";
|
|
@@ -74,7 +76,7 @@ const _sfc_main = create({
|
|
|
74
76
|
};
|
|
75
77
|
});
|
|
76
78
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
77
|
-
index
|
|
79
|
+
index,
|
|
78
80
|
classes
|
|
79
81
|
});
|
|
80
82
|
}
|
|
@@ -117,5 +119,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
117
119
|
])
|
|
118
120
|
], 2);
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
+
_sfc_main.render = _sfc_render;
|
|
123
|
+
export { _sfc_main as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 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
|
+
var _sfc_main = create({
|
|
10
10
|
props: {
|
|
11
11
|
direction: {
|
|
12
12
|
type: String,
|
|
@@ -17,17 +17,21 @@ 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
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
28
|
+
import Taro from "@tarojs/taro";
|
|
25
29
|
import { u as useTouch } from "./index.js";
|
|
26
|
-
import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
30
|
+
import { computed, ref, onMounted, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
|
|
27
31
|
import { c as createComponent } from "./component.js";
|
|
28
|
-
import {
|
|
32
|
+
import { u as useTaroRect } from "./index2.js";
|
|
29
33
|
const { componentName, create } = createComponent("swipe");
|
|
30
|
-
|
|
34
|
+
var _sfc_main = create({
|
|
31
35
|
props: {
|
|
32
36
|
name: {
|
|
33
37
|
type: String,
|
|
@@ -48,21 +52,29 @@ const _sfc_main = create({
|
|
|
48
52
|
},
|
|
49
53
|
emits: ["open", "close"],
|
|
50
54
|
setup(props, { emit }) {
|
|
55
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
51
56
|
const classes = computed(() => {
|
|
52
57
|
const prefixCls = componentName;
|
|
53
58
|
return {
|
|
54
59
|
[prefixCls]: true
|
|
55
60
|
};
|
|
56
61
|
});
|
|
57
|
-
const getRefWidth = (ref2) => {
|
|
58
|
-
|
|
59
|
-
return
|
|
62
|
+
const getRefWidth = async (ref2) => {
|
|
63
|
+
let rect = await useTaroRect(ref2, Taro);
|
|
64
|
+
return rect.width || 0;
|
|
60
65
|
};
|
|
61
|
-
const leftRef = ref()
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
+
const leftRef = ref();
|
|
67
|
+
const leftRefWidth = ref(0);
|
|
68
|
+
const rightRef = ref();
|
|
69
|
+
const rightRefWidth = ref(0);
|
|
70
|
+
const initWidth = async () => {
|
|
71
|
+
leftRefWidth.value = await getRefWidth(leftRef);
|
|
72
|
+
rightRefWidth.value = await getRefWidth(rightRef);
|
|
73
|
+
};
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
initWidth();
|
|
77
|
+
}, 100);
|
|
66
78
|
});
|
|
67
79
|
let opened = false;
|
|
68
80
|
let position = "";
|
|
@@ -122,7 +134,7 @@ const _sfc_main = create({
|
|
|
122
134
|
return;
|
|
123
135
|
touch.start(event);
|
|
124
136
|
},
|
|
125
|
-
onTouchMove(event) {
|
|
137
|
+
async onTouchMove(event) {
|
|
126
138
|
if (props.disabled)
|
|
127
139
|
return;
|
|
128
140
|
touch.move(event);
|
|
@@ -168,20 +180,15 @@ const _sfc_main = create({
|
|
|
168
180
|
}, touchMethods), {
|
|
169
181
|
leftRef,
|
|
170
182
|
rightRef,
|
|
183
|
+
refRandomId,
|
|
171
184
|
open,
|
|
172
185
|
close
|
|
173
186
|
});
|
|
174
187
|
}
|
|
175
188
|
});
|
|
176
|
-
const _hoisted_1 =
|
|
177
|
-
class: "nut-swipe__left",
|
|
178
|
-
ref: "leftRef"
|
|
179
|
-
};
|
|
189
|
+
const _hoisted_1 = ["id"];
|
|
180
190
|
const _hoisted_2 = { class: "nut-swipe__content" };
|
|
181
|
-
const _hoisted_3 =
|
|
182
|
-
class: "nut-swipe__right",
|
|
183
|
-
ref: "rightRef"
|
|
184
|
-
};
|
|
191
|
+
const _hoisted_3 = ["id"];
|
|
185
192
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
186
193
|
return openBlock(), createElementBlock("view", {
|
|
187
194
|
class: normalizeClass(_ctx.classes),
|
|
@@ -191,16 +198,24 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
191
198
|
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
192
199
|
onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
193
200
|
}, [
|
|
194
|
-
createElementVNode("view",
|
|
201
|
+
createElementVNode("view", {
|
|
202
|
+
class: "nut-swipe__left",
|
|
203
|
+
ref: "leftRef",
|
|
204
|
+
id: "leftRef-" + _ctx.refRandomId
|
|
205
|
+
}, [
|
|
195
206
|
renderSlot(_ctx.$slots, "left")
|
|
196
|
-
],
|
|
207
|
+
], 8, _hoisted_1),
|
|
197
208
|
createElementVNode("view", _hoisted_2, [
|
|
198
209
|
renderSlot(_ctx.$slots, "default")
|
|
199
210
|
]),
|
|
200
|
-
createElementVNode("view",
|
|
211
|
+
createElementVNode("view", {
|
|
212
|
+
class: "nut-swipe__right",
|
|
213
|
+
ref: "rightRef",
|
|
214
|
+
id: "rightRef-" + _ctx.refRandomId
|
|
215
|
+
}, [
|
|
201
216
|
renderSlot(_ctx.$slots, "right")
|
|
202
|
-
],
|
|
217
|
+
], 8, _hoisted_3)
|
|
203
218
|
], 38);
|
|
204
219
|
}
|
|
205
|
-
|
|
206
|
-
export {
|
|
220
|
+
_sfc_main.render = _sfc_render;
|
|
221
|
+
export { _sfc_main as default };
|