客服电话换接口获取
This commit is contained in:
parent
e89470df68
commit
126e236cc2
|
|
@ -26,17 +26,31 @@
|
|||
<script>
|
||||
import permissionUtils from "@/utils/per";
|
||||
import locationService from "@/utils/locationService";
|
||||
export default {
|
||||
import request from "@/utils/request";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShowPer: false, // 控制电话权限说明视图显示
|
||||
phone: '19950079687'
|
||||
phone: '19950079687' // 默认号码,接口失败时使用
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.phone = options.phone || '19950079687'
|
||||
// 调用接口获取客服电话
|
||||
this.getCustomerService();
|
||||
},
|
||||
methods: {
|
||||
// 获取客服电话
|
||||
async getCustomerService() {
|
||||
try {
|
||||
const res = await request.post('/sj/poster/getCustomerService');
|
||||
if (res.code === 200 && res.data && res.data.phone) {
|
||||
this.phone = res.data.phone;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取客服电话失败', error);
|
||||
}
|
||||
},
|
||||
// 拨打电话
|
||||
async callPhone() {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
|
@ -90,7 +104,7 @@ import locationService from "@/utils/locationService";
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue