Commit 3f670438 authored by lihui's avatar lihui

feat: pic

parent e1230bc7
<template> <template>
<div <layout>
class="manage-wrapper" <div
v-loading="tableLoading" class="manage-wrapper"
element-loading-text="拼命加载中" v-loading="tableLoading"
element-loading-spinner="el-icon-loading" element-loading-text="拼命加载中"
element-loading-background="rgba(0, 0, 0, 0.8)" element-loading-spinner="el-icon-loading"
> element-loading-background="rgba(0, 0, 0, 0.8)"
<el-form
ref="form"
:model="activity"
inline
label-width="80px"
class="form-wrapper"
> >
<!-- 表单控件 --> <el-form
<div class="formitem-wrapper"> ref="form"
<el-form-item label="活动名称"> :model="activity"
<el-input v-model="activity.activityName"></el-input> inline
</el-form-item> label-width="80px"
<el-form-item label="活动状态"> class="form-wrapper"
<el-select v-model="activity.online_status"> >
<el-option <!-- 表单控件 -->
v-for="item in options" <div class="formitem-wrapper">
:key="item.value" <el-form-item label="活动名称">
:label="item.label" <el-input v-model="activity.activityName"></el-input>
:value="item.value" </el-form-item>
></el-option> <el-form-item label="活动状态">
</el-select> <el-select v-model="activity.online_status">
</el-form-item> <el-option
<el-form-item style="margin-left: 50px"> v-for="item in options"
<el-button type="primary" @click="getActivityList">搜索</el-button> :key="item.value"
</el-form-item> :label="item.label"
<el-form-item> :value="item.value"
<el-button type="primary" @click="goReleaseProduc" ></el-option>
>发布拼单</el-button </el-select>
> </el-form-item>
</el-form-item> <el-form-item style="margin-left: 50px">
</div> <el-button type="primary" @click="getActivityList">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="goReleaseProduc"
>发布拼单</el-button
>
</el-form-item>
</div>
<!-- 列表 --> <!-- 列表 -->
<div class="table-wrapper"> <div class="table-wrapper">
<el-table :data="tableActivityList" border style="width: 100%"> <el-table :data="tableActivityList" border style="width: 100%">
<el-table-column <el-table-column
align="center" align="center"
prop="activiteId" prop="activiteId"
label="活动ID" label="活动ID"
width="width" width="width"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="activiteHead" prop="activiteHead"
label="活动标题" label="活动标题"
width="width" width="width"
> >
<template #default="scope"> <template #default="scope">
<div @click="handleHeadline(scope.row)" class="activityTitle"> <div @click="handleHeadline(scope.row)" class="activityTitle">
<div> <div>
{{ scope.row.activiteHead }} {{ scope.row.activiteHead }}
</div>
<div class="activityPrice">
{{
scope.row.minPrice === scope.row.maxPrice
? ` ¥ ${scope.row.minPrice}`
: ` ¥ ${scope.row.minPrice}~¥${scope.row.maxPrice} `
}}
</div>
</div> </div>
<div class="activityPrice"> </template>
{{ </el-table-column>
scope.row.minPrice === scope.row.maxPrice <el-table-column
? ` ¥ ${scope.row.minPrice}` align="center"
: ` ¥ ${scope.row.minPrice}~¥${scope.row.maxPrice} ` prop="activiteStatus"
}} label="活动状态"
width="width"
>
</el-table-column>
<el-table-column
align="center"
prop="orderNumber"
label="订单数量"
width="width"
>
</el-table-column>
<el-table-column
align="center"
prop="scope"
label="操作"
width="250"
>
<template #default="scope">
<div class="button-one">
<el-button
type="primary"
size="small"
@click="handleModify(scope.row)"
>修改</el-button
>
<el-popconfirm
title="确定要结束本次拼单吗?"
@confirm="updateActivity"
>
<template #reference>
<el-button
v-show="scope.row.status === 1"
type="primary"
size="small"
@click="handleEnd(scope.row)"
>结束</el-button
>
</template>
</el-popconfirm>
<el-popconfirm
title="确定要开启本次拼单吗?"
@confirm="updateActivity"
>
<template #reference>
<el-button
v-show="
scope.row.status === 2 || scope.row.status === 3
"
type="primary"
size="small"
@click="handleStart(scope.row)"
>开始</el-button
>
</template>
</el-popconfirm>
</div> </div>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="activiteStatus"
label="活动状态"
width="width"
>
</el-table-column>
<el-table-column
align="center"
prop="orderNumber"
label="订单数量"
width="width"
>
</el-table-column>
<el-table-column align="center" prop="scope" label="操作" width="250">
<template #default="scope">
<div class="button-one">
<el-button <el-button
class="checkButton"
type="primary" type="primary"
size="small" size="small"
@click="handleModify(scope.row)" @click="handleLook(scope.row)"
>修改</el-button >查看订单</el-button
> >
<el-popconfirm </template>
title="确定要结束本次拼单吗?" </el-table-column>
@confirm="updateActivity" </el-table>
> </div>
<template #reference>
<el-button
v-show="scope.row.status === 1"
type="primary"
size="small"
@click="handleEnd(scope.row)"
>结束</el-button
>
</template>
</el-popconfirm>
<el-popconfirm
title="确定要开启本次拼单吗?"
@confirm="updateActivity"
>
<template #reference>
<el-button
v-show="scope.row.status === 2 || scope.row.status === 3"
type="primary"
size="small"
@click="handleStart(scope.row)"
>开始</el-button
>
</template>
</el-popconfirm>
</div>
<el-button
class="checkButton"
type="primary"
size="small"
@click="handleLook(scope.row)"
>查看订单</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页 --> <!-- 分页 -->
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:total="pageCount" :total="pageCount"
:page-size="10" :page-size="10"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
> >
</el-pagination> </el-pagination>
</div> </div>
</el-form> </el-form>
</div> </div>
</layout>
</template> </template>
<script> <script>
import { layout } from "../../Groupmeal/layout/index.vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import ActivityService from "@/service/Activity/index"; import ActivityService from "@/service/Activity/index";
import dayJs from "dayjs"; import dayJs from "dayjs";
...@@ -174,6 +184,9 @@ export default { ...@@ -174,6 +184,9 @@ export default {
] ]
}; };
}, },
components: {
layout
},
methods: { methods: {
/* API */ /* API */
// 获取商品列表 // 获取商品列表
...@@ -286,7 +299,7 @@ export default { ...@@ -286,7 +299,7 @@ export default {
marketing_id: val.activiteId, marketing_id: val.activiteId,
online_status: 2, // 1 启用 2 关闭 online_status: 2, // 1 启用 2 关闭
end_time: dayJs().format("YYYY-MM-DD HH:mm:ss") end_time: dayJs().format("YYYY-MM-DD HH:mm:ss")
}; };
}, },
// 开始 // 开始
handleStart(val) { handleStart(val) {
......
...@@ -45,7 +45,12 @@ export default { ...@@ -45,7 +45,12 @@ export default {
props: { props: {
infoEditArr: { infoEditArr: {
type: Object, type: Object,
defult: () => {} default: () => {
return {
pindan_pic_url: []
};
},
require: true
} }
}, },
data() { data() {
...@@ -54,11 +59,10 @@ export default { ...@@ -54,11 +59,10 @@ export default {
title: "", // 标题 title: "", // 标题
desc: "", // 介绍 desc: "", // 介绍
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表 picUrlList: [], // 图片回显列表
picSubmitList: [] // 发布功能需要的图片列表
}, },
propData: {}, propData: {},
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址 uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址
}; };
...@@ -66,15 +70,20 @@ export default { ...@@ -66,15 +70,20 @@ export default {
watch: { watch: {
infoEditArr: { infoEditArr: {
// 监听props属性 展示自提点列表 // 监听props属性 展示自提点列表
handler: async function(newVal) { handler: function(newVal) {
console.log(99);
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
this.propData = newVal; this.propData = newVal;
this.infoEditForm.title = this.propData.marketing_name; this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc; this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) { // console.log(newVal.pindan_pic_url.length);
this.infoEditForm.picUrlList.push({ // console.log(oldVal);
url: this.propData.pindan_pic_url[i] if (newVal.pindan_pic_url) {
}); for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
});
}
} }
} }
}, },
...@@ -91,16 +100,26 @@ export default { ...@@ -91,16 +100,26 @@ export default {
// 图片上传成功时 // 图片上传成功时
handleDetailSuccess(res) { handleDetailSuccess(res) {
this.infoEditForm.picUploadList.push(res.result.image_id); this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id
// this.infoEditForm.picUrlList.push({
// // 回显图片列表
// url: res.result.url
// });
}, },
// 图片删除后 // 图片删除后
removeDetailFiles(file, fileList) { removeDetailFiles(file, fileList) {
for (let i = 0; i < fileList.length; i++) { for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid == file.uid) { if (fileList[i].uid == file.uid) {
this.infoEditForm.picUploadList.splice(i, 1); this.infoEditForm.picUrlList.splice(i, 1);
} }
} }
// for (let i = 0; i < fileList.length; i++) {
// if (fileList[i].uid == file.uid) {
// this.infoEditForm.picUploadList.splice(i, 1);
// }
// }
}, },
// 获取营销活动详情 // 获取营销活动详情
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<addProduc <addProduc
ref="addProduc" ref="addProduc"
v-show="active === 2" v-show="active === 2"
:editInfo="infoEditArr"
:addProduc="addProducArr" :addProduc="addProducArr"
:editInfo="infoEditArr"
/> />
<spellOrderSet <spellOrderSet
ref="spellOrderSet" ref="spellOrderSet"
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
ElMessage.error("请填写商品标题"); ElMessage.error("请填写商品标题");
return; return;
} }
this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title; // this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title;
this.active = 2; this.active = 2;
} else if (this.active === 2) { } else if (this.active === 2) {
if (this.$refs.addProduc.comTableData.length == 0) { if (this.$refs.addProduc.comTableData.length == 0) {
...@@ -131,6 +131,13 @@ export default { ...@@ -131,6 +131,13 @@ export default {
// 确认发布 // 确认发布
async confirmRelease() { async confirmRelease() {
let list = this.$refs.infoEdit.infoEditForm.picUrlList.map(item => {
console.log(item);
return item.url;
});
console.log(list);
let picList = list.join(",");
console.log(this.$refs.infoEdit.infoEditForm.picUrlList);
for (var i in this.addProducArr) { for (var i in this.addProducArr) {
this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id); this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id);
} }
...@@ -147,9 +154,7 @@ export default { ...@@ -147,9 +154,7 @@ export default {
op_cur_user: store.state.userInfo.email, op_cur_user: store.state.userInfo.email,
start_time: this.startDate, start_time: this.startDate,
end_time: this.endDate, end_time: this.endDate,
pindan_pic: this.infoEditArr.pindan_pic_url pindan_pic: picList,
? this.infoEditArr.pindan_pic_url
: [].concat(this.$refs.infoEdit.infoEditForm.picUploadList).join(","),
pindan_desc: this.$refs.infoEdit.infoEditForm.desc, pindan_desc: this.$refs.infoEdit.infoEditForm.desc,
take_place_ids: this.takePlaceIDArr take_place_ids: this.takePlaceIDArr
}; };
......
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