dengjie ;拨打电话功能

This commit is contained in:
邓洁
2023-02-04 20:01:53 +08:00
parent 08ebc6574d
commit 4b40658fb5
6 changed files with 59 additions and 23 deletions

View File

@@ -79,7 +79,7 @@
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirmCall" @cancel="cancelCall">
<view>
<view>{{phone}}</view>
<view style="text-indent: 25rpx;">{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
@@ -114,13 +114,14 @@
isLoad: true,
showM: false,
showCall: false,
phone: '138 1222 222',
mobile: '',
content: '您暂无权限访问请升级VIP访问'
}
},
onLoad(option) {
this.id = option.id
this.getProductDetail()
this.getCsTel()
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
@@ -129,6 +130,12 @@
this.isLoad = true
},
methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
@@ -229,7 +236,8 @@
},
confirmCall() {
this.showCall = false
let phone = '1381222222'
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
@@ -248,6 +256,11 @@
</script>
<style lang="scss">
// .u-modal__content {
// padding: 43rpx 104rpx !important;
// text-indent: 25rpx;
// }
.collect {
display: flex;
position: absolute;

View File

@@ -1,7 +1,7 @@
<template>
<view class="login-content">
<view style="text-align: center;margin-bottom:30rpx;">
<text>请登录后查看</text>
<text>{{loginText}}</text>
</view>
<view style="padding-left: 30rpx;padding-right: 30rpx;display: flex;">
<u-button type="info" :plain="true" size="nomal" @click="$emit('fail')">取消</u-button>
@@ -18,7 +18,20 @@
} from '@/service/request.js'
export default {
data() {
return {}
return {
loginText: '请登录后查看'
}
},
props: {
timoutText: {
type: String,
default: ''
}
},
created() {
if (this.timoutText == 1) {
this.loginText = "登录超时,请重新登录"
}
},
methods: {
getphonenumber(e) {

View File

@@ -111,7 +111,8 @@
},
confirm() {
this.showM = false
let phone = ''
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {