Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
csssp-xcx-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
劳广强
csssp-xcx-h5
Commits
1fa14c61
提交
1fa14c61
authored
12月 29, 2022
作者:
劳广强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 填写上报内容 添加上传中蒙版
上级
087e67d5
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
38 行增加
和
8 行删除
+38
-8
index.scss
pages/record-content/index.scss
+20
-0
index.vue
pages/record-content/index.vue
+18
-8
没有找到文件。
pages/record-content/index.scss
浏览文件 @
1fa14c61
...
@@ -317,3 +317,23 @@
...
@@ -317,3 +317,23 @@
border-radius
:
16rpx
;
border-radius
:
16rpx
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.photo_item--loading
{
$size
:
168rpx
;
width
:
$size
;
height
:
$size
;
border-radius
:
16rpx
;
overflow
:
hidden
;
background-color
:
#000
;
position
:
relative
;
}
.
photo_item--loading
:
:
after
{
content
:
'上传中...'
;
position
:
absolute
;
top
:
35%
;
text-align
:
center
;
color
:
#fff
;
width
:
100%
;
}
pages/record-content/index.vue
浏览文件 @
1fa14c61
...
@@ -132,7 +132,9 @@
...
@@ -132,7 +132,9 @@
<view
class=
"tip"
>
{{ !showActive ? null : '照片至少上传1张/视频20M以下' }}
</view>
<view
class=
"tip"
>
{{ !showActive ? null : '照片至少上传1张/视频20M以下' }}
</view>
</view>
</view>
<view
class=
"photo_list"
>
<view
class=
"photo_list"
>
<view
class=
"photo_item"
bindtap=
"preview"
v-for=
"(item, index) in photoList"
:key=
"item.id"
@
click=
"previewVideo(item, index)"
>
<view
class=
"photo_item"
bindtap=
"preview"
v-for=
"(item, index) in photoList"
:key=
"item.id"
>
<view
v-if=
"item.status === 'loading'"
class=
"photo_item--loading"
>
</view>
<view
v-else
@
click=
"previewVideo(item, index)"
>
<!-- <image mode="aspectFill" class="upload_img" src="{{item}}" /> -->
<!-- <image mode="aspectFill" class="upload_img" src="{{item}}" /> -->
<image
mode=
"aspectFill"
v-if=
"item.type === 'image'"
:src=
"item.url"
style=
"display: block; width: 168rpx; height: 168rpx; border-radius: 16rpx"
/>
<image
mode=
"aspectFill"
v-if=
"item.type === 'image'"
:src=
"item.url"
style=
"display: block; width: 168rpx; height: 168rpx; border-radius: 16rpx"
/>
...
@@ -145,6 +147,7 @@
...
@@ -145,6 +147,7 @@
<image
@
click
.
native
.
stop=
"cancel(item, index)"
mode=
"aspectFill"
class=
"upload_del"
src=
"/static/icon/ic_zp_del@2x.png"
/>
<image
@
click
.
native
.
stop=
"cancel(item, index)"
mode=
"aspectFill"
class=
"upload_del"
src=
"/static/icon/ic_zp_del@2x.png"
/>
</view>
</view>
</view>
<view
class=
"photo_upload"
@
click=
"upload"
>
<view
class=
"photo_upload"
@
click=
"upload"
>
<image
mode=
"aspectFill"
class=
"upload_icon"
src=
"/static/icon/upload_icon@2x.png"
/>
<image
mode=
"aspectFill"
class=
"upload_icon"
src=
"/static/icon/upload_icon@2x.png"
/>
</view>
</view>
...
@@ -480,6 +483,13 @@ export default {
...
@@ -480,6 +483,13 @@ export default {
*/
*/
async
onUpload
(
item
)
{
async
onUpload
(
item
)
{
const
upLoad
=
async
(
file
,
type
=
'image'
)
=>
{
const
upLoad
=
async
(
file
,
type
=
'image'
)
=>
{
const
media
=
{
id
:
uni
.
$u
.
guid
(),
type
,
url
:
''
,
status
:
'loading'
,
};
this
.
photoList
.
push
(
media
);
const
[
_temp0
,
{
data
}]
=
await
uni
.
request
({
url
:
'/api/qiniu/token'
});
const
[
_temp0
,
{
data
}]
=
await
uni
.
request
({
url
:
'/api/qiniu/token'
});
const
[
_temp1
,
{
data
:
res
}]
=
await
uni
.
uploadFile
({
const
[
_temp1
,
{
data
:
res
}]
=
await
uni
.
uploadFile
({
url
:
data
.
upload_url
,
url
:
data
.
upload_url
,
...
@@ -489,11 +499,13 @@ export default {
...
@@ -489,11 +499,13 @@ export default {
},
},
});
});
const
{
key
}
=
JSON
.
parse
(
res
);
const
{
key
}
=
JSON
.
parse
(
res
);
this
.
photoList
.
push
({
// this.photoList.push({
id
:
uni
.
$u
.
guid
(),
// id: uni.$u.guid(),
type
,
// type,
url
:
`
${
data
.
qn_domain
}${
key
}
`
,
// url: `${data.qn_domain}${key}`,
});
// });
media
.
url
=
`
${
data
.
qn_domain
}${
key
}
`
;
media
.
status
=
'finish'
;
if
(
type
===
'video'
)
{
if
(
type
===
'video'
)
{
this
.
photoList
=
this
.
photoList
.
map
((
value
,
index
)
=>
({
this
.
photoList
=
this
.
photoList
.
map
((
value
,
index
)
=>
({
...
value
,
...
value
,
...
@@ -506,7 +518,6 @@ export default {
...
@@ -506,7 +518,6 @@ export default {
case
'image'
:
case
'image'
:
uni
.
chooseImage
({
uni
.
chooseImage
({
success
:
(
result
)
=>
{
success
:
(
result
)
=>
{
console
.
log
(
result
);
result
.
tempFiles
.
forEach
((
value
)
=>
{
result
.
tempFiles
.
forEach
((
value
)
=>
{
upLoad
(
value
);
upLoad
(
value
);
});
});
...
@@ -519,7 +530,6 @@ export default {
...
@@ -519,7 +530,6 @@ export default {
case
'video'
:
case
'video'
:
uni
.
chooseVideo
({
uni
.
chooseVideo
({
success
:
(
result
)
=>
{
success
:
(
result
)
=>
{
console
.
log
(
result
);
upLoad
(
result
.
tempFile
,
'video'
);
upLoad
(
result
.
tempFile
,
'video'
);
},
},
fail
:
(
result
)
=>
{
fail
:
(
result
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论