Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uview-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李晖
uview-ui
Commits
b443a0a4
Commit
b443a0a4
authored
May 04, 2020
by
wlxuqu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构cell组件
parent
5c9923ce
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
503 additions
and
326 deletions
+503
-326
.npmignore
.npmignore
+18
-0
LICENSE
LICENSE
+0
-0
pages.json
pages.json
+8
-8
index.vue
pages/componentsB/form/index.vue
+8
-0
index.vue
pages/componentsB/upload/index.vue
+1
-1
index.vue
pages/componentsC/cell/index.vue
+15
-8
LICENSE
uview/LICENSE
+0
-0
u-cell-item.vue
uview/components/u-cell-item/u-cell-item.vue
+259
-196
u-form-item.vue
uview/components/u-form-item/u-form-item.vue
+21
-0
u-form.vue
uview/components/u-form/u-form.vue
+21
-0
u-icon.vue
uview/components/u-icon/u-icon.vue
+83
-83
u-upload.vue
uview/components/u-upload/u-upload.vue
+9
-1
iconfont.css
uview/iconfont.css
+18
-6
index.scss
uview/index.scss
+6
-2
index.js
uview/libs/request/index.js
+19
-21
package.json
uview/package.json
+17
-0
No files found.
.npmignore
0 → 100644
View file @
b443a0a4
common/
components/
node_modules/
pages/
static/
store/
unpackage/
.gitignore
App.vue
LICENSE.txt
main.js
manifext.json
pages.json
vue.config.js
package-lock.json
.editorconfig
uni.scss
template.h5.html
LICENSE
.txt
→
LICENSE
View file @
b443a0a4
File moved
pages.json
View file @
b443a0a4
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
"easycom"
:
{
"easycom"
:
{
"^u-(.*)"
:
"@/uview/components/u-$1/u-$1.vue"
"^u-(.*)"
:
"@/uview/components/u-$1/u-$1.vue"
},
},
//
"condition"
:
{
//模式配置,仅开发期间生效
"condition"
:
{
//模式配置,仅开发期间生效
//
"current"
:
0
,
//当前激活的模式(list
的索引项)
"current"
:
0
,
//当前激活的模式(list
的索引项)
//
"list"
:
[{
"list"
:
[{
//
"name"
:
"test"
,
//模式名称
"name"
:
"test"
,
//模式名称
//
"path"
:
"pages/componentsA/slider
/index"
,
//启动页面,必选
"path"
:
"pages/componentsC/cell
/index"
,
//启动页面,必选
//
"query"
:
"id=1&name=2"
//启动参数,在页面的-+onLoad函数里面得到
"query"
:
"id=1&name=2"
//启动参数,在页面的-+onLoad函数里面得到
//
}]
}]
//
},
},
"pages"
:
[
"pages"
:
[
//
演示-组件
//
演示-组件
{
{
...
...
pages/componentsB/form/index.vue
0 → 100644
View file @
b443a0a4
<
template
>
</
template
>
<
script
>
</
script
>
<
style
>
</
style
>
pages/componentsB/upload/index.vue
View file @
b443a0a4
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</u-upload>
</u-upload>
<u-button
:custom-style=
"
{marginTop: '20rpx'}" @click="upload">上传
</u-button>
<u-button
:custom-style=
"
{marginTop: '20rpx'}" @click="upload">上传
</u-button>
<u-button
:custom-style=
"
{marginTop: '40rpx'}" @click="clear">清空列表
</u-button>
<u-button
:custom-style=
"
{marginTop: '40rpx'}" @click="clear">清空列表
</u-button>
<
u-button
:custom-style=
"
{marginTop: '40rpx'}" @click="reUpload">重新上传
</u-button
>
<
!--
<u-button
:custom-style=
"
{marginTop: '40rpx'}" @click="reUpload">重新上传
</u-button>
--
>
</view>
</view>
</view>
</view>
<view
class=
"u-config-wrap"
>
<view
class=
"u-config-wrap"
>
...
...
pages/componentsC/cell/index.vue
View file @
b443a0a4
...
@@ -4,13 +4,18 @@
...
@@ -4,13 +4,18 @@
<view
class=
"u-demo-title"
>
演示效果
</view>
<view
class=
"u-demo-title"
>
演示效果
</view>
<view
class=
"u-demo-area"
>
<view
class=
"u-demo-area"
>
<u-cell-group
title=
"读万卷书"
>
<u-cell-group
title=
"读万卷书"
>
<u-cell-item
index=
"index"
@
click=
"click"
:hover=
"hover"
:label=
"label"
:arrow=
"arrow"
:value=
"rightSlot == 'text' ? '蒹葭苍苍' : ''"
:title=
"title"
>
<u-cell-item
center
:is-link=
"true"
:label=
"label"
value=
"铁马冰河入梦来"
i
<u-icon
slot=
"icon"
size=
"34"
:name=
"icon"
></u-icon>
ndex=
"index"
@
click=
"click"
:hover-class=
"hoverClass"
<u-badge
:absolute=
"false"
v-if=
"rightSlot == 'badge'"
count=
"105"
slot=
"right"
></u-badge>
:arrow=
"arrow"
:title=
"title"
<u-switch
v-if=
"rightSlot == 'switch'"
slot=
"right"
v-model=
"checked"
></u-switch>
:icon=
"icon"
>
<u-badge
:absolute=
"false"
v-if=
"rightSlot == 'badge'"
count=
"105"
slot=
"right-icon"
></u-badge>
<u-switch
v-if=
"rightSlot == 'switch'"
slot=
"right-icon"
v-model=
"checked"
></u-switch>
</u-cell-item>
</u-cell-item>
<u-cell-item
title=
"铁马冰河入梦来"
value=
"行万里路"
>
<u-cell-item
value=
""
title=
"铁马冰河入梦来"
value=
"行万里路"
:arrow=
"false"
>
<u-icon
slot=
"icon"
size=
"34"
name=
"calendar"
></u-icon>
<u-icon
slot=
"icon"
size=
"34"
name=
"calendar"
style=
"margin-right: 5px;"
></u-icon>
<u-icon
slot=
"right-icon"
size=
"34"
name=
"calendar"
></u-icon>
<u-field
slot=
"value"
></u-field>
</u-cell-item>
</u-cell-item>
</u-cell-group>
</u-cell-group>
</view>
</view>
...
@@ -56,9 +61,9 @@ export default {
...
@@ -56,9 +61,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
hover
()
{
hover
Class
()
{
// 如果右侧是switch步进器组件的话,去掉cell的点击反馈,因为这个时候点击的反馈应该在switch上
// 如果右侧是switch步进器组件的话,去掉cell的点击反馈,因为这个时候点击的反馈应该在switch上
return
this
.
rightSlot
!=
'
switch
'
;
return
this
.
rightSlot
==
'
switch
'
?
'
none
'
:
'
u-cell-hover
'
;
}
}
},
},
methods
:
{
methods
:
{
...
@@ -76,6 +81,8 @@ export default {
...
@@ -76,6 +81,8 @@ export default {
},
},
rightSlotChange
(
index
)
{
rightSlotChange
(
index
)
{
this
.
rightSlot
=
index
==
0
?
'
text
'
:
index
==
1
?
'
switch
'
:
'
badge
'
this
.
rightSlot
=
index
==
0
?
'
text
'
:
index
==
1
?
'
switch
'
:
'
badge
'
if
(
index
==
0
)
this
.
arrow
=
true
;
else
this
.
arrow
=
false
;
},
},
click
(
index
)
{
click
(
index
)
{
// console.log(index);
// console.log(index);
...
...
uview/LICENSE
.txt
→
uview/LICENSE
View file @
b443a0a4
File moved
uview/components/u-cell-item/u-cell-item.vue
View file @
b443a0a4
<
template
>
<
template
>
<view
@
tap=
"click"
class=
"u-cell-item-box"
:class=
"
{'u-cell-border': itemIndex > 0 }" hover-stay-time="150"
<view
:hover-class="hover ? 'u-hover-class' : ''" :style="{
@
tap=
"click"
class=
"u-cell"
:class=
"
{ 'u-cell-border': itemIndex > 0
&&
borderBottom, 'u-col-center': center, 'u-border-gap': borderGap, 'u-cell--required': required }"
hover-stay-time="150"
:hover-class="hoverClass"
:style="{
backgroundColor: bgColor
backgroundColor: bgColor
}">
}"
<view
class=
"u-cell-content"
>
>
<view
class=
"u-icon-wrap"
v-if=
"icon"
>
<u-icon
:size=
"iconSize"
:name=
"icon"
v-if=
"icon"
class=
"u-cell__left-icon-wrap"
></u-icon>
<u-icon
size=
"32"
:name=
"icon"
class=
"u-icon"
></u-icon>
<view
class=
"u-flex"
v-else
>
</view>
<view
class=
"u-icon-wrap"
>
<slot
name=
"icon"
></slot>
<slot
name=
"icon"
></slot>
</view>
</view>
<view
class=
"u-cell-title"
:style=
"[titleStyle]"
>
<view
<text
class=
"u-title-text"
v-if=
"title"
>
{{
title
}}
</text>
class=
"u-cell_title"
<slot
name=
"left"
></slot>
:style=
"[
</view>
{
<view
class=
"u-cell-value"
v-if=
"value"
>
width: titleWidth ? titleWidth + 'rpx' : 'auto'
<text
class=
"u-value-text"
:style=
"[valueStyle]"
v-if=
"value"
>
{{
value
}}
</text>
},
</view>
titleStyle
<view
v-else
class=
"u-slot-wrap"
>
]"
<slot
name=
"right"
></slot>
>
<block
v-if=
"title"
>
{{
title
}}
</block>
<slot
name=
"title"
v-else
></slot>
<view
class=
"u-cell__label"
v-if=
"label || $slots.label"
:style=
"[labelStyle]"
>
<block
v-if=
"label"
>
{{
label
}}
</block>
<slot
name=
"label"
v-else
></slot>
</view>
</view>
<view
:style=
"[arrowStyle]"
class=
"u-icon-wrap"
>
<u-icon
v-if=
"arrow"
size=
"26"
class=
"u-arror-right"
color=
"#969799"
name=
"arrow-right"
></u-icon>
</view>
</view>
<view
class=
"u-cell__value"
:style=
"[valueStyle]"
>
<block
class=
"u-cell__value"
v-if=
"value"
>
{{
value
}}
</block>
<slot
v-else
></slot>
</view>
</view>
<view
class=
"u-cell-label"
v-if=
"label"
:style=
"[labelStyle]"
>
<u-icon
v-if=
"arrow"
name=
"arrow-right"
:style=
"[arrowStyle]"
class=
"u-icon-wrap u-cell__right-icon-wrap"
></u-icon>
{{
label
}}
<view
class=
"u-flex"
v-else
>
<slot
name=
"right-icon"
></slot>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
/**
/**
* cellItem 单元格Item
* cellItem 单元格Item
* @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-group使用
* @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-group使用
* @tutorial https://www.uviewui.com/components/cell.html
* @tutorial https://www.uviewui.com/components/cell.html
...
@@ -39,19 +51,22 @@
...
@@ -39,19 +51,22 @@
* @property {String} icon 左侧图标名,只支持uView内置图标,见Icon 图标
* @property {String} icon 左侧图标名,只支持uView内置图标,见Icon 图标
* @property {String} value 右侧内容
* @property {String} value 右侧内容
* @property {String} label 标题下方的描述信息
* @property {String} label 标题下方的描述信息
* @property {Boolean} border 是否显示每个cell的下边框(默认true)
* @property {Boolean} border-bottom 是否显示每个cell的下边框(默认true)
* @property {Boolean} hover 是否开启点击反馈,hover-class形式,如果右侧通过slot传递switch进去的话,可以将此值设置为false(默认true)
* @property {String} hover-class 是否开启点击反馈,none为无效果(默认true)
* @property {Boolean} border-gap border-bottom为true时,Cell列表中间的条目的下边框是否与左边有一个间隔(默认true)
* @property {Boolean} arrow 是否显示右侧箭头(默认true)
* @property {Boolean} arrow 是否显示右侧箭头(默认true)
* @property {Boolean} arrow-direction 箭头方向,可选值(默认right)
* @property {Boolean} required 箭头方向,可选值(默认right)
* @property {Boolean} arrow-direction 是否显示左边表示必填的星号(默认false)
* @property {Object} title-style 标题样式,对象形式
* @property {Object} title-style 标题样式,对象形式
* @property {Object} value-style 右侧内容样式,对象形式
* @property {Object} value-style 右侧内容样式,对象形式
* @property {Object} label-style 标题下方描述信息的样式,对象形式
* @property {Object} label-style 标题下方描述信息的样式,对象形式
* @property {String} bg-color 背景颜色(默认#ffffff
)
* @property {String} bg-color 背景颜色(默认transparent
)
* @property {String Number} index 用于在click事件回调中返回,标识当前是第几个Item
* @property {String Number} index 用于在click事件回调中返回,标识当前是第几个Item
* @property {String Number} title-width 标题的宽度,单位rpx
* @example <u-cell-item icon="integral-fill" title="会员等级" value="新版本"></u-cell-item>
* @example <u-cell-item icon="integral-fill" title="会员等级" value="新版本"></u-cell-item>
*/
*/
export
default
{
export
default
{
name
:
"
u-cell-item
"
,
name
:
'
u-cell-item
'
,
props
:
{
props
:
{
// 左侧图标名称(只能uView内置图标),或者图标src
// 左侧图标名称(只能uView内置图标),或者图标src
icon
:
{
icon
:
{
...
@@ -74,20 +89,40 @@
...
@@ -74,20 +89,40 @@
default
:
''
default
:
''
},
},
// 是否显示内边框
// 是否显示内边框
border
:
{
borderBottom
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
// 是否开启点击反馈,即点击是cell背景为灰色
// 多个cell中,中间的cell显示下划线时,下划线是否给一个到左边的距离
hover
:
{
borderGap
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
// 是否开启点击反馈,即点击时cell背景为灰色,none为无效果
hoverClass
:
{
type
:
String
,
default
:
'
u-cell-hover
'
},
// 是否显示右侧箭头
// 是否显示右侧箭头
arrow
:
{
arrow
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
// 内容是否垂直居中
center
:
{
type
:
Boolean
,
default
:
false
},
// 是否显示左边表示必填的星号
required
:
{
type
:
Boolean
,
default
:
false
},
// 标题的宽度,单位rpx
titleWidth
:
{
type
:
[
Number
,
String
],
default
:
''
},
// 右侧箭头方向,可选值:right|up|down,默认为right
// 右侧箭头方向,可选值:right|up|down,默认为right
arrowDirection
:
{
arrowDirection
:
{
type
:
String
,
type
:
String
,
...
@@ -96,40 +131,50 @@
...
@@ -96,40 +131,50 @@
// 控制标题的样式
// 控制标题的样式
titleStyle
:
{
titleStyle
:
{
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{};
return
{};
}
}
},
},
// 右侧显示内容的样式
// 右侧显示内容的样式
valueStyle
:
{
valueStyle
:
{
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{};
return
{};
}
}
},
},
// 描述信息的样式
// 描述信息的样式
labelStyle
:
{
labelStyle
:
{
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{};
return
{};
}
}
},
},
// 背景颜色
// 背景颜色
bgColor
:
{
bgColor
:
{
type
:
String
,
type
:
String
,
default
:
'
#ffffff
'
default
:
'
transparent
'
},
},
// 用于识别被点击的是第几个cell
// 用于识别被点击的是第几个cell
index
:
{
index
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
default
:
''
default
:
''
},
// 是否使用lable插槽
useLabelSlot
:
{
type
:
Boolean
,
default
:
false
},
// 左边图标的大小,单位rpx,只对传入icon字段时有效
iconSize
:
{
type
:
[
Number
,
String
],
default
:
34
}
}
},
},
inject
:
[
'
uCellGroup
'
],
inject
:
[
'
uCellGroup
'
],
data
()
{
data
()
{
return
{
return
{
itemIndex
:
0
,
itemIndex
:
0
}
};
},
},
created
()
{
created
()
{
this
.
itemIndex
=
this
.
uCellGroup
.
index
++
;
this
.
itemIndex
=
this
.
uCellGroup
.
index
++
;
...
@@ -137,8 +182,8 @@
...
@@ -137,8 +182,8 @@
computed
:
{
computed
:
{
arrowStyle
()
{
arrowStyle
()
{
let
style
=
{};
let
style
=
{};
if
(
this
.
arrowDirection
==
'
to
p
'
)
style
.
transform
=
'
rotate(-90deg)
'
;
if
(
this
.
arrowDirection
==
'
u
p
'
)
style
.
transform
=
'
rotate(-90deg)
'
;
else
if
(
this
.
arrowDirection
==
'
bottom
'
)
style
.
transform
=
'
rotate(90deg)
'
;
else
if
(
this
.
arrowDirection
==
'
down
'
)
style
.
transform
=
'
rotate(90deg)
'
;
else
style
.
transform
=
'
rotate(0deg)
'
;
else
style
.
transform
=
'
rotate(0deg)
'
;
return
style
;
return
style
;
}
}
...
@@ -148,80 +193,98 @@
...
@@ -148,80 +193,98 @@
this
.
$emit
(
'
click
'
,
this
.
index
);
this
.
$emit
(
'
click
'
,
this
.
index
);
}
}
}
}
}
};
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.u-cell-item-box
{
.u-cell
{
padding
:
28rpx
32rpx
;
position
:
relative
;
position
:
relative
;
}
display
:
flex
;
box-sizing
:
border-box
;
width
:
100%
;
padding
:
20rpx
32rpx
;
font-size
:
28rpx
;
line-height
:
48rpx
;
color
:
$u-content-color
;
background-color
:
#fff
;
text-align
:
left
;
}
.u-cell-border
:after
{
.u-cell_title
{
left
:
32rpx
!
important
;
font-size
:
28rpx
;
}
.u-cell__left-icon-wrap
{
margin-right
:
10rpx
;
font-size
:
32rpx
;
}
.u-cell__right-icon-wrap
{
margin-left
:
10rpx
;
color
:
#969799
;
font-size
:
28rpx
;
}
.u-cell__left-icon-wrap
,
.u-cell__right-icon-wrap
{
display
:
flex
;
align-items
:
center
;
height
:
48rpx
;
}
.u-cell-border
:after
{
position
:
absolute
;
position
:
absolute
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
content
:
' '
;
content
:
' '
;
pointer-events
:
none
;
pointer-events
:
none
;
right
:
0
;
right
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
border-bottom
:
1px
solid
$u-border-color
;
border-bottom
:
1px
solid
$u-border-color
;
-webkit-transform
:
scaleY
(
0
.5
);
-webkit-transform
:
scaleY
(
0
.5
);
transform
:
scaleY
(
0
.5
);
transform
:
scaleY
(
0
.5
);
}
}
.u-cell-content
{
.u-cell-border
{
display
:
flex
;
position
:
relative
;
align-items
:
center
;
}
}
.u-cell-title
{
.u-border-gap
:after
{
color
:
#323233
;
left
:
32rpx
!
important
;
font-size
:
30rpx
;
}
flex
:
1
;
margin-left
:
6rpx
;
text-align
:
left
;
}
.u-cell-value
{
.u-cell__label
{
flex
:
1
;
margin-top
:
6rpx
;
font-size
:
26rpx
;
font-size
:
26rpx
;
color
:
#969799
;
line-height
:
36rpx
;
text-align
:
right
;
color
:
$u-tips-color
;
}
}
.u-cell-label
{
.u-cell__value
{
color
:
#969799
;
overflow
:
hidden
;
text-align
:
right
;
vertical-align
:
middle
;
color
:
$u-tips-color
;
font-size
:
26rpx
;
font-size
:
26rpx
;
margin-top
:
10rpx
;
}
text-align
:
left
;
}
.u-slot-wrap
{
.u-cell__title
,
display
:
flex
;
.u-cell__value
{
align-items
:
center
;
flex
:
1
;
}
}
// 微信小程序需要额外处理可能通过slot传入badge和switch的问题
.u-cell--required
{
// 否则无法垂直居中
overflow
:
visible
;
/* #ifdef MP-WEIXIN */
.u-slot-wrap
/
deep
/
u-badge
,
.u-slot-wrap
/
deep
/
u-switch
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
}
}
/* #endif */
.u-cell--required
:before
{
position
:
absolute
;
.u-icon
{
content
:
'*'
;
margin-right
:
6rpx
;
left
:
8px
;
}
margin-top
:
4rpx
;
font-size
:
14px
;
.u-value-text
{
color
:
$u-type-error
;
margin-right
:
10rpx
;
}
}
.u-title-text
{
margin-right
:
10rpx
;
}
</
style
>
</
style
>
uview/components/u-form-item/u-form-item.vue
0 → 100644
View file @
b443a0a4
<
template
>
<view
class=
"u-form-item"
>
<slot
/>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
uview/components/u-form/u-form.vue
0 → 100644
View file @
b443a0a4
<
template
>
<view
class=
"u-form"
>
<slot
/>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
uview/components/u-icon/u-icon.vue
View file @
b443a0a4
<
template
>
<
template
>
<text
class=
"uicon"
:class=
"customClass"
:style=
"
{
<text
class=
"uicon"
:class=
"customClass"
:style=
"[iconStyle]"
@
tap=
"click"
:hover-class=
"hoverClass"
@
touchstart=
"touchstart"
></text>
color: color,
fontSize: size + 'rpx',
fontWeight: bold ? 'bold' : 'normal',
}"
@tap="click" :hover-class="hoverClass" @touchstart="touchstart">
</text>
</
template
>
</
template
>
<
script
>
<
script
>
/**
/**
* icon 图标
* icon 图标
* @description 基于字体的图标集,包含了大多数常见场景的图标。
* @description 基于字体的图标集,包含了大多数常见场景的图标。
* @tutorial https://www.uviewui.com/components/icon.html
* @tutorial https://www.uviewui.com/components/icon.html
...
@@ -22,8 +15,8 @@
...
@@ -22,8 +15,8 @@
* @event {Function} click 点击图标时触发
* @event {Function} click 点击图标时触发
* @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
* @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
*/
*/
export
default
{
export
default
{
name
:
"
u-icon
"
,
name
:
'
u-icon
'
,
props
:
{
props
:
{
// 图标类名
// 图标类名
name
:
{
name
:
{
...
@@ -33,7 +26,7 @@
...
@@ -33,7 +26,7 @@
// 图标颜色
// 图标颜色
color
:
{
color
:
{
type
:
String
,
type
:
String
,
default
:
'
inherit
'
default
:
'
'
},
},
// 字体大小,单位rpx
// 字体大小,单位rpx
size
:
{
size
:
{
...
@@ -62,9 +55,7 @@
...
@@ -62,9 +55,7 @@
}
}
},
},
data
()
{
data
()
{
return
{
return
{};
}
},
},
computed
:
{
computed
:
{
customClass
()
{
customClass
()
{
...
@@ -74,6 +65,15 @@
...
@@ -74,6 +65,15 @@
if
(
this
.
customPrefix
==
'
uicon
'
)
classes
.
push
(
'
u-iconfont
'
);
if
(
this
.
customPrefix
==
'
uicon
'
)
classes
.
push
(
'
u-iconfont
'
);
else
classes
.
push
(
this
.
customPrefix
);
else
classes
.
push
(
this
.
customPrefix
);
return
classes
;
return
classes
;
},
iconStyle
()
{
let
style
=
{};
style
=
{
fontSize
:
this
.
size
+
'
rpx
'
,
fontWeight
:
this
.
bold
?
'
bold
'
:
'
normal
'
};
if
(
this
.
color
)
style
.
color
=
this
.
color
;
return
style
;
}
}
},
},
methods
:
{
methods
:
{
...
@@ -84,14 +84,14 @@
...
@@ -84,14 +84,14 @@
this
.
$emit
(
'
touchstart
'
,
this
.
index
);
this
.
$emit
(
'
touchstart
'
,
this
.
index
);
}
}
}
}
}
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
@import
'../../../uview/iconfont.css'
;
@import
'../../../uview/iconfont.css'
;
.uicon
{
.uicon
{
display
:
inline-flex
;
display
:
inline-flex
;
align-items
:
center
;
align-items
:
center
;
}
}
</
style
>
</
style
>
uview/components/u-upload/u-upload.vue
View file @
b443a0a4
...
@@ -198,7 +198,7 @@
...
@@ -198,7 +198,7 @@
this
.
lists
.
push
({
url
:
value
.
url
,
error
:
false
,
progress
:
100
});
this
.
lists
.
push
({
url
:
value
.
url
,
error
:
false
,
progress
:
100
});
})
})
}
}
}
}
,
},
},
methods
:
{
methods
:
{
// 清除列表
// 清除列表
...
@@ -369,6 +369,14 @@
...
@@ -369,6 +369,14 @@
}
}
});
});
},
},
// 用户通过ref手动的形式,移除一张图片
remove
(
index
)
{
// 判断索引的合法范围
if
(
index
>=
0
&&
index
<
this
.
lists
.
length
)
{
this
.
lists
.
splice
(
index
,
1
);
this
.
$emit
(
'
on-list-change
'
,
this
.
lists
);
}
},
// 预览图片
// 预览图片
doPreviewImage
(
url
,
index
)
{
doPreviewImage
(
url
,
index
)
{
if
(
!
this
.
previewFullImage
)
if
(
!
this
.
previewFullImage
)
...
...
uview/iconfont.css
View file @
b443a0a4
This diff is collapsed.
Click to expand it.
uview/index.scss
View file @
b443a0a4
...
@@ -58,12 +58,16 @@ u-icon {
...
@@ -58,12 +58,16 @@ u-icon {
}
}
/* end-iPhoneX底部安全区定义--end */
/* end-iPhoneX底部安全区定义--end */
/* start--
hover-class
-start */
/* start--
各种hover点击反馈相关的类名
-start */
.u-hover-class
{
.u-hover-class
{
// background-color: #f7f8f9!important;
// background-color: #f7f8f9!important;
opacity
:
0
.6
;
opacity
:
0
.6
;
}
}
/* end--hover-class--end */
.u-cell-hover
{
background-color
:
#f7f8f9
!
important
;
}
/* end--各种hover点击反馈相关的类名--end */
/* start--文本行数限制--start */
/* start--文本行数限制--start */
.u-line-1
{
.u-line-1
{
...
...
uview/libs/request/index.js
View file @
b443a0a4
c
lass
Request
{
c
onst
Request
=
{
config
=
{
config
:
{
baseUrl
:
''
,
// 请求的根域名
baseUrl
:
''
,
// 请求的根域名
// 默认的请求头
// 默认的请求头
header
:
{
header
:
{
...
@@ -16,28 +16,28 @@ class Request {
...
@@ -16,28 +16,28 @@ class Request {
timer
:
null
,
// 定时器
timer
:
null
,
// 定时器
originalData
:
false
,
// 是否在拦截器中返回服务端的原始数据,见文档说明
originalData
:
false
,
// 是否在拦截器中返回服务端的原始数据,见文档说明
loadingMask
:
true
,
// 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
loadingMask
:
true
,
// 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
}
}
,
// 判断是否http|https开头的URL
// 判断是否http|https开头的URL
static
isHttp
(
url
)
{
isHttp
:
(
url
)
=>
{
return
/
(
http|https
)
:
\/\/([\w
.
]
+
\/?)\S
*/
.
test
(
url
)
return
/
(
http|https
)
:
\/\/([\w
.
]
+
\/?)\S
*/
.
test
(
url
)
}
}
,
// 拦截器
// 拦截器
interceptor
=
{
interceptor
:
{
// 请求前的拦截
// 请求前的拦截
request
:
null
,
request
:
null
,
// 请求后的拦截
// 请求后的拦截
response
:
null
response
:
null
}
}
,
// 设置全局默认配置
// 设置全局默认配置
setConfig
(
customConfig
)
{
setConfig
:
(
customConfig
)
=>
{
this
.
config
=
Object
.
assign
(
this
.
config
,
customConfig
);
this
.
config
=
Object
.
assign
(
this
.
config
,
customConfig
);
}
}
,
// 主要请求部分
// 主要请求部分
async
request
(
options
=
{})
{
request
:
(
options
=
{})
=>
{
// 检查请求拦截
// 检查请求拦截
if
(
this
.
interceptor
.
request
&&
typeof
this
.
interceptor
.
request
===
'
function
'
)
{
if
(
this
.
interceptor
.
request
&&
typeof
this
.
interceptor
.
request
===
'
function
'
)
{
let
tmpConfig
=
{};
let
tmpConfig
=
{};
...
@@ -119,41 +119,40 @@ class Request {
...
@@ -119,41 +119,40 @@ class Request {
}
}
uni
.
request
(
options
);
uni
.
request
(
options
);
})
})
}
}
,
constructor
()
{
// get请求
// get请求
this
.
get
=
(
url
,
data
=
{},
header
=
{})
=>
{
get
:
(
url
,
data
=
{},
header
=
{})
=>
{
return
this
.
request
({
return
this
.
request
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
,
url
,
header
,
header
,
data
data
})
})
}
}
,
// post请求
// post请求
this
.
post
=
(
url
,
data
=
{},
header
=
{})
=>
{
post
:
(
url
,
data
=
{},
header
=
{})
=>
{
return
this
.
request
({
return
this
.
request
({
url
,
url
,
method
:
'
POST
'
,
method
:
'
POST
'
,
header
,
header
,
data
data
})
})
}
}
,
// put请求,不支持支付宝小程序(HX2.6.15)
// put请求,不支持支付宝小程序(HX2.6.15)
this
.
put
=
(
url
,
data
=
{},
header
=
{})
=>
{
put
:
(
url
,
data
=
{},
header
=
{})
=>
{
return
this
.
request
({
return
this
.
request
({
url
,
url
,
method
:
'
PUT
'
,
method
:
'
PUT
'
,
header
,
header
,
data
data
})
})
}
}
,
// delete请求,不支持支付宝和头条小程序(HX2.6.15)
// delete请求,不支持支付宝和头条小程序(HX2.6.15)
this
.
delete
=
(
url
,
data
=
{},
header
=
{})
=>
{
delete
:
(
url
,
data
=
{},
header
=
{})
=>
{
return
this
.
request
({
return
this
.
request
({
url
,
url
,
method
:
'
DELETE
'
,
method
:
'
DELETE
'
,
...
@@ -161,6 +160,5 @@ class Request {
...
@@ -161,6 +160,5 @@ class Request {
data
data
})
})
}
}
}
}
}
export
default
new
Request
export
default
Request
uview/package.json
0 → 100644
View file @
b443a0a4
{
"name"
:
"uview"
,
"version"
:
"1.1.6"
,
"description"
:
"uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水"
,
"main"
:
"uview/index.js"
,
"keyword"
:
[
"uview"
,
"uView"
,
"uni-app"
,
"uniapp"
,
"uviewui"
,
"uview ui"
,
"uviewUI"
,
"uViewui"
,
"uViewUI"
,
"uView UI"
,
"uni ui"
,
"uni UI"
,
"uniapp ui"
,
"ui"
,
"UI框架"
,
"uniapp ui框架"
,
"uniapp UI"
],
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
""
},
"files"
:
[
"uview"
],
"author"
:
"uView"
,
"license"
:
"MIT"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment