|
@@ -154,23 +154,22 @@
|
|
|
|
|
|
<!-- 音乐 -->
|
|
|
<!-- <div id="volume" class="ui-icon bgandshare wide"> -->
|
|
|
- <div id="volume" class="toHomeBox" style="margin-right: '10px'">
|
|
|
+ <!-- <div id="volume" class="toHomeBox" style="margin-right: '10px'">
|
|
|
<img id="openMusic" style="display: block" @click="switchBGM(true)" src="../../assets/img/musicAc.png"
|
|
|
alt="" />
|
|
|
<img id="closeMusic" style="display: none" @click="switchBGM(false)" src="../../assets/img/music.png"
|
|
|
alt="" />
|
|
|
<div class="btmText">讲解</div>
|
|
|
- </div>
|
|
|
-
|
|
|
+ </div> -->
|
|
|
<div class="toHomeBox">
|
|
|
<img src="../../assets/img/viewer.png" alt="" />
|
|
|
- <div class="btmText">1206</div>
|
|
|
+ <div class="btmText">{{ viewerNumber }}</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 分享 -->
|
|
|
- <div id="volume" class="toHomeBox" style="margin-right: '10px'" @click="() => { isLike = true }">
|
|
|
+ <div id="volume" class="toHomeBox" style="margin-right: '10px'" @click="liking()">
|
|
|
<img :src="require(`../../assets/img/like${isLike ? '_active' : ''}.png`)" alt="">
|
|
|
- <div class="btmText">112</div>
|
|
|
+ <div class="btmText">{{ likeNumber }}</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 分享 -->
|
|
@@ -213,7 +212,7 @@ import HotList from "./components/hotList.vue";
|
|
|
import FeedBack from "./components/FeedBack.vue";
|
|
|
import PunchCard from "./components/PunchCard.vue";
|
|
|
import html2canvas from "html2canvas";
|
|
|
-
|
|
|
+import { addViewDataAPI, getVisitAPI } from '@/utils/api'
|
|
|
|
|
|
|
|
|
|
|
@@ -227,13 +226,57 @@ export default {
|
|
|
openInd: 0,
|
|
|
isFull: false,
|
|
|
isLike: false,
|
|
|
- isOk: ''
|
|
|
+ isOk: '',
|
|
|
+ likeNumber: 0,
|
|
|
+ viewerNumber: 0,
|
|
|
+ keyValueById: {
|
|
|
+ 'KJ-7w6beohW0SV': 20,
|
|
|
+ 'KJ-n861OZCBj9g': 21,
|
|
|
+ 'KJ-0NKXh1TsRoF': 22,
|
|
|
+ 'KJ-LGeMazpL33X': 23,
|
|
|
+ 'KJ-FdfCowgsJsq': 24,
|
|
|
+ 'KJ-Ofi7O1dMuRv': 25,
|
|
|
+ 'KJ-Z0bljPCpxNe': 29,
|
|
|
+ 'KJ-YDu2r2dJkfK': 30,
|
|
|
+ 'KJ-zeUY8SIudGo': 31,
|
|
|
+ 'KJ-NDyJKVNPO3j': 32
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
computed: {},
|
|
|
- mounted() { },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ addViewDataAPI({
|
|
|
+ id: this.keyValueById[this.$route.query.m],
|
|
|
+ type: 'visit'
|
|
|
+ })
|
|
|
+ this.getViewAndLike()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getViewAndLike() {
|
|
|
+ getVisitAPI(this.keyValueById[this.$route.query.m]).then((res) => {
|
|
|
+ this.viewerNumber = res.data.pcsVisit
|
|
|
+ this.likeNumber = res.data.pcsStar
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ liking() {
|
|
|
+ if (!this.isLike) {
|
|
|
+ addViewDataAPI({
|
|
|
+ id: this.keyValueById[this.$route.query.m],
|
|
|
+ type: 'star'
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.isLike = true
|
|
|
+ this.getViewAndLike()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
punchCardFu() {
|
|
|
window.setTimeout(() => {
|
|
@@ -246,6 +289,13 @@ export default {
|
|
|
const link = canvas.toDataURL("image/jpeg");
|
|
|
this.isOk = link;
|
|
|
this.openInd = 4
|
|
|
+
|
|
|
+ // 打卡
|
|
|
+ const data = {
|
|
|
+ id: this.keyValueById[this.$route.query.m],
|
|
|
+ type: 'check'
|
|
|
+ }
|
|
|
+ addViewDataAPI(data).then(() => { })
|
|
|
});
|
|
|
}, 100);
|
|
|
},
|
|
@@ -312,6 +362,11 @@ export default {
|
|
|
if (document.execCommand("copy")) {
|
|
|
document.execCommand("copy");
|
|
|
alert("链接已复制");
|
|
|
+
|
|
|
+ addViewDataAPI({
|
|
|
+ id: this.keyValueById[this.$route.query.m],
|
|
|
+ type: 'share'
|
|
|
+ })
|
|
|
}
|
|
|
document.body.removeChild(input);
|
|
|
},
|