Skip to content

Commit 7adaada

Browse files
committed
fix(uni-ui)
1 parent d7fd67a commit 7adaada

5 files changed

Lines changed: 59 additions & 25 deletions

File tree

‎components/uni-indexed-list/uni-indexed-list.vue‎

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
<template>
22
<view class="uni-indexed-list" ref="list" id="list">
3-
<scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
4-
<view v-for="(list, idx) in lists" :key="idx" :id="'uni-indexed-list-' + list.key">
5-
<uni-indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></uni-indexed-list-item>
6-
</view>
7-
</scroll-view>
3+
<!-- #ifdef APP-NVUE -->
4+
<list class="uni-indexed-list__scroll" scrollable="true" show-scrollbar="false">
5+
<cell v-for="(list, idx) in lists" :key="idx" :ref="'uni-indexed-list-' + list.key">
6+
<!-- #endif -->
7+
<!-- #ifndef APP-NVUE -->
8+
<scroll-view :scroll-into-view="scrollViewId" class="uni-indexed-list__scroll" scroll-y>
9+
<view v-for="(list, idx) in lists" :key="idx" :id="'uni-indexed-list-' + list.key">
10+
<!-- #endif -->
11+
<uni-indexed-list-item :list="list" :loaded="loaded" :idx="idx" :showSelect="showSelect" @itemClick="onClick"></uni-indexed-list-item>
12+
<!-- #ifndef APP-NVUE -->
13+
</view>
14+
</scroll-view>
15+
<!-- #endif -->
16+
<!-- #ifdef APP-NVUE -->
17+
</cell>
18+
</list>
19+
<!-- #endif -->
820
<view :class="touchmove ? 'uni-indexed-list__menu--active' : ''" @touchstart="touchStart" @touchmove.stop="touchMove" @touchend="touchEnd" class="uni-indexed-list__menu">
921
<view v-for="(list, key) in lists" :key="key" class="uni-indexed-list__menu-item">
1022
<text class="uni-indexed-list__menu-text" :class="touchmoveIndex == key ? 'uni-indexed-list__menu-text--active' : ''">{{ list.key }}</text>
@@ -18,6 +30,9 @@
1830
<script>
1931
import uniIcons from '@/components/uni-icons/uni-icons.vue'
2032
import uniIndexedListItem from './uni-indexed-list-item.vue'
33+
// #ifdef APP-NVUE
34+
const dom = weex.requireModule('dom');
35+
// #endif
2136
// #ifdef APP-PLUS
2237
function throttle(func, delay) {
2338
var prev = Date.now();
@@ -40,15 +55,20 @@
4055
}
4156
let item = this.lists[index]
4257
if (item) {
58+
// #ifndef APP-NVUE
4359
this.scrollViewId = 'uni-indexed-list-' + item.key
4460
this.touchmoveIndex = index
61+
// #endif
62+
// #ifdef APP-NVUE
63+
dom.scrollToElement(this.$refs['uni-indexed-list-' + item.key][0], {
64+
animated: false
65+
})
66+
this.touchmoveIndex = index
67+
// #endif
4568
}
4669
}
4770
const throttleTouchMove = throttle(touchMove, 40)
4871
// #endif
49-
// #ifdef APP-NVUE
50-
const dom = weex.requireModule('dom');
51-
// #endif
5272
export default {
5373
name: 'UniIndexedList',
5474
components: {

‎components/uni-search-bar/uni-search-bar.vue‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!-- #ifndef MP-ALIPAY -->
1010
<uni-icons color="#999999" class="uni-searchbar__box-icon-search" size="18" type="search" />
1111
<!-- #endif -->
12-
<input v-if="show" :focus="show" :placeholder="placeholder" @confirm="confirm" class="uni-searchbar__box-search-input" confirm-type="search" placeholder-style="color:#cccccc" type="text" v-model="searchVal" />
12+
<input v-if="show" :focus="showSync" :placeholder="placeholder" @confirm="confirm" class="uni-searchbar__box-search-input" confirm-type="search" placeholder-style="color:#cccccc" type="text" v-model="searchVal" />
1313
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
1414
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='')" class="uni-searchbar__box-icon-clear">
1515
<uni-icons color="#999999" class="" size="24" type="clear" />
@@ -43,41 +43,52 @@
4343
data() {
4444
return {
4545
show: false,
46+
showSync: false,
4647
searchVal: ""
47-
};
48+
}
4849
},
4950
watch: {
5051
searchVal() {
5152
this.$emit("input", {
5253
value: this.searchVal
53-
});
54+
})
5455
}
5556
},
5657
methods: {
5758
searchClick() {
58-
this.searchVal = "";
59+
this.searchVal = ""
5960
this.show = true;
61+
this.$nextTick(() => {
62+
this.showSync = true;
63+
})
6064
},
6165
clear() {
62-
this.searchVal = "";
66+
this.searchVal = ""
6367
},
6468
cancel() {
6569
this.$emit("cancel", {
6670
value: this.searchVal
6771
});
68-
this.searchVal = "";
69-
this.show = false;
72+
this.searchVal = ""
73+
this.show = false
74+
this.showSync = false
7075
// #ifndef APP-PLUS
71-
uni.hideKeyboard();
76+
uni.hideKeyboard()
7277
// #endif
7378
// #ifdef APP-PLUS
7479
plus.key.hideSoftKeybord()
7580
// #endif
7681
},
7782
confirm() {
83+
// #ifndef APP-PLUS
84+
uni.hideKeyboard();
85+
// #endif
86+
// #ifdef APP-PLUS
87+
plus.key.hideSoftKeybord()
88+
// #endif
7889
this.$emit("confirm", {
7990
value: this.searchVal
80-
});
91+
})
8192
}
8293
}
8394
};

‎components/uni-swiper-dot/uni-swiper-dot.vue‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
border-radius: 100px;
124124
margin-left: 12rpx;
125125
background-color: rgba(0, 0, 0, .3);
126-
transition: width 0.2s linear;
126+
/* transition: width 0.2s linear; 不要取消注释,不然会不能变色
127+
*/
127128
}
128129
129130
.uni-swiper__dots-item:first-child {

‎pages/extUI/grid/grid.nvue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<image class="image" src="/static/c1.png" mode="aspectFill" />
1818
<text class="text">Grid 1</text>
1919
</uni-grid-item>
20-
<uni-grid-item :hor="0" :ver="0" :img-width="30" marker="image" src="https://img-cdn-qiniu.dcloud.net.cn/uni-ui/recommend.png">
20+
<uni-grid-item :hor="0" :ver="0" :img-width="30" marker="image">
2121
<image class="image" src="/static/c2.png" mode="aspectFill" />
2222
<text class="text">Grid 2</text>
2323
</uni-grid-item>

‎pages/extUI/search-bar/search-bar.nvue‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,25 @@
3636
},
3737
methods: {
3838
search(res) {
39-
uni.showModal({
40-
content: '搜索:' + res.value,
41-
showCancel: false
39+
uni.showToast({
40+
title: '搜索:' + res.value,
41+
icon: 'none'
4242
})
4343
},
4444
input(res) {
4545
this.searchVal = res.value
4646
},
4747
cancel(res) {
48-
uni.showModal({
49-
content: '点击取消,输入值为:' + res.value,
50-
showCancel: false
48+
uni.showToast({
49+
title: '点击取消,输入值为:' + res.value,
50+
icon: 'none'
5151
})
5252
}
5353
},
5454
onBackPress() {
55+
// #ifdef APP-PLUS
5556
plus.key.hideSoftKeybord();
57+
// #endif
5658
}
5759
}
5860
</script>

0 commit comments

Comments
 (0)