|
@@ -14,74 +14,31 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import config from '../config/config'
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
data () {
|
|
|
return {
|
|
|
- productIcon: [
|
|
|
- {
|
|
|
- name: '母婴清洁',
|
|
|
- id: '57e3a5a49f5160c9048b457c',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-mother-child.png',
|
|
|
- color: '#a6dc48'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '日常清洁',
|
|
|
- id: '57e0dffc9f5160dd048b4568',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-daily.png',
|
|
|
- color: '#76a6f6'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '深度清洁',
|
|
|
- id: '57e0e0189f5160dc048b4568',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-depth.png',
|
|
|
- color: '#5ecdec'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '专业除螨',
|
|
|
- id: '57e0e0369f5160b1048b456b',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-mites.png',
|
|
|
- color: '#b17ff6'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '家电清洗',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-appliances.png',
|
|
|
- id: '57e0e04e9f5160af048b456b',
|
|
|
- color: '#fabf4c'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '新居开荒',
|
|
|
- id: '57e0e0879f5160b8048b4571',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-new-home.png',
|
|
|
- color: '#5adde9'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '擦玻璃',
|
|
|
- id: '57fb4a909f5160b2048b4a0e',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-ca-bo-li.png',
|
|
|
- color: '#70df68'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '租房大扫除',
|
|
|
- id: '57e0e0709f5160aa048b456c',
|
|
|
- url: 'http://oduj3utzz.bkt.clouddn.com/home-renting.png',
|
|
|
- color: '#fcac71'
|
|
|
- }
|
|
|
- ]
|
|
|
+ productIcon: config.productIcon
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ for (let i in config.productIcon) {
|
|
|
+ console.log(config.productIcon[i])
|
|
|
+ console.log(this.$store.state.product.products)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
pro: function (id) {
|
|
|
+ config.productInfo = {}
|
|
|
let products = this.$store.state.product.products
|
|
|
- let productBox = {}
|
|
|
for (let i in products) {
|
|
|
if (products[i].id === id) {
|
|
|
- productBox = products[i]
|
|
|
+ config.productInfo = products[i]
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 带查询参数,变成 /register?plan=private
|
|
|
- this.$router.push({path: 'product', query: {productBox: productBox}})
|
|
|
+ this.$router.push({path: 'product'})
|
|
|
}
|
|
|
}
|
|
|
}
|