|
@@ -30,7 +30,7 @@
|
|
|
/>
|
|
/>
|
|
|
<!-- 点赞的数字 -->
|
|
<!-- 点赞的数字 -->
|
|
|
<p v-if="item.id === 4">{{ likeNum }}</p>
|
|
<p v-if="item.id === 4">{{ likeNum }}</p>
|
|
|
- <p v-else>{{item.name}}</p>
|
|
|
|
|
|
|
+ <p v-else>{{ item.name }}</p>
|
|
|
<transition v-if="item.id === 4" name="likeAddAnimate">
|
|
<transition v-if="item.id === 4" name="likeAddAnimate">
|
|
|
<div class="good" v-show="isShowGood">
|
|
<div class="good" v-show="isShowGood">
|
|
|
<div class="pic">
|
|
<div class="pic">
|
|
@@ -54,7 +54,7 @@
|
|
|
import StairIntro from "./component/intro.vue";
|
|
import StairIntro from "./component/intro.vue";
|
|
|
import StairCard from "./component/card.vue";
|
|
import StairCard from "./component/card.vue";
|
|
|
import StairShare from "./component/share.vue";
|
|
import StairShare from "./component/share.vue";
|
|
|
-import { likeSaveApi, lookSaveApi, getCunNumApi } from "@/utils/api";
|
|
|
|
|
|
|
+import { likeSaveApi, getCunNumApi } from "@/utils/api";
|
|
|
export default {
|
|
export default {
|
|
|
name: "stair",
|
|
name: "stair",
|
|
|
components: { StairIntro, StairCard, StairShare },
|
|
components: { StairIntro, StairCard, StairShare },
|
|
@@ -99,12 +99,6 @@ export default {
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
async created() {
|
|
async created() {
|
|
|
let id = Number(this.$route.params.id);
|
|
let id = Number(this.$route.params.id);
|
|
|
- // 只有从首页进入的才保存浏览量
|
|
|
|
|
- this.$router.beforeEach(async (to, from, next) => {
|
|
|
|
|
- if (from.name === "Home") await lookSaveApi(id);
|
|
|
|
|
- next();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
let res = await getCunNumApi(id);
|
|
let res = await getCunNumApi(id);
|
|
|
this.likeNum = res.data.star;
|
|
this.likeNum = res.data.star;
|
|
|
this.lookNum = res.data.visit;
|
|
this.lookNum = res.data.visit;
|