1
This commit is contained in:
@@ -1,9 +1,77 @@
|
||||
import request from "@/utils/request"
|
||||
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
s: "李",
|
||||
name: "李医生",
|
||||
title: "主任医师 · 骨科专家",
|
||||
desc: "20年临床经验"
|
||||
},
|
||||
{
|
||||
s: "王",
|
||||
name: "王医生",
|
||||
title: "副主任医师 · 康复医学",
|
||||
desc: "15年临床经验"
|
||||
},
|
||||
{
|
||||
s: "张",
|
||||
name: "张护士长",
|
||||
title: "主管护师 · 伤口护理",
|
||||
desc: "18年护理经验"
|
||||
}
|
||||
],
|
||||
count: 0
|
||||
},
|
||||
onShow() {
|
||||
let userInfo = app.globalData.userInfo
|
||||
this.setData({
|
||||
count: userInfo.consult_remains
|
||||
})
|
||||
this.getTabBar((tabBar) => {
|
||||
tabBar.setData({
|
||||
selected: '专家服务',
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async onPlay() {
|
||||
if (this.data.count <= 0) {
|
||||
wx.showToast({
|
||||
title: '免费次数已用完',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 2. 弹窗确认
|
||||
wx.showModal({
|
||||
title: '拨打专家热线',
|
||||
content: '确认拨打专家咨询电话吗?本次咨询将使用1次免费机会',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
wx.showLoading({ title: '正在呼叫...', mask: true });
|
||||
const info = await request.get("/expert/phone");
|
||||
this.setData({
|
||||
count: this.data.count - 1
|
||||
});
|
||||
wx.hideLoading();
|
||||
|
||||
// 5. 吊起拨号盘
|
||||
if (info && info.expert_phone) {
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: info.expert_phone,
|
||||
});
|
||||
} else {
|
||||
wx.showToast({ title: '暂无专家电话', icon: 'none' });
|
||||
}
|
||||
} catch (error) {
|
||||
wx.hideLoading();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -1,5 +1,6 @@
|
||||
page {
|
||||
background-color: rgba(247, 249, 252, 1);
|
||||
padding-bottom: 200rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
@@ -47,11 +48,175 @@ page {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
|
||||
.btn {
|
||||
padding: 50rpx 0;
|
||||
background-color: rgba(29, 120, 116, 1);
|
||||
}
|
||||
.c-2{
|
||||
|
||||
|
||||
.service-card {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
||||
margin-top: 30rpx;
|
||||
|
||||
.flex-align {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
.icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background-color: #f0f5f0; // 图标背景色
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 12px;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 6px;
|
||||
|
||||
.label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #18a74f; // 绿色
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 12px;
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #18a74f;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 12px;
|
||||
color: #18a74f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.emergency-card {
|
||||
background: rgba(255, 235, 238, 1);
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx;
|
||||
margin-top: 30rpx;
|
||||
gap: 30rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
--color: rgba(198, 40, 40, 1);
|
||||
color: var(--color);
|
||||
|
||||
|
||||
.icon {
|
||||
width: 90rpx;
|
||||
aspect-ratio: 1;
|
||||
background-color: rgba(186, 26, 26, 0.15);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.t-1 {
|
||||
font-weight: 700;
|
||||
font-size: 34rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-weight: 700;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
font-size: 28rpx;
|
||||
line-height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
background-color: var(--color);
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.service {
|
||||
background-color: white;
|
||||
--color: black;
|
||||
|
||||
.icon {
|
||||
background-color: rgba(0, 106, 106, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.express {
|
||||
background-color: white;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.item {
|
||||
gap: 30rpx;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.icon {
|
||||
width: 100rpx;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 50%;
|
||||
color: white;
|
||||
font-weight: 700;
|
||||
background: linear-gradient(rgba(29, 120, 116, 1), rgba(46, 139, 139, 1));
|
||||
}
|
||||
|
||||
.t-1 {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.t-2 {
|
||||
font-size: 28rpx;
|
||||
color: rgba(69, 70, 78, 1);
|
||||
}
|
||||
|
||||
.t-3 {
|
||||
font-size: 24rpx;
|
||||
color: rgba(69, 70, 78, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,21 +14,91 @@
|
||||
<t-icon name="check-circle" />
|
||||
可咨询次数
|
||||
</view>
|
||||
<view class="num">3</view>
|
||||
<view class="num">{{count}}</view>
|
||||
</view>
|
||||
<view class="tip">本月剩余 3 次免费咨询机会</view>
|
||||
<view class="tip">本月剩余 {{count}} 次免费咨询机会</view>
|
||||
</view>
|
||||
|
||||
<t-button block
|
||||
theme="primary"
|
||||
class="btn"
|
||||
icon="call-1">
|
||||
icon="call-1"
|
||||
bind:tap="onPlay">
|
||||
一键拨打专家电话
|
||||
</t-button>
|
||||
|
||||
<view class="c-2 flex-align">
|
||||
<view class="icon">
|
||||
<t-icon name="time" />
|
||||
<view class="service-card">
|
||||
<view class="header flex-align">
|
||||
<view class="icon">
|
||||
<t-icon name="time" />
|
||||
</view>
|
||||
<view class="title">服务时间</view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<view class="row">
|
||||
<view class="label">工作日</view>
|
||||
<view class="time">09:00 - 21:00</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view class="label">周末及节假日</view>
|
||||
<view class="time">10:00 - 18:00</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="status">
|
||||
<view class="dot"></view>
|
||||
<view class="text">当前服务中</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="emergency-card">
|
||||
<view class="icon flex-center">
|
||||
<t-icon name="error-triangle" />
|
||||
</view>
|
||||
<view style="flex: 1;">
|
||||
<view class="t-1">紧急情况处理</view>
|
||||
<view>如遇以下紧急情况,请立即拨打</view>
|
||||
<view style="margin-bottom: 20rpx;"><text class="num">120</text> 或前往急诊</view>
|
||||
|
||||
<view class="list">
|
||||
<view class="item">大量出血或伤口裂开</view>
|
||||
<view class="item">高热不退(体温≥39°C)</view>
|
||||
<view class="item">剧烈疼痛无法缓解</view>
|
||||
<view class="item">呼吸困难或胸痛</view>
|
||||
<view class="item">意识模糊或昏迷</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="emergency-card service">
|
||||
<view class="icon flex-center">
|
||||
<t-icon name="info-circle" />
|
||||
</view>
|
||||
<view style="flex: 1;">
|
||||
<view class="t-1">服务说明</view>
|
||||
|
||||
<view class="list">
|
||||
<view class="item">每次通话时长不超过15分钟</view>
|
||||
<view class="item">专家会根据您的情况提供专业建议</view>
|
||||
<view class="item">复杂问题可能需要您到院面诊</view>
|
||||
<view class="item">建议提前准备好相关检查报告</view>
|
||||
<view class="item">咨询记录会同步到您的康复档案</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="express">
|
||||
<view style="font-weight: 700;">专家团队</view>
|
||||
<view class="item flex-align"
|
||||
wx:for="{{list}}"
|
||||
wx:key="index">
|
||||
<view class="icon flex-center">{{item.s}}</view>
|
||||
<view>
|
||||
<view class="t-1">{{item.name}}</view>
|
||||
<view class="t-2">{{item.title}}</view>
|
||||
<view class="t-3">{{item.desc}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user