Commit 6c39447d authored by lihui's avatar lihui

feat: activityDetail

parents 15ef2269 8a2bf981
...@@ -91,17 +91,16 @@ exports.addMarketing = async ctx => { ...@@ -91,17 +91,16 @@ exports.addMarketing = async ctx => {
// 编辑营销活动 // 编辑营销活动
exports.updateMarketing = async ctx => { exports.updateMarketing = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/update_marketing`; const url = `${ACTIVITY_URI}/marketing/background/update_marketing`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 营销活动详情 // 营销活动详情
exports.marketingInfo = async ctx => { exports.marketingInfo = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/marketing_info`; const url = `${ACTIVITY_URI}/marketing/background/marketing_info`;
...@@ -139,6 +138,18 @@ exports.checkActivityDetail = async ctx => { ...@@ -139,6 +138,18 @@ exports.checkActivityDetail = async ctx => {
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 查看活动订单
exports.checkActivityDetailInfo = async ctx => {
const url = `${ACTIVITY_URI}/order/background/pindan_marketing_info_data_statistics`;
const opts = {
url,
method: "GET",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 获取自提点列表 // 获取自提点列表
exports.getPlaceList = async ctx => { exports.getPlaceList = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/take_place_list`; const url = `${ACTIVITY_URI}/marketing/background/take_place_list`;
......
...@@ -64,9 +64,10 @@ router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list) ...@@ -64,9 +64,10 @@ router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail) router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail)
// 后台运营管理 // 后台运营管理
router.get(`${API_VERSION}/marketing/background/marketing_list`, activity.getActivityList) router.get(`${API_VERSION}/marketing/background/marketing_list`, activity.getActivityList)
router.get(`${API_VERSION}/order/background/pindan_marketing_info_data_statistics`, activity.checkActivityDetailInfo)
router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoodsDetail) router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoodsDetail)
router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateActivity) router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateActivity)
router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.checkActivityDetail) router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.checkActivityDetail)
// //
router.get(`${API_VERSION}/marketing/background/take_place_list`, activity.getPlaceList) router.get(`${API_VERSION}/marketing/background/take_place_list`, activity.getPlaceList)
router.post(`${API_VERSION}/marketing/background/add_take_place`, activity.addPlace) router.post(`${API_VERSION}/marketing/background/add_take_place`, activity.addPlace)
......
...@@ -6,39 +6,41 @@ ...@@ -6,39 +6,41 @@
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)" element-loading-background="rgba(0, 0, 0, 0.8)"
> >
<div class="activityInfo"> <div class="activityInfo-wrapper">
<div> <el-card class="activityInfo">
<p></p> <div class="infoItem">
<p>订单数量</p> <p class="infoItemText">{{ detailInfo.order_count }}</p>
</div> <p>订单数量</p>
<div> </div>
<p></p> <div class="infoItem">
<p>已售商品数量</p> <p class="infoItemText">{{ detailInfo.sold_goods_count }}</p>
</div> <p>已售商品数量</p>
<div> </div>
<p></p> <div class="infoItem">
<p>支付金额</p> <p class="infoItemText">{{ detailInfo.pay_amount_count }}</p>
</div> <p>支付金额</p>
<div> </div>
<p></p> <div class="infoItem">
<p>优惠金额</p> <p class="infoItemText">{{ detailInfo.discount_amount_count }}</p>
</div> <p>优惠金额</p>
<div> </div>
<p></p> <div class="infoItem">
<p>退款</p> <p class="infoItemText">{{ detailInfo.refund_count }}</p>
</div> <p>退款</p>
<div> </div>
<p></p> <div class="infoItem">
<p>实际收入</p> <p class="infoItemText">{{ detailInfo.real_income_count }}</p>
</div> <p>实际收入</p>
</div>
</el-card>
</div> </div>
<div class="activityDetail"> <div class="activityDetail">
<div class="my-header">
<h3>{{ marketingInfo.marketing_name }}</h3>
<p class="endTime">{{ showTimer }}</p>
</div>
<section class="content"> <section class="content">
<el-card class="activityGoods box-card"> <el-card class="activityGoods box-card">
<div class="my-header">
<h3>{{ marketingInfo.marketing_name }}</h3>
<p class="endTime">{{ showTimer }}</p>
</div>
<p class="title">拼单商品</p> <p class="title">拼单商品</p>
<div class="images-wrapper"> <div class="images-wrapper">
<div <div
...@@ -111,7 +113,8 @@ export default { ...@@ -111,7 +113,8 @@ export default {
goodsList: [], goodsList: [],
marketingInfo: {}, marketingInfo: {},
endTime: "", endTime: "",
showTimer: "" showTimer: "",
detailInfo: {}
}; };
}, },
watch: {}, watch: {},
...@@ -120,14 +123,25 @@ export default { ...@@ -120,14 +123,25 @@ export default {
async checkActivityDetail() { async checkActivityDetail() {
try { try {
this.pageLoading = true; this.pageLoading = true;
let data = await ActivityService.checkActivityDetail({ let dataArr = await Promise.all([
marketing_id: this.$route.query.marketing_id, ActivityService.checkActivityDetail({
marketing_type: this.$route.query.marketing_type marketing_id: this.$route.query.marketing_id,
}); marketing_type: this.$route.query.marketing_type
}),
ActivityService.checkActivityDetailInfo({
marketing_id: this.$route.query.marketing_id
})
]);
// let data = await ActivityService.checkActivityDetail({
// marketing_id: this.$route.query.marketing_id,
// marketing_type: this.$route.query.marketing_type
// });
this.pageLoading = false; this.pageLoading = false;
this.goodsList = data.result.goods_list; this.goodsList = dataArr[0].result.goods_list;
this.marketingInfo = data.result.marketing_info; this.marketingInfo = dataArr[0].result.marketing_info;
this.endTime = data.result.marketing_info.end_time; this.endTime = dataArr[0].result.marketing_info.end_time;
this.detailInfo = dataArr[1].result;
} catch { } catch {
this.pageLoading = false; this.pageLoading = false;
ElMessage.error("加载失败"); ElMessage.error("加载失败");
...@@ -182,18 +196,39 @@ export default { ...@@ -182,18 +196,39 @@ export default {
.wrapper { .wrapper {
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; flex-direction: column;
justify-content: flex-start;
align-items: center;
padding: 45px 10px 0; padding: 45px 10px 0;
.activityDetail { .activityInfo {
width: 500px; width: 500px;
.my-header { /deep/ .el-card__body {
.endTime { width: 100%;
margin: 5px 0; display: flex;
font-size: 15px; flex-wrap: wrap;
color: red; }
.infoItem {
width: 33%;
text-align: center;
margin-bottom: 20px;
.infoItemText {
font-weight: bolder;
} }
// display: flex;
// align-items: center;
// justify-content: center;
} }
}
.activityDetail {
width: 500px;
.content { .content {
.my-header {
.endTime {
margin: 5px 0;
font-size: 15px;
color: red;
}
}
.box-card { .box-card {
margin: 10px 0; margin: 10px 0;
} }
......
...@@ -503,6 +503,7 @@ export default { ...@@ -503,6 +503,7 @@ export default {
this.comTableData = this.addProduc; this.comTableData = this.addProduc;
}, },
}, },
created() { created() {
this.getBusinessListMet(); this.getBusinessListMet();
this.marketingInfoMet(); this.marketingInfoMet();
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
<script> <script>
import { GOODS_URI } from "../../../../../server/config"; import { GOODS_URI } from "../../../../../server/config";
import { marketingInfo } from "../../../../service/Activity/index";
export default { export default {
props: { props: {
editInfo: { editInfo: {
...@@ -86,30 +85,20 @@ export default { ...@@ -86,30 +85,20 @@ export default {
this.infoEditForm.picUploadList.splice(i, 1); this.infoEditForm.picUploadList.splice(i, 1);
} }
} }
}, }
// 获取营销活动详情 },
async marketingInfoMet() { watch: {
let marketingId = this.$route.query.marketing_id; editInfo: function(newVal) {
if (marketingId == undefined) { this.infoEditForm.title = newVal.marketing_name;
return; this.infoEditForm.desc = newVal.pindan_desc;
} for (var i in newVal.pindan_pic_url) {
let params = {
marketing_id: marketingId,
marketing_type: "4"
};
const res = await marketingInfo(params);
this.infoEditForm.title = res.result.marketing_info.marketing_name;
this.infoEditForm.desc = res.result.marketing_info.pindan_desc;
for (var i in res.result.marketing_info.pindan_pic_url) {
this.infoEditForm.picUrlList.push({ this.infoEditForm.picUrlList.push({
url: res.result.marketing_info.pindan_pic_url[i] url: newVal.pindan_pic_url[i]
}); });
} }
} }
}, },
created() { created() {}
this.marketingInfoMet();
}
}; };
</script> </script>
......
...@@ -239,6 +239,7 @@ let checkphone = (rule, value, callback) => { ...@@ -239,6 +239,7 @@ let checkphone = (rule, value, callback) => {
export default { export default {
data() { data() {
return { return {
testData: this.spellOrderSetArr,
startDate: "", //开始时间 startDate: "", //开始时间
endDate: "", // 结束时间 endDate: "", // 结束时间
pickerOptions: { pickerOptions: {
...@@ -295,6 +296,7 @@ export default { ...@@ -295,6 +296,7 @@ export default {
id: "", // 删除自提点id id: "", // 删除自提点id
pageCount: 0, // 总条数 pageCount: 0, // 总条数
takePlacelist: [], // 自提点列表 takePlacelist: [], // 自提点列表
checkedTakePlacelist: [], // 已选择自提点列表 活动详情中添加的自提点列表
multipleSelection: [], multipleSelection: [],
dialogFormVisible: false, dialogFormVisible: false,
formLabelWidth: "120px", formLabelWidth: "120px",
...@@ -310,9 +312,27 @@ export default { ...@@ -310,9 +312,27 @@ export default {
} // 添加自提点 详细信息 } // 添加自提点 详细信息
}; };
}, },
props: {
spellOrderSetArr: {
type: Array,
default: () => []
}
},
components: { components: {
myMap myMap
}, },
watch: {
spellOrderSetArr: {
// 监听props属性 展示自提点列表
handler: function(newVal, oldVal) {
// TO DO
console.log("newVal:", newVal);
console.log("oldVal:", oldVal);
},
deep: true,
immediate: true
}
},
methods: { methods: {
/* API */ /* API */
// 获取自提点 // 获取自提点
...@@ -440,10 +460,12 @@ export default { ...@@ -440,10 +460,12 @@ export default {
} }
}, },
async created() { async created() {
// 初始化时间 if (this.$route.query.marketing_id) {
this.startMinTime = new Date(); // 开始时间的最小选择时间 console.log(this.spellOrderSetArr);
this.startMaxTime = ""; // 开始时间的最大选择时间 this.setTableListData(this.spellOrderSetArr);
this.getPlaceList(); } else {
this.getPlaceList();
}
} }
}; };
</script> </script>
......
...@@ -13,14 +13,21 @@ ...@@ -13,14 +13,21 @@
<el-step title="拼单设置"></el-step> <el-step title="拼单设置"></el-step>
</el-steps> </el-steps>
<div class="content"> <div class="content">
<infoEditing ref="infoEdit" v-if="active === 1" :editInfo="infoEditArr" /> <infoEditing
ref="infoEdit"
v-show="active === 1"
:editInfo="infoEditArr"
/>
<addProduc <addProduc
ref="addProduc" ref="addProduc"
v-else-if="active === 2" v-show="active === 2"
:editInfo="testData" :editInfo="testData"
:addProduc="addProducArr" :addProduc="addProducArr"
/> />
<spellOrderSet :spellOrderSet="spellOrderSetArr" v-else /> <spellOrderSet
:spellOrderSetArr="spellOrderSetArr"
v-show="active === 3"
/>
</div> </div>
<div class="stepsBtn"> <div class="stepsBtn">
<el-button @click="prev" v-show="active >= 2" style="margin-right: 20px" <el-button @click="prev" v-show="active >= 2" style="margin-right: 20px"
...@@ -56,7 +63,7 @@ export default { ...@@ -56,7 +63,7 @@ export default {
}, },
data() { data() {
return { return {
active: 3, // 步骤条状态 active: 1, // 步骤条状态
infoEditArr: [], // 信息编辑数据 infoEditArr: [], // 信息编辑数据
addProducArr: [], // 添加商品 addProducArr: [], // 添加商品
goodsSkuIDArr: [], // 接收goods_sku_id goodsSkuIDArr: [], // 接收goods_sku_id
...@@ -112,7 +119,7 @@ export default { ...@@ -112,7 +119,7 @@ export default {
const res = await marketingInfo(params); const res = await marketingInfo(params);
this.infoEditArr = res.result.marketing_info; this.infoEditArr = res.result.marketing_info;
this.addProducArr = res.result.goods_list; this.addProducArr = res.result.goods_list;
this.spellOrderSetArr = res.result.marketing_info; this.spellOrderSetArr = res.result.take_place;
}, },
// 取消 // 取消
......
...@@ -24,34 +24,43 @@ export async function pindanGoods(params) { ...@@ -24,34 +24,43 @@ export async function pindanGoods(params) {
// 查看商品详情 // 查看商品详情
export async function markGoodsInfo(params) { export async function markGoodsInfo(params) {
const res = await axios.get("/api/v1/goods/background/marketing_goods_info", { const res = await axios.get("/api/v1/goods/background/marketing_goods_info", {
params params
}); });
return res; return res;
} }
// 编辑商品详情 // 编辑商品详情
export async function editGoods(params) { export async function editGoods(params) {
const res = await axios.post("/api/v1/goods/background/edit_goods",params); const res = await axios.post("/api/v1/goods/background/edit_goods", params);
return res; return res;
} }
// 添加营销活动 // 添加营销活动
export async function addMarketing(params) { export async function addMarketing(params) {
const res = await axios.post("/api/v1/marketing/background/add_marketing",params); const res = await axios.post(
return res; "/api/v1/marketing/background/add_marketing",
params
);
return res;
} }
// 编辑营销活动 // 编辑营销活动
export async function updateMarketing(params) { export async function updateMarketing(params) {
const res = await axios.post("/api/v1/marketing/background/update_marketing",params); const res = await axios.post(
return res; "/api/v1/marketing/background/update_marketing",
params
);
return res;
} }
// 营销活动详情 // 营销活动详情
export async function marketingInfo(params) { export async function marketingInfo(params) {
const res = await axios.post("/api/v1/marketing/background/marketing_info",params); const res = await axios.post(
return res; "/api/v1/marketing/background/marketing_info",
params
);
return res;
} }
class ActivityService { class ActivityService {
...@@ -92,6 +101,17 @@ class ActivityService { ...@@ -92,6 +101,17 @@ class ActivityService {
return res; return res;
} }
// 查看活动订单-- 具体信息(新添加)
static async checkActivityDetailInfo(params) {
const res = await axios.get(
"/api/v1/order/background/pindan_marketing_info_data_statistics",
{
params
}
);
return res;
}
// 获取自提点列表 // 获取自提点列表
static async getPlaceList(params) { static async getPlaceList(params) {
const res = await axios.get( const res = await axios.get(
......
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