+
{{form.productList1.productName}}
@@ -58,19 +70,19 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -118,9 +130,12 @@
},
data() {
return {
- loading1:false,
- aaVisiable:false,
- shopList:[],
+ adList: [{
+ pic: ''
+ }],
+ loading1: false,
+ aaVisiable: false,
+ shopList: [],
roleList: [],
visible: this.value,
title: "",
@@ -146,17 +161,17 @@
maxHeight: 510,
form: {
position: '',
- sortOrder:"",
- title:'',
- adImage:'',
- status:1,
- regionId:JSON.parse(this.getStore("user")).departmentId,
- merchantName:'',
- merchantId:'',
- merchantImage:'',
- linkUrl:'/package1/group/groupBuySingle?type=shop&item=',
- linkParams:'',
- productList1:{
+ sortOrder: "",
+ title: '',
+ adImage: '',
+ status: 1,
+ regionId: JSON.parse(this.getStore("user")).departmentId,
+ merchantName: '',
+ merchantId: '',
+ merchantImage: '',
+ linkUrl: '/package1/group/groupBuySingle?type=shop&item=',
+ linkParams: '',
+ productList1: {
adId: "",
productImage: "",
productName: "",
@@ -164,10 +179,10 @@
groupPrice: "",
groupMembers: ""
},
- productList:[]
+ productList: []
},
searchForm: {
- regionId:JSON.parse(this.getStore("userInfo")).departmentId,
+ regionId: JSON.parse(this.getStore("userInfo")).departmentId,
shopType: "",
shopArea: "",
pageNumber: 1,
@@ -186,11 +201,24 @@
},
methods: {
init() {
-
+
+ },
+ addOne() {
+ let data = {
+ pic: ''
+ }
+ this.adList.push(data)
+ },
+ delOne(i) {
+ this.adList.splice(i, 1);
},
submit() {
this.form.productList.push(this.form.productList1)
- this.form.linkUrl='/package1/group/groupBuySingle?type=shop&item='
+ this.form.linkUrl = '/package1/group/groupBuySingle?type=shop&item='
+ this.form.adImage = ''
+ for (let i = 0; i < this.adList.length; i++) {
+ this.form.adImage += this.adList[i].pic + ','
+ }
this.$refs.form.validate((valid) => {
if (valid) {
if (this.type == "1") {
@@ -199,22 +227,22 @@
updateAD(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
-
+
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.form = {
position: '',
- sortOrder:"",
- title:'',
- adImage:'',
- status:1,
- regionId:JSON.parse(this.getStore("user")).departmentId,
- merchantName:'',
- merchantId:'',
- merchantImage:'',
- linkUrl:'/package1/group/groupBuySingle?type=shop&item=',
- linkParams:'',
- productList1:{
+ sortOrder: "",
+ title: '',
+ adImage: '',
+ status: 1,
+ regionId: JSON.parse(this.getStore("user")).departmentId,
+ merchantName: '',
+ merchantId: '',
+ merchantImage: '',
+ linkUrl: '/package1/group/groupBuySingle?type=shop&item=',
+ linkParams: '',
+ productList1: {
adId: "",
productImage: "",
productName: "",
@@ -222,7 +250,7 @@
groupPrice: "",
groupMembers: ""
},
- productList:[]
+ productList: []
}
this.visible = false;
}
@@ -233,22 +261,22 @@
addAD(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
-
+
this.$Message.success("操作成功");
this.$emit("on-submit", true);
this.form = {
position: '',
- sortOrder:"",
- title:'',
- adImage:'',
- status:1,
- regionId:JSON.parse(this.getStore("user")).departmentId,
- merchantName:'',
- merchantId:'',
- merchantImage:'',
- linkUrl:'/package1/group/groupBuySingle?type=shop&item=',
- linkParams:'',
- productList1:{
+ sortOrder: "",
+ title: '',
+ adImage: '',
+ status: 1,
+ regionId: JSON.parse(this.getStore("user")).departmentId,
+ merchantName: '',
+ merchantId: '',
+ merchantImage: '',
+ linkUrl: '/package1/group/groupBuySingle?type=shop&item=',
+ linkParams: '',
+ productList1: {
adId: "",
productImage: "",
productName: "",
@@ -256,7 +284,7 @@
groupPrice: "",
groupMembers: ""
},
- productList:[]
+ productList: []
}
this.visible = false;
}
@@ -265,9 +293,9 @@
}
});
},
- checkGoods(){
+ checkGoods() {
let that = this;
- if(this.form.merchantId == ''){
+ if (this.form.merchantId == '') {
this.$Message.warning("您还未选择商家");
return
}
@@ -276,15 +304,15 @@
that.$refs.goodsPage.init(that.form.linkParams);
});
},
- getGoods(v){
- console.log('11111',v)
+ getGoods(v) {
+ console.log('11111', v)
this.form.productList1.productImage = v.productPicture
this.form.productList1.productName = v.productName
- console.log('22222',this.form)
+ console.log('22222', this.form)
this.aaVisiable = false
},
- sreachShop(v){
-
+ sreachShop(v) {
+
this.searchForm.keyWord = v
// 多条件搜索用户列表
this.loading = true;
@@ -292,28 +320,28 @@
this.loading = false;
if (res.success) {
this.shopList = res.result.content;
- for(let i=0;i
item.trim() !== '') // 过滤掉空项
+ .map(url => ({
+ pic: url.trim()
+ }));
+ } else {
+ // 没有逗号:整个字符串作为一个对象
+ this.adList = [{
+ pic: this.form.adImage.trim()
+ }];
+ }
getShopData(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
this.shopList = res.result.content;
- for(let i=0;i0){
+ if (data.productList.length > 0) {
this.form.productList1 = {
adId: data.id,
productImage: data.productList[0].productImage,
productName: data.productList[0].productName,
originalPrice: data.productList[0].originalPrice,
groupPrice: data.productList[0].groupPrice,
- groupMembers:data.productList[0].groupMembers
+ groupMembers: data.productList[0].groupMembers
}
- }else{
+ } else {
this.form.productList1 = {
adId: "",
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
- groupMembers:""
+ groupMembers: ""
}
}
-
+
}
this.$forceUpdate()
this.visible = value;
diff --git a/src/views/app/business/lineManage/lineManage.vue b/src/views/app/business/lineManage/lineManage.vue
index 97da042..ee25d2e 100644
--- a/src/views/app/business/lineManage/lineManage.vue
+++ b/src/views/app/business/lineManage/lineManage.vue
@@ -155,23 +155,49 @@
width: 100,
render: (h, params) => {
- return h("img", {
- attrs: {
- src: params.row.adImage,
- },
- style: {
- cursor: "zoom-in",
- width: "80px",
- height: "60px",
- margin: "10px 0",
- "object-fit": "contain",
- },
- on: {
- click: () => {
- this.showPic(params.row.adImage);
- },
- },
- });
+ // 处理图片字符串:分割、过滤空项、去空格
+ const imageStr = params.row.adImage || '';
+ const imageUrls = imageStr.indexOf(',') !== -1
+ ? imageStr.split(',').filter(item => item.trim() !== '').map(url => url.trim())
+ : [imageStr.trim()];
+
+ // 如果没有任何有效图片,显示占位符
+ if (imageUrls.length === 0 || (imageUrls.length === 1 && imageUrls[0] === '')) {
+ return h('span', '无图片');
+ }
+
+ // 创建多个 img 标签
+ const imgElements = imageUrls.map(url => {
+ return h('img', {
+ attrs: {
+ src: url,
+ },
+ style: {
+ cursor: "zoom-in",
+ width: "80px",
+ height: "60px",
+ margin: "10px 5px", // 横向间距
+ "object-fit": "contain",
+ "border-radius": "4px",
+ "background": "#f5f5f5"
+ },
+ on: {
+ click: () => {
+ this.showPic(url); // 注意:点击时传入当前图片的 URL
+ },
+ },
+ });
+ });
+
+ // 用 div 包裹,flex 布局横向排列,允许换行
+ return h('div', {
+ style: {
+ display: "flex",
+ "flex-wrap": "wrap",
+ "align-items": "center",
+ "gap": "8px"
+ }
+ }, imgElements);
},
},
{