wangfukang 3 weeks ago
parent
commit
3bfa70b3e1
  1. 8
      src/api/index.js
  2. 127
      src/views/app/business/lineManage/addEdit.vue
  3. 143
      src/views/app/business/lineManage/lineManage.vue
  4. 51
      src/views/app/business/logistics/logistics.vue

8
src/api/index.js

@ -832,6 +832,14 @@ export const getBaseDeliveryFeeSetting = (params) => {
export const saveBaseDeliveryFeeSetting = (params) => {
return postBodyRequest('/mall/admin/seckillGroup/baseDeliveryFee/save', params)
}
// 查询校区配送开关
export const getShopAreaDeliverySwitch = (params) => {
return getRequest('/app/shopArea/deliverySwitch/get', params)
}
// 保存校区配送开关
export const saveShopAreaDeliverySwitch = (params) => {
return postRequest('/app/shopArea/deliverySwitch/update', params)
}
// 查询i/e审核管理配置
export const getIeAuditSetting = (params) => {
return getRequest('/app/ie/admin/audit-setting', params)

127
src/views/app/business/lineManage/addEdit.vue

@ -10,14 +10,15 @@
<Row :gutter="32">
<Col span="24">
<FormItem label="广告位置" prop="position">
<Select v-model="form.position" style="width:200px">
<Input v-if="isHomePopup" value="首页弹窗" disabled />
<Select v-else v-model="form.position" style="width:200px">
<Option v-for="item in dictData" :value="item.value" :key="item.value">{{ item.title }}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Row :gutter="32" v-if="!isHomePopup">
<Col span="12">
<FormItem label="商家名" prop="value">
<Select v-model="form.merchantId" filterable @on-change="checkShop"
@ -31,16 +32,16 @@
<Row :gutter="32">
<Col span="24">
<FormItem label="广告图" prop="adImage">
<FormItem :label="isHomePopup ? '弹窗图片' : '广告图'" prop="adImage">
<div v-for="(item,index) in adList" :key="index" style="display: flex;line-height: 30px;">
<upload-pic-input v-model="item.pic"></upload-pic-input>
<Icon @click="delOne(index)" type="ios-trash-outline" v-if="adList.length>1" size="30"
<Icon @click="delOne(index)" type="ios-trash-outline" v-if="!isHomePopup && adList.length>1" size="30"
color="red" />
</div>
</FormItem>
</Col>
</Row>
<Row :gutter="32" v-if="form.position != 'home_top'">
<Row :gutter="32" v-if="!isHomePopup && form.position != 'home_top'">
<Col span="24">
<FormItem label="广告标题" prop="title">
<Input v-model="form.title" placeholder="请输入广告标题" />
@ -54,7 +55,7 @@
</FormItem>
</Col>
</Row>
<Row :gutter="32" v-if="form.position != 'home_top'">
<Row :gutter="32" v-if="!isHomePopup && form.position != 'home_top'">
<Col span="24">
<FormItem label="广告关联商品" prop="productList1">
<div @click="checkGoods"
@ -65,7 +66,7 @@
</FormItem>
</Col>
</Row>
<Row :gutter="32" v-if="form.productList1.productName != ''">
<Row :gutter="32" v-if="!isHomePopup && form.productList1.productName != ''">
<Col span="12">
<FormItem label="商品原价" prop="originalPrice">
<Input v-model="form.productList1.originalPrice" placeholder="请输入商品原价" />
@ -124,6 +125,14 @@
type: String,
default: "0",
},
scene: {
type: String,
default: "homeAd",
},
homeCenterAdCount: {
type: Number,
default: 0,
},
},
data() {
return {
@ -136,28 +145,20 @@
roleList: [],
visible: this.value,
title: "",
originalPosition: "",
data: [],
dictData: [{
title: "首页顶部大广告位",
value: 'home_top'
}, {
title: "首页中位左上",
value: 'home_center_left_top'
}, {
title: "首页中位左下",
value: 'home_center_left_bottom'
}, {
title: "首页中位右上",
value: 'home_center_right_top'
}, {
title: "首页中位右下",
value: 'home_center_right_bottom'
title: "首页广告位",
value: 'home_center'
}],
passColor: "",
submitLoading: false,
maxHeight: 510,
form: {
position: '',
position: 'home_center',
sortOrder: "",
title: '',
adImage: '',
@ -196,9 +197,38 @@
},
};
},
computed: {
isHomePopup() {
return this.scene == "homePopup" || this.form.position == "home_popup";
},
},
methods: {
init() {
},
getDefaultForm() {
return {
position: this.scene == "homePopup" ? "home_popup" : 'home_center',
sortOrder: "",
title: this.scene == "homePopup" ? "首页弹窗" : '',
adImage: '',
status: 1,
regionId: JSON.parse(this.getStore("user")).departmentId,
merchantName: '',
merchantId: '',
merchantImage: '',
linkUrl: this.scene == "homePopup" ? '' : '/package2/group/groupBuySingle?type=shop&item=',
linkParams: '',
productList1: {
adId: "",
productImage: "",
productName: "",
originalPrice: "",
groupPrice: "",
groupMembers: ""
},
productList: []
}
},
addOne() {
let data = {
@ -209,13 +239,40 @@
delOne(i) {
this.adList.splice(i, 1);
},
isHomeCenterPosition(position) {
return !!position && position != 'home_top' && position != 'home_popup';
},
submit() {
this.form.productList = []
this.form.productList.push(this.form.productList1)
this.form.linkUrl = '/package2/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.form.adImage = this.adList
.map(item => item.pic)
.filter(item => item != null && String(item).trim() != '')
.map(item => String(item).trim())
.join(',')
if (this.isHomePopup) {
this.form.position = 'home_popup'
this.form.title = this.form.title || '首页弹窗'
this.form.merchantName = ''
this.form.merchantId = ''
this.form.merchantImage = ''
this.form.linkUrl = ''
this.form.linkParams = ''
this.form.productList = []
} else {
if (this.isHomeCenterPosition(this.form.position)) {
const isNewHomeCenterAd = !this.isHomeCenterPosition(this.originalPosition)
if (isNewHomeCenterAd && this.homeCenterAdCount >= 10) {
this.$Message.warning("首页广告位最多添加10个");
return;
}
this.form.position = 'home_center'
}
this.form.productList = []
this.form.productList.push(this.form.productList1)
this.form.linkUrl = '/package2/group/groupBuySingle?type=shop&item='
}
if (this.isHomePopup && !this.form.adImage) {
this.$Message.warning("请上传弹窗图片");
return;
}
this.$refs.form.validate((valid) => {
if (valid) {
@ -405,16 +462,26 @@
}
//
this.$refs.form.resetFields();
this.originalPosition = "";
this.form = this.getDefaultForm();
this.adList = [{
pic: ''
}];
if (this.type == "0" || this.type == "1") {
//
let data = this.data;
this.originalPosition = data.position || "";
//
this.form = data;
this.form = Object.assign(this.getDefaultForm(), data);
if (this.isHomeCenterPosition(this.form.position)) {
this.form.position = 'home_center';
}
//
if (this.form.adImage.indexOf(',') !== -1) {
const adImage = this.form.adImage || '';
if (adImage.indexOf(',') !== -1) {
// {pic: url}
this.adList = this.form.adImage
this.adList = adImage
.split(',')
.filter(item => item.trim() !== '') //
.map(url => ({
@ -423,7 +490,7 @@
} else {
//
this.adList = [{
pic: this.form.adImage.trim()
pic: adImage.trim()
}];
}
getShopData(this.searchForm).then((res) => {
@ -436,7 +503,7 @@
}
}
});
if (data.productList.length > 0) {
if (data.productList && data.productList.length > 0) {
this.form.productList1 = {
adId: data.id,
productImage: data.productList[0].productImage,

143
src/views/app/business/lineManage/lineManage.vue

@ -5,10 +5,15 @@
<template>
<div class="search">
<Card>
<Tabs v-model="activeTab" @on-click="changeAdTab">
<TabPane label="首页广告位" name="homeAd"></TabPane>
<TabPane label="首页弹窗" name="homePopup"></TabPane>
</Tabs>
<Row align="middle" justify="space-between" class="operation">
<div>
<Button @click="add" type="primary" icon="md-add">添加</Button>
<Button v-if="activeTab != 'homePopup' || data.length == 0" @click="add" type="primary" icon="md-add">
{{ activeTab == 'homePopup' ? '添加弹窗图片' : '添加' }}
</Button>
</div>
<div class="icons">
<Tooltip content="刷新" placement="top" transfer>
@ -32,7 +37,7 @@
</Tooltip>
</div>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize"
<Table :loading="loading" border :columns="activeTab == 'homePopup' ? popupColumns : columns" :data="data" :size="tableSize"
ref="table"></Table>
<Row type="flex" justify="end" class="page">
@ -44,7 +49,7 @@
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
<addEdit :data="form" :type="showType" :scene="activeTab" :home-center-ad-count="homeCenterAdCount" v-model="showCompany" @on-submit="getDataList" />
</div>
</template>
@ -66,6 +71,7 @@
data() {
return {
tableSize: "default",
activeTab: "homeAd",
message: "",
selectIndex: "",
currentRow: {},
@ -105,14 +111,10 @@
let re = ""
if (params.row.position == 'home_top') {
re = "首页顶部大广告位";
} else if (params.row.position == 'home_center_left_top') {
re = "首页中位左上";
} else if (params.row.position == 'home_center_left_bottom') {
re = "首页中位左下";
} else if (params.row.position == 'home_center_right_top') {
re = "首页中位右上";
} else if (params.row.position == 'home_center_right_bottom') {
re = "首页中位右下";
} else if (params.row.position == 'home_popup') {
re = "首页弹窗";
} else {
re = "首页广告位";
}
return h(
"div",
@ -234,7 +236,7 @@
width: 150,
render: (h, params) => {
let re = ""
if(params.row.productList != ''){
if(params.row.productList && params.row.productList.length > 0){
re = params.row.productList[0].productName
}
return h(
@ -279,7 +281,100 @@
},
},
],
popupColumns: [
{
type: "index",
width: 60,
align: "center",
fixed: "left",
},
{
title: "弹窗图片",
key: "adImage",
minWidth: 180,
render: (h, params) => {
const imageUrl = (params.row.adImage || '').split(',').filter(item => item.trim() !== '').map(url => url.trim())[0];
if (!imageUrl) {
return h('span', '无图片');
}
return h("img", {
attrs: {
src: imageUrl,
},
style: {
cursor: "zoom-in",
width: "120px",
height: "80px",
margin: "10px 0",
"object-fit": "contain",
"border-radius": "6px",
background: "#f5f5f5"
},
on: {
click: () => {
this.showPic(imageUrl);
},
},
});
},
},
{
title: "排序值",
key: "sortOrder",
width: 100,
},
{
title: "状态",
key: "status",
width: 100,
render: (h, params) => {
let re = ""
if (params.row.status == 0) {
re = "下架";
} else if (params.row.status == 1) {
re = "上架";
}
return h("div", re);
}
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", [
h(
"a", {
on: {
click: () => {
this.edit(params.row);
},
},
},
"编辑"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.del(params.row);
},
},
},
"删除"
),
]);
},
},
],
chooseColumns: [],
rawData: [],
data: [],
exportData: [],
total: 0,
@ -287,6 +382,11 @@
rechargeVisiable: false,
};
},
computed: {
homeCenterAdCount() {
return (this.rawData || []).filter(item => this.isHomeCenterAd(item)).length;
},
},
methods: {
init() {
this.getDataList();
@ -299,17 +399,31 @@
changeTableSize(v) {
this.tableSize = v;
},
changeAdTab() {
this.data = this.filterAdData(this.rawData);
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
filterAdData(list) {
const records = list || [];
if (this.activeTab == "homePopup") {
return records.filter(item => item.position == "home_popup");
}
return records.filter(item => item.position != "home_popup");
},
isHomeCenterAd(item) {
return item && item.position != "home_top" && item.position != "home_popup";
},
getDataList() {
// 线
this.loading = true;
getADList(this.searchForm).then((res) => {
this.loading = false;
if (res.code == 200) {
this.data = res.result.records;
this.rawData = res.result.records || [];
this.data = this.filterAdData(this.rawData);
}
});
},
@ -344,6 +458,7 @@
this.showCompany = true;
},
add() {
this.form = {};
this.showType = "2";
this.showCompany = true;
},

51
src/views/app/business/logistics/logistics.vue

@ -79,6 +79,7 @@
<TabPane label="配送时长设置" name="setting"></TabPane>
<TabPane label="客服设置" name="service"></TabPane>
<TabPane label="基础配送费" name="baseDeliveryFee"></TabPane>
<TabPane label="开启关闭配送" name="deliverySwitch"></TabPane>
</Tabs>
<div v-if="isOrderTab">
<Tabs v-if="tabName === 'hall'" v-model="hallTab" :animated="false" @on-click="changeHallTab">
@ -125,6 +126,22 @@
</FormItem>
</Form>
</div>
<div v-else-if="tabName === 'deliverySwitch'" style="padding: 20px 0;">
<Form ref="deliverySwitchForm" :model="deliverySwitchForm" :label-width="130" style="width: 520px;">
<FormItem label="是否开启配送">
<i-switch v-model="deliverySwitchForm.deliveryEnabled" size="large" :true-value="1" :false-value="0">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
<div style="color: #999; font-size: 12px; line-height: 22px; margin-top: 8px;">
关闭后用户在该校区外卖商家下单时只能选择到店消费
</div>
</FormItem>
<FormItem>
<Button type="primary" :loading="deliverySwitchLoading" @click="saveDeliverySwitch">保存</Button>
</FormItem>
</Form>
</div>
<Row v-if="isOrderTab" v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="activeSearchForm" inline :label-width="90">
<FormItem label="配送类型" v-if="tabName === 'delivery'">
@ -248,6 +265,8 @@
saveCustomerPhoneSetting,
getBaseDeliveryFeeSetting as getBaseDeliveryFeeSettingApi,
saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi,
getShopAreaDeliverySwitch,
saveShopAreaDeliverySwitch,
} from "@/api/index";
import addEdit from "./addEdit.vue";
import logisticsAddress from "@/views/app/business/logistics/logisticsAddress";
@ -288,6 +307,7 @@
settingLoading: false,
customerServiceLoading: false,
baseDeliveryFeeLoading: false,
deliverySwitchLoading: false,
transferOrder: false,
workerOrderVisible: false,
workerOrderTab: "daiqu",
@ -343,6 +363,10 @@
regionId: regionId,
baseDeliveryFee: 0
},
deliverySwitchForm: {
regionId: regionId,
deliveryEnabled: 1
},
workerOrderForm: {
pageNum: 1,
pageSize: 10
@ -414,6 +438,7 @@
this.getSetting();
this.getCustomerServiceSetting();
this.getBaseDeliveryFeeSetting();
this.getDeliverySwitch();
},
buildWorkerColumns() {
return [ {
@ -555,6 +580,10 @@
this.getBaseDeliveryFeeSetting();
return;
}
if (v === "deliverySwitch") {
this.getDeliverySwitch();
return;
}
this.total = 0;
this.data = [];
const form = v === "hall" ? this.hallSearchForm : this.deliverySearchForm;
@ -1005,6 +1034,28 @@
this.baseDeliveryFeeLoading = false;
});
},
getDeliverySwitch() {
getShopAreaDeliverySwitch({
regionId: this.deliverySwitchForm.regionId
}).then((res) => {
if (res.success) {
this.deliverySwitchForm.deliveryEnabled = res.result == null ? 1 : Number(res.result);
}
});
},
saveDeliverySwitch() {
this.deliverySwitchLoading = true;
saveShopAreaDeliverySwitch({
regionId: this.deliverySwitchForm.regionId,
deliveryEnabled: this.deliverySwitchForm.deliveryEnabled
}).then((res) => {
if (res.success) {
this.$Message.success("保存成功");
}
}).finally(() => {
this.deliverySwitchLoading = false;
});
},
goTransferOrder(item) {
if (!item || !item.workerId) {
this.$Message.warning("请选择配送员");

Loading…
Cancel
Save