Skip to content

Commit a32cd0f

Browse files
committed
Merge branch 'yiruiwen' into dev
2 parents ae5aa52 + 6336ffd commit a32cd0f

File tree

15 files changed

+94
-237
lines changed

15 files changed

+94
-237
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ Vue.use(uView);
8686
// pages.json
8787
{
8888
"easycom": {
89+
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
90+
// 下载安装方式
8991
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
92+
// npm安装方式
93+
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
9094
},
9195
// 此为本身已有的内容
9296
"pages": [

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.6.4",
5+
"versionName" : "1.6.5",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// "current": 0, //当前激活的模式(list 的索引项)
77
// "list": [{
88
// "name": "test", //模式名称
9-
// "path": "pages/componentsA/field/index", //启动页面,必选
9+
// "path": "pages/componentsC/test/index", //启动页面,必选
1010
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
1111
// }]
1212
// },

pages/componentsB/noticeBar/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@
114114
this.toast(`点击了关闭图标`);
115115
},
116116
click(index) {
117-
this.toast(`点击了第${index + 1}条消息`);
117+
if(this.mode == 'horizontal' && this.isCircular) {
118+
this.toast('此模式无法获取Index值');
119+
} else {
120+
this.toast(`点击了第${index + 1}条消息`);
121+
}
122+
118123
},
119124
getMore() {
120125
this.toast(`点击了更多图标`);

pages/componentsC/test/index.vue

Lines changed: 41 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -1,232 +1,52 @@
11
<template>
22
<view class="">
3-
3+
<u-dropdown ref="uDropdown" @open="open" @close="close">
4+
<u-dropdown-item v-model="value1" title="距离" :options="options1" @change="change"></u-dropdown-item>
5+
<u-dropdown-item v-model="value2" title="温度" :options="options2"></u-dropdown-item>
6+
</u-dropdown>
47
</view>
58
</template>
69

710
<script>
8-
export default {
9-
10-
data() {
11-
return {
12-
13-
};
14-
},
15-
onLoad() {
16-
console.log(this.$u.test.url('http://www.aa.com?b=3&a=328sdsfhiwiefwismdfhsewiemsnfwiemdhisi'));
17-
},
18-
computed: {
19-
20-
},
21-
methods: {
22-
reachBottom() {
23-
// 此tab为空数据
24-
if(this.current != 2) {
25-
this.loadStatus.splice(this.current,1,"loading")
26-
setTimeout(() => {
27-
this.getOrderList(this.current);
28-
}, 1200);
29-
}
30-
},
31-
32-
// 页面数据
33-
getOrderList(idx) {
34-
for(let i = 0; i < 5; i++) {
35-
let index = this.$u.random(0, this.dataList.length - 1);
36-
let data = JSON.parse(JSON.stringify(this.dataList[index]));
37-
data.id = this.$u.guid();
38-
this.orderList[idx].push(data);
11+
export default {
12+
data() {
13+
return {
14+
value1: 1,
15+
value2: 2,
16+
options1: [{
17+
label: '默认排序',
18+
value: 1,
19+
},
20+
{
21+
label: '距离优先',
22+
value: 2,
23+
}
24+
],
25+
options2: [{
26+
label: '去冰',
27+
value: 1,
28+
},
29+
{
30+
label: '加冰',
31+
value: 2,
32+
},
33+
],
3934
}
40-
this.loadStatus.splice(this.current,1,"loadmore")
41-
},
42-
43-
change(index) {
44-
this.swiperCurrent = index;
45-
this.getOrderList();
4635
},
47-
transition({ detail: { dx } }) {
48-
this.$refs.tabs.setDx(dx);
49-
},
50-
animationfinish({ detail: { current } }) {
51-
this.$refs.tabs.setFinishCurrent(current);
52-
this.swiperCurrent = current;
53-
this.current = current;
54-
},
55-
56-
// 数据请求
57-
// post示例
58-
// sumbitByPost() {
59-
// this.$u.post('http://10.28.83.111:59694/formMessage', {
60-
// username:this.loginForm.username,
61-
// password:md5(this.loginForm.password).toUpperCase(),
62-
// }).then(res => {
63-
// // res为服务端返回的数据
64-
65-
// })
66-
// },
67-
sendInfo(){
68-
let params = {
69-
username:this.loginForm.username,
70-
password:md5(this.loginForm.password).toUpperCase(),
71-
}
72-
let headers={
73-
"Content-Type":"application/x-www-form-urlencoded",
74-
// "Token":`this.userToken` //设置token,保证每一个用户进入系统的安全性
75-
}
76-
uni.request({
77-
url: `http://10.28.83.111:59694/formMessage`,
78-
method: 'POST',
79-
header: headers,
80-
data: params,
81-
success: (res)=>{
82-
83-
},
84-
fail: (err)=>{
85-
86-
}
87-
})
88-
}
89-
90-
91-
92-
}
93-
};
94-
</script>
95-
96-
<style>
97-
/* #ifndef H5 */
98-
page {
99-
height: 100%;
100-
background-color: #f2f2f2;
101-
}
102-
/* #endif */
103-
</style>
104-
105-
<style lang="scss" scoped>
106-
.order {
107-
width: 710rpx;
108-
background-color: #ffffff;
109-
margin: 20rpx auto;
110-
border-radius: 20rpx;
111-
box-sizing: border-box;
112-
padding: 20rpx;
113-
font-size: 28rpx;
114-
.top {
115-
display: flex;
116-
justify-content: space-between;
117-
.left {
118-
display: flex;
119-
align-items: center;
120-
.store {
121-
margin: 0 10rpx;
122-
font-size: 32rpx;
123-
font-weight: bold;
36+
methods: {
37+
open(index) {
38+
// 展开某个下来菜单时,先关闭原来的其他菜单高亮
39+
// 同时内部会自动给当前展开项进行高亮
40+
this.$refs.uDropdown.highlight();
41+
},
42+
close(index) {
43+
// 关闭的时候,给当前项加上高亮
44+
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
45+
this.$refs.uDropdown.highlight(index);
46+
},
47+
change() {
48+
// 更多的细节,请自行实现
12449
}
12550
}
126-
.right {
127-
// color: $u-type-warning-dark;
128-
color: #F29100;
129-
// color: #5098ff;
130-
// color: #e5d001;
131-
}
13251
}
133-
.item {
134-
display: flex;
135-
margin: 20rpx 0 0;
136-
.left {
137-
margin-right: 20rpx;
138-
image {
139-
width: 200rpx;
140-
height: 200rpx;
141-
border-radius: 10rpx;
142-
}
143-
}
144-
.content {
145-
.title {
146-
font-size: 28rpx;
147-
line-height: 50rpx;
148-
}
149-
.type {
150-
margin: 10rpx 0;
151-
font-size: 24rpx;
152-
color: $u-tips-color;
153-
}
154-
.delivery-time {
155-
color: #999999;
156-
font-size: 24rpx;
157-
}
158-
}
159-
.right {
160-
margin-left: 10rpx;
161-
padding-top: 20rpx;
162-
text-align: right;
163-
.decimal {
164-
font-size: 24rpx;
165-
margin-top: 4rpx;
166-
}
167-
.number {
168-
color: $u-tips-color;
169-
font-size: 24rpx;
170-
}
171-
}
172-
}
173-
.total {
174-
margin-top: 20rpx;
175-
text-align: right;
176-
font-size: 24rpx;
177-
.total-price {
178-
font-size: 32rpx;
179-
}
180-
}
181-
.bottom {
182-
display: flex;
183-
margin-top: 40rpx;
184-
padding: 0 10rpx;
185-
justify-content: space-between;
186-
align-items: center;
187-
.btn {
188-
line-height: 52rpx;
189-
width: 160rpx;
190-
border-radius: 26rpx;
191-
border: 2rpx solid $u-border-color;
192-
font-size: 26rpx;
193-
text-align: center;
194-
color: $u-type-info-dark;
195-
}
196-
.evaluate {
197-
color: $u-type-warning-dark;
198-
border-color: $u-type-warning-dark;
199-
}
200-
}
201-
}
202-
.centre {
203-
text-align: center;
204-
margin: 200rpx auto;
205-
font-size: 32rpx;
206-
image {
207-
width: 250rpx;
208-
height: 300rpx;
209-
// margin-bottom: 20rpx;
210-
}
211-
.tips {
212-
font-size: 24rpx;
213-
color: #999999;
214-
margin-top: 20rpx;
215-
}
216-
217-
}
218-
.wrap {
219-
display: flex;
220-
flex-direction: column;
221-
height: calc(100vh - var(--window-top));
222-
width: 100%;
223-
}
224-
.swiper-box {
225-
flex: 1;
226-
}
227-
.swiper-item {
228-
height: 100%;
229-
}
230-
</style>
231-
232-
52+
</script>

pages/example/components.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
});
4040
},
4141
created() {
42-
42+
4343
},
4444
methods: {
4545
openPage(path) {

uview-ui/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ Vue.use(uView);
5555
// pages.json
5656
{
5757
"easycom": {
58+
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
59+
// npm安装方式
5860
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
61+
// 下载安装方式
62+
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
5963
},
6064
// 此为本身已有的内容
6165
"pages": [

uview-ui/components/u-dropdown-item/u-dropdown-item.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@
7474
this.activeColor = parent.activeColor;
7575
this.inactiveColor = parent.inactiveColor;
7676
// 将本组件的this,放入到父组件的children数组中,让父组件可以操作本(子)组件的方法和属性
77-
parent.children.push(this);
77+
// push进去前,显判断是否已经存在了本实例,因为在子组件内部数据变化时,会通过父组件重新初始化子组件
78+
let exist = parent.children.find(val => {
79+
return this === val;
80+
})
81+
if(!exist) parent.children.push(this);
7882
if(parent.children.length == 1) this.active = true;
7983
// 父组件无法监听children的变化,故将子组件的title,传入父组件的menuList数组中
8084
parent.menuList.push({

0 commit comments

Comments
 (0)