@tuya-miniapp/smart-ui 2.9.0-beta-0 → 2.9.1-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.
@@ -1,6 +1,6 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { getMonthEndDay, compareDay, getPrevDay, getNextDay } from '../calendar-utils/utils';
3
- import ty from '../common/ty';
3
+ import tyApi from '../common/ty';
4
4
  SmartComponent({
5
5
  props: {
6
6
  date: {
@@ -57,7 +57,7 @@ SmartComponent({
57
57
  const item = this.data.days[index];
58
58
  if (item.type !== 'disabled') {
59
59
  this.$emit('click', item);
60
- ty.vibrateShort({ type: 'light' });
60
+ tyApi.vibrateShort({ type: 'light' });
61
61
  }
62
62
  },
63
63
  setDays() {
@@ -1,7 +1,7 @@
1
1
  // components/month-list.js
2
2
  import { getMonths } from '../calendar-utils/utils';
3
3
  import { SmartComponent } from '../common/component';
4
- import ty from '../common/ty';
4
+ import tyApi from '../common/ty';
5
5
  const currentYear = new Date().getFullYear();
6
6
  const minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
7
7
  const maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
@@ -98,7 +98,7 @@ SmartComponent({
98
98
  this.setData({
99
99
  date: item.value,
100
100
  });
101
- ty.vibrateShort({ type: 'light' });
101
+ tyApi.vibrateShort({ type: 'light' });
102
102
  }
103
103
  },
104
104
  },
@@ -1,7 +1,7 @@
1
1
  // components/month-list.js
2
2
  import { getYears } from '../calendar-utils/utils';
3
3
  import { SmartComponent } from '../common/component';
4
- import ty from '../common/ty';
4
+ import tyApi from '../common/ty';
5
5
  SmartComponent({
6
6
  /**
7
7
  * 组件的属性列表
@@ -108,7 +108,7 @@ SmartComponent({
108
108
  this.setData({
109
109
  date: item.value,
110
110
  });
111
- ty.vibrateShort({ type: 'light' });
111
+ tyApi.vibrateShort({ type: 'light' });
112
112
  }
113
113
  },
114
114
  },
package/dist/common/ty.js CHANGED
@@ -1,6 +1,10 @@
1
+ const systemInfo = wx.getSystemInfoSync();
2
+ const isIOS = systemInfo.platform === 'ios';
1
3
  const tyApi = {
2
4
  vibrateShort: (v) => {
3
5
  var _a, _b;
6
+ if (!isIOS)
7
+ return;
4
8
  // @ts-ignore
5
9
  if (typeof ty !== 'undefined') {
6
10
  // @ts-ignore
@@ -12,6 +16,8 @@ const tyApi = {
12
16
  },
13
17
  selectionVibrate: () => {
14
18
  var _a;
19
+ if (!isIOS)
20
+ return;
15
21
  // @ts-ignore
16
22
  if (typeof ty !== 'undefined') {
17
23
  // @ts-ignore
@@ -20,6 +26,8 @@ const tyApi = {
20
26
  },
21
27
  notificationVibrate: (v) => {
22
28
  var _a;
29
+ if (!isIOS)
30
+ return;
23
31
  // @ts-ignore
24
32
  if (typeof ty !== 'undefined') {
25
33
  // @ts-ignore
@@ -28,6 +36,8 @@ const tyApi = {
28
36
  },
29
37
  nativeDisabled: (v) => {
30
38
  var _a;
39
+ if (!isIOS)
40
+ return;
31
41
  // @ts-ignore
32
42
  if (typeof ty !== 'undefined') {
33
43
  // @ts-ignore
package/lib/common/ty.js CHANGED
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var systemInfo = wx.getSystemInfoSync();
4
+ var isIOS = systemInfo.platform === 'ios';
3
5
  var tyApi = {
4
6
  vibrateShort: function (v) {
5
7
  var _a, _b;
8
+ if (!isIOS)
9
+ return;
6
10
  // @ts-ignore
7
11
  if (typeof ty !== 'undefined') {
8
12
  // @ts-ignore
@@ -14,6 +18,8 @@ var tyApi = {
14
18
  },
15
19
  selectionVibrate: function () {
16
20
  var _a;
21
+ if (!isIOS)
22
+ return;
17
23
  // @ts-ignore
18
24
  if (typeof ty !== 'undefined') {
19
25
  // @ts-ignore
@@ -22,6 +28,8 @@ var tyApi = {
22
28
  },
23
29
  notificationVibrate: function (v) {
24
30
  var _a;
31
+ if (!isIOS)
32
+ return;
25
33
  // @ts-ignore
26
34
  if (typeof ty !== 'undefined') {
27
35
  // @ts-ignore
@@ -30,6 +38,8 @@ var tyApi = {
30
38
  },
31
39
  nativeDisabled: function (v) {
32
40
  var _a;
41
+ if (!isIOS)
42
+ return;
33
43
  // @ts-ignore
34
44
  if (typeof ty !== 'undefined') {
35
45
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.9.0-beta-0",
3
+ "version": "2.9.1-beta-0",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",