拨号api

This commit is contained in:
jqtmviyu@gmail.com 2021-03-05 22:32:07 +08:00
parent ea33ee8b36
commit aa8b768eb6

View File

@ -1,14 +1,31 @@
<template>
<view>
<view>
<view class="user">
<!-- 1. 已登录 -->
<block v-if="userInfo.nickName">
<image class="user_avatar_bg" :src="userInfo.avatarUrl" mode="aspectFill"></image>
<u-avatar :src="userInfo.avatarUrl" mode="circle" :sex-icon="userInfo.gender===1? 'man' : 'woman'" show-sex="true" size="large" show-level="true" level-icon="level"></u-avatar>
<image
class="user_avatar_bg"
:src="userInfo.avatarUrl"
mode="aspectFill"
></image>
<u-avatar
:src="userInfo.avatarUrl"
mode="circle"
:sex-icon="userInfo.gender===1? 'man' : 'woman'"
show-sex="true"
size="large"
show-level="true"
level-icon="level"
></u-avatar>
<text class="user_nickName">{{userInfo.nickName}}</text>
</block>
<!-- 2. 未登录 -->
<button v-else open-type="getUserInfo" @getuserinfo="getUserInfo" class="user_btn">去登录</button>
<button
v-else
open-type="getUserInfo"
@getuserinfo="getUserInfo"
class="user_btn"
>去登录</button>
</view>
<!-- 3 菜单:宫格布局 -->
@ -59,6 +76,7 @@
icon="server-man"
title="联系客服"
value="400-618-40000"
@click="phoneCall"
></u-cell-item>
<u-cell-item
icon="integral-fill"
@ -66,7 +84,7 @@
value="v4.1.1"
></u-cell-item>
</u-cell-group>
</view>
</view>
</template>
<script>
@ -83,16 +101,21 @@ export default {
getUserInfo({detail: {userInfo}}){
this.userInfo = userInfo
uni.setStorageSync("userInfo",userInfo)
},
phoneCall(){
uni.makePhoneCall({
phoneNumber: '114'
})
}
},
}
</script>
<style lang="scss">
page {
page {
background-color: #f9f9f9;
}
.user {
}
.user {
position: relative;
height: 330rpx;
display: flex;
@ -119,9 +142,9 @@ page {
margin-top: 20rpx;
color: #fff;
}
}
}
.user_avatar_bg {
.user_avatar_bg {
width: 120%;
height: 120%;
position: absolute;
@ -129,10 +152,10 @@ page {
top: -10%;
z-index: -1;
filter: blur(30px) grayscale(20%);
}
}
.grid {
.grid {
margin: 20rpx;
border-radius: 5rpx;
}
}
</style>