修改首页及样式

This commit is contained in:
xuli3099
2025-08-19 13:28:14 +08:00
parent a0f2fab6bf
commit 2ad389e2f0
8 changed files with 170 additions and 191 deletions

View File

@@ -4,16 +4,16 @@
<script setup>
import { onLaunch } from '@dcloudio/uni-app';
onLaunch((opt) => {
console.log("onLaunch")
// import { onLaunch } from '@dcloudio/uni-app';
// onLaunch((opt) => {
// console.log("onLaunch")
uni.preloadPage({ url: "/pages/login/login" });
uni.preloadPage({ url: "/pages/home/home" });
uni.preloadPage({ url: "/pages/business/business" });
uni.preloadPage({ url: "/pages/notice/notice" });
uni.preloadPage({ url: "/pages/userinfo/userinfo" });
})
// uni.preloadPage({ url: "/pages/login/login" });
// uni.preloadPage({ url: "/pages/home/home" });
// uni.preloadPage({ url: "/pages/business/business" });
// uni.preloadPage({ url: "/pages/notice/notice" });
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
// })
</script>

View File

@@ -58,15 +58,15 @@ const handleBack = () => {
margin-left:-375rpx;
z-index: 999;
/* #ifdef APP-PLUS */
background: url('@/static/images/bg-Blue-header.png') no-repeat;
/* background: url('@/static/images/bg-Blue-header.png') no-repeat;
background-size:750rpx 160rpx;
height:160rpx;
height:160rpx; */
/* #endif */
/* #ifndef APP-PLUS */
background: url('@/static/images/bg-Blue-header2.png') no-repeat;
/* background: url('@/static/images/bg-Blue-header2.png') no-repeat;
background-size:750rpx 116rpx;
height:116rpx;
height:116rpx; */
/* #endif */
}

View File

@@ -2,12 +2,11 @@
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'业务中心'"
:leftFlag="false" :rightFlag="false" v-if="!searchShow"
></customHeader>
<customHeader v-else ref="customHeaderRef" :title="'搜索'"
:leftFlag="true" :rightFlag="false"
@back="handleBack" :searchType="1"
<customHeader ref="customHeaderRef" :title="!searchShow?'业务中心':'搜索'"
:leftFlag="!searchShow?false:true"
:rightFlag="false"
@back="handleBack"
:searchType="searchShow?1:undefined"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
@@ -68,7 +67,7 @@
<script setup>
import { ref,onMounted } from 'vue'
import { onLoad,onShow } from '@dcloudio/uni-app';
import { onLoad,onHide } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue';
import customSearch from '@/components/customSearch.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
@@ -99,6 +98,10 @@ let searchShow = ref(false);
let searchText = ref(undefined);
let searchTypeObj = ref({typeId:2});
onHide(()=>{
searchShow.value=false;
})
// 搜索返回操作
const handleBack=()=>{
searchShow.value=false;
@@ -173,7 +176,7 @@ let handleJump=(url)=>{
<style scope>
.scroll-h{
/* #ifdef APP-PLUS */
height: calc(100vh - 120px) !important;
height: calc(100vh - 130px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 140px) !important;

View File

@@ -1,14 +1,17 @@
<template>
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'首页'"
:leftFlag="false" :rightFlag="false"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
<!-- 下拉刷新 -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit"
:down="downOption" @down="downCallback"
:fixed="false" class="scroll-h" :style="{ paddingTop: navBarPaddingTop + 'px' }"
:fixed="false" class="scroll-h"
>
<!-- #ifdef H5 -->
<view style="height:50rpx"></view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<!-- 删除设备ID--测试用 -->
<view class="del-cache" @click="handleDelete">
@@ -16,24 +19,6 @@
</view>
<!-- #endif -->
<!-- 搜索 @confirm="handleSearch" -->
<customSearch v-if="searchShow"
:searchKeywords="searchText"
:searchType="searchTypeObj"
@confirm="handleSearchConfirm"
></customSearch>
<view class="search search-sao" v-else>
<uni-search-bar class="custom-search" radius="28"
placeholder="请输入您想查询的内容或服务"
clearButton="auto" cancelButton="none"
bgColor="#6FA2F8" textColor="#ffffff"
@focus="handleSearchFocus"
v-model="searchText"
/>
<uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phonesaoyisao" size="20"></uni-icons>
</view>
<block v-if="!searchShow">
<!-- 待办内容 -->
<view class="backlog-bg">
<view class="backlog-b-item">
@@ -150,7 +135,6 @@
<!-- 底部加高度来避免tabbar遮挡 -->
<view class="bottom-height"></view>
</block>
</mescroll-uni>
</view>
</view>
@@ -159,6 +143,7 @@
<script setup>
import { ref,onMounted,computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import customSteps from '@/components/customSteps.vue'
import customSearch from '@/components/customSearch.vue'
@@ -204,7 +189,7 @@ onLoad(async(opt) => {
// 初始化调用方法
const initLoad =()=>{
try {
showLoading("加载中...")
showLoading("加载中...");
getBackBlogCount();
getSwiperList();
getStepData();
@@ -251,24 +236,6 @@ onMounted(() => {
navBarPaddingTop.value = getNavBarPaddingTop()*2;
})
// 搜索处理
let searchShow = ref(false);
let searchTypeObj = ref({typeId:1});
let searchText = ref(undefined);
// 获取input 焦点跳转
const handleSearchFocus=()=>{
searchShow.value = true;
}
// 搜索完返回处理
const handleSearchConfirm = (param1,param2)=>{
// console.log(param1,param2)
searchText.value=param2.value;;
searchShow.value=false;
}
let backBlogObj = ref({
count1:0,
count2:0,
@@ -409,10 +376,10 @@ const formatDateStr =(times)=>{
.scroll-h{
/* #ifdef APP-PLUS */
height:calc(100vh - 30px) !important;
height:calc(100vh - 78px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 30px) !important;
height: calc(100vh - 80px) !important;
/* #endif */
}
:deep(.mescroll-upwarp){

View File

@@ -45,9 +45,9 @@ let versionData = ref({}); //版本参数
onLoad(async(opt) => {
console.log("onLoad");
uni.preloadPage({url: "/pages/login/login"});
uni.preloadPage({url: "/pages/deviceAuth/deviceAuth"});
uni.preloadPage({url: "/pages/home/home"});
// uni.preloadPage({url: "/pages/login/login"});
// uni.preloadPage({url: "/pages/deviceAuth/deviceAuth"});
// uni.preloadPage({url: "/pages/home/home"});
// #ifdef APP-PLUS
// 查询版本接口

View File

@@ -2,17 +2,18 @@
<view class="con-body">
<view class="con-bg">
<!-- 头部 -->
<customHeader ref="customHeaderRef" :title="'消息'" :leftFlag="false" :rightFlag="true" v-if="!searchShow">
<template #right>
<customHeader ref="customHeaderRef" :title="!searchShow?'消息':'搜索'"
:leftFlag="!searchShow?false:true"
:rightFlag="true"
@back="handleBack" :searchType="searchShow?1:undefined"
>
<template #right v-if="!searchShow">
<view class="head-right" @click="handleRead">
<img :src="'static/images/icon-clean@2x.png'" />清除未读
</view>
</template>
</customHeader>
<customHeader v-else ref="customHeaderRef" :title="'搜索'"
:leftFlag="true" :rightFlag="false"
@back="handleBack" :searchType="1"
></customHeader>
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
@@ -54,7 +55,7 @@
<script setup>
import { ref, onMounted,computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app';
import { onLoad,onHide } from '@dcloudio/uni-app';
import customHeader from '@/components/customHeader.vue'
import customSearch from '@/components/customSearch.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
@@ -85,6 +86,9 @@ let noticeTypeList=ref([
]);
let notictTypeCheck = ref({});//选中类型
onHide(()=>{
searchShow.value=false;
})
// 搜索返回操作
const handleBack=()=>{

View File

@@ -213,7 +213,7 @@ onMounted(() => {
<style scoped>
.scroll-h{
/* #ifdef APP-PLUS */
height:calc(100vh - 30px) !important;
height:calc(100vh - 50px) !important;
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 30px) !important;

View File

@@ -5,7 +5,8 @@ page {
height: 100%;
padding: 0;
margin: 0;
background-color: #F5F5F5;
background-color: #307AF5;
/* background-color: #F5F5F5; */
color: #333;
}
@@ -19,26 +20,30 @@ page {
width: 100%;
margin: 0;
padding: 0;
background-color: #F5F5F5;
}
.con-bg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
/* #ifdef APP-PLUS */
background: url('@/static/images/bg-Blue.png') no-repeat;
background-size: 100vw 761rpx;
width: 100vw;
height: 761rpx;
background-color: #F5F5F5;
background-image: url('@/static/images/bg-Blue.png');
background-repeat: no-repeat;
background-size: 750rpx 761rpx;
width: 750rpx;
/* height: 761rpx; */
left: 0;
/* #endif */
/* #ifndef APP-PLUS */
background: url('@/static/images/bg-Blue.png') no-repeat;
background-color: #F5F5F5;
background-image: url('@/static/images/bg-Blue.png');
background-repeat: no-repeat;
background-size: 750rpx 761rpx;
width: 750rpx;
height: 761rpx;
/* height: 761rpx; */
left: 50%;
margin-left: -375rpx;
/* #endif */
@@ -187,7 +192,7 @@ page {
/* width:690rpx; */
width:630rpx;
height:56rpx;
margin:0 auto 30rpx;
margin:10rpx auto 30rpx;
padding:0 30rpx;
display: flex;
color:#fff;