|
|
@@ -6,6 +6,7 @@
|
|
|
<floor :floor="defaultFloors[1]" :isDefault="true"></floor>
|
|
|
<floor v-for="(floor, index) in floors.data" :floor="floor" :isDefault="false" :key="index"></floor>
|
|
|
</div>
|
|
|
+ <span v-text="expandFloors"></span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -45,54 +46,40 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
-// mounted () {
|
|
|
-// this.$http.get('/api/floors/home')
|
|
|
-// .then(response => {
|
|
|
-// this.floors = response
|
|
|
-// })
|
|
|
-// }
|
|
|
computed: {
|
|
|
floors () {
|
|
|
return this.$store.state.floor.list
|
|
|
- }
|
|
|
- },
|
|
|
- created () {
|
|
|
- let arr = []
|
|
|
- this.$http.post('api/commodity/detail', arr).then(response => {
|
|
|
- let data = response.data
|
|
|
-// {
|
|
|
-// backGroundColor: '',
|
|
|
-// body: 'Rohm<br>晶体管',
|
|
|
-// hrefUrl: 'https://www.usoftmall.com/store/33069557578d44e69bd91ad12d28a8d4/BT2018012500000141',
|
|
|
-// name: 'RHU002N06T106',
|
|
|
-// pictureUrl: '/images/floor/RHU002N06T106.png',
|
|
|
-// size: 'medium',
|
|
|
-// price: 1.111111,
|
|
|
-// currency: 'RMB'
|
|
|
-// }
|
|
|
- let obj = {
|
|
|
- backGroundColor: '',
|
|
|
- body: '',
|
|
|
- hrefUrl: '',
|
|
|
- name: '',
|
|
|
- pictureUrl: '',
|
|
|
- size: '',
|
|
|
- price: '',
|
|
|
- currency: 'RMB'
|
|
|
- }
|
|
|
+ },
|
|
|
+ isProd () {
|
|
|
+ return this.$store.state.option.url === 'http://www.usoftmall.com'
|
|
|
+ },
|
|
|
+ expandFloors () {
|
|
|
+ let data = this.$store.state.floor.list_expand.data
|
|
|
+ let _this = this
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ backGroundColor: '',
|
|
|
+ body: '',
|
|
|
+ hrefUrl: '',
|
|
|
+ name: '',
|
|
|
+ pictureUrl: '',
|
|
|
+ size: '',
|
|
|
+ price: '',
|
|
|
+ currency: 'RMB'
|
|
|
+ }
|
|
|
if (data[i]) {
|
|
|
obj.name = data[i].code
|
|
|
- obj.body = data[i].brandNameEn + '<br/>' + data[i].kindNameCn
|
|
|
- obj.hrefUrl = 'https://www.usoftmall.com/store/productDetail/' + data[i].batchCode
|
|
|
- obj.pictureUrl = '/images/floor/' + data[i].code + '.png'
|
|
|
+ obj.body = data[i].brandNameEn + '<br/>' + (data[i].kindNameCn || '其他')
|
|
|
+ obj.hrefUrl = '/store/productDetail/' + data[i].batchCode
|
|
|
+ obj.pictureUrl = '/images/floor/' + (this.isProd ? data[i].code : '2SD2704KT146') + '.png'
|
|
|
obj.size = i % 3 === 0 ? 'medium' : 'small'
|
|
|
obj.currency = data[i].currencyName
|
|
|
- obj.price = this.getMinPrice(data[i].prices, data[i].currencyName)
|
|
|
- this.defaultFloors.items[i < 6 ? 0 : 1].append(obj)
|
|
|
+ obj.price = _this.getMinPrice(data[i].prices, data[i].currencyName)
|
|
|
+ _this.defaultFloors[i < 6 ? 0 : 1].items.push(obj)
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ return data
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
getMinPrice: function (prices, currency) {
|