Commit 6c39447d authored by lihui's avatar lihui

feat: activityDetail

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