Skip to content

Commit 76f95e7

Browse files
张寸起7insummer
authored andcommitted
feat:修改count-select组件层级问题
1 parent 147245b commit 76f95e7

File tree

27 files changed

+117
-48
lines changed

27 files changed

+117
-48
lines changed

dist/count-selector/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Component({
2929
* 组件的初始数据
3030
*/
3131
data: {
32-
32+
focus: false
3333
},
3434

3535
/**
@@ -44,7 +44,16 @@ Component({
4444
});
4545
},
4646

47+
onCount() {
48+
this.setData({
49+
focus: true
50+
});
51+
},
52+
4753
onBlur(e) {
54+
this.setData({
55+
focus: false
56+
});
4857
let {
4958
value
5059
} = e.detail;

dist/count-selector/index.wxml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
data-type="reduce">
55
<text>-</text>
66
</view>
7-
<input class="l-count-class count"
7+
<input wx:if="{{focus}}"
8+
class="l-count-class count"
89
disabled="{{disabled}}"
9-
type="number"
10+
type="number"
11+
focus="{{focus}}"
1012
value="{{count}}"
1113
bindblur="onBlur"></input>
14+
<view wx:else class="l-count-class count" bindtap="onCount">{{count}}</view>
1215
<view class="l-symbol-class symbol {{count>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
1316
catchtap="{{count>=max|| disabled?'doNothing':'addTap'}}"
1417
data-type="reduce">

dist/count-selector/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}
1+
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}

dist/loading/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Component({
3737
this._init();
3838
},
3939

40+
pageLifetimes: {
41+
show() {
42+
this._init();
43+
},
44+
},
45+
4046
methods: {
4147
_init() {
4248
wx.lin = wx.lin || {};

dist/loadmore/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Component({
3434
this._init();
3535
},
3636

37+
pageLifetimes: {
38+
show() {
39+
this._init();
40+
},
41+
},
42+
3743
methods: {
3844
_init() {
3945
wx.lin = wx.lin || {};

dist/mask/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ Component({
5656
*/
5757
methods: {
5858
// 阻止滑动
59-
doNothingMove(e) {
59+
doNothingMove() {
6060
// do nothing……
6161
},
6262

6363
// 点击事件
64-
onMaskTap(e) {
64+
onMaskTap() {
6565

6666
let detail = true;
6767
let option = { bubbles: true, composed: true };
@@ -70,7 +70,7 @@ Component({
7070
this.setData({
7171
// fullScreen: 'hide',
7272
show: false,
73-
})
73+
});
7474
}
7575
this.triggerEvent('lintap', detail, option);
7676
}
@@ -80,4 +80,4 @@ Component({
8080
},
8181

8282

83-
})
83+
});

dist/mask/index.wxml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!-- mask.wxml -->
32
<view
43
class="container-mask {{center? 'center' : ''}}"

dist/popup/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Component({
3535
attached() {
3636
this._init();
3737
},
38+
39+
pageLifetimes: {
40+
show() {
41+
this._init();
42+
},
43+
},
3844
/**
3945
* 组件的初始数据
4046
*/

examples/dist/count-selector/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Component({
2929
* 组件的初始数据
3030
*/
3131
data: {
32-
32+
focus: false
3333
},
3434

3535
/**
@@ -44,7 +44,16 @@ Component({
4444
});
4545
},
4646

47+
onCount() {
48+
this.setData({
49+
focus: true
50+
});
51+
},
52+
4753
onBlur(e) {
54+
this.setData({
55+
focus: false
56+
});
4857
let {
4958
value
5059
} = e.detail;

examples/dist/count-selector/index.wxml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
data-type="reduce">
55
<text>-</text>
66
</view>
7-
<input class="l-count-class count"
7+
<input wx:if="{{focus}}"
8+
class="l-count-class count"
89
disabled="{{disabled}}"
9-
type="number"
10+
type="number"
11+
focus="{{focus}}"
1012
value="{{count}}"
1113
bindblur="onBlur"></input>
14+
<view wx:else class="l-count-class count" bindtap="onCount">{{count}}</view>
1215
<view class="l-symbol-class symbol {{count>=max|| disabled?'disabled l-disabled-class':'abled l-symbol-class'}}"
1316
catchtap="{{count>=max|| disabled?'doNothing':'addTap'}}"
1417
data-type="reduce">

0 commit comments

Comments
 (0)