拨号api

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

View File

@ -3,12 +3,29 @@
<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"
@ -83,6 +101,11 @@ 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'
})
} }
}, },
} }