圆形头像
<image src="/images/avatar.png" style='width:200rpx; height:200rpx; border-radius: 50%;'></image>
拨打电话
<text bindtap='call' style='color:#1c8cff;'>0571-10086</text>
call() {
wx.makePhoneCall({
phoneNumber: '0571-10086'
})
}
空格及换行
<text decode="{{true}}">
A p p B l o g . C N \n你 好
</text>
<text>你\t好!AppBlog.CN\n这是第二行</text>
PS:必须在text标签中!
PS:经测试,多个\t只能显示一个空格
对象与字符串互转
JSON.stringify(user)
JSON.parse(json)
对象传递
wx.navigateTo({
url: '/pages/index/index?from=index&user=' + JSON.stringify(this.data.user)
})
var user = JSON.parse(options.user);
元素覆盖:position:absolute
<view style="position:absolute; left:0rpx; top:0rpx; width:100%; background-color:rgba(0,0,0,.25); visibility:{{visibility}};">
<image src="/images/share_tip.png"></image>
</view>
回退至最前页面
var pages = getCurrentPages(); //获取当前页面信息栈
console.log("pages.length: " + pages.length)
wx.navigateBack({
delta: pages.length
})




