Commit 5f315a59 authored by zhangjianguo's avatar zhangjianguo
parents 14e2721f b2aba15c
......@@ -97,3 +97,21 @@
.tableCenter td, .tableCenter th{
text-align:center;
}
.searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.searchInput{
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width:250px;
margin-right: 20px;
}
\ No newline at end of file
<template>
<div v-loading="pageloading" class="RecSettings">
<div class="head-title">
推荐设置
</div>
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px">
<el-card style="margin-top:10px" class="box-card">
<div slot="header" class="clearfix">
<span>商品详情页推荐设置</span>
</div>
<el-form-item label="推荐商品状态">
<el-switch
v-model="addMsg.DetailRecommendStatus"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="推荐商品显示数量">
<el-input v-model="addMsg.DetailRecommendNum" style="width:635px" size="small">
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
</el-card>
<el-card shadow="never" style="margin-top:10px" class="box-card">
<div slot="header" class="clearfix">
<span>订单完成后推荐设置</span>
</div>
<el-form-item label="推荐商品状态">
<el-switch
v-model="addMsg.OrderCompleteStatus"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="自定义推荐商品">
<el-switch
v-model="addMsg.IsOrderRecommend"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
<span>按商品列表排序显示前10件商品</span>
<template v-if="addMsg.IsOrderRecommend==1">
<div>
<div v-for="(item,index) in addMsg.OrderProductList" :key="index" class="goods-item">
<div :style="{backgroundImage:'url(' +domainManager().ImageUrl+ item.Image + ')'}" class="goods-pic"></div>
<el-button @click="spliceImg(1,index)" class="deleteBtn" size="mini" type="danger" icon="el-icon-close" circle></el-button>
</div>
</div>
<div @click="toggleCheck(1)" class="goods-add">
<el-button icon="el-icon-plus"></el-button>
</div>
</template>
</el-form-item>
</el-card>
<el-card shadow="never" style="margin-top:10px" class="box-card">
<div slot="header" class="clearfix">
<span>评论后推荐设置</span>
</div>
<el-form-item label="推荐商品状态">
<el-switch
v-model="addMsg.CommentRecommentStatus"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item label="自定义推荐商品">
<el-switch
v-model="addMsg.IsCommentRecommend"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
<span>按商品列表排序显示前10件商品</span>
<template v-if="addMsg.IsCommentRecommend==1">
<div>
<div v-for="(item,index) in addMsg.CommentProductList" :key="index" class="goods-item">
<div :style="{backgroundImage:'url(' +domainManager().ImageUrl+ item.Image + ')'}" class="goods-pic"></div>
<el-button @click="spliceImg(2,index)" class="deleteBtn" size="mini" type="danger" icon="el-icon-close" circle></el-button>
</div>
</div>
<div @click="toggleCheck(2)" class="goods-add">
<el-button icon="el-icon-plus"></el-button>
</div>
</template>
</el-form-item>
</el-card>
</el-form>
<div style="padding:20px;background:#fff;margin-top:10px">
<el-button @click="Save" size="small" type="primary">保存</el-button>
</div>
<!-- 新增规格模板 -->
<el-dialog title="充值" :visible.sync="ggmbDig" width="960px">
<div class="searchInput" style="width:250px">
<el-input style="display:inline-block;width:225px;height:30px"
placeholder="请输入商品名称搜索"
v-model="msg.Name"
size="small"
@clear="getList"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<el-table
ref="tableData"
:data="tableData"
v-loading="loading"
@selection-change="selectionChange"
style="width: 100%;margin:20px 0">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="Id"
width="100"
label="ID">
</el-table-column>
<el-table-column
prop="Name"
label="名称">
</el-table-column>
</el-table>
<el-pagination style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="total">
</el-pagination>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="ggmbDig = false">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "RecSettings",
data(){
return{
pageloading:false,
addMsg:{},
rules:{},
ggmbDig:false,
msg:{
pageIndex:1,
pageSize:15,
Name:'',
},
total:0,
loading:false,
tableData:[],
commonList:[],
listType:1,
}
},
created(){
this.getData();
this.getList();
},
methods:{
Save(){
this.apipost("/api/product/SetProductRecommendSetInfo", this.addMsg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.getData();
this.Success(res.data.message);
}else{
this.Error(res.data.message);
}
})
},
spliceImg(num,index){
if(num==1){
this.addMsg.OrderProductList.splice(index,1)
}else{
this.addMsg.CommentProductList.splice(index,1)
}
},
toggleCheck(num){
this.listType=num;
this.ggmbDig=true;
this.$nextTick(()=>{
this.$refs.tableData.clearSelection();
})
},
submitForm(){
this.commonList.forEach(item=>{
item.Image=item.CoverImage;
})
if(this.listType==1){
this.addMsg.OrderProductList=this.commonList
}else{
this.addMsg.CommentProductList=this.commonList
}
this.ggmbDig=false;
},
selectionChange(val){
this.commonList=val;
},
getList(){
this.loading=true;
this.apipost("/api/product/GetProductGoodsDialogList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.total=res.data.data.count;
let pageData=res.data.data.pageData;
this.tableData=pageData;
}
})
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getData(){
this.pageloading=true;
this.apipost("/api/product/GetProductRecommendSetInfo",{}, res => {
this.pageloading=false;
if(res.data.resultCode==1){
this.addMsg=res.data.data;
}else {
this.Error(res.data.message);
}
})
},
},
};
</script>
<style>
.RecSettings .goods-add .el-button {
width: 100%;
height: 100%;
border: none;
border-radius: 0;
padding: 0;
}
.RecSettings .el-button--mini.is-circle{
padding:4px!important;
}
.RecSettings .deleteBtn {
position: absolute;
top: -6px;
right: -6px;
}
.RecSettings .goods-item ,.RecSettings .goods-add{
width: 50px;
height: 50px;
position: relative;
border: 1px solid #e2e2e2;
margin-right: 15px;
margin-bottom: 15px;
display: inline-block;
}
.RecSettings .goods-pic {
background-size: cover;
background-position: center;
width: 100%;
height: 100%;
background-color: #f6f6f6;
background-repeat: no-repeat;
}
</style>
<template>
<div class="SpeTemplate">
<div class="head-title">
规格模板
<el-button @click="openDig" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">新增模板管理</el-button>
</div>
<div class="content">
<div>
<div class="searchInput" style="width:250px">
<el-input style="display:inline-block;width:225px;height:30px"
placeholder="请输入规格名搜索"
v-model="msg.Name"
@clear="getList"
size="small"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
<el-table
:data="tableData"
v-loading="loading"
border
style="width: 100%;margin:20px 0">
<el-table-column
prop="Name"
width="300"
label="规格名">
</el-table-column>
<el-table-column
prop="address"
label="规格值">
<template slot-scope="scope">
<el-tag size="small" v-for="(item,index) in scope.row.SpecList" :key="index" style="margin:0 5px" type="info">{{item}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="address"
width="200"
label="操作">
<template slot-scope="scope">
<img @click="Edit(scope.row)" style="width:32px;height:32px" src="../../assets/img/userman/edit.png" alt="">
<img @click="Delete(scope.row)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt="">
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="total">
</el-pagination>
</div>
<!-- 新增规格模板 -->
<el-dialog custom-class="attr-template" title="充值" :visible.sync="ggmbDig" width="960px">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<el-form-item label="规格名" prop="Name">
<el-input size="small" v-model="addMsg.Name" style="width:330px"></el-input>
</el-form-item>
<el-form-item label="规格值" prop="SpecList">
<div flex="dir:left" style="flex-wrap: wrap;">
<div v-for="(item,index) in SpecList" :key="index" class="attr-list">
<el-input size="small" v-model="item.num" style="width:152px"></el-input>
<i @click="deleteGgz(item,index)" class="el-icon-error close"></i>
</div>
<span @click="addGgz" class="point blue">添加规格值</span>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="ggmbDig = false">取 消</el-button>
<el-button size="small" type="primary" @click="submitForm('addMsg')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "SpeTemplate",
data(){
return{
ggmbDig:false,
msg:{
pageIndex:1,
pageSize:15,
Name:'',
Id:0,
Content:'',
},
total:0,
tableData:[
{Name:'11'}
],
loading:false,
addMsg:{
Id:0,
Name:'',
SpecList:[],
},
rules:{
SpecList: [],
Name: [
{ required: true, message: '规格名不能为空', trigger: 'blur' }
],
},
SpecList:[],
}
},
created(){
this.getList();
},
methods:{
Delete(item){
let that=this;
that.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apipost('/api/product/DelProductSpecificationInfo',{SpecificationId:item.Id},
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
});
},
Edit(row){
this.addMsg=row;
this.SpecList=[];
row.SpecList.forEach(item=>{
let obj={
num:item
}
this.SpecList.push(obj)
})
this.ggmbDig=true;
},
deleteGgz(item,index){
this.SpecList.splice(index,1);
},
addGgz(){
let obj={num:''}
this.SpecList.push(obj);
},
openDig(){
this.addMsg={
Id:0,
Name:'',
SpecList:[],
}
this.SpecList=[];
this.ggmbDig=true;
},
submitForm(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
for(let i=0;i<this.SpecList.length;i++){
if(this.SpecList[i].num==""){
this.Error("规格值不能为空");
return;
}
}
this.addMsg.SpecList=[];
this.SpecList.forEach(item=>{
this.addMsg.SpecList.push(item.num);
})
this.apipost('/api/product/SetProductSpecificationInfo',this.addMsg,
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
this.ggmbDig=false;
} else {
this.Error(res.data.message);
}
},
null
);
} else {
return false;
}
});
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList(){
this.loading=true;
this.apipost("/api/product/GetProductSpecificationPageList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.total=res.data.data.count;
let pageData=res.data.data.pageData;
this.tableData=pageData;
}
})
},
},
};
</script>
<style>
.attr-template .attr-list {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
position: relative;
cursor: move;
}
.attr-template .close {
position: absolute;
top: -4px;
right: -4px;
font-size: 16px;
cursor: pointer;
background: #ffffff;
}
.SpeTemplate .content .searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.SpeTemplate .content .searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.SpeTemplate .content .searchInput{
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width:250px;
margin-right: 20px;
}
.SpeTemplate .content{
background: #fff;
margin-top:10px;
padding: 20px;
box-sizing: border-box;
}
</style>
......@@ -7,21 +7,31 @@
<div class="content">
<el-form style="width:50%" :model="userInfo" :rules="rules" ref="userInfo" label-width="120px">
<el-form-item label="选择分类级别" prop="Tier">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="1">一级分类</el-radio>
<div @click="SelectTier(2)" style="display:inline-block;margin-right:18px">
<template v-if="editState">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="1">一级分类</el-radio>
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="2">二级分类</el-radio>
</div>
<div @click="SelectTier(3)" style="display:inline-block">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="3">三级分类</el-radio>
</div>
</template>
<template v-else>
<div @click="SelectTier(1)" style="display:inline-block;margin-right:18px">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="1">一级分类</el-radio>
</div>
<div @click="SelectTier(2)" style="display:inline-block;margin-right:18px">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="2">二级分类</el-radio>
</div>
<div @click="SelectTier(3)" style="display:inline-block">
<el-radio :disabled="editState" v-model="userInfo.Tier" :label="3">三级分类</el-radio>
</div>
</template>
</el-form-item>
<el-form-item v-if="userInfo.Parent1Name && (userInfo.Tier==2 || userInfo.Tier==3)" label="一级分类">
<span>{{userInfo.Parent1Name}}</span>
<span @click="SelectTier(2)" v-if="userInfo.Tier==2" style="margin-left:10px" class="blue point">修改</span>
<span @click="SelectTier(2)" v-if="userInfo.Tier==2 && !editState" style="margin-left:10px" class="blue point">修改</span>
</el-form-item>
<el-form-item v-if="userInfo.Parent2Name && userInfo.Tier==3" label="二级分类">
<span>{{userInfo.Parent2Name}}</span>
<span @click="SelectTier(3)" style="margin-left:10px" class="blue point">修改</span>
<span v-if="!editState" @click="SelectTier(3)" style="margin-left:10px" class="blue point">修改</span>
</el-form-item>
<el-form-item label="分类名称" prop="Name">
<el-input v-model="userInfo.Name" size="small"></el-input>
......@@ -106,7 +116,7 @@
<img v-if="imgDig==2" style="width:280px" src="../../assets/img/userman/example-2.png" alt="">
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="czjfDig = false">我知道了</el-button>
<el-button type="primary" size="small" @click="czjfDig = false">确定</el-button>
</span>
</el-dialog>
<!-- 选择文件 -->
......@@ -128,9 +138,9 @@
</div>
</div>
<ul class="tierUl">
<li :class="active1==index ? 'SelectLi' :''" @click="SelectTier1(item,index)" v-for="(item,index) in tableData" :key="index">
<li @click="SelectTier1(item,index,2)" :class="active1==index ? 'SelectLi' :''" v-for="(item,index) in tableData" :key="index">
<span>{{item.Name}}</span>
<span v-if="item.ChildList.length>0" style="float:right">
<span v-if="userInfo.Tier==3 && item.ChildList.length>0" style="float:right">
<i class="el-icon-arrow-right"></i>
</span>
</li>
......@@ -139,7 +149,7 @@
</div>
</ul>
<ul v-if="userInfo.Tier==3" class="tierUl" style="margin-left:10px">
<li :class="active2==index ? 'SelectLi' :''" v-show="tableData2 && tableData2.ChildList" @click="SelectTier2(item,index)" v-for="(item,index) in tableData2.ChildList" :key="index">
<li @click="SelectTier2(item,index,3)" :class="active2==index ? 'SelectLi' :''" v-show="tableData2 && tableData2.ChildList" v-for="(item,index) in tableData2.ChildList" :key="index">
<span>{{item.Name}}</span>
</li>
<div v-show="tableData2.ChildList && tableData2.ChildList.length==0" class="empty-text">
......@@ -148,7 +158,7 @@
</ul>
<div style="text-align:right;margin-top:20px" slot="footer" class="dialog-footer">
<el-button size="small" @click="ExitTier">取消</el-button>
<el-button type="primary" size="small" @click="tierDig = false">我知道了</el-button>
<el-button type="primary" size="small" @click="TierOk">确定</el-button>
</div>
</div>
</el-dialog>
......@@ -212,6 +222,7 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
active1:-1,
active2:-1,
keepData:{},
tierOk:0,
};
},
created() {
......@@ -220,36 +231,52 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
this.getData()
this.editState=true;
}
else{
this.keepData=this.userInfo;
}
this.getList();
},
methods: {
TierOk(){
this.tierDig =false;
this.userInfo.Tier=this.tierOk;
},
ExitTier(){
this.userInfo.ParentId=0;
this.userInfo.ParentId=this.keepData.ParentId;
this.userInfo.Parent1Name=this.keepData.Parent1Name;
this.userInfo.Parent2Name=this.keepData.Parent2Name;
this.tierDig =false;
},
SelectTier2(item,index){
SelectTier2(item,index,num){
this.active2=index;
this.userInfo.ParentId=this.tableData2.Id;
this.userInfo.ParentId=item.Id;
this.userInfo.Parent2Name=item.Name;
this.userInfo.Tier=3;
this.tierOk=num;
},
SelectTier1(item,index){
SelectTier1(item,index,num){
this.tableData2=this.tableData[index];
this.active1=index;
this.userInfo.ParentId=0;
this.userInfo.ParentId=item.Id;
this.userInfo.Parent1Name=item.Name;
this.userInfo.Tier=2;
this.tierOk=num;
this.active2=-1;
this.userInfo.Parent2Name="";
},
SelectTier(num){
this.tierDig=true;
if(num==1){
this.active1=-1;
this.active2=-1;
this.userInfo.ParentId=this.keepData.ParentId;
this.userInfo.Parent1Name=this.keepData.Parent1Name;
this.userInfo.Parent2Name=this.keepData.Parent2Name;
}
if(num==2){
this.tierDig=true;
this.titleDig='选择归属的一级分类';
this.tierWidth='20%'
}
if(num==3){
this.tierDig=true;
this.titleDig='选择归属的二级分类';
this.tierWidth='600px'
}
......@@ -306,7 +333,7 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
getData(){
this.apipost("/api/product/GetProductCategoryInfo",{CategoryId:this.UserId}, res => {
this.userInfo=res.data.data;
this.keepData=re.data.data;
this.keepData=res.data.data;
})
},
......
......@@ -490,7 +490,6 @@ export default {
},
methods:{
goUrl(item){
console.log("111",item);
if(item){
this.$router.push({
name: 'addGoodsClass',
......
This diff is collapsed.
<template>
<div class="quickBuy">
<div class="head-title">
服务列表
<el-button @click="CommonJump('goodsServicesEdit')" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">添加服务</el-button>
</div>
<div class="content">
<div>
<div class="searchInput" style="width:250px">
<el-input style="display:inline-block;width:225px;height:30px"
placeholder="请输入规格名搜索"
v-model="msg.Name"
@clear="getList"
size="small"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<el-select size="small" @change="getList" v-model="msg.IsDefault" placeholder="请选择">
<el-option label="不限" :value="0"></el-option>
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="2"></el-option>
</el-select>
</div>
<el-table
:data="tableData"
v-loading="loading"
border
style="width: 100%;margin:20px 0">
<el-table-column
prop="Id"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="Name"
label="服务名称">
</el-table-column>
<el-table-column
prop="Remark"
label="备注">
</el-table-column>
<el-table-column
prop="address"
label="是否默认">
<template slot-scope="scope">
<el-switch
@change="Edit(scope.row,1)"
v-model="scope.row.IsDefault"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
</template>
</el-table-column>
<el-table-column
prop="address"
label="排序">
<template slot-scope="scope">
<template v-if="!scope.row.editState">
<span>{{scope.row.Sort}}</span>
<img @click="scope.row.editState=true,scope.row.SortNew=scope.row.Sort" style="width:15px;height:15px;margin-left:7px" src="../../assets/img/userman/edit1.png" alt="">
</template>
<template v-else>
<el-input v-model="scope.row.SortNew" type="number" min="1" size="small" style="display:inline-block;width:150px"></el-input>
<span @click="scope.row.editState=false" class="el-icon-error" style="color: rgb(245, 108, 108);"></span>
<span @click="Edit(scope.row,2)" class="el-icon-success" style="color:#67c23a"></span>
</template>
</template>
</el-table-column>
<el-table-column
prop="UpdateDate"
width="150"
label="添加日期">
</el-table-column>
<el-table-column
prop="address"
width="200"
label="操作">
<template slot-scope="scope">
<img @click="Delete(scope.row)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/edit.png" alt="">
<img @click="Delete(scope.row)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt="">
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right"
background
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: "quickBuy",
data(){
return{
editState:false,
msg:{
pageIndex:1,
pageSize:15,
Name:'',
IsDefault:0,
},
total:0,
tableData:[],
loading:false,
addMsg:{
Id:0,
Sort:'',
Name:'',
IsDefault:1,
Remark:'',
UpdateType:1,
},
rules:{
CategoryIdNew: [
{ required: true, message: '分类不能为空', trigger: 'change' }
],
Sort: [
{ required: true, message: '请输入排序', trigger: 'blur' }
],
},
msg1:{
Id:0,
Name:'',
Tier:0,
ParentId:0,
Enabled:1,
IsShow:1,
},
}
},
created(){
this.getList();
},
methods:{
Delete(item){
let that=this;
that.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apipost('/api/product/DelProductServiceInfo',{ServiceId:item.Id},
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
});
},
Edit(row,num){
let addMsg=row;
addMsg.Sort=addMsg.SortNew;
addMsg.UpdateType=num;
this.apipost('/api/product/SetProductServiceInfo',addMsg,
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList(){
this.loading=true;
this.apipost("/api/product/GetProductServicePageList", this.msg, res => {
this.loading=false;
if(res.data.resultCode==1){
this.total=res.data.data.count;
let pageData=res.data.data.pageData;
pageData.forEach(item=>{
item.SortNew=item.Sort;
item.editState=false;
})
this.tableData=pageData;
}
})
},
},
};
</script>
<style>
.quickBuy .content .searchInput{
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.quickBuy .content .searchInput .el-input__inner{
border:none;outline:none;
height: 30px;
line-height: 30px;
}
.quickBuy .content .searchInput{
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width:250px;
margin-right: 20px;
}
.quickBuy .content{
background: #fff;
margin-top:10px;
padding: 20px;
box-sizing: border-box;
}
</style>
<template>
<div v-loading="pageloading" class="goodsServicesEdit">
<div class="head-title">
<span @click="CommonJump('goodsServices')" class="blue point">服务</span> / 服务编辑
</div>
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px">
<el-card shadow="never" style="margin-top:10px" class="box-card">
<el-form-item class="commonLabel discount" label="服务名称" prop="Name">
<el-tooltip class="item" effect="dark" content="例如:正品保障|极速发货|7天退换货" placement="top-start">
<i class=" elzk el-tooltip el-icon-info"></i>
</el-tooltip>
<el-input v-model="addMsg.Name" style="width:690px" size="small">
</el-input>
</el-form-item>
<el-form-item label="排序" prop="Sort">
<el-input type="number" min="1" size="small" style="width:690px" placeholder="请输入" v-model="addMsg.Sort">
</el-input>
</el-form-item>
<el-form-item label="备注">
<el-input type="textarea" :row="2" style="width:690px" placeholder="请输入" v-model="addMsg.Remark">
</el-input>
</el-form-item>
<el-form-item label="是否默认">
<el-switch
v-model="addMsg.IsDefault"
active-color="#409EFF"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-card>
</el-form>
<div style="padding:20px;background:#fff;margin-top:10px">
<el-button @click="Save('addMsg')" size="small" type="primary">保存</el-button>
</div>
</div>
</template>
<script>
export default {
name: "goodsServicesEdit",
data(){
return{
pageloading:false,
addMsg:{
Id:0,
Name:'',
Sort:100,
IsDefault:0,
Remark:'',
UpdateType:0,
},
rules:{
Name: [
{ required: true, message: '请输入服务名称', trigger: 'blur' },
],
Sort:[
{ required: true, message: '请输入排序', trigger: 'blur' },
],
},
}
},
created(){
// this.getData()
},
methods:{
Save(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
this.apipost('/api/product/SetProductServiceInfo',this.addMsg,
res => {
if (res.data.resultCode === 1) {
this.CommonJump('goodsServices')
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
} else {
return false;
}
});
},
getData(){
this.pageloading=true;
this.apipost("/api/product/GetProductRecommendSetInfo",{}, res => {
this.pageloading=false;
if(res.data.resultCode==1){
this.addMsg=res.data.data;
}else {
this.Error(res.data.message);
}
})
},
},
};
</script>
<style>
.goodsServicesEdit .discount .el-form-item__label{
padding-right: 30px;
}
.goodsServicesEdit .el-form-item .elzk{
position: absolute;
left: -25px;
top:12px;
}
</style>
This diff is collapsed.
......@@ -116,6 +116,7 @@
pageSize: 15,
NavIconName: "",
MallBaseId: 0,
NavIconIsShow:-1
},
total: 0,
NavIconIsShowAdd: true,
......
......@@ -163,7 +163,6 @@
getData(){
this.apipost("/api/user/GetMemberUserInfo",{UserId:this.UserId}, res => {
console.log("res,res",res);
this.userInfo=res.data.data;
})
},
......
......@@ -30,6 +30,7 @@
pageSize: 15,
NavIconName: "",
MallBaseId: 0,
NavIconIsShow:0,
},
total: 0,
navArr:[]
......
......@@ -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;
}
},
//给子组件调用 重新排序上移下移
......
......@@ -176,6 +176,44 @@ export default new Router({
name: 'addGoodsClass',
component: resolve => require(['@/components/CommodityMan/addGoodsClass'], resolve),
},
// 商品管理 规格模板
{
path: '/SpecificationTemplate',
name: 'SpecificationTemplate',
component: resolve => require(['@/components/CommodityMan/SpecificationTemplate'], resolve),
},
// 商品管理 快速购买
{
path: '/quickBuy',
name: 'quickBuy',
component: resolve => require(['@/components/CommodityMan/quickBuy'], resolve),
},
// 商品管理 推荐设置
{
path: '/RecSettings',
name: 'RecSettings',
component: resolve => require(['@/components/CommodityMan/RecSettings'], resolve),
},
// 商品管理 商品服务
{
path: '/goodsServices',
name: 'goodsServices',
component: resolve => require(['@/components/CommodityMan/goodsServices'], resolve),
},
// 商品管理 商品服务新增或修改
{
path: '/goodsServicesEdit',
name: 'goodsServicesEdit',
component: resolve => require(['@/components/CommodityMan/goodsServicesEdit'], resolve),
},
// 商品管理 商品列表
{
path: '/goodsList',
name: 'goodsList',
component: resolve => require(['@/components/CommodityMan/goodsList'], resolve),
},
//设置 基础设置
{
path: '/basicSetUp',
......
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