Browse Source

fix(mind): make crisis hotline clickable in PsychCrisisBanner via uni.makePhoneCall

Xiaogang Liao 4 tháng trước cách đây
mục cha
commit
c1110dddb1
1 tập tin đã thay đổi với 8 bổ sung và 3 xóa
  1. 8 3
      cfc-frontend/components/PsychCrisisBanner.vue

+ 8 - 3
cfc-frontend/components/PsychCrisisBanner.vue

@@ -83,9 +83,14 @@ export default {
     onAlertTap(alert) {
       uni.showModal({
         title: alert.title,
-        content: alert.message,
-        confirmText: '知道了',
-        showCancel: false
+        content: alert.message + '\n\n紧急心理援助热线:400-161-9995',
+        confirmText: '拨打热线',
+        cancelText: '知道了',
+        success: function(res) {
+          if (res.confirm) {
+            uni.makePhoneCall({ phoneNumber: '400-161-9995' })
+          }
+        }
       })
     },