@cloudbase/weda-ui-mp 3.18.8 → 3.19.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.
|
@@ -138,6 +138,10 @@ Component({
|
|
|
138
138
|
type: Array,
|
|
139
139
|
value: [],
|
|
140
140
|
},
|
|
141
|
+
duration: {
|
|
142
|
+
type: Number,
|
|
143
|
+
value: 2000,
|
|
144
|
+
},
|
|
141
145
|
},
|
|
142
146
|
lifetimes: {
|
|
143
147
|
attached() {
|
|
@@ -153,7 +157,7 @@ Component({
|
|
|
153
157
|
},
|
|
154
158
|
clickLotteryButton: function (_, force) {
|
|
155
159
|
const { lotteryList } = this.data;
|
|
156
|
-
const { prizeResult, enablePrize, clickLotteryEnable } = this.properties;
|
|
160
|
+
const { prizeResult, enablePrize, clickLotteryEnable, duration } = this.properties;
|
|
157
161
|
//触发外部事件
|
|
158
162
|
this.triggerEvent('clickLotteryButton', {});
|
|
159
163
|
|
|
@@ -178,10 +182,7 @@ Component({
|
|
|
178
182
|
let intervalId = setInterval(() => {
|
|
179
183
|
//再次获取抽奖结果
|
|
180
184
|
let prizeResultNew = this.properties.prizeResult;
|
|
181
|
-
if (
|
|
182
|
-
prizeResultNew == null ||
|
|
183
|
-
(!this.properties.enablePrize && !force)
|
|
184
|
-
) {
|
|
185
|
+
if (prizeResultNew == null || (!this.properties.enablePrize && !force)) {
|
|
185
186
|
//如果是禁止,立马停止
|
|
186
187
|
clearInterval();
|
|
187
188
|
this.setData({
|
|
@@ -261,7 +262,7 @@ Component({
|
|
|
261
262
|
// eslint-disable-next-line rulesdir/no-timer
|
|
262
263
|
setTimeout(() => {
|
|
263
264
|
isTimeout = true;
|
|
264
|
-
},
|
|
265
|
+
}, duration);
|
|
265
266
|
},
|
|
266
267
|
},
|
|
267
268
|
observers: {
|
|
@@ -293,7 +294,7 @@ Component({
|
|
|
293
294
|
list.map(async (item) => {
|
|
294
295
|
const src = await getTempFileURL(item.src);
|
|
295
296
|
return { ...item, src };
|
|
296
|
-
})
|
|
297
|
+
}),
|
|
297
298
|
);
|
|
298
299
|
this.setData({
|
|
299
300
|
lotteryList: realList,
|
|
@@ -26,6 +26,7 @@ Component({
|
|
|
26
26
|
placeholderCls: `${WD_PREFIX}-form-input-wrap__placeholder weui-input__placeholder`,
|
|
27
27
|
_size: 'md',
|
|
28
28
|
_focus: false,
|
|
29
|
+
isiOS: false,
|
|
29
30
|
},
|
|
30
31
|
methods: {
|
|
31
32
|
handleChange: function (e) {
|
|
@@ -98,6 +99,8 @@ Component({
|
|
|
98
99
|
attached: function () {
|
|
99
100
|
this.init();
|
|
100
101
|
this.updateWidgetAPI();
|
|
102
|
+
const isiOS = wx.getSystemInfoSync().system.includes('iOS');
|
|
103
|
+
this.setData({ isiOS });
|
|
101
104
|
},
|
|
102
105
|
},
|
|
103
106
|
});
|
|
@@ -22,7 +22,19 @@
|
|
|
22
22
|
borderedH5="{{borderedH5}}"
|
|
23
23
|
>
|
|
24
24
|
<view class="{{cls}}" wx:if="{{!readOnly}}">
|
|
25
|
-
|
|
25
|
+
<block wx:if="{{autoHeight}}" >
|
|
26
|
+
<view class="wd-textarea__content">
|
|
27
|
+
<textarea class="wd-textarea__content_input" placeholder-class="{{placeholderCls}}" auto-focus="{{focus}}" cursor-spacing="{{cursorSpacing}}" focus="{{focus}}" placeholder="{{placeholder}}" value="{{value}}" disabled="{{disabled}}" maxlength="{{maxLength}}" bind:input="handleChange" bind:focus="handleFocus" bind:blur="handleBlur" bindconfirm="handleConfirm"></textarea>
|
|
28
|
+
<text class="wd-textarea__content_text">
|
|
29
|
+
{{value}}</text>
|
|
30
|
+
</view>
|
|
31
|
+
</block>
|
|
32
|
+
<block wx:else>
|
|
33
|
+
<textarea class="{{isiOS?'wd-textarea__ios':''}}" placeholder-class="{{placeholderCls}}" auto-focus="{{focus}}" auto-height="{{autoHeight}}" cursor-spacing="{{cursorSpacing}}" focus="{{focus}}" placeholder="{{placeholder}}" value="{{value}}" disabled="{{disabled}}" maxlength="{{maxLength}}" bind:input="handleChange" bind:focus="handleFocus" bind:blur="handleBlur" bindconfirm="handleConfirm"></textarea>
|
|
34
|
+
</block>
|
|
35
|
+
</view>
|
|
36
|
+
<view>
|
|
37
|
+
|
|
26
38
|
<block wx:if="{{counterVisible}}">
|
|
27
39
|
<label class="{{countCls}}">{{counter}}/{{maxLength}}</label>
|
|
28
40
|
</block>
|
|
@@ -53,19 +53,9 @@ Component({
|
|
|
53
53
|
},
|
|
54
54
|
methods: {
|
|
55
55
|
async getPhoneNumber(e) {
|
|
56
|
-
if (
|
|
57
|
-
e?.detail
|
|
58
|
-
e?.detail
|
|
59
|
-
!e?.detail?.code
|
|
60
|
-
) {
|
|
61
|
-
console.warn(
|
|
62
|
-
'获取手机号失败:',
|
|
63
|
-
e?.detail || { errMsg: '可能基础库版本过低' }
|
|
64
|
-
);
|
|
65
|
-
this.triggerEvent(
|
|
66
|
-
'phonefail',
|
|
67
|
-
e?.detail || { errMsg: '获取手机号失败,可能基础库版本过低' }
|
|
68
|
-
);
|
|
56
|
+
if (e?.detail?.errMsg?.includes('fail') || e?.detail?.errno || !e?.detail?.code) {
|
|
57
|
+
console.warn('获取手机号失败:', e?.detail || { errMsg: '可能基础库版本过低' });
|
|
58
|
+
this.triggerEvent('phonefail', e?.detail || { errMsg: '获取手机号失败,可能基础库版本过低' });
|
|
69
59
|
return;
|
|
70
60
|
}
|
|
71
61
|
const res = await callWedaApi({
|
|
@@ -75,6 +65,7 @@ Component({
|
|
|
75
65
|
Method: 'InvokeComponentWxData',
|
|
76
66
|
ReqBody: JSON.stringify({ code: e?.detail?.code }),
|
|
77
67
|
},
|
|
68
|
+
wxAppId: wx.getAccountInfoSync()?.miniProgram?.appId,
|
|
78
69
|
});
|
|
79
70
|
if (!res?.Data) {
|
|
80
71
|
this.triggerEvent('phonefail', { errMsg: '获取手机号失败' });
|