作业详情:链接:https://pan.baidu.com/s/1HfqLEaJNSu_h-t09bhwVDw
提取码:avkn
完善前一天学习的任务,将页面map,页面我的进行完善。
在页面map上利用show-location属性显示带有方向的当前定位点
在页面我的添加背景图片,由于background: url()的参数只能是base64或者网页链接的形式,本次利用base64将本地图片转化为连接形式,在.js文件内利用
wx.chooseImage({
success: function (res) {
console.log(wx.getFileSystemManager().readFileSync(res.tempFilePaths[0], "base64"))
},在日志中获取,然后再base64获取的链接复制粘贴至.wxss中的background: url(),然会对所获取的用户头像与用户名进行相关布局:
page{
height:100%;
}
.container{
height:350rpx;
width:100%;
}
.auto-img{
width:100%;
height:100%;
display:block;
}
.userimage{
height:150rpx;
width:150rpx;
/* border-radius:50%; */
clip-path: circle(50rpx at center);
}
.bg>text{
color:white;
}