UNPKG

minix-template

Version:

minix template

101 lines (99 loc) 2.24 kB
/* * @Description: * @Autor: tangsj * @Date: 2022-05-12 11:02:42 * @LastEditTime: 2022-05-23 16:42:05 */ import router from '@system.router' import prompt from '@system.prompt' export default { data: { telphoneList:[ { name:'callTel', // url:'pages/base/canlUse/index', describe:'拨打电话接口(Promise返回)' }, { name:'callTelList', // url:'pages/base/log/index', describe:'弹出拨打电话列表接口(从APP整屏底部弹出)' } ] }, goRouter(url){ router.push({ uri: url, }) }, /** * @description: 获取ios设备,是否支持SiriShortcut * @param {*} * @return {*} */ callTel(){ const params={ tel: '18407716176', // 拨打的电话号码 title: '客户服务', // 确认框的标题,如“客户服务” desc: '拨打热线电话', // 确认框的描述,如“拨打热线电话:” confirmText: '确认按钮', //测试的时候 ios 才生效 cancelText: '取消按钮', //测试的时候 ios 才生效 isDirectCall: false, // 是否直接拨打电话 } this.$app.$def.bridge.callTel(params) .then((res)=>{ prompt.showToast({ message: res, duration: 200, }) }).catch((err)=>{ prompt.showToast({ message: '接口调用失败', duration: 200, }) }) }, /** * @description: 添加场景到Siri Shortcut * @param {*} * @return {*} */ callTelList(){ const params = [ { tel: '13535676678', title: '美的:', desc: '在线客服', }, { tel: '18888888888', title: '美的:', desc: '在线客服2', }, ] this.$app.$def.bridge.callTelList(params) .then((res)=>{ prompt.showToast({ message: res, duration: 200, }) }).catch((err)=>{ prompt.showToast({ message: '接口调用失败', duration: 200, }) }) }, testBridge(name){ switch(name){ case 'callTel': this.callTel() break; case 'callTelList': this.callTelList() break; default: break; } } }