<view>
<view class="image" @click="uploadImg">
<image v-for="(item,index) in imgArr" :src="item" style="width: 200px; height: 200px; background-color: #eeeeee;">
</image>
</view>
<view @click="uploadImg" class="click-one"><text>从手机相册上传</text></view>
<view class="to"><text>提交</text></view>
<view class="to" @click="to"><text>通过搜索群号添加</text></view>
</view>
export default{
data(){
return{
imgArr:[]
}
},
methods:{
uploadImg(){
let that = this
uni.chooseImage({
count: 1,
sourceType: ['album'],
success(res) {
console.log(res.tempFilePaths)
that.imgArr = res.tempFilePaths;
console.log(that.imgArr)
}
})
},
to(){
uni.navigateTo({
url:'/pages/chat/search'
})
}
}
}
.image{
margin-top:100rpx;
margin-left: 25%;
width: 200px;
height: 200px;
background-color: #eeeeee;
}
.click-one{
// margin-left: 275rpx;
margin-top: 50rpx;
// display: block;
margin-left: 35%;
}
.to{
background-color: #D44C3B1A;
height:80rpx;
line-height: 80rpx;
margin-top: 100rpx;
width:40%;
text-align: center;
border-radius: 20rpx;
margin-left: auto;
margin-right: auto;
}