creditIndex.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <image :src="iconUrl.page_topBg" class="topBg_img"></image>
  5. <!-- <view class="top_box">
  6. <view class="topBox_title" :style="{marginTop: statusBarHeight + 'px', height: '44px', lineHeight: '44px'}">我的信用</view>
  7. </view> -->
  8. <view class="memeberInfo">
  9. <image :src="iconUrl.credit_memberBg" class="credit_memberBg" mode="widthFix"></image>
  10. <view class="memeberInfo_box">
  11. <view class="memeberInfo_boxData displayFlexBetween">
  12. <view class="boxData_left displayFlexLeft">
  13. <image class="credit_memberBgT" :src="iconUrl.credit_memberBgT"/>
  14. <view class="">
  15. <view class="displayFlexLeft">
  16. <text class="boxData_leftName">{{myInfo?.memberName}}</text>
  17. <text class="boxData_leftTip backgroundCustom">本人</text>
  18. </view>
  19. <view class="colorCustom">福建省诊疗信用管理平台</view>
  20. </view>
  21. </view>
  22. <view class="boxData_right">
  23. <image class="credit_iconResk" :src="myInfo?.isCredit == 2 ? iconUrl.credit_iconResk : iconUrl.credit_iconExcell"></image>
  24. <view class="boxData_rightText">
  25. <!-- <image class="credit_iconReskText" :src="iconUrl.credit_iconReskText"></image> -->
  26. <!-- <text class="">更新信用状态</text> -->
  27. </view>
  28. </view>
  29. </view>
  30. <view class="memeberInfo_boxTip">
  31. <view class="bg backgroundCustom"></view>
  32. <view v-if="myInfo?.isCredit == 2" class="colorRed">提醒:您存在信用风险,请及时处理</view>
  33. <view v-if="myInfo?.isCredit == 1" class="colorCustom_F08">诊疗信用良好,可享受先诊疗后付费权益</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="youCredit">
  38. <view class="title">您的信用</view>
  39. <view class="displayFlexRow border_bottom">
  40. <view class="creditReport displayFlexCol">
  41. <view class="creditReport_title">爽约记录</view>
  42. <view class="creditReport_num">{{appoinmentList.length}}</view>
  43. </view>
  44. <view class="creditReport displayFlexCol">
  45. <view class="creditReport_title">欠费逾期</view>
  46. <view class="creditReport_num">{{(overdueList[0] && overdueList[0].ItemList && overdueList[0].ItemList.length) || 0}}</view>
  47. </view>
  48. </view>
  49. <view class="checkCreditReport displayFlexBetween">
  50. <view class="displayFlexLeft">
  51. <image class="credit_icon" :src="iconUrl.credit_icon"></image>
  52. <view class="checkCreditReport_text">
  53. <view class="checkCreditReport_text1">信用记录</view>
  54. <view class="checkCreditReport_text2">记录您在历次信用就医过程中信用状态</view>
  55. </view>
  56. </view>
  57. <view class="checkCreditReport_btn backgroundCustom" @click="checkReport">查看</view>
  58. </view>
  59. </view>
  60. <!-- 诊疗付费的权益 -->
  61. <view class="rightsBox">
  62. <view class="rightsBox_top displayFlexCol">
  63. <view class="rightsBox_topTitle">了解先诊疗后付费权益</view>
  64. <view class="rightsBox_topList displayFlexBetween">
  65. <view class="topList_item displayFlexCol">
  66. <image class="topList_itemImg" :src="iconUrl.credit_list"></image>
  67. <view class="topList_itemName">先诊疗后付费</view>
  68. </view>
  69. <view class="topList_item displayFlexCol">
  70. <image class="topList_itemImg" :src="iconUrl.credit_list1"></image>
  71. <view class="topList_itemName">免交预缴金</view>
  72. </view>
  73. <view class="topList_item displayFlexCol">
  74. <image class="topList_itemImg" :src="iconUrl.credit_list2"></image>
  75. <view class="topList_itemName">当天一次结算</view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="rightsBox_floot ">
  80. <view class="flootBox">
  81. <view class="displayFlexLeft ">
  82. <image src=""></image>
  83. <view class="flootBox_title">免交预缴金就医</view>
  84. </view>
  85. <view class="flootBox_txt">享受免充值预缴金直接就医看病服务。院内签到取号时,信用平台将为您做信用就医使用授权,授权成功后,在就诊过程可享“先诊疗,后付费”。</view>
  86. </view>
  87. <view class="flootBox">
  88. <view class="displayFlexLeft ">
  89. <image src=""></image>
  90. <view class="flootBox_title">取消预存预缴金</view>
  91. </view>
  92. <view class="flootBox_txt">在诊察环节不再进行诊察费预扣,在诊室就诊完成后,取药前,检查检验前及门诊手术前一次性完成当次所有医疗费用结算。</view>
  93. </view>
  94. <view class="flootBox border_bottom">
  95. <view class="displayFlexLeft ">
  96. <image src=""></image>
  97. <view class="flootBox_title">建立诊疗失信限制</view>
  98. </view>
  99. <view class="flootBox_txt colorRed">未及时缴清欠费,将限制预约挂号,并取消享受“先诊疗后付费”的便利。</view>
  100. </view>
  101. </view>
  102. <view class="rightsBox_bottom">
  103. <block v-if="myInfo?.acceptCredit != 1">
  104. <checkbox :checked="isCheckbox" color="var(--dominantColor)" @click="checkChange">我已阅读并同意</checkbox>
  105. <view class="rightsBox_bottomBtn backgroundCustom" @click="clickAcceptCredit" data-accept-credit="1">立即使用</view>
  106. </block>
  107. <view v-if="myInfo?.acceptCredit == 1" class="rightsBox_bottomBtn border boderColorCustom colorCustom" @click="clickAcceptCredit" data-accept-credit="0">暂不使用</view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </template>
  113. <script lang="ts" setup>
  114. import { ref } from 'vue';
  115. import { onShow } from '@dcloudio/uni-app';
  116. import { usePreserMember } from '@/hook';
  117. import { queryOverdueData, queryBreakAppoinmentList, acceptCredit } from '@/pagesPersonal/service/patientManagement';
  118. import { common } from "@/utils";
  119. import icon from "@/utils/icon.js";
  120. const app = getApp();
  121. // 定义响应式数据
  122. const myInfo = ref<any>({});
  123. const iconUrl = ref(icon);
  124. const appoinmentList = ref([]);
  125. const overdueList = ref<any[]>([]);
  126. const isCheckbox = ref(false);
  127. const statusBarHeight = ref(20);
  128. // 生命周期
  129. onShow(() => {
  130. main();
  131. });
  132. const main = async () => {
  133. let info = app.globalData.myInfo || uni.getStorageSync('myInfo') || {};
  134. statusBarHeight.value = app.globalData.statusBarHeight || 20;
  135. myInfo.value = info;
  136. await getCredit(info);
  137. };
  138. const getCredit = async (info: any) => {
  139. // 获取欠费逾期记录
  140. let { resData: overdue } = await queryOverdueData({
  141. MemberId: info.memberId,
  142. });
  143. // 确保 overdueList 是个数组
  144. const overdueData = overdue || [];
  145. // 未获取id 则跳去授权
  146. if (overdueData.length > 0 && !common.isEmpty(overdueData[0].WxMiniPath)) {
  147. common.showModal(`前往授权`, () => {
  148. uni.navigateToMiniProgram({
  149. appId: overdueData[0].WxMiniAppId,
  150. path: `${overdueData[0].WxMiniPath}&authSource=WX_MINI&authAppId=wx3cf937079d74124f&authBackUrl=${encodeURIComponent(`/pagesPersonal/st1/business/creditManagement/creditIndex/creditIndex`)}`,
  151. extraData: {},
  152. envVersion: 'release',
  153. success(res) {},
  154. fail(res) {
  155. common.navigateBack(1);
  156. },
  157. });
  158. });
  159. return;
  160. }
  161. // 获取爽约记录条数
  162. let { resData: appointment } = await queryBreakAppoinmentList({
  163. memberId: info.memberId,
  164. });
  165. const appointmentData = appointment || [];
  166. let creditLevel = 1;
  167. if (common.isNotEmpty(overdueData) || common.isNotEmpty(appointmentData)) {
  168. // 判断当前用户有存在欠费 或者爽约记录大于等于2
  169. creditLevel = ((overdueData[0]?.ItemList && overdueData[0]?.ItemList.length > 0) || appointmentData.length >= 2) ? 2 : 1;
  170. }
  171. overdueList.value = overdueData;
  172. appoinmentList.value = appointmentData;
  173. if (myInfo.value) {
  174. myInfo.value.isCredit = creditLevel;
  175. }
  176. };
  177. // 查看信用记录
  178. const checkReport = () => {
  179. common.goToUrl(`/pagesPersonal/st1/business/creditManagement/creditReport/creditReport?myInfo=${encodeURIComponent(JSON.stringify(myInfo.value))}`);
  180. };
  181. const checkChange = (e: any) => {
  182. // console.log(e)
  183. isCheckbox.value = !isCheckbox.value;
  184. };
  185. const clickAcceptCredit = async (e: any) => {
  186. // 兼容 dataset 获取
  187. let targetStatus = e.currentTarget?.dataset?.acceptCredit;
  188. // 如果没有通过 dataset 传递,尝试直接作为参数(虽然模板里是dataset,但为了代码健壮性)
  189. if (targetStatus === undefined) {
  190. // 这里的逻辑主要是为了兼容模板写法
  191. }
  192. // 判断为打开使用且未阅读
  193. if (targetStatus == 1 && !isCheckbox.value) {
  194. common.showModal("请先阅读并同意");
  195. return;
  196. }
  197. let { resData } = await acceptCredit({
  198. memberId: myInfo.value.memberId,
  199. acceptCredit: targetStatus
  200. });
  201. if (resData && resData.RespCode == '10000') {
  202. await usePreserMember();
  203. if (myInfo.value) {
  204. myInfo.value.acceptCredit = targetStatus;
  205. }
  206. }
  207. };
  208. </script>
  209. <style lang="scss" scoped>
  210. .topBg_img {
  211. width: 100%;
  212. height: 750upx;
  213. position: fixed;
  214. top: 0;
  215. left: 0;
  216. }
  217. .top_box {
  218. position: relative;
  219. z-index: 1;
  220. padding: 0 30upx;
  221. }
  222. .topBox_title {
  223. width: 100%;
  224. font-size: 32upx;
  225. font-family: Source Han Sans CN;
  226. font-weight: 500;
  227. color: #000000;
  228. text-align: center;
  229. }
  230. .memeberInfo{
  231. width: 698upx;
  232. height: 267upx;
  233. position: relative;
  234. margin: 30upx auto 0;
  235. }
  236. .memeberInfo .credit_memberBg{
  237. position: absolute;
  238. z-index: 0;
  239. top: 0;
  240. left: 0;
  241. }
  242. .memeberInfo .memeberInfo_box{
  243. position: relative;
  244. z-index: 1;
  245. height: 100%;
  246. }
  247. .memeberInfo .memeberInfo_boxData{
  248. height: 207upx;
  249. padding-top: 30upx;
  250. }
  251. .memeberInfo .boxData_left .credit_memberBgT{
  252. width: 102upx;
  253. height: 102upx;
  254. margin:0 30upx;
  255. }
  256. .memeberInfo .boxData_leftName{
  257. font-weight: bold;
  258. font-size: 36upx;
  259. margin-right: 22upx;
  260. margin-bottom: 12upx;
  261. }
  262. .memeberInfo .boxData_leftTip{
  263. padding: 6upx;
  264. font-size: 22upx;
  265. margin-bottom: 9upx;
  266. border-radius: 4upx;
  267. }
  268. .memeberInfo .boxData_right {
  269. position: absolute;
  270. right: 28upx;
  271. top: 7upx;
  272. }
  273. .memeberInfo .boxData_right .credit_iconResk{
  274. width: 155upx;
  275. height: 155upx;
  276. }
  277. .memeberInfo .boxData_rightText{
  278. position: relative;
  279. left: -12upx;
  280. z-index: 1;
  281. width: 176upx;
  282. height: 60upx;
  283. }
  284. .memeberInfo .boxData_rightText .credit_iconReskText{
  285. position: absolute;
  286. }
  287. .memeberInfo .boxData_rightText text{
  288. position: absolute;
  289. top: 24upx;
  290. width: 100%;
  291. text-align: center;
  292. color: #fff;
  293. }
  294. .memeberInfo .memeberInfo_box .memeberInfo_boxTip{
  295. height: 60upx;
  296. border-radius: 0upx 0 20upx 20upx;
  297. font-size: 24upx;
  298. padding-left: 32upx;
  299. position: relative;
  300. overflow: hidden;
  301. display: flex;
  302. align-items: center;
  303. }
  304. .memeberInfo .memeberInfo_box .memeberInfo_boxTip .bg{
  305. position: absolute;
  306. width: 100%;
  307. height: 100%;
  308. left: 0;
  309. top: 0;
  310. opacity: .2;
  311. }
  312. /* 您的信用 */
  313. .youCredit{
  314. background: #fff;
  315. border-radius: 20upx;
  316. position: relative;
  317. width: 698upx;
  318. margin: 30upx auto 0;
  319. padding: 30upx;
  320. }
  321. /* .youCredit */
  322. .youCredit .title{
  323. font-weight: bold;
  324. font-size: 32upx;
  325. color: #212326;
  326. }
  327. .youCredit .creditReport{
  328. width: 300upx;
  329. margin: 30upx 0;
  330. }
  331. .youCredit .creditReport_title{
  332. font-weight: bold;
  333. font-size: 28upx;
  334. color: #434349;
  335. margin-bottom: 30upx;
  336. }
  337. .youCredit .creditReport_num{
  338. font-weight: 800;
  339. font-size: 38upx;
  340. color: #FF5D5F;
  341. }
  342. .youCredit .checkCreditReport{
  343. margin-top: 30upx;
  344. }
  345. .youCredit .credit_icon{
  346. width: 65upx;
  347. height: 70upx;
  348. margin-right: 25upx;
  349. }
  350. .youCredit .checkCreditReport_text .checkCreditReport_text1{
  351. font-weight: bold;
  352. font-size: 28upx;
  353. color: #434349;
  354. margin-bottom: 12upx;
  355. }
  356. .youCredit .checkCreditReport_text .checkCreditReport_text2{
  357. font-size: 22upx;
  358. color: #999999;
  359. }
  360. .youCredit .checkCreditReport_btn{
  361. width: 128upx;
  362. height: 50upx;
  363. line-height: 50upx;
  364. border-radius: 25upx;
  365. font-size: 24upx;
  366. text-align: center;
  367. }
  368. /* 诊疗后付费权益 */
  369. .rightsBox{
  370. background-color: #fff;
  371. border-radius: 20upx 20upx 0 0;
  372. margin-top: 30upx;
  373. padding: 20upx 0 40upx;
  374. position: relative;
  375. }
  376. .rightsBox_top{
  377. background: #FFFFFF;
  378. box-shadow: 0upx 0upx 16upx 0upx #DDDDDD;
  379. border-radius: 20upx;
  380. width: 709upx;
  381. height: 245upx;
  382. margin: 0 auto;
  383. }
  384. .rightsBox_top .rightsBox_topTitle{
  385. font-weight: bold;
  386. font-size: 32upx;
  387. color: #212326;
  388. }
  389. .rightsBox_top .rightsBox_topList{
  390. width: 100%;
  391. padding: 0 30upx;
  392. margin-top: 30upx;
  393. }
  394. .rightsBox_top .rightsBox_topList .topList_itemImg{
  395. width: 90upx;
  396. height: 90upx;
  397. }
  398. .rightsBox_top .rightsBox_topList .topList_itemName{
  399. font-size: 28upx;
  400. color: #434349;
  401. margin-top: 17upx;
  402. }
  403. .rightsBox_floot{
  404. padding: 30upx 50upx;
  405. }
  406. .rightsBox_floot .flootBox_title{
  407. font-weight: bold;
  408. font-size: 28upx;
  409. color: #212326;
  410. }
  411. .rightsBox_floot .flootBox_txt{
  412. font-size: 26upx;
  413. color: #898999;
  414. line-height: 36upx;
  415. padding: 23upx 0 36upx;
  416. }
  417. .rightsBox_bottom{
  418. margin:0 30upx ;
  419. }
  420. .rightsBox_bottomBtn{
  421. height: 80upx;
  422. line-height: 80upx;
  423. border-radius: 45upx;
  424. font-size: 32upx;
  425. font-weight: 600;
  426. text-align: center;
  427. margin: 30upx 0;
  428. }
  429. </style>