@tuya-miniapp/smart-ui 2.1.11-beta-9 → 2.1.11-beta-11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/dist/toast/toast.js +7 -5
  2. package/lib/datetime-picker/demo/index.js +12 -1
  3. package/lib/picker/demo/index.js +10 -0
  4. package/lib/toast/toast.js +7 -5
  5. package/package.json +3 -1
  6. package/dist/action-sheet/demo/index.d.ts +0 -1
  7. package/dist/action-sheet/demo/index.js +0 -110
  8. package/dist/area/demo/index.d.ts +0 -1
  9. package/dist/area/demo/index.js +0 -41
  10. package/dist/battery/demo/index.d.ts +0 -1
  11. package/dist/battery/demo/index.js +0 -2
  12. package/dist/bottom-sheet/demo/index.d.ts +0 -1
  13. package/dist/bottom-sheet/demo/index.js +0 -24
  14. package/dist/button/demo/index.d.ts +0 -1
  15. package/dist/button/demo/index.js +0 -9
  16. package/dist/calendar/demo/index.d.ts +0 -1
  17. package/dist/calendar/demo/index.js +0 -106
  18. package/dist/cascader/demo/index.d.ts +0 -1
  19. package/dist/cascader/demo/index.js +0 -191
  20. package/dist/cell/demo/index.d.ts +0 -1
  21. package/dist/cell/demo/index.js +0 -15
  22. package/dist/checkbox/demo/index.d.ts +0 -1
  23. package/dist/checkbox/demo/index.js +0 -34
  24. package/dist/circle/demo/index.d.ts +0 -1
  25. package/dist/circle/demo/index.js +0 -19
  26. package/dist/col/demo/index.d.ts +0 -1
  27. package/dist/col/demo/index.js +0 -4
  28. package/dist/collapse/demo/index.d.ts +0 -1
  29. package/dist/collapse/demo/index.js +0 -36
  30. package/dist/config-provider/demo/index.d.ts +0 -1
  31. package/dist/config-provider/demo/index.js +0 -22
  32. package/dist/count-down/demo/index.d.ts +0 -1
  33. package/dist/count-down/demo/index.js +0 -33
  34. package/dist/custom-keyboard/demo/index.d.ts +0 -1
  35. package/dist/custom-keyboard/demo/index.js +0 -17
  36. package/dist/datetime-picker/demo/index.d.ts +0 -1
  37. package/dist/datetime-picker/demo/index.js +0 -83
  38. package/dist/dialog/demo/index.d.ts +0 -1
  39. package/dist/dialog/demo/index.js +0 -134
  40. package/dist/divider/demo/index.d.ts +0 -1
  41. package/dist/divider/demo/index.js +0 -4
  42. package/dist/dropdown-menu/demo/index.d.ts +0 -1
  43. package/dist/dropdown-menu/demo/index.js +0 -47
  44. package/dist/empty/demo/index.d.ts +0 -1
  45. package/dist/empty/demo/index.js +0 -13
  46. package/dist/field/demo/index.d.ts +0 -1
  47. package/dist/field/demo/index.js +0 -20
  48. package/dist/goods-action/demo/index.d.ts +0 -1
  49. package/dist/goods-action/demo/index.js +0 -12
  50. package/dist/grid/demo/index.d.ts +0 -1
  51. package/dist/grid/demo/index.js +0 -9
  52. package/dist/icon/demo/index.d.ts +0 -1
  53. package/dist/icon/demo/index.js +0 -26
  54. package/dist/image/demo/index.d.ts +0 -1
  55. package/dist/image/demo/index.js +0 -15
  56. package/dist/index-bar/demo/index.d.ts +0 -1
  57. package/dist/index-bar/demo/index.js +0 -21
  58. package/dist/loading/demo/index.d.ts +0 -1
  59. package/dist/loading/demo/index.js +0 -4
  60. package/dist/nav-bar/demo/index.d.ts +0 -1
  61. package/dist/nav-bar/demo/index.js +0 -26
  62. package/dist/normal-slider/demo/index.d.ts +0 -1
  63. package/dist/normal-slider/demo/index.js +0 -19
  64. package/dist/notice-bar/demo/index.d.ts +0 -1
  65. package/dist/notice-bar/demo/index.js +0 -11
  66. package/dist/notify/demo/index.d.ts +0 -1
  67. package/dist/notify/demo/index.js +0 -45
  68. package/dist/overlay/demo/index.d.ts +0 -1
  69. package/dist/overlay/demo/index.js +0 -22
  70. package/dist/picker/demo/index.d.ts +0 -1
  71. package/dist/picker/demo/index.js +0 -77
  72. package/dist/popup/demo/index.d.ts +0 -1
  73. package/dist/popup/demo/index.js +0 -79
  74. package/dist/progress/demo/index.d.ts +0 -1
  75. package/dist/progress/demo/index.js +0 -4
  76. package/dist/radio/demo/index.d.ts +0 -1
  77. package/dist/radio/demo/index.js +0 -31
  78. package/dist/rate/demo/index.d.ts +0 -1
  79. package/dist/rate/demo/index.js +0 -25
  80. package/dist/search/demo/index.d.ts +0 -1
  81. package/dist/search/demo/index.js +0 -43
  82. package/dist/sidebar/demo/index.d.ts +0 -1
  83. package/dist/sidebar/demo/index.js +0 -9
  84. package/dist/skeleton/demo/index.d.ts +0 -1
  85. package/dist/skeleton/demo/index.js +0 -11
  86. package/dist/slider/demo/index.d.ts +0 -1
  87. package/dist/slider/demo/index.js +0 -19
  88. package/dist/stepper/demo/index.d.ts +0 -1
  89. package/dist/stepper/demo/index.js +0 -19
  90. package/dist/steps/demo/index.d.ts +0 -1
  91. package/dist/steps/demo/index.js +0 -43
  92. package/dist/sticky/demo/index.d.ts +0 -1
  93. package/dist/sticky/demo/index.js +0 -26
  94. package/dist/swipe-cell/demo/index.d.ts +0 -1
  95. package/dist/swipe-cell/demo/index.js +0 -45
  96. package/dist/switch/demo/index.d.ts +0 -1
  97. package/dist/switch/demo/index.js +0 -29
  98. package/dist/tab/demo/index.d.ts +0 -1
  99. package/dist/tab/demo/index.js +0 -55
  100. package/dist/tabbar/demo/index.d.ts +0 -1
  101. package/dist/tabbar/demo/index.js +0 -34
  102. package/dist/tag/demo/index.d.ts +0 -1
  103. package/dist/tag/demo/index.js +0 -16
  104. package/dist/toast/demo/index.d.ts +0 -1
  105. package/dist/toast/demo/index.js +0 -67
  106. package/dist/transition/demo/index.d.ts +0 -1
  107. package/dist/transition/demo/index.js +0 -67
  108. package/dist/tree-select/demo/index.d.ts +0 -1
  109. package/dist/tree-select/demo/index.js +0 -113
@@ -13,7 +13,9 @@ const defaultOptions = {
13
13
  selector: '#smart-toast',
14
14
  width: '',
15
15
  };
16
- let queue = [];
16
+ const queueRef = {
17
+ value: [],
18
+ };
17
19
  // @ts-expect-error
18
20
  let currentOptions = Object.assign({}, defaultOptions);
19
21
  function parseOptions(message) {
@@ -40,13 +42,13 @@ function Toast(toastOptions) {
40
42
  options.onClose();
41
43
  }
42
44
  };
43
- queue.push(toast);
45
+ queueRef.value.push(toast);
44
46
  toast.setData(options);
45
47
  clearTimeout(toast.timer);
46
48
  if (options.duration != null && options.duration > 0) {
47
49
  toast.timer = setTimeout(() => {
48
50
  toast.clear();
49
- queue = queue.filter(item => item !== toast);
51
+ queueRef.value = queueRef.value.filter(item => item !== toast);
50
52
  }, options.duration);
51
53
  }
52
54
  return toast;
@@ -57,10 +59,10 @@ Toast.success = createMethod('success');
57
59
  Toast.fail = createMethod('fail');
58
60
  Toast.warn = createMethod('warn');
59
61
  Toast.clear = () => {
60
- queue.forEach(toast => {
62
+ queueRef.value.forEach(toast => {
61
63
  toast.clear();
62
64
  });
63
- queue = [];
65
+ queueRef.value = [];
64
66
  };
65
67
  Toast.setDefaultOptions = (options) => {
66
68
  Object.assign(currentOptions, options);
@@ -9,7 +9,7 @@ var toast_1 = __importDefault(require("../../toast/toast"));
9
9
  data: {
10
10
  minHour: 10,
11
11
  maxHour: 20,
12
- columnsOrder: [2, 1, 1],
12
+ columnsOrder: [3, 2, 1],
13
13
  minDate: new Date(2018, 0, 1).getTime(),
14
14
  maxDate: new Date(2019, 10, 1).getTime(),
15
15
  currentDate1: new Date(2018, 2, 31).getTime(),
@@ -69,6 +69,17 @@ var toast_1 = __importDefault(require("../../toast/toast"));
69
69
  message: result,
70
70
  });
71
71
  },
72
+ onInputChange: function (event) {
73
+ var detail = event.detail, currentTarget = event.currentTarget;
74
+ this.setData({
75
+ currentDate5: detail
76
+ });
77
+ var result = this.getResult(detail, currentTarget.dataset.type);
78
+ (0, toast_1.default)({
79
+ context: this,
80
+ message: result,
81
+ });
82
+ },
72
83
  getResult: function (time, type) {
73
84
  var date = new Date(time);
74
85
  switch (type) {
@@ -47,6 +47,16 @@ var toast_1 = __importDefault(require("../../toast/toast"));
47
47
  unit: 'Kg',
48
48
  },
49
49
  ],
50
+ column6: [
51
+ {
52
+ values: [I18n.t('zhejiang'), I18n.t('fujian')],
53
+ order: 2
54
+ },
55
+ {
56
+ values: [I18n.t('hangzhou'), I18n.t('ningbo'), I18n.t('wenzhou'), I18n.t('jiaxing'), I18n.t('huzhou')],
57
+ order: 1
58
+ },
59
+ ],
50
60
  },
51
61
  methods: {
52
62
  onChange1: function (event) {
@@ -27,7 +27,9 @@ var defaultOptions = {
27
27
  selector: '#smart-toast',
28
28
  width: '',
29
29
  };
30
- var queue = [];
30
+ var queueRef = {
31
+ value: [],
32
+ };
31
33
  // @ts-expect-error
32
34
  var currentOptions = __assign({}, defaultOptions);
33
35
  function parseOptions(message) {
@@ -54,13 +56,13 @@ function Toast(toastOptions) {
54
56
  options.onClose();
55
57
  }
56
58
  };
57
- queue.push(toast);
59
+ queueRef.value.push(toast);
58
60
  toast.setData(options);
59
61
  clearTimeout(toast.timer);
60
62
  if (options.duration != null && options.duration > 0) {
61
63
  toast.timer = setTimeout(function () {
62
64
  toast.clear();
63
- queue = queue.filter(function (item) { return item !== toast; });
65
+ queueRef.value = queueRef.value.filter(function (item) { return item !== toast; });
64
66
  }, options.duration);
65
67
  }
66
68
  return toast;
@@ -73,10 +75,10 @@ Toast.success = createMethod('success');
73
75
  Toast.fail = createMethod('fail');
74
76
  Toast.warn = createMethod('warn');
75
77
  Toast.clear = function () {
76
- queue.forEach(function (toast) {
78
+ queueRef.value.forEach(function (toast) {
77
79
  toast.clear();
78
80
  });
79
- queue = [];
81
+ queueRef.value = [];
80
82
  };
81
83
  Toast.setDefaultOptions = function (options) {
82
84
  Object.assign(currentOptions, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.1.11-beta-9",
3
+ "version": "2.1.11-beta-11",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",
@@ -21,6 +21,8 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
+ "!dist/**/demo/",
25
+ "!lib/**/demo/",
24
26
  "lib"
25
27
  ],
26
28
  "husky": {
@@ -1 +0,0 @@
1
- export {};
@@ -1,110 +0,0 @@
1
- import { SmartComponent } from '../../common/component';
2
- SmartComponent({
3
- data: {
4
- show1: false,
5
- show2: false,
6
- show3: false,
7
- show4: false,
8
- show5: false,
9
- showSelect: false,
10
- showSelect2: false,
11
- showNumber: false,
12
- showPicker: false,
13
- isReady: false,
14
- action1: [{ name: 'Action' }, { name: 'Action' }, { name: 'Action' }],
15
- action2: [
16
- { name: I18n.t('coloringOptions'), color: '#ee0a24' },
17
- { loading: true },
18
- { name: I18n.t('disableOption'), disabled: true },
19
- ],
20
- actionSelect: [
21
- { id: 0, name: 'Action', checked: true },
22
- { id: 1, name: 'Action', checked: false },
23
- { id: 2, name: 'Action', checked: false },
24
- { id: 3, name: 'Action', checked: false },
25
- { id: 4, name: 'Action', checked: false },
26
- { id: 5, name: 'Action', checked: false },
27
- { id: 6, name: 'Action', checked: false },
28
- { id: 7, name: 'Action', checked: false },
29
- ],
30
- currentNumber: 0,
31
- currentDate: new Date(2018, 0, 1),
32
- currentDateStr: new Date(2018, 0, 1).toLocaleDateString(),
33
- minDate: new Date(2018, 0, 1).getTime(),
34
- formatter(type, value) {
35
- if (type === 'year') {
36
- return `${value}${I18n.t('year')}`;
37
- }
38
- if (type === 'month') {
39
- return `${value}${I18n.t('month')}`;
40
- }
41
- return value;
42
- },
43
- },
44
- methods: {
45
- toggle(type) {
46
- this.setData({
47
- [type]: !this.data[type],
48
- });
49
- },
50
- toggleActionSheet1() {
51
- this.toggle('show1');
52
- },
53
- toggleActionSheet2() {
54
- this.toggle('show2');
55
- },
56
- toggleActionSheet3() {
57
- this.toggle('show3');
58
- },
59
- toggleActionSheet4() {
60
- this.toggle('show4');
61
- },
62
- toggleActionSheet5() {
63
- this.toggle('show5');
64
- },
65
- toggleActionSheet6() {
66
- this.toggle('show6');
67
- },
68
- toggleActionSheetSelect() {
69
- this.toggle('showSelect');
70
- },
71
- toggleActionSheetSelect2() {
72
- this.toggle('showSelect2');
73
- },
74
- toggleActionSheetNumber() {
75
- this.toggle('showNumber');
76
- },
77
- toggleActionSheetPicker() {
78
- this.toggle('showPicker');
79
- },
80
- onAfterEnter() {
81
- this.setData({ isReady: true });
82
- },
83
- onChange(event) {
84
- this.setData({ currentNumber: event.detail.value });
85
- },
86
- onSelect(evt) {
87
- const { id } = evt.detail;
88
- const newActionSelect = this.data.actionSelect.map((item) => {
89
- if (item.id === id)
90
- return Object.assign(Object.assign({}, item), { checked: true });
91
- return Object.assign(Object.assign({}, item), { checked: false });
92
- });
93
- this.setData({
94
- actionSelect: newActionSelect,
95
- });
96
- },
97
- onInput(event) {
98
- const { detail } = event;
99
- const date = new Date(detail);
100
- this.setData({ currentDate: date });
101
- },
102
- onPickerConfirm() {
103
- var _a, _b;
104
- this.setData({
105
- showPicker: false,
106
- currentDateStr: (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.currentDate) === null || _b === void 0 ? void 0 : _b.toLocaleDateString(),
107
- });
108
- },
109
- },
110
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
1
- var _a;
2
- import { SmartComponent } from '../../common/component';
3
- import Toast from '../../toast/toast';
4
- const db = (_a = wx.cloud) === null || _a === void 0 ? void 0 : _a.database();
5
- SmartComponent({
6
- data: {
7
- areaList: {},
8
- loading: true,
9
- value: 330302,
10
- },
11
- mounted() {
12
- db === null || db === void 0 ? void 0 : db.collection('region').limit(1).get().then((res) => {
13
- if (res.data && res.data.length > 0) {
14
- this.setData({
15
- loading: false,
16
- areaList: res.data[0],
17
- });
18
- }
19
- }).catch((err) => {
20
- console.log(err);
21
- this.setData({
22
- loading: false,
23
- });
24
- });
25
- },
26
- methods: {
27
- onChange(event) {
28
- const { values } = event.detail;
29
- Toast({
30
- context: this,
31
- message: values.map((item) => item.name).join('-'),
32
- });
33
- },
34
- onConfirm(event) {
35
- console.log(event);
36
- },
37
- onCancel(event) {
38
- console.log(event);
39
- },
40
- },
41
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { SmartComponent } from '../../common/component';
2
- SmartComponent({});
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { SmartComponent } from '../../common/component';
2
- SmartComponent({
3
- data: {
4
- show1: false,
5
- show2: false,
6
- show3: false,
7
- },
8
- methods: {
9
- toggle(type) {
10
- this.setData({
11
- [type]: !this.data[type],
12
- });
13
- },
14
- toggleActionSheet1() {
15
- this.toggle('show1');
16
- },
17
- toggleActionSheet2() {
18
- this.toggle('show2');
19
- },
20
- toggleActionSheet3() {
21
- this.toggle('show3');
22
- },
23
- },
24
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import iconAdd from '@tuya-miniapp/icons/dist/svg/PlusCircle';
2
- import iconRight from '@tuya-miniapp/icons/dist/svg/Right';
3
- import { SmartComponent } from '../../common/component';
4
- SmartComponent({
5
- data: {
6
- iconAdd,
7
- iconRight,
8
- },
9
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,106 +0,0 @@
1
- import { SmartComponent } from '../../common/component';
2
- SmartComponent({
3
- data: {
4
- // day
5
- curDayDate: new Date(2024, 0, 15).getTime(),
6
- minDayDate: new Date(2024, 0, 4).getTime(),
7
- maxDayDate: new Date(2024, 1, 20).getTime(),
8
- // weekday
9
- curWeekDayDate: [
10
- new Date(2024, 0, 15).getTime(),
11
- new Date(2024, 0, 21).getTime(),
12
- ],
13
- minWeekDayDate: new Date(2024, 0, 4).getTime(),
14
- maxWeekDayDate: new Date(2024, 1, 20).getTime(),
15
- // range
16
- curRangeDayDate: [
17
- new Date(2024, 0, 10).getTime(),
18
- new Date(2024, 0, 20).getTime(),
19
- ],
20
- minRangeDayDate: new Date(2024, 0, 4).getTime(),
21
- maxRangeDayDate: new Date(2024, 1, 20).getTime(),
22
- // month
23
- curMonthDate: new Date(2024, 6, 1).getTime(),
24
- minMonthDate: new Date(2024, 2, 1).getTime(),
25
- maxMonthDate: new Date(2025, 9, 31).getTime(),
26
- // year
27
- curYearDate: new Date(2017, 6, 1).getTime(),
28
- minYearDate: new Date(2012, 0, 1).getTime(),
29
- maxYearDate: new Date(2029, 10, 31).getTime(),
30
- // locale
31
- confirmText: I18n.t('confirm'),
32
- confirmDisabledText: I18n.t('confirm'),
33
- firstDayOfWeek: 0,
34
- locale: {
35
- shortWeekDays: [
36
- I18n.t('week0'),
37
- I18n.t('week1'),
38
- I18n.t('week2'),
39
- I18n.t('week3'),
40
- I18n.t('week4'),
41
- I18n.t('week5'),
42
- I18n.t('week6'),
43
- ],
44
- subFormatter: 'YYYY' + I18n.t('year') + 'MM' + I18n.t('month'),
45
- },
46
- locale2: {
47
- subFormatter: 'YYYY' + I18n.t('year'),
48
- monthsFormatter: [
49
- I18n.t('cal_Jan'),
50
- I18n.t('cal_Feb'),
51
- I18n.t('cal_Mar'),
52
- I18n.t('cal_Apr'),
53
- I18n.t('cal_May'),
54
- I18n.t('cal_Jun'),
55
- I18n.t('cal_Jul'),
56
- I18n.t('cal_Aug'),
57
- I18n.t('cal_Sept'),
58
- I18n.t('cal_Oct'),
59
- I18n.t('cal_Nov'),
60
- I18n.t('cal_Dec')
61
- ]
62
- },
63
- showDayPicker: false,
64
- dayClassMap: {
65
- '2024-01-17': "calendar-disabled"
66
- }
67
- },
68
- methods: {
69
- setCurDay(event) {
70
- const date = event.detail;
71
- this.setData({
72
- curDayDate: new Date(date).getTime(),
73
- showDayPicker: false,
74
- });
75
- },
76
- setWeekCurDay(event) {
77
- const date = event.detail;
78
- this.setData({
79
- curWeekDayDate: [date[0], date[1]],
80
- });
81
- },
82
- setRangeCurDay(event) {
83
- const date = event.detail;
84
- this.setData({
85
- curRangeDayDate: [date[0], date[1]],
86
- });
87
- },
88
- setCurMonth(event) {
89
- const date = event.detail;
90
- this.setData({
91
- curMonthDate: date,
92
- });
93
- },
94
- setCurYear(event) {
95
- const date = event.detail;
96
- this.setData({
97
- curYearDate: date,
98
- });
99
- },
100
- onShowDayPicker() {
101
- this.setData({
102
- showDayPicker: !this.data.showDayPicker,
103
- });
104
- },
105
- },
106
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,191 +0,0 @@
1
- import { SmartComponent } from '../../common/component';
2
- const zhCNOptions = [
3
- {
4
- text: I18n.t('zhejiangProvince'),
5
- value: '330000',
6
- options: [
7
- {
8
- text: I18n.t('hangzhou'),
9
- value: '330100',
10
- options: [
11
- {
12
- text: I18n.t('upperCityDistrict'),
13
- value: '330102',
14
- },
15
- {
16
- text: I18n.t('downtownDistrict'),
17
- value: '330103',
18
- },
19
- {
20
- text: I18n.t('jiangganDistrict'),
21
- value: '330104',
22
- },
23
- ],
24
- },
25
- {
26
- text: I18n.t('ningboCity'),
27
- value: '330200',
28
- options: [
29
- {
30
- text: I18n.t('haishuDistrict'),
31
- value: '330203',
32
- },
33
- {
34
- text: I18n.t('jiangbeiDistrict'),
35
- value: '330205',
36
- },
37
- {
38
- text: I18n.t('beilunDistrict'),
39
- value: '330206',
40
- },
41
- ],
42
- },
43
- {
44
- text: I18n.t('wenzhou'),
45
- value: '330300',
46
- options: [
47
- {
48
- text: I18n.t('luchengDistrict'),
49
- value: '330302',
50
- },
51
- {
52
- text: I18n.t('longwanDistrict'),
53
- value: '330303',
54
- },
55
- {
56
- text: I18n.t('ouhaiDistrict'),
57
- value: '330304',
58
- },
59
- ],
60
- },
61
- ],
62
- },
63
- {
64
- text: I18n.t('jiangsuProvince'),
65
- value: '320000',
66
- options: [
67
- {
68
- text: I18n.t('nanjing'),
69
- value: '320100',
70
- options: [
71
- {
72
- text: I18n.t('xuanwuDistrict'),
73
- value: '320102',
74
- },
75
- {
76
- text: I18n.t('qinhuaiDistrict'),
77
- value: '320104',
78
- },
79
- {
80
- text: I18n.t('jianyeDistrict'),
81
- value: '320105',
82
- },
83
- ],
84
- },
85
- {
86
- text: I18n.t('wuxi'),
87
- value: '320200',
88
- options: [
89
- {
90
- text: I18n.t('xishanDistrict'),
91
- value: '320205',
92
- },
93
- {
94
- text: I18n.t('huishanDistrict'),
95
- value: '320206',
96
- },
97
- {
98
- text: I18n.t('binhuDistrict'),
99
- value: '320211',
100
- },
101
- ],
102
- },
103
- {
104
- text: I18n.t('xuzhou'),
105
- value: '320300',
106
- options: [
107
- {
108
- text: I18n.t('gulouDistrict'),
109
- value: '320302',
110
- },
111
- {
112
- text: I18n.t('yunlongDistrict'),
113
- value: '320303',
114
- },
115
- {
116
- text: I18n.t('jiawangDistrict'),
117
- value: '320305',
118
- },
119
- ],
120
- },
121
- ],
122
- },
123
- ];
124
- const asyncOptions1 = [
125
- {
126
- text: I18n.t('zhejiangProvince'),
127
- value: '330000',
128
- options: [],
129
- },
130
- ];
131
- const asyncOptions2 = [
132
- { text: I18n.t('hangzhou'), value: '330100' },
133
- { text: I18n.t('ningboCity'), value: '330200' },
134
- ];
135
- SmartComponent({
136
- data: {
137
- area: I18n.t('region'),
138
- options: zhCNOptions,
139
- selectArea: I18n.t('pleaseSelectARegion'),
140
- baseState: {
141
- show: false,
142
- value: '',
143
- result: '',
144
- },
145
- asyncState: {
146
- show: false,
147
- value: undefined,
148
- result: '',
149
- options: asyncOptions1,
150
- },
151
- customFieldState: {
152
- show: false,
153
- value: '',
154
- result: '',
155
- },
156
- },
157
- methods: {
158
- onClick(e) {
159
- const { stateKey } = e.currentTarget.dataset;
160
- this.setData({
161
- [`${stateKey}.show`]: true,
162
- });
163
- },
164
- onClose(e) {
165
- const { stateKey } = e.currentTarget.dataset;
166
- this.setData({
167
- [`${stateKey}.show`]: false,
168
- });
169
- },
170
- onFinish(e) {
171
- const { stateKey } = e.currentTarget.dataset;
172
- const { selectedOptions, value } = e.detail;
173
- const result = selectedOptions.map((option) => option.text).join('/');
174
- this.setData({
175
- [`${stateKey}.value`]: value,
176
- [`${stateKey}.result`]: result,
177
- });
178
- this.onClose(e);
179
- },
180
- loadDynamicOptions(e) {
181
- const { value } = e.detail;
182
- if (value === '330000') {
183
- setTimeout(() => {
184
- this.setData({
185
- 'asyncState.options[0].options': asyncOptions2,
186
- });
187
- }, 500);
188
- }
189
- },
190
- },
191
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import Sun from '@tuya-miniapp/icons/dist/svg/Sun';
2
- import Checkmark from '@tuya-miniapp/icons/dist/svg/Checkmark';
3
- import { SmartComponent } from '../../common/component';
4
- SmartComponent({
5
- data: {
6
- sunMaxFill: Sun,
7
- checkMark: Checkmark,
8
- },
9
- methods: {
10
- onNavTo() {
11
- // @ts-ignore
12
- ty.openInnerH5({ url: 'https://www.tuya.com', title: 'Tuya' });
13
- },
14
- },
15
- });
@@ -1 +0,0 @@
1
- export {};