Commit 06d34b8b authored by 黄奎's avatar 黄奎

页面修改

parent 730b91b8
......@@ -38,6 +38,11 @@
<el-table-column prop="MaterialInfo" label="发圈文案" width="300">
</el-table-column>
<el-table-column prop="MaterialImg" label="图片视频" width="300">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.ImgList" :key="index">
<img :src="item" />
</div>
</template>
</el-table-column>
<el-table-column prop="GoodsId" label="商品信息" width="220">
</el-table-column>
......@@ -78,9 +83,9 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<img @click="getCategory(scope.row.Id)" style="width:32px;height:32px;margin:0 10px"
<img @click="getShareFriend(scope.row.Id)" style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/edit.png" alt="">
<img @click="removeCategory(scope.row.Id)" style="width:32px;height:32px;margin:0 10px"
<img @click="removeShareFriend(scope.row.Id)" style="width:32px;height:32px;margin:0 10px"
src="../../assets/img/userman/del.png" alt="">
</template>
</el-table-column>
......@@ -108,11 +113,11 @@
<el-button size="mini" @click="imgDialog=true">选择文件</el-button>
</el-tooltip>
<div>
<div class="zk_pic_box" v-if="dynamicArr.length==0" style="width:90px;height:90px;"
<div class="zk_pic_box" v-if="addMsg.ImgList.length==0" style="width:90px;height:90px;"
flex="main:center cross:center">
<i class="el-icon-picture-outline"></i>
</div>
<div v-else class="zk_pic_box" v-for="(item,index) in dynamicArr" :key="index"
<div v-else class="zk_pic_box" v-for="(item,index) in addMsg.ImgList" :key="index"
style="width:90px;height:90px;display:inline-block;margin-right:10px;" flex="main:center cross:center"
:style="{backgroundImage:'url(' + item + ')'}">
<i v-if="item==''" class="el-icon-picture-outline"></i>
......@@ -185,17 +190,17 @@
pageSize: 10,
total: 0,
},
dynamicArr: [], //动态图片数组
addMsg: {
Id: 0, //编号
CateId: 0, //分类编号
GoodsId: 0, //商品编号
CoverImg: "", //封面图
MaterialImg: "", //素材图片
MaterialInfo: "", //素材文案
LinkUrl: "", //链接地址
IsTop: 0, //是否置顶
SortNum: 0, //排序
ImgList: [], //动态图片数组
},
imgDialog: false, //图片弹窗
rules: {
......@@ -234,7 +239,6 @@
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.addMsg.MaterialImg = this.dynamicArr.toString();
this.apipost("/api/Share/SetShareFriend", this.addMsg,
res => {
this.loading = false;
......@@ -267,12 +271,16 @@
this.addMsg.CateId = tempObj.CateId;
this.addMsg.GoodsId = tempObj.GoodsId;
this.addMsg.CoverImg = tempObj.CoverImg;
this.addMsg.MaterialImg = tempObj.MaterialImg;
this.addMsg.MaterialInfo = tempObj.MaterialInfo;
this.addMsg.LinkUrl = tempObj.LinkUrl;
if (tempObj.LinkUrl) {
this.addMsg.LinkUrl = tempObj.LinkUrl;
}
this.addMsg.IsTop = tempObj.IsTop;
this.addMsg.SortNum = tempObj.SortNum;
this.addMsg.ImgList = tempObj.ImgList;
}
this.IsShowCategory = false;
} else {
this.Error(res.data.message);
}
......@@ -304,7 +312,7 @@
this.addMsg.CateId = 0;
this.addMsg.GoodsId = 0;
this.addMsg.CoverImg = "";
this.addMsg.MaterialImg = "";
this.addMsg.MaterialInfo = "";
this.addMsg.LinkUrl = "";
this.addMsg.IsTop = 1;
......@@ -346,7 +354,6 @@
},
//更新排序
updateSortNum(item) {
console.log(item, 'item');
this.apipost("/api/Share/SetShareFriendSortNum", {
Id: item.Id,
SortNum: item.SortNum
......@@ -382,16 +389,20 @@
//选择图片
SelectId(msg) {
let that = this;
if (this.dynamicArr.length < 9) {
this.dynamicArr.push(that.getIconLink(msg[0].url));
} else {
if (msg && msg.length > 0) {
msg.forEach(item => {
this.addMsg.ImgList.push(that.getIconLink(item.url))
})
};
if (this.addMsg.ImgList.length > 9) {
this.addMsg.ImgList.length = 9;
this.Error('最多选择9张图片哟!');
}
this.imgDialog = false;
},
//删除图片
delImgArr(index) {
this.dynamicArr.splice(index, 1);
this.addMsg.ImgList.splice(index, 1);
},
},
......
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