關於在 bbpress 中插入撥打電話代碼,無法插入代碼

正在查看 7 個帖子:1-7 (共 7 個帖子)
  • 作者
    帖子
  • qq774526879
    參與者
    • 文章數量: 10
    @qq774526879
    樓主

    最近在調試 WordPress 和 bbpress 的時候有人發帖是想把電話發在裏面,不過不能點擊電話直接撥打,我試着把撥打電話的 js 代碼插入進去,還是不能調用打電話,不知道怎麼回事

    詩語
    管理員
    • 文章數量: 5,930
    @feibisi

    打電話的不應該是這種形式嗎 tel:0916-8131992 不知道你具體想要實現什麼效果,在一個撥打電話一般電腦上是無效的,必須手機點擊才行。

    qq774526879
    參與者
    • 文章數量: 10
    @qq774526879
    樓主

    在微信打開有關係嗎,在手機瀏覽器打開可以撥打電話,微信要怎麼設置

    qq774526879
    參與者
    • 文章數量: 10
    @qq774526879
    樓主

    我想在微信打開,

    詩語
    管理員
    • 文章數量: 5,930
    @feibisi

    你得插入微信電話的協議才能喚醒微信電話。

    qq774526879
    參與者
    • 文章數量: 10
    @qq774526879
    樓主

    微信的電話協議是什麼,能説一下嗎

    詩語
    管理員
    • 文章數量: 5,930
    @feibisi

    iOS 版的:

    //跳轉到 qq 聊天界面
    
    + (void)callQQ:(NSString*)qq {
    
    if([selfisQQInstalled]) {
    
    NSString* qqUrl = [NSStringstringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",qq];
    
    UIWebView* webview = [[UIWebViewalloc]initWithFrame:CGRectZero];
    
    [[UIApplicationsharedApplication].keyWindowaddSubview:webview];
    
    NSURL*url = [NSURLURLWithString:qqUrl];
    
    NSURLRequest*request = [NSURLRequestrequestWithURL:url];
    
    [webviewloadRequest:request];
    
    }
    
    }
    
    + (BOOL)isQQInstalled{
    
    NSString*urlStr = [NSStringstringWithFormat:@"mqqapi://card/show_pslcard?src_type=internal&version=1&uin=6481427ed9be2a6b6df78d95f2abf8a0ebaed07baefe3a2bea8bd847cb9d84ed&card_type=group&source=external"];
    
    NSURL*url = [NSURLURLWithString:urlStr];
    
    if([[UIApplicationsharedApplication]canOpenURL:url]){
    
    returnYES;
    
    }
    
    else{
    
    [YBAlertViewalertWithTile:@" 提示"message:@" 尚未安裝 QQ,請安裝 QQ 後重試"delegate:nilbtn1:@" 確定"btn2:nil];
    
    returnNO;
    
    }
    
    }
    
    //跳轉到微信
    
    + (void)callWeChat:(NSString*)Weixin {
    
    if([selfisWeChatInstalled]) {
    
    NSString* qqUrl = [NSStringstringWithFormat:@"weixin://"];
    
    UIWebView* webview = [[UIWebViewalloc]initWithFrame:CGRectZero];
    
    [[UIApplicationsharedApplication].keyWindowaddSubview:webview];
    
    NSURL*url = [NSURLURLWithString:qqUrl];
    
    NSURLRequest*request = [NSURLRequestrequestWithURL:url];
    
    [webviewloadRequest:request];
    
    }
    
    }
    
    + (BOOL)isWeChatInstalled{
    
    NSString*urlStr = [NSStringstringWithFormat:@"weixin://"];
    
    NSURL*url = [NSURLURLWithString:urlStr];
    
    if([[UIApplicationsharedApplication]canOpenURL:url]){
    
    NSLog(@" 已安裝微信了");
    
    returnYES;
    
    }
    
    else{
    
    [YBAlertViewalertWithTile:@" 提示"message:@" 尚未安裝微信,請安裝微信後重試"delegate:nilbtn1:@" 確定"btn2:nil];
    
    returnNO;
    
    }
    
    }
    
    //打電話
    
    + (void)callPhone:(NSString*)phone {
    
    NSMutableString* str=[[NSMutableStringalloc]initWithFormat:@"tel:%@",phone];
    
    UIWebView* callWebview = [[UIWebViewalloc]init];
    
    [callWebviewloadRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:str]]];
    
    [[UIApplicationsharedApplication].keyWindowaddSubview:callWebview];
    
    }

    Android 版的:

    https://blog.csdn.net/pksport/article/details/78287006

正在查看 7 個帖子:1-7 (共 7 個帖子)
  • 哎呀,回覆話題必需登錄。

話題信息

  • 當前位於:bbPress
  • 6 條回覆
  • 2 個參與人
  • 最後回覆:<a href="https://bbs.weixiaoduo.com/users/feibisi/" title=" 查看詩語的個人資料" class="bbp-author-link"><span class="bbp-author-name"> 詩語</span></a>
  • 上次活動:<a href="https://bbs.weixiaoduo.com/topic/25340/#post-25347" title=" 回覆至:關於在 bbpress 中插入撥打電話代碼,無法插入代碼">7 年、 1 月前</a>