-
+
-
-
- - +
- + - - -
@@ -65,10 +67,13 @@
-
+
{{ item.name }}
@@ -133,14 +138,14 @@ import Crumb from "@/components/Crumb";
import { reqGetDetail } from "@/request/api";
export default {
components: { Crumb },
- watch : {
- "$route.query.id": {
- handler() {
- //刷新页面
- this.$router.go(0);
- }
- }
- },
+ // watch : {
+ // "$route.query.id": {
+ // handler() {
+ // //刷新页面
+ // this.$router.go(0);
+ // }
+ // }
+ // },
data() {
return {
stepNum : 2,
@@ -149,16 +154,33 @@ export default {
//可以兑换
themYouCanBuy: [],
// 商品详情的数据
- productInfo : {}
+ productInfo : {},
+ opacity : 0
};
},
- async created() {
+ created() {
const goodsId = this.$route.query.id;
- const { data: res } = await reqGetDetail(goodsId);
- const { productInfo, nav, themYouCanBuy } = res;
- this.productInfo = productInfo;
- this.nav = nav;
- this.themYouCanBuy = themYouCanBuy;
+ this.getDetailsInfo(goodsId);
+ },
+ methods: {
+ getNewPage(id) {
+ this.$router.push({
+ path : "/detail",
+ query: { id }
+ });
+ this.getDetailsInfo(id);
+ },
+ async getDetailsInfo(goodsId) {
+ const { data: res } = await reqGetDetail(goodsId);
+ const { productInfo, nav, themYouCanBuy } = res;
+ this.productInfo = productInfo;
+ this.nav = nav;
+ this.themYouCanBuy = themYouCanBuy;
+ },
+ imgTab(i,src) {
+ this.opacity = i
+ this.productInfo.coverImg =src
+ }
}
};
@@ -186,16 +208,16 @@ export default {
li {
width: 100px;
height: 100px;
- background-color: #cff;
+ // background-color: #cff;
cursor: pointer;
- img {
- filter: brightness(50%);
- }
- &:hover {
- img {
- filter: brightness(100%);
- }
- }
+ // img {
+ // filter: brightness(60%);
+ // }
+ // &:hover {
+ // img {
+ // filter: brightness(100%);
+ // }
+ // }
}
}
}