Authored by htoooth

add sell type

<template>
<Select :value="handleValue" @on-change="updateValue" clearable placeholder="请选择">
<Option :value="item.value" v-for="item in list" :key="item.value">{{item.label}}</Option>
</Select>
</template>
<script>
import {SellTypeService} from 'services/product';
export default {
name: 'select-sell-type',
props: {
value: {
type: String
}
},
data() {
return {
handleValue: this.value,
list: []
};
},
mounted() {
SellTypeService.getSellType('/platform/getSellType').then((result) => {
if (result.code === 200) {
this.list = result.data;
}
});
},
methods: {
updateValue(newValue) {
this.$emit('input', newValue);
}
},
watch: {
value(newValue) {
this.handleValue = newValue;
}
}
};
</script>
<style>
</style>
... ...
... ... @@ -4,6 +4,7 @@ import ColorService from './color-service';
import SizeService from './size-service';
import ProductCreateService from './product-create-service';
import ProductService from './product-service';
import SellTypeService from './sell-type-service';
export {
BrandService,
... ... @@ -11,5 +12,6 @@ export {
ProductService,
SortService,
ColorService,
SizeService
SizeService,
SellTypeService
};
... ...
/**
* Created by TaoHuang on 2017/6/12.
*/
import Service from '../service';
class SellTypeService extends Service {
getSellType() {
return this.get('/platform/getSellType', {
cache: true
});
}
}
export default SellTypeService;
\ No newline at end of file
... ...
... ... @@ -78,7 +78,8 @@ let domainApis = {
deleteCategoryLinkProduct: '/SellerShopController/deleteCategoryLinkProduct',
getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku',
importSeller: '/batch/importSeller',
downloadFile: '/exceltemplate/download/CreateProductForShops'
downloadFile: '/exceltemplate/download/CreateProductForShops',
getSellType: '/SellerProductController/getSellType'
},
shop: {
login: '/loginInter',
... ...