Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
csssp-xcx-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
劳广强
csssp-xcx-h5
Commits
9b9dcb4f
提交
9b9dcb4f
authored
8月 02, 2023
作者:
黎九
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug修复
上级
a8bfe986
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
147 行增加
和
124 行删除
+147
-124
manifest.json
manifest.json
+1
-1
index.vue
pages/record-type/index.vue
+10
-3
index.vue
pages/record/index.vue
+16
-4
LICENSE
uni_modules/uview-ui/LICENSE
+2
-3
changelog.md
uni_modules/uview-ui/changelog.md
+6
-1
u-modal.vue
uni_modules/uview-ui/components/u-modal/u-modal.vue
+2
-2
props.js
uni_modules/uview-ui/components/u-text/props.js
+1
-1
config.js
uni_modules/uview-ui/libs/config/config.js
+2
-2
index.js
uni_modules/uview-ui/libs/function/index.js
+0
-0
route.js
uni_modules/uview-ui/libs/util/route.js
+107
-107
没有找到文件。
manifest.json
浏览文件 @
9b9dcb4f
{
"name"
:
"荣县随手拍"
,
"appid"
:
"__UNI__
BD3107B
"
,
"appid"
:
"__UNI__
7F4BF0D
"
,
"description"
:
""
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
...
...
pages/record-type/index.vue
浏览文件 @
9b9dcb4f
...
...
@@ -68,6 +68,7 @@ export default {
onLoad
(
query
)
{
this
.
query
=
query
;
console
.
log
(
query
);
this
.
fetchPhotoTaskTypeData
();
this
.
fetchPhotoTaskTypeDetail
();
...
...
@@ -80,7 +81,7 @@ export default {
async
fetchPhotoTaskTypeData
()
{
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/app/phototasktype/list'
,
{
params
:
{
parent_id
:
this
.
query
.
id
}
});
this
.
list
=
list
;
console
.
log
(
list
);
// 可分类
if
(
list
.
some
(
v
=>
v
.
category
>
0
))
{
this
.
totalList
=
Object
.
keys
(
categoryMap
).
map
((
c
,
index
)
=>
{
...
...
@@ -124,11 +125,14 @@ export default {
},
onListClick
(
item
,
index
)
{
if
(
!
this
.
isFirstRecordType
)
{
console
.
log
(
123
,
'Tt'
);
this
.
isFirstRecordTypeId
=
item
.
id
;
this
.
showReport
=
true
;
return
;
}
console
.
log
(
'ccc'
);
uni
.
$u
.
route
({
url
:
'pages/record-content/index'
,
params
:
{
...
...
@@ -139,8 +143,11 @@ export default {
},
getIsFirstRecordType
()
{
const
isFirstRecordType
=
uni
.
getStorageSync
(
'isFirstRecordType'
);
if
(
!
isFirstRecordType
)
uni
.
setStorageSync
(
'isFirstRecordType'
,
1
);
let
isFirstRecordType
=
uni
.
getStorageSync
(
'isFirstRecordType'
);
if
(
!
isFirstRecordType
){
uni
.
setStorageSync
(
'isFirstRecordType'
,
1
);
isFirstRecordType
=
uni
.
getStorageSync
(
'isFirstRecordType'
);
}
return
isFirstRecordType
;
},
},
...
...
pages/record/index.vue
浏览文件 @
9b9dcb4f
...
...
@@ -84,6 +84,7 @@ export default {
// this.fetchPhotoTaskTypeDetail();
this
.
isFirstRecord
=
this
.
getIsFirstRecord
();
// console.log(this.isFirstRecord);
},
onShow
(
options
)
{},
...
...
@@ -99,7 +100,7 @@ export default {
async
fetchPhotoTaskTypeDetail
()
{
const
{
detail
}
=
await
uni
.
$u
.
http
.
get
(
'/api/app/phototasktype/detail'
,
{
params
:
{
id
:
0
}
});
console
.
log
(
detail
);
//
console.log(detail);
},
async
fetchFalutTask
(
id
)
{
...
...
@@ -140,17 +141,28 @@ export default {
},
onListClick
(
item
,
index
)
{
// console.log(this.isFirstRecord);
if
(
!
this
.
isFirstRecord
)
{
// console.log(123);
this
.
isFirstRecordId
=
item
.
id
;
this
.
showReport
=
true
;
return
;
}
uni
.
$u
.
route
({
url
:
'pages/record-type/index'
,
params
:
{
id
:
item
.
id
}
});
// console.log(123,'ttc');
uni
.
$u
.
route
({
url
:
'pages/record-type/index'
,
params
:
{
id
:
item
.
id
,
}
,
});
},
getIsFirstRecord
()
{
const
isFirstRecord
=
uni
.
getStorageSync
(
'isFirstRecord'
);
if
(
!
isFirstRecord
)
uni
.
setStorageSync
(
'isFirstRecord'
,
1
);
let
isFirstRecord
=
uni
.
getStorageSync
(
'isFirstRecord'
);
if
(
!
isFirstRecord
){
uni
.
setStorageSync
(
'isFirstRecord'
,
1
)
isFirstRecord
=
uni
.
getStorageSync
(
'isFirstRecord'
);
}
;
return
isFirstRecord
;
},
...
...
uni_modules/uview-ui/LICENSE
浏览文件 @
9b9dcb4f
MIT License
Copyright (c) 202
0
www.uviewui.com
Copyright (c) 202
3
www.uviewui.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
SOFTWARE.
uni_modules/uview-ui/changelog.md
浏览文件 @
9b9dcb4f
## 2.0.34(2022-09-25)
## 2.0.36(2023-03-27)
# uView2.0重磅发布,利剑出鞘,一统江湖
1.
重构
`deepClone`
&
`deepMerge`
方法
2.
其他优化
## 2.0.34(2022-09-24)
# uView2.0重磅发布,利剑出鞘,一统江湖
1.
`u-input`
、
`u-textarea`
增加
`ignoreCompositionEvent`
属性
...
...
uni_modules/uview-ui/components/u-modal/u-modal.vue
浏览文件 @
9b9dcb4f
...
...
@@ -114,7 +114,7 @@
* @event {Function} confirm 点击确认按钮时触发
* @event {Function} cancel 点击取消按钮时触发
* @event {Function} close 点击遮罩关闭出发,closeOnClickOverlay为true有效
* @example <u-
loadmore :status="status" icon-type="iconType" load-text="loadText" /
>
* @example <u-
modal :show="true" title="title" content="content"></u-modal
>
*/
export
default
{
name
:
'u-modal'
,
...
...
@@ -146,7 +146,7 @@
},
// 点击遮罩
// 从原理上来说,modal的遮罩点击,并不是真的点击到了遮罩
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽
有然
遮罩,但是为了让弹窗内容能flex居中
// 因为modal依赖于popup的中部弹窗类型,中部弹窗比较特殊,虽
然有
遮罩,但是为了让弹窗内容能flex居中
// 多了一个透明的遮罩,此透明的遮罩会覆盖在灰色的遮罩上,所以实际上是点击不到灰色遮罩的,popup内部在
// 透明遮罩的子元素做了.stop处理,所以点击内容区,也不会导致误触发
clickHandler
()
{
...
...
uni_modules/uview-ui/components/u-text/props.js
浏览文件 @
9b9dcb4f
...
...
@@ -83,7 +83,7 @@ export default {
},
// 文字装饰,下划线,中划线等,可选值 none|underline|line-through
decoration
:
{
t
e
pe
:
String
,
t
y
pe
:
String
,
default
:
uni
.
$u
.
props
.
text
.
decoration
},
// 外边距,对象、字符串,数值形式均可
...
...
uni_modules/uview-ui/libs/config/config.js
浏览文件 @
9b9dcb4f
// 此版本发布于202
2-00-24
const
version
=
'2.0.3
4
'
// 此版本发布于202
3-03-27
const
version
=
'2.0.3
6
'
// 开发环境才提示,生产环境不会提示
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
...
...
uni_modules/uview-ui/libs/function/index.js
浏览文件 @
9b9dcb4f
差异被折叠。
点击展开。
uni_modules/uview-ui/libs/util/route.js
浏览文件 @
9b9dcb4f
...
...
@@ -4,121 +4,121 @@
*/
class
Router
{
constructor
()
{
// 原始属性定义
this
.
config
=
{
type
:
'navigateTo'
,
url
:
''
,
delta
:
1
,
// navigateBack页面后退时,回退的层数
params
:
{},
// 传递的参数
animationType
:
'pop-in'
,
// 窗口动画,只在APP有效
animationDuration
:
300
,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept
:
false
// 是否需要拦截
}
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
// 这里在构造函数中进行this绑定
this
.
route
=
this
.
route
.
bind
(
this
)
}
constructor
()
{
// 原始属性定义
this
.
config
=
{
type
:
'navigateTo'
,
url
:
''
,
delta
:
1
,
// navigateBack页面后退时,回退的层数
params
:
{},
// 传递的参数
animationType
:
'pop-in'
,
// 窗口动画,只在APP有效
animationDuration
:
300
,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept
:
false
// 是否需要拦截
}
// 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
// 这里在构造函数中进行this绑定
this
.
route
=
this
.
route
.
bind
(
this
)
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath
(
url
)
{
return
url
[
0
]
===
'/'
?
url
:
`/
${
url
}
`
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath
(
url
)
{
return
url
[
0
]
===
'/'
?
url
:
`/
${
url
}
`
}
// 整合路由参数
mixinParam
(
url
,
params
)
{
url
=
url
&&
this
.
addRootPath
(
url
)
// 整合路由参数
mixinParam
(
url
,
params
)
{
url
=
url
&&
this
.
addRootPath
(
url
)
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
// 如果有url中有get参数,转换后无需带上"?"
let
query
=
''
if
(
/.*
\/
.*
\?
.*=.*/
.
test
(
url
))
{
// object对象转为get类型的参数
query
=
uni
.
$u
.
queryParams
(
params
,
false
)
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
return
url
+=
`&
${
query
}
`
}
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
query
=
uni
.
$u
.
queryParams
(
params
)
return
url
+=
query
}
// 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
// 如果有url中有get参数,转换后无需带上"?"
let
query
=
''
if
(
/.*
\/
.*
\?
.*=.*/
.
test
(
url
))
{
// object对象转为get类型的参数
query
=
uni
.
$u
.
queryParams
(
params
,
false
)
// 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
return
url
+=
`&
${
query
}
`
}
// 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
query
=
uni
.
$u
.
queryParams
(
params
)
return
url
+=
query
}
// 对外的方法名称
async
route
(
options
=
{},
params
=
{})
{
// 合并用户的配置和内部的默认配置
let
mergeConfig
=
{}
// 对外的方法名称
async
route
(
options
=
{},
params
=
{})
{
// 合并用户的配置和内部的默认配置
let
mergeConfig
=
{}
if
(
typeof
options
===
'string'
)
{
// 如果options为字符串,则为route(url, params)的形式
mergeConfig
.
url
=
this
.
mixinParam
(
options
,
params
)
mergeConfig
.
type
=
'navigateTo'
}
else
{
mergeConfig
=
uni
.
$u
.
deepMerge
(
options
,
this
.
config
)
// 否则正常使用mergeConfig中的url和params进行拼接
mergeConfig
.
url
=
this
.
mixinParam
(
options
.
url
,
options
.
params
)
}
if
(
typeof
options
===
'string'
)
{
// 如果options为字符串,则为route(url, params)的形式
mergeConfig
.
url
=
this
.
mixinParam
(
options
,
params
)
mergeConfig
.
type
=
'navigateTo'
}
else
{
mergeConfig
=
uni
.
$u
.
deepMerge
(
this
.
config
,
options
)
// 否则正常使用mergeConfig中的url和params进行拼接
mergeConfig
.
url
=
this
.
mixinParam
(
options
.
url
,
options
.
params
)
}
// 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
if
(
mergeConfig
.
url
===
uni
.
$u
.
page
())
return
// 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题
if
(
mergeConfig
.
url
===
uni
.
$u
.
page
())
return
if
(
params
.
intercept
)
{
this
.
config
.
intercept
=
params
.
intercept
}
// params参数也带给拦截器
mergeConfig
.
params
=
params
// 合并内外部参数
mergeConfig
=
uni
.
$u
.
deepMerge
(
this
.
config
,
mergeConfig
)
// 判断用户是否定义了拦截器
if
(
typeof
uni
.
$u
.
routeIntercept
===
'function'
)
{
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
const
isNext
=
await
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
$u
.
routeIntercept
(
mergeConfig
,
resolve
)
})
// 如果isNext为true,则执行路由跳转
isNext
&&
this
.
openPage
(
mergeConfig
)
}
else
{
this
.
openPage
(
mergeConfig
)
}
}
if
(
params
.
intercept
)
{
this
.
config
.
intercept
=
params
.
intercept
}
// params参数也带给拦截器
mergeConfig
.
params
=
params
// 合并内外部参数
mergeConfig
=
uni
.
$u
.
deepMerge
(
this
.
config
,
mergeConfig
)
// 判断用户是否定义了拦截器
if
(
typeof
uni
.
$u
.
routeIntercept
===
'function'
)
{
// 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转
const
isNext
=
await
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
$u
.
routeIntercept
(
mergeConfig
,
resolve
)
})
// 如果isNext为true,则执行路由跳转
isNext
&&
this
.
openPage
(
mergeConfig
)
}
else
{
this
.
openPage
(
mergeConfig
)
}
}
// 执行路由跳转
openPage
(
config
)
{
// 解构参数
const
{
url
,
type
,
delta
,
animationType
,
animationDuration
}
=
config
if
(
config
.
type
==
'navigateTo'
||
config
.
type
==
'to'
)
{
uni
.
navigateTo
({
url
,
animationType
,
animationDuration
})
}
if
(
config
.
type
==
'redirectTo'
||
config
.
type
==
'redirect'
)
{
uni
.
redirectTo
({
url
})
}
if
(
config
.
type
==
'switchTab'
||
config
.
type
==
'tab'
)
{
uni
.
switchTab
({
url
})
}
if
(
config
.
type
==
'reLaunch'
||
config
.
type
==
'launch'
)
{
uni
.
reLaunch
({
url
})
}
if
(
config
.
type
==
'navigateBack'
||
config
.
type
==
'back'
)
{
uni
.
navigateBack
({
delta
})
}
}
// 执行路由跳转
openPage
(
config
)
{
// 解构参数
const
{
url
,
type
,
delta
,
animationType
,
animationDuration
}
=
config
if
(
config
.
type
==
'navigateTo'
||
config
.
type
==
'to'
)
{
uni
.
navigateTo
({
url
,
animationType
,
animationDuration
})
}
if
(
config
.
type
==
'redirectTo'
||
config
.
type
==
'redirect'
)
{
uni
.
redirectTo
({
url
})
}
if
(
config
.
type
==
'switchTab'
||
config
.
type
==
'tab'
)
{
uni
.
switchTab
({
url
})
}
if
(
config
.
type
==
'reLaunch'
||
config
.
type
==
'launch'
)
{
uni
.
reLaunch
({
url
})
}
if
(
config
.
type
==
'navigateBack'
||
config
.
type
==
'back'
)
{
uni
.
navigateBack
({
delta
})
}
}
}
export
default
(
new
Router
()).
route
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论