payState.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <template>
  2. <view class="container">
  3. <view class="main_box">
  4. <view class="make_msg_box" :class="{ 'topBorderRadius': pageType == 'yygh' }">
  5. <image class="success_icon" :src="icon.icon_circleActive"></image>
  6. <text class="title" v-if="pageType == 'yygh'">预约成功</text>
  7. <text class="title mb30" v-if="pageType == 'czjf'">付款成功</text>
  8. <text class="title mb30" v-if="pageType == 'signIn'">恭喜您,签到成功</text>
  9. <text class="title mb30" v-if="pageType == 'orderPayment'">恭喜您,结算成功</text>
  10. <text class="title mb30" v-if="pageType == 'refund'">退款成功</text>
  11. <text class="title mb30" v-if="pageType == 'yjyy'">{{ isSuccess ? '预约成功' : '预约失败' }}</text>
  12. </view>
  13. <image v-if="pageType == 'yygh'" class="division_icon" :src="icon.icon_division"></image>
  14. <view class="time_box bottomBorderRadius" v-if="pageType == 'yygh'">
  15. <view class="time_box_list displayFlexRow">
  16. <text class="time_leftText">预约科室</text>
  17. <text class="time_rightText">{{ orderInfo.OrderMemo.DeptName }}</text>
  18. </view>
  19. <view class="time_box_list displayFlexRow">
  20. <text class="time_leftText">医生姓名</text>
  21. <text class="time_rightText">{{ orderInfo.OrderMemo.DoctorName }}</text>
  22. </view>
  23. <view class="time_box_list displayFlexRow">
  24. <text class="time_leftText">就诊时间</text>
  25. <text class="time_rightText">{{ orderInfo.OrderMemo.RegDate }} {{ orderInfo.OrderMemo.CommendTime }}</text>
  26. </view>
  27. <view class="time_box_list displayFlexRow">
  28. <text class="time_leftText">就诊人</text>
  29. <text class="time_rightText">{{ orderInfo.MemberName }}</text>
  30. </view>
  31. <view class="time_box_list displayFlexRow">
  32. <text class="time_leftText">挂号费</text>
  33. <text class="time_rightText colorCustom_F08">{{ orderInfo.TotalMoney / 100 }}元</text>
  34. </view>
  35. <view class="footerBtn displayFlexRow">
  36. <text v-if="orderInfo.allowCancel" class="colorCustom border" @click="cancelAppointment">取消预约</text>
  37. <text class="colorCustom border" @click="toAppointmentRecord">查看预约记录</text>
  38. </view>
  39. </view>
  40. <!-- 不等于在线签到成功页面时展示提示信息 -->
  41. <view class="tips_box" v-if="pageType != 'signIn'">
  42. <view v-if="pageType == 'yygh'">
  43. <view class="tips_title_box displayFlexRow">
  44. <image :src="icon.spot_left"></image>
  45. <text>注意事项</text>
  46. <image :src="icon.spot_right"></image>
  47. </view>
  48. <!-- 判断是否有配置信息有就取配置信息的 -->
  49. <block v-if="pageConfig.tip && pageConfig.tip.length > 0">
  50. <view class="tips_item_box" v-for="(item, index) in pageConfig.tip" :key="index">
  51. <block v-if="item.length > 1">
  52. <text class="font_weight">{{ item[0] }}</text>
  53. <text>{{ item[1] }}</text>
  54. </block>
  55. <block v-else>
  56. <text class="font_weight">{{ item }}</text>
  57. </block>
  58. </view>
  59. </block>
  60. <!-- 没有就走固定的 -->
  61. <block v-else>
  62. <view class="tips_item_box">
  63. <text class="font_weight">1、签到取号:</text>
  64. <text>请于就诊当日到院签到,支持微信签到、自助机、服务台签到取号,可提前90分钟或延迟30分钟(超过30分钟则预约无效,需要重新排号);</text>
  65. </view>
  66. <view class="tips_item_box">
  67. <text class="font_weight">2、退号:</text>
  68. <text>如您无法按时就诊,请至少提前1天取消,以免因为爽约影响下次预约;</text>
  69. </view>
  70. <view class="tips_item_box">
  71. <text class="font_weight">3、首次就诊患者:</text>
  72. <text>需要带身份证原件办理开卡;</text>
  73. <text class="font_weight">未实名制的复诊患者:</text>
  74. <text>在就诊前需要持本人有效身份证证件进行实名认证,否则无法就诊;有效证件类型包括:身份证、社保卡、户口簿(仅限未成年)、护照、驾驶证、港澳台通行证、老人证、军官证、出生证(仅限新生儿)。</text>
  75. </view>
  76. </block>
  77. </view>
  78. <text v-if="pageType == 'czjf' && orderInfo.ServiceId == '006'">尊敬的患者,系统正在为您的就诊卡账户充值,充值过程大约需要3~5分钟,祝您早日康复!</text>
  79. <text v-if="pageType == 'czjf' && orderInfo.ServiceId == '007'">尊敬的患者,系统正在为住院预交金账户<text class="colorRed">{{ orderInfo.CardNo }}</text>充值,充值过程大约需要3~5分钟,祝您早日康复!</text>
  80. <text v-if="pageType == 'orderPayment'">尊敬的患者,系统正在为您进行结算,结算过程大约需要3-5分钟,祝您早日康复!</text>
  81. <text v-if="pageType == 'refund'">尊敬的患者,系统退款金额将在5个工作日内原路退还到您的充值账户内!</text>
  82. </view>
  83. <!-- 等于在线签到且有候诊查询时展示候诊 -->
  84. <view class="tips_box" v-if="pageType == 'signIn' && pageConfig.signInQueue">
  85. <queueItem :orderInfo="queryBean" :currentUser="currentUser" :ifGetQueueInfo="true"></queueItem>
  86. </view>
  87. <!-- 医技预约状态 -->
  88. <block v-if="pageType == 'yjyy'">
  89. <view class="con">
  90. <view class="tips" v-if="isSuccess">
  91. 请与就诊当日提前20分钟到该医技科室,若您无法 按时就诊,请至少提前一天进行取消,祝您早日康复~
  92. <view class="yjyy_tipInfo">
  93. <view>注意事项:</view>
  94. <view>1、CT、MRI检查当天需到自助机打印预约单;</view>
  95. <view>2、窗口签到;</view>
  96. <view>
  97. 3、<view class="btn" @click="gotoAppointmentRecord">预约回执单</view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="tips" v-else>
  102. 非常抱歉,预约失败,请稍后重试。
  103. <view class="btn" @click="gotoAppointmentRecord">查看记录</view>
  104. </view>
  105. </view>
  106. </block>
  107. <view class="btn_box">
  108. <view class="btn" @click="btnClick">回到首页</view>
  109. <view class="btn" v-if="pageType == 'yjyy'" @click="clickAi">智能导诊</view>
  110. </view>
  111. </view>
  112. </view>
  113. </template>
  114. <script setup lang="ts">
  115. import { ref } from 'vue';
  116. import { onLoad } from '@dcloudio/uni-app';
  117. import common from '@/utils/common';
  118. import icon from '@/utils/icon';
  119. import { orderDetailLocal, orderCancel } from '@/pagesPatient/service/record/index';
  120. import { getAppointReceiptInfo } from '@/pagesPatient/service/otherService/index';
  121. import queueItem from '@/pagesPatient/st1/components/queueItem/queueItem.vue';
  122. const app = getApp();
  123. const isSuccess = ref(true);
  124. const pageType = ref('card');
  125. const showCon = ref(false);
  126. const orderInfo = ref<any>({});
  127. const orderId = ref('');
  128. const toUrl = ref('');
  129. const pageConfig = ref<any>({});
  130. const queryBean = ref<any>('');
  131. const currentUser = ref<any>({});
  132. const info = ref<any>({});
  133. onLoad((options: any) => {
  134. pageConfig.value = common.deepCopy(app.globalData.config?.pageConfiguration?.payState_config || {});
  135. toUrl.value = options.toUrl || '';
  136. orderId.value = options.orderId || '';
  137. pageType.value = options.pageType || 'card';
  138. isSuccess.value = options.isSuccess === 'false' ? false : true;
  139. queryBean.value = options.queryBean ? JSON.parse(options.queryBean) : '';
  140. currentUser.value = app.globalData.currentUser || {};
  141. main();
  142. });
  143. const main = async () => {
  144. let tempOrderId = orderId.value;
  145. let tempPageType = pageType.value;
  146. let tempOrderInfo: any = {};
  147. let tempInfo: any = {};
  148. // 判断orderId不为空的时候查询订单详情
  149. if (!common.isEmpty(tempOrderId)) {
  150. try {
  151. let orderResp = await orderDetailLocal({ OrderId: tempOrderId });
  152. if (!common.isEmpty(orderResp) && orderResp.length > 0) {
  153. tempOrderInfo = orderResp[0];
  154. let serviceId = tempOrderInfo.ServiceId;
  155. tempPageType = serviceId == '006' || serviceId == '007' ? 'czjf' :
  156. serviceId == '0' || serviceId == '009' ? 'yygh' :
  157. serviceId == '011' || serviceId == '008' ? 'orderPayment' : pageType.value;
  158. // 判断订单返回是否存在扩展字段,存在转json格式
  159. if (tempOrderInfo.OrderMemo) {
  160. tempOrderInfo.OrderMemo = JSON.parse(tempOrderInfo.OrderMemo);
  161. // 判断是否允许取消预约
  162. chkAllowCancel(tempOrderInfo);
  163. }
  164. }
  165. } catch (e) {
  166. console.error(e);
  167. }
  168. }
  169. if (tempPageType == 'yjyy') {
  170. try {
  171. const resp = await getAppointReceiptInfo(queryBean.value.hisKey);
  172. if (common.isNotEmpty(resp)) {
  173. tempInfo = resp;
  174. }
  175. } catch (e) {
  176. console.error(e);
  177. }
  178. }
  179. info.value = tempInfo;
  180. pageType.value = tempPageType;
  181. orderInfo.value = tempOrderInfo;
  182. showCon.value = true;
  183. };
  184. const btnClick = () => {
  185. common.goToUrl('/pages/st1/business/tabbar/homePage/homePage', { skipWay: "reLaunch" });
  186. };
  187. const gotoAppointmentRecord = () => {
  188. common.goToUrl(`/pages/st1/green/business/record/outpatientMedical/outpatientMedical`);
  189. };
  190. const clickAi = () => {
  191. uni.navigateToMiniProgram({
  192. appId: 'wx1ccb00ea4ab483fe',
  193. path: `/pages/prediagnosis?partnerId=100000038&hospitalId=800000366&registerId=${orderId.value}`,
  194. success(res) {
  195. // 打开成功
  196. }
  197. });
  198. };
  199. const chkAllowCancel = (info: any) => {
  200. const timeLimit = 1; // 提前取消最小时间间隔(单位:天)
  201. if (pageType.value !== 'yygh') {
  202. return;
  203. }
  204. let { RegDate } = info.OrderMemo;
  205. if (RegDate) {
  206. RegDate = RegDate.replace(/-/g, '/');
  207. const targetDate = new Date(`${RegDate}`);
  208. const today = new Date(new Date().toLocaleDateString());
  209. // @ts-ignore
  210. info.allowCancel = (targetDate - today) >= timeLimit * 24 * 60 * 60 * 1000;
  211. }
  212. };
  213. const cancelAppointment = () => {
  214. common.showModal(`确认退号吗?`, async () => {
  215. try {
  216. const orderCancelData = {
  217. ...orderInfo.value,
  218. OrderId: orderInfo.value.OrderId,
  219. OperatorId: orderInfo.value.OperatorId,
  220. OperatorName: orderInfo.value.OperatorName
  221. };
  222. // Note: Original code calls record.orderCancel(orderCancelData) but orderCancel signature is (data, serviceId) or (data).
  223. // Checking service definition: export const orderCancel = async (queryData: any, serviceId: any = '') => { ... }
  224. // So passing just orderCancelData is fine if serviceId logic is handled or empty.
  225. // However, usually we pass serviceId. The original code in `payState.js` was:
  226. // await record.orderCancel(orderCancelData)
  227. // I'll stick to that.
  228. await orderCancel(orderCancelData, orderInfo.value.ServiceId); // Better to pass ServiceId if available
  229. common.showModal('取消成功', () => {
  230. // Refresh
  231. main();
  232. });
  233. } catch (e) {
  234. console.error(e);
  235. }
  236. });
  237. };
  238. const toAppointmentRecord = () => {
  239. common.goToUrl(`/pagesPatient/st1/business/record/appointmentRecord/appointmentRecord`);
  240. };
  241. </script>
  242. <style scoped lang="scss">
  243. .container {
  244. background-color: #f5f5f5;
  245. min-height: 100vh;
  246. }
  247. .main_box {
  248. width: 100%;
  249. height: 100%;
  250. padding: 30upx;
  251. box-sizing: border-box;
  252. padding-bottom: 210upx;
  253. overflow: auto;
  254. }
  255. .make_msg_box {
  256. width: 100%;
  257. padding: 64upx 0upx 30upx 0upx;
  258. box-sizing: border-box;
  259. background: white;
  260. display: flex;
  261. flex-direction: column;
  262. justify-content: center;
  263. align-items: center;
  264. border-radius: 24upx;
  265. }
  266. .mb30 {
  267. margin-bottom: 34upx;
  268. }
  269. .topBorderRadius {
  270. border-radius: 24upx 24upx 0 0 !important;
  271. }
  272. .bottomBorderRadius {
  273. border-radius: 0 0 30upx 30upx !important;
  274. }
  275. .make_msg_box .success_icon {
  276. width: 120upx;
  277. height: 120upx;
  278. margin-bottom: 30upx;
  279. }
  280. .make_msg_box .title {
  281. font-size: 36upx;
  282. font-family: PingFang SC;
  283. font-weight: bold;
  284. color: #333;
  285. text-align: left;
  286. }
  287. .division_icon {
  288. width: 100%;
  289. height: 48upx;
  290. }
  291. .time_box {
  292. width: 100%;
  293. background: white;
  294. padding: 10upx 30upx 16upx;
  295. box-sizing: border-box;
  296. border-radius: 24upx;
  297. }
  298. .time_box_list {
  299. width: 100%;
  300. padding-bottom: 32upx;
  301. align-items: flex-start;
  302. position: relative;
  303. display: flex;
  304. flex-direction: row;
  305. }
  306. .time_box_list:last-child {
  307. margin-bottom: 0;
  308. }
  309. .time_box_list .time_leftText {
  310. width: 28%;
  311. font-size: 30upx;
  312. font-family: PingFang SC;
  313. color: #8A8A99;
  314. text-align: left;
  315. }
  316. .time_box_list .time_rightText {
  317. width: 72%;
  318. font-size: 30upx;
  319. font-family: PingFang SC;
  320. color: #222326;
  321. }
  322. .sign_main_box {
  323. width: 100%;
  324. }
  325. .tips_box {
  326. margin-top: 30upx;
  327. background: white;
  328. padding: 30upx;
  329. box-sizing: border-box;
  330. border-radius: 24upx;
  331. }
  332. .tips_box text {
  333. line-height: 48upx;
  334. font-size: 30upx;
  335. }
  336. .tips_title_box {
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. margin-bottom: 30upx;
  341. }
  342. .tips_title_box image {
  343. width: 20upx;
  344. height: 20upx;
  345. }
  346. .tips_title_box text {
  347. font-size: 32upx;
  348. font-weight: bold;
  349. color: #333;
  350. margin: 0 20upx;
  351. }
  352. .tips_item_box {
  353. margin-bottom: 20upx;
  354. display: flex;
  355. flex-direction: column;
  356. }
  357. .font_weight {
  358. font-weight: bold;
  359. color: #333;
  360. }
  361. .colorRed {
  362. color: #ff5e5e;
  363. }
  364. .colorCustom {
  365. color: #29cf8c;
  366. }
  367. .colorCustom_F08 {
  368. color: #F08300;
  369. }
  370. .footerBtn {
  371. display: flex;
  372. justify-content: flex-end;
  373. padding-top: 20upx;
  374. border-top: 1upx solid #eee;
  375. }
  376. .footerBtn text {
  377. padding: 10upx 30upx;
  378. border-radius: 30upx;
  379. font-size: 28upx;
  380. margin-left: 20upx;
  381. }
  382. .border {
  383. border: 1upx solid #29cf8c;
  384. }
  385. .btn_box {
  386. width: 100%;
  387. margin-top: 60upx;
  388. display: flex;
  389. flex-direction: column;
  390. align-items: center;
  391. }
  392. .btn {
  393. width: 690upx;
  394. height: 88upx;
  395. background: #29cf8c;
  396. border-radius: 44upx;
  397. text-align: center;
  398. line-height: 88upx;
  399. color: white;
  400. font-size: 32upx;
  401. margin-bottom: 30upx;
  402. }
  403. .yjyy_tipInfo {
  404. margin-top: 20upx;
  405. font-size: 28upx;
  406. color: #666;
  407. }
  408. .con {
  409. background: #fff;
  410. border-radius: 20upx;
  411. padding: 30upx;
  412. margin-top: 20upx;
  413. }
  414. </style>