Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
6cfa2759
提交
6cfa2759
authored
5月 29, 2023
作者:
陈楚尹
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 更新show
上级
55afdc7e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
130 行增加
和
17 行删除
+130
-17
index.ts
src/api/services/mods/home/index.ts
+48
-0
index.vue
src/pages/index/index.vue
+8
-7
meteService.vue
src/pages/index/modules/meteService.vue
+34
-0
weather.vue
src/pages/index/modules/weather.vue
+40
-10
index.ts
src/utils/const/index.ts
+0
-0
没有找到文件。
src/api/services/mods/home/index.ts
0 → 100644
浏览文件 @
6cfa2759
/**
* @desc 新增
*/
import
*
as
defs
from
'../../baseClass'
import
{
defHttp
}
from
'/@/utils/http/axios'
export
class
Params
{
/** 组件 */
component
?:
string
/** 是否启用 */
enable
?:
boolean
/** 是否隐藏 */
hidden
?:
boolean
/** 图标 */
icon
?:
string
/** 元数据 */
meta
?:
string
/** 名称 */
name
:
string
/** 路径 */
path
?:
string
/** 父级ID */
pid
?:
string
/** 重定向 */
redirect
?:
string
/** 序号 */
serial
?:
number
/** 权限类型 */
type
:
'DIR'
|
'MENU'
|
'BUTTON'
/** 标识 */
uid
:
string
}
export
const
init
=
new
defs
.
Result
()
export
function
request
(
params
:
Params
,
config
?:
http
.
RequestConfig
<
Params
>
,
options
?:
http
.
RequestOptions
)
{
return
defHttp
.
request
(
{
url
:
'/sys/permission/add'
,
method
:
'POST'
,
data
:
params
,
...
config
,
},
options
,
)
}
src/pages/index/index.vue
浏览文件 @
6cfa2759
<
script
setup
lang=
"ts"
>
import
Header
from
'./modules/header.vue'
import
Weather
from
'./modules/weather.vue'
import
MeteService
from
'./modules/meteService.vue'
const
title
=
ref
(
'Hello World'
)
//
const title = ref('Hello World')
onMounted
(()
=>
{
// test API
API
.
example
.
hello
.
request
().
then
((
body
)
=>
{
title
.
value
=
body
console
.
log
(
'[API]'
,
body
,
$app
.
name
,
$app
.
version
)
Message
.
toast
(
body
)
})
// API.example.hello.request().then((body) => {
// title.value = body
// console.log('[API]', body, $app.name, $app.version)
// Message.toast(body)
// })
})
// const surprise = () => {
...
...
@@ -35,6 +35,7 @@
<view
class=
"content"
>
<Header
/>
<Weather
/>
<MeteService
/>
<!--
<fui-avatar
src=
"/static/logo.png"
radius=
"14"
@
click=
"surprise"
/>
-->
<!--
<view
class=
"info"
>
<text
class=
"title"
>
{{
title
}}
</text>
...
...
src/pages/index/modules/meteService.vue
0 → 100644
浏览文件 @
6cfa2759
<
script
setup
lang=
"ts"
></
script
>
<
template
>
<view
class=
"meteService-container"
>
<view
class=
"header"
>
<view
class=
"title"
>
气象服务
</view>
<view
class=
"other"
>
全部>
</view>
</view>
</view>
</
template
>
<
style
lang=
"less"
scoped
>
.meteService-container
{
margin-top
:
20
rpx
;
background-color
:
#fff
;
padding
:
28
rpx
;
.header
{
font-size
:
30
rpx
;
line-height
:
40
rpx
;
display
:
flex
;
justify-content
:
space-between
;
.title
{
font-size
:
32
rpx
;
}
.other
{
color
:
#ccc
;
font-size
:
28
rpx
;
}
}
}
</
style
>
src/pages/index/modules/weather.vue
浏览文件 @
6cfa2759
<
script
setup
lang=
"ts"
>
const
url
=
ref
<
string
>
(
'/static/images/weather-little-icon/day3.png'
)
const
url
=
ref
<
string
>
(
'/static/images/weather-little-icon/day1.png'
)
// 切换城市
const
cityChange
=
()
=>
{
uni
.
showToast
({
title
:
'切换城市'
})
}
// 预报预览
const
previewForecast
=
()
=>
{
uni
.
showToast
({
title
:
'预报预览'
})
}
</
script
>
<
template
>
<view
class=
"weather-container"
>
<view
class=
"weather-city"
>
<view
class=
"weather-city"
@
tap=
"cityChange"
>
<FuiIcon
name=
"location"
color=
"#3FA5FF"
class=
"location-icon"
/>
<text
class=
"location-text"
>
天心区
</text>
<text
class=
"right-line"
/>
</view>
<view
class=
"weather-info"
>
<image
:
url
=
"url"
/>
<image
:
src
=
"url"
/>
<text>
晴 39°
</text>
<view
class=
"weather-air"
>
良
</view>
</view>
<view
class=
"weather-detail"
/
>
<view
class=
"weather-detail"
@
tap=
"previewForecast"
>
未来24小时预报 >
</view
>
</view>
</
template
>
...
...
@@ -35,7 +46,7 @@
.location-icon
{
font-size
:
42
rpx
!important
;
margin-right
:
1
2
rpx
;
margin-right
:
1
0
rpx
;
vertical-align
:
middle
;
}
...
...
@@ -48,26 +59,45 @@
width
:
2px
;
height
:
42
rpx
;
background-color
:
#eeeeee
;
margin-left
:
30
rpx
;
border-radius
:
5
0%
;
margin-left
:
24
rpx
;
border-radius
:
1
0%
;
}
}
.weather-info
{
flex
:
1.
2
;
flex
:
1.
3
;
display
:
flex
;
align-items
:
center
;
justify-content
:
left
;
image
{
width
:
50
rpx
;
height
:
50
rpx
;
margin-right
:
18
rpx
;
//
margin-bottom
:
10
rpx
;
}
text
{
font-size
:
40
rpx
;
vertical-align
:
top
;
}
.weather-air
{
width
:
65
rpx
;
//
height
:
42
rpx
;
line-height
:
42
rpx
;
background-color
:
#24e228
;
border-radius
:
5px
;
text-align
:
center
;
font-size
:
27
rpx
;
margin-left
:
10
rpx
;
color
:
#fff
;
}
}
.weather-detail
{
flex
:
1.6
;
flex
:
1.4
;
font-size
:
28
rpx
;
color
:
#aaaaaa
;
}
}
</
style
>
src/utils/const/index.ts
0 → 100644
浏览文件 @
6cfa2759
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论