<WaterfallItem v-for="(item, index) in caseList" :key="index" :order="index">
<div v-if="item.num>item.sell_num" class="itemImg" :id="item.id" :data="host+item.img_url" @click="clickImg(item)">
<div class="img_show"><img :src="host+item.img_url"></div>
<div class="goodsTit">{{item.title}}:</div> <div class="goodsIntro" v-html="item.remark"></div>
<p class="inPrice"><i>¥ {{item.price}}</i> <span class="fr">價格:{{item.in_price}}</span></p>
<p class="numPage">總:{{item.num}} <span class="fr">已賣:{{item.sell_num}}</span></p>
<!-- <div class="share">
<span><a href="javascript:void(0);"><img src="../../../static/images/qzone.png"></a></span>
<span><a href="https://weibo.com/u/3818321066/home?wvr=5"><img src="../../../static/images/weibo.png"></a></span>
<span><a href="javascript:void(0);"><img src="../../../static/images/weixin.png"></a></span>
</div> -->
</div>
</WaterfallItem>
clickImg(item){//點擊跳轉
//存儲當前點擊元素綁定的數據(這裏需要將數據轉化爲字符串,因localStorage只能存字符串),在跳轉後的頁面將其轉爲JSON格式
localStorage.setItem('goodsItem',JSON.stringify(item));
localStorage.setItem('host',this.host);
this.$router.push("/oneBuyList");
}
詳情頁中
created(){
this.goods=JSON.parse(localStorage.getItem("goodsItem"))
},