From 197ad80fc3e6f44314e337f4a61208d759c68010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=A5=E6=96=AF?= <9068149@qq.com> Date: Thu, 11 Nov 2021 14:12:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/componentscom/tabBar/index.vue | 17 ++-- src/components/phoneBottom/index.vue | 9 -- .../rightslider/tabBarStyle/index.vue | 85 +++++++++++++------ src/components/uploadImg/index.vue | 1 + src/layout/home/index.vue | 16 ---- 5 files changed, 71 insertions(+), 57 deletions(-) diff --git a/src/components/componentscom/tabBar/index.vue b/src/components/componentscom/tabBar/index.vue index 39feb1c..8c33afa 100644 --- a/src/components/componentscom/tabBar/index.vue +++ b/src/components/componentscom/tabBar/index.vue @@ -9,14 +9,17 @@ :active-color="datas.activeColor" :inactive-color="datas.inactiveColor" > - {{ item.iconText }} + {{ item.iconText }} + + @@ -29,7 +32,7 @@ :active-color="datas.activeColor" :inactive-color="datas.inactiveColor" > - 标签 + 标签 标签 标签 标签 @@ -46,11 +49,11 @@ export default { name: 'tabBar', props: { - datas: Object, + datas: Object }, data() { return { - // active: 'home', + active: 0 } }, @@ -71,7 +74,7 @@ export default { beforeDestroy() { document.querySelector('.phone-container').style.cssText = 'padding-bottom: 0px' - }, + } } diff --git a/src/components/phoneBottom/index.vue b/src/components/phoneBottom/index.vue index 08a3b3a..c123b5b 100644 --- a/src/components/phoneBottom/index.vue +++ b/src/components/phoneBottom/index.vue @@ -1,10 +1,6 @@ @@ -13,11 +9,6 @@ export default { name: 'phoneBottom', props:['datas'], - watch: { - datas() { - // console.log(this.datas,'------------this.datas') - }, - }, } diff --git a/src/components/rightslider/tabBarStyle/index.vue b/src/components/rightslider/tabBarStyle/index.vue index a781273..b90ceb9 100644 --- a/src/components/rightslider/tabBarStyle/index.vue +++ b/src/components/rightslider/tabBarStyle/index.vue @@ -52,8 +52,22 @@ > -
- +
+
+ +
+ {{ replaceIconIndex == 1 ? '选中时' : '未选中时' }} +
+
@@ -112,7 +126,11 @@ - +
@@ -161,6 +179,8 @@ export default { dragOptions: { animation: 200, }, + replaceIconIndex: null, + replaceIndex: null, } }, @@ -171,11 +191,22 @@ export default { methods: { // 提交 uploadInformation(res) { + if (this.replaceIconIndex == 1) { + this.datas.iconList[this.replaceIndex].iconPic = res + this.replaceIconIndex = null + return + } + if (this.replaceIconIndex == 2) { + this.datas.iconList[this.replaceIndex].inactive = res + this.replaceIconIndex = null + return + } this.datas.iconList.push({ /** 图标名称文字 */ iconText: '', /** 图标图片 */ iconPic: res, + inactive: res, /** 是否显示小圆点 */ isDot: false, /** 跳转类型 */ @@ -184,12 +215,21 @@ export default { http: {}, }) }, - + /* 取消上传 */ + handleClose() { + this.replaceIconIndex = null + }, /* 删除图片 */ deleteimg(index) { this.datas.iconList.splice(index, 1) }, - + /* 点击图片 */ + replaceIcon(replaceIconIndex, replaceIndex) { + this.replaceIconIndex = replaceIconIndex + this.replaceIndex = replaceIndex + console.log(replaceIconIndex, replaceIndex) + this.$refs.upload.showUpload() + }, }, computed: {}, @@ -257,40 +297,35 @@ export default { } /* 图片 */ - .imag { - width: 60px; - height: 60px; + .imagBox { + position: relative; border-radius: 5px; overflow: hidden; - position: relative; cursor: pointer; - img { - width: 100%; - height: 100%; - display: inline-block; + .imag { + width: 60px; + height: 60px; } - span { - background: rgba(0, 0, 0, 0.5); - font-size: 12px; + div { position: absolute; - left: 0px; - bottom: 0px; - display: inline-block; - width: 100%; + top: 0; + width: 60px; + line-height: 60px; + border-radius: 5px; text-align: center; + font-size: 12px; color: #fff; - height: 20px; - line-height: 20px; + background-color: rgba(0, 0, 0, 0.3); } } + /* 图片字 */ .imgText { - width: 80%; + padding-left: 20px; display: flex; flex-direction: column; box-sizing: border-box; - padding-left: 20px; - justify-content: space-between; + justify-content: space-around; /* 图片字 */ .imgTextChild { width: 100%; diff --git a/src/components/uploadImg/index.vue b/src/components/uploadImg/index.vue index 644f32c..3b24fe7 100644 --- a/src/components/uploadImg/index.vue +++ b/src/components/uploadImg/index.vue @@ -81,6 +81,7 @@ export default { this.$confirm('点击取消后您填写的信息将丢失,您确定取消?') .then(() => { this.handleRemove() + this.$emit('handleClose') // 隐藏上传文件 this.dialogVisible = false this.dialogImageUrl = '' diff --git a/src/layout/home/index.vue b/src/layout/home/index.vue index 3ce8c2b..d16f522 100644 --- a/src/layout/home/index.vue +++ b/src/layout/home/index.vue @@ -49,7 +49,6 @@
-