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

页面修改

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