Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-16 12:34:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2eb885509c802d915f859ec0f31c461cc37f7ce6
2eb88550
1 parent
182177fa
fix 处理首页位置问题
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
49 deletions
src/route.js
src/views/client/index.vue
src/route.js
View file @
2eb8855
...
...
@@ -3,7 +3,8 @@ export default [{
name
:
'首页'
,
component
:
()
=>
import
(
'./views/client/index.vue'
),
meta
:
{
title
:
'童声无界'
title
:
'童声无界'
,
name
:
'index'
},
children
:
[]
},
{
...
...
@@ -11,7 +12,8 @@ export default [{
name
:
'客户端入口页'
,
component
:
()
=>
import
(
'./views/client/index.vue'
),
meta
:
{
title
:
'童声无界'
title
:
'童声无界'
,
name
:
'index'
},
children
:
[]
},
{
...
...
src/views/client/index.vue
View file @
2eb8855
...
...
@@ -22,6 +22,8 @@
</template>
<script setup>
import { mainStore } from '@/store'
import Cookies from 'js-cookie'
import 'animate.css';
import icon_subscribed from '@images/icon-dingyue01@2x.png'
...
...
@@ -31,12 +33,30 @@ import MyButton from '@/components/MyButton/index.vue'
import $ from 'jquery';
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router'
import { Toast } from 'vant';
import { nextTick, onMounted, reactive, ref } from 'vue'
import { nextTick, onMounted, reactive, ref
, watch
} from 'vue'
import axios from '@/utils/axios';
// 滚动条判断
function hasScrollbar() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
}
onMounted(() => {
// TODO: 临时处理位置不对问题
// 因为微信第一次进入默认全屏,之后产生的导航栏会影响位置
if (hasScrollbar()) {
location.reload()
}
})
const $route = useRoute();
const $router = useRouter();
// TAG: keepAlive 缓存页面
const store = mainStore();
store.keepThisPage($route.meta.name);
// 自定义按钮颜色样式
const styleObject1 = reactive({
backgroundColor: '#FFFFFF',
...
...
@@ -62,7 +82,7 @@ const goSchool = () => { // 跳转选择幼儿园页面
Cookies.set('userType', 'client'); // 客户标识
}
onMounted
(() => {
onMounted(() => {
// 背景颜色全屏
$('.client-index-page').height($(document).height());
})
...
...
@@ -82,21 +102,21 @@ const cancelAuth = () => {
type: 'cancel'
}
})
.then(res => {
if (res.data.code === 1) {
Toast.success('操作成功')
} else {
console.warn(res);
if (!res.data.show) return false;
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
.then(res => {
if (res.data.code === 1) {
Toast.success('操作成功')
} else {
console.warn(res);
if (!res.data.show) return false;
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
}
</script>
...
...
@@ -105,49 +125,56 @@ import mixin from 'common/mixin'
import { mainStore } from '@/store'
import { storeToRefs } from 'pinia'
export default {
name: 'index',
mixins: [mixin.init],
data
() {
data() {
return {
}
},
mounted
() {
mounted() {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.client-index-page {
// 背景图 宽度100% 高度控制
background-image: url('@images/yindao@2x.png');
background-repeat: no-repeat;
width: 100%;
background-size: 100% 85%;
position: relative;
.client-index-page {
// 背景图 宽度100% 高度控制
background-image: url('@images/yindao@2x.png');
background-repeat: no-repeat;
width: 100%;
background-size: 100% 85%;
position: relative;
}
.entry-wrapper {
position: absolute;
bottom: 1rem;
width: 100%;
.text {
color: #B8B8B8;
margin: 1rem;
margin-bottom: 0;
}
.entry-wrapper {
position: absolute;
bottom: 0;
width: 100%;
.text {
color: #B8B8B8;
margin: 1rem;
margin-bottom: 0;
.control {
margin: 1rem;
margin-top: 0.5rem;
overflow: auto;
.plain {
width: 28%;
float: left;
margin-right: 3%;
}
.control {
margin: 1rem;
margin-top: 0.5rem;
overflow: auto;
.plain {
width: 28%; float: left;
margin-right: 3%;
}
.primary {
width: 69%; float: left;
}
.primary {
width: 69%;
float: left;
}
}
}
</style>
...
...
Please
register
or
login
to post a comment