{path:'/goods/goodsshow/:goodsid',component:goodsshow},
整体和前面差不多
<template>
<div class="tmpl">
<!-- 1.0 商品列表图片布局 -->
<ul class="mui-table-view mui-grid-view">
<!-- <li class="mui-table-view-cell mui-media mui-col-xs-6">
<a class="a" href="#">
![](../../../statics/imgs/thumb_201504200154277661.jpg)
<div class="mui-media-body">想要一间这样的木屋,静静的喝咖啡</div>
</a>
<div class="desc">
<h5><span class="sellprice">¥2099</span>
<s>¥1099 </s>
</h5>
<div class="left">热卖中</div>
<div class="right">剩60件</div>
</div>
</li> -->
<li v-for="item in list" class="mui-table-view-cell mui-media mui-col-xs-6">
<router-link v-bind="{to:'/goods/goodsshow/'+item.id}">
![](item.img_url)
<div class="mui-media-body" v-text="item.title"></div>
</router-link>
<div class="desc">
<h5><span class="sellprice">¥{{item.sell_price}}</span>
<s>¥{{item.market_price}} </s>
</h5>
<div class="left">热卖中</div>
<div class="right">剩{{item.stock_quantity}}件</div>
</div>
</li>
</ul>
</div>
</template>
<script>
import common from '../../kits/common.js'
export default{
data(){
return {
list:[]
}
},
methods:{
getlist(){
this.$http.get(common.apiDomain+'/api/getgoods?pageindex=1').then(res=>{
this.list = res.body.message;
console.log(res.body.message[0].img_url);
});
}
},
created(){
this.getlist();
}
}
</script>
<style scoped>
.mui-table-view.mui-grid-view .mui-table-view-cell{
border:1px solid rgba(0,0,0,0.3);
padding:0 0 0 0;
box-shadow:0 0 3px #666;
}
.mui-table-view.mui-grid-view{
padding:5px;
}
.a{
padding: 5px;
}
.desc{
background-color: rgba(0,0,0,0.1);
height: 60px;
width: 100%;
margin: 0px;
padding: 0px;
}
.desc h5{
text-align: left;
padding: 5px;
}
.desc s{
padding-left: 15px;
}
.sellprice{
color: red;
font-size: 14px;
font-weight: bold;
}
.left {
width: 50%;
float: left;
text-align: left;
padding-left: 10px;
}
.right {
width:50%;
float: right;
text-align: right;
padding-right: 10px;
}
.left,.right{
margin-top: 15px;
font-size: 12px;
}
.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{
font-size:12px;
}
.mui-table-view.mui-grid-view .mui-table-view-cell{
margin-right: 5px;
}
.mui-col-xs-6{
width: 48%;
}
</style>
goodslist和goodsshow跳转之间的参数传递
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 微信小程序拥有web网页和Application共同的特征,我们的页面都不是孤立存在的,而是通过和其他页面进行交互...