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