|
|
- <template>
- <uv-action-sheet
- ref="actionSheet"
- :actions="actionSheet"
- @select="select">
- </uv-action-sheet>
- </template>
-
- <script>
- export default {
- data() {
- return {
- actionSheet : [
- {
- name: '线上客服',
- openType: 'contact'
- },
- {
- name: '电话呼叫',
- type : 'phone',
- },
- ],
- }
- },
- methods: {
- select(e){
- if(e.type == 'phone'){
- uni.makePhoneCall({
- // 手机号 这里可以直接写号码如 12345 也可以写获取号码的字段如this.mobile
- phoneNumber: '123',
- // 成功回调
- success: (res) => {
- console.log('调用成功!')
- },
- })
- }
- },
- open(){
- this.$refs.actionSheet.open()
- }
- }
- }
- </script>
-
- <style>
-
- </style>
|