diff --git a/admin/.env b/admin/.env index c6f2eea..42ff52a 100644 --- a/admin/.env +++ b/admin/.env @@ -1,2 +1,2 @@ -VUE_APP_NAME=Ele Admin +VUE_APP_NAME=后台管理 VUE_APP_API_BASE_URL=https://v2.eleadmin.com/api diff --git a/admin/src/components/CarSelector/index.vue b/admin/src/components/CarSelector/index.vue index 93e2143..154ffe8 100644 --- a/admin/src/components/CarSelector/index.vue +++ b/admin/src/components/CarSelector/index.vue @@ -63,7 +63,7 @@ export default { name: 'CarModelSelector', props: { - modelValue: { + value: { type: Object, default: () => ({ brandId: null, @@ -80,11 +80,7 @@ }, data() { return { - form: { - brandId: null, - seriesId: null, - modelId: null - }, + form: { ...this.value }, // 初始化时深拷贝value, brandList: [], seriesList: [], modelList: [], @@ -94,43 +90,22 @@ brandFilter: '' }; }, - watch: { - modelValue: { - deep: true, - handler(newVal) { - console.log(newVal); - this.form = { ...newVal }; - this.syncFormWithProps(); - } - }, - '$props.modelValue': { - handler() { - this.syncFormWithProps(); - } - }, - 'form.brandId'(val) { - this.emitValue(); - if (!val) { - this.seriesList = []; - this.modelList = []; - this.form.seriesId = null; - this.form.modelId = null; - } - }, - 'form.seriesId'(val) { - this.emitValue(); - if (!val) this.modelList = this.form.modelId = null; - }, - 'form.modelId': { - handler() { - this.emitValue(); - }, - immediate: true - } - }, created() { this.loadBrands(); - this.syncFormWithProps(); + if (this.form.brandId) { + this.loadSeriesList(this.form.brandId); + } + if (this.form.seriesId) { + this.loadModelList(this.form.seriesId); + } + }, + watch: { + value: { + deep: true, + handler(newVal) { + this.form = { ...newVal }; // 外部值变化时更新内部form + } + } }, methods: { async loadBrands(filter = '') { @@ -138,6 +113,8 @@ try { const res = await pageBrand({ nameLike: filter }); this.brandList = res; + this.seriesList = []; + this.modelList = []; } catch (error) { this.$message.error('品牌加载失败'); } finally { @@ -150,7 +127,7 @@ try { const res = await pageSeries({ brandId }); this.seriesList = res; - this.form.seriesId = null; + this.modelList = []; } catch (error) { this.$message.error('车系加载失败'); } finally { @@ -163,7 +140,6 @@ try { const res = await pageAutoCar({ seriesId }); this.modelList = res; - this.form.modelId = null; } catch (error) { this.$message.error('车型加载失败'); } finally { @@ -172,41 +148,46 @@ }, handleBrandChange(brandId) { - if (brandId) this.loadSeriesList(brandId); + if (brandId) { + this.form.seriesId = null; + this.loadSeriesList(brandId); + } + this.emitValue(); }, handleSeriesChange(seriesId) { - if (seriesId) this.loadModelList(seriesId); + if (seriesId) { + this.form.modelId = null; + this.loadModelList(seriesId); + } + this.emitValue(); + }, + handleModelChange() { + this.emitValue(); }, - handleModelChange() {}, handleBrandFilter(filter) { this.brandFilter = filter; this.loadBrands(filter); }, - emitValue() { - this.$emit('update:modelValue', { - brandId: this.form.brandId, - seriesId: this.form.seriesId, - modelId: this.form.modelId - }); + this.$emit('input', { ...this.form }); }, syncFormWithProps() { // 重置所有数据 - this.brandList = []; - this.seriesList = []; - this.modelList = []; - - const { brandId, seriesId, modelId } = this.modelValue; - this.form = { brandId, seriesId, modelId }; - - if (brandId) { - this.loadSeriesList(brandId); - if (seriesId) { - this.loadModelList(seriesId); - } - } + // this.brandList = []; + // this.seriesList = []; + // this.modelList = []; + // + // const { brandId, seriesId, modelId } = this.modelValue; + // this.form = { brandId, seriesId, modelId }; + // + // if (brandId) { + // this.loadSeriesList(brandId); + // if (seriesId) { + // this.loadModelList(seriesId); + // } + // } } } }; diff --git a/admin/src/views/car/product/components/edit.vue b/admin/src/views/car/product/components/edit.vue index 2f8ff03..23ed731 100644 --- a/admin/src/views/car/product/components/edit.vue +++ b/admin/src/views/car/product/components/edit.vue @@ -165,6 +165,29 @@ v-model="form.descript" /> + + + + + + 新增推广文案 + + 取消 @@ -301,6 +324,10 @@ /* 更新visible */ updateVisible(value) { this.$emit('update:visible', value); + }, + /* 添加海报描述 */ + addShareTitle() { + this.form.promotion_text.push(''); } }, watch: { @@ -313,6 +340,9 @@ ...this.data }); this.isUpdate = true; + if (this.form.promotion_text.length <= 0) { + this.addShareTitle(); + } } else { this.form.imgs = []; this.isUpdate = false; @@ -325,7 +355,7 @@ } }; - diff --git a/admin/src/views/home/analysis/components/hot-search.vue b/admin/src/views/home/analysis/components/hot-search.vue deleted file mode 100644 index adb9de6..0000000 --- a/admin/src/views/home/analysis/components/hot-search.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - diff --git a/admin/src/views/home/analysis/components/profile-card.vue b/admin/src/views/home/analysis/components/profile-card.vue new file mode 100644 index 0000000..8ef3d90 --- /dev/null +++ b/admin/src/views/home/analysis/components/profile-card.vue @@ -0,0 +1,119 @@ + + + + + + + + Hi, {{ loginUser.nickname }} , 您好! + + + + + + + + + + + diff --git a/admin/src/views/home/analysis/components/sale-card.vue b/admin/src/views/home/analysis/components/sale-card.vue deleted file mode 100644 index cd7f194..0000000 --- a/admin/src/views/home/analysis/components/sale-card.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - 今天 - 本周 - 本月 - 本年 - - - - - - - - - - - 销售额趋势 - 访问量趋势 - - - - - - 门店 - - 销售额 - 访问量 - - 排名 - - - - {{ index + 1 }} - - {{ item.name }} - {{ item.value }} - - - - - - - - - diff --git a/admin/src/views/home/analysis/components/statistics-card.vue b/admin/src/views/home/analysis/components/statistics-card.vue index b044354..7b216e0 100644 --- a/admin/src/views/home/analysis/components/statistics-card.vue +++ b/admin/src/views/home/analysis/components/statistics-card.vue @@ -5,99 +5,33 @@ - 总销售额 - - - - - - - ¥ 126,560 - - - 周同比12% - - - - 日同比11% - - - - - 日销售额 ¥12,423 - - - - - - - 访问量 + 今日新增线索 日 - 8,846 - - - + 101条 - 日访问量 1,234 + 累计线索:100000条 - 支付笔数 - 月 + 当前团队成员 - 6,560 - - - + 2323人 - 转化率 60% - - - - - - - 运营活动效果 - 周 - - - 78% - - - - - - - 周同比12% - - - - 日同比11% - - - + 历史成交:100000单 @@ -108,14 +42,13 @@ import { CanvasRenderer } from 'echarts/renderers'; import { LineChart, BarChart } from 'echarts/charts'; import { GridComponent, TooltipComponent } from 'echarts/components'; - import VChart from 'vue-echarts'; import { getPayNumList } from '@/api/dashboard/analysis'; import { echartsMixin } from '@/utils/echarts-mixin'; use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]); export default { - components: { VChart }, + components: {}, mixins: [echartsMixin(['visitChart', 'payNumChart'])], data() { return { diff --git a/admin/src/views/home/analysis/components/visit-hour.vue b/admin/src/views/home/analysis/components/visit-hour.vue deleted file mode 100644 index 9fd61df..0000000 --- a/admin/src/views/home/analysis/components/visit-hour.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - diff --git a/admin/src/views/home/analysis/index.vue b/admin/src/views/home/analysis/index.vue index a635250..1b63bcc 100644 --- a/admin/src/views/home/analysis/index.vue +++ b/admin/src/views/home/analysis/index.vue @@ -1,37 +1,33 @@ + - - - - - - - - - + + diff --git a/pingan/src/api/auto/index.js b/pingan/src/api/auto/index.js new file mode 100644 index 0000000..964d480 --- /dev/null +++ b/pingan/src/api/auto/index.js @@ -0,0 +1,22 @@ +import request from '@/utils/request'; + +export async function pageBrand(params) { + const res = await request.get('/common/autoBrand', { + params + }); + return res.data; +} + +export async function pageSeries(params) { + const res = await request.get('/common/autoSeries', { + params + }); + return res.data; +} + +export async function pageAutoCar(params) { + const res = await request.get('/common/autoCar', { + params + }); + return res.data; +} diff --git a/pingan/src/api/car/product/index.js b/pingan/src/api/car/product/index.js index 6c365dc..f13808e 100644 --- a/pingan/src/api/car/product/index.js +++ b/pingan/src/api/car/product/index.js @@ -60,3 +60,16 @@ export async function removeProduct(ids) { } return Promise.reject(new Error(res.data.message)); } + +/** + * @param id 产品id + */ +export async function getProduct(id) { + const res = await request.get('/car/product/', { + id: id + }); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/pingan/src/components/CarSelector/index.vue b/pingan/src/components/CarSelector/index.vue new file mode 100644 index 0000000..154ffe8 --- /dev/null +++ b/pingan/src/components/CarSelector/index.vue @@ -0,0 +1,196 @@ + + + + + + + + - + + + + + + - + + + + + + + + + + + diff --git a/pingan/src/i18n/lang/zh_CN/layout.js b/pingan/src/i18n/lang/zh_CN/layout.js index a1b5d3b..7ddd8f1 100644 --- a/pingan/src/i18n/lang/zh_CN/layout.js +++ b/pingan/src/i18n/lang/zh_CN/layout.js @@ -7,10 +7,10 @@ export default { logout: '退出登录' }, footer: { - website: '官网', - document: '文档', - authorization: '授权', - copyright: 'Copyright © 2022 武汉易云智科技有限公司' + website: '', + document: '', + authorization: '', + copyright: 'Copyright © 2022 好店云(厦门)科技有限公司' }, logout: { title: '提示', diff --git a/pingan/src/layout/components/header-tools.vue b/pingan/src/layout/components/header-tools.vue index 5a67a1b..7a66584 100644 --- a/pingan/src/layout/components/header-tools.vue +++ b/pingan/src/layout/components/header-tools.vue @@ -50,7 +50,9 @@ + diff --git a/pingan/src/views/car/product/detail.vue b/pingan/src/views/car/product/detail.vue new file mode 100644 index 0000000..a318e11 --- /dev/null +++ b/pingan/src/views/car/product/detail.vue @@ -0,0 +1,124 @@ + + + + + 概况 + + + 品牌 + 车型 + 官方售价 + + + + 优惠 + + + 置换补贴 + 报废补贴 + 优惠金额 + + + + 客户画像 + + + 男性占比 + 年龄区间 + 人群标签 + + + + 车型卖点 + + + 范围访问量附件为冷风机微辣 + + + 推广文案 + + + + + + + 复制 + + + + 购车链接 + + + + + + 复制 + + + + + + + + diff --git a/pingan/src/views/car/product/index.vue b/pingan/src/views/car/product/index.vue index 836fb80..411da7f 100644 --- a/pingan/src/views/car/product/index.vue +++ b/pingan/src/views/car/product/index.vue @@ -13,6 +13,13 @@ /> + + + - - - 新建 - - - 删除 - - + + + + + {{ row.title }} + + + + + L {{ row.firstLevelClues }} + S {{ row.firstLevelDeal }} + + + + {{ row.timeStart.split(' ')[0] }}~ + {{ row.timeEnd.split(' ')[0] }} + - + 已上架 + 未上架 - 修改 + 文案 - - - - 删除 - - - + 购车券 + 海报 + + + + + + + 复制 + + + + - - + diff --git a/pingan/src/views/home/analysis/components/hot-search.vue b/pingan/src/views/home/analysis/components/hot-search.vue deleted file mode 100644 index adb9de6..0000000 --- a/pingan/src/views/home/analysis/components/hot-search.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - diff --git a/pingan/src/views/home/analysis/components/profile-card.vue b/pingan/src/views/home/analysis/components/profile-card.vue new file mode 100644 index 0000000..8ef3d90 --- /dev/null +++ b/pingan/src/views/home/analysis/components/profile-card.vue @@ -0,0 +1,119 @@ + + + + + + + + Hi, {{ loginUser.nickname }} , 您好! + + + + + + + + + + + diff --git a/pingan/src/views/home/analysis/components/sale-card.vue b/pingan/src/views/home/analysis/components/sale-card.vue deleted file mode 100644 index cd7f194..0000000 --- a/pingan/src/views/home/analysis/components/sale-card.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - 今天 - 本周 - 本月 - 本年 - - - - - - - - - - - 销售额趋势 - 访问量趋势 - - - - - - 门店 - - 销售额 - 访问量 - - 排名 - - - - {{ index + 1 }} - - {{ item.name }} - {{ item.value }} - - - - - - - - - diff --git a/pingan/src/views/home/analysis/components/statistics-card.vue b/pingan/src/views/home/analysis/components/statistics-card.vue index b044354..7b216e0 100644 --- a/pingan/src/views/home/analysis/components/statistics-card.vue +++ b/pingan/src/views/home/analysis/components/statistics-card.vue @@ -5,99 +5,33 @@ - 总销售额 - - - - - - - ¥ 126,560 - - - 周同比12% - - - - 日同比11% - - - - - 日销售额 ¥12,423 - - - - - - - 访问量 + 今日新增线索 日 - 8,846 - - - + 101条 - 日访问量 1,234 + 累计线索:100000条 - 支付笔数 - 月 + 当前团队成员 - 6,560 - - - + 2323人 - 转化率 60% - - - - - - - 运营活动效果 - 周 - - - 78% - - - - - - - 周同比12% - - - - 日同比11% - - - + 历史成交:100000单 @@ -108,14 +42,13 @@ import { CanvasRenderer } from 'echarts/renderers'; import { LineChart, BarChart } from 'echarts/charts'; import { GridComponent, TooltipComponent } from 'echarts/components'; - import VChart from 'vue-echarts'; import { getPayNumList } from '@/api/dashboard/analysis'; import { echartsMixin } from '@/utils/echarts-mixin'; use([CanvasRenderer, LineChart, BarChart, GridComponent, TooltipComponent]); export default { - components: { VChart }, + components: {}, mixins: [echartsMixin(['visitChart', 'payNumChart'])], data() { return { diff --git a/pingan/src/views/home/analysis/components/visit-hour.vue b/pingan/src/views/home/analysis/components/visit-hour.vue deleted file mode 100644 index 9fd61df..0000000 --- a/pingan/src/views/home/analysis/components/visit-hour.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - diff --git a/pingan/src/views/home/analysis/index.vue b/pingan/src/views/home/analysis/index.vue index a635250..1b63bcc 100644 --- a/pingan/src/views/home/analysis/index.vue +++ b/pingan/src/views/home/analysis/index.vue @@ -1,37 +1,33 @@ + - - - - - - - - - + +