1.修改背景图 2.修改文件显示样式

This commit is contained in:
yangzhq68909 2025-06-04 10:49:30 +08:00
parent ff49b8df0e
commit d5a8ed1d31
7 changed files with 47 additions and 22 deletions

View File

@ -18,12 +18,13 @@
<!-- 列表内容 --> <!-- 列表内容 -->
<view v-for="(item, i) in list" :key="i"> <view v-for="(item, i) in list" :key="i">
<wd-card :title="item.title" @click="getList(item.path)"> <wd-card :title="item.title" @click="getList(item.path)">
<view class="card-content"> <view class="card-content meta-info">
<view class="meta-info"> <view class="meta-info">
<wd-icon name="time" size="14px" color="#999"></wd-icon> <wd-icon name="time" size="14px" :style="{ color: item.color }"></wd-icon>
<text class="meta-text">{{item.time}}</text> <text :style="{ color: item.color, marginLeft: '4px' }">{{ item.time }}</text>
<wd-icon name="usergroup" size="14px" color="#999" style="margin-left: auto;"></wd-icon> <wd-icon name="usergroup" size="14px"
<text class="meta-text"> :style="{ color: item.color, marginLeft: 'auto'}"></wd-icon>
<text :style="{ color: item.color, marginLeft: '4px' }">
{{item.depart.length > 19 ? item.depart.substring(0, 18) + '...': item.depart}}</text> {{item.depart.length > 19 ? item.depart.substring(0, 18) + '...': item.depart}}</text>
</view> </view>
</view> </view>
@ -117,7 +118,11 @@
zdmc: formatSearchkey() zdmc: formatSearchkey()
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
list.value = [...list.value, ...formatObj(res.result.records, 'zdmc', 'updateTime2', 'zbbm', const recordsWithColor = res.result.records.map(item => ({
...item,
color: DateDiff(item.updateTime2) // updateTime2
}));
list.value = [...list.value, ...formatObj(recordsWithColor, 'zdmc', 'updateTime2', 'zbbm',
'sszd')] 'sszd')]
} }
loading = false loading = false
@ -151,7 +156,11 @@
flfgmc: formatSearchkey() flfgmc: formatSearchkey()
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
list.value = [...list.value, ...formatObj(res.result.records, 'flfgmc', 'updateTime2', const recordsWithColor = res.result.records.map(item => ({
...item,
color: DateDiff(item.updateTime2) // updateTime2
}));
list.value = [...list.value, ...formatObj(recordsWithColor, 'flfgmc', 'updateTime2',
'fabubumen', 'mingcheng')] 'fabubumen', 'mingcheng')]
} }
loading = false loading = false
@ -188,6 +197,21 @@
getList(1) getList(1)
} }
const DateDiff = (time) => {
var today = new Date();
time = new Date(time);
var days = parseInt((today - time) / 1000 / 60 / 60 / 24); //-
if (days < 90) { //
return '#ff0000'; // red
} else if (days > 90 && days < 180) {
return '#aa00ff'; // purple
} else if (days > 180 && days < 365) {
return '#00c861'; // green
} else {
return ''; // black
}
}
onReachBottom(() => { onReachBottom(() => {
if (loading) return if (loading) return
pageNo++ pageNo++
@ -238,11 +262,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
color: #666;
.meta-text {
margin-left: 4px;
}
} }
} }

View File

@ -9,7 +9,7 @@
</route> </route>
<template> <template>
<PageLayout :navbarShow="false"> <PageLayout :navbarShow="false">
<view class="nav" v-if="!isH5"> <view class="nav" >
<view class="nav_box"> <view class="nav_box">
<view class="weather_calender"> <view class="weather_calender">
<view class="position position-left"> <view class="position position-left">

View File

@ -127,6 +127,17 @@
uni.setStorageSync('logintime', Date.now()) // uni.setStorageSync('logintime', Date.now()) //
router.pushTab({ path: HOME_PAGE }) router.pushTab({ path: HOME_PAGE })
} else { } else {
res.message == '数据库中已存在该记录' ? res.message = '请使用统一身份账号登录' : res.message
if (!res.success) {
try {
// JSON message JSON
const response = JSON.parse(res.message);
if (response.error_description === '用户名或密码错误') {
res.message = '用户名或密码错误';
}
} catch (e) {
}
}
toast.warning(res.message) toast.warning(res.message)
} }
}) })

View File

@ -195,12 +195,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
// //
.avatar-area { .avatar-area {
/* #ifdef MP-WEIXIN */ background-image: url('@/static/backgroud.jpg');
background-image: url('https://static.jeecg.com/upload/test/blue_1595818030310.png');
/* #endif */
/* #ifndef MP-WEIXIN */
background-image: url('@/static/blue.png');
/* #endif */
background-size: cover; background-size: cover;
height: 400upx; height: 400upx;
display: flex; display: flex;

BIN
src/static/backgroud.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

View File

@ -323,7 +323,7 @@ export const getLocation = () => {
success: function (position) { success: function (position) {
// //
uni.request({ uni.request({
url: 'http://api.tianditu.gov.cn/geocoder', url: 'https://api.tianditu.gov.cn/geocoder',
method: 'GET', method: 'GET',
data: { data: {
postStr: JSON.stringify({ postStr: JSON.stringify({
@ -394,7 +394,7 @@ function handleDefaultLocation() {
function weatherRequest(params : { lat ?: number; lon ?: number; q ?: string }) { function weatherRequest(params : { lat ?: number; lon ?: number; q ?: string }) {
const store = useAppStore() const store = useAppStore()
uni.request({ uni.request({
url: 'http://api.openweathermap.org/data/2.5/weather', url: 'https://api.openweathermap.org/data/2.5/weather',
method: 'GET', method: 'GET',
data: { data: {
...params, ...params,
@ -437,7 +437,7 @@ export const imgUrl = (url : string) => {
* @returns {*} * @returns {*}
*/ */
export function getFileAccessHttpUrl(avatar, subStr) { export function getFileAccessHttpUrl(avatar, subStr) {
if (!subStr) subStr = 'http' if (!subStr) subStr = 'https'
if (avatar && avatar.startsWith(subStr)) { if (avatar && avatar.startsWith(subStr)) {
return avatar; return avatar;
} else { } else {