feat: 拨打电话调整

This commit is contained in:
gcd 2025-04-21 21:45:43 +08:00
parent e6ff122ee9
commit a1f1bd46b8
3 changed files with 19 additions and 12 deletions

View File

@ -27,7 +27,7 @@
</view>
<view class="item-row flex-sb line-after">
<view class="title flex-l">客户电话</view>
<view class="value flex-r value-theme">
<view class="value flex-r value-theme" @click="helpers.makePhoneCall(data.order_info.tel)">
<me-icon class="icon" type="icon-call" color="var(--themeColor)" size="40rpx"></me-icon>
<text>{{ data.order_info.tel }}</text>
</view>

View File

@ -50,7 +50,7 @@
<view class="phone flex-l">{{ item.order_info.tel }}</view>
</view>
<view class="right flex-c">
<view @click="call(item.order_info.tel)" class="icon-ctr flex-c" hover-class="auto-mask-layer-radius8" hover-stay-time="100">
<view @click="helpers.makePhoneCall(item.order_info.tel)" class="icon-ctr flex-c" hover-class="auto-mask-layer-radius8" hover-stay-time="100">
<me-icon type="icon-call" color="var(--themeColor)" size="80rpx"></me-icon>
</view>
</view>
@ -112,16 +112,6 @@ const getOrderStatusText = (status) => {
return enums.WORKBENCH_STATUS_TEXT[status]
}
/**
* 拨打电话
* @param tel
*/
const call = (tel) => {
uni.makePhoneCall({
phoneNumber: tel
});
}
onShow(() => {
init()
})

View File

@ -139,6 +139,11 @@ class helpers {
return datetimeStr.slice(0, 16);
}
/**
* 打开客户地址
* @param lat
* @param lng
*/
static openLocation (lat, lng) {
uni.openLocation({
latitude: Number(lat),
@ -148,5 +153,17 @@ class helpers {
}
});
}
/**
* 拨打电话
* @param tel
*/
static makePhoneCall (tel){
uni.makePhoneCall({
phoneNumber: tel,
fail: function () {
}
});
}
}
export default helpers