Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
e70e0280
提交
e70e0280
authored
11月 07, 2025
作者:
宇宙超人
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' of
https://gitee.com/mrf/agri-app
上级
2a77a7b1
e266b465
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
142 行增加
和
46 行删除
+142
-46
register.vue
src/pages/login/register.vue
+0
-3
nongchang.vue
src/pages/nongchang/nongchang.vue
+78
-11
shouye.vue
src/pages/shouye/shouye.vue
+63
-31
proxy.ts
src/utils/proxy.ts
+1
-1
没有找到文件。
src/pages/login/register.vue
浏览文件 @
e70e0280
<
script
setup
lang=
"ts"
>
// import { PUSH_CLIENT_KEY } from '/@/enums/cacheEnum'
import
{
useUserStore
}
from
'@/store/modules/user'
import
*
as
API
from
'/@/api/model/userInfo'
const
userStore
=
useUserStore
()
onShow
(
async
()
=>
{})
// 页面数据
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
e70e0280
...
...
@@ -5,7 +5,9 @@
import
*
as
HomeAPI
from
'@/api/model/home'
import
*
as
NongChangAPI
from
'@/api/model/nongchang'
import
{
useUserStore
}
from
'@/store/modules/user'
const
userStore
=
useUserStore
()
onShow
(()
=>
{
// 获取金刚区菜单数据
getZoomList
()
...
...
@@ -17,6 +19,7 @@
getCommonToolsList
()
// 农技课堂
getAgricultureClassList
()
pageData
.
userInfo
=
userStore
.
getUserInfo
})
// 下拉刷新
...
...
@@ -214,6 +217,10 @@
videoList
:
[],
},
current
:
0
,
// 信用分
userInfo
:
{
creditScore
:
0
,
},
})
function
getZoomList
()
{
...
...
@@ -270,7 +277,10 @@
// 菜单点击事件
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
// 在这里添加具体的菜单点击逻辑
// 在这里添加具体的菜单点击逻辑+
uni
.
reLaunch
({
url
:
item
.
jump_target
,
})
}
// 农业模型点击事件
...
...
@@ -308,6 +318,9 @@
function
onDeviceManagementClick
()
{
console
.
log
(
'设备管理'
)
// 在这里添加具体的设备管理逻辑
uni
.
navigateTo
({
url
:
'/pages/device/device'
,
})
}
// 灵活用工
function
onViewMoreFlexibleEmployment
(
type
)
{
...
...
@@ -338,9 +351,41 @@
// 轮播视频切换的时候触发
function
handleChangeVideo
(
e
:
any
)
{
// console.log('切换视频', e.detail.current)
pageData
.
current
=
e
.
detail
.
current
pageData
.
agricultureClass
.
title
=
pageData
.
agricultureClass
.
videoList
[
pageData
.
current
]?.
title
const
currentIndex
=
e
.
detail
.
current
const
prevIndex
=
pageData
.
current
pageData
.
current
=
currentIndex
pageData
.
agricultureClass
.
title
=
pageData
.
agricultureClass
.
videoList
[
currentIndex
]?.
title
// 延迟处理视频切换,避免卡顿
setTimeout
(()
=>
{
// 停止所有其他视频的播放(只暂停,不重置位置)
pageData
.
agricultureClass
.
videoList
.
forEach
((
_
,
index
)
=>
{
if
(
index
!==
currentIndex
)
{
try
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
videoContext
.
pause
()
// 不重置到开头,保留播放位置
}
catch
(
error
)
{
console
.
log
(
'停止视频失败:'
,
error
)
}
}
else
{
// 当前视频:尝试播放
try
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
// 自动播放当前视频
videoContext
.
play
()
}
catch
(
error
)
{
console
.
log
(
'播放视频失败:'
,
error
)
}
}
})
},
100
)
}
// 处理swiper过渡动画
function
handleTransition
(
e
:
any
)
{
// 过渡期间可以做一些优化处理
console
.
log
(
'swiper过渡中...'
)
}
// 获取视频时长
...
...
@@ -352,11 +397,20 @@
function
handleVideoPlay
(
currentIndex
)
{
pageData
.
agricultureClass
.
videoList
.
forEach
((
_
,
index
)
=>
{
if
(
index
!==
currentIndex
)
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
videoContext
.
pause
()
try
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
videoContext
.
pause
()
}
catch
(
error
)
{
console
.
log
(
'停止视频失败:'
,
error
)
}
}
})
}
// 视频暂停事件处理
function
handleVideoPause
(
currentIndex
)
{
console
.
log
(
`视频
${
currentIndex
}
暂停`
)
}
</
script
>
<
template
>
...
...
@@ -643,7 +697,7 @@
>
<image
class=
"image_15"
:src=
"pageData.creditCenter.image"
/>
<view
class=
"codefun-flex-col codefun-items-start group_29"
>
<text
class=
"text_62"
>
{{ pageData.
creditCenter.s
core }}
</text>
<text
class=
"text_62"
>
{{ pageData.
userInfo.creditS
core }}
</text>
<text
class=
"font_5 text_63 mt-13"
>
{{ pageData.creditCenter.rating }}
</text>
<text
class=
"font_10 text_64 mt-13"
>
{{ pageData.creditCenter.tips }}
</text>
<view
...
...
@@ -676,10 +730,14 @@
class=
"fui-banner__wrap"
circular
:indicator-dots=
"false"
autoplay
:interval=
"4000"
:duration=
"150"
:autoplay=
"false"
:interval=
"8000"
:duration=
"300"
:disable-touch=
"false"
:touch-angle=
"45"
:threshold=
"50"
@
change=
"handleChangeVideo"
@
transition=
"handleTransition"
>
<swiper-item
v-for=
"(video, index) in pageData.agricultureClass.videoList"
:key=
"index"
>
<video
...
...
@@ -688,8 +746,17 @@
:poster=
"video.cover_image"
:controls=
"false"
style=
"width: 654rpx; height: 358rpx"
:autoplay=
"false"
:muted=
"false"
:loop=
"false"
:show-play-btn=
"true"
:show-center-play-btn=
"true"
:enable-progress-gesture=
"false"
:show-progress=
"false"
object-fit=
"contain"
@
loadedmetadata=
"handleMetadataLoaded"
@
play=
"handleVideoPlay(index)"
@
pause=
"handleVideoPause(index)"
></video>
</swiper-item>
</swiper>
...
...
@@ -1496,7 +1563,7 @@
.equal-division_6
{
position
:
relative
;
margin-top
:
-
16
rpx
;
margin-top
:
-
5
rpx
;
.section_13
{
flex
:
1
1
201.34
rpx
;
...
...
src/pages/shouye/shouye.vue
浏览文件 @
e70e0280
...
...
@@ -47,18 +47,9 @@
UserAPI
.
location
({
lat
:
cachedLocation
.
lat
,
lon
:
cachedLocation
.
lon
})
.
then
((
res
)
=>
{
console
.
log
(
'UserAPI.location'
,
res
)
pageData
.
weather
.
detailedLocation
=
res
.
province
+
'-'
+
res
.
city
+
'-'
+
res
.
country
+
'-'
+
res
.
road
+
'-'
+
res
.
town
+
'-'
+
res
.
address
pageData
.
weather
.
detailedLocation
=
`
${
res
.
province
}
-
${
res
.
city
}
-
${
res
.
country
}
-
${
res
.
road
}
-
${
res
.
town
}
-
${
res
.
address
}
`
})
.
catch
(()
=>
{
// 地址获取失败时使用默认显示
...
...
@@ -92,18 +83,9 @@
UserAPI
.
location
({
lat
:
res
.
latitude
,
lon
:
res
.
longitude
})
.
then
((
res
)
=>
{
console
.
log
(
'UserAPI.location'
,
res
)
pageData
.
weather
.
detailedLocation
=
res
.
province
+
'-'
+
res
.
city
+
'-'
+
res
.
country
+
'-'
+
res
.
road
+
'-'
+
res
.
town
+
'-'
+
res
.
address
pageData
.
weather
.
detailedLocation
=
`
${
res
.
province
}
-
${
res
.
city
}
-
${
res
.
country
}
-
${
res
.
road
}
-
${
res
.
town
}
-
${
res
.
address
}
`
})
.
catch
(()
=>
{
// 地址获取失败时使用默认显示
...
...
@@ -406,9 +388,46 @@
// 轮播视频切换的时候触发
function
handleChangeVideo
(
e
:
any
)
{
// console.log('切换视频', e.detail.current)
pageData
.
current
=
e
.
detail
.
current
pageData
.
agricultureClass
.
title
=
pageData
.
agricultureClass
.
videoList
[
pageData
.
current
]?.
title
const
currentIndex
=
e
.
detail
.
current
const
prevIndex
=
pageData
.
current
pageData
.
current
=
currentIndex
pageData
.
agricultureClass
.
title
=
pageData
.
agricultureClass
.
videoList
[
currentIndex
]?.
title
// 延迟处理视频切换,避免卡顿
setTimeout
(()
=>
{
// 停止所有其他视频的播放(只暂停,不重置位置)
pageData
.
agricultureClass
.
videoList
.
forEach
((
_
,
index
)
=>
{
if
(
index
!==
currentIndex
)
{
try
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
videoContext
.
pause
()
// 不重置到开头,保留播放位置
}
catch
(
error
)
{
console
.
log
(
'停止视频失败:'
,
error
)
}
}
else
{
// 当前视频:尝试播放
try
{
const
videoContext
=
uni
.
createVideoContext
(
`video
${
index
}
`
)
// 自动播放当前视频
videoContext
.
play
()
}
catch
(
error
)
{
console
.
log
(
'播放视频失败:'
,
error
)
}
}
})
},
100
)
}
// 处理swiper过渡动画
function
handleTransition
(
e
:
any
)
{
// 过渡期间可以做一些优化处理
console
.
log
(
'swiper过渡中...'
)
}
// 视频暂停事件处理
function
handleVideoPause
(
currentIndex
)
{
console
.
log
(
`视频
${
currentIndex
}
暂停`
)
}
// 获取视频时长
...
...
@@ -464,7 +483,7 @@
scrollable
:speed=
"50"
style=
"width: 100%; height: auto"
></up-notice-bar
>
/
>
<view
v-else
class=
"text_3"
>
{{
pageData
.
weather
.
detailedLocation
}}
</view>
</view>
<!--
<image
...
...
@@ -700,10 +719,14 @@
class
=
"fui-banner__wrap"
circular
:
indicator
-
dots
=
"false"
autoplay
:
interval
=
"4000"
:
duration
=
"150"
:
autoplay
=
"false"
:
interval
=
"8000"
:
duration
=
"300"
:
disable
-
touch
=
"false"
:
touch
-
angle
=
"45"
:
threshold
=
"50"
@
change
=
"handleChangeVideo"
@
transition
=
"handleTransition"
>
<
swiper
-
item
v
-
for
=
"(video, index) in pageData.agricultureClass.videoList"
:
key
=
"index"
>
<
video
...
...
@@ -712,8 +735,17 @@
:
poster
=
"video.cover_image"
:
controls
=
"false"
style
=
"width: 654rpx; height: 358rpx"
:
autoplay
=
"false"
:
muted
=
"false"
:
loop
=
"false"
:
show
-
play
-
btn
=
"true"
:
show
-
center
-
play
-
btn
=
"true"
:
enable
-
progress
-
gesture
=
"false"
:
show
-
progress
=
"false"
object
-
fit
=
"contain"
@
loadedmetadata
=
"handleMetadataLoaded"
@
play
=
"handleVideoPlay(index)"
@
pause
=
"handleVideoPause(index)"
><
/video
>
<
/swiper-item
>
<
/swiper
>
...
...
src/utils/proxy.ts
浏览文件 @
e70e0280
...
...
@@ -11,7 +11,7 @@ const PROXY_LIST: [[string, string]?] = [
// [`http://192.168.0.100:18100`, `https://oss.beta.app.yiring.com`],
// 开发环境(预览)
[
`http://192.168.0.156:18100`
,
`http://
111.22.182.169:49091
`
],
[
`http://192.168.0.156:18100`
,
`http://
36.133.16.81:42112
`
],
]
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论