Browse Source

版本2.5.2

ming 2 years ago
parent
commit
30a0c176f4

+ 1 - 1
components/fs-avatar/fs-avatar.vue

@@ -19,7 +19,7 @@
 		@click="handleClick"
 	>
 		<image class="fs-avatar-img" :src="errImg" v-if="errImg" :lazy-load="lazyLoad" :mode="imageMode" @click="handlePreview" />
-		<image class="fs-avatar-img" :src="src" v-if="src" :lazy-load="lazyLoad" :mode="imageMode" @click="handlePreview" @error="handleError"/>
+		<image class="fs-avatar-img" :src="src" v-if="src" :lazy-load="lazyLoad" :mode="imageMode" @click="handlePreview" @error="handleError" />
 		<view v-else class="fs-avatar-slot" :class="['bg-' + bgColorType]" :style="{backgroundColor:bgColor}">
 			<slot></slot>
 		</view>

+ 19 - 2
components/fs-swiper/fs-swiper.vue

@@ -20,6 +20,7 @@
 			<swiper-item class="fs-swiper-item-box" v-for="(item, index) in list" :key="index" @click="handleClick">
 				<view class="fs-swiper-item" :class="{'card-cur': index === curIndex}">
 					<fs-avatar shape="square" radius width="100%" height="100%" :src="item[keyMap.src]"></fs-avatar>
+					<view class="fs-swiper-item-text line1" v-if="showTitle">{{item[keyMap.title]}}</view>
 				</view>
 			</swiper-item>
 		</template>
@@ -27,6 +28,7 @@
 			<swiper-item class="fs-swiper-item-box" v-for="(item, index) in list" :key="index" @click="handleClick">
 				<view class="fs-swiper-item">
 					<fs-avatar shape="square" width="100%" height="100%" :src="item[keyMap.src]"></fs-avatar>
+					<view class="fs-swiper-item-text line1" v-if="showTitle">{{item[keyMap.title]}}</view>
 				</view>
 			</swiper-item>
 		</template>
@@ -95,14 +97,16 @@ const props = defineProps({
 		type: Object,
 		default() {
 			return {
-				src: 'src'
+				src: 'src',
+				title: 'title'
 			}
 		}
 	},
 	mode: {
 		type: String
 	},
-	gutter: Boolean
+	gutter: Boolean,
+	showTitle: Boolean
 })
 const emits = defineEmits(['change', 'click', 'transition'])
 
@@ -124,6 +128,18 @@ const handleClick = item => {
 	&-item{
 		width: 100%;
 		height: 100%;
+		
+		&-text{
+			position: absolute;
+			left: 0;
+			right: 0;
+			bottom: 0;
+			background-color: rgba(0, 0, 0, .5);
+			color: #fff;
+			padding: 10rpx 20rpx;
+			font-size: 14px;
+			z-index: 10;
+		}
 	}
 }
 
@@ -131,6 +147,7 @@ const handleClick = item => {
 	.fs-swiper-item-box{
 		width: 610rpx !important;
 		left: 70rpx;
+		position: relative;
 	}
 	.fs-swiper-item{
 		transform: scale(.9);

+ 4 - 1
components/fs-text/fs-text.vue

@@ -37,6 +37,7 @@ const props = defineProps({
 		default: 'navigateTo'
 	},
 	block: Boolean,
+	encrypt: Boolean,
 	decoration: {
 		type: String,
 		validator(value) {
@@ -54,7 +55,9 @@ const formatText = text => {
 	if (props.mode === 'price') {
 		return '¥' + text
 	} else if (props.mode === 'name') {
-		return text[0] + '*' + text[text.length - 1]
+		return text[0] + '**'
+	} else if (props.mode === 'phone' && props.encrypt) {
+		return text.slice(0, 3) + '****' + text.slice(-4)
 	}
 	return text
 }