feat(页面): 增加打电话功能

在页面跳转逻辑中增加电话拨打功能,当点击元素包含电话号码时,调用微信API进行拨号
This commit is contained in:
XiaoMo 2025-04-16 23:47:29 +08:00
parent c79b3599cf
commit 7b5e501e6c
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<template name="pageList">
<view class="index-href-box">
<view bindtap="toPage" class="item" data-needlogin="{{item.needlogin}}" data-refresh="{{item.refresh}}" data-showimg="{{item.showimg}}" data-url="{{item.url}}" wx:for="{{urlList}}" wx:key="index">
<view bindtap="toPage" class="item" data-needlogin="{{item.needlogin}}" data-refresh="{{item.refresh}}" data-showimg="{{item.showimg}}" data-url="{{item.url}}" data-phone="{{item.phone}}" wx:for="{{urlList}}" wx:key="index">
<view class="item_b" style="background-image:url({{item.img}}) ;">
<!-- <view class="btn">
<image class="video" src="../../img/video.png" wx:if="{{item.img=='video'}}"></image>

View File

@ -124,6 +124,14 @@ Page({
},
toPage: function (t) {
console.info(t);
// 增加打电话
if (t.currentTarget.dataset.phone) {
wx.makePhoneCall({
phoneNumber: "" + t.currentTarget.dataset.phone
});
return;
}
var a = t.currentTarget.dataset, i = a.url, o = a.needlogin, n = a.showimg;
if (console.log("showImg", n), i) {
this.isneedUpload = !0;