Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6bc7d9dd
authored
Jan 18, 2025
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
上传延保协议添加自定义loading
1 parent
3dd49c86
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
8 deletions
packageEquity/pages/carQuotation/components/Popup/Popup.wxss
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.js
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.json
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.sass
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml
packageEquity/pages/carQuotation/components/Popup/Popup.wxss
View file @
6bc7d9d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
left: 0;
left: 0;
bottom: 0;
bottom: 0;
right: 0;
right: 0;
background-color: rgba(0, 0, 0, .
6
);
background-color: rgba(0, 0, 0, .
7
);
}
}
.text-center {
.text-center {
...
...
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.js
View file @
6bc7d9d
...
@@ -47,15 +47,19 @@ Component({
...
@@ -47,15 +47,19 @@ Component({
let
[
tempFiles
]
=
res
.
tempFilePaths
let
[
tempFiles
]
=
res
.
tempFilePaths
let
imgType
=
tempFiles
.
split
(
'.'
)[
1
]
let
imgType
=
tempFiles
.
split
(
'.'
)[
1
]
let
type
=
imgType
==
'unknown'
?
'jpg'
:
imgType
let
type
=
imgType
==
'unknown'
?
'jpg'
:
imgType
_this
.
setData
({
loadingFlag
:
true
})
wx
.
getFileSystemManager
().
readFile
({
wx
.
getFileSystemManager
().
readFile
({
filePath
:
tempFiles
,
//选择图片返回的相对路径
filePath
:
tempFiles
,
//选择图片返回的相对路径
encoding
:
'base64'
,
//编码格式
encoding
:
'base64'
,
//编码格式
success
(
_res
)
{
success
(
_res
)
{
wx
.
$util
.
showLoading
(
'上传中...'
)
api
.
uploadImg
({
api
.
uploadImg
({
file
:
`
${
type
}
@
${
_res
.
data
}
`
file
:
`
${
type
}
@
${
_res
.
data
}
`
}).
then
(
img
=>
{
}).
then
(
img
=>
{
wx
.
$util
.
hideLoading
()
_this
.
setData
({
loadingFlag
:
false
})
let
{
code
,
data
,
message
}
=
img
let
{
code
,
data
,
message
}
=
img
if
(
code
==
0
)
{
if
(
code
==
0
)
{
fileList
.
push
({
url
:
data
})
fileList
.
push
({
url
:
data
})
...
@@ -97,16 +101,20 @@ Component({
...
@@ -97,16 +101,20 @@ Component({
let
fileType
=
fileName
.
split
(
'.'
).
pop
()
// 获取文件扩展名
let
fileType
=
fileName
.
split
(
'.'
).
pop
()
// 获取文件扩展名
// 读取文件
// 读取文件
if
(
fileType
!=
'pdf'
)
return
wx
.
$util
.
showToast
(
'只可上传pdf类型文件'
)
if
(
fileType
!=
'pdf'
)
return
wx
.
$util
.
showToast
(
'只可上传pdf类型文件'
)
_this
.
setData
({
loadingFlag
:
true
})
wx
.
getFileSystemManager
().
readFile
({
wx
.
getFileSystemManager
().
readFile
({
filePath
:
tempFile
.
path
,
// 使用正确的路径
filePath
:
tempFile
.
path
,
// 使用正确的路径
encoding
:
'base64'
,
encoding
:
'base64'
,
success
(
_res
)
{
success
(
_res
)
{
wx
.
$util
.
showLoading
(
'上传中...'
);
// 调用上传接口
// 调用上传接口
api
.
uploadPdfAPI
({
api
.
uploadPdfAPI
({
file
:
`
${
fileType
}
@
${
_res
.
data
}
`
// 处理文件类型
file
:
`
${
fileType
}
@
${
_res
.
data
}
`
// 处理文件类型
}).
then
(
img
=>
{
}).
then
(
img
=>
{
wx
.
$util
.
hideLoading
();
_this
.
setData
({
loadingFlag
:
false
})
let
{
code
,
data
,
message
}
=
img
;
let
{
code
,
data
,
message
}
=
img
;
if
(
code
==
0
)
{
if
(
code
==
0
)
{
...
...
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.json
View file @
6bc7d9d
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"popup"
:
"../Popup/Popup"
"popup"
:
"../Popup/Popup"
,
"van-loading"
:
"@vant/weapp/loading/index"
}
}
}
}
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.sass
View file @
6bc7d9d
...
@@ -101,4 +101,10 @@
...
@@ -101,4 +101,10 @@
line-height
:
var
(
--
fontSize112
)
;
line-height
:
var
(
--
fontSize112
)
;
border-bottom
:
var
(
--
fontSize1
)
solid
#EBEDF0
;
border-bottom
:
var
(
--
fontSize1
)
solid
#EBEDF0
;
}
}
}
.loading-box
{
background-color
:
rgba
(
0
,
0
,
0
,
0
.7
)
;
.van-loading__text
{
color
:
#FFFFFF
!
important
;
}
}
}
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml
View file @
6bc7d9d
<!--packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml-->
<!--packageEquity/pages/carQuotation/components/zyPayPopup/zyPayPopup.wxml-->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<block wx:if="{{!showChangeFileType}}">
<block wx:if="{{!showChangeFileType
&& !loadingFlag
}}">
<popup
<popup
title="{{'上传延保协议'}}"
title="{{'上传延保协议'}}"
show="{{show}}"
show="{{show}}"
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
</view>
</view>
</popup>
</popup>
</block>
</block>
<block wx:
else
>
<block wx:
if="{{showChangeFileType && !loadingFlag}}"
>
<van-popup
<van-popup
class="file-type-popup"
class="file-type-popup"
show="{{show}}"
show="{{show}}"
...
@@ -54,4 +54,9 @@
...
@@ -54,4 +54,9 @@
</view>
</view>
</van-popup>
</van-popup>
</block>
</block>
<block wx:if="{{loadingFlag}}">
<van-popup show="{{show}}" close-on-click-overlay="{{false}}" >
<van-loading custom-class="loading-box" color="#FFFFFF" type="spinner" size="45px" vertical>上传中</van-loading>
</van-popup>
</block>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment