|
@@ -118,6 +118,7 @@
|
|
class="top-wrap-img"
|
|
class="top-wrap-img"
|
|
>
|
|
>
|
|
<img
|
|
<img
|
|
|
|
+ draggable="false"
|
|
:style="{height:item['音图'] == 'zhaomengfu1.png' ? '78%':''}"
|
|
:style="{height:item['音图'] == 'zhaomengfu1.png' ? '78%':''}"
|
|
:src="`${$env.BASE_URL}configMultiMedia/author/${item['音图']}`"
|
|
:src="`${$env.BASE_URL}configMultiMedia/author/${item['音图']}`"
|
|
>
|
|
>
|
|
@@ -201,15 +202,23 @@
|
|
@click="router.go(-1)"
|
|
@click="router.go(-1)"
|
|
/>
|
|
/>
|
|
<OperationTip
|
|
<OperationTip
|
|
- class="operation-tip"
|
|
|
|
- direction="h"
|
|
|
|
- :is-show="isShowOperationTip"
|
|
|
|
|
|
+ v-show="isShowClickTip"
|
|
|
|
+ class="operation-tip-click"
|
|
|
|
+ :text="'点击收起'"
|
|
|
|
+ :color="'white'"
|
|
|
|
+ type="click"
|
|
|
|
+ />
|
|
|
|
+ <OperationTip
|
|
|
|
+ v-show="isShowWheelTip"
|
|
|
|
+ class="operation-tip-wheel"
|
|
|
|
+ :text="'向下滑动滚轮'"
|
|
|
|
+ :color="'green'"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, computed, watch, onMounted, inject } from "vue"
|
|
|
|
|
|
+import { ref, computed, watch, onMounted, inject, onBeforeUnmount } from "vue"
|
|
import { useRoute, useRouter } from "vue-router"
|
|
import { useRoute, useRouter } from "vue-router"
|
|
import { useStore } from "vuex"
|
|
import { useStore } from "vuex"
|
|
import useSmoothSwipe from "@/useFunctions/useSmoothSwipe.js"
|
|
import useSmoothSwipe from "@/useFunctions/useSmoothSwipe.js"
|
|
@@ -224,7 +233,6 @@ const store = useStore()
|
|
const $env = inject('$env')
|
|
const $env = inject('$env')
|
|
|
|
|
|
const menuEl = ref(null)
|
|
const menuEl = ref(null)
|
|
-const menuElScrollLeft = ref(0)
|
|
|
|
|
|
|
|
const { width: windowWidth, height: windowHeight } = useWindowSize()
|
|
const { width: windowWidth, height: windowHeight } = useWindowSize()
|
|
const windowHeightDesign = 1080 - 71 - 37 // 设计稿里视口高度。注意要减去上下边栏
|
|
const windowHeightDesign = 1080 - 71 - 37 // 设计稿里视口高度。注意要减去上下边栏
|
|
@@ -249,13 +257,16 @@ const {
|
|
translateLength,
|
|
translateLength,
|
|
computeMaxTranslateLengthInnerByScrollTarget,
|
|
computeMaxTranslateLengthInnerByScrollTarget,
|
|
speedUp,
|
|
speedUp,
|
|
|
|
+ haveSwipedThisTime, // 用于在click事件中判断是否是鼠标按下后左右滑动导致的
|
|
} = useSmoothSwipe({
|
|
} = useSmoothSwipe({
|
|
scrollTargetRef: menuEl,
|
|
scrollTargetRef: menuEl,
|
|
maxTranslateLength: undefined,
|
|
maxTranslateLength: undefined,
|
|
viewportWidth: windowWidth,
|
|
viewportWidth: windowWidth,
|
|
|
|
+ initialTranslateLength: store.state.scrollPosInPaintingListPage
|
|
})
|
|
})
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
computeMaxTranslateLengthInnerByScrollTarget()
|
|
computeMaxTranslateLengthInnerByScrollTarget()
|
|
|
|
+ menuEl.value.scrollLeft = translateLength.value
|
|
}, 100)
|
|
}, 100)
|
|
watch(translateLength, (v) => {
|
|
watch(translateLength, (v) => {
|
|
menuEl.value.scrollLeft = v
|
|
menuEl.value.scrollLeft = v
|
|
@@ -304,6 +315,7 @@ const ageRenderInfo = {
|
|
function getAuthorList(paintingGroup) {
|
|
function getAuthorList(paintingGroup) {
|
|
const temp = paintingGroup.map((item) => {
|
|
const temp = paintingGroup.map((item) => {
|
|
let author = item['作者']
|
|
let author = item['作者']
|
|
|
|
+ author = author.replace(new RegExp('(.*)', 'g'), '')
|
|
return author
|
|
return author
|
|
})
|
|
})
|
|
return Array.from(new Set(temp))
|
|
return Array.from(new Set(temp))
|
|
@@ -313,16 +325,16 @@ function getPaintingSizeStringForShow({ width, height }) {
|
|
return `${width}\u00D7${height} 厘米`
|
|
return `${width}\u00D7${height} 厘米`
|
|
}
|
|
}
|
|
|
|
|
|
-const expandedAgeNameList = ref(new Set(['宋']))
|
|
|
|
-
|
|
|
|
-const isShowOperationTip = ref(true)
|
|
|
|
-const unwatch = watch(menuElScrollLeft, (v) => {
|
|
|
|
- isShowOperationTip.value = false
|
|
|
|
- unwatch()
|
|
|
|
-})
|
|
|
|
|
|
+const expandedAgeNameList = ref(new Set(['宋', '元', '明', '清']))
|
|
|
|
|
|
function onClickAge(ageName, evt) {
|
|
function onClickAge(ageName, evt) {
|
|
- isShowOperationTip.value = false
|
|
|
|
|
|
+ if (haveSwipedThisTime.value) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (isShowClickTip.value) {
|
|
|
|
+ isShowClickTip.value = false
|
|
|
|
+ isShowWheelTip.value = true
|
|
|
|
+ }
|
|
if (expandedAgeNameList.value.has(ageName)) {
|
|
if (expandedAgeNameList.value.has(ageName)) {
|
|
expandedAgeNameList.value.delete(ageName)
|
|
expandedAgeNameList.value.delete(ageName)
|
|
} else {
|
|
} else {
|
|
@@ -341,7 +353,9 @@ function onClickAge(ageName, evt) {
|
|
const isShowPaintingStyleDesc = ref(false)
|
|
const isShowPaintingStyleDesc = ref(false)
|
|
|
|
|
|
function onClickPainting(item) {
|
|
function onClickPainting(item) {
|
|
- console.log('sdfsdfsdf', item)
|
|
|
|
|
|
+ if (haveSwipedThisTime.value) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
router.push({
|
|
router.push({
|
|
name: 'PaintingDetail',
|
|
name: 'PaintingDetail',
|
|
query: {
|
|
query: {
|
|
@@ -350,6 +364,17 @@ function onClickPainting(item) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const isShowClickTip = ref(true)
|
|
|
|
+const isShowWheelTip = ref(false)
|
|
|
|
+const unwatch = watch(translateLength, (v) => {
|
|
|
|
+ isShowClickTip.value = false
|
|
|
|
+ isShowWheelTip.value = false
|
|
|
|
+ unwatch()
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+onBeforeUnmount(() => {
|
|
|
|
+ store.commit('setScrollPosInPaintingListPage', translateLength.value)
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -661,10 +686,16 @@ function onClickPainting(item) {
|
|
>.button-back{
|
|
>.button-back{
|
|
z-index: 2;
|
|
z-index: 2;
|
|
}
|
|
}
|
|
- >.operation-tip{
|
|
|
|
|
|
+ > .operation-tip-click {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: calc(42px * v-bind('windowHeight') / v-bind('windowHeightDesign'));
|
|
|
|
+ bottom: calc(102px * v-bind('windowHeight') / v-bind('windowHeightDesign'));
|
|
|
|
+ z-index: 10;
|
|
|
|
+ }
|
|
|
|
+ > .operation-tip-wheel {
|
|
position: absolute;
|
|
position: absolute;
|
|
- left: 43px;
|
|
|
|
- bottom: 102px;
|
|
|
|
|
|
+ left: 50%;
|
|
|
|
+ bottom: calc(102px * v-bind('windowHeight') / v-bind('windowHeightDesign'));
|
|
transform: translateX(-50%);
|
|
transform: translateX(-50%);
|
|
z-index: 10;
|
|
z-index: 10;
|
|
}
|
|
}
|