Przeglądaj źródła

打开电力医院小程序,开发中

gjh 1 dzień temu
rodzic
commit
bc607da2b3

+ 5 - 0
android/app/proguard-rules.pro

@@ -203,4 +203,9 @@
203 203
 #vlc播放器
204 204
 -keep class org.videolan.libvlc.** { *; }
205 205
 
206
+#微信SDK
207
+-keep class com.tencent.mm.opensdk.** { *; }
208
+-keep class com.tencent.wxop.** { *; }
209
+-keep class com.tencent.mm.sdk.** { *; }
210
+
206 211
 #--------------------------第三方库End--------------------------------------

+ 11 - 6
lib/funcs.dart

@@ -732,12 +732,6 @@ void popAllRoutes(BuildContext context) {
732 732
   AutoRouter.of(context).popUntil((_) => false);
733 733
 }
734 734
 
735
-///是否是慧视健康
736
-bool get isHsjk => appFlavor == flavorHsjk;
737
-
738
-///是否是慧视通
739
-bool get isHst => appFlavor == flavorHst;
740
-
741 735
 ///app名字
742 736
 String get appName =>
743 737
     switch (appFlavor) { flavorHst => getS().appNameHst, _ => getS().appName };
@@ -747,3 +741,14 @@ void exitApp() async {
747 741
   await SystemNavigator.pop();
748 742
   //exit(0);
749 743
 }
744
+
745
+///微信是否安装
746
+///
747
+/// [toast] 是否显示提示,默认true
748
+Future<bool> isWxInstalled({bool toast = true}) async {
749
+  bool bo = await fluwx.isWeChatInstalled;
750
+  if (!bo && toast) {
751
+    showToast(text: getS().wxNotInstalledHint);
752
+  }
753
+  return bo;
754
+}

+ 9 - 1
lib/generated/intl/messages_en.dart

@@ -83,6 +83,7 @@ class MessageLookup extends MessageLookupByLibrary {
83 83
             MessageLookupByLibrary.simpleMessage("Connection error"),
84 84
         "connectTimeout":
85 85
             MessageLookupByLibrary.simpleMessage("The connection timed out"),
86
+        "consultationNow": MessageLookupByLibrary.simpleMessage("Enquire now"),
86 87
         "delayShot": MessageLookupByLibrary.simpleMessage("Delayed shooting"),
87 88
         "delayShotColon":
88 89
             MessageLookupByLibrary.simpleMessage("Delayed shooting:"),
@@ -104,6 +105,8 @@ class MessageLookup extends MessageLookupByLibrary {
104 105
         "downloadFailed":
105 106
             MessageLookupByLibrary.simpleMessage("The download failed"),
106 107
         "downloading": MessageLookupByLibrary.simpleMessage("Downloading"),
108
+        "electricityHospitalConsultationDesc": MessageLookupByLibrary.simpleMessage(
109
+            "The oral observer is a recommended instrument for the Department of Stomatology of Beijing Electric Power Hospital, and the photos taken through the instrument can be used for free online consultation, and the consultation is unlimited and free of charge."),
107 110
         "exitApp": MessageLookupByLibrary.simpleMessage("Quit the app"),
108 111
         "faq1Desc1": MessageLookupByLibrary.simpleMessage(
109 112
             "1. Check whether the observation instrument is in normal use. \nCheck whether the observer is powered on and whether the battery is low in combination with the <Oral Observer Instruction Manual>."),
@@ -115,6 +118,8 @@ class MessageLookup extends MessageLookupByLibrary {
115 118
             "Still can\'t link the viewer after following the instructions?"),
116 119
         "faqs": MessageLookupByLibrary.simpleMessage("FAQS"),
117 120
         "female": MessageLookupByLibrary.simpleMessage("Female"),
121
+        "freeConsultation":
122
+            MessageLookupByLibrary.simpleMessage("Free consultation"),
118 123
         "gateError": MessageLookupByLibrary.simpleMessage("Wrong gateway"),
119 124
         "gateTimeout":
120 125
             MessageLookupByLibrary.simpleMessage("The gateway timed out"),
@@ -130,7 +135,7 @@ class MessageLookup extends MessageLookupByLibrary {
130 135
         "hasStopRecord":
131 136
             MessageLookupByLibrary.simpleMessage("Recording has been stopped"),
132 137
         "hint": MessageLookupByLibrary.simpleMessage("Tips"),
133
-        "history": MessageLookupByLibrary.simpleMessage("History"),
138
+        "history": MessageLookupByLibrary.simpleMessage("Historical imagery"),
134 139
         "idCard": MessageLookupByLibrary.simpleMessage("ID number"),
135 140
         "install": MessageLookupByLibrary.simpleMessage("Install"),
136 141
         "leftBototmArea":
@@ -264,6 +269,7 @@ class MessageLookup extends MessageLookupByLibrary {
264 269
             MessageLookupByLibrary.simpleMessage("Server internal error"),
265 270
         "serverRejectExec": MessageLookupByLibrary.simpleMessage(
266 271
             "The server refuses to execute"),
272
+        "serviceCenter": MessageLookupByLibrary.simpleMessage("Service Center"),
267 273
         "settings": MessageLookupByLibrary.simpleMessage("Settings"),
268 274
         "showVideoError":
269 275
             MessageLookupByLibrary.simpleMessage("The video is abnormal"),
@@ -321,6 +327,8 @@ class MessageLookup extends MessageLookupByLibrary {
321 327
         "video": MessageLookupByLibrary.simpleMessage("Video"),
322 328
         "waitingConnectDevice": MessageLookupByLibrary.simpleMessage(
323 329
             "Waiting for the device to connect"),
330
+        "wxNotInstalledHint":
331
+            MessageLookupByLibrary.simpleMessage("Please install WeChat first"),
324 332
         "xxAge": m6,
325 333
         "xxSecond": m7
326 334
       };

+ 8 - 1
lib/generated/intl/messages_zh.dart

@@ -71,6 +71,7 @@ class MessageLookup extends MessageLookupByLibrary {
71 71
         "connect": MessageLookupByLibrary.simpleMessage("连接"),
72 72
         "connectError": MessageLookupByLibrary.simpleMessage("连接错误"),
73 73
         "connectTimeout": MessageLookupByLibrary.simpleMessage("连接超时"),
74
+        "consultationNow": MessageLookupByLibrary.simpleMessage("立即咨询"),
74 75
         "delayShot": MessageLookupByLibrary.simpleMessage("延迟拍摄"),
75 76
         "delayShotColon": MessageLookupByLibrary.simpleMessage("延迟拍摄:"),
76 77
         "delayTimeColon": MessageLookupByLibrary.simpleMessage("延迟时间:"),
@@ -85,6 +86,9 @@ class MessageLookup extends MessageLookupByLibrary {
85 86
         "downloadComplete": MessageLookupByLibrary.simpleMessage("下载完毕"),
86 87
         "downloadFailed": MessageLookupByLibrary.simpleMessage("下载失败"),
87 88
         "downloading": MessageLookupByLibrary.simpleMessage("正在下载中"),
89
+        "electricityHospitalConsultationDesc":
90
+            MessageLookupByLibrary.simpleMessage(
91
+                "口腔观察仪为北京电力医院口腔科推荐仪器,通过仪器拍摄的照片可用于免费在线咨询,咨询不限次数、不另收费。"),
88 92
         "exitApp": MessageLookupByLibrary.simpleMessage("退出应用"),
89 93
         "faq1Desc1": MessageLookupByLibrary.simpleMessage(
90 94
             "1、检查观察仪器是否正常使用。\n结合《口腔观察仪使用说明书》检查观察仪是否开机状态,是否低电量。"),
@@ -94,6 +98,7 @@ class MessageLookup extends MessageLookupByLibrary {
94 98
         "faq1Title": MessageLookupByLibrary.simpleMessage("按照操作指引仍无法链接观察仪?"),
95 99
         "faqs": MessageLookupByLibrary.simpleMessage("常见问题"),
96 100
         "female": MessageLookupByLibrary.simpleMessage("女"),
101
+        "freeConsultation": MessageLookupByLibrary.simpleMessage("免费咨询"),
97 102
         "gateError": MessageLookupByLibrary.simpleMessage("错误网关"),
98 103
         "gateTimeout": MessageLookupByLibrary.simpleMessage("网关超时"),
99 104
         "gender": MessageLookupByLibrary.simpleMessage("性别"),
@@ -105,7 +110,7 @@ class MessageLookup extends MessageLookupByLibrary {
105 110
         "hasStartRecord": MessageLookupByLibrary.simpleMessage("已开始录像"),
106 111
         "hasStopRecord": MessageLookupByLibrary.simpleMessage("已停止录像"),
107 112
         "hint": MessageLookupByLibrary.simpleMessage("提示"),
108
-        "history": MessageLookupByLibrary.simpleMessage("历史记录"),
113
+        "history": MessageLookupByLibrary.simpleMessage("历史影像"),
109 114
         "idCard": MessageLookupByLibrary.simpleMessage("身份证号"),
110 115
         "install": MessageLookupByLibrary.simpleMessage("安装"),
111 116
         "leftBototmArea": MessageLookupByLibrary.simpleMessage("左下区"),
@@ -205,6 +210,7 @@ class MessageLookup extends MessageLookupByLibrary {
205 210
         "serverError": MessageLookupByLibrary.simpleMessage("服务器异常"),
206 211
         "serverInternalError": MessageLookupByLibrary.simpleMessage("服务器内部错误"),
207 212
         "serverRejectExec": MessageLookupByLibrary.simpleMessage("服务器拒绝执行"),
213
+        "serviceCenter": MessageLookupByLibrary.simpleMessage("服务中心"),
208 214
         "settings": MessageLookupByLibrary.simpleMessage("设置"),
209 215
         "showVideoError": MessageLookupByLibrary.simpleMessage("显示视频异常"),
210 216
         "splashTitle": MessageLookupByLibrary.simpleMessage("慧视健康管理"),
@@ -251,6 +257,7 @@ class MessageLookup extends MessageLookupByLibrary {
251 257
         "video": MessageLookupByLibrary.simpleMessage("视频"),
252 258
         "waitingConnectDevice":
253 259
             MessageLookupByLibrary.simpleMessage("正在等待设备连接"),
260
+        "wxNotInstalledHint": MessageLookupByLibrary.simpleMessage("请先安装微信"),
254 261
         "xxAge": m6,
255 262
         "xxSecond": m7
256 263
       };

+ 52 - 2
lib/generated/l10n.dart

@@ -110,10 +110,10 @@ class S {
110 110
     );
111 111
   }
112 112
 
113
-  /// `History`
113
+  /// `Historical imagery`
114 114
   String get history {
115 115
     return Intl.message(
116
-      'History',
116
+      'Historical imagery',
117 117
       name: 'history',
118 118
       desc: '',
119 119
       args: [],
@@ -1839,6 +1839,56 @@ class S {
1839 1839
       args: [],
1840 1840
     );
1841 1841
   }
1842
+
1843
+  /// `Service Center`
1844
+  String get serviceCenter {
1845
+    return Intl.message(
1846
+      'Service Center',
1847
+      name: 'serviceCenter',
1848
+      desc: '',
1849
+      args: [],
1850
+    );
1851
+  }
1852
+
1853
+  /// `Free consultation`
1854
+  String get freeConsultation {
1855
+    return Intl.message(
1856
+      'Free consultation',
1857
+      name: 'freeConsultation',
1858
+      desc: '',
1859
+      args: [],
1860
+    );
1861
+  }
1862
+
1863
+  /// `The oral observer is a recommended instrument for the Department of Stomatology of Beijing Electric Power Hospital, and the photos taken through the instrument can be used for free online consultation, and the consultation is unlimited and free of charge.`
1864
+  String get electricityHospitalConsultationDesc {
1865
+    return Intl.message(
1866
+      'The oral observer is a recommended instrument for the Department of Stomatology of Beijing Electric Power Hospital, and the photos taken through the instrument can be used for free online consultation, and the consultation is unlimited and free of charge.',
1867
+      name: 'electricityHospitalConsultationDesc',
1868
+      desc: '',
1869
+      args: [],
1870
+    );
1871
+  }
1872
+
1873
+  /// `Enquire now`
1874
+  String get consultationNow {
1875
+    return Intl.message(
1876
+      'Enquire now',
1877
+      name: 'consultationNow',
1878
+      desc: '',
1879
+      args: [],
1880
+    );
1881
+  }
1882
+
1883
+  /// `Please install WeChat first`
1884
+  String get wxNotInstalledHint {
1885
+    return Intl.message(
1886
+      'Please install WeChat first',
1887
+      name: 'wxNotInstalledHint',
1888
+      desc: '',
1889
+      args: [],
1890
+    );
1891
+  }
1842 1892
 }
1843 1893
 
1844 1894
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 20 - 14
lib/global.dart

@@ -1,5 +1,5 @@
1
-import 'package:eitc_erm_dental_flutter/funcs.dart';
2 1
 import 'package:flutter/services.dart';
2
+import 'package:fluwx/fluwx.dart';
3 3
 import 'package:image/image.dart';
4 4
 
5 5
 ///设备WIFI前缀,固定的
@@ -11,20 +11,9 @@ const String flavorHsjk = "hsjk";
11 11
 ///Flavor慧视通
12 12
 const String flavorHst = "hst";
13 13
 
14
-///慧视健康IOS appid
15
-const String _iosAppIdHsjk = "6737254914";
16
-
17
-///慧视通IOS appid
18
-const String _iosAppIdHst = "00000000";
19
-
20 14
 ///IOS的appid,默认返回慧视健康的
21
-String get iosAppId {
22
-  if (isHst) {
23
-    return _iosAppIdHst;
24
-  } else {
25
-    return _iosAppIdHsjk;
26
-  }
27
-}
15
+String get iosAppId =>
16
+    switch (appFlavor) { flavorHst => "00000000", _ => "6737254914" };
28 17
 
29 18
 ///上传接口appid
30 19
 const String uploadApplicationKey = "GK-KQJ";
@@ -77,3 +66,20 @@ fPgs/mANKCixDwNFOIAFvTnKUvGgxVhBXpFL8Ma/J0cCAwEAAQ==
77 66
 
78 67
 ///国康RSA加密密钥长度
79 68
 final int gkRsaKeyBitLength = 512;
69
+
70
+///Fluwx实例
71
+final Fluwx fluwx = Fluwx();
72
+
73
+///微信APPid
74
+String get wxAppId => switch (appFlavor) { _ => "" };
75
+
76
+///微信SDK使用的IOS的universalLink
77
+String get wxUniversalLink => switch (appFlavor) { _ => "" };
78
+
79
+///医院小程序ID
80
+String get hospitalMiniProgramId =>
81
+    switch (appFlavor) { _ => "gh_ec8e805a6e13" };
82
+
83
+///医院小程序路径
84
+String? get hospitalMiniProgramPath =>
85
+    switch (appFlavor) { _ => "index/index?page=BRANCH&id=207001" };

+ 7 - 2
lib/l10n/intl_en.arb

@@ -5,7 +5,7 @@
5 5
   "splashTitleHst": "Wisdom Health Management",
6 6
   "appSlogan": "Take photos in HD and upload them easily",
7 7
   "appSlogan2": "Dental experts online — providing professional health guidance",
8
-  "history": "History",
8
+  "history": "Historical imagery",
9 9
   "showVideoError": "The video is abnormal",
10 10
   "waitingConnectDevice": "Waiting for the device to connect",
11 11
   "notConnectDesc1": "1. Turn on the Wisdom Dental Viewer, the device will automatically start WiFi, the WiFi name is mlg + device number (for example mlg_L240684), and use your mobile phone to connect to this WiFi.",
@@ -177,5 +177,10 @@
177 177
   "selectRecord": "Select Recording",
178 178
   "selectPhotoAndRecord": "Select Photo & Video Recording",
179 179
   "maxSelectCountXx": "You can choose up to {count}",
180
-  "pleaseSelectAtLastOne": "Please select at least one"
180
+  "pleaseSelectAtLastOne": "Please select at least one",
181
+  "serviceCenter": "Service Center",
182
+  "freeConsultation": "Free consultation",
183
+  "electricityHospitalConsultationDesc": "The oral observer is a recommended instrument for the Department of Stomatology of Beijing Electric Power Hospital, and the photos taken through the instrument can be used for free online consultation, and the consultation is unlimited and free of charge.",
184
+  "consultationNow": "Enquire now",
185
+  "wxNotInstalledHint": "Please install WeChat first"
181 186
 }

+ 7 - 2
lib/l10n/intl_zh.arb

@@ -5,7 +5,7 @@
5 5
   "splashTitleHst": "慧视通健康管理",
6 6
   "appSlogan": "高清拍照,轻松上传",
7 7
   "appSlogan2": "口腔专家在线 — 提供专业健康指导",
8
-  "history": "历史记录",
8
+  "history": "历史影像",
9 9
   "showVideoError": "显示视频异常",
10 10
   "waitingConnectDevice": "正在等待设备连接",
11 11
   "notConnectDesc1": "1、打开慧视口腔观察仪,设备会自动启动WiFi,WiFi名称为mlg+设备编号(例mlg_L240684),使用手机连接此WiFi。",
@@ -177,5 +177,10 @@
177 177
   "selectRecord": "选择录像",
178 178
   "selectPhotoAndRecord": "选择照片和录像",
179 179
   "maxSelectCountXx": "最多可以选择{count}项",
180
-  "pleaseSelectAtLastOne": "请至少选择一项"
180
+  "pleaseSelectAtLastOne": "请至少选择一项",
181
+  "serviceCenter": "服务中心",
182
+  "freeConsultation": "免费咨询",
183
+  "electricityHospitalConsultationDesc": "口腔观察仪为北京电力医院口腔科推荐仪器,通过仪器拍摄的照片可用于免费在线咨询,咨询不限次数、不另收费。",
184
+  "consultationNow": "立即咨询",
185
+  "wxNotInstalledHint": "请先安装微信"
181 186
 }

+ 5 - 0
lib/main.dart

@@ -60,6 +60,11 @@ Future _initSettings() async {
60 60
   if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) {
61 61
     await InAppWebViewController.setWebContentsDebuggingEnabled(kDebugMode);
62 62
   }
63
+
64
+  //注册微信SDK
65
+  /*bool wxResult =
66
+      await fluwx.registerApi(appId: wxAppId, universalLink: wxUniversalLink);
67
+  logd("微信SDK注册结果=$wxResult");*/
63 68
 }
64 69
 
65 70
 void _loadFonts() async {

+ 130 - 40
lib/pages/history/history_page.dart

@@ -6,12 +6,16 @@ import 'package:eitc_erm_dental_flutter/entity/history_item_info.dart';
6 6
 import 'package:eitc_erm_dental_flutter/funcs.dart';
7 7
 import 'package:eitc_erm_dental_flutter/pages/history/vm/history_view_model.dart';
8 8
 import 'package:eitc_erm_dental_flutter/pages/history/widget/history_item_view.dart';
9
+import 'package:eitc_erm_dental_flutter/widget/custom_divider.dart';
9 10
 import 'package:eitc_erm_dental_flutter/widget/empty_widget.dart';
10 11
 import 'package:eitc_erm_dental_flutter/widget/loading_widget.dart';
11 12
 import 'package:eitc_erm_dental_flutter/widget/main_button.dart';
12 13
 import 'package:flutter/material.dart';
13 14
 import 'package:flutter_riverpod/flutter_riverpod.dart';
14 15
 import 'package:flutter_screenutil/flutter_screenutil.dart';
16
+import 'package:fluwx/fluwx.dart';
17
+
18
+import '../../global.dart';
15 19
 
16 20
 ///历史记录页面
17 21
 @RoutePage(name: "historyRoute")
@@ -23,12 +27,6 @@ class HistoryPage extends ConsumerStatefulWidget {
23 27
 }
24 28
 
25 29
 class _HistoryPageState extends ConsumerState<HistoryPage> {
26
-  //照片列表
27
-  final List<HistoryItemInfo> _photoList = [];
28
-
29
-  //视频列表
30
-  final List<HistoryItemInfo> _videoList = [];
31
-
32 30
   @override
33 31
   void initState() {
34 32
     super.initState();
@@ -45,6 +43,8 @@ class _HistoryPageState extends ConsumerState<HistoryPage> {
45 43
             padding: EdgeInsets.symmetric(horizontal: 16.w),
46 44
             child: Column(
47 45
               children: [
46
+                _getConsultations(context),
47
+                _getHistoryTitle(),
48 48
                 _getSelectedCount(context),
49 49
                 Expanded(child: _getListWidget(context)),
50 50
                 _getBottomButtons(context),
@@ -74,47 +74,127 @@ class _HistoryPageState extends ConsumerState<HistoryPage> {
74 74
     return AppBar(
75 75
       centerTitle: true,
76 76
       forceMaterialTransparency: true,
77
-      title: Text(getS().history),
77
+      title: Text(getS().serviceCenter),
78 78
       leading: IconButton(
79 79
           onPressed: () {
80 80
             Navigator.pop(context);
81 81
           },
82 82
           icon: Icon(
83 83
               Platform.isIOS ? Icons.arrow_back_ios_new : Icons.arrow_back)),
84
-      actions: [
85
-        PopupMenuButton(
86
-            icon: const Icon(Icons.menu),
87
-            //弹出菜单背景色
88
-            color: const Color(0xFF383838),
89
-            //背景形状
90
-            shape: RoundedRectangleBorder(
91
-                borderRadius: BorderRadius.circular(8.r)),
92
-            itemBuilder: (ctx) {
93
-              return [
94
-                PopupMenuItem(
95
-                  child: SizedBox(
96
-                    width: double.infinity,
97
-                    child: Text(
98
-                      getS().byTime,
99
-                      textAlign: TextAlign.center,
100
-                      style: const TextStyle(color: Colors.white),
101
-                    ),
102
-                  ),
103
-                  onTap: () => _updateListType(0),
104
-                ),
105
-                PopupMenuItem(
106
-                  child: SizedBox(
107
-                    width: double.infinity,
108
-                    child: Text(
109
-                      getS().byCategory,
110
-                      textAlign: TextAlign.center,
111
-                      style: const TextStyle(color: Colors.white),
112
-                    ),
113
-                  ),
114
-                  onTap: () => _updateListType(1),
115
-                )
116
-              ];
84
+    );
85
+  }
86
+
87
+  ///获取咨询部分
88
+  Widget _getConsultations(BuildContext context) {
89
+    return Container(
90
+      padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 15.h),
91
+      decoration: BoxDecoration(
92
+          color: Theme.of(context).colorScheme.surfaceContainerHigh,
93
+          borderRadius: BorderRadius.circular(15.r)),
94
+      child: Column(
95
+        crossAxisAlignment: CrossAxisAlignment.start,
96
+        children: [
97
+          Text(
98
+            getS().freeConsultation,
99
+            style: Theme.of(context)
100
+                .textTheme
101
+                .titleMedium
102
+                ?.copyWith(fontWeight: FontWeight.bold),
103
+          ),
104
+          SizedBox(
105
+            height: 10.h,
106
+          ),
107
+          Text(
108
+            getS().electricityHospitalConsultationDesc,
109
+            style: Theme.of(context).textTheme.bodySmall,
110
+          ),
111
+          SizedBox(
112
+            height: 10.h,
113
+          ),
114
+          CustomDivider(
115
+            height: 0,
116
+            color: Colors.grey[300],
117
+          ),
118
+          SizedBox(
119
+            height: 10.h,
120
+          ),
121
+          Align(
122
+            alignment: Alignment.center,
123
+            child: MainButton(
124
+                text: getS().consultationNow,
125
+                fitMinimumSize: true,
126
+                buttonPadding:
127
+                    EdgeInsets.symmetric(horizontal: 20.w, vertical: 6.h),
128
+                minimumSize: Size.zero,
129
+                shape: RoundedRectangleBorder(
130
+                    borderRadius: BorderRadius.circular(8.r)),
131
+                onPressed: _onOpenElectricityHospitalMiniProgram),
132
+          ),
133
+        ],
134
+      ),
135
+    );
136
+  }
137
+
138
+  ///获取历史记录标题
139
+  Widget _getHistoryTitle() {
140
+    return Column(
141
+      children: [
142
+        SizedBox(
143
+          height: 10.h,
144
+        ),
145
+        Row(
146
+          children: [
147
+            Text(getS().history),
148
+            Spacer(),
149
+            Consumer(builder: (ctx, ref, _) {
150
+              int type = ref.watch(historyViewTypeProvider);
151
+              return PopupMenuButton(
152
+                  color: const Color(0xFF383838),
153
+                  //背景形状
154
+                  shape: RoundedRectangleBorder(
155
+                      borderRadius: BorderRadius.circular(8.r)),
156
+                  itemBuilder: (ctx) {
157
+                    return [
158
+                      PopupMenuItem(
159
+                        child: SizedBox(
160
+                          width: double.infinity,
161
+                          child: Text(
162
+                            getS().byTime,
163
+                            textAlign: TextAlign.center,
164
+                            style: const TextStyle(color: Colors.white),
165
+                          ),
166
+                        ),
167
+                        onTap: () => _updateListType(0),
168
+                      ),
169
+                      PopupMenuItem(
170
+                        child: SizedBox(
171
+                          width: double.infinity,
172
+                          child: Text(
173
+                            getS().byCategory,
174
+                            textAlign: TextAlign.center,
175
+                            style: const TextStyle(color: Colors.white),
176
+                          ),
177
+                        ),
178
+                        onTap: () => _updateListType(1),
179
+                      ),
180
+                    ];
181
+                  },
182
+                  child: Row(
183
+                    children: [
184
+                      Text(type == 0 ? getS().byTime : getS().byCategory),
185
+                      Icon(Icons.arrow_drop_down)
186
+                    ],
187
+                  ));
117 188
             }),
189
+          ],
190
+        ),
191
+        Consumer(builder: (ctx, ref, _) {
192
+          return ref.read(historySelectModeProvider)
193
+              ? SizedBox()
194
+              : SizedBox(
195
+                  height: 10.h,
196
+                );
197
+        })
118 198
       ],
119 199
     );
120 200
   }
@@ -361,4 +441,14 @@ class _HistoryPageState extends ConsumerState<HistoryPage> {
361 441
     bool result = await ref.read(historyListProvider.notifier).delete(list);
362 442
     showToast(text: result ? getS().deleteSuccess : getS().deleteFailed);
363 443
   }
444
+
445
+  ///打开电力医院小程序
446
+  void _onOpenElectricityHospitalMiniProgram() async {
447
+    if (!await isWxInstalled()) {
448
+      return;
449
+    }
450
+    fluwx.open(
451
+        target: MiniProgram(
452
+            username: hospitalMiniProgramId, path: hospitalMiniProgramPath));
453
+  }
364 454
 }

+ 2 - 4
lib/pages/main/main_page.dart

@@ -1,4 +1,3 @@
1
-import 'dart:async';
2 1
 import 'dart:io';
3 2
 
4 3
 import 'package:auto_route/auto_route.dart';
@@ -13,7 +12,6 @@ import 'package:eitc_erm_dental_flutter/pages/patient/vm/patient_view_model.dart
13 12
 import 'package:eitc_erm_dental_flutter/pages/patient/widget/patient_info_bar.dart';
14 13
 import 'package:eitc_erm_dental_flutter/vm/global_view_model.dart';
15 14
 import 'package:flutter/material.dart';
16
-import 'package:flutter/services.dart';
17 15
 import 'package:flutter_riverpod/flutter_riverpod.dart';
18 16
 import 'package:flutter_screenutil/flutter_screenutil.dart';
19 17
 
@@ -103,7 +101,7 @@ class _MainPageState extends ConsumerState<MainPage> {
103 101
             style: buttonStyle,
104 102
             child: Row(children: [
105 103
               Icon(
106
-                Icons.history_outlined,
104
+                Icons.people_outline,
107 105
                 color: color,
108 106
                 size: 24.r,
109 107
               ),
@@ -111,7 +109,7 @@ class _MainPageState extends ConsumerState<MainPage> {
111 109
                 width: 4.w,
112 110
               ),
113 111
               Text(
114
-                getS().history,
112
+                getS().serviceCenter,
115 113
                 style: textStyle,
116 114
               )
117 115
             ])),

+ 7 - 7
lib/pages/splash/splash_page.dart

@@ -7,8 +7,11 @@ import 'package:eitc_erm_dental_flutter/funcs.dart';
7 7
 import 'package:eitc_erm_dental_flutter/generated/assets.dart';
8 8
 import 'package:eitc_erm_dental_flutter/sp_util.dart';
9 9
 import 'package:flutter/material.dart';
10
+import 'package:flutter/services.dart';
10 11
 import 'package:flutter_screenutil/flutter_screenutil.dart';
11 12
 
13
+import '../../global.dart';
14
+
12 15
 ///Splash页面
13 16
 @RoutePage(name: "splashRoute")
14 17
 class SplashPage extends StatefulWidget {
@@ -79,13 +82,10 @@ class _SplashPageState extends State<SplashPage> {
79 82
     );
80 83
   }
81 84
 
82
-  String get splashTitle {
83
-    if (isHst) {
84
-      return getS().splashTitleHst;
85
-    } else {
86
-      return getS().splashTitle;
87
-    }
88
-  }
85
+  String get splashTitle => switch (appFlavor) {
86
+        flavorHst => getS().splashTitleHst,
87
+        _ => getS().splashTitle
88
+      };
89 89
 
90 90
   ///下一步
91 91
   ///

+ 29 - 3
lib/widget/main_button.dart

@@ -6,13 +6,21 @@ class MainButton extends StatelessWidget {
6 6
   final String text;
7 7
   final bool isOutlined;
8 8
   final EdgeInsets? buttonPadding;
9
+  final Size? minimumSize;
10
+  final Size? maximumSize;
11
+  final bool fitMinimumSize;
12
+  final OutlinedBorder? shape;
9 13
 
10 14
   const MainButton(
11 15
       {super.key,
12 16
       required this.text,
13 17
       required this.onPressed,
14 18
       this.buttonPadding,
15
-      this.isOutlined = false});
19
+      this.minimumSize,
20
+      this.maximumSize,
21
+      this.isOutlined = false,
22
+      this.fitMinimumSize = false,
23
+      this.shape});
16 24
 
17 25
   @override
18 26
   Widget build(BuildContext context) {
@@ -20,11 +28,20 @@ class MainButton extends StatelessWidget {
20 28
         ? OutlinedButton(
21 29
             onPressed: onPressed,
22 30
             style: ButtonStyle(
31
+                tapTargetSize:
32
+                    fitMinimumSize ? MaterialTapTargetSize.shrinkWrap : null,
23 33
                 padding: buttonPadding == null
24 34
                     ? null
25 35
                     : WidgetStatePropertyAll(buttonPadding),
36
+                minimumSize: minimumSize == null
37
+                    ? null
38
+                    : WidgetStatePropertyAll(minimumSize),
39
+                maximumSize: maximumSize == null
40
+                    ? null
41
+                    : WidgetStatePropertyAll(maximumSize),
26 42
                 side: WidgetStatePropertyAll(
27
-                    BorderSide(color: Color(0xFFD2D2D2)))),
43
+                    BorderSide(color: Color(0xFFD2D2D2))),
44
+                shape: shape == null ? null : WidgetStatePropertyAll(shape)),
28 45
             child: Text(
29 46
               text,
30 47
               style: TextStyle(color: Theme.of(context).colorScheme.onSurface),
@@ -32,12 +49,21 @@ class MainButton extends StatelessWidget {
32 49
         : ElevatedButton(
33 50
             onPressed: onPressed,
34 51
             style: ButtonStyle(
52
+                tapTargetSize:
53
+                    fitMinimumSize ? MaterialTapTargetSize.shrinkWrap : null,
35 54
                 padding: buttonPadding == null
36 55
                     ? null
37 56
                     : WidgetStatePropertyAll(buttonPadding),
38 57
                 backgroundColor:
39 58
                     WidgetStatePropertyAll(Theme.of(context).primaryColor),
40
-                elevation: const WidgetStatePropertyAll(0.0)),
59
+                minimumSize: minimumSize == null
60
+                    ? null
61
+                    : WidgetStatePropertyAll(minimumSize),
62
+                maximumSize: maximumSize == null
63
+                    ? null
64
+                    : WidgetStatePropertyAll(maximumSize),
65
+                elevation: const WidgetStatePropertyAll(0.0),
66
+                shape: shape == null ? null : WidgetStatePropertyAll(shape)),
41 67
             child: Text(
42 68
               text,
43 69
               textAlign: TextAlign.center,

+ 8 - 0
pubspec.lock

@@ -514,6 +514,14 @@ packages:
514 514
     description: flutter
515 515
     source: sdk
516 516
     version: "0.0.0"
517
+  fluwx:
518
+    dependency: "direct main"
519
+    description:
520
+      name: fluwx
521
+      sha256: dace8cff13fd0acfb09f77dca4a83ba630e7fb96e65369fb86e91bfd711ebcf2
522
+      url: "https://pub.flutter-io.cn"
523
+    source: hosted
524
+    version: "5.3.0"
517 525
   freezed_annotation:
518 526
     dependency: transitive
519 527
     description:

+ 7 - 0
pubspec.yaml

@@ -21,6 +21,12 @@ version: 1.0.9+10
21 21
 environment:
22 22
   sdk: ^3.5.1
23 23
 
24
+#微信插件配置
25
+fluwx:
26
+  debug_logging: true
27
+  ios:
28
+    no_pay: true
29
+
24 30
 # Dependencies specify other packages that your package needs in order to work.
25 31
 # To automatically upgrade your package dependencies to the latest versions
26 32
 # consider running `flutter pub upgrade --major-versions`. Alternatively,
@@ -96,6 +102,7 @@ dependencies:
96 102
 
97 103
   retrofit: ^4.4.1
98 104
   json_annotation: ^4.9.0
105
+  fluwx: ^5.3.0
99 106
 
100 107
   flutter_localizations:
101 108
     sdk: flutter