@tuya-miniapp/smart-ui 1.3.1-beta-3 → 1.3.1-beta-4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/demo/index.d.ts +1 -0
- package/dist/action-sheet/demo/index.js +101 -0
- package/dist/action-sheet/index.js +1 -1
- package/dist/area/demo/index.d.ts +1 -0
- package/dist/area/demo/index.js +41 -0
- package/dist/area/index.js +4 -5
- package/dist/battery/demo/index.d.ts +1 -0
- package/dist/battery/demo/index.js +2 -0
- package/dist/battery/index.js +1 -3
- package/dist/bottom-sheet/demo/index.d.ts +1 -0
- package/dist/bottom-sheet/demo/index.js +24 -0
- package/dist/bottom-sheet/index.css +1 -1
- package/dist/bottom-sheet/index.js +3 -2
- package/dist/bottom-sheet/index.wxml +3 -1
- package/dist/bottom-sheet/index.wxss +1 -1
- package/dist/button/demo/index.d.ts +1 -0
- package/dist/button/demo/index.js +9 -0
- package/dist/button/index.js +1 -1
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/header/index.wxml +3 -3
- package/dist/calendar/components/header/index.wxss +1 -1
- package/dist/calendar/components/month/index.css +1 -1
- package/dist/calendar/components/month/index.js +3 -5
- package/dist/calendar/components/month/index.wxs +1 -4
- package/dist/calendar/components/month/index.wxss +1 -1
- package/dist/calendar/components/month-list/index.css +1 -1
- package/dist/calendar/components/month-list/index.js +4 -17
- package/dist/calendar/components/month-list/index.wxml +15 -13
- package/dist/calendar/components/month-list/index.wxss +1 -1
- package/dist/calendar/components/year-list/index.css +1 -1
- package/dist/calendar/components/year-list/index.js +3 -3
- package/dist/calendar/components/year-list/index.wxml +1 -1
- package/dist/calendar/components/year-list/index.wxss +1 -1
- package/dist/calendar/demo/index.d.ts +1 -0
- package/dist/calendar/demo/index.js +103 -0
- package/dist/calendar/index.js +9 -14
- package/dist/calendar/index.wxs +4 -7
- package/dist/calendar/utils.js +2 -4
- package/dist/cascader/demo/index.d.ts +1 -0
- package/dist/cascader/demo/index.js +191 -0
- package/dist/cascader/index.js +3 -3
- package/dist/cell/demo/index.d.ts +1 -0
- package/dist/cell/demo/index.js +14 -0
- package/dist/cell/index.js +1 -7
- package/dist/checkbox/demo/index.d.ts +1 -0
- package/dist/checkbox/demo/index.js +34 -0
- package/dist/checkbox-group/index.js +1 -1
- package/dist/circle/demo/index.d.ts +1 -0
- package/dist/circle/demo/index.js +19 -0
- package/dist/col/demo/index.d.ts +1 -0
- package/dist/col/demo/index.js +4 -0
- package/dist/collapse/demo/index.d.ts +1 -0
- package/dist/collapse/demo/index.js +36 -0
- package/dist/collapse/index.js +1 -1
- package/dist/collapse-item/animate.js +1 -1
- package/dist/common/component.js +1 -1
- package/dist/common/utils.js +3 -3
- package/dist/config-provider/demo/index.d.ts +1 -0
- package/dist/config-provider/demo/index.js +22 -0
- package/dist/count-down/demo/index.d.ts +1 -0
- package/dist/count-down/demo/index.js +33 -0
- package/dist/custom-keyboard/demo/index.d.ts +1 -0
- package/dist/custom-keyboard/demo/index.js +17 -0
- package/dist/custom-keyboard/index.js +1 -3
- package/dist/datetime-picker/demo/index.d.ts +1 -0
- package/dist/datetime-picker/demo/index.js +63 -0
- package/dist/datetime-picker/index.js +4 -5
- package/dist/dialog/demo/index.d.ts +1 -0
- package/dist/dialog/demo/index.js +134 -0
- package/dist/dialog/dialog.js +3 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/demo/index.d.ts +1 -0
- package/dist/divider/demo/index.js +4 -0
- package/dist/dropdown-item/index.js +3 -3
- package/dist/dropdown-item/index.wxml +1 -7
- package/dist/dropdown-menu/demo/index.d.ts +1 -0
- package/dist/dropdown-menu/demo/index.js +47 -0
- package/dist/dropdown-menu/index.js +8 -10
- package/dist/empty/demo/index.d.ts +1 -0
- package/dist/empty/demo/index.js +13 -0
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.wxs +1 -1
- package/dist/empty/index.wxss +1 -1
- package/dist/field/demo/index.d.ts +1 -0
- package/dist/field/demo/index.js +21 -0
- package/dist/goods-action/demo/index.d.ts +1 -0
- package/dist/goods-action/demo/index.js +12 -0
- package/dist/goods-action/index.js +1 -1
- package/dist/grid/demo/index.d.ts +1 -0
- package/dist/grid/demo/index.js +9 -0
- package/dist/grid/index.js +1 -1
- package/dist/grid-item/index.js +1 -1
- package/dist/icon/demo/index.d.ts +1 -0
- package/dist/icon/demo/index.js +26 -0
- package/dist/image/demo/index.d.ts +1 -0
- package/dist/image/demo/index.js +15 -0
- package/dist/index-anchor/index.js +1 -1
- package/dist/index-bar/demo/index.d.ts +1 -0
- package/dist/index-bar/demo/index.js +21 -0
- package/dist/index-bar/index.js +9 -16
- package/dist/loading/demo/index.d.ts +1 -0
- package/dist/loading/demo/index.js +4 -0
- package/dist/loading/index.js +25 -1
- package/dist/loading/index.wxml +2 -2
- package/dist/loading/index.wxs +6 -21
- package/dist/mixins/basic.js +2 -2
- package/dist/mixins/link.js +1 -2
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/mixins/touch.js +1 -2
- package/dist/mixins/transition.js +1 -1
- package/dist/nav-bar/demo/index.d.ts +1 -0
- package/dist/nav-bar/demo/index.js +26 -0
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.js +1 -1
- package/dist/nav-bar/index.wxml +1 -1
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/demo/index.d.ts +1 -0
- package/dist/normal-slider/demo/index.js +19 -0
- package/dist/notice-bar/demo/index.d.ts +1 -0
- package/dist/notice-bar/demo/index.js +11 -0
- package/dist/notice-bar/index.js +3 -6
- package/dist/notice-bar/index.wxml +1 -5
- package/dist/notify/demo/index.d.ts +1 -0
- package/dist/notify/demo/index.js +45 -0
- package/dist/overlay/demo/index.d.ts +1 -0
- package/dist/overlay/demo/index.js +22 -0
- package/dist/picker/demo/index.d.ts +1 -0
- package/dist/picker/demo/index.js +76 -0
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.js +2 -2
- package/dist/picker/index.wxml +1 -0
- package/dist/picker/index.wxss +1 -1
- package/dist/picker-column/index.js +3 -8
- package/dist/popup/demo/index.d.ts +1 -0
- package/dist/popup/demo/index.js +79 -0
- package/dist/progress/demo/index.d.ts +1 -0
- package/dist/progress/demo/index.js +4 -0
- package/dist/progress/index.js +1 -4
- package/dist/radio/demo/index.d.ts +1 -0
- package/dist/radio/demo/index.js +31 -0
- package/dist/radio-group/index.js +1 -1
- package/dist/rate/demo/index.d.ts +1 -0
- package/dist/rate/demo/index.js +25 -0
- package/dist/rate/index.js +2 -2
- package/dist/row/index.js +1 -1
- package/dist/search/demo/index.d.ts +1 -0
- package/dist/search/demo/index.js +43 -0
- package/dist/sidebar/demo/index.d.ts +1 -0
- package/dist/sidebar/demo/index.js +9 -0
- package/dist/skeleton/demo/index.d.ts +1 -0
- package/dist/skeleton/demo/index.js +11 -0
- package/dist/slider/demo/index.d.ts +1 -0
- package/dist/slider/demo/index.js +19 -0
- package/dist/slider/index.js +5 -7
- package/dist/stepper/demo/index.d.ts +1 -0
- package/dist/stepper/demo/index.js +19 -0
- package/dist/steps/demo/index.d.ts +1 -0
- package/dist/steps/demo/index.js +42 -0
- package/dist/sticky/demo/index.d.ts +1 -0
- package/dist/sticky/demo/index.js +26 -0
- package/dist/sticky/index.js +2 -2
- package/dist/swipe-cell/demo/index.d.ts +1 -0
- package/dist/swipe-cell/demo/index.js +45 -0
- package/dist/swipe-cell/index.js +3 -5
- package/dist/switch/demo/index.d.ts +1 -0
- package/dist/switch/demo/index.js +29 -0
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/dist/tab/demo/index.d.ts +1 -0
- package/dist/tab/demo/index.js +55 -0
- package/dist/tabbar/demo/index.d.ts +1 -0
- package/dist/tabbar/demo/index.js +34 -0
- package/dist/tabbar/index.js +1 -1
- package/dist/tabs/index.js +7 -25
- package/dist/tag/demo/index.d.ts +1 -0
- package/dist/tag/demo/index.js +16 -0
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/demo/index.d.ts +1 -0
- package/dist/toast/demo/index.js +67 -0
- package/dist/toast/toast.js +3 -5
- package/dist/transition/demo/index.d.ts +1 -0
- package/dist/transition/demo/index.js +67 -0
- package/dist/tree-select/demo/index.d.ts +1 -0
- package/dist/tree-select/demo/index.js +113 -0
- package/lib/action-sheet/demo/index.d.ts +1 -0
- package/lib/action-sheet/demo/index.js +115 -0
- package/lib/area/demo/index.d.ts +1 -0
- package/lib/area/demo/index.js +47 -0
- package/lib/area/index.js +1 -2
- package/lib/battery/demo/index.d.ts +1 -0
- package/lib/battery/demo/index.js +4 -0
- package/lib/battery/index.js +1 -3
- package/lib/bottom-sheet/demo/index.d.ts +1 -0
- package/lib/bottom-sheet/demo/index.js +27 -0
- package/lib/bottom-sheet/index.css +1 -1
- package/lib/bottom-sheet/index.js +3 -2
- package/lib/bottom-sheet/index.wxml +3 -1
- package/lib/bottom-sheet/index.wxss +1 -1
- package/lib/button/demo/index.d.ts +1 -0
- package/lib/button/demo/index.js +14 -0
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.wxml +3 -3
- package/lib/calendar/components/header/index.wxss +1 -1
- package/lib/calendar/components/month/index.css +1 -1
- package/lib/calendar/components/month/index.js +2 -6
- package/lib/calendar/components/month/index.wxs +1 -4
- package/lib/calendar/components/month/index.wxss +1 -1
- package/lib/calendar/components/month-list/index.css +1 -1
- package/lib/calendar/components/month-list/index.js +3 -16
- package/lib/calendar/components/month-list/index.wxml +15 -13
- package/lib/calendar/components/month-list/index.wxss +1 -1
- package/lib/calendar/components/year-list/index.css +1 -1
- package/lib/calendar/components/year-list/index.js +1 -1
- package/lib/calendar/components/year-list/index.wxml +1 -1
- package/lib/calendar/components/year-list/index.wxss +1 -1
- package/lib/calendar/demo/index.d.ts +1 -0
- package/lib/calendar/demo/index.js +105 -0
- package/lib/calendar/index.js +7 -14
- package/lib/calendar/index.wxs +4 -7
- package/lib/calendar/utils.js +1 -3
- package/lib/cascader/demo/index.d.ts +1 -0
- package/lib/cascader/demo/index.js +197 -0
- package/lib/cell/demo/index.d.ts +1 -0
- package/lib/cell/demo/index.js +39 -0
- package/lib/cell/index.js +1 -7
- package/lib/checkbox/demo/index.d.ts +1 -0
- package/lib/checkbox/demo/index.js +38 -0
- package/lib/circle/demo/index.d.ts +1 -0
- package/lib/circle/demo/index.js +21 -0
- package/lib/col/demo/index.d.ts +1 -0
- package/lib/col/demo/index.js +6 -0
- package/lib/collapse/demo/index.d.ts +1 -0
- package/lib/collapse/demo/index.js +42 -0
- package/lib/config-provider/demo/index.d.ts +1 -0
- package/lib/config-provider/demo/index.js +24 -0
- package/lib/count-down/demo/index.d.ts +1 -0
- package/lib/count-down/demo/index.js +38 -0
- package/lib/custom-keyboard/demo/index.d.ts +1 -0
- package/lib/custom-keyboard/demo/index.js +19 -0
- package/lib/custom-keyboard/index.js +1 -3
- package/lib/datetime-picker/demo/index.d.ts +1 -0
- package/lib/datetime-picker/demo/index.js +68 -0
- package/lib/datetime-picker/index.js +4 -3
- package/lib/dialog/demo/index.d.ts +1 -0
- package/lib/dialog/demo/index.js +144 -0
- package/lib/dialog/dialog.js +1 -3
- package/lib/divider/demo/index.d.ts +1 -0
- package/lib/divider/demo/index.js +6 -0
- package/lib/dropdown-item/index.wxml +1 -7
- package/lib/dropdown-menu/demo/index.d.ts +1 -0
- package/lib/dropdown-menu/demo/index.js +52 -0
- package/lib/dropdown-menu/index.js +2 -4
- package/lib/empty/demo/index.d.ts +1 -0
- package/lib/empty/demo/index.js +15 -0
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.wxs +1 -1
- package/lib/empty/index.wxss +1 -1
- package/lib/field/demo/index.d.ts +1 -0
- package/lib/field/demo/index.js +23 -0
- package/lib/goods-action/demo/index.d.ts +1 -0
- package/lib/goods-action/demo/index.js +17 -0
- package/lib/grid/demo/index.d.ts +1 -0
- package/lib/grid/demo/index.js +11 -0
- package/lib/icon/demo/index.d.ts +1 -0
- package/lib/icon/demo/index.js +54 -0
- package/lib/image/demo/index.d.ts +1 -0
- package/lib/image/demo/index.js +17 -0
- package/lib/index-bar/demo/index.d.ts +1 -0
- package/lib/index-bar/demo/index.js +23 -0
- package/lib/index-bar/index.js +3 -10
- package/lib/loading/demo/index.d.ts +1 -0
- package/lib/loading/demo/index.js +6 -0
- package/lib/loading/index.js +27 -1
- package/lib/loading/index.wxml +2 -2
- package/lib/loading/index.wxs +6 -21
- package/lib/mixins/link.js +1 -2
- package/lib/mixins/touch.js +1 -2
- package/lib/nav-bar/demo/index.d.ts +1 -0
- package/lib/nav-bar/demo/index.js +31 -0
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.wxml +1 -1
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/demo/index.d.ts +1 -0
- package/lib/normal-slider/demo/index.js +21 -0
- package/lib/notice-bar/demo/index.d.ts +1 -0
- package/lib/notice-bar/demo/index.js +16 -0
- package/lib/notice-bar/index.js +2 -5
- package/lib/notice-bar/index.wxml +1 -5
- package/lib/notify/demo/index.d.ts +1 -0
- package/lib/notify/demo/index.js +50 -0
- package/lib/overlay/demo/index.d.ts +1 -0
- package/lib/overlay/demo/index.js +24 -0
- package/lib/picker/demo/index.d.ts +1 -0
- package/lib/picker/demo/index.js +82 -0
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.js +1 -3
- package/lib/picker/index.wxml +1 -0
- package/lib/picker/index.wxss +1 -1
- package/lib/picker-column/index.js +2 -7
- package/lib/popup/demo/index.d.ts +1 -0
- package/lib/popup/demo/index.js +85 -0
- package/lib/progress/demo/index.d.ts +1 -0
- package/lib/progress/demo/index.js +6 -0
- package/lib/progress/index.js +1 -4
- package/lib/radio/demo/index.d.ts +1 -0
- package/lib/radio/demo/index.js +34 -0
- package/lib/rate/demo/index.d.ts +1 -0
- package/lib/rate/demo/index.js +30 -0
- package/lib/search/demo/index.d.ts +1 -0
- package/lib/search/demo/index.js +48 -0
- package/lib/sidebar/demo/index.d.ts +1 -0
- package/lib/sidebar/demo/index.js +14 -0
- package/lib/skeleton/demo/index.d.ts +1 -0
- package/lib/skeleton/demo/index.js +14 -0
- package/lib/slider/demo/index.d.ts +1 -0
- package/lib/slider/demo/index.js +21 -0
- package/lib/slider/index.js +1 -3
- package/lib/stepper/demo/index.d.ts +1 -0
- package/lib/stepper/demo/index.js +25 -0
- package/lib/steps/demo/index.d.ts +1 -0
- package/lib/steps/demo/index.js +47 -0
- package/lib/sticky/demo/index.d.ts +1 -0
- package/lib/sticky/demo/index.js +30 -0
- package/lib/sticky/index.js +3 -1
- package/lib/swipe-cell/demo/index.d.ts +1 -0
- package/lib/swipe-cell/demo/index.js +50 -0
- package/lib/swipe-cell/index.js +1 -3
- package/lib/switch/demo/index.d.ts +1 -0
- package/lib/switch/demo/index.js +37 -0
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/lib/tab/demo/index.d.ts +1 -0
- package/lib/tab/demo/index.js +57 -0
- package/lib/tabbar/demo/index.d.ts +1 -0
- package/lib/tabbar/demo/index.js +41 -0
- package/lib/tabs/index.js +6 -24
- package/lib/tag/demo/index.d.ts +1 -0
- package/lib/tag/demo/index.js +19 -0
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/demo/index.d.ts +1 -0
- package/lib/toast/demo/index.js +74 -0
- package/lib/toast/toast.js +1 -3
- package/lib/transition/demo/index.d.ts +1 -0
- package/lib/transition/demo/index.js +71 -0
- package/lib/tree-select/demo/index.d.ts +1 -0
- package/lib/tree-select/demo/index.js +130 -0
- package/package.json +1 -1
@@ -0,0 +1,74 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
8
|
+
(0, component_1.SmartComponent)({
|
9
|
+
methods: {
|
10
|
+
showToast: function () {
|
11
|
+
(0, toast_1.default)({ context: this, message: I18n.t('promptContent') });
|
12
|
+
},
|
13
|
+
showLongToast: function () {
|
14
|
+
(0, toast_1.default)({
|
15
|
+
context: this,
|
16
|
+
message: I18n.t('toastDemoTip1'),
|
17
|
+
});
|
18
|
+
},
|
19
|
+
showLoadingToast: function () {
|
20
|
+
toast_1.default.loading({
|
21
|
+
context: this,
|
22
|
+
message: I18n.t('loading') + '...',
|
23
|
+
forbidClick: true,
|
24
|
+
});
|
25
|
+
},
|
26
|
+
showCustomLoadingToast: function () {
|
27
|
+
toast_1.default.loading({
|
28
|
+
context: this,
|
29
|
+
message: I18n.t('loading') + '...',
|
30
|
+
forbidClick: true,
|
31
|
+
loadingType: 'spinner',
|
32
|
+
});
|
33
|
+
},
|
34
|
+
showSuccessToast: function () {
|
35
|
+
toast_1.default.success({ context: this, message: I18n.t('successMessage') });
|
36
|
+
},
|
37
|
+
showFailToast: function () {
|
38
|
+
toast_1.default.fail({ context: this, message: I18n.t('failurePrompt') });
|
39
|
+
},
|
40
|
+
showWarnToast: function () {
|
41
|
+
toast_1.default.warn({ context: this, message: I18n.t('warningPrompt') });
|
42
|
+
},
|
43
|
+
showCustomizedToast: function () {
|
44
|
+
var text = function (second) {
|
45
|
+
return "".concat(I18n.t('countdown'), " ").concat(second, " ").concat(I18n.t('second'));
|
46
|
+
};
|
47
|
+
var toast = toast_1.default.loading({
|
48
|
+
context: this,
|
49
|
+
duration: 0,
|
50
|
+
forbidClick: true,
|
51
|
+
message: text(3),
|
52
|
+
});
|
53
|
+
var second = 3;
|
54
|
+
var timer = setInterval(function () {
|
55
|
+
second--;
|
56
|
+
if (second) {
|
57
|
+
toast === null || toast === void 0 ? void 0 : toast.setData({ message: text(second) });
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
clearInterval(timer);
|
61
|
+
toast_1.default.clear();
|
62
|
+
}
|
63
|
+
}, 1000);
|
64
|
+
},
|
65
|
+
showCustomizedWidthToast: function () {
|
66
|
+
toast_1.default.loading({
|
67
|
+
context: this,
|
68
|
+
message: I18n.t('loading') + '...',
|
69
|
+
forbidClick: true,
|
70
|
+
width: 200,
|
71
|
+
});
|
72
|
+
},
|
73
|
+
},
|
74
|
+
});
|
package/lib/toast/toast.js
CHANGED
@@ -37,9 +37,7 @@ function getContext() {
|
|
37
37
|
}
|
38
38
|
function Toast(toastOptions) {
|
39
39
|
var options = __assign(__assign({}, currentOptions), parseOptions(toastOptions));
|
40
|
-
var context = (typeof options.context === 'function'
|
41
|
-
? options.context()
|
42
|
-
: options.context) || getContext();
|
40
|
+
var context = (typeof options.context === 'function' ? options.context() : options.context) || getContext();
|
43
41
|
var toast = context.selectComponent(options.selector);
|
44
42
|
if (!toast) {
|
45
43
|
console.warn('未找到 smart-toast 节点,请确认 selector 及 context 是否正确');
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
show: false,
|
7
|
+
name: 'fade',
|
8
|
+
showCustom: false,
|
9
|
+
},
|
10
|
+
methods: {
|
11
|
+
onClickFade: function () {
|
12
|
+
this.trigger('fade');
|
13
|
+
},
|
14
|
+
onClickFadeUp: function () {
|
15
|
+
this.trigger('fade-up');
|
16
|
+
},
|
17
|
+
onClickFadeDown: function () {
|
18
|
+
this.trigger('fade-down');
|
19
|
+
},
|
20
|
+
onClickFadeLeft: function () {
|
21
|
+
this.trigger('fade-left');
|
22
|
+
},
|
23
|
+
onClickFadeRight: function () {
|
24
|
+
this.trigger('fade-right');
|
25
|
+
},
|
26
|
+
onClickSlideUp: function () {
|
27
|
+
this.trigger('slide-up');
|
28
|
+
},
|
29
|
+
onClickSlideDown: function () {
|
30
|
+
this.trigger('slide-down');
|
31
|
+
},
|
32
|
+
onClickSlideLeft: function () {
|
33
|
+
this.trigger('slide-left');
|
34
|
+
},
|
35
|
+
onClickSlideRight: function () {
|
36
|
+
this.trigger('slide-right');
|
37
|
+
},
|
38
|
+
trigger: function (name) {
|
39
|
+
var _this = this;
|
40
|
+
this.setData({ name: name, show: true });
|
41
|
+
setTimeout(function () {
|
42
|
+
_this.setData({ show: false });
|
43
|
+
}, 500);
|
44
|
+
},
|
45
|
+
onClickCustom: function () {
|
46
|
+
var _this = this;
|
47
|
+
this.setData({ showCustom: true });
|
48
|
+
setTimeout(function () {
|
49
|
+
_this.setData({ showCustom: false });
|
50
|
+
}, 1000);
|
51
|
+
},
|
52
|
+
onBeforeEnter: function () {
|
53
|
+
console.log('before enter');
|
54
|
+
},
|
55
|
+
onEnter: function () {
|
56
|
+
console.log('enter');
|
57
|
+
},
|
58
|
+
onAfterEnter: function () {
|
59
|
+
console.log('after enter');
|
60
|
+
},
|
61
|
+
onBeforeLeave: function () {
|
62
|
+
console.log('before leave');
|
63
|
+
},
|
64
|
+
onLeave: function () {
|
65
|
+
console.log('leave');
|
66
|
+
},
|
67
|
+
onAfterLeave: function () {
|
68
|
+
console.log('after leave');
|
69
|
+
},
|
70
|
+
},
|
71
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,130 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
var component_1 = require("../../common/component");
|
15
|
+
var config = {
|
16
|
+
pro1Name: I18n.t('zhejiang'),
|
17
|
+
pro1: [
|
18
|
+
{
|
19
|
+
text: I18n.t('hangzhou'),
|
20
|
+
id: 1,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
text: I18n.t('wenzhou'),
|
24
|
+
id: 2,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
text: I18n.t('ningbo'),
|
28
|
+
id: 3,
|
29
|
+
disabled: true,
|
30
|
+
},
|
31
|
+
{
|
32
|
+
text: I18n.t('yiwu'),
|
33
|
+
id: 4,
|
34
|
+
},
|
35
|
+
],
|
36
|
+
pro2Name: I18n.t('jiangsu'),
|
37
|
+
pro2: [
|
38
|
+
{
|
39
|
+
text: I18n.t('nanjing'),
|
40
|
+
id: 5,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
text: I18n.t('wuxi'),
|
44
|
+
id: 6,
|
45
|
+
},
|
46
|
+
{
|
47
|
+
text: I18n.t('xuzhou'),
|
48
|
+
id: 7,
|
49
|
+
},
|
50
|
+
{
|
51
|
+
text: I18n.t('suzhou'),
|
52
|
+
id: 8,
|
53
|
+
},
|
54
|
+
],
|
55
|
+
pro3Name: I18n.t('fujian'),
|
56
|
+
pro3: [
|
57
|
+
{
|
58
|
+
text: I18n.t('quanzhou'),
|
59
|
+
id: 9,
|
60
|
+
},
|
61
|
+
{
|
62
|
+
text: I18n.t('xiamen'),
|
63
|
+
id: 10,
|
64
|
+
},
|
65
|
+
],
|
66
|
+
};
|
67
|
+
var items = [
|
68
|
+
{
|
69
|
+
text: config.pro1Name,
|
70
|
+
options: config.pro1,
|
71
|
+
},
|
72
|
+
{
|
73
|
+
text: config.pro2Name,
|
74
|
+
options: config.pro2,
|
75
|
+
},
|
76
|
+
{
|
77
|
+
text: config.pro3Name,
|
78
|
+
disabled: true,
|
79
|
+
options: config.pro3,
|
80
|
+
},
|
81
|
+
];
|
82
|
+
(0, component_1.SmartComponent)({
|
83
|
+
data: {
|
84
|
+
items: items,
|
85
|
+
badgeItems: items.slice(0, 2).map(function (item, index) {
|
86
|
+
if (index === 0) {
|
87
|
+
return __assign(__assign({}, item), { dot: true });
|
88
|
+
}
|
89
|
+
if (index === 1) {
|
90
|
+
return __assign(__assign({}, item), { badge: 5 });
|
91
|
+
}
|
92
|
+
return item;
|
93
|
+
}),
|
94
|
+
mainActiveIndex: 0,
|
95
|
+
activeId: 0,
|
96
|
+
mainActiveIndexMulti: 0,
|
97
|
+
activeIdMulti: [],
|
98
|
+
},
|
99
|
+
methods: {
|
100
|
+
onClickNav: function (_a) {
|
101
|
+
var detail = _a.detail;
|
102
|
+
this.setData({
|
103
|
+
mainActiveIndex: detail.index || 0,
|
104
|
+
});
|
105
|
+
},
|
106
|
+
onClickItem: function (_a) {
|
107
|
+
var detail = _a.detail;
|
108
|
+
var activeId = this.data.activeId === detail.id ? null : detail.id;
|
109
|
+
this.setData({ activeId: activeId });
|
110
|
+
},
|
111
|
+
onClickNavMulti: function (_a) {
|
112
|
+
var detail = _a.detail;
|
113
|
+
this.setData({
|
114
|
+
mainActiveIndexMulti: detail.index || 0,
|
115
|
+
});
|
116
|
+
},
|
117
|
+
onClickItemMulti: function (_a) {
|
118
|
+
var detail = _a.detail;
|
119
|
+
var activeIdMulti = this.data.activeIdMulti;
|
120
|
+
var idx = activeIdMulti.indexOf(detail.id);
|
121
|
+
if (idx > -1) {
|
122
|
+
activeIdMulti.splice(idx, 1);
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
activeIdMulti.push(detail.id);
|
126
|
+
}
|
127
|
+
this.setData({ activeIdMulti: activeIdMulti });
|
128
|
+
},
|
129
|
+
},
|
130
|
+
});
|