index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. var api_common = require("../../api/common.js");
  4. var api_package = require("../../api/package.js");
  5. var api_doctorArticle = require("../../api/doctorArticle.js");
  6. var api_doctor = require("../../api/doctor.js");
  7. var api_article = require("../../api/article.js");
  8. var api_adv = require("../../api/adv.js");
  9. var api_department = require("../../api/department.js");
  10. require("../../common/request.js");
  11. const _sfc_main = {
  12. data() {
  13. return {
  14. layouts: [],
  15. yangshengs: [
  16. { id: "0", title: "AI\u820C\u8BCA", page: "/pages_user/tongue/index", icon: "https://cos.his.cdwjyyh.com/fs/20240919/647fb42de0ab4e96a6c3097f3c3d9cf5.png" },
  17. { id: "1", title: "\u836F\u81B3\u98DF\u7597", page: "/pages_index/medicatedFoodList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/3cfbd47911cf4753aa9497eac500728d.png" },
  18. { id: "2", title: "\u7ECF\u7EDC\u7A74\u4F4D", page: "/pages_index/vesselList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e93536a9dc1a4f8ca09545097b12fdea.png" },
  19. { id: "3", title: "\u95EE\u7B54\u4E13\u533A", page: "/pages_index/questionsList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e896972bd56f4e358188af36f2c5af42.png" },
  20. { id: "4", title: "\u75BE\u75C5", page: "/pages_index/diseaseList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/d6f1851cccae414b8baf2ba07782f91b.png" },
  21. { id: "5", title: "\u4E2D\u836F\u56FE\u89E3", page: "/pages_index/chineseMedicineList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/ff43572d0d004285b5a3b0ef2663c471.png" },
  22. { id: "6", title: "\u540D\u65B9\u4ECA\u7528", page: "/pages_index/famousPrescribeList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/45db770e58c34963b0d2ba24a958b617.png" },
  23. { id: "7", title: "\u5EB7\u590D\u533B\u6848", page: "/pages_doctor/doctorArticleList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e793942797b24035b51f94d894bdfa0b.png" }
  24. ],
  25. isTop: false,
  26. titleColor: "#2A2B2E",
  27. descColor: "#626468",
  28. top: 0,
  29. statusBarHeight: common_vendor.index.getStorageSync("menuInfo").statusBarHeight,
  30. advImgs: [],
  31. doctors: [],
  32. advs: [],
  33. articles: [],
  34. depts: [],
  35. doctocArticles: [],
  36. hosLevelOptions: [],
  37. packages: []
  38. };
  39. },
  40. onLoad() {
  41. this.getDictByKey("sys_hospital_level");
  42. common_vendor.index.$on("refreshMsgCount", () => {
  43. try {
  44. let totalUnreadCount = common_vendor.index.$TUIKit.getTotalUnreadMessageCount();
  45. if (totalUnreadCount > 0) {
  46. try {
  47. common_vendor.index.setTabBarBadge({
  48. index: 1,
  49. text: totalUnreadCount + ""
  50. });
  51. } catch (e) {
  52. }
  53. } else {
  54. try {
  55. common_vendor.index.hideTabBarRedDot({
  56. index: 1
  57. });
  58. } catch (e) {
  59. }
  60. }
  61. } catch (e) {
  62. }
  63. });
  64. },
  65. onShow() {
  66. this.getDoctorList();
  67. this.getArticleList();
  68. this.getAdvList();
  69. this.getDepartmentList();
  70. this.getDoctorArticleList();
  71. this.getPackageList();
  72. this.getConfigByKey("his.appShow");
  73. common_vendor.index.$emit("refreshMsgCount");
  74. },
  75. onPageScroll(e) {
  76. this.top = e.scrollTop;
  77. },
  78. onShareAppMessage(res) {
  79. if (this.$isLogin()) {
  80. return {
  81. title: "\u5FA1\u541B\u65B9\u4E92\u8054\u7F51\u533B\u9662",
  82. path: "/pages/index/index",
  83. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  84. };
  85. }
  86. },
  87. onShareTimeline(res) {
  88. if (this.utils.isLogin()) {
  89. return {
  90. title: "\u5FA1\u541B\u65B9\u4E92\u8054\u7F51\u533B\u9662",
  91. imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png"
  92. };
  93. }
  94. },
  95. computed: {
  96. bg: function() {
  97. var top = this.top / 120;
  98. console.log(top);
  99. if (top > 0) {
  100. this.isTop = true;
  101. this.titleColor = "#fff";
  102. this.descColor = "#fff";
  103. } else {
  104. this.isTop = false;
  105. this.titleColor = "#2A2B2E";
  106. this.descColor = "#626468";
  107. }
  108. return "rgba(195,154,88, " + top + ")";
  109. }
  110. },
  111. methods: {
  112. dev() {
  113. common_vendor.index.showToast({
  114. icon: "none",
  115. title: "\u656C\u8BF7\u671F\u5F85"
  116. });
  117. },
  118. getConfigByKey(key) {
  119. var that = this;
  120. var data = { key };
  121. api_common.getConfigByKey(data).then((res) => {
  122. if (res.code == 200) {
  123. this.layouts = JSON.parse(res.data);
  124. this.layouts.sort((a, b) => a.sort - b.sort);
  125. console.log(this.layouts);
  126. this.layouts.forEach(function(element) {
  127. if (element.id == "4") {
  128. if (!element.isShow) {
  129. that.yangshengs.splice(6, 1);
  130. }
  131. }
  132. if (element.id == "7")
  133. ;
  134. });
  135. }
  136. }, (rej) => {
  137. });
  138. },
  139. yangshengClick(item) {
  140. if (item.id == 0) {
  141. this.$isLogin().then((res) => {
  142. if (res) {
  143. common_vendor.index.navigateTo({
  144. url: item.page
  145. });
  146. } else {
  147. common_vendor.index.navigateTo({
  148. url: "/pages/auth/login"
  149. });
  150. }
  151. });
  152. } else {
  153. if (item.page == "") {
  154. common_vendor.index.showToast({
  155. icon: "none",
  156. title: "\u6682\u65E0\u66F4\u591A"
  157. });
  158. return;
  159. }
  160. common_vendor.index.navigateTo({
  161. url: item.page
  162. });
  163. }
  164. },
  165. switchTab(url) {
  166. common_vendor.index.switchTab({
  167. url
  168. });
  169. },
  170. navToMiniProgram() {
  171. common_vendor.index.navigateToMiniProgram({
  172. appId: "wx45cf09091aead547",
  173. path: "/pages/common/launch",
  174. extraData: {},
  175. envVersion: "develop",
  176. success(res) {
  177. },
  178. fail(err) {
  179. }
  180. });
  181. },
  182. getDictByKey(key) {
  183. var data = { key };
  184. api_common.getDictByKey(data).then((res) => {
  185. if (res.code == 200) {
  186. if (key == "sys_hospital_level") {
  187. this.hosLevelOptions = res.data;
  188. }
  189. }
  190. }, (err) => {
  191. });
  192. },
  193. getDoctorArticleList(page) {
  194. var data = {
  195. pageNum: 1,
  196. pageSize: 10
  197. };
  198. api_doctorArticle.getDoctorArticleList(data).then((res) => {
  199. if (res.code == 200) {
  200. this.doctocArticles = res.data.list;
  201. }
  202. });
  203. },
  204. getDepartmentList(page) {
  205. var data = {
  206. isTui: 1
  207. };
  208. api_department.getDepartmentList(data).then((res) => {
  209. if (res.code == 200) {
  210. this.depts = res.data;
  211. }
  212. });
  213. },
  214. handleAdvClick(index) {
  215. var ad = this.advs[index];
  216. console.log(ad.advUrl);
  217. if (ad.showType == 1) {
  218. common_vendor.index.setStorageSync("url", ad.advUrl);
  219. common_vendor.index.navigateTo({
  220. url: "h5"
  221. });
  222. } else if (ad.showType == 2) {
  223. common_vendor.index.navigateTo({
  224. url: ad.advUrl
  225. });
  226. } else if (ad.showType == 3) {
  227. common_vendor.index.setStorageSync("content", ad.content);
  228. common_vendor.index.navigateTo({
  229. url: "content"
  230. });
  231. }
  232. },
  233. getAdvList() {
  234. var that = this;
  235. var data = {
  236. advType: 1
  237. };
  238. api_adv.getAdvList(data).then((res) => {
  239. if (res.code == 200) {
  240. that.advImgs = [];
  241. that.advs = [];
  242. res.data.forEach(function(element) {
  243. if (element.imageUrl != null && element.imageUrl != "") {
  244. that.advs.push(element);
  245. that.advImgs.push(element.imageUrl);
  246. }
  247. });
  248. } else {
  249. common_vendor.index.showToast({
  250. icon: "none",
  251. title: "\u8BF7\u6C42\u5931\u8D25"
  252. });
  253. }
  254. });
  255. },
  256. getArticleList() {
  257. var data = {
  258. isTui: 1,
  259. pageNum: 1,
  260. pageSize: 10
  261. };
  262. api_article.getArticleList(data).then((res) => {
  263. if (res.code == 200) {
  264. this.articles = res.data.list;
  265. } else {
  266. common_vendor.index.showToast({
  267. icon: "none",
  268. title: "\u8BF7\u6C42\u5931\u8D25"
  269. });
  270. }
  271. });
  272. },
  273. getDoctorList() {
  274. var data = {
  275. isTui: 1,
  276. pageNum: 1,
  277. pageSize: 10
  278. };
  279. api_doctor.getDoctorList(data).then((res) => {
  280. if (res.code == 200) {
  281. this.doctors = res.data.list;
  282. this.doctors.forEach(function(value, index, array) {
  283. value.prices = JSON.parse(value.priceJson);
  284. });
  285. } else {
  286. common_vendor.index.showToast({
  287. icon: "none",
  288. title: "\u8BF7\u6C42\u5931\u8D25"
  289. });
  290. }
  291. });
  292. },
  293. getPackageList() {
  294. var data = {
  295. isShow: 1,
  296. pageNum: 1,
  297. pageSize: 10
  298. };
  299. api_package.getPackageList(data).then((res) => {
  300. if (res.code == 200) {
  301. this.packages = res.data.list;
  302. } else {
  303. common_vendor.index.showToast({
  304. icon: "none",
  305. title: "\u8BF7\u6C42\u5931\u8D25"
  306. });
  307. }
  308. });
  309. },
  310. loginNavTo(url) {
  311. this.$isLogin().then((res) => {
  312. if (res) {
  313. console.log(res);
  314. common_vendor.index.navigateTo({
  315. url
  316. });
  317. } else {
  318. common_vendor.index.navigateTo({
  319. url: "/pages/auth/login"
  320. });
  321. }
  322. });
  323. },
  324. navTo(url) {
  325. if (url == "dev") {
  326. common_vendor.index.showToast({
  327. icon: "none",
  328. title: "\u5C3D\u60C5\u671F\u5F85..."
  329. });
  330. return;
  331. }
  332. console.log(url);
  333. common_vendor.index.navigateTo({
  334. url
  335. });
  336. },
  337. navToTest() {
  338. const course = { "companyId": 100, "companyUserId": 6806, "corpId": "ww5a88c4f879f204c5", "courseId": 63, "link": "1899022782092541952", "linkType": 3, "qwExternalId": 9914983, "qwUserId": "18931", "videoId": 409 };
  339. common_vendor.index.navigateTo({
  340. url: "/pages_course/video?course=" + JSON.stringify(course)
  341. });
  342. }
  343. }
  344. };
  345. if (!Array) {
  346. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  347. _easycom_u_swiper2();
  348. }
  349. const _easycom_u_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
  350. if (!Math) {
  351. _easycom_u_swiper();
  352. }
  353. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  354. return common_vendor.e({
  355. a: $data.statusBarHeight,
  356. b: $data.titleColor,
  357. c: !$data.isTop
  358. }, !$data.isTop ? {} : {}, {
  359. d: $data.isTop
  360. }, $data.isTop ? {} : {}, {
  361. e: $data.descColor,
  362. f: common_vendor.o(($event) => $options.navTo("/pages_index/search")),
  363. g: !$data.isTop
  364. }, !$data.isTop ? {} : {}, {
  365. h: $data.isTop
  366. }, $data.isTop ? {} : {}, {
  367. i: $options.bg,
  368. j: $data.statusBarHeight,
  369. k: $data.advImgs.length > 0
  370. }, $data.advImgs.length > 0 ? {
  371. l: common_vendor.o($options.handleAdvClick),
  372. m: common_vendor.p({
  373. list: $data.advImgs,
  374. indicator: true,
  375. indicatorMode: "line",
  376. circular: true
  377. })
  378. } : {}, {
  379. n: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList")),
  380. o: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelectType")),
  381. p: common_vendor.f($data.layouts, (item, index, i0) => {
  382. return common_vendor.e({
  383. a: item.id == 1 && item.isShow
  384. }, item.id == 1 && item.isShow ? {
  385. b: common_vendor.t(item.name),
  386. c: common_vendor.o(($event) => $options.navTo("/pages_index/testList")),
  387. d: common_vendor.o(($event) => $options.loginNavTo("/pages_user/integralGoodsList")),
  388. e: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelect?inquiryType=3")),
  389. f: common_vendor.o(($event) => $options.switchTab("/pages/store/index"))
  390. } : {}, {
  391. g: item.id == 2 && item.isShow
  392. }, item.id == 2 && item.isShow ? {
  393. h: common_vendor.t(item.name),
  394. i: common_vendor.f($data.depts, (item2, index2, i1) => {
  395. return {
  396. a: item2.iconUrl,
  397. b: common_vendor.t(item2.deptName),
  398. c: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList?deptId=" + item2.deptId))
  399. };
  400. }),
  401. j: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList?deptId=0"))
  402. } : {}, {
  403. k: item.id == 3 && item.isShow
  404. }, item.id == 3 && item.isShow ? {
  405. l: common_vendor.t(item.name),
  406. m: common_vendor.f($data.yangshengs, (item2, index2, i1) => {
  407. return {
  408. a: item2.icon,
  409. b: common_vendor.t(item2.title),
  410. c: common_vendor.t(item2.isShow),
  411. d: common_vendor.o(($event) => $options.yangshengClick(item2))
  412. };
  413. })
  414. } : {}, {
  415. n: item.id == 4 && item.isShow
  416. }, item.id == 4 && item.isShow ? {
  417. o: common_vendor.t(item.name),
  418. p: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorArticleList")),
  419. q: common_vendor.f($data.doctocArticles, (item2, index2, i1) => {
  420. return {
  421. a: item2.imageUrl,
  422. b: common_vendor.t(item2.views),
  423. c: item2.avatar,
  424. d: common_vendor.t(item2.doctorName),
  425. e: common_vendor.t(item2.position),
  426. f: common_vendor.t(item2.title),
  427. g: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorArticleDetails?articleId=" + item2.articleId))
  428. };
  429. })
  430. } : {}, {
  431. r: item.id == 5 && item.isShow
  432. }, item.id == 5 && item.isShow ? common_vendor.e({
  433. s: common_vendor.t(item.name),
  434. t: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList")),
  435. v: $data.doctors.length > 0
  436. }, $data.doctors.length > 0 ? {
  437. w: common_vendor.f($data.doctors, (item2, index2, i1) => {
  438. return common_vendor.e({
  439. a: item2.avatar,
  440. b: item2.workStatus == 1
  441. }, item2.workStatus == 1 ? {} : {}, {
  442. c: common_vendor.t(item2.doctorName),
  443. d: common_vendor.t(item2.position),
  444. e: common_vendor.t(item2.deptName),
  445. f: common_vendor.t(item2.hospitalName),
  446. g: common_vendor.t(item2.speciality),
  447. h: common_vendor.t(item2.pingStar),
  448. i: common_vendor.t(item2.orderNumber),
  449. j: common_vendor.f(item2.prices, (price, index3, i2) => {
  450. return common_vendor.e({
  451. a: common_vendor.t(price.price.toFixed(2)),
  452. b: index3 == 0
  453. }, index3 == 0 ? {} : {});
  454. }),
  455. k: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorDetails?doctorId=" + item2.doctorId))
  456. });
  457. })
  458. } : {}) : {}, {
  459. x: item.id == 6 && item.isShow
  460. }, item.id == 6 && item.isShow ? common_vendor.e({
  461. y: common_vendor.t(item.name),
  462. z: common_vendor.o(($event) => $options.navTo("/pages_index/articleList")),
  463. A: $data.articles.length > 0
  464. }, $data.articles.length > 0 ? {
  465. B: common_vendor.f($data.articles, (item2, index2, i1) => {
  466. return {
  467. a: common_vendor.t(item2.title),
  468. b: common_vendor.t(item2.views),
  469. c: item2.imageUrl,
  470. d: common_vendor.o(($event) => $options.navTo("/pages_index/articleDetails?articleId=" + item2.articleId))
  471. };
  472. })
  473. } : {}) : {}, {
  474. C: item.id == 7 && item.isShow
  475. }, item.id == 7 && item.isShow ? {
  476. D: common_vendor.t(item.name),
  477. E: common_vendor.o(($event) => $options.navTo("/pages_index/packageList")),
  478. F: common_vendor.f($data.packages, (item2, index2, i1) => {
  479. return {
  480. a: item2.imgUrl,
  481. b: common_vendor.t(item2.packageName),
  482. c: common_vendor.t(item2.price.toFixed(2)),
  483. d: common_vendor.t(item2.sales),
  484. e: common_vendor.o(($event) => $options.navTo("/pages_index/packageDetails?packageId=" + item2.packageId))
  485. };
  486. })
  487. } : {});
  488. })
  489. });
  490. }
  491. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-57280228"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages/index/index.vue"]]);
  492. _sfc_main.__runtimeHooks = 7;
  493. wx.createPage(MiniProgramPage);