Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
get-up-early
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baihong
get-up-early
Commits
7b7f5299
Commit
7b7f5299
authored
Apr 21, 2021
by
baihong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:新增图片上传弹窗
parent
6dc6293b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
5 deletions
+94
-5
home.vue
pages/home/home.vue
+94
-5
ic_gallery@2x.png
static/imgs/ic_gallery@2x.png
+0
-0
No files found.
pages/home/home.vue
View file @
7b7f5299
...
...
@@ -105,7 +105,7 @@
<image
style=
"width: 26rpx;height: 26rpx;"
src=
"../../static/imgs/ic_dollar@2x.png"
mode=
""
></image>
</view>
</view>
<image
class=
"camera"
src=
"../../static/imgs/ic_health_client@2x.png"
mode=
""
></image>
<image
@
click=
"showUpload=true"
class=
"camera"
src=
"../../static/imgs/ic_health_client@2x.png"
mode=
""
></image>
<u-popup
:closeable=
'true'
v-model=
"show"
mode=
"center"
width=
"673rpx"
height=
"648rpx"
>
<view
class=
"popup"
>
<view
class=
"title"
>
...
...
@@ -121,6 +121,22 @@
</view>
</view>
</u-popup>
<u-popup
v-model=
"showUpload"
mode=
"bottom"
border-radius=
"16"
>
<view
class=
"upload-popup"
>
<view
class=
"top"
>
上传图片
</view>
<view
class=
"upload-main"
>
<view
class=
"item"
>
<image
src=
"../../static/imgs/ic_gallery@2x.png"
mode=
""
></image>
<text>
照相
</text>
</view>
<view
class=
"item"
>
<image
src=
"../../static/imgs/ic_gallery@2x.png"
mode=
""
></image>
<text>
图库
</text>
</view>
</view>
<view
class=
"close"
@
click=
"showUpload=false"
>
取消
</view>
</view>
</u-popup>
</view>
</
template
>
...
...
@@ -132,7 +148,8 @@
},
data
()
{
return
{
show
:
false
,
show
:
false
,
showUpload
:
true
,
src
:
'https://t7.baidu.com/it/u=1951548898,3927145&fm=193&f=GIF'
,
number
:
0
,
};
...
...
@@ -149,6 +166,30 @@
url
:
'../salesInquiry/salesInquiry'
});
},
chooseImage
()
{
let
_this
=
this
uni
.
chooseImage
({
sizeType
:
[
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'camera'
,
'album'
],
//从相册拍照选择
success
:
(
chooseImageRes
)
=>
{
const
tempFilePaths
=
chooseImageRes
.
tempFilePaths
;
uni
.
uploadFile
({
url
:
config
.
baseURL
+
'/api/upload/add'
,
//仅为示例,非真实的接口地址
filePath
:
tempFilePaths
[
0
],
name
:
'image'
,
formData
:
{
type
:
4
,
},
success
:
(
uploadFileRes
)
=>
{
let
file_path
=
JSON
.
parse
(
uploadFileRes
.
data
).
data
.
file_path
_this
.
member_avatar
=
file_path
_this
.
infoUpdate
(
file_path
)
}
});
}
});
},
startMove
()
{
// eslint-disable-next-line
let
timer
=
setTimeout
(()
=>
{
...
...
@@ -168,9 +209,55 @@
.app
{
background
:
#f5f7f9
;
height
:
100vh
;
.upload-popup
{
background-color
:
#F5F5F5
;
.close
{
height
:
114
rpx
;
background
:
#FFFFFF
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
36
rpx
;
font-family
:
OpenSans
;
color
:
#333333
;
line-height
:
49
rpx
;
margin-top
:
10
rpx
;
}
.top
{
padding
:
32
rpx
0
37
rpx
0
;
text-align
:
center
;
font-size
:
32
rpx
;
font-family
:
OpenSans-Bold
,
OpenSans
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
43
rpx
;
border-bottom
:
1
rpx
solid
#DCDCDC
;
background-color
:
#FFFFFF
;
}
.upload-main
{
padding
:
53
rpx
181
rpx
58
rpx
174
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
background-color
:
#FFFFFF
;
.item
{
display
:
flex
;
flex-direction
:
column
;
font-size
:
28
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
#333333
;
line-height
:
40
rpx
;
image
{
width
:
54
rpx
;
height
:
48
rpx
;
margin-bottom
:
21
rpx
;
}
}
}
}
.popup
{
//
padding
:
31
rpx
45
rpx
;
.title{
.title
{
padding
:
30
rpx
35
rpx
;
border-bottom
:
1
rpx
solid
#DCDCDC
;
font-size
:
28
rpx
;
...
...
@@ -180,7 +267,8 @@
line-height
:
38
rpx
;
margin-bottom
:
33
rpx
;
}
.text
{
.text
{
padding
:
0
40
rpx
;
font-size
:
24
rpx
;
font-family
:
OpenSans
;
...
...
@@ -188,6 +276,7 @@
line-height
:
36
rpx
;
}
}
.camera
{
width
:
110
rpx
;
height
:
110
rpx
;
...
...
static/imgs/ic_gallery@2x.png
0 → 100644
View file @
7b7f5299
3.61 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment