Commit c4f771a8 authored by zhengke's avatar zhengke

修改

parent 2352d021
......@@ -2,12 +2,6 @@
.banner-container{
background-color: #fff;
}
.banner-container .el-carousel{
height:100%;
}
.banner-container .el-carousel__container{
height:100%;
}
.bannerStyle-item {
width: 100px;
border: 1px solid #ebeef5;
......@@ -56,8 +50,9 @@
border: 1px solid #dcdfe6;
padding: 5px;
margin-bottom: 5px;
position: relative;
}
.navapp-image-upload .pic-box{
.banner_image_upload .pic-box{
width: 70px;
height: 70px;
border: 1px solid #ccc;
......@@ -79,7 +74,7 @@
position: absolute;
margin-left: 0;
}
.navapp-image-upload .pic-box .size-tip {
.banner_image_upload .pic-box .size-tip {
line-height: 1.35;
text-align: center;
position: absolute;
......@@ -94,9 +89,32 @@
background: rgba(0, 0, 0, 0.2);
letter-spacing: -1px;
}
.navapp-image-upload .pic-box i {
font-size: 22px;
color: #909399;
.banner_image_upload .pic-box i {
font-size: 12px;
color: #fff;
}
.banner_image_upload .image-delete {
position: absolute;
top: -10px;
right: -10px;
padding: 5px;
visibility: hidden;
z-index: 1;
}
.banner_image_upload:hover .image-delete{
visibility:visible;
}
.banner-container .banner-img {
height: 100%;
width: 100%;
background-repeat: no-repeat;
background-position: center;
}
.banner-container .banner-img-contain{
background-size: contain;
}
.banner-container .banner-img-cover{
background-size: cover;
}
</style>
<template>
......@@ -109,22 +127,27 @@
</div>
<div class="diy-component-preview">
<div class="banner-container" :style="{height:banData.data.height+'px'}">
<el-carousel :interval="3000" arrow="always">
<el-carousel-item v-for="item in 4" :key="item">
<h3>{{ item }}</h3>
<el-carousel :interval="3000" arrow="always" v-if="banData.data.style==1" :height="banData.data.height+'px'">
<el-carousel-item v-for="(item,index) in banData.data.banners" :key="index">
<div class="banner-img" :class="banData.data.fill==1?'banner-img-cover':'banner-img-contain'" :style="{backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com'+item.picUrl+')'}"></div>
</el-carousel-item>
</el-carousel>
<el-carousel v-else :interval="4000" type="card" :height="banData.data.height+'px'">
<el-carousel-item v-for="(item,index) in banData.data.banners" :key="index">
<div class="banner-img" :class="banData.data.fill==1?'banner-img-cover':'banner-img-contain'" :style="{backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com'+item.picUrl+')'}"></div>
</el-carousel-item>
</el-carousel>
</div>
</div>
<div class="diy-component-edit" v-if="banData.isCked">
<el-form label-width="100px;">
<el-form label-width="100px">
<el-form-item label="样式">
<div flex="dir:left">
<div class="bannerStyle-item banner_active">
<div class="bannerStyle-item" :class="{'banner_active':banData.data.style==1}" @click="banData.data.style=1">
<div class="banner-style-1"></div>
<div>样式1</div>
</div>
<div class="bannerStyle-item" style="margin-left:5px;">
<div class="bannerStyle-item" style="margin-left:5px;" :class="{'banner_active':banData.data.style==2}" @click="banData.data.style=2">
<div flex class="banner-style-2">
<div></div>
<div></div>
......@@ -151,14 +174,15 @@
<div flex="dir:top">
<div class="banner-edit-item" v-for="(item,index) in banData.data.banners" :key="index">
<div class="banner-edit-options">
<el-button type="primary" icon="el-icon-delete" @click="delBanner(index)" style="top: -6px; right: -31px;"></el-button>
<el-button type="primary" icon="el-icon-delete" @click="delBanner(index)" style="position:absolute;top: -1px; right: -26px;"></el-button>
</div>
<div flex="box:first">
<div>
<div class="navapp-image-upload" style="margin-right:5px;">
<div flex="main:center cross:center" class="pic-box" :style="{backgroundImage:'url(' + item.picUrl + ')'}">
<i class="el-icon-picture-outline" v-if="item.picUrl==''"></i>
<div class="banner_image_upload" style="margin-right:5px;">
<div flex="main:center cross:center" @click="choiceMyImg(index)" class="pic-box" :style="{backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com' + item.picUrl + ')'}">
<i style="font-size:22px;color:#909399;" class="el-icon-picture-outline" v-if="item.picUrl==''"></i>
<div class="size-tip">720 × 250</div>
<el-button type="danger" v-if="item.picUrl!=''" class="image-delete" size="mini" icon="el-icon-close" @click.stop="item.picUrl=''" circle></el-button>
</div>
</div>
</div>
......@@ -183,21 +207,28 @@
<el-button size="small" type="danger" @click="getChoiceLink()">确 定</el-button>
</span>
</el-dialog>
<!-- 选择图片文件 -->
<el-dialog title="选择文件" :visible.sync="choicImg" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog>
</div>
</template>
<script>
import chooseMeun from "../../common/chooseMeun.vue";
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
props: ["banData","index","dataLeng"],
data() {
return {
isShowLink:false,
choicImg:false,
commonIndex:0,
};
},
components: {
chooseMeun,
ChooseImg
},
created() {
......@@ -228,8 +259,20 @@
this.banData.data.banners[this.commonIndex].url=obj.PageUrl;
this.isShowLink = false;
},
//选取图片
choiceMyImg(index){
this.choicImg = true;
this.commonIndex=index;
},
//选择图片
SelectId(msg){
this.banData.data.banners[this.commonIndex].picUrl=msg.url;
this.choicImg=false;
},
//向父组件传值 并调用排序
resetSord(IsUp){
this.$emit('getSord', this.index,IsUp);
},
},
mounted() {
......
......@@ -153,7 +153,7 @@
backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com' + navData.data.backgroundPicUrl + ')'}">
<div flex="dir:left" style="width:750px;flex-wrap:wrap;">
<div class="Headernav-item" v-for="(item,index) in navData.data.navs" :key="index" :style="{width:getNavWidth(navData.data.columns)}">
<img :src="item.icon"/>
<img :src="'http://viitto-1301420277.cos.ap-chengdu.myqcloud.com'+item.icon"/>
<div style="color: rgb(53, 53, 53);">{{item.name}}</div>
</div>
</div>
......@@ -175,7 +175,7 @@
<el-switch v-model="navData.data.scroll"></el-switch>
</el-form-item>
<el-form-item label="拉取商城导航">
<el-button size="small" @click="isShowLink=true">选择</el-button>
<el-button size="small" @click="isShowNavLink=true">选择</el-button>
</el-form-item>
<el-form-item label="导航图标">
<div flex="dir:top">
......@@ -186,9 +186,10 @@
<div flex="dir:left box:first cross:center">
<div>
<div class="navapp-image-upload">
<div flex="main:center cross:center" class="pic-box" :style="{backgroundImage:'url(' + item.icon + ')'}">
<div flex="main:center cross:center" @click="choiceMyImg(index)" class="pic-box" :style="{backgroundImage:'url(' + getIconLink(item.icon) + ')'}">
<i class="el-icon-picture-outline" v-if="item.icon==''"></i>
<div class="size-tip">88 × 88</div>
<el-button type="danger" v-if="item.icon!=''" class="image-delete" size="mini" icon="el-icon-close" @click.stop="item.icon=''" circle></el-button>
</div>
</div>
</div>
......@@ -217,7 +218,7 @@
</el-form-item>
<el-form-item label="上传背景" v-if="navData.data.showImg">
<div style="line-height:normal;display:inline-block;">
<div class="navigation_pic_boxDiv" @click="choicImg=true" flex="main:center cross:center" :style="{backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com' + navData.data.backgroundPicUrl + ')'}">
<div class="navigation_pic_boxDiv" @click="choicImg=true,selectType=1" flex="main:center cross:center" :style="{backgroundImage:'url(http://viitto-1301420277.cos.ap-chengdu.myqcloud.com' + navData.data.backgroundPicUrl + ')'}">
<i class="el-icon-picture-outline" v-if="navData.data.backgroundPicUrl==''"></i>
<el-button type="danger" class="image-delete" v-if="navData.data.backgroundPicUrl!=''" size="mini" icon="el-icon-close" @click.stop="navData.data.backgroundPicUrl=''" circle></el-button>
</div>
......@@ -297,6 +298,7 @@
commonIndex:0,
//选择图片弹窗
choicImg:false,
selectType:1,
};
},
components: {
......@@ -358,14 +360,33 @@
},
//选择图片
SelectId(msg){
this.navData.data.backgroundPicUrl=msg.url;
if(this.selectType==1){
this.navData.data.backgroundPicUrl=msg.url;
}else{
this.navData.data.navs[this.commonIndex].icon=msg.url;
}
this.choicImg=false;
},
//向父组件传值 并调用排序
resetSord(IsUp){
this.$emit('getSord', this.index,IsUp);
},
//选取图片
choiceMyImg(index){
this.choicImg=true;
this.commonIndex=index;
this.selectType=2;
},
//判断是否包含http
getIconLink(url){
let str=''
if(url.indexOf('http')!=-1){
str=url
}else{
str= 'http://viitto-1301420277.cos.ap-chengdu.myqcloud.com'+url
}
return str;
}
},
mounted() {
......
<style>
.diy-rubik .layout {
width: 750px;
position: relative;
}
.diy-rubik .layout .rubik {
position: absolute;
top: 0;
left: 0;
border: 1px dashed #c9c9c9;
cursor: pointer;
color: #c9c9c9;
z-index: 11;
}
.diy-component-preview{
background-color: #fff;
}
.diy-component-preview:hover {
box-shadow: inset 0 0 10000px rgba(0, 0, 0, .03);
}
</style>
<template>
<div :class="{'active':rubData.isCked}">
<div class="diy-component-options" v-if="rubData.isCked">
<el-button type="primary" icon="el-icon-delete" style="left: -25px; top: 0px;"></el-button>
<el-button type="primary" icon="el-icon-document-copy" style="left: -25px; top: 30px;"></el-button>
<el-button type="primary" icon="el-icon-arrow-up" v-if="index>0" @click="resetSord(0)" style="right: -25px; top: 0;"></el-button>
<el-button type="primary" icon="el-icon-arrow-down" v-if="index!=dataLeng-1" @click="resetSord(1)" style="right: -25px; top: 30px;"></el-button>
</div>
<div class="diy-rubik">
<div class="diy-component-preview">
<div class="layout" style="height:360px;">
<div class="rubik" style="width:100%;height:100%;z-index:16;"></div>
<!-- <div flex="main:center cross:center" class="rubik" style="x: 0px; y: 0px; width: calc(100% - 0px); height: calc(100% - 0px); left: 0%; top: 0%;">
<span>宽度为750,不限高度</span>
</div> -->
</div>
</div>
<div class="diy-component-edit" v-if="rubData.isCked">
</div>
</div>
</div>
</template>
<script>
export default {
props: ["rubData","index","dataLeng"],
data() {
return {
};
},
created() {
},
methods: {
// 魔方展示样式(preview)
blockStyle(index) {
// if (index === 8) {
// let per = 750 / this.data.w;
// this.data.height = this.data.h * 750 / this.data.w;
// return `height: ${this.data.height}px;background-image: url('${this.img}');background-size: ${per}px ${per}px;`;
// } else {
// if (index === 0) {
// this.data.height = 'auto';
// return `height: ${this.data.list[0].pic_url ? 'auto' : '360px'}`;
// }
// return `height: ${this.style_list[index] ? this.style_list[index].height : 360}px`;
// }
},
},
mounted() {
}
};
</script>
......@@ -195,6 +195,7 @@
<search v-if="item.Id=='search'" :searchData="item" @getSord="getSord" :index="index" :dataLeng="dataList.length"></search>
<navigationIcon v-if="item.Id=='nav'" :navData="item" @getSord="getSord" :index="index" :dataLeng="dataList.length"></navigationIcon>
<banner v-if="item.Id=='banner'" :banData="item" @getSord="getSord" :index="index" :dataLeng="dataList.length"></banner>
<rubik v-if="item.Id=='rubik'" :rubData="item" @getSord="getSord" :index="index" :dataLeng="dataList.length"></rubik>
</div>
</div>
</div>
......@@ -210,6 +211,7 @@
import search from "../sallCenter/plugin/search.vue"
import navigationIcon from "../sallCenter/plugin/navigationIcon.vue"
import banner from "../sallCenter/plugin/banner.vue"
import rubik from "../sallCenter/plugin/rubik.vue"
export default {
data() {
return {
......@@ -226,6 +228,7 @@
search,
navigationIcon,
banner,
rubik
},
methods: {
//获取左侧菜单
......@@ -280,6 +283,7 @@
}
}
this.dataList.push(navObj);
console.log(this.dataList,'this.dataList');
break;
case 'banner':
let banObj={
......@@ -294,6 +298,22 @@
}
this.dataList.push(banObj);
break;
case 'rubik':
let rubObj={
Id:'rubik',
isCked:false,
data:{
style:-1,
space:0,
height:0,
w:1,
h:1,
list:[],
hotspot:[]
}
}
this.dataList.push(rubObj);
break;
}
},
//给子组件调用 重新排序上移下移
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment