Skip to content

Commit 62c7139

Browse files
committed
update(uni-ui): uni-ui日常更新
1 parent 5b1724a commit 62c7139

File tree

10 files changed

+767
-450
lines changed

10 files changed

+767
-450
lines changed

components/uni-badge/uni-badge.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<text v-if="text" :class="inverted ? 'uni-badge--' + type + ' uni-badge--' + size + ' uni-badge--' + type + '-inverted' : 'uni-badge--' + type + ' uni-badge--' + size" class="uni-badge" @click="onClick()">{{ text }}</text>
2+
<text v-if="text" :class="inverted ? 'uni-badge--' + type + ' uni-badge--' + size + ' uni-badge--' + type + '-inverted' : 'uni-badge--' + type + ' uni-badge--' + size" :style="badgeStyle" class="uni-badge" @click="onClick()">{{ text }}</text>
33
</template>
44

55
<script>
@@ -43,10 +43,21 @@
4343
},
4444
data() {
4545
return {
46-
46+
badgeStyle: ''
4747
};
4848
},
49+
watch: {
50+
text() {
51+
this.setStyle()
52+
}
53+
},
54+
mounted() {
55+
this.setStyle()
56+
},
4957
methods: {
58+
setStyle() {
59+
this.badgeStyle = `width: ${String(this.text).length * 8 + 12}px`
60+
},
5061
onClick() {
5162
this.$emit('click');
5263
}
@@ -59,9 +70,10 @@
5970
/* #ifndef APP-PLUS */
6071
display: flex;
6172
/* #endif */
73+
justify-content: center;
6274
flex-direction: row;
63-
height: 40rpx;
64-
line-height: 40rpx;
75+
height: 20px;
76+
line-height: 20px;
6577
color: #333;
6678
border-radius: 100px;
6779
background-color: #f1f1f1;

components/uni-goods-nav/uni-goods-nav.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<view class="flex uni-tab__cart-sub-left">
77
<view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
88
<view class="uni-tab__icon">
9-
<image class="image" :src="item.icon" mode="widthFix" />
9+
<uni-icons :type="item.icon" size="20" color="#646566"></uni-icons>
10+
<!-- <image class="image" :src="item.icon" mode="widthFix" /> -->
1011
</view>
1112
<text class="uni-tab__text">{{ item.text }}</text>
1213
<view class="flex uni-tab__dot-box">
@@ -23,6 +24,7 @@
2324
</template>
2425

2526
<script>
27+
import uniIcons from '../uni-icons/uni-icons.vue'
2628
/**
2729
* GoodsNav 商品导航
2830
* @description 商品加入购物车、立即购买等
@@ -36,15 +38,18 @@
3638
*/
3739
export default {
3840
name: 'UniGoodsNav',
41+
components: {
42+
uniIcons
43+
},
3944
props: {
4045
options: {
4146
type: Array,
4247
default () {
4348
return [{
44-
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/uni-ui/goodsnav/dianpu.png',
49+
icon: 'shop',
4550
text: '店铺'
4651
}, {
47-
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/uni-ui/goodsnav/carts.png',
52+
icon: 'cart',
4853
text: '购物车'
4954
}]
5055
}

components/uni-icons/icons.js

Lines changed: 130 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,132 @@
11
export default {
2-
'contact': '\ue100',
3-
'person': '\ue101',
4-
'personadd': '\ue102',
5-
'contact-filled': '\ue130',
6-
'person-filled': '\ue131',
7-
'personadd-filled': '\ue132',
8-
'phone': '\ue200',
9-
'email': '\ue201',
10-
'chatbubble': '\ue202',
11-
'chatboxes': '\ue203',
12-
'phone-filled': '\ue230',
13-
'email-filled': '\ue231',
14-
'chatbubble-filled': '\ue232',
15-
'chatboxes-filled': '\ue233',
16-
'weibo': '\ue260',
17-
'weixin': '\ue261',
18-
'pengyouquan': '\ue262',
19-
'chat': '\ue263',
20-
'qq': '\ue264',
21-
'videocam': '\ue300',
22-
'camera': '\ue301',
23-
'mic': '\ue302',
24-
'location': '\ue303',
25-
'mic-filled': '\ue332',
26-
'speech': '\ue332',
27-
'location-filled': '\ue333',
28-
'micoff': '\ue360',
29-
'image': '\ue363',
30-
'map': '\ue364',
31-
'compose': '\ue400',
32-
'trash': '\ue401',
33-
'upload': '\ue402',
34-
'download': '\ue403',
35-
'close': '\ue404',
36-
'redo': '\ue405',
37-
'undo': '\ue406',
38-
'refresh': '\ue407',
39-
'star': '\ue408',
40-
'plus': '\ue409',
41-
'minus': '\ue410',
42-
'circle': '\ue411',
43-
'checkbox': '\ue411',
44-
'close-filled': '\ue434',
45-
'clear': '\ue434',
46-
'refresh-filled': '\ue437',
47-
'star-filled': '\ue438',
48-
'plus-filled': '\ue439',
49-
'minus-filled': '\ue440',
50-
'circle-filled': '\ue441',
51-
'checkbox-filled': '\ue442',
52-
'closeempty': '\ue460',
53-
'refreshempty': '\ue461',
54-
'reload': '\ue462',
55-
'starhalf': '\ue463',
56-
'spinner': '\ue464',
57-
'spinner-cycle': '\ue465',
58-
'search': '\ue466',
59-
'plusempty': '\ue468',
60-
'forward': '\ue470',
61-
'back': '\ue471',
62-
'left-nav': '\ue471',
63-
'checkmarkempty': '\ue472',
64-
'home': '\ue500',
65-
'navigate': '\ue501',
66-
'gear': '\ue502',
67-
'paperplane': '\ue503',
68-
'info': '\ue504',
69-
'help': '\ue505',
70-
'locked': '\ue506',
71-
'more': '\ue507',
72-
'flag': '\ue508',
73-
'home-filled': '\ue530',
74-
'gear-filled': '\ue532',
75-
'info-filled': '\ue534',
76-
'help-filled': '\ue535',
77-
'more-filled': '\ue537',
78-
'settings': '\ue560',
79-
'list': '\ue562',
80-
'bars': '\ue563',
81-
'loop': '\ue565',
82-
'paperclip': '\ue567',
83-
'eye': '\ue568',
84-
'arrowup': '\ue580',
85-
'arrowdown': '\ue581',
86-
'arrowleft': '\ue582',
87-
'arrowright': '\ue583',
88-
'arrowthinup': '\ue584',
89-
'arrowthindown': '\ue585',
90-
'arrowthinleft': '\ue586',
91-
'arrowthinright': '\ue587',
92-
'pulldown': '\ue588',
93-
'closefill': '\ue589',
94-
'sound': '\ue590',
95-
'scan': '\ue612'
2+
"pulldown": "\ue588",
3+
"refreshempty": "\ue461",
4+
"back": "\ue471",
5+
"forward": "\ue470",
6+
"more": "\ue507",
7+
"more-filled": "\ue537",
8+
"scan": "\ue612",
9+
"qq": "\ue264",
10+
"weibo": "\ue260",
11+
"weixin": "\ue261",
12+
"pengyouquan": "\ue262",
13+
"loop": "\ue565",
14+
"refresh": "\ue407",
15+
"refresh-filled": "\ue437",
16+
"arrowthindown": "\ue585",
17+
"arrowthinleft": "\ue586",
18+
"arrowthinright": "\ue587",
19+
"arrowthinup": "\ue584",
20+
"undo-filled": "\ue7d6",
21+
"undo": "\ue406",
22+
"redo": "\ue405",
23+
"redo-filled": "\ue7d9",
24+
"bars": "\ue563",
25+
"chatboxes": "\ue203",
26+
"camera": "\ue301",
27+
"chatboxes-filled": "\ue233",
28+
"camera-filled": "\ue7ef",
29+
"cart-filled": "\ue7f4",
30+
"cart": "\ue7f5",
31+
"checkbox-filled": "\ue442",
32+
"checkbox": "\ue7fa",
33+
"arrowleft": "\ue582",
34+
"arrowdown": "\ue581",
35+
"arrowright": "\ue583",
36+
"smallcircle-filled": "\ue801",
37+
"arrowup": "\ue580",
38+
"circle": "\ue411",
39+
"eye-filled": "\ue568",
40+
"eye-slash-filled": "\ue822",
41+
"eye-slash": "\ue823",
42+
"eye": "\ue824",
43+
"flag-filled": "\ue825",
44+
"flag": "\ue508",
45+
"gear-filled": "\ue532",
46+
"reload": "\ue462",
47+
"gear": "\ue502",
48+
"hand-thumbsdown-filled": "\ue83b",
49+
"hand-thumbsdown": "\ue83c",
50+
"hand-thumbsup-filled": "\ue83d",
51+
"heart-filled": "\ue83e",
52+
"hand-thumbsup": "\ue83f",
53+
"heart": "\ue840",
54+
"home": "\ue500",
55+
"info": "\ue504",
56+
"home-filled": "\ue530",
57+
"info-filled": "\ue534",
58+
"circle-filled": "\ue441",
59+
"chat-filled": "\ue847",
60+
"chat": "\ue263",
61+
"mail-open-filled": "\ue84d",
62+
"email-filled": "\ue231",
63+
"mail-open": "\ue84e",
64+
"email": "\ue201",
65+
"checkmarkempty": "\ue472",
66+
"list": "\ue562",
67+
"locked-filled": "\ue856",
68+
"locked": "\ue506",
69+
"map-filled": "\ue85c",
70+
"map-pin": "\ue85e",
71+
"map-pin-ellipse": "\ue864",
72+
"map": "\ue364",
73+
"minus-filled": "\ue440",
74+
"mic-filled": "\ue332",
75+
"minus": "\ue410",
76+
"micoff": "\ue360",
77+
"mic": "\ue302",
78+
"clear": "\ue434",
79+
"smallcircle": "\ue868",
80+
"close": "\ue404",
81+
"closeempty": "\ue460",
82+
"paperclip": "\ue567",
83+
"paperplane": "\ue503",
84+
"paperplane-filled": "\ue86e",
85+
"person-filled": "\ue131",
86+
"contact-filled": "\ue130",
87+
"person": "\ue101",
88+
"contact": "\ue100",
89+
"images-filled": "\ue87a",
90+
"phone": "\ue200",
91+
"images": "\ue87b",
92+
"image": "\ue363",
93+
"image-filled": "\ue877",
94+
"location-filled": "\ue333",
95+
"location": "\ue303",
96+
"plus-filled": "\ue439",
97+
"plus": "\ue409",
98+
"plusempty": "\ue468",
99+
"help-filled": "\ue535",
100+
"help": "\ue505",
101+
"navigate-filled": "\ue884",
102+
"navigate": "\ue501",
103+
"mic-slash-filled": "\ue892",
104+
"search": "\ue466",
105+
"settings": "\ue560",
106+
"sound": "\ue590",
107+
"sound-filled": "\ue8a1",
108+
"spinner-cycle": "\ue465",
109+
"download-filled": "\ue8a4",
110+
"personadd-filled": "\ue132",
111+
"videocam-filled": "\ue8af",
112+
"personadd": "\ue102",
113+
"upload": "\ue402",
114+
"upload-filled": "\ue8b1",
115+
"starhalf": "\ue463",
116+
"star-filled": "\ue438",
117+
"star": "\ue408",
118+
"trash": "\ue401",
119+
"phone-filled": "\ue230",
120+
"compose": "\ue400",
121+
"videocam": "\ue300",
122+
"trash-filled": "\ue8dc",
123+
"download": "\ue403",
124+
"chatbubble-filled": "\ue232",
125+
"chatbubble": "\ue202",
126+
"cloud-download": "\ue8e4",
127+
"cloud-upload-filled": "\ue8e5",
128+
"cloud-upload": "\ue8e6",
129+
"cloud-download-filled": "\ue8e9",
130+
"headphones":"\ue8bf",
131+
"shop":"\ue609"
96132
}

components/uni-icons/uni-icons.vue

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

components/uni-link/uni-link.vue

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template>
2+
<text class="uni-link" :class="{'uni-link--withline':showUnderLine===true||showUnderLine==='true'}" :style="{color,fontSize:fontSize+'px'}" @click="openURL">{{text}}</text>
3+
</template>
4+
5+
<script>
6+
/**
7+
* Link 外部网页超链接组件
8+
* @description uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页
9+
* @property {String} href 点击后打开的外部网页url
10+
* @property {String} text 显示的文字
11+
* @property {Boolean} showUnderLine 是否显示下划线
12+
* @property {String} copyTips 在小程序端复制链接时显示的提示语
13+
* @property {String} color 链接文字颜色
14+
* @property {String} fontSize 链接文字大小
15+
* @example * <uni-link href="https://ext.dcloud.net.cn" text="https://ext.dcloud.net.cn"></uni-link>
16+
*/
17+
export default {
18+
name: 'uniLink',
19+
props: {
20+
href: {
21+
type: String,
22+
default: ''
23+
},
24+
text: {
25+
type: String,
26+
default: ''
27+
},
28+
showUnderLine: {
29+
type: [Boolean, String],
30+
default: true
31+
},
32+
copyTips: {
33+
type: String,
34+
default: '已自动复制网址,请在手机浏览器里粘贴该网址'
35+
},
36+
color: {
37+
type: String,
38+
default: '#999999'
39+
},
40+
fontSize: {
41+
type: [Number, String],
42+
default: 14
43+
}
44+
},
45+
methods: {
46+
openURL() {
47+
// #ifdef APP-PLUS
48+
plus.runtime.openURL(this.href)
49+
// #endif
50+
// #ifdef H5
51+
window.open(this.href)
52+
// #endif
53+
// #ifdef MP
54+
uni.setClipboardData({
55+
data: this.href
56+
});
57+
uni.showModal({
58+
content: this.copyTips,
59+
showCancel: false
60+
});
61+
// #endif
62+
}
63+
}
64+
}
65+
</script>
66+
67+
<style scoped>
68+
.uni-link--withline {
69+
text-decoration: underline;
70+
}
71+
</style>

pages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,10 @@
878878
{
879879
"path": "title/title",
880880
"style": {}
881+
},
882+
{
883+
"path": "link/link",
884+
"style": {}
881885
}
882886
]
883887
},

0 commit comments

Comments
 (0)