Commit 08deb1b7 authored by 黄奎's avatar 黄奎

页面修改

parent a2ce9c03
......@@ -695,9 +695,21 @@
this.Info(res.data.message);
}
})
},
//修改版权
TestMall() {
this.apipost("/api/Mall/GetHome",{MiniAppId:"wxacd9f8cc3480d29e"}, res => {
console.log("res",res);
if (res.data.resultCode == 1) {
} else {
this.Info(res.data.message);
}
})
},
},
mounted() {
this.TestMall();
this.init();
this.getMiniPrograme();
this.getRemoveMiniPrograme();
......
......@@ -258,7 +258,8 @@
max-height: 500px;
overflow: auto;
}
.Goodspic-box{
.Goodspic-box {
width: 70px;
height: 70px;
border: 1px solid #ccc;
......@@ -269,10 +270,12 @@
background-repeat: no-repeat;
position: relative;
}
.Goodspic-box i {
font-size: 22px;
color: #909399;
}
.Goodspic-box .size-tip {
line-height: 1.35;
text-align: center;
......@@ -287,7 +290,8 @@
color: #fff;
background: rgba(0, 0, 0, 0.2);
letter-spacing: -1px;
}
}
</style>
<template>
<div :class="{'active':goodData.isCked}">
......@@ -322,17 +326,17 @@
<div :style="cGoodsItemStyle" :flex="cGoodsItemFlex" style="position: relative;">
<div class="goods-pic"
:class="'goods-pic-'+data.goodsCoverProportion+' goods-pic-fill-'+data.fill"
:style="'background-image: url('+getIconLink(goods.CoverImage)+')'">
:style="'background-image: url('+getIconLink(goods.picUrl)+')'">
<div v-if="data.showGoodsTag" class="goods-tag"
:style="'background-image: url('+ getIconLink(data.goodsTagPicUrl)+')'"></div>
</div>
<div :style="cGoodsItemInfoStyle">
<div class="goods-name" :class="data.listStyle===-1?'goods-name-static':''">
<template v-if="data.showGoodsName">{{goods.Name}}</template>
<template v-if="data.showGoodsName">{{goods.name}}</template>
</div>
<div flex="box:last">
<div class="goods-price">
<template v-if="data.showGoodsPrice">{{goods.SellingPrice}}</template>
<template v-if="data.showGoodsPrice">{{goods.price}}</template>
</div>
<div>
<template v-if="cShowBuyBtn">
......@@ -361,7 +365,7 @@
<div class="diy-component-edit" v-if="goodData.isCked">
<el-form label-width='150px' @submit.native.prevent>
<el-form-item label="显示分类">
<el-switch v-model="data.showCat" @change="showCatChange"></el-switch>
<el-switch v-model="data.showCat" @change="showCatChange" :active-value="true" :inactive-value="false"></el-switch>
</el-form-item>
<template v-if="data.showCat">
<el-form-item label="分类栏位置">
......@@ -398,7 +402,7 @@
<div flex="box:first">
<div class="diy-goods-label">自定义商品</div>
<div>
<el-switch v-model="cat.staticGoods"></el-switch>
<el-switch v-model="cat.staticGoods" :active-value="true" :inactive-value="false"></el-switch>
</div>
</div>
<div flex="box:first" v-if="cat.staticGoods">
......@@ -410,7 +414,7 @@
<el-button @click="deleteGoods(goodsIndex,catIndex)" circle class="goods-delete" type="danger"
icon="el-icon-close"></el-button>
</el-tooltip>
<div class="goods-pic" :style="'background-image:url('+getIconLink(goods.CoverImage)+')'"></div>
<div class="goods-pic" :style="'background-image:url('+getIconLink(goods.picUrl)+')'"></div>
</div>
</draggable>
<div class="goods-add">
......@@ -437,7 +441,7 @@
<el-button @click="deleteGoods(goodsIndex,null)" circle class="goods-delete" type="danger"
icon="el-icon-close"></el-button>
</el-tooltip>
<div class="goods-pic" :style="'background-image:url('+getIconLink(goods.CoverImage)+')'"></div>
<div class="goods-pic" :style="'background-image:url('+getIconLink(goods.picUrl)+')'"></div>
</div>
</draggable>
<div class="goods-add">
......@@ -467,17 +471,17 @@
<el-radio v-model="data.goodsStyle" :label="3">无底无边框</el-radio>
</el-form-item>
<el-form-item label="显示商品名称">
<el-switch v-model="data.showGoodsName"></el-switch>
<el-switch v-model="data.showGoodsName" :active-value="true" :inactive-value="false"></el-switch>
</el-form-item>
<el-form-item label="显示商品价格">
<el-switch v-model="data.showGoodsPrice"></el-switch>
<el-switch v-model="data.showGoodsPrice" :active-value="true" :inactive-value="false"></el-switch>
</el-form-item>
<el-form-item v-if="data.listStyle!==-1" label="文本样式">
<el-radio v-model="data.textStyle" :label="1">左对齐</el-radio>
<el-radio v-model="data.textStyle" :label="2">居中</el-radio>
</el-form-item>
<el-form-item label="显示购买按钮" v-if="data.textStyle !== 2">
<el-switch v-model="data.showBuyBtn"></el-switch>
<el-switch v-model="data.showBuyBtn" :active-value="true" :inactive-value="false"></el-switch>
</el-form-item>
<el-form-item label="购买按钮样式" v-if="data.textStyle !== 2&&data.showBuyBtn">
<el-radio v-model="data.buyBtn" label="cart">购物车</el-radio>
......@@ -497,26 +501,28 @@
<el-input maxlength="4" size="small" v-model="data.buyBtnText"></el-input>
</el-form-item>
<el-form-item label="显示商品角标">
<el-switch v-model="data.showGoodsTag"></el-switch>
<el-switch v-model="data.showGoodsTag" :active-value="true" :inactive-value="false" ></el-switch>
</el-form-item>
<el-form-item label="商品角标" v-if="data.showGoodsTag">
<el-radio v-model="data.goodsTagPicUrl" v-for="tag in goodsTags" :label="tag.picUrl" :key="tag.name" @change="goodsTagChange">
{{tag.name}}
<el-radio v-model="data.goodsTagPicUrl" v-for="tag in goodsTags" :label="tag.picUrl" :key="tag.name"
@change="goodsTagChange">
{{tag.name}}
</el-radio>
<el-radio v-model="data.customizeGoodsTag" :label="true" @change="customizeGoodsTagChange">自定义</el-radio>
</el-form-item>
<el-form-item label="自定义商品角标" v-if="data.showGoodsTag&&data.customizeGoodsTag">
<div flex="main:center cross:center" @click="choicImg=true" class="Goodspic-box" :style="{backgroundImage:'url('+getIconLink(data.goodsTagPicUrl)+')'}">
<i v-if="data.goodsTagPicUrl==''" class="el-icon-picture-outline"></i>
<div class="size-tip">64 × 64</div>
</div>
<div flex="main:center cross:center" @click="choicImg=true" class="Goodspic-box"
:style="{backgroundImage:'url('+getIconLink(data.goodsTagPicUrl)+')'}">
<i v-if="data.goodsTagPicUrl==''" class="el-icon-picture-outline"></i>
<div class="size-tip">64 × 64</div>
</div>
</el-form-item>
<el-form-item label="背景颜色">
<div class="input-color" flex="dir:left cross:center">
<el-color-picker size="small" v-model="data.backgroundColor"></el-color-picker>
<el-input size="small" style="width: 80px;margin-right: 25px;" v-model="data.backgroundColor"></el-input>
</div>
</el-form-item>
<el-form-item label="背景颜色">
<div class="input-color" flex="dir:left cross:center">
<el-color-picker size="small" v-model="data.backgroundColor"></el-color-picker>
<el-input size="small" style="width: 80px;margin-right: 25px;" v-model="data.backgroundColor"></el-input>
</div>
</el-form-item>
</el-form>
</div>
</div>
......@@ -544,10 +550,10 @@
</div>
</template>
<script>
import draggable from "vuedraggable"
import ChooseImg from "@/components/global/ChooseImg.vue";
import ChooseFenlei from "../../common/choiceFenlei.vue";
import choiceGood from "../../common/choiceGood.vue";
import draggable from "vuedraggable"
import ChooseImg from "@/components/global/ChooseImg.vue";
import ChooseFenlei from "../../common/choiceFenlei.vue";
import choiceGood from "../../common/choiceGood.vue";
export default {
props: ["goodData", "index", "dataLeng"],
......@@ -562,32 +568,32 @@
data: this.goodData.data,
position: 'center center',
repeat: 'no-repeat',
choicImg:false,
isFenlei:false,
isShowGoods:false,
choicImg: false,
isFenlei: false,
isShowGoods: false,
//添加的下标
comIndex:-1,
comIndex: -1,
goodsTags: [{
name: '热销',
picUrl: this.domainManager().ImageUrl+'/Static/goods-tag-rx.png',
picUrl: this.domainManager().ImageUrl + '/Static/goods-tag-rx.png',
},
{
name: '新品',
picUrl: this.domainManager().ImageUrl+'/Static/goods-tag-xp.png',
picUrl: this.domainManager().ImageUrl + '/Static/goods-tag-xp.png',
},
{
name: '折扣',
picUrl: this.domainManager().ImageUrl+'/Static/goods-tag-zk.png',
picUrl: this.domainManager().ImageUrl + '/Static/goods-tag-zk.png',
},
{
name: '推荐',
picUrl: this.domainManager().ImageUrl+'/Static/goods-tag-tj.png',
picUrl: this.domainManager().ImageUrl + '/Static/goods-tag-tj.png',
},
],
};
},
created() {
},
methods: {
//向父组件传值 并调用排序
......@@ -595,7 +601,7 @@
this.$emit('getSord', this.index, IsUp);
},
//点击触发父组件删除
delPlugin(){
delPlugin() {
this.$emit('comDelPlugin', this.index);
},
cCatGoodsList(cat, catIndex) {
......@@ -609,9 +615,9 @@
} else {
const defaultGoodsItem = {
id: 0,
Name: '商品名称',
name: '商品名称',
picUrl: '',
SellingPrice: '100.00',
price: '100.00',
};
newList = new Array(cat.goodsNum).fill(defaultGoodsItem);
}
......@@ -636,9 +642,9 @@
},
showGoodsDialog(catIndex) {
if (catIndex !== null) {
this.comIndex=catIndex
this.comIndex = catIndex
} else {
this.comIndex=null;
this.comIndex = null;
}
this.isShowGoods = true;
},
......@@ -676,31 +682,55 @@
this.choicImg = false;
},
//选择商品分类
getChoiceFenlei(){
var ckedArr=this.$refs.ChooseFenlei.getChoicedFenlei();
this.data.catList=this.data.catList.concat(ckedArr);
this.isFenlei=false;
getChoiceFenlei() {
var ckedArr = this.$refs.ChooseFenlei.getChoicedFenlei();
var myCatArray = [];
if (ckedArr && ckedArr.length > 0) {
ckedArr.forEach(item => {
myCatArray.push({
goodsList: [],
goodsNum: 3,
id: item.id,
menuName: item.menuName,
name: item.name,
staticGoods: true
});
});
}
this.data.catList = this.data.catList.concat(myCatArray);
this.isFenlei = false;
this.$refs.ChooseFenlei.toggleSelection();
},
//取消商品分类选择
quxiaoFenlei(){
this.isFenlei=false;
quxiaoFenlei() {
this.isFenlei = false;
this.$refs.ChooseFenlei.toggleSelection();
},
//选择商品
getGoodsChoice(){
getGoodsChoice() {
var ckedArr = this.$refs.choiceGood.getChoicedGoods();
if(this.comIndex!==null){
this.data.catList[this.comIndex].goodsList=this.data.catList[this.comIndex].goodsList.concat(ckedArr);
}else{
this.data.list=this.data.list.concat(ckedArr);
var myArray = [];
if (ckedArr && ckedArr.length > 0) {
ckedArr.forEach(element => {
myArray.push({
id: element.Id,
name: element.Name,
picUrl: element.CoverImage,
price: element.SellingPrice
});
});
}
if (this.comIndex !== null) {
this.data.catList[this.comIndex].goodsList = this.data.catList[this.comIndex].goodsList.concat(myArray);
} else {
this.data.list = this.data.list.concat(myArray);
}
this.isShowGoods=false;
this.isShowGoods = false;
this.$refs.choiceGood.toggleSelection();
},
//取消选择商品
quxiaoGoods(){
this.isShowGoods=false;
quxiaoGoods() {
this.isShowGoods = false;
this.$refs.choiceGood.toggleSelection();
}
},
......
......@@ -1237,6 +1237,7 @@
//点击保存
SaveData() {
this.addMsg.ComponentDataList = this.dataList;
console.log("this.addMsg.ComponentDataList",this.addMsg.ComponentDataList);
this.apipost("/api/Template/SetMiniTemplate", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.addMsg.Id = res.data.data;
......
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