Jelajahi Sumber

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

Xiaogang Liao 4 bulan lalu
induk
melakukan
c1110dddb1
1 mengubah file dengan 8 tambahan dan 3 penghapusan
  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' })
+          }
+        }
       })
     },