Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
f6ee7c68
提交
f6ee7c68
authored
11月 27, 2025
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复错误使用 img 标签渲染图片引起 APP 打包后图片无法显示的问题
上级
f4f824b0
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
108 行增加
和
108 行删除
+108
-108
chanxiao.vue
src/pages/chanxiao/chanxiao.vue
+3
-3
detail.vue
src/pages/knowledgeVideo/detail.vue
+1
-1
index.vue
src/pages/knowledgeVideo/index.vue
+1
-1
index.vue
src/pages/mine/index.vue
+1
-1
detail.vue
src/pages/news/detail.vue
+45
-45
index.vue
src/pages/news/index.vue
+56
-56
shouye.vue
src/pages/shouye/shouye.vue
+1
-1
没有找到文件。
src/pages/chanxiao/chanxiao.vue
浏览文件 @
f6ee7c68
...
@@ -274,13 +274,13 @@
...
@@ -274,13 +274,13 @@
@click="Navigate.to(channel.link)"
@click="Navigate.to(channel.link)"
>
>
<view
class=
"channel-list-left"
>
<view
class=
"channel-list-left"
>
<im
g
class=
"channel-imgLeft"
:src=
"channel.iconLeft"
/>
<im
age
class=
"channel-imgLeft"
:src=
"channel.iconLeft"
/>
</view>
</view>
<view
class=
"channel-list-center"
>
<view
class=
"channel-list-center"
>
<im
g
<im
age
class=
"channel-imgCenter"
class=
"channel-imgCenter"
:style=
"
:style=
"
channel.icon.indexOf('
菜鲜宜
') > 0 ? 'width: 100rpx; height: 40rpx' : ''
channel.icon.indexOf('
caixianyi
') > 0 ? 'width: 100rpx; height: 40rpx' : ''
"
"
:src=
"channel.icon"
:src=
"channel.icon"
/>
/>
...
...
src/pages/knowledgeVideo/detail.vue
浏览文件 @
f6ee7c68
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
!
isNull
(
detail
)
?
'时间: '
+
dayjs
(
detail
?.
publishDate
).
format
(
'YYYY年MM月DD日'
)
:
''
!
isNull
(
detail
)
?
'时间: '
+
dayjs
(
detail
?.
publishDate
).
format
(
'YYYY年MM月DD日'
)
:
''
}}
</text>
}}
</text>
<view
class=
"mr-1"
>
<view
class=
"mr-1"
>
<im
g
v-show=
"detail?.viewCount"
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<im
age
v-show=
"detail?.viewCount"
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<text>
{{
detail
?.
viewCount
}}
</text>
<text>
{{
detail
?.
viewCount
}}
</text>
</view>
</view>
</view>
</view>
...
...
src/pages/knowledgeVideo/index.vue
浏览文件 @
f6ee7c68
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<view
class=
"text-25 mt-1 mb-2"
>
{{
item
.
title
}}
</view>
<view
class=
"text-25 mt-1 mb-2"
>
{{
item
.
title
}}
</view>
<view
class=
"flex justify-between text-25 color-#686868"
>
<view
class=
"flex justify-between text-25 color-#686868"
>
<view
class=
"mr-1"
>
<view
class=
"mr-1"
>
<im
g
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<im
age
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<text>
{{
item
.
viewCount
}}
</text>
<text>
{{
item
.
viewCount
}}
</text>
</view>
</view>
<text>
{{
dayjs
(
item
.
publishDate
).
format
(
'MM-DD'
)
}}
</text>
<text>
{{
dayjs
(
item
.
publishDate
).
format
(
'MM-DD'
)
}}
</text>
...
...
src/pages/mine/index.vue
浏览文件 @
f6ee7c68
...
@@ -235,7 +235,7 @@
...
@@ -235,7 +235,7 @@
<view
class=
"px-6 pt-4"
>
<view
class=
"px-6 pt-4"
>
<view
class=
"w-full h-130rpx pl-3 border-rd-lg bg-#fff flex justify-between items-center"
>
<view
class=
"w-full h-130rpx pl-3 border-rd-lg bg-#fff flex justify-between items-center"
>
<view
class=
"w-40% flex flex-row"
>
<view
class=
"w-40% flex flex-row"
>
<im
g
src=
"/static/images/codefun/shield.png
"
/>
<im
age
src=
"/static/images/codefun/shield.png"
class=
"w-100 h-100
"
/>
<view
class=
"color-#FFAA1E text-50 line-height-loose"
>
726
</view>
<view
class=
"color-#FFAA1E text-50 line-height-loose"
>
726
</view>
</view>
</view>
<view
class=
"w-60%"
>
<view
class=
"w-60%"
>
...
...
src/pages/news/detail.vue
浏览文件 @
f6ee7c68
<
template
>
<view
class=
"p-3"
style=
"font-family: '思源黑体'; font-weight: 400"
>
<view
class=
"flex flex-col justify-between mt-1 mb-6"
>
<view
class=
"text-35 color-#333333 text-center mb-3"
>
{{
detail
?.
title
}}
</view>
<view
class=
"flex flex-col text-25 color-#686868"
>
<view
class=
"flex flex-row justify-between"
>
<text>
{{
detail
?.
editor
}}
</text>
<text
class=
"ml-5"
>
{{
detail
?.
source
}}
</text>
</view>
<view
class=
"flex flex-row justify-between"
>
<text>
{{
!
isNull
(
detail
)
?
'时间: '
+
dayjs
(
detail
?.
publishDate
).
format
(
'YYYY年MM月DD日'
)
:
''
}}
</text>
<view
class=
"mr-1"
>
<img
v-show=
"detail?.viewCount"
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<text>
{{
detail
?.
viewCount
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"w-full text-28"
>
<view
v-for=
"(content, index) in detail?.contentBlocks"
:key=
"index"
class=
"mb-1"
>
<view
v-show=
"content.type === 'VIDEO'"
>
<video
class=
"w-full"
:src=
"content.url ? content.url : ''"
controls
/>
</view>
<view
v-show=
"content.type === 'PARAGRAPH'"
style=
"text-indent: 2rem"
>
<text>
{{
content
.
content
}}
</text>
</view>
<view
v-show=
"content.type === 'IMAGE'"
>
<img
class=
"w-full"
:src=
"content.url ? content.url : ''"
/>
<text
v-show=
"content.caption"
class=
"w-full text-25 color-#686868 text-center"
style=
"display: inline-block"
>
{{
content
.
caption
}}
</text
>
</view>
</view>
</view>
</view>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
dayjs
from
'dayjs'
import
*
as
newsApi
from
'@/api/model/news'
import
*
as
newsApi
from
'@/api/model/news'
import
{
isNull
}
from
'@/utils/is'
import
{
isNull
}
from
'@/utils/is'
import
dayjs
from
'dayjs'
interface
Detail
{
interface
Detail
{
id
:
number
id
:
number
...
@@ -64,14 +22,14 @@
...
@@ -64,14 +22,14 @@
const
detail
=
ref
<
Detail
|
null
>
(
null
)
const
detail
=
ref
<
Detail
|
null
>
(
null
)
const
getInfo
=
async
(
id
:
string
)
=>
{
async
function
getInfo
(
id
:
string
)
{
await
newsApi
.
getDetail
({
id
}).
then
((
res
)
=>
{
await
newsApi
.
getDetail
({
id
}).
then
((
res
)
=>
{
detail
.
value
=
res
detail
.
value
=
res
addViewCount
(
id
)
addViewCount
(
id
)
})
})
}
}
const
addViewCount
=
async
(
id
:
string
)
=>
{
async
function
addViewCount
(
id
:
string
)
{
newsApi
.
addViewCount
({
id
})
newsApi
.
addViewCount
({
id
})
}
}
...
@@ -79,3 +37,45 @@
...
@@ -79,3 +37,45 @@
await
getInfo
(
options
.
id
)
await
getInfo
(
options
.
id
)
})
})
</
script
>
</
script
>
<
template
>
<view
class=
"p-3"
style=
"font-family: '思源黑体'; font-weight: 400"
>
<view
class=
"flex flex-col justify-between mt-1 mb-6"
>
<view
class=
"text-35 color-#333333 text-center mb-3"
>
{{
detail
?.
title
}}
</view>
<view
class=
"flex flex-col text-25 color-#686868"
>
<view
class=
"flex flex-row justify-between"
>
<text>
{{
detail
?.
editor
}}
</text>
<text
class=
"ml-5"
>
{{
detail
?.
source
}}
</text>
</view>
<view
class=
"flex flex-row justify-between"
>
<text>
{{
!
isNull
(
detail
)
?
`时间: ${dayjs(detail?.publishDate).format('YYYY年MM月DD日')
}
`
:
''
}}
<
/text
>
<
view
class
=
"mr-1 flex-center"
>
<
image
v
-
show
=
"detail?.viewCount"
class
=
"mr-1 w-30 h-26"
src
=
"/static/images/news/views.png"
/>
<
text
>
{{
detail
?.
viewCount
}}
<
/text
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
view
class
=
"w-full text-28"
>
<
view
v
-
for
=
"(content, index) in detail?.contentBlocks"
:
key
=
"index"
class
=
"mb-1"
>
<
view
v
-
show
=
"content.type === 'VIDEO'"
>
<
video
class
=
"w-full"
:
src
=
"content.url ? content.url : ''"
controls
><
/video
>
<
/view
>
<
view
v
-
show
=
"content.type === 'PARAGRAPH'"
style
=
"text-indent: 2rem"
>
<
text
>
{{
content
.
content
}}
<
/text
>
<
/view
>
<
view
v
-
show
=
"content.type === 'IMAGE'"
>
<
image
class
=
"w-full"
:
src
=
"content.url ? content.url : ''"
/>
<
text
v
-
show
=
"content.caption"
class
=
"w-full text-25 color-#686868 text-center"
style
=
"display: inline-block"
>
{{
content
.
caption
}}
<
/tex
t
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/template
>
src/pages/news/index.vue
浏览文件 @
f6ee7c68
<
template
>
<view
class=
"w-full h-95vh p-2 bg-#E6F5E8"
>
<!--
<view
class=
"tag-box"
>
<view
class=
"tag"
:class=
"infoType === 0 ? 'active' : ''"
@
click=
"switchNavigate(0)"
>
<img
:src=
"infoType === 0 ? '/static/images/news/news-active.png' : '/static/images/news/news.png'"
/>
热点新闻
</view>
<view
class=
"tag"
:class=
"infoType === 1 ? 'active' : ''"
@
click=
"switchNavigate(1)"
>
<img
:src=
"infoType === 1 ? '/static/images/news/policy-active.png' : '/static/images/news/policy.png'"
/>
农业政策
</view>
</view>
-->
<!-- 列表 -->
<scroll-view
class=
"w-full h-full"
style=
"font-family: '思源黑体'; font-weight: 400"
scroll-y
@
scrolltolower=
"getNewsList(model.params)"
:show-scrollbar=
"false"
>
<view
v-for=
"news in newsList"
:key=
"news.id"
class=
"w-full flex flex-row justify-around p-2 bg-#fff border-rd-lg mb-2 h-150"
@
click=
"toNewsDetail(news)"
>
<view
class=
"flex flex-col justify-between"
:class=
"news.image ? 'w-70%' : 'w-full'"
>
<view
class=
"text-28 color-#333333"
>
{{
news
.
title
}}
</view>
<view
class=
"flex flex-row justify-between text-25 color-#686868"
>
<text>
{{
news
.
publishDate
}}
</text>
<view
class=
"mr-1"
>
<img
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<text>
{{
news
.
viewCount
}}
</text>
</view>
</view>
</view>
<view
v-show=
"news.image"
class=
"w-30% h-full"
>
<img
class=
"w-full h-full border-rd"
:src=
"news.image"
/>
</view>
</view>
<!-- 加载状态 -->
<view
class=
"loading-status"
>
<text
v-if=
"model.loading"
>
加载中...
</text>
<text
v-else-if=
"!model.hasMore"
>
没有更多数据了
</text>
<text
v-else
>
上拉加载更多
</text>
</view>
</scroll-view>
</view>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
reactive
,
ref
}
from
'vue'
import
{
reactive
,
ref
}
from
'vue'
import
*
as
NewsApi
from
'@/api/model/news'
import
*
as
NewsApi
from
'@/api/model/news'
...
@@ -82,7 +32,7 @@
...
@@ -82,7 +32,7 @@
const
infoType
=
ref
(
0
)
const
infoType
=
ref
(
0
)
const
navigateName
=
ref
([
'热点新闻'
,
'农业政策'
])
const
navigateName
=
ref
([
'热点新闻'
,
'农业政策'
])
const
getNewsList
=
async
(
params
)
=>
{
async
function
getNewsList
(
params
)
{
if
(
model
.
loading
)
return
if
(
model
.
loading
)
return
model
.
loading
=
true
model
.
loading
=
true
NewsApi
.
getList
(
params
).
then
((
res
)
=>
{
NewsApi
.
getList
(
params
).
then
((
res
)
=>
{
...
@@ -102,22 +52,22 @@
...
@@ -102,22 +52,22 @@
})
})
model
.
loading
=
false
model
.
loading
=
false
}
}
const
getPolicyList
=
async
()
=>
{}
async
function
getPolicyList
()
{}
const
switchNavigate
=
(
type
:
number
)
=>
{
function
switchNavigate
(
type
:
number
)
{
infoType
.
value
=
type
infoType
.
value
=
type
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
navigateName
.
value
[
type
],
title
:
navigateName
.
value
[
type
],
})
})
}
}
const
toNewsDetail
=
(
news
)
=>
{
function
toNewsDetail
(
news
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/news/detail?id='
+
news
.
id
,
url
:
`/pages/news/detail?id=
${
news
.
id
}
`
,
})
})
}
}
const
resetData
=
()
=>
{
function
resetData
()
{
model
.
params
.
pageNo
=
1
model
.
params
.
pageNo
=
1
model
.
hasMore
=
true
model
.
hasMore
=
true
model
.
loading
=
false
model
.
loading
=
false
...
@@ -143,6 +93,56 @@
...
@@ -143,6 +93,56 @@
})
})
</
script
>
</
script
>
<
template
>
<view
class=
"w-full h-95vh p-2 bg-#E6F5E8"
>
<!--
<view
class=
"tag-box"
>
<view
class=
"tag"
:class=
"infoType === 0 ? 'active' : ''"
@
click=
"switchNavigate(0)"
>
<image
:src=
"infoType === 0 ? '/static/images/news/news-active.png' : '/static/images/news/news.png'"
/>
热点新闻
</view>
<view
class=
"tag"
:class=
"infoType === 1 ? 'active' : ''"
@
click=
"switchNavigate(1)"
>
<image
:src=
"infoType === 1 ? '/static/images/news/policy-active.png' : '/static/images/news/policy.png'"
/>
农业政策
</view>
</view>
-->
<!-- 列表 -->
<scroll-view
class=
"w-full h-full"
style=
"font-family: '思源黑体'; font-weight: 400"
scroll-y
@
scrolltolower=
"getNewsList(model.params)"
:show-scrollbar=
"false"
>
<view
v-for=
"news in newsList"
:key=
"news.id"
class=
"w-full flex flex-row justify-around p-2 bg-#fff border-rd-lg mb-2 h-150"
@
click=
"toNewsDetail(news)"
>
<view
class=
"flex flex-col justify-between"
:class=
"news.image ? 'w-70%' : 'w-full'"
>
<view
class=
"text-28 color-#333333"
>
{{
news
.
title
}}
</view>
<view
class=
"flex flex-row justify-between text-25 color-#686868"
>
<text>
{{
news
.
publishDate
}}
</text>
<view
class=
"mr-1"
>
<image
class=
"mr-1"
src=
"/static/images/news/views.png"
/>
<text>
{{
news
.
viewCount
}}
</text>
</view>
</view>
</view>
<view
v-show=
"news.image"
class=
"w-30% h-full"
>
<image
class=
"w-full h-full border-rd"
:src=
"news.image"
/>
</view>
</view>
<!-- 加载状态 -->
<view
class=
"loading-status"
>
<text
v-if=
"model.loading"
>
加载中...
</text>
<text
v-else-if=
"!model.hasMore"
>
没有更多数据了
</text>
<text
v-else
>
上拉加载更多
</text>
</view>
</scroll-view>
</view>
</
template
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.tag-box
{
.tag-box
{
display
:
flex
;
display
:
flex
;
...
...
src/pages/shouye/shouye.vue
浏览文件 @
f6ee7c68
...
@@ -716,7 +716,7 @@
...
@@ -716,7 +716,7 @@
}}
</view>
}}
</view>
</view>
</view>
<view
v-show=
"news.image"
class=
"w-30% h-150"
>
<view
v-show=
"news.image"
class=
"w-30% h-150"
>
<im
g
class=
"w-full h-full border-rd"
:src=
"news.image"
/>
<im
age
class=
"w-full h-full border-rd"
:src=
"news.image"
/>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论