Commit 7b7f5299 by baihong

add:新增图片上传弹窗

parent 6dc6293b
......@@ -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;
.popup {
//padding: 31rpx 45rpx;
.title{
.upload-popup {
background-color: #F5F5F5;
.close {
height: 114rpx;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
font-family: OpenSans;
color: #333333;
line-height: 49rpx;
margin-top: 10rpx;
}
.top {
padding: 32rpx 0 37rpx 0;
text-align: center;
font-size: 32rpx;
font-family: OpenSans-Bold, OpenSans;
font-weight: bold;
color: #333333;
line-height: 43rpx;
border-bottom: 1rpx solid #DCDCDC;
background-color: #FFFFFF;
}
.upload-main {
padding: 53rpx 181rpx 58rpx 174rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FFFFFF;
.item {
display: flex;
flex-direction: column;
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 40rpx;
image {
width: 54rpx;
height: 48rpx;
margin-bottom: 21rpx;
}
}
}
}
.popup {
.title {
padding: 30rpx 35rpx;
border-bottom: 1rpx solid #DCDCDC;
font-size: 28rpx;
......@@ -180,7 +267,8 @@
line-height: 38rpx;
margin-bottom: 33rpx;
}
.text{
.text {
padding: 0 40rpx;
font-size: 24rpx;
font-family: OpenSans;
......@@ -188,6 +276,7 @@
line-height: 36rpx;
}
}
.camera {
width: 110rpx;
height: 110rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment