@tuya-miniapp/smart-ui 2.3.0-beta-6 → 2.3.0-beta-8

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.
@@ -36,7 +36,7 @@ export const contextRef = {
36
36
  };
37
37
  const Dialog = (options) => {
38
38
  options = Object.assign(Object.assign({}, currentOptions), options);
39
- return new Promise((resolve, reject) => {
39
+ const prom = new Promise((resolve, reject) => {
40
40
  appLog.info('start open dialog');
41
41
  const context = (typeof options.context === 'function' ? options.context() : options.context) ||
42
42
  contextRef.value[options.selector] ||
@@ -79,6 +79,11 @@ const Dialog = (options) => {
79
79
  appLog.info(`未找到 ${(selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', '')} 节点,请确认 selector 及 context 是否正确`);
80
80
  }
81
81
  });
82
+ prom.catch(err => {
83
+ appLog.info(`Dialog promise Error`, err);
84
+ console.log(err, '---Dialog-error');
85
+ });
86
+ return prom;
82
87
  };
83
88
  Dialog.alert = (options) => Dialog(options);
84
89
  Dialog.confirm = (options) => Dialog(Object.assign({ showCancelButton: true }, options));
@@ -40,7 +40,7 @@ export function transition(showDefaultValue) {
40
40
  },
41
41
  methods: {
42
42
  observeShow(value, old) {
43
- appLog.info(`transition component observeShow value: ${value};old: ${value}`);
43
+ appLog.info(`transition component observeShow value: ${value};old: ${old}`);
44
44
  if (value === old) {
45
45
  return;
46
46
  }
@@ -83,7 +83,7 @@ export function transition(showDefaultValue) {
83
83
  });
84
84
  this.enterFinishedPromise.catch(err => {
85
85
  this.enterFinishedPromise = null;
86
- appLog.info(err);
86
+ appLog.info(`enter enterFinishedPromise catch`, err);
87
87
  console.log(err, '---error-enter');
88
88
  });
89
89
  },
@@ -127,7 +127,8 @@ export function transition(showDefaultValue) {
127
127
  })
128
128
  .catch(err => {
129
129
  this.enterFinishedPromise = null;
130
- console.log(err, '---error-leave');
130
+ appLog.info(`leave enterFinishedPromise catch`, err);
131
+ console.log(err, '---error-enter');
131
132
  });
132
133
  },
133
134
  onTransitionEnd() {
@@ -53,7 +53,7 @@ exports.contextRef = {
53
53
  };
54
54
  var Dialog = function (options) {
55
55
  options = __assign(__assign({}, currentOptions), options);
56
- return new Promise(function (resolve, reject) {
56
+ var prom = new Promise(function (resolve, reject) {
57
57
  appLog_1.default.info('start open dialog');
58
58
  var context = (typeof options.context === 'function' ? options.context() : options.context) ||
59
59
  exports.contextRef.value[options.selector] ||
@@ -96,6 +96,11 @@ var Dialog = function (options) {
96
96
  appLog_1.default.info("\u672A\u627E\u5230 ".concat((selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', ''), " \u8282\u70B9\uFF0C\u8BF7\u786E\u8BA4 selector \u53CA context \u662F\u5426\u6B63\u786E"));
97
97
  }
98
98
  });
99
+ prom.catch(function (err) {
100
+ appLog_1.default.info("Dialog promise Error", err);
101
+ console.log(err, '---Dialog-error');
102
+ });
103
+ return prom;
99
104
  };
100
105
  Dialog.alert = function (options) { return Dialog(options); };
101
106
  Dialog.confirm = function (options) {
@@ -46,7 +46,7 @@ function transition(showDefaultValue) {
46
46
  },
47
47
  methods: {
48
48
  observeShow: function (value, old) {
49
- appLog_1.default.info("transition component observeShow value: ".concat(value, ";old: ").concat(value));
49
+ appLog_1.default.info("transition component observeShow value: ".concat(value, ";old: ").concat(old));
50
50
  if (value === old) {
51
51
  return;
52
52
  }
@@ -90,7 +90,7 @@ function transition(showDefaultValue) {
90
90
  });
91
91
  this.enterFinishedPromise.catch(function (err) {
92
92
  _this.enterFinishedPromise = null;
93
- appLog_1.default.info(err);
93
+ appLog_1.default.info("enter enterFinishedPromise catch", err);
94
94
  console.log(err, '---error-enter');
95
95
  });
96
96
  },
@@ -135,7 +135,8 @@ function transition(showDefaultValue) {
135
135
  })
136
136
  .catch(function (err) {
137
137
  _this.enterFinishedPromise = null;
138
- console.log(err, '---error-leave');
138
+ appLog_1.default.info("leave enterFinishedPromise catch", err);
139
+ console.log(err, '---error-enter');
139
140
  });
140
141
  },
141
142
  onTransitionEnd: function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.3.0-beta-6",
3
+ "version": "2.3.0-beta-8",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",