Authored by htoooth

fix format

@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 import api from '../api'; 5 import api from '../api';
6 6
7 -function getProduct (skn) { 7 +function getProduct(skn) {
8 return api.getProductAllInfo(skn).then((result) => { 8 return api.getProductAllInfo(skn).then((result) => {
9 return result.data; 9 return result.data;
10 }); 10 });
@@ -239,8 +239,8 @@ export default { @@ -239,8 +239,8 @@ export default {
239 this.submit().then((result) => { 239 this.submit().then((result) => {
240 this.$Loading.finish(); 240 this.$Loading.finish();
241 241
242 - if (result.code === 200) {  
243 - this.$Notice.success({title : '保存成功'}); 242 + if (result.code === 200) {
  243 + this.$Notice.success({title: '保存成功'});
244 this.$router.push({name: 'product.offsale'}); 244 this.$router.push({name: 'product.offsale'});
245 } else { 245 } else {
246 this.$Notice.error({ 246 this.$Notice.error({
@@ -333,7 +333,7 @@ import MuliSelect from './views/muli-select'; @@ -333,7 +333,7 @@ import MuliSelect from './views/muli-select';
333 import Age from './views/age'; 333 import Age from './views/age';
334 import Season from './views/season'; 334 import Season from './views/season';
335 import Gender from './views/gender'; 335 import Gender from './views/gender';
336 -import GoodsSeason from './views/goods-season' 336 +import GoodsSeason from './views/goods-season';
337 337
338 import service from './service'; 338 import service from './service';
339 import api from './api'; 339 import api from './api';
@@ -590,8 +590,9 @@ export default { @@ -590,8 +590,9 @@ export default {
590 590
591 one.forEach((s) => { 591 one.forEach((s) => {
592 let i = _.find(this.render.attributeProValuesOne, {attributeId: s.attributeId}); 592 let i = _.find(this.render.attributeProValuesOne, {attributeId: s.attributeId});
  593 +
593 if (i) { 594 if (i) {
594 - i.model = s.attributeValueIds.map(s => `${s}`); 595 + i.model = s.attributeValueIds.map(id => `${id}`);
595 } 596 }
596 }); 597 });
597 598
@@ -599,7 +600,7 @@ export default { @@ -599,7 +600,7 @@ export default {
599 let i = _.find(this.render.attributeProValuesTwo, {attributeId: s.attributeId}); 600 let i = _.find(this.render.attributeProValuesTwo, {attributeId: s.attributeId});
600 601
601 if (i) { 602 if (i) {
602 - i.model = s.attributeValueIds.map(s => `${s}`); 603 + i.model = s.attributeValueIds.map(id => `${id}`);
603 } 604 }
604 }); 605 });
605 }); 606 });
@@ -612,7 +613,7 @@ export default { @@ -612,7 +613,7 @@ export default {
612 this.initAttr(); 613 this.initAttr();
613 }, 614 },
614 getDefaultSelectedColor: function() { 615 getDefaultSelectedColor: function() {
615 - this.product.sellerGoodList.forEach((g) => { 616 + this.product.sellerGoodList.forEach((g) => {
616 let defaultColor = _.find(this.colors, (c) => c.id === g.colorId); 617 let defaultColor = _.find(this.colors, (c) => c.id === g.colorId);
617 618
618 if (defaultColor) { 619 if (defaultColor) {
@@ -740,7 +741,7 @@ export default { @@ -740,7 +741,7 @@ export default {
740 desc: '该商品保存成功!' 741 desc: '该商品保存成功!'
741 }); 742 });
742 743
743 - this.$router.push({name: 'product.offsale'}) 744 + this.$router.push({name: 'product.offsale'});
744 } else { 745 } else {
745 this.$Notice.error({ 746 this.$Notice.error({
746 title: '保存错误', 747 title: '保存错误',
@@ -792,6 +793,7 @@ export default { @@ -792,6 +793,7 @@ export default {
792 let sizeId = s.id; 793 let sizeId = s.id;
793 let productSku = s.productSku; 794 let productSku = s.productSku;
794 let factoryCode = color.sizeCode[i].name; 795 let factoryCode = color.sizeCode[i].name;
  796 +
795 return {sizeId, factoryCode, productSku}; 797 return {sizeId, factoryCode, productSku};
796 }); 798 });
797 }, 799 },
@@ -883,7 +885,7 @@ export default { @@ -883,7 +885,7 @@ export default {
883 }, 885 },
884 removeColorData: function(color) { 886 removeColorData: function(color) {
885 let index = this.table.data.findIndex((d) => { 887 let index = this.table.data.findIndex((d) => {
886 - return d.colorId === color.id; 888 + return d.colorId === color.id;
887 }); 889 });
888 890
889 this.table.data.splice(index, 1); 891 this.table.data.splice(index, 1);
@@ -8,4 +8,4 @@ export default { @@ -8,4 +8,4 @@ export default {
8 path: '/edit/:id', 8 path: '/edit/:id',
9 name: 'edit', 9 name: 'edit',
10 component: editProduct 10 component: editProduct
11 -};  
  11 +};
@@ -69,9 +69,9 @@ const handleGoods = (goods) => { @@ -69,9 +69,9 @@ const handleGoods = (goods) => {
69 }; 69 };
70 70
71 const handleGoodsImage = (goodsColorInfo) => { 71 const handleGoodsImage = (goodsColorInfo) => {
72 - let image0 = {genderCover: 0, isDefault: 'Y'}; // 0商品正面图  
73 - let image3 = {genderCover: 1, isDefault: 'N'}; // 3男生频道封面图  
74 - let image4 = {genderCover: 2, isDefault: 'N'}; // 4女生频道封面图 72 + let image0 = {genderCover: 0, isDefault: 'Y'}; // 0商品正面图
  73 + let image3 = {genderCover: 1, isDefault: 'N'}; // 3男生频道封面图
  74 + let image4 = {genderCover: 2, isDefault: 'N'}; // 4女生频道封面图
75 75
76 let newGoods = handleGoods(goodsColorInfo); 76 let newGoods = handleGoods(goodsColorInfo);
77 77
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 import api from '../api'; 5 import api from '../api';
6 6
7 -function getProduct (skn) { 7 +function getProduct(skn) {
8 return api.getProductAllInfo(skn).then((result) => { 8 return api.getProductAllInfo(skn).then((result) => {
9 return result.data; 9 return result.data;
10 }); 10 });
@@ -23,13 +23,15 @@ export default { @@ -23,13 +23,15 @@ export default {
23 props: ['value'], 23 props: ['value'],
24 data() { 24 data() {
25 let _this = this; 25 let _this = this;
  26 +
26 return { 27 return {
27 handleValue: _this.value.split('|') 28 handleValue: _this.value.split('|')
28 - } 29 + };
29 }, 30 },
30 methods: { 31 methods: {
31 updateValue(newValue) { 32 updateValue(newValue) {
32 let nValue = newValue.join('|'); 33 let nValue = newValue.join('|');
  34 +
33 this.$emit('input', nValue); 35 this.$emit('input', nValue);
34 } 36 }
35 }, 37 },
@@ -38,10 +40,10 @@ export default { @@ -38,10 +40,10 @@ export default {
38 this.handleValue = newValue.split('|'); 40 this.handleValue = newValue.split('|');
39 } 41 }
40 } 42 }
  43 +};
41 44
42 -}  
43 </script> 45 </script>
44 46
45 <style> 47 <style>
46 48
47 -</style>  
  49 +</style>
@@ -13,29 +13,31 @@ @@ -13,29 +13,31 @@
13 </template> 13 </template>
14 14
15 <script> 15 <script>
16 - export default {  
17 - props: ['value'],  
18 - data() {  
19 - let _this = this;  
20 - return {  
21 - handleValue: _this.value  
22 - }  
23 - },  
24 - methods: {  
25 - updateValue(newValue) {  
26 - let nValue = newValue;  
27 - this.$emit('input', nValue);  
28 - }  
29 - },  
30 - watch: {  
31 - value(newValue) {  
32 - this.handleValue = newValue;  
33 - }  
34 - } 16 +export default {
  17 + props: ['value'],
  18 + data() {
  19 + let _this = this;
  20 +
  21 + return {
  22 + handleValue: _this.value
  23 + };
  24 + },
  25 + methods: {
  26 + updateValue(newValue) {
  27 + let nValue = newValue;
35 28
  29 + this.$emit('input', nValue);
  30 + }
  31 + },
  32 + watch: {
  33 + value(newValue) {
  34 + this.handleValue = newValue;
  35 + }
36 } 36 }
  37 +
  38 +};
37 </script> 39 </script>
38 40
39 <style> 41 <style>
40 42
41 -</style>  
  43 +</style>
@@ -10,30 +10,32 @@ @@ -10,30 +10,32 @@
10 </template> 10 </template>
11 11
12 <script> 12 <script>
13 - export default {  
14 - name: 'product-goods-season',  
15 - props: ['value'],  
16 - data() {  
17 - let _this = this;  
18 - return {  
19 - handleValue: _this.value  
20 - }  
21 - },  
22 - methods: {  
23 - updateValue(newValue) {  
24 - let nValue = newValue;  
25 - this.$emit('input', nValue);  
26 - }  
27 - },  
28 - watch: {  
29 - value(newValue) {  
30 - this.handleValue = newValue;  
31 - }  
32 - } 13 +export default {
  14 + name: 'product-goods-season',
  15 + props: ['value'],
  16 + data() {
  17 + let _this = this;
  18 +
  19 + return {
  20 + handleValue: _this.value
  21 + };
  22 + },
  23 + methods: {
  24 + updateValue(newValue) {
  25 + let nValue = newValue;
33 26
  27 + this.$emit('input', nValue);
  28 + }
  29 + },
  30 + watch: {
  31 + value(newValue) {
  32 + this.handleValue = newValue;
  33 + }
34 } 34 }
  35 +
  36 +};
35 </script> 37 </script>
36 38
37 <style> 39 <style>
38 40
39 -</style>  
  41 +</style>
@@ -24,14 +24,16 @@ export default { @@ -24,14 +24,16 @@ export default {
24 }, 24 },
25 data() { 25 data() {
26 let _this = this; 26 let _this = this;
  27 +
27 return { 28 return {
28 handleValue: _this.value.map(s => `${s.id}`) 29 handleValue: _this.value.map(s => `${s.id}`)
29 }; 30 };
30 }, 31 },
31 methods: { 32 methods: {
32 updateValue: function(value) { 33 updateValue: function(value) {
33 - this.handleValue = value;  
34 let newValue = value.map(s => ({id: s})); 34 let newValue = value.map(s => ({id: s}));
  35 +
  36 + this.handleValue = value;
35 this.$emit('input', newValue); 37 this.$emit('input', newValue);
36 } 38 }
37 }, 39 },
@@ -41,9 +43,9 @@ export default { @@ -41,9 +43,9 @@ export default {
41 } 43 }
42 } 44 }
43 45
44 -} 46 +};
45 </script> 47 </script>
46 48
47 <style> 49 <style>
48 50
49 -</style>  
  51 +</style>
@@ -26,10 +26,11 @@ export default { @@ -26,10 +26,11 @@ export default {
26 props: ['value', 'attr'], 26 props: ['value', 'attr'],
27 data() { 27 data() {
28 let _this = this; 28 let _this = this;
  29 +
29 return { 30 return {
30 handleSelectValue: _this.value[0], 31 handleSelectValue: _this.value[0],
31 handleCheckValue: _this.value 32 handleCheckValue: _this.value
32 - } 33 + };
33 }, 34 },
34 methods: { 35 methods: {
35 updateSelectValue(value) { 36 updateSelectValue(value) {
@@ -48,9 +49,9 @@ export default { @@ -48,9 +49,9 @@ export default {
48 } 49 }
49 } 50 }
50 } 51 }
51 -} 52 +};
52 </script> 53 </script>
53 54
54 <style> 55 <style>
55 56
56 -</style>  
  57 +</style>
@@ -16,29 +16,31 @@ @@ -16,29 +16,31 @@
16 </template> 16 </template>
17 17
18 <script> 18 <script>
19 - export default {  
20 - props: ['value'],  
21 - data() {  
22 - let _this = this;  
23 - return {  
24 - handleValue: _this.value  
25 - }  
26 - },  
27 - methods: {  
28 - updateValue(newValue) {  
29 - let nValue = newValue;  
30 - this.$emit('input', nValue);  
31 - }  
32 - },  
33 - watch: {  
34 - value(newValue) {  
35 - this.handleValue = newValue;  
36 - }  
37 - } 19 +export default {
  20 + props: ['value'],
  21 + data() {
  22 + let _this = this;
  23 +
  24 + return {
  25 + handleValue: _this.value
  26 + };
  27 + },
  28 + methods: {
  29 + updateValue(newValue) {
  30 + let nValue = newValue;
38 31
  32 + this.$emit('input', nValue);
  33 + }
  34 + },
  35 + watch: {
  36 + value(newValue) {
  37 + this.handleValue = newValue;
  38 + }
39 } 39 }
  40 +
  41 +};
40 </script> 42 </script>
41 43
42 <style> 44 <style>
43 45
44 -</style>  
  46 +</style>
@@ -8,4 +8,4 @@ export default { @@ -8,4 +8,4 @@ export default {
8 path: '/show/:id', 8 path: '/show/:id',
9 name: 'show', 9 name: 'show',
10 component: showProduct 10 component: showProduct
11 -};  
  11 +};