添加回到顶部代码
This commit is contained in:
parent
cb2674fe48
commit
438b5179ed
BIN
src/assets/img/publicImage/back-icon.png
Normal file
BIN
src/assets/img/publicImage/back-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1010 B |
@ -62,7 +62,7 @@
|
||||
转发
|
||||
</span>
|
||||
<transmit-btn v-if="data.data['info']" :qrcode="data.data['qrcode']"
|
||||
:title="data.data.info['title']"></transmit-btn>
|
||||
:title="data.data.info['subject']"></transmit-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
40
src/components/public/backToTop.vue
Normal file
40
src/components/public/backToTop.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div class="returnTop flexcenter" @click="screenroll()">
|
||||
<img class="icon" src="@/assets/img/publicImage/back-icon.png">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const screenroll = () => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth"
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@media screen and (max-width: 1360px) {
|
||||
.returnTop {
|
||||
right: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.returnTop {
|
||||
position: fixed;
|
||||
right: calc((100vw - 1200px) / 2 - 75px);
|
||||
bottom: 18px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: #323232;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.11764706);
|
||||
border-radius: 50%;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
|
||||
.icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -187,6 +187,8 @@
|
||||
<footerTool></footerTool>
|
||||
<!-- <indexRegularBox></indexRegularBox> -->
|
||||
</div>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -202,6 +204,7 @@ import { useRouter } from 'vue-router'
|
||||
import store from '../store/index';
|
||||
import api from "../utils/api";
|
||||
import { ElMessage } from 'element-plus'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
//
|
||||
let informationData = ref([
|
||||
|
@ -365,6 +365,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<footerpage></footerpage>
|
||||
<back-to-top></back-to-top>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -376,6 +377,7 @@ import pageTopBar from '../components/pageTopBar/pageTopBar.vue';
|
||||
import footerpage from '@/components/footer/footer.vue'
|
||||
import viewMap from '@/components/public/viewMap.vue'
|
||||
import transmitBtn from '@/components/public/transmitBtn.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
import imageWatch from '@/components/detail/imageWatch.vue';
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
let router = useRouter()
|
||||
@ -571,7 +573,6 @@ const handleNavData = () => {
|
||||
// 处理点击nav 滚动事件
|
||||
const handleClickNav = value => {
|
||||
let scrollTop = eval(value).value.offsetTop + 136
|
||||
// if (value != 'eleseEle') navTab.value = value
|
||||
window.scrollTo({ top: scrollTop, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@
|
||||
转发
|
||||
</span>
|
||||
<transmit-btn v-if="housingInfo.data" :qrcode="housingInfo.data['qrcode']"
|
||||
:title="housingInfo.data.info['title']"></transmit-btn>
|
||||
:title="housingInfo.data.info['subject']"></transmit-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="concat-btn-box" :class="{ 'concat-btn-show': concatType }">
|
||||
@ -962,6 +962,8 @@
|
||||
<watchImage :show="imageShow" :close="cloaseImageShow" :list="imgList"></watchImage>
|
||||
<!-- 右下角咨询 -->
|
||||
<circle-btn></circle-btn>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -979,6 +981,7 @@ import indexWaterfallBox from "../components/indexWaterfallBox/indexWaterfallBox
|
||||
import Masonry from 'masonry-layout';
|
||||
import transmitBtn from '@/components/public/transmitBtn.vue'
|
||||
import biserialItem from '../components/biserialListItem/biserialListItem.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
import store from '@/store';
|
||||
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
<!-- 右下角咨询 -->
|
||||
<circle-btn></circle-btn>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -36,6 +38,7 @@ import { ref, onMounted, onUnmounted, watch, getCurrentInstance, nextTick } from
|
||||
import { ElLoading } from 'element-plus'
|
||||
import Masonry from 'masonry-layout';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
@ -25,6 +25,9 @@
|
||||
</div>
|
||||
<!-- 右下角咨询 -->
|
||||
<circle-btn></circle-btn>
|
||||
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -40,6 +43,7 @@ import tool from '../../toolJs/downLoadMore'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import footerTool from '@/components/footer/footer.vue'
|
||||
import loadMoreText from '../../components/loadMore/loadMoreText.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
//获取数据
|
||||
let pages = ref(1)
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
<!-- 右下角咨询 -->
|
||||
<circle-btn></circle-btn>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -41,6 +43,7 @@ import tool from '../../toolJs/downLoadMore'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import footerTool from '@/components/footer/footer.vue'
|
||||
import loadMoreText from '../../components/loadMore/loadMoreText.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
//获取数据
|
||||
let pages = ref(1)
|
||||
|
@ -26,6 +26,9 @@
|
||||
|
||||
<!-- 右下角咨询 -->
|
||||
<circle-btn></circle-btn>
|
||||
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -42,6 +45,7 @@ import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import footerTool from '@/components/footer/footer.vue'
|
||||
import loadMoreText from '../../components/loadMore/loadMoreText.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
//路由
|
||||
const router = useRouter()
|
||||
|
@ -28,6 +28,8 @@
|
||||
<listBtmPrompt></listBtmPrompt>
|
||||
<footerTool></footerTool>
|
||||
</div>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -45,6 +47,7 @@ import { useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus'
|
||||
import footerTool from '@/components/footer/footer.vue'
|
||||
import loadMoreText from '../components/loadMore/loadMoreText.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
//路由
|
||||
const route = useRouter()
|
||||
|
@ -108,6 +108,8 @@
|
||||
|
||||
<!-- 系统通知弹窗 -->
|
||||
<systematic-notification-pop v-if="systematicState" @close="systematicState = false"></systematic-notification-pop>
|
||||
<back-to-top></back-to-top>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -118,6 +120,8 @@ import pageFooter from '@/components/footer/footer.vue'
|
||||
import publicListItem from '@/components/public/public-list-item.vue'
|
||||
import emptyDuck from '@/components/public/empty-duck.vue'
|
||||
import choosingIdentity from '@/components/edit/choosingIdentity.vue'
|
||||
import backToTop from '@/components/public/backToTop.vue'
|
||||
|
||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user