Commit 3d816809 authored by 徐光星's avatar 徐光星

Merge branch 'feat/v1.6' into 'master'

Feat/v1.6

See merge request !69
parents 629b91e0 6b0d44f2
...@@ -86,4 +86,21 @@ export default { ...@@ -86,4 +86,21 @@ export default {
}, },
}); });
}, },
getActivityList(params) {
return http.post(`${config.opapiHost}/kdspOp/api/kdsp/activity/activity-info/current-valid-activity`, params, {
accessToken: true
});
},
// 获取品牌列表
getBrandAndPriority(params) {
return http.post(`${config.opapiHost}/kdspOp/api/kdsp/op/operateIntervene/getBrandAndPriority`, params, {
accessToken: true
});
},
// 获取品类列表
getCategoryAndPriority(params) {
return http.post(`${config.opapiHost}/kdspOp/api/kdsp/op/operateIntervene/getCategoryAndPriority`, params, {
accessToken: true
});
},
}; };
\ No newline at end of file
...@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http'; ...@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
const hostMap = { const hostMap = {
apiHost: `http://localhost:7002/`, apiHost: `http://localhost:7002/`,
// apiHost: `http://192.168.28.199:7001/`, // apiHost: `http://192.168.28.199:7001/`,
// apiHost: 'https://quantum-blocks-qa.liangkebang.net/', // apiHost: 'https://quantum-blocks-test1.liangkebang.net/',
h5Host: 'https://quantum-h5-qa.liangkebang.net', h5Host: 'https://quantum-h5-test1.liangkebang.net',
qiniuHost: `https://appsync.lkbang.net`, qiniuHost: `https://appsync.lkbang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`, shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
opapiHost: `https://opapi-qa.liangkebang.net`, opapiHost: `https://opapi-test1.liangkebang.net`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`, qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
// kdspHost: 'https://kdsp-api-qa.liangkebang.net', // kdspHost: 'https://kdsp-api-test1.liangkebang.net',
talosHost: 'https://talos-qa.liangkebang.net', talosHost: 'https://talos-test1.liangkebang.net',
kdspHost: 'https://kdsp-api-qa.liangkebang.net', kdspHost: 'https://kdsp-api-test1.liangkebang.net',
yxmTenantId: 560761, yxmTenantId: 560761,
appIdMap: { appIdMap: {
560761: 'wxe16bf9293671506c', 560761: 'wxe16bf9293671506c',
......
<template>
<div class="VerticalAdGoodsSelectorContainer">
<Input
v-model="data.ids"
type="textarea"
:autosize="{minRows: 3,maxRows: 10}"
placeholder="请输入skuNo,每个skuNo使用英文逗号隔开"
@on-blur="changeIds"
/>
<div class="goodsItem" v-for="(item, index) in data.data" :key="index">
<div class="title">
商品{{index + 1}}
</div>
<Form @submit.native.prevent ref="formCustom" :model="item" :label-width="90" label-position="left">
<FormItem label="sku_no" prop="skuNo">
<Input v-model="item.skuNo" disabled />
</FormItem>
<FormItem label="商品名称" prop="goodsName">
<Input v-model="item.goodsName" />
</FormItem>
<FormItem label="商品主图" prop="img">
<Upload v-model="item.img"></Upload>
</FormItem>
<FormItem label="商品横幅文案" prop="subtitle">
<Input v-model="item.subtitle" />
</FormItem>
</Form>
<Button type="error" long @click="del(index, item.skuNo)" class="deleteGood">删除</Button>
</div>
</div>
</template>
<script>
import operationApi from '@api/operation.api';
import Upload from '@editor/component/DynamicForm/component/Upload/index.vue';
export default {
props: {
value: {
type: Object,
default: () => {}
}
},
watch: {
value: {
handler(val) {
this.data = val;
}
},
data: {
deep: true,
handler(val) {
this.$emit('input', val);
}
}
},
components: {
Upload
},
data() {
return {
data: {}
}
},
created() {
this.data = JSON.parse(JSON.stringify(this.value));
},
methods: {
init() {
const data = this.value;
if (!data.ids) data.ids = '';
if (!data.data) data.data = [];
this.data = data;
},
async getGoods(params) {
let prevDataArr = this.data && this.data.data ? JSON.parse(JSON.stringify(this.data.data)) : [];
let skuToInfoMaps = {};
for (let i = 0; i < prevDataArr.length; i++) {
skuToInfoMaps[prevDataArr[i].skuNo] = prevDataArr[i];
}
const res = await operationApi.getGoods(params);
try {
let goodsList = res.skus || [];
let arr = [];
if (goodsList.length) {
for (let i = 0; i < goodsList.length; i++) {
let item = {};
item.goodsName = goodsList[i].skuName;
item.salePrice = goodsList[i].salePrice;
item.skuNo = goodsList[i].skuNo;
item.img = goodsList[i].skuUrl;
item.subtitle = '';
item.status = goodsList[i].status;
if (skuToInfoMaps[goodsList[i].skuNo]) {
item = Object.assign({}, skuToInfoMaps[goodsList[i].skuNo])
};
arr.push(item);
}
this.$set(this.data, 'data', arr);
} else {
this.$set(this.data, 'data', []);
}
} catch (err) {
console.log(err);
this.$set(this.data, 'data', []);
}
// setTimeout(() => {
// this.$emit('adjust')
// }, 1000)
},
changeIds() {
const ids = this.data && this.data.ids ? this.data.ids.trim() : '';
this.data.ids = ids;
const skus = ids ? ids.split(',') : [];
if (skus.length) {
if (skus.length > 15) {
this.$toast('最多填入15个商品');
return;
}
this.getGoods({
skus: Array.from(new Set(skus))
});
} else {
this.$set(this.data, 'data', []);
}
},
del(index, skuNo) {
this.data.data.splice(index, 1)
const ids = this.data.ids ? this.data.ids.split(',') : [];
const idx = ids.indexOf(skuNo);
if (idx > -1 && ids.length) ids.splice(idx, 1);
this.data.ids = ids.join();
if (this.data.data.length == 0) this.data.ids = '';
}
}
}
</script>
<style scoped lang="less">
.goodsItem{
border: 1px solid #dddee1;
border-radius: 4px;
margin-top: 10px;
padding: 5px;
.title{
width: 100%;
height: 30px;
font-weight: bold;
}
}
</style>
<template>
<div class="categorySelectorContainer">
<!-- <Button type="primary" @click="save">保存</Button> -->
<div class="item" v-for="(item, index) in categoryData" :key="index">
<Form ref="formInline" :model="item" inline>
<FormItem label="素材名称" prop="name">
<Input v-model="item.name" placeholder="" />
</FormItem>
<FormItem label="素材图片" prop="img">
<Upload v-model="item.img"></Upload>
</FormItem>
<FormItem label="利益点" prop="text">
<Input v-model="item.text" placeholder="" />
</FormItem>
<FormItem label="logo图" prop="logoUrl">
<Upload v-model="item.logoUrl"></Upload>
</FormItem>
<FormItem label="跳转链接" prop="link">
<Input v-model="item.link" placeholder="" />
</FormItem>
</Form>
<Button long type="error" @click="del(index)">删除</Button>
</div>
<Button type="ghost" @click="add">添加项目</Button>
<Modal v-model="showModal" :mask-closable="false" title="选择品类/品牌" width="700">
<Tabs :value="type" @on-click="selectType">
<TabPane label="品类" name="1">
<div class="search">
<Form class="searchFormStyle" inline>
<FormItem label="类目名称" prop="name">
<Input v-model="searchParams.name" placeholder="" />
</FormItem>
<FormItem label="类目编码" prop="name">
<Input v-model="searchParams.sceneId" placeholder="" />
</FormItem>
<Button type="primary" @click="search">查询</Button>
</Form>
</div>
<Table
:columns="tableColumn"
:data="tableData"
class="tableStyle"
:loading="loading"
/>
<Page class="page" :total="total" @on-change="changePageNo" show-total></Page>
</TabPane>
<TabPane label="品牌" name="2">
<div class="search">
<Form class="searchFormStyle" inline>
<FormItem label="品牌名称" prop="name">
<Input v-model="searchParams.name" placeholder="" />
</FormItem>
<FormItem label="品牌编码" prop="name">
<Input v-model="searchParams.sceneId" placeholder="" />
</FormItem>
<Button type="primary" @click="search">查询</Button>
</Form>
</div>
<Table
:columns="tableColumn"
:data="tableData"
class="tableStyle"
:loading="loading"
/>
<Page class="page" :total="total" @on-change="changePageNo" show-total></Page>
</TabPane>
</Tabs>
<div slot="footer" />
</Modal>
</div>
</template>
<script>
import Upload from '@editor/component/DynamicForm/component/Upload/index.vue';
import operationApi from '@api/operation.api';
// const validOptions = {
// pageName: [
// { required: true, message: '请输入页面名称', trigger: 'blur' }
// ],
// shareOpenMethod: [
// { validator: this.validateOpenMethod, trigger: 'blur' }
// ],
// };
const categoryCol = function() {
return [
{
align: 'center',
title: '类目名称',
key: 'categoryName',
},
{
align: 'center',
title: '类目编码',
key: 'sceneId',
width: 120
},
{
align: 'center',
title: '类目级别',
key: 'categoryLevel',
width: 120
},
{
align: 'center',
title: '图片',
render: (h, params) => {
const row = params.row;
return h('div', {
style: {
padding: '5px 0'
}
}, [
h('img', {
attrs: {
src: row.imgUrl,
width: 80,
height: 80
},
})
]
)
},
width: 120
},
{
align: 'center',
title: '操作',
width: 120,
render: (h, params) => {
const row = params.row;
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
this.select(row);
}
}
}, '选择')
]
)
}
},
]
}
const brandCol = function() {
return [
{
align: 'center',
title: '品牌名称',
key: 'brandName',
},
{
align: 'center',
title: '品牌编码',
key: 'sceneId',
width: 120
},
{
align: 'center',
title: 'logo',
render: (h, params) => {
const row = params.row;
return h('div', {
style: {
padding: '5px 0'
}
}, [
h('img', {
attrs: {
src: row.imgUrl,
width: 80,
height: 80
},
})
]
)
},
width: 300
},
{
align: 'center',
title: '操作',
width: 120,
render: (h, params) => {
const row = params.row;
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
this.select(row);
}
}
}, '选择')
]
)
}
}
]
}
export default {
components: {
Upload
},
props: {
value: {
type: Array,
default: () => []
}
},
watch: {
value(val) {
this.categoryData = val;
},
categoryData: {
handler(val) {
this.$emit('input', val);
},
deep: true
}
},
methods: {
search() {
this.searchParams.pageNo = 1;
this.searchParams.pageSize = 10;
this.getData();
},
add() {
this.showModal = true;
this.getData();
},
del(index) {
this.categoryData.splice(index, 1)
},
changePageNo(val) {
this.searchParams.pageNo = val;
this.getData();
},
selectType(val) {
this.type = val;
let searchParams = {};
searchParams.pageSize = 10;
searchParams.pageNo = 1;
searchParams.name = '';
searchParams.sceneId = '';
this.searchParams = searchParams;
this.getData();
},
async getData() {
let res;
this.loading = true;
this.tableData = [];
this.tableColumn = this.type == 1 ? categoryCol.bind(this)() : brandCol.bind(this)();
try {
if (this.type == 1) {
// 品类
res = await operationApi.getCategoryAndPriority(this.searchParams);
} else {
// 品牌
res = await operationApi.getBrandAndPriority(this.searchParams);
}
this.$nextTick(() => {
this.loading = false
this.total = res.total || 0;
this.tableData = res.records || [];
})
} catch (e) {
this.loading = false;
}
},
select(data) {
this.categoryData.push({
name: data.categoryName || data.brandName || '',
img: data.imgUrl || '',
text: '',
logoUrl: '',
link: ''
})
this.showModal = false;
this.type = '1';
this.searchParams = {
pageSize: 10,
pageNo: 1,
name: '',
sceneId: ''
}
}
},
data() {
return {
showModal: false,
categoryData: [],
type: '1',
tableData: [],
tableColumn: [],
total: 0,
searchParams: {
pageSize: 10,
pageNo: 1,
name: '',
sceneId: ''
},
loading: false
}
},
created() {
this.categoryData = JSON.parse(JSON.stringify(this.value));
}
}
</script>
<style scoped lang="less">
.item{
border: 1px solid #dddee1;
border-radius: 4px;
margin-bottom: 10px;
padding: 5px;
}
.page{
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
.categorySelectorContainer{
/deep/ .ivu-form-item{
margin-bottom: 10px;
}
/deep/ .ivu-form-item-label{
width: 80px !important;
}
}
.inline {
display: inline-block;
}
.searchFormStyle {
text-align: left;
clear: both;
background-color: #fff;
padding: 4px;
min-height: 70px;
font-size: 0;
display: flex;
align-items: center;
.btnGroupStyle{
button{
margin-right: 6px;
}
}
/deep/ .ivu-form-item{
margin-bottom: 0;
}
/deep/ .ivu-form-item-label {
font-weight: bold;
display: inline-block;
}
/deep/.ivu-form-item-content {
display: inline-block;
}
}
</style>
<template>
<div class="snapUpActivityContainer">
<span class="option" @click="select(item.id)" v-for="(item, index) in options" :key="index" :class="{selected: item.id == selected}">
{{item.label}}
</span>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: "1"
}
},
watch: {
selected(val) {
this.$emit('input', val);
}
},
methods: {
select(id) {
this.selected = id;
}
},
data() {
return {
options: [
{id: '1', label: '基础款'},
{id: '2', label: '无logo'},
{id: '3', label: '无利益点'},
],
selected: 0
}
},
created() {
this.selected = this.value;
}
}
</script>
<style scoped lang="less">
.option{
cursor: pointer;
border-radius: 4px;
line-height:normal;
display: inline-block;
padding: 3px 5px;
border: 1px solid #dddee1;
margin: 0 2px;
user-select: none;
&.selected, &:hover{
border-color: #57a3f3;
box-shadow: 0px 0px 0px 2px rgb(45 140 240 / 20%)
}
}
</style>
<template>
<div class="VerticalAdGoodsSelectorContainer">
<Input
v-model="data.ids"
type="textarea"
:autosize="{minRows: 3,maxRows: 10}"
placeholder="请输入skuNo,每个skuNo使用英文逗号隔开"
@on-blur="changeIds"
/>
<div class="goodsItem" v-for="(item, index) in data.data" :key="index">
<div class="title">
商品{{index + 1}}
</div>
<Form @submit.native.prevent ref="formCustom" :model="item" :label-width="90" label-position="left">
<FormItem label="sku_no" prop="skuNo">
<Input v-model="item.skuNo" disabled />
</FormItem>
<FormItem label="商品名称" prop="goodsName">
<Input v-model="item.goodsName" />
</FormItem>
<FormItem label="商品主图" prop="img">
<Upload v-model="item.img"></Upload>
</FormItem>
<FormItem label="横幅文案" prop="subtitle">
<Input v-model="item.subtitle" />
</FormItem>
<FormItem label="标签文案" prop="tag">
<Input v-model="item.tag" />
</FormItem>
<FormItem label="标签文案颜色" prop="tagColor">
<ColorSelector v-model="item.tagColor" />
</FormItem>
<FormItem label="标签背景图" prop="tagBgImg">
<Upload v-model="item.tagBgImg"></Upload>
</FormItem>
</Form>
<Button type="error" long @click="del(index, item.skuNo)" class="deleteGood">删除</Button>
</div>
</div>
</template>
<script>
import operationApi from '@api/operation.api';
import ColorSelector from '@editor/component/DynamicForm/component/ColorSelector/index.vue';
import Upload from '@editor/component/DynamicForm/component/Upload/index.vue';
export default {
inject: ['editor'],
props: {
value: {
type: Object,
default: () => {}
}
},
watch: {
value: {
handler(val) {
this.data = val;
// this.$nextTick(() =>this.editor.adjustHeight());
}
},
data: {
deep: true,
handler(val) {
this.$emit('input', val);
}
}
},
components: {
Upload,
ColorSelector
},
data() {
return {
data: {}
}
},
created() {
this.data = JSON.parse(JSON.stringify(this.value));
},
methods: {
init() {
const data = this.value;
if (!data.ids) data.ids = '';
if (!data.data) data.data = [];
this.data = data;
},
async getGoods(params) {
let prevDataArr = this.data && this.data.data ? JSON.parse(JSON.stringify(this.data.data)) : [];
let skuToInfoMaps = {};
for (let i = 0; i < prevDataArr.length; i++) {
skuToInfoMaps[prevDataArr[i].skuNo] = prevDataArr[i];
}
const res = await operationApi.getGoods(params);
try {
let goodsList = res.skus || [];
let arr = [];
if (goodsList.length) {
for (let i = 0; i < goodsList.length; i++) {
let item = {};
item.goodsName = goodsList[i].skuName;
item.salePrice = goodsList[i].salePrice;
item.skuNo = goodsList[i].skuNo;
item.img = goodsList[i].skuUrl;
item.subtitle = '';
item.tag = '';
item.tagColor = '';
item.tagBgImg = '';
item.status = goodsList[i].status;
if (skuToInfoMaps[goodsList[i].skuNo]) {
item = Object.assign({}, skuToInfoMaps[goodsList[i].skuNo])
};
arr.push(item);
}
this.$set(this.data, 'data', arr);
} else {
this.$set(this.data, 'data', []);
}
} catch (err) {
console.log(err);
this.$set(this.data, 'data', []);
}
// setTimeout(() => {
// this.$emit('adjust')
// }, 1000)
},
changeIds() {
const ids = this.data && this.data.ids ? this.data.ids.trim() : '';
this.data.ids = ids;
const skus = ids ? ids.split(',') : [];
if (skus.length) {
if (skus.length > 15) {
this.$toast('最多填入15个商品');
return;
}
this.getGoods({
skus: Array.from(new Set(skus))
});
} else {
this.$set(this.data, 'data', []);
}
},
del(index, skuNo) {
this.data.data.splice(index, 1)
const ids = this.data.ids ? this.data.ids.split(',') : [];
const idx = ids.indexOf(skuNo);
if (idx > -1 && ids.length) ids.splice(idx, 1);
this.data.ids = ids.join();
if (this.data.data.length == 0) this.data.ids = '';
}
}
}
</script>
<style scoped lang="less">
.goodsItem{
border: 1px solid #dddee1;
border-radius: 4px;
margin-top: 10px;
padding: 5px;
/deep/ .ivu-form-item{
margin-bottom: 10px;
}
.title{
width: 100%;
height: 30px;
font-weight: bold;
}
}
</style>
<template> <template>
<Input v-model="text" :number="true"></Input> <Input v-model="text" :number="true" />
</template> </template>
<script> <script>
export default { export default {
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
} }
}, },
watch: { watch: {
value(val) {
this.text = val;
},
text(val) { text(val) {
this.$emit('input', val); this.$emit('input', val);
} }
......
<template>
<div class="snapUpActivityContainer">
<Select v-model="activityInfoId" filterable>
<Option v-for="item in list" :value="item.id" :key="item.id">{{ `id ${item.id} - ${item.title}` }}</Option>
</Select>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
import operationApi from '@api/operation.api';
export default {
props: {
value: {
type: String,
default: ''
}
},
watch: {
activityInfoId(val) {
this.$emit('input', val);
}
},
components: {
},
data() {
return {
list: [],
activityInfoId: ''
}
},
created() {
this.activityInfoId = this.value;
this.getActivityList();
console.log(this.value)
},
methods: {
async getActivityList() {
const res = await operationApi.getActivityList({
templateType: 11
});
for (let i = 0; i < res.length; i++) {
res[i].id = res[i].id.toString();
}
this.list = res;
}
}
}
</script>
<style scoped lang="less">
</style>
<template>
<div class="VerticalAdStyleSelectorContainer">
<span class="options" v-for="(item, index) in list" :class="{selected: item.id == styleType}" :key="index" @click="changeSelect(item.id)">{{item.title}}</span>
</div>
</template>
<script>
export default {
props: {
value: {
type: String,
default: '1'
}
},
watch: {
value(val) {
this.styleType = val;
},
styleType(val) {
this.$emit('input', val);
}
},
components: {
},
data() {
return {
list: [
{
id: '1',
title: '一行一组'
},
{
id: '2',
title: '两行一组'
}
],
styleType: ''
}
},
created() {
this.styleType = this.value;
},
methods: {
changeSelect(id) {
if (id == this.styleType) return;
this.styleType = id;
}
}
}
</script>
<style scoped lang="less">
.options{
cursor: pointer;
border-radius: 4px;
line-height:normal;
display: inline-block;
padding: 3px 5px;
border: 1px solid #dddee1;
margin: 0 2px;
user-select: none;
&.selected, &:hover{
border-color: #57a3f3;
box-shadow: 0px 0px 0px 2px rgb(45 140 240 / 20%)
}
}
</style>
...@@ -6,6 +6,12 @@ import DynamicFormMixin from './component/mixins/dynamicForm.mixin'; ...@@ -6,6 +6,12 @@ import DynamicFormMixin from './component/mixins/dynamicForm.mixin';
import Upload from './component/Upload/index.vue'; import Upload from './component/Upload/index.vue';
import ColorSelector from './component/ColorSelector/index.vue'; import ColorSelector from './component/ColorSelector/index.vue';
import DiscountGoodsSelector from './component/DiscountGoodsSelector/index.vue'; import DiscountGoodsSelector from './component/DiscountGoodsSelector/index.vue';
import SnapUpActivitySelector from './component/SnapUpActivitySelector/index.vue';
import VerticalAdStyleSelector from './component/VerticalAdStyleSelector/index.vue';
import CategoryTypeSelector from './component/CategoryTypeSelector/index.vue';
import CategorySelector from './component/CategorySelector/index.vue';
import BatchGoodsSelector from './component/BatchGoodsSelector/index.vue';
import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue';
import BaseSelect from './component/BaseSelect/index.vue'; import BaseSelect from './component/BaseSelect/index.vue';
import ComponentSelect from './component/ComponentSelect/index.vue'; import ComponentSelect from './component/ComponentSelect/index.vue';
import FormList from './component/FormList/index.vue'; import FormList from './component/FormList/index.vue';
...@@ -19,7 +25,25 @@ import { getAllScheme } from '../../../store/modules/editor/scheme'; ...@@ -19,7 +25,25 @@ import { getAllScheme } from '../../../store/modules/editor/scheme';
import EventBus from '@service/eventBus.service'; import EventBus from '@service/eventBus.service';
const allComponentsMap = getAllScheme(); const allComponentsMap = getAllScheme();
@Component({ components: { Upload, ColorSelector, BaseSelect, FormList, Textarea, Number, ComponentSelect, GoodsTableModal, CouponTableModal, ColumnSelector, DiscountGoodsSelector }, name: 'DynamicForm' }) @Component({ components: {
Upload,
ColorSelector,
BaseSelect,
FormList,
Textarea,
Number,
ComponentSelect,
GoodsTableModal,
CouponTableModal,
ColumnSelector,
DiscountGoodsSelector,
SnapUpActivitySelector,
CategoryTypeSelector,
CategorySelector,
VerticalAdStyleSelector,
BatchGoodsSelector,
DiscountGoodsSelectorV2
}, name: 'DynamicForm' })
export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) { export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) {
@State(state => state.editor.curEleIndex) curEleIndex; @State(state => state.editor.curEleIndex) curEleIndex;
@State(state => state.editor.curChildIndex) curChildIndex; @State(state => state.editor.curChildIndex) curChildIndex;
......
...@@ -58,6 +58,7 @@ export default class AutoSaveMixin extends Vue { ...@@ -58,6 +58,7 @@ export default class AutoSaveMixin extends Vue {
const record = localStorage.get(`${this.account}-${this.pageId}`); const record = localStorage.get(`${this.account}-${this.pageId}`);
this.setPageInfo(record); this.setPageInfo(record);
this.hasCompared = true; this.hasCompared = true;
localStorage.remove(`${this.account}-${this.pageId}`);
} }
cancel() { cancel() {
......
...@@ -13,6 +13,9 @@ export default class GoodsTabsMixin extends Vue { ...@@ -13,6 +13,9 @@ export default class GoodsTabsMixin extends Vue {
get hasFloorNavCom() { get hasFloorNavCom() {
return this.pageData.elements.some(item => item.name === 'cs-floor-nav'); return this.pageData.elements.some(item => item.name === 'cs-floor-nav');
} }
get hasSnapUpCom() {
return this.pageData.elements.some(item => item.name === 'cs-snap-up');
}
get hasGoodsNavCom() { get hasGoodsNavCom() {
return this.pageData.elements.some(item => item.name === 'cs-goods-tabs'); return this.pageData.elements.some(item => item.name === 'cs-goods-tabs');
} }
......
...@@ -249,6 +249,14 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin, ...@@ -249,6 +249,14 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
}); });
} }
} }
if (el.data.name === 'cs-snap-up') {
if (this.hasSnapUpCom) {
this.$Notice.warning({
title: '抢购组件目前只支持添加一个'
});
return;
}
}
// 添加多个goods-tabs会取消锚点滚动 // 添加多个goods-tabs会取消锚点滚动
if (el.data.name === 'cs-goods-tabs') { if (el.data.name === 'cs-goods-tabs') {
if (this.hasGoodsNavCom) { if (this.hasGoodsNavCom) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1", "test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop", "stop": "egg-scripts stop",
"backend": "nohup egg-scripts start --port 7001 --workers 4", "backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=qa npm run apollo && egg-bin dev -r egg-ts-helper/register --port 7002", "dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=test1 npm run apollo && egg-bin dev -r egg-ts-helper/register --port 7002",
"debug": "egg-bin debug -r egg-ts-helper/register", "debug": "egg-bin debug -r egg-ts-helper/register",
"apollo": "node bin/apollo.js", "apollo": "node bin/apollo.js",
"build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool", "build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool",
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"@hubcarl/json-typescript-mapper": "^2.0.0", "@hubcarl/json-typescript-mapper": "^2.0.0",
"@qg/apollo-nodejs": "^2.1.2", "@qg/apollo-nodejs": "^2.1.2",
"@qg/cherry-ui": "2.23.10", "@qg/cherry-ui": "2.23.10",
"@qg/citrus-ui": "0.3.39", "@qg/citrus-ui": "0.3.42",
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"@types/lodash": "^4.14.117", "@types/lodash": "^4.14.117",
"@types/node": "^10.12.0", "@types/node": "^10.12.0",
......
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