Skip to content

Commit bb453ec

Browse files
committed
Merge branch 'yiruiwen' into dev
2 parents 4f8c388 + 7d463c8 commit bb453ec

File tree

39 files changed

+801
-431
lines changed

39 files changed

+801
-431
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.5.5",
5+
"versionName" : "1.5.6",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"easycom": {
33
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
44
},
5-
// "condition": { //模式配置,仅开发期间生效
6-
// "current": 0, //当前激活的模式(list 的索引项)
7-
// "list": [{
8-
// "name": "test", //模式名称
9-
// "path": "pages/componentsB/table/index", //启动页面,必选
10-
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11-
// }]
12-
// },
5+
"condition": { //模式配置,仅开发期间生效
6+
"current": 0, //当前激活的模式(list 的索引项)
7+
"list": [{
8+
"name": "test", //模式名称
9+
"path": "pages/componentsA/avatar/index", //启动页面,必选
10+
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
}]
12+
},
1313
"pages": [
1414
// 演示-组件
1515
{
@@ -828,22 +828,22 @@
828828
"backgroundColor": "#FFFFFF",
829829
"borderStyle": "black",
830830
"list": [{
831-
"pagePath": "pages/example/components",
832-
"iconPath": "static/uview/example/component.png",
833-
"selectedIconPath": "static/uview/example/component_select.png",
834-
"text": "组件"
831+
"pagePath": "pages/example/components"
832+
// "iconPath": "static/uview/example/component.png",
833+
// "selectedIconPath": "static/uview/example/component_select.png",
834+
// "text": "组件"
835835
},
836836
{
837-
"pagePath": "pages/example/js",
838-
"iconPath": "static/uview/example/js.png",
839-
"selectedIconPath": "static/uview/example/js_select.png",
840-
"text": "工具"
837+
"pagePath": "pages/example/js"
838+
// "iconPath": "static/uview/example/js.png",
839+
// "selectedIconPath": "static/uview/example/js_select.png",
840+
// "text": "工具"
841841
},
842842
{
843-
"pagePath": "pages/example/template",
844-
"iconPath": "static/uview/example/template.png",
845-
"selectedIconPath": "static/uview/example/template_select.png",
846-
"text": "模板"
843+
"pagePath": "pages/example/template"
844+
// "iconPath": "static/uview/example/template.png",
845+
// "selectedIconPath": "static/uview/example/template_select.png",
846+
// "text": "模板"
847847
}
848848
]
849849
}

pages/componentsA/avatar/index.vue

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<u-avatar :mode="mode" :size="size" :src="src" :text="text">
7-
</u-avatar>
6+
<u-avatar
7+
:mode="mode"
8+
:size="size"
9+
:src="src"
10+
:text="text"
11+
:showLevel="showLevel"
12+
:showSex="showSex"
13+
:sexIcon="sexIcon"
14+
:bgColor='bgColor'
15+
></u-avatar>
816
</view>
917
</view>
1018
<view class="u-config-wrap">
@@ -15,9 +23,17 @@
1523
<view class="u-item-title">模式选择</view>
1624
<u-subsection vibrateShort :list="['圆形', '圆角方形']" @change="modeChange"></u-subsection>
1725
</view>
26+
<view class="u-config-item">
27+
<view class="u-item-title">性别选择</view>
28+
<u-subsection vibrateShort :list="['男', '女', '不显示']" @change="sexChange"></u-subsection>
29+
</view>
30+
<view class="u-config-item">
31+
<view class="u-item-title">等级</view>
32+
<u-subsection vibrateShort :list="['显示', '不显示']" @change="levelChange"></u-subsection>
33+
</view>
1834
<view class="u-config-item">
1935
<view class="u-item-title">自定义内容</view>
20-
<u-subsection vibrateShort current="1" :list="['默认', '图片', '文字']" @change="styleChange"></u-subsection>
36+
<u-subsection vibrateShort current="0" :list="['图片', '文字']" @change="styleChange"></u-subsection>
2137
</view>
2238
<view class="u-config-item">
2339
<view class="u-item-title">尺寸</view>
@@ -34,7 +50,11 @@
3450
mode: 'circle',
3551
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
3652
text: '', // 优先级比src高
37-
size: '90'
53+
size: '90',
54+
showLevel: true,
55+
showSex: true,
56+
sexIcon: 'man',
57+
bgColor: '#fcbd71'
3858
}
3959
},
4060
methods: {
@@ -43,9 +63,6 @@
4363
},
4464
styleChange(index) {
4565
if(index == 0) {
46-
this.src = '';
47-
this.text = '';
48-
} else if(index == 1) {
4966
this.text = '';
5067
this.src = 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg';
5168
} else {
@@ -54,8 +71,16 @@
5471
},
5572
sizeChange(index) {
5673
this.size = index == 0 ? 'large' : index == 1 ? 'default' : index == 2 ? 'mini' : 160;
74+
},
75+
sexChange(index) {
76+
this.showSex = true;
77+
if(index == 0) this.sexIcon = 'man';
78+
if(index == 1) this.sexIcon = 'woman';
79+
if(index == 2) this.showSex = false;
80+
},
81+
levelChange(index) {
82+
this.showLevel = !index;
5783
}
58-
5984
}
6085
}
6186
</script>

pages/componentsB/sticky/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
66
<u-toast ref="uToast"></u-toast>
7-
<u-sticky :offset-top="offsetTop" :enable="enable" @fixed="fixed">
7+
<u-sticky :offset-top="offsetTop" :enable="enable" @fixed="fixed" @unfixed="unfixed">
88
<view class="sticky">
99
宝剑锋从磨砺出,梅花香自苦寒来
1010
</view>
@@ -51,6 +51,12 @@
5151
type: 'warning',
5252
title: '触发吸顶'
5353
})
54+
},
55+
unfixed() {
56+
this.$refs.uToast.show({
57+
type: 'success',
58+
title: '取消吸顶'
59+
})
5460
}
5561
}
5662
}

pages/componentsB/waterfall/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
</view>
1919
<view class="demo-shop">{{ item.shop }}</view>
2020
<!-- 微信小程序无效,因为它不支持在template中引入组件 -->
21-
<u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close" @click="remove(item.id)"></u-icon>
21+
<view class="u-close">
22+
<u-icon name="close-circle-fill" color="#fa3534" size="34" @click="remove(item.id)"></u-icon>
23+
</view>
2224
</view>
2325
</template>
2426
<template v-slot:right="{ rightList }">
@@ -37,7 +39,9 @@
3739
</view>
3840
<view class="demo-shop">{{ item.shop }}</view>
3941
<!-- 微信小程序无效,因为它不支持在template中引入组件 -->
40-
<u-icon name="close-circle-fill" color="#fa3534" size="34" class="u-close" @click="remove(item.id)"></u-icon>
42+
<view class="u-close">
43+
<u-icon name="close-circle-fill" color="#fa3534" size="34" @click="remove(item.id)"></u-icon>
44+
</view>
4145
</view>
4246
</template>
4347
</u-waterfall>

pages/componentsC/actionSheet/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
list: [{
3333
text: '最是人间留不住',
3434
}, {
35-
text: '朱颜辞镜花辞树'
35+
text: '朱颜辞镜花辞树',
36+
disabled: true
3637
}, {
3738
text: '正是江南好风景'
3839
}, {

pages/componentsC/test/index.vue

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
<template>
2-
<view class="u-content">
3-
<u-dropdown-list></u-dropdown-list>
2+
<view>
3+
<u-popup v-model="show" @close="close">
4+
<view>出淤泥而不染,濯清涟而不妖</view>
5+
</u-popup>
6+
<u-button @click="show = true">打开</u-button>
47
</view>
58
</template>
69

710
<script>
811
export default {
912
data() {
1013
return {
11-
content: `
12-
<p>露从今夜白,月是故乡明</p>
13-
<img src="https://cdn.uviewui.com/uview/swiper/2.jpg" />
14-
`
14+
show: false
1515
}
1616
},
17-
}
18-
</script>
19-
20-
<style lang="scss" scoped>
21-
.u-content {
22-
margin-top: 100rpx;
23-
color: $u-content-color;
24-
font-size: 32rpx;
25-
line-height: 1.8;
26-
27-
// 标签形式无效
28-
p {
29-
color: $u-tips-color;
17+
methods: {
18+
close() {
19+
console.log('close');
20+
}
3021
}
3122
}
32-
</style>
23+
</script>

pages/example/components.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,11 @@ export default [{
198198
icon: 'sticky',
199199
title: 'Sticky 吸顶',
200200
},
201-
// #ifndef MP-ALIPAY
202201
{
203202
path: '/pages/componentsB/waterfall/index',
204203
icon: 'waterfall',
205204
title: 'Waterfall 瀑布流',
206205
},
207-
// #endif
208206
{
209207
path: '/pages/componentsB/divider/index',
210208
icon: 'divider',

pages/example/components.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</u-cell-group>
1010
</view>
1111
<u-gap height="70"></u-gap>
12+
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
1213
</view>
1314
</template>
1415

pages/example/js.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</u-cell-group>
1010
</view>
1111
<u-gap height="70"></u-gap>
12+
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
1213
</view>
1314
</template>
1415

pages/example/template.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</u-cell-group>
1010
</view>
1111
<u-gap height="70"></u-gap>
12+
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
1213
</view>
1314
</template>
1415

static/uview/example/js.png

1 KB
Loading

static/uview/example/js_bak.png

3.14 KB
Loading

static/uview/example/js_select.png

1.98 KB
Loading
2.2 KB
Loading

store/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ const store = new Vuex.Store({
3636
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
3737
vuex_version: '1.0.1',
3838
vuex_demo: '绛紫',
39+
// 自定义tabbar数据
40+
vuex_tabbar: [{
41+
iconPath: "/static/uview/example/component.png",
42+
selectedIconPath: "/static/uview/example/component_select.png",
43+
text: '组件',
44+
pagePath: '/pages/example/components'
45+
},
46+
{
47+
iconPath: "/static/uview/example/js.png",
48+
selectedIconPath: "/static/uview/example/js_select.png",
49+
text: '工具',
50+
midButton: true,
51+
pagePath: '/pages/example/js'
52+
},
53+
{
54+
iconPath: "/static/uview/example/template.png",
55+
selectedIconPath: "/static/uview/example/template_select.png",
56+
text: '模板',
57+
pagePath: '/pages/example/template'
58+
}
59+
]
3960
},
4061
mutations: {
4162
$uStore(state, payload) {

uview-ui/components/u-action-sheet/u-action-sheet.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
<template>
22
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
3-
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
3+
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
44
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
55
{{tips.text}}
66
</view>
77
<block v-for="(item, index) in list" :key="index">
8-
<view @touchmove.stop.prevent @tap="itemClick(index)" :style="[itemStyle(index)]" class="u-action-sheet-item" :class="[index < list.length - 1 ? 'u-border-bottom' : '']"
9-
hover-class="u-hover-class" :hover-stay-time="150">
8+
<view
9+
@touchmove.stop.prevent
10+
@tap="itemClick(index)"
11+
:style="[itemStyle(index)]"
12+
class="u-action-sheet-item"
13+
:class="[index < list.length - 1 ? 'u-border-bottom' : '']"
14+
:hover-stay-time="150"
15+
>
1016
{{item.text}}
1117
</view>
1218
</block>
1319
<view class="u-gab" v-if="cancelBtn">
1420
</view>
1521
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
16-
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
22+
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
1723
</u-popup>
1824
</template>
1925

@@ -112,6 +118,8 @@
112118
let style = {};
113119
if (this.list[index].color) style.color = this.list[index].color;
114120
if (this.list[index].fontSize) style.fontSize = this.list[index].fontSize + 'rpx';
121+
// 选项被禁用的样式
122+
if (this.list[index].disabled) style.color = '#c0c4cc';
115123
return style;
116124
}
117125
},
@@ -132,8 +140,10 @@
132140
popupClose() {
133141
this.$emit('input', false);
134142
},
135-
// 点击某一个itemif (!this.show) return;
143+
// 点击某一个item
136144
itemClick(index) {
145+
// disabled的项禁止点击
146+
if(this.list[index].disabled) return;
137147
this.$emit('click', index);
138148
this.$emit('input', false);
139149
}
@@ -143,7 +153,7 @@
143153

144154
<style lang="scss" scoped>
145155
@import "../../libs/css/style.components.scss";
146-
156+
147157
.u-tips {
148158
font-size: 26rpx;
149159
text-align: center;

0 commit comments

Comments
 (0)