From 6057475ee0c3e9db5732ebba069b5e6adea2741c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 17 六月 2025 13:44:16 +0800
Subject: [PATCH] 商品详情页打不开-分包组件问题

---
 components/u-icon/props.js   |   89 ++++++++
 components/u-icon/u-icon.vue |  261 ++++++++++++++++++++++++++
 components/popups/popups.vue |    2 
 components/u-icon/icons.js   |  214 +++++++++++++++++++++
 4 files changed, 565 insertions(+), 1 deletions(-)

diff --git a/components/popups/popups.vue b/components/popups/popups.vue
index 48e3bb0..fbdd22c 100644
--- a/components/popups/popups.vue
+++ b/components/popups/popups.vue
@@ -11,7 +11,7 @@
 </template>
 
 <script>
-import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue';
+import UIcon from '@/components/u-icon/u-icon.vue';
 
 export default {
   components: {UIcon},
diff --git a/components/u-icon/icons.js b/components/u-icon/icons.js
new file mode 100644
index 0000000..f4d0fe2
--- /dev/null
+++ b/components/u-icon/icons.js
@@ -0,0 +1,214 @@
+export default {
+    'uicon-level': '\ue693',
+    'uicon-column-line': '\ue68e',
+    'uicon-checkbox-mark': '\ue807',
+    'uicon-folder': '\ue7f5',
+    'uicon-movie': '\ue7f6',
+    'uicon-star-fill': '\ue669',
+    'uicon-star': '\ue65f',
+    'uicon-phone-fill': '\ue64f',
+    'uicon-phone': '\ue622',
+    'uicon-apple-fill': '\ue881',
+    'uicon-chrome-circle-fill': '\ue885',
+    'uicon-backspace': '\ue67b',
+    'uicon-attach': '\ue632',
+    'uicon-cut': '\ue948',
+    'uicon-empty-car': '\ue602',
+    'uicon-empty-coupon': '\ue682',
+    'uicon-empty-address': '\ue646',
+    'uicon-empty-favor': '\ue67c',
+    'uicon-empty-permission': '\ue686',
+    'uicon-empty-news': '\ue687',
+    'uicon-empty-search': '\ue664',
+    'uicon-github-circle-fill': '\ue887',
+    'uicon-rmb': '\ue608',
+    'uicon-person-delete-fill': '\ue66a',
+    'uicon-reload': '\ue788',
+    'uicon-order': '\ue68f',
+    'uicon-server-man': '\ue6bc',
+    'uicon-search': '\ue62a',
+    'uicon-fingerprint': '\ue955',
+    'uicon-more-dot-fill': '\ue630',
+    'uicon-scan': '\ue662',
+    'uicon-share-square': '\ue60b',
+    'uicon-map': '\ue61d',
+    'uicon-map-fill': '\ue64e',
+    'uicon-tags': '\ue629',
+    'uicon-tags-fill': '\ue651',
+    'uicon-bookmark-fill': '\ue63b',
+    'uicon-bookmark': '\ue60a',
+    'uicon-eye': '\ue613',
+    'uicon-eye-fill': '\ue641',
+    'uicon-mic': '\ue64a',
+    'uicon-mic-off': '\ue649',
+    'uicon-calendar': '\ue66e',
+    'uicon-calendar-fill': '\ue634',
+    'uicon-trash': '\ue623',
+    'uicon-trash-fill': '\ue658',
+    'uicon-play-left': '\ue66d',
+    'uicon-play-right': '\ue610',
+    'uicon-minus': '\ue618',
+    'uicon-plus': '\ue62d',
+    'uicon-info': '\ue653',
+    'uicon-info-circle': '\ue7d2',
+    'uicon-info-circle-fill': '\ue64b',
+    'uicon-question': '\ue715',
+    'uicon-error': '\ue6d3',
+    'uicon-close': '\ue685',
+    'uicon-checkmark': '\ue6a8',
+    'uicon-android-circle-fill': '\ue67e',
+    'uicon-android-fill': '\ue67d',
+    'uicon-ie': '\ue87b',
+    'uicon-IE-circle-fill': '\ue889',
+    'uicon-google': '\ue87a',
+    'uicon-google-circle-fill': '\ue88a',
+    'uicon-setting-fill': '\ue872',
+    'uicon-setting': '\ue61f',
+    'uicon-minus-square-fill': '\ue855',
+    'uicon-plus-square-fill': '\ue856',
+    'uicon-heart': '\ue7df',
+    'uicon-heart-fill': '\ue851',
+    'uicon-camera': '\ue7d7',
+    'uicon-camera-fill': '\ue870',
+    'uicon-more-circle': '\ue63e',
+    'uicon-more-circle-fill': '\ue645',
+    'uicon-chat': '\ue620',
+    'uicon-chat-fill': '\ue61e',
+    'uicon-bag-fill': '\ue617',
+    'uicon-bag': '\ue619',
+    'uicon-error-circle-fill': '\ue62c',
+    'uicon-error-circle': '\ue624',
+    'uicon-close-circle': '\ue63f',
+    'uicon-close-circle-fill': '\ue637',
+    'uicon-checkmark-circle': '\ue63d',
+    'uicon-checkmark-circle-fill': '\ue635',
+    'uicon-question-circle-fill': '\ue666',
+    'uicon-question-circle': '\ue625',
+    'uicon-share': '\ue631',
+    'uicon-share-fill': '\ue65e',
+    'uicon-shopping-cart': '\ue621',
+    'uicon-shopping-cart-fill': '\ue65d',
+    'uicon-bell': '\ue609',
+    'uicon-bell-fill': '\ue640',
+    'uicon-list': '\ue650',
+    'uicon-list-dot': '\ue616',
+    'uicon-zhihu': '\ue6ba',
+    'uicon-zhihu-circle-fill': '\ue709',
+    'uicon-zhifubao': '\ue6b9',
+    'uicon-zhifubao-circle-fill': '\ue6b8',
+    'uicon-weixin-circle-fill': '\ue6b1',
+    'uicon-weixin-fill': '\ue6b2',
+    'uicon-twitter-circle-fill': '\ue6ab',
+    'uicon-twitter': '\ue6aa',
+    'uicon-taobao-circle-fill': '\ue6a7',
+    'uicon-taobao': '\ue6a6',
+    'uicon-weibo-circle-fill': '\ue6a5',
+    'uicon-weibo': '\ue6a4',
+    'uicon-qq-fill': '\ue6a1',
+    'uicon-qq-circle-fill': '\ue6a0',
+    'uicon-moments-circel-fill': '\ue69a',
+    'uicon-moments': '\ue69b',
+    'uicon-qzone': '\ue695',
+    'uicon-qzone-circle-fill': '\ue696',
+    'uicon-baidu-circle-fill': '\ue680',
+    'uicon-baidu': '\ue681',
+    'uicon-facebook-circle-fill': '\ue68a',
+    'uicon-facebook': '\ue689',
+    'uicon-car': '\ue60c',
+    'uicon-car-fill': '\ue636',
+    'uicon-warning-fill': '\ue64d',
+    'uicon-warning': '\ue694',
+    'uicon-clock-fill': '\ue638',
+    'uicon-clock': '\ue60f',
+    'uicon-edit-pen': '\ue612',
+    'uicon-edit-pen-fill': '\ue66b',
+    'uicon-email': '\ue611',
+    'uicon-email-fill': '\ue642',
+    'uicon-minus-circle': '\ue61b',
+    'uicon-minus-circle-fill': '\ue652',
+    'uicon-plus-circle': '\ue62e',
+    'uicon-plus-circle-fill': '\ue661',
+    'uicon-file-text': '\ue663',
+    'uicon-file-text-fill': '\ue665',
+    'uicon-pushpin': '\ue7e3',
+    'uicon-pushpin-fill': '\ue86e',
+    'uicon-grid': '\ue673',
+    'uicon-grid-fill': '\ue678',
+    'uicon-play-circle': '\ue647',
+    'uicon-play-circle-fill': '\ue655',
+    'uicon-pause-circle-fill': '\ue654',
+    'uicon-pause': '\ue8fa',
+    'uicon-pause-circle': '\ue643',
+    'uicon-eye-off': '\ue648',
+    'uicon-eye-off-outline': '\ue62b',
+    'uicon-gift-fill': '\ue65c',
+    'uicon-gift': '\ue65b',
+    'uicon-rmb-circle-fill': '\ue657',
+    'uicon-rmb-circle': '\ue677',
+    'uicon-kefu-ermai': '\ue656',
+    'uicon-server-fill': '\ue751',
+    'uicon-coupon-fill': '\ue8c4',
+    'uicon-coupon': '\ue8ae',
+    'uicon-integral': '\ue704',
+    'uicon-integral-fill': '\ue703',
+    'uicon-home-fill': '\ue964',
+    'uicon-home': '\ue965',
+    'uicon-hourglass-half-fill': '\ue966',
+    'uicon-hourglass': '\ue967',
+    'uicon-account': '\ue628',
+    'uicon-plus-people-fill': '\ue626',
+    'uicon-minus-people-fill': '\ue615',
+    'uicon-account-fill': '\ue614',
+    'uicon-thumb-down-fill': '\ue726',
+    'uicon-thumb-down': '\ue727',
+    'uicon-thumb-up': '\ue733',
+    'uicon-thumb-up-fill': '\ue72f',
+    'uicon-lock-fill': '\ue979',
+    'uicon-lock-open': '\ue973',
+    'uicon-lock-opened-fill': '\ue974',
+    'uicon-lock': '\ue97a',
+    'uicon-red-packet-fill': '\ue690',
+    'uicon-photo-fill': '\ue98b',
+    'uicon-photo': '\ue98d',
+    'uicon-volume-off-fill': '\ue659',
+    'uicon-volume-off': '\ue644',
+    'uicon-volume-fill': '\ue670',
+    'uicon-volume': '\ue633',
+    'uicon-red-packet': '\ue691',
+    'uicon-download': '\ue63c',
+    'uicon-arrow-up-fill': '\ue6b0',
+    'uicon-arrow-down-fill': '\ue600',
+    'uicon-play-left-fill': '\ue675',
+    'uicon-play-right-fill': '\ue676',
+    'uicon-rewind-left-fill': '\ue679',
+    'uicon-rewind-right-fill': '\ue67a',
+    'uicon-arrow-downward': '\ue604',
+    'uicon-arrow-leftward': '\ue601',
+    'uicon-arrow-rightward': '\ue603',
+    'uicon-arrow-upward': '\ue607',
+    'uicon-arrow-down': '\ue60d',
+    'uicon-arrow-right': '\ue605',
+    'uicon-arrow-left': '\ue60e',
+    'uicon-arrow-up': '\ue606',
+    'uicon-skip-back-left': '\ue674',
+    'uicon-skip-forward-right': '\ue672',
+    'uicon-rewind-right': '\ue66f',
+    'uicon-rewind-left': '\ue671',
+    'uicon-arrow-right-double': '\ue68d',
+    'uicon-arrow-left-double': '\ue68c',
+    'uicon-wifi-off': '\ue668',
+    'uicon-wifi': '\ue667',
+    'uicon-empty-data': '\ue62f',
+    'uicon-empty-history': '\ue684',
+    'uicon-empty-list': '\ue68b',
+    'uicon-empty-page': '\ue627',
+    'uicon-empty-order': '\ue639',
+    'uicon-man': '\ue697',
+    'uicon-woman': '\ue69c',
+    'uicon-man-add': '\ue61c',
+    'uicon-man-add-fill': '\ue64c',
+    'uicon-man-delete': '\ue61a',
+    'uicon-man-delete-fill': '\ue66a',
+    'uicon-zh': '\ue70a',
+    'uicon-en': '\ue692'
+}
diff --git a/components/u-icon/props.js b/components/u-icon/props.js
new file mode 100644
index 0000000..71845b7
--- /dev/null
+++ b/components/u-icon/props.js
@@ -0,0 +1,89 @@
+export default {
+    props: {
+        // 鍥炬爣绫诲悕
+        name: {
+            type: String,
+            default: uni.$u.props.icon.name
+        },
+        // 鍥炬爣棰滆壊锛屽彲鎺ュ彈涓婚鑹�
+        color: {
+            type: String,
+            default: uni.$u.props.icon.color
+        },
+        // 瀛椾綋澶у皬锛屽崟浣峱x
+        size: {
+            type: [String, Number],
+            default: uni.$u.props.icon.size
+        },
+        // 鏄惁鏄剧ず绮椾綋
+        bold: {
+            type: Boolean,
+            default: uni.$u.props.icon.bold
+        },
+        // 鐐瑰嚮鍥炬爣鐨勬椂鍊欎紶閫掍簨浠跺嚭鍘荤殑index锛堢敤浜庡尯鍒嗙偣鍑讳簡鍝竴涓級
+        index: {
+            type: [String, Number],
+            default: uni.$u.props.icon.index
+        },
+        // 瑙︽懜鍥炬爣鏃剁殑绫诲悕
+        hoverClass: {
+            type: String,
+            default: uni.$u.props.icon.hoverClass
+        },
+        // 鑷畾涔夋墿灞曞墠缂�锛屾柟渚跨敤鎴锋墿灞曡嚜宸辩殑鍥炬爣搴�
+        customPrefix: {
+            type: String,
+            default: uni.$u.props.icon.customPrefix
+        },
+        // 鍥炬爣鍙宠竟鎴栬�呬笅闈㈢殑鏂囧瓧
+        label: {
+            type: [String, Number],
+            default: uni.$u.props.icon.label
+        },
+        // label鐨勪綅缃紝鍙兘鍙宠竟鎴栬�呬笅杈�
+        labelPos: {
+            type: String,
+            default: uni.$u.props.icon.labelPos
+        },
+        // label鐨勫ぇ灏�
+        labelSize: {
+            type: [String, Number],
+            default: uni.$u.props.icon.labelSize
+        },
+        // label鐨勯鑹�
+        labelColor: {
+            type: String,
+            default: uni.$u.props.icon.labelColor
+        },
+        // label涓庡浘鏍囩殑璺濈
+        space: {
+            type: [String, Number],
+            default: uni.$u.props.icon.space
+        },
+        // 鍥剧墖鐨刴ode
+        imgMode: {
+            type: String,
+            default: uni.$u.props.icon.imgMode
+        },
+        // 鐢ㄤ簬鏄剧ず鍥剧墖灏忓浘鏍囨椂锛屽浘鐗囩殑瀹藉害
+        width: {
+            type: [String, Number],
+            default: uni.$u.props.icon.width
+        },
+        // 鐢ㄤ簬鏄剧ず鍥剧墖灏忓浘鏍囨椂锛屽浘鐗囩殑楂樺害
+        height: {
+            type: [String, Number],
+            default: uni.$u.props.icon.height
+        },
+        // 鐢ㄤ簬瑙e喅鏌愪簺鎯呭喌涓嬶紝璁╁浘鏍囧瀭鐩村眳涓殑鐢ㄩ��
+        top: {
+            type: [String, Number],
+            default: uni.$u.props.icon.top
+        },
+        // 鏄惁闃绘浜嬩欢浼犳挱
+        stop: {
+            type: Boolean,
+            default: uni.$u.props.icon.stop
+        }
+    }
+}
diff --git a/components/u-icon/u-icon.vue b/components/u-icon/u-icon.vue
new file mode 100644
index 0000000..34f361c
--- /dev/null
+++ b/components/u-icon/u-icon.vue
@@ -0,0 +1,261 @@
+<template>
+	<view :style="[customStyle]" class="u-icon" @tap="click" :class="['u-icon--' + labelPos]">
+		<image class="u-icon__img" v-if="isImg" :src="name" :mode="imgMode" :style="[imgStyle]"></image>
+		<text v-else class="u-icon__icon" :class="customClass" :style="[iconStyle]" :hover-class="hoverClass" @touchstart="touchstart"></text>
+		<text v-if="label" class="u-icon__label" :style="{
+			color: labelColor,
+			fontSize: $u.addUnit(labelSize),
+			marginLeft: labelPos == 'right' ? $u.addUnit(marginLeft) : 0,
+			marginTop: labelPos == 'bottom' ? $u.addUnit(marginTop) : 0,
+			marginRight: labelPos == 'left' ? $u.addUnit(marginRight) : 0,
+			marginBottom: labelPos == 'top' ? $u.addUnit(marginBottom) : 0,
+		}">{{label}}</text>
+	</view>
+</template>
+
+<script>
+/**
+ * icon 鍥炬爣
+ * @description 鍩轰簬瀛椾綋鐨勫浘鏍囬泦锛屽寘鍚簡澶у鏁板父瑙佸満鏅殑鍥炬爣銆�
+ * @tutorial https://www.uviewui.com/components/icon.html
+ * @property {String} name 鍥炬爣鍚嶇О锛岃绀轰緥鍥炬爣闆�
+ * @property {String} color 鍥炬爣棰滆壊锛堥粯璁nherit锛�
+ * @property {String | Number} size 鍥炬爣瀛椾綋澶у皬锛屽崟浣峳px锛堥粯璁�32锛�
+ * @property {String | Number} label-size label瀛椾綋澶у皬锛屽崟浣峳px锛堥粯璁�28锛�
+ * @property {String} label 鍥炬爣鍙充晶鐨刲abel鏂囧瓧锛堥粯璁�28锛�
+ * @property {String} label-pos label鏂囧瓧鐩稿浜庡浘鏍囩殑浣嶇疆锛屽彧鑳絩ight鎴朾ottom锛堥粯璁ight锛�
+ * @property {String} label-color label瀛椾綋棰滆壊锛堥粯璁�#606266锛�
+ * @property {Object} custom-style icon鐨勬牱寮忥紝瀵硅薄褰㈠紡
+ * @property {String} custom-prefix 鑷畾涔夊瓧浣撳浘鏍囧簱鏃讹紝闇�瑕佸啓涓婃鍊�
+ * @property {String | Number} margin-left label鍦ㄥ彸渚ф椂涓庡浘鏍囩殑璺濈锛屽崟浣峳px锛堥粯璁�6锛�
+ * @property {String | Number} margin-top label鍦ㄤ笅鏂规椂涓庡浘鏍囩殑璺濈锛屽崟浣峳px锛堥粯璁�6锛�
+ * @property {String | Number} margin-bottom label鍦ㄤ笂鏂规椂涓庡浘鏍囩殑璺濈锛屽崟浣峳px锛堥粯璁�6锛�
+ * @property {String | Number} margin-right label鍦ㄥ乏渚ф椂涓庡浘鏍囩殑璺濈锛屽崟浣峳px锛堥粯璁�6锛�
+ * @property {String} label-pos label鐩稿浜庡浘鏍囩殑浣嶇疆锛屽彧鑳絩ight鎴朾ottom锛堥粯璁ight锛�
+ * @property {String} index 涓�涓敤浜庡尯鍒嗗涓浘鏍囩殑鍊硷紝鐐瑰嚮鍥炬爣鏃堕�氳繃click浜嬩欢浼犲嚭
+ * @property {String} hover-class 鍥炬爣鎸変笅鍘荤殑鏍峰紡绫伙紝鐢ㄦ硶鍚寀ni鐨剉iew缁勪欢鐨刪over-class鍙傛暟锛岃鎯呰瀹樼綉
+ * @property {String} width 鏄剧ず鍥剧墖灏忓浘鏍囨椂鐨勫搴�
+ * @property {String} height 鏄剧ず鍥剧墖灏忓浘鏍囨椂鐨勯珮搴�
+ * @property {String} top 鍥炬爣鍦ㄥ瀭鐩存柟鍚戜笂鐨勫畾浣�
+ * @event {Function} click 鐐瑰嚮鍥炬爣鏃惰Е鍙�
+ * @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
+ */
+export default {
+	name: 'u-icon',
+	props: {
+		// 鍥炬爣绫诲悕
+		name: {
+			type: String,
+			default: ''
+		},
+		// 鍥炬爣棰滆壊锛屽彲鎺ュ彈涓婚鑹�
+		color: {
+			type: String,
+			default: ''
+		},
+		// 瀛椾綋澶у皬锛屽崟浣峳px
+		size: {
+			type: [Number, String],
+			default: 'inherit'
+		},
+		// 鏄惁鏄剧ず绮椾綋
+		bold: {
+			type: Boolean,
+			default: false
+		},
+		// 鐐瑰嚮鍥炬爣鐨勬椂鍊欎紶閫掍簨浠跺嚭鍘荤殑index锛堢敤浜庡尯鍒嗙偣鍑讳簡鍝竴涓級
+		index: {
+			type: [Number, String],
+			default: ''
+		},
+		// 瑙︽懜鍥炬爣鏃剁殑绫诲悕
+		hoverClass: {
+			type: String,
+			default: ''
+		},
+		// 鑷畾涔夋墿灞曞墠缂�锛屾柟渚跨敤鎴锋墿灞曡嚜宸辩殑鍥炬爣搴�
+		customPrefix: {
+			type: String,
+			default: 'uicon'
+		},
+		// 鍥炬爣鍙宠竟鎴栬�呬笅闈㈢殑鏂囧瓧
+		label: {
+			type: String,
+			default: ''
+		},
+		// label鐨勪綅缃紝鍙兘鍙宠竟鎴栬�呬笅杈�
+		labelPos: {
+			type: String,
+			default: 'right'
+		},
+		// label鐨勫ぇ灏�
+		labelSize: {
+			type: [String, Number],
+			default: '28'
+		},
+		// label鐨勯鑹�
+		labelColor: {
+			type: String,
+			default: '#606266'
+		},
+		// label涓庡浘鏍囩殑璺濈(妯悜鎺掑垪)
+		marginLeft: {
+			type: [String, Number],
+			default: '6'
+		},
+		// label涓庡浘鏍囩殑璺濈(绔栧悜鎺掑垪)
+		marginTop: {
+			type: [String, Number],
+			default: '6'
+		},
+		// label涓庡浘鏍囩殑璺濈(绔栧悜鎺掑垪)
+		marginRight: {
+			type: [String, Number],
+			default: '6'
+		},
+		// label涓庡浘鏍囩殑璺濈(绔栧悜鎺掑垪)
+		marginBottom: {
+			type: [String, Number],
+			default: '6'
+		},
+		// 鍥剧墖鐨刴ode
+		imgMode: {
+			type: String,
+			default: 'widthFix'
+		},
+		// 鑷畾涔夋牱寮�
+		customStyle: {
+			type: Object,
+			default() {
+				return {}
+			}
+		},
+		// 鐢ㄤ簬鏄剧ず鍥剧墖灏忓浘鏍囨椂锛屽浘鐗囩殑瀹藉害
+		width: {
+			type: [String, Number],
+			default: ''
+		},
+		// 鐢ㄤ簬鏄剧ず鍥剧墖灏忓浘鏍囨椂锛屽浘鐗囩殑楂樺害
+		height: {
+			type: [String, Number],
+			default: ''
+		},
+		// 鐢ㄤ簬瑙e喅鏌愪簺鎯呭喌涓嬶紝璁╁浘鏍囧瀭鐩村眳涓殑鐢ㄩ��
+		top: {
+			type: [String, Number],
+			default: 0
+		}
+	},
+	computed: {
+		customClass() {
+			let classes = [];
+			classes.push(this.customPrefix + '-' + this.name);
+			// uView鐨勮嚜瀹氫箟鍥炬爣绫诲悕涓簎-iconfont
+			if (this.customPrefix == 'uicon') classes.push('u-iconfont');
+			else classes.push(this.customPrefix);
+			// 涓婚鑹诧紝閫氳繃绫婚厤缃�
+			if (this.color && this.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color);
+			// 闃块噷锛屽ご鏉★紝鐧惧害灏忕▼搴忛�氳繃鏁扮粍缁戝畾绫诲悕鏃讹紝鏃犳硶鐩存帴浣跨敤[a, b, c]鐨勫舰寮忥紝鍚﹀垯鏃犳硶璇嗗埆
+			// 鏁呴渶灏嗗叾鎷嗘垚涓�涓瓧绗︿覆鐨勫舰寮忥紝閫氳繃绌烘牸闅斿紑鍚勪釜绫诲悕
+			//#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU
+			classes = classes.join(' ');
+			//#endif
+			return classes;
+		},
+		iconStyle() {
+			let style = {};
+			style = {
+				fontSize: this.size == 'inherit' ? 'inherit' : this.$u.addUnit(this.size),
+				fontWeight: this.bold ? 'bold' : 'normal',
+				// 鏌愪簺鐗规畩鎯呭喌闇�瑕佽缃竴涓埌椤堕儴鐨勮窛绂伙紝鎵嶈兘鏇村ソ鐨勫瀭鐩村眳涓�
+				top: this.$u.addUnit(this.top)
+			};
+			// 闈炰富棰樿壊鍊兼椂锛屾墠褰撲綔棰滆壊鍊�
+			if (this.color && !this.$u.config.type.includes(this.color)) style.color = this.color;
+			return style;
+		},
+		// 鍒ゆ柇浼犲叆鐨刵ame灞炴�э紝鏄惁鍥剧墖璺緞锛屽彧瑕佸甫鏈�"/"鍧囪涓烘槸鍥剧墖褰㈠紡
+		isImg() {
+			return this.name.indexOf('/') !== -1;
+		},
+		imgStyle() {
+			let style = {};
+			// 濡傛灉璁剧疆width鍜宧eight灞炴�э紝鍒欎紭鍏堜娇鐢紝鍚﹀垯浣跨敤size灞炴��
+			style.width = this.width ? this.$u.addUnit(this.width) : this.$u.addUnit(this.size);
+			style.height = this.height ? this.$u.addUnit(this.height) : this.$u.addUnit(this.size);
+			return style;
+		}
+	},
+	methods: {
+		click() {
+			this.$emit('click', this.index);
+		},
+		touchstart() {
+			this.$emit('touchstart', this.index);
+		}
+	}
+};
+</script>
+
+<style scoped lang="scss">
+@import "@/uview-components/uview-ui/libs/css/style.components.scss";
+@import '@/uview-components/uview-ui/iconfont.css';
+
+.u-icon {
+	display: inline-flex;
+	align-items: center;
+
+	&--left {
+		flex-direction: row-reverse;
+		align-items: center;
+	}
+
+	&--right {
+		flex-direction: row;
+		align-items: center;
+	}
+
+	&--top {
+		flex-direction: column-reverse;
+		justify-content: center;
+	}
+
+	&--bottom {
+		flex-direction: column;
+		justify-content: center;
+	}
+
+	&__icon {
+		position: relative;
+		
+		&--primary {
+			color: $u-type-primary;
+		}
+
+		&--success {
+			color: $u-type-success;
+		}
+
+		&--error {
+			color: $u-type-error;
+		}
+
+		&--warning {
+			color: $u-type-warning;
+		}
+
+		&--info {
+			color: $u-type-info;
+		}
+	}
+
+	&__img {
+		height: auto;
+		will-change: transform;
+	}
+
+	&__label {
+		line-height: 1;
+	}
+}
+</style>

--
Gitblit v1.8.0