Skip to content

Commit 5e5b3da

Browse files
committed
1. 修复select和picker组件在微信小程序滑动过快,快速点击确定按钮时选择值可能不对的问题
2. 废弃color.js文件,颜色值全部改由css提供,为自定义主题做准备 3. 修复form表单综合演示中,switch没有垂直居中的问题
1 parent b6fac51 commit 5e5b3da

File tree

27 files changed

+1548
-1412
lines changed

27 files changed

+1548
-1412
lines changed

pages.json

Lines changed: 8 additions & 8 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/componentsC/test/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/select/index", //启动页面,必选
10+
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
}]
12+
},
1313
"pages": [
1414
// 演示-组件
1515
{

pages/componentsA/select/index.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,32 @@ export default {
3232
list: [],
3333
list1: [
3434
{
35-
id: '',
36-
name: ''
35+
value: '',
36+
label: ''
3737
},
3838
{
39-
id: '',
40-
name: ''
39+
value: '',
40+
label: ''
4141
},
4242
{
43-
id: '',
44-
name: ''
43+
value: '',
44+
label: ''
4545
},
4646
{
47-
id: '',
48-
name: ''
47+
value: '',
48+
label: ''
4949
},
5050
{
51-
id: '',
52-
name: ''
51+
value: '',
52+
label: ''
5353
},
5454
{
55-
id: '',
56-
name: ''
55+
value: '',
56+
label: ''
5757
},
5858
{
59-
id: '',
60-
name: ''
59+
value: '',
60+
label: ''
6161
}
6262
],
6363
list2: [

pages/componentsB/steps/index.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<u-steps :current="current" :list="steps" :mode="mode" :type="type"></u-steps>
6+
<u-steps :current="current" :list="steps" :mode="mode" :icon="icon"></u-steps>
77
</view>
88
</view>
99
<view class="u-config-wrap">
@@ -15,8 +15,8 @@
1515
<u-subsection vibrateShort :list="['number', 'dot']" @change="modeChange"></u-subsection>
1616
</view>
1717
<view class="u-config-item">
18-
<view class="u-item-title">主题选择</view>
19-
<u-subsection vibrateShort :list="['primary', 'success', 'error', 'warning', 'info']" @change="typeChange"></u-subsection>
18+
<view class="u-item-title">自定义图标</view>
19+
<u-subsection vibrateShort :list="['', '是']" @change="iconChange"></u-subsection>
2020
</view>
2121
<view class="u-config-item">
2222
<view class="u-item-title">当前步值</view>
@@ -40,19 +40,19 @@
4040
name: '签收'
4141
}, ],
4242
current: 0,
43-
type: 'primary',
43+
icon: 'checkmark',
4444
mode: 'number'
4545
}
4646
},
4747
methods: {
4848
modeChange(index) {
4949
this.mode = index == 0 ? 'number' : 'dot';
5050
},
51-
typeChange(index) {
52-
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'info';
53-
},
5451
stepChange(index) {
5552
this.current = index == 0 ? 0 : index == 1 ? 1 : index == 2 ? 2 : 3;
53+
},
54+
iconChange(index) {
55+
this.icon = index == 0 ? 'checkmark' : 'map-fill';
5656
}
5757
}
5858
}

pages/componentsC/button/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<u-button @click="btnClick" :loading="loading" :plain="plain" :shape="shape" :size="size" :ripple="ripple" :hairLine="hairLine" :type="type">山川异域,风月同天</u-button>
6+
<u-button disabled @click="btnClick" :loading="loading" :plain="plain" :shape="shape" :size="size" :ripple="ripple" :hairLine="hairLine" :type="type">山川异域,风月同天</u-button>
77
</view>
88
</view>
99
<view class="u-config-wrap">

pages/componentsC/test/index.vue

Lines changed: 18 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,231 +1,41 @@
11
<template>
2-
<view>
3-
<view class="wed">
4-
<!-- 单选日期 -->
5-
<text @click="WE=!WE">开始</text>
6-
<input type="text" v-model="result" />
7-
<u-calendar v-model="WE" :mode="WEmode" @change="WEchange" start-text="开始" end-text="结束"></u-calendar>
8-
</view>
9-
10-
<view class="wed">
11-
<!-- 多选日期 -->
12-
<text @click="WED=!WED">开始</text>
13-
<input type="text" v-model="startDate" />
14-
<text@click="WED=!WED">结束</text>
15-
<input type="text" v-model="endDate" />
16-
<u-calendar v-model="WED" :mode="WEDmode" @change="WEDchange" start-text="开始" end-text="结束"></u-calendar>
17-
</view>
18-
19-
20-
<view class="">
21-
<u-read-more class="u-read-more" :toggle="true" show-height="100" font-size="12" close-text="更多" :shadow-style="shadowStyle">
22-
<rich-text :nodes="content"></rich-text>
23-
</u-read-more>
24-
<u-read-more class="u-read-more" :toggle="true" show-height="100" font-size="12" close-tex t="更多" :shadow-style="shadowStyle">
25-
<rich-text :nodes="content"></rich-text>
26-
</u-read-more>
27-
28-
</view>
29-
30-
<view>
31-
<!-- 字段少的表格 -->
32-
<u-table>
33-
<u-tr>
34-
<u-th width="30%">学校</u-th>
35-
<u-th>班级</u-th>
36-
<u-th>年龄</u-th>
37-
<u-th>爱好</u-th>
38-
</u-tr>
39-
<u-tr v-for="(item, index) in itemList" :key="index">
40-
<u-td width="6%">
41-
<u-checkbox-group @change="checkboxGroupChange1(index)">
42-
<u-checkbox @change="checkboxChange" v-model="item.checked"></u-checkbox>
43-
</u-checkbox-group>
44-
</u-td>
45-
<u-td>{{item.warehouseid}}</u-td>
46-
<u-td>{{item.warehouseid}}</u-td>
47-
<u-td>{{item.desc}}</u-td>
48-
<u-td>{{item.desc}}</u-td>
49-
</u-tr>
50-
</u-table>
51-
</view>
52-
53-
54-
55-
<view>
56-
<u-table>
57-
<u-tr>
58-
<u-th width="38%">名称</u-th>
59-
<u-th>别名</u-th>
60-
<u-th>座右铭</u-th>
61-
</u-tr>
62-
<u-tr v-for="(item, index) in itemList" :key="index">
63-
<u-td width="6%">
64-
<u-radio-group v-model="value" label-disabled="true" @change="radioGroupChange(index)">
65-
<u-radio @change="radioChange" :name="item.warehouseid">
66-
67-
</u-radio>
68-
</u-radio-group>
69-
</u-td>
70-
<u-td>{{item.warehouseid}}</u-td>
71-
<u-td>{{item.warehouseid}}</u-td>
72-
<u-td>{{item.desc}}</u-td>
73-
74-
</u-tr>
75-
</u-table>
76-
</view>
77-
2+
<view class="wrap">
3+
<u-swiper :list="list"></u-swiper>
784
</view>
79-
805
</template>
816

827
<script>
838
export default {
849
data() {
8510
return {
86-
// ----单选------------
87-
WE: false,
88-
WEmode: "date",
89-
result: '',
90-
// ---------------------
91-
92-
// ----多选--------------
93-
WED: false,
94-
WEDmode: 'range',
95-
startDate: "",
96-
endDate: '',
97-
// ----------------------
98-
content: `客户:山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。
99-
苔痕上阶绿,草色入帘青。谈笑有鸿儒,往来无白丁。可以调素琴,阅金经。
100-
无丝竹之乱耳,无案牍之劳形。南阳诸葛庐,西蜀子云亭。孔子云:何陋之有?`,
101-
shadowStyle: {
102-
// backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
103-
paddingTop: "300rpx",
104-
marginTop: "-300rpx",
105-
106-
},
107-
//-------------单选框
108-
checked: false,
109-
checked1: false,
110-
currentSort: 0,
111-
itemList: {},
112-
113-
114-
value: 'orange',
115-
bangkList: [{
116-
name: '英雄联盟',
117-
alias: '撸啊撸',
118-
else: '玩你**',
119-
11+
list: [{
12+
image: '/static/uView/swiper/swiper1.jpg',
13+
title: '蒹葭苍苍,白露为霜。所谓伊人,在水一方'
12014
},
12115
{
122-
name: '守望先锋',
123-
alias: '守望屁股',
124-
else: '打你**',
125-
16+
image: '/static/uView/swiper/swiper2.jpg',
17+
title: '溯洄从之,道阻且长。溯游从之,宛在水中央'
12618
},
12719
{
128-
name: '炉石传说',
129-
alias: '非酋玩家',
130-
else: '冲你**',
131-
20+
image: '/static/uView/swiper/swiper3.jpg',
21+
title: '蒹葭萋萋,白露未晞。所谓伊人,在水之湄'
13222
}
133-
],
134-
135-
// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
136-
// value: false,
137-
138-
23+
]
13924
}
14025
},
141-
created() {
142-
//页面一进来就发送请求
143-
uni.request({
144-
url: 'http://47.99.173.114:9999/wms/wmmdwarehouse/list',
145-
method: 'GET',
146-
success: res => {
147-
this.itemList = res.data
148-
}
149-
})
150-
26+
onLoad() {
27+
setTimeout(() => {
28+
this.list.pop();
29+
}, 2000)
15130
},
15231
methods: {
153-
// 选中某个单选框时,由radio时触发
154-
radioChange(e) {
155-
// console.log(e);
156-
},
157-
158-
// 选中任一radio时,由radio-group触发
159-
radioGroupChange(index) {
160-
console.log(index);
161-
},
162-
163-
164-
checkboxGroupChange1(index) {
165-
console.log("下标为:" + index);
166-
167-
},
168-
// 选中某个复选框时,由checkbox时触发
169-
checkboxChange(e) {
170-
console.log(e);
171-
17232
173-
},
174-
// 选中任一checkbox时,由checkbox-group触发
175-
checkboxGroupChange(e) {
176-
console.log("全部选按钮" + e);
177-
},
178-
179-
WEchange(e) {
180-
console.log(e); //打印出来的值
181-
// ----------时间单选-----------
182-
this.result = e.result
183-
},
184-
WEDchange(e) {
185-
console.log(e); //打印出来的值
186-
// ----------时间多选择-----------
187-
this.startDate = e.startDate //赋值
188-
this.endDate = e.endDate //赋值
189-
190-
},
19133
}
19234
}
19335
</script>
19436

195-
<style lang="scss">
196-
.u-read-more {
197-
border: 1px solid #007AFF;
198-
margin-top: 10rpx;
199-
}
200-
201-
.u-content {
202-
font-size: 12;
203-
204-
}
205-
206-
.wed {
207-
rich-text {
208-
font-size: 12rpx;
209-
color: #0066CC
210-
}
211-
212-
text {
213-
width: 100rpx;
214-
height: 100%;
215-
}
216-
217-
width: 100%;
218-
height: 100%;
219-
display: flex;
220-
border: 2rpx solid #007AFF;
221-
// justify-content: center;
222-
223-
.red {
224-
225-
uni-view,
226-
uni-text {
227-
border: 1px solid #007aff;
228-
}
229-
}
37+
<style lang="scss" scoped>
38+
.wrap {
39+
padding: 40rpx;
23040
}
231-
</style>
41+
</style>

store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const store = new Vuex.Store({
4343
let nameArr = payload.name.split('.');
4444
let saveKey = '';
4545
let len = nameArr.length;
46-
if(nameArr.length >= 2) {
46+
if(len >= 2) {
4747
let obj = state[nameArr[0]];
4848
for(let i = 1; i < len - 1; i ++) {
4949
obj = obj[nameArr[i]];

0 commit comments

Comments
 (0)