|
@@ -25,6 +25,9 @@
|
|
|
:src="`${imgPrefix}/${drawName}`"
|
|
|
alt=""
|
|
|
draggable="false"
|
|
|
+ @show="onViewerShow"
|
|
|
+ @hide="onViewerHide"
|
|
|
+ @inited="onViewerInit"
|
|
|
>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -56,13 +59,42 @@
|
|
|
name: 'EntryList',
|
|
|
})"
|
|
|
/>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-show="isViewingBigImage"
|
|
|
+ class="show-on-mask"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="eye"
|
|
|
+ src="@/assets/images/eye.png"
|
|
|
+ alt=""
|
|
|
+ draggable="false"
|
|
|
+ >
|
|
|
+ <div class="view-count">
|
|
|
+ {{ viewCount }}
|
|
|
+ </div>
|
|
|
+ <button
|
|
|
+ class="like"
|
|
|
+ :class="{
|
|
|
+ liked: hasLiked,
|
|
|
+ }"
|
|
|
+ @click="onClickLike"
|
|
|
+ />
|
|
|
+ <div class="like-count">
|
|
|
+ {{ likeCount }}
|
|
|
+ </div>
|
|
|
+ <button
|
|
|
+ class="return"
|
|
|
+ @click="closeViewer"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, computed, } from "vue"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
|
-import { hasShownForword } from "@/store/index.js"
|
|
|
+import { hasShownForword, likeRecord } from "@/store/index.js"
|
|
|
import { drawTree } from "@/assets/draw-tree.js"
|
|
|
|
|
|
const {
|
|
@@ -86,9 +118,49 @@ const drawList = computed(() => {
|
|
|
const imgPrefix = computed(() => {
|
|
|
return `https://4dkk-culture.oss-cn-shenzhen.aliyuncs.com/LiangZhu/draws/${encodeURIComponent(groupL1Name)}/${encodeURIComponent(groupName.value)}`
|
|
|
})
|
|
|
-</script>
|
|
|
|
|
|
+const isViewingBigImage = ref(false)
|
|
|
+function onViewerShow(e) {
|
|
|
+ isViewingBigImage.value = true
|
|
|
+}
|
|
|
+function onViewerHide(e) {
|
|
|
+ isViewingBigImage.value = false
|
|
|
+}
|
|
|
+function closeViewer() {
|
|
|
+ const closeBtn = document.querySelector('.viewer-close')
|
|
|
+ closeBtn.click()
|
|
|
+}
|
|
|
+
|
|
|
+const viewCount = ref(null)
|
|
|
+api.getViewCount(route.query.idx - 1).then((res) => {
|
|
|
+ viewCount.value = res
|
|
|
+})
|
|
|
+
|
|
|
+const likeCount = ref(null)
|
|
|
+api.getLikeCount(route.query.idx - 1).then((res) => {
|
|
|
+ likeCount.value = res
|
|
|
+})
|
|
|
+const hasLiked = computed(() => {
|
|
|
+ return likeRecord.value[route.query.idx - 1]
|
|
|
+})
|
|
|
+function onClickLike(e) {
|
|
|
+ if (hasLiked.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ likeRecord.value[route.query.idx - 1] = true
|
|
|
+ api.like(route.query.idx - 1)
|
|
|
+ setTimeout(() => {
|
|
|
+ utils.animateCSS(e.target, 'heartBeat')
|
|
|
+ }, 0)
|
|
|
+}
|
|
|
+</script>
|
|
|
|
|
|
+<style>
|
|
|
+.viewer-button{
|
|
|
+ width: 0 !important;
|
|
|
+ height: 0 !important;
|
|
|
+}
|
|
|
+</style>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
.common-draw-list-view{
|
|
@@ -201,5 +273,56 @@ const imgPrefix = computed(() => {
|
|
|
box-shadow: 0px calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')) calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')) 0px rgba(0,0,0,0.25);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ >.show-on-mask{
|
|
|
+ position: absolute;
|
|
|
+ z-index: 2106;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: calc(90 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ >img.eye{
|
|
|
+ width: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ height: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+ >.view-count{
|
|
|
+ font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ line-height: calc(19 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ margin-bottom: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+ >button.like{
|
|
|
+ width: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ height: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ background-image: url(@/assets/images/like.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ }
|
|
|
+ >button.like.liked{
|
|
|
+ background-image: url(@/assets/images/liked.png);
|
|
|
+ }
|
|
|
+ >.like-count{
|
|
|
+ font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #FFFFFF;
|
|
|
+ line-height: calc(19 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ margin-bottom: calc(10 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+ >button.return {
|
|
|
+ width: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ height: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ background-image: url(@/assets/images/icon_back@2x.png);
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ margin-bottom: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|