feat:navigate

master
ewall 5 years ago
parent e6a90f3357
commit 8ef3e92e0a

@ -1,5 +1,5 @@
<template>
<div class="goods-item">
<div class="goods-item" @click="onNavigate">
<div class="pic">
<image-pic align="center" width="90" height="125" :src="img" />
</div>
@ -19,16 +19,10 @@
export default {
props: ['img', 'title', 'desc', 'price', 'discount'],
methods: {
onNavigate(pitemId) {
onNavigate() {
this.$router.push({
path: '/detail',
query: {
pitemId
}
path: '/detail'
})
},
onAddCart(pitemId) {
this.$emit('onEmitAddCart', pitemId)
}
}
}

@ -1,5 +1,5 @@
<template>
<div class="product-item">
<div class="product-item" @click="onClick">
<image-pic :src="img" width="90" height="90" />
<div class="desc">
<div class="desc__top">
@ -26,7 +26,14 @@
<script>
export default {
props: ['img', 'title', 'desc', 'price', 'discount', 'percentage']
props: ['img', 'title', 'desc', 'price', 'discount', 'percentage'],
methods: {
onClick() {
this.$router.push({
path: '/detail'
})
}
}
}
</script>

@ -1,5 +1,5 @@
<template>
<div class="session-item">
<div class="session-item" @click="onClick">
<image-pic align="center" width="100%" height="160" :src="img" />
<div class="title">
<span class="title__text">{{title}}</span>
@ -40,6 +40,13 @@ export default {
},
components: {
CountDown
},
methods: {
onClick() {
this.$router.push({
path: '/product'
})
}
}
}
</script>
@ -65,7 +72,7 @@ export default {
}
}
.desc {
padding:0 10px;
padding: 0 10px;
display: flex;
align-items: center;
.desc__tag {

@ -1,26 +0,0 @@
<template>
<div class="icon-font">
<van-nav-bar title="svg图标" left-text="" left-arrow @click-left="onClickLeft"/>
<svg-icon icon-class="backtop" :width="30" :height="30" />
<svg-icon icon-class="wechat" :width="30" :height="30" />
<span style="color:red">
<svg-icon icon-class="qq" :width="30" :height="30" />
</span>
<span fill="red">
<svg-icon icon-class="search" :width="30" :height="30" />
</span>
<svg-icon icon-class="user" :width="30" :height="30" />
</div>
</template>
<script>
export default {
name: 'IconFont',
methods: {
onClickLeft() {
this.$router.go(-1)
}
}
}
</script>

@ -1,6 +1,6 @@
<template>
<div class="home-goods">
<Title name="为你推荐" style="background:#fff"/>
<Title name="为你推荐" style="background:#fff" />
<van-list
v-model="loading"

Loading…
Cancel
Save