120 lines
4.3 KiB
Plaintext
120 lines
4.3 KiB
Plaintext
<template>
|
|
<view class="sent--popups" v-if="show">
|
|
<view class="sent--popups--item" @click="onPopupsItem('picture')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-00.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">相册</text>
|
|
</view>
|
|
<view class="sent--popups--item" @click="onPopupsItem('film')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-01.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">拍摄</text>
|
|
</view>
|
|
<view class="sent--popups--item" @click="onPopupsItem('video')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-02.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">视频通话</text>
|
|
</view>
|
|
<view class="sent--popups--item" @click="onPopupsItem('location')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-03.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">位置</text>
|
|
</view>
|
|
<view class="sent--popups--item" @click="onPopupsItem('redpacket')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-04.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">红包</text>
|
|
</view>
|
|
<view class="sent--popups--item" @click="onPopupsItem('file')">
|
|
<image class="sent--popups--icon" src="@/static/icon/popups-icon-05.png" mode="widthFix"></image>
|
|
<text class="sent--popups--text">文件</text>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
|
|
};
|
|
},
|
|
props:{
|
|
show: {
|
|
type: Boolean,
|
|
default: false
|
|
}
|
|
},
|
|
methods:{
|
|
onPopupsItem(type){
|
|
switch (type){
|
|
case 'picture':
|
|
uni.chooseImage({
|
|
count: 9,
|
|
sourceType: ['album'],
|
|
success: res => {
|
|
this.onSentValue(type, res.tempFilePaths)
|
|
}
|
|
})
|
|
break;
|
|
case 'film':
|
|
uni.chooseImage({
|
|
sourceType: ['camera'],
|
|
success: res => {
|
|
this.onSentValue(type, res.tempFilePaths)
|
|
}
|
|
})
|
|
break;
|
|
case 'video':
|
|
this.onSentValue(type, {})
|
|
break;
|
|
case 'location':
|
|
uni.chooseLocation({
|
|
success: res=> {
|
|
this.onSentValue(type, {
|
|
address: res.address,
|
|
longitude: res.longitude,
|
|
latitude: res.latitude,
|
|
name: res.name
|
|
})
|
|
}
|
|
})
|
|
break;
|
|
case 'redpacket':
|
|
console.log('红包')
|
|
break;
|
|
case 'file':
|
|
console.log('文件选择')
|
|
break;
|
|
}
|
|
},
|
|
// 处理返回
|
|
onSentValue(type, value){
|
|
this.$emit('onVlaue', { type, value })
|
|
this.show = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.sent--popups{
|
|
background: white;
|
|
padding: 30rpx 15rpx;
|
|
flex-wrap: wrap;
|
|
flex-direction: row;
|
|
&--item{
|
|
width: 150rpx;
|
|
margin: 15rpx;
|
|
}
|
|
&--text{
|
|
text-align: center;
|
|
font-size: 26rpx;
|
|
color: #555;
|
|
padding-top: 15rpx;
|
|
}
|
|
&--icon{
|
|
width: 110rpx;
|
|
height: 110rpx;
|
|
margin: 0 20rpx;
|
|
border-radius: 20rpx;
|
|
background: #F3F6FB;
|
|
}
|
|
}
|
|
</style>
|