From 2b99047683332624832c1dfcae596e957a710b7d Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 28 七月 2022 10:20:49 +0800 Subject: [PATCH] bug修复 --- src/views/index/components/rightRrid.vue | 43 +++++++++++++++++++++++++++++++++---------- 1 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/views/index/components/rightRrid.vue b/src/views/index/components/rightRrid.vue index 948068e..2cca0d6 100644 --- a/src/views/index/components/rightRrid.vue +++ b/src/views/index/components/rightRrid.vue @@ -1,21 +1,21 @@ <template> <div class="rightRrid"> - <div class="gridItem" v-for="(item, index) in data.product" :key="index"> + <div class="gridItem" v-for="(item, index) in product" :key="index"> <div class="title"> - <img :src="item.icon" alt="" /> - {{ item.title }} + <ImageShow :src="item.logoUrl"></ImageShow> + {{ item.modelName }} </div> - <div class="des"> - {{ item.des }} + <div class="des limitRow2"> + {{ item.description }} </div> - <price :priceNew="item.priceNew" :priceOld="item.priceOld"></price> - <div class="button">绔嬪嵆璐拱</div> + <price :priceNew="item.priceBase"></price> + <div class="button" @click="buyProduct(item.id)">绔嬪嵆璐拱</div> </div> </div> </template> <script> -import price from "@/views/index/components/price"; +import price from "@/components/Price.vue"; export default { props: { @@ -25,6 +25,28 @@ }, components: { price, + }, + data() { + return { + product: [], + }; + }, + created() { + if (this.data.product.length > 6) { + this.product = this.data.product.slice(0, 6); + } else { + this.product = this.data.product; + } + }, + methods: { + buyProduct(id) { + this.$router.push({ + path: "/productDetail", + query: { + id: id, + }, + }); + }, }, }; </script> @@ -72,12 +94,13 @@ .des { margin-bottom: 10px; + height: 35px; font-size: 14px; color: #666666; } - .price { - margin-bottom: 10px; + .Price { + margin-bottom: 16px; margin-left: 0; } -- Gitblit v1.8.0