26 changed files with 751 additions and 140 deletions
@ -0,0 +1,211 @@ |
|||
<template> |
|||
<!-- <u-navbar title="办年报" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar> --> |
|||
<view class="container"> |
|||
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" |
|||
placeholder-color="#A9D4FF" v-model="keyword" search-icon="/static/img/search.png" search-icon-size="14" |
|||
:show-action="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bg-color="#FFFFFF"></u-search> |
|||
<view class="main"> |
|||
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore"> |
|||
<view class="wkbox"> |
|||
<view class="wkone" v-for="(item, index) in rightData" :key="index"> |
|||
<view class="tittt"> |
|||
{{item.title}} |
|||
</view> |
|||
<view class="xzs"> |
|||
下载人数 |
|||
<view class="num"> |
|||
{{item.download_num}} |
|||
</view> |
|||
</view> |
|||
<view class="ljxz" @click="downwk(item.id,baseurl+item.filepath)"> |
|||
立即下载 |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { |
|||
ref |
|||
} from 'vue' |
|||
import { |
|||
enterpriseList |
|||
} from '@/api/shop' |
|||
|
|||
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') |
|||
|
|||
// 响应式数据 |
|||
const keyword = ref('') |
|||
const page = ref(1) |
|||
const pagesize = ref(11) |
|||
|
|||
const search = async (val) => { |
|||
page.value = 1 |
|||
pagesize.value = 11 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const clickIcon = async () => { |
|||
page.value = 1 |
|||
pagesize.value = 11 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const clear = async () => { |
|||
page.value = 1 |
|||
pagesize.value = 11 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const rightData = ref([]) |
|||
|
|||
const godetail = (item) => { |
|||
uni.navigateTo({ |
|||
url: '/pages/index/bnbdetail?id=' + item.id |
|||
}) |
|||
} |
|||
|
|||
const getfinanceList = async (name, page, limit) => { |
|||
let params = { |
|||
category_id: 2, |
|||
title: name, |
|||
page: page, |
|||
limit: limit |
|||
} |
|||
await enterpriseList(params).then((res) => { |
|||
rightData.value = res.data.data |
|||
}) |
|||
} |
|||
|
|||
const onloadmore = async () => { |
|||
page.value++ |
|||
let params = { |
|||
category_id: 2, |
|||
title: keyword.value, |
|||
page: page.value, |
|||
limit: pagesize.value |
|||
} |
|||
await enterpriseList(params).then((res) => { |
|||
rightData.value = [...rightData.value, ...res.data.data] |
|||
}) |
|||
} |
|||
|
|||
const downwk = (id,url) => { |
|||
uni.showLoading({ title: '下载中...' }); |
|||
uni.downloadFile({ |
|||
url, |
|||
success: (res) => { |
|||
if (res.statusCode === 200) { |
|||
// 保存到本地 |
|||
uni.saveFile({ |
|||
tempFilePath: res.tempFilePath, |
|||
success: (saveRes) => { |
|||
uni.hideLoading(); |
|||
uni.showToast({ title: '下载成功', icon: 'success' }); |
|||
openDocument(saveRes.savedFilePath); |
|||
contractDownload(id) |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
fail: (err) => { |
|||
uni.hideLoading(); |
|||
uni.showToast({ title: '下载失败', icon: 'none' }); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
onShow(async () => { |
|||
await getfinanceList('', 1, 11) |
|||
}) |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.container { |
|||
background: linear-gradient(0deg, #f1f3f9 72%, rgba(129, 179, 222, 0.5) 88%); |
|||
height: 100vh; |
|||
width: 100%; |
|||
overflow-y: hidden; |
|||
|
|||
.hyonne { |
|||
max-height: calc(100vh - 154rpx); |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.main { |
|||
margin-top: 10rpx; |
|||
width: 100%; |
|||
height: 100%; |
|||
padding: 0 24rpx; |
|||
box-sizing: border-box; |
|||
overflow-y: hidden; |
|||
|
|||
.wkbox { |
|||
display: grid; |
|||
grid-template-columns: repeat(2, 1fr); |
|||
gap: 20rpx; |
|||
width: 100%; |
|||
background-color: #FFFFFF; |
|||
padding: 15px 12px; |
|||
box-sizing: border-box; |
|||
|
|||
.wkone { |
|||
background: #F1F3F9; |
|||
border-radius: 20rpx; |
|||
padding: 32rpx 24rpx 20rpx 24rpx; |
|||
box-sizing: border-box; |
|||
|
|||
.tittt { |
|||
font-family: Source Han Sans; |
|||
font-size: 28rpx; |
|||
color: #444444; |
|||
display: -webkit-box; |
|||
-webkit-box-orient: vertical; |
|||
-webkit-line-clamp: 1; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.xzs { |
|||
margin-top: 70rpx; |
|||
font-size: 19.4rpx; |
|||
color: #B0B0B5; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
.num { |
|||
margin-left: 6rpx; |
|||
font-size: 19.4rpx; |
|||
color: #2563EB |
|||
} |
|||
} |
|||
|
|||
.ljxz { |
|||
margin-top: 24rpx; |
|||
padding: 8rpx 40rpx; |
|||
box-sizing: border-box; |
|||
border-radius: 40rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); |
|||
font-size: 20rpx; |
|||
color: #FFFFFF; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.hdzq { |
|||
width: 212rpx; |
|||
height: 86rpx; |
|||
position: fixed; |
|||
right: 0; |
|||
top: 70%; |
|||
margin-right: -14rpx; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,159 @@ |
|||
<template> |
|||
<!-- <u-navbar title="办年报" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar> --> |
|||
<view class="container"> |
|||
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" |
|||
placeholder-color="#A9D4FF" v-model="keyword" search-icon="/static/img/search.png" search-icon-size="14" |
|||
:show-action="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bg-color="#FFFFFF"></u-search> |
|||
<view class="main"> |
|||
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore"> |
|||
<view class="ztone" v-for="(item, index) in ztList" :key="index" @click="godetail(item.id)"> |
|||
<image style="width: 80rpx; height: 80rpx; flex: 1;border-radius: 16rpx;" |
|||
:src="baseurl+item.head_pic" mode="widthFix"></image> |
|||
<view class="rightpart"> |
|||
<view class="splace"> |
|||
{{ item.name }} |
|||
</view> |
|||
<text class="title">{{ item.enterprise }}</text> |
|||
</view> |
|||
<image style="width: 32rpx; height: 44rpx" src="@/static/img/Icon.png" mode="aspectFill"></image> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { |
|||
ref |
|||
} from 'vue' |
|||
import { |
|||
enterpriseList |
|||
} from '@/api/shop' |
|||
|
|||
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') |
|||
|
|||
// 响应式数据 |
|||
const keyword = ref('') |
|||
const page = ref(1) |
|||
const pagesize = ref(6) |
|||
|
|||
const search = async (val) => { |
|||
page.value = 1 |
|||
pagesize.value = 6 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const clickIcon = async () => { |
|||
page.value = 1 |
|||
pagesize.value = 6 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const clear = async () => { |
|||
page.value = 1 |
|||
pagesize.value = 6 |
|||
await getfinanceList(keyword.value, page.value, pagesize.value) |
|||
} |
|||
|
|||
const ztList = ref([]) |
|||
|
|||
|
|||
const getfinanceList = async (name, page, limit) => { |
|||
let params = { |
|||
category_id: 1, |
|||
title: name, |
|||
page: page, |
|||
limit: limit |
|||
} |
|||
await enterpriseList(params).then((res) => { |
|||
ztList.value = res.data.data |
|||
}) |
|||
} |
|||
|
|||
const onloadmore = async () => { |
|||
page.value++ |
|||
let params = { |
|||
title: keyword.value, |
|||
page: page.value, |
|||
limit: pagesize.value |
|||
} |
|||
await financeList(params).then((res) => { |
|||
ztList.value = [...ztList.value, ...res.data.data] |
|||
}) |
|||
} |
|||
|
|||
const godetail = (id) => { |
|||
uni.navigateTo({ |
|||
url: '/pages/index/shoppage/qyDetail?id=' + id + '¤t=' + 1 |
|||
}) |
|||
} |
|||
|
|||
onShow(async () => { |
|||
await getfinanceList('', 1, 6) |
|||
}) |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.container { |
|||
background: linear-gradient(0deg, #f1f3f9 72%, rgba(129, 179, 222, 0.5) 88%); |
|||
height: 100vh; |
|||
width: 100%; |
|||
overflow-y: hidden; |
|||
|
|||
.hyonne { |
|||
max-height: calc(100vh - 154rpx); |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.main { |
|||
margin-top: 10rpx; |
|||
width: 100%; |
|||
height: 100%; |
|||
padding: 0 24rpx; |
|||
box-sizing: border-box; |
|||
overflow-y: hidden; |
|||
|
|||
.ztone { |
|||
display: flex; |
|||
align-items: center; |
|||
width: 100%; |
|||
padding: 20rpx; |
|||
border-radius: 8rpx; |
|||
background: #ffffff; |
|||
box-sizing: border-box; |
|||
border: 2rpx solid #F1F3F9; |
|||
|
|||
.rightpart { |
|||
width: 100%; |
|||
margin-left: 20rpx; |
|||
flex: 3; |
|||
display: grid; |
|||
align-content: space-between; |
|||
|
|||
.splace { |
|||
font-family: Source Han Sans; |
|||
font-size: 20rpx; |
|||
font-weight: 600; |
|||
color: #0C092A; |
|||
} |
|||
|
|||
.title { |
|||
margin-top: 20rpx; |
|||
font-family: Source Han Sans; |
|||
font-size: 20rpx; |
|||
color: #666666; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.hdzq { |
|||
width: 212rpx; |
|||
height: 86rpx; |
|||
position: fixed; |
|||
right: 0; |
|||
top: 70%; |
|||
margin-right: -14rpx; |
|||
} |
|||
</style> |
|||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 979 B |
Loading…
Reference in new issue