Browse Source

页面优化

master
DX 17 hours ago
parent
commit
b6f9276ef2
  1. 4
      config.js
  2. 3
      pages/enterprise.vue
  3. 44
      pages/index.vue
  4. 3
      pages/login.vue
  5. 2
      pages/owner.vue
  6. 3
      pages/task.vue
  7. 2
      sub/chat/index.vue
  8. 4
      sub/owner/edit.vue
  9. 203
      sub/owner/message.vue

4
config.js

@ -2,8 +2,8 @@
module.exports = {
// baseUrl: 'http://188.188.5.188:48080',
// baseUrl: 'https://www.jzce.com',
baseUrl: 'https://yxsthj.cn',
// baseUrl: 'http://188.188.3.232:48080',
// baseUrl: 'https://yxsthj.cn',
baseUrl: 'http://188.188.3.232:48080',
// baseUrl: 'http://localhost:48080',
baseApi: '/admin-api',
// 应用信息

3
pages/enterprise.vue

@ -120,6 +120,7 @@
待审核
</view>
</view>
<cs-emty v-if="list.length == 0"></cs-emty>
<u-loadmore
:status="load"
marginTop="12"
@ -127,7 +128,7 @@
v-if="load !== 'nomore' && list.length > 0"
/>
<view style="height: 96rpx; width: 100%" v-else></view>
<cs-emty v-if="list.length == 0"></cs-emty>
</scroll-view>
</view>
</cs-page>

44
pages/index.vue

@ -168,6 +168,7 @@
</view>
</view>
<view style="min-height: 440rpx">
<cs-emty marginTop="0" v-if="list.length == 0" height="400rpx"></cs-emty>
<view
v-for="(item, index) in list"
:key="index"
@ -284,26 +285,29 @@ export default {
this.queryParams.region = this.dropOption.area[0].value
},
async init() {
const res = await HomeApi.getPieData(this.queryParams)
this.detail = res.data
let curIndex = 0
const colorMap = []
const data = this.detail.completionRate.map((item, index) => {
const color = this.getGradientColor(
index,
this.detail.completionRate.length
)
const res = {
...item,
color
}
colorMap.push(color)
return res
})
this.color = [...colorMap, '#F9F9F9']
this.detail.legendData = data
this.setPieData(data, this.detail.taskCompletionRate)
this.getList()
if (this.queryParams.region) {
const res = await HomeApi.getPieData(this.queryParams)
this.detail = res.data
let curIndex = 0
const colorMap = []
const data = this.detail.completionRate.map((item, index) => {
const color = this.getGradientColor(
index,
this.detail.completionRate.length
)
const res = {
...item,
color
}
colorMap.push(color)
return res
})
this.color = [...colorMap, '#F9F9F9']
this.detail.legendData = data
this.setPieData(data, this.detail.taskCompletionRate)
this.getList()
}
},
async getList() {
const res = await HomeApi.getListData(this.queryParams)

3
pages/login.vue

@ -114,9 +114,10 @@ export default {
})
return
}
uni.switchTab({
url: '/pages/index'
url: '/pages/owner'
})
}
}

2
pages/owner.vue

@ -49,7 +49,7 @@
<u-icon name="arrow-right"></u-icon>
</view> -->
<view class="row">
<view class="notice-wrapper">
<view class="notice-wrapper" v-if="noticeTotal > 0">
<u-count-to
:startVal="0"
:endVal="policyTotal"

3
pages/task.vue

@ -129,6 +129,8 @@
></cs-dict-tag>
</view>
</view>
<cs-emty marginTop="24" v-if="list.length == 0"></cs-emty>
<u-loadmore
:status="load"
marginTop="12"
@ -136,7 +138,6 @@
v-if="load !== 'nomore'"
/>
<view style="height: 96rpx; width: 100%" v-else></view>
<cs-emty marginTop="24" v-if="list.length == 0"></cs-emty>
</scroll-view>
</view>
</cs-page>

2
sub/chat/index.vue

@ -1,5 +1,5 @@
<template>
<web-view src="https://mb.jzce.com/chat/313cf9e35628923a"></web-view>
<web-view src="https://yxsthj.cn/chat/313cf9e35628923a"></web-view>
<!-- <web-view src="https://chat.deepseek.com/"></web-view> -->
</template>

4
sub/owner/edit.vue

@ -303,8 +303,8 @@ export default {
border-radius: 30px;
font-size: 32rpx;
font-weight: bold;
height: 40px;
line-height: 40px;
height: 96rpx;
line-height: 96rpx;
box-sizing: border-box;
}
.submit {

203
sub/owner/message.vue

@ -0,0 +1,203 @@
<template>
<!-- 政策法规列表页面容器 -->
<view class="policy-container">
<!-- 搜索框区域 -->
<view class="search-box">
<van-search
:value="abc"
placeholder="输入关键字查询"
@search="handleSearch"
id="sreach"
@clear="handleClear"
/>
</view>
<!-- 政策法规列表区域 -->
<!-- 修改列表项部分 -->
<view class="policy-list">
<view
class="policy-item"
v-for="item in policyList"
:key="item.id"
@click="handlePolicyClick(item)"
>
<view class="item-left">
<image :src="itemImgUrl" class="policy-icon"></image>
</view>
<view class="item-right">
<view class="policy-title">{{ item.title }}</view>
<view class="policy-time">生效时间: {{ item.effectiveDate }}</view>
</view>
</view>
</view>
<!-- 加载更多状态组件 -->
<uni-load-more :status="loadMoreStatus" />
</view>
</template>
<script>
import { PolicyApi, formatPolicyContext } from '@/api/policy/index.js'
import { formatDate } from '@/utils/ruoyi.js'
import config from '@/config'
export default {
data() {
return {
searchValue: '', //
abc: '',
policyList: [], //
pageNum: 1, //
pageSize: 10, //
total: 0, //
loadMoreStatus: 'more' ,// more- loading- noMore-
itemImgUrl: config.imgUrl + '/miniohb/c103c92335bdd30d33ff8a062c219ead0626bf0a1898536bd7590285ca11c9db.png'
}
},
//
onShow() {
console.log(this.itemImgUrl)
this.getPolicyList()
},
//
onReachBottom() {
if (this.policyList.length < this.total) {
this.pageNum++
this.getPolicyList()
}
},
methods: {
//
async getPolicyList() {
try {
console.log('PolicyApi',this.searchValue)
this.loadMoreStatus = 'loading'
const res = await PolicyApi.getPolicyPage({
pageNum: this.pageNum,
pageSize: this.pageSize,
name: this.searchValue //
})
if (res.code === 0 && res.data.total > 0) {
//
const formattedData = res.data.list.map(item => ({
...item,
title: item.name.length > 15 ? item.name.slice(0, 15) + '...' : item.name,
effectiveDate: formatDate(item.effectiveDate,'YYYY年MM月DD日')
}))
//
if (this.pageNum === 1) {
this.policyList = formattedData
} else {
this.policyList = [...this.policyList, ...formattedData]
}
this.total = res.total
//
this.loadMoreStatus = this.policyList.length >= this.total ? 'noMore' : 'more'
}
} catch (error) {
console.error(error)
this.loadMoreStatus = 'more'
uni.showToast({
title: '获取列表失败',
icon: 'none'
})
}
},
//
handleSearch(e) {
this.pageNum = 1 //
this.searchValue = e.detail //
this.getPolicyList()
},
//
handleClear() {
this.pageNum = 1 //
this.searchValue = '' //
this.getPolicyList()
},
//
handlePolicyClick(item) {
uni.navigateTo({
url: `/sub/owner/policy-detail?id=${item.id}`
})
}
}
}
</script>
<style lang="scss">
.policy-container {
background: var(--LightMode-Secondary-Secondary, #F9F9F9);
min-height: 100vh;
.search-box {
padding: 20rpx;
background: #fff;
}
.policy-list {
display: flex;
flex-direction: column;
align-items: flex-start;
background: var(--LightMode-Secondary-Secondary, #F9F9F9);
.policy-item {
display: flex;
padding: var(--Number-12px, 12px);
align-items: center;
gap: var(--Number-12px, 12px);
align-self: stretch;
border-radius: var(--Number-8px, 8px);
border-bottom: 1px solid var(--LightMode-Grey-Grey-100, #F9F9F9);
background: var(--LightMode-Light-Light, #FFF);
margin-top: 12px;
margin-left: 12px;
margin-right: 12px;
margin-bottom: 0px;
.item-left {
margin-right: 20rpx;
border-radius: 100px;
background: var(--LightMode-Grey-Grey-100, #F9F9F9);
display: flex;
padding: 8px;
justify-content: center;
align-items: center;
gap: 8px;
.policy-icon {
display: flex;
width: 20px;
height: 20px;
justify-content: center;
align-items: center;
aspect-ratio: 1/1;
}
}
.item-right {
flex: 1;
.policy-title {
font-size: 28rpx;
color: #333;
margin-bottom: 10rpx;
}
.policy-time {
font-size: 24rpx;
color: #999;
}
}
}
}
}
</style>
Loading…
Cancel
Save