"use strict"; var common_vendor = require("../../common/vendor.js"); var api_common = require("../../api/common.js"); var api_package = require("../../api/package.js"); var api_doctorArticle = require("../../api/doctorArticle.js"); var api_doctor = require("../../api/doctor.js"); var api_article = require("../../api/article.js"); var api_adv = require("../../api/adv.js"); var api_department = require("../../api/department.js"); require("../../common/request.js"); const _sfc_main = { data() { return { layouts: [], yangshengs: [ { id: "0", title: "AI\u820C\u8BCA", page: "/pages_user/tongue/index", icon: "https://cos.his.cdwjyyh.com/fs/20240919/647fb42de0ab4e96a6c3097f3c3d9cf5.png" }, { id: "1", title: "\u836F\u81B3\u98DF\u7597", page: "/pages_index/medicatedFoodList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/3cfbd47911cf4753aa9497eac500728d.png" }, { id: "2", title: "\u7ECF\u7EDC\u7A74\u4F4D", page: "/pages_index/vesselList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e93536a9dc1a4f8ca09545097b12fdea.png" }, { id: "3", title: "\u95EE\u7B54\u4E13\u533A", page: "/pages_index/questionsList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e896972bd56f4e358188af36f2c5af42.png" }, { id: "4", title: "\u75BE\u75C5", page: "/pages_index/diseaseList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/d6f1851cccae414b8baf2ba07782f91b.png" }, { id: "5", title: "\u4E2D\u836F\u56FE\u89E3", page: "/pages_index/chineseMedicineList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/ff43572d0d004285b5a3b0ef2663c471.png" }, { id: "6", title: "\u540D\u65B9\u4ECA\u7528", page: "/pages_index/famousPrescribeList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/45db770e58c34963b0d2ba24a958b617.png" }, { id: "7", title: "\u5EB7\u590D\u533B\u6848", page: "/pages_doctor/doctorArticleList", icon: "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/e793942797b24035b51f94d894bdfa0b.png" } ], isTop: false, titleColor: "#2A2B2E", descColor: "#626468", top: 0, statusBarHeight: common_vendor.index.getStorageSync("menuInfo").statusBarHeight, advImgs: [], doctors: [], advs: [], articles: [], depts: [], doctocArticles: [], hosLevelOptions: [], packages: [] }; }, onLoad() { this.getDictByKey("sys_hospital_level"); common_vendor.index.$on("refreshMsgCount", () => { try { let totalUnreadCount = common_vendor.index.$TUIKit.getTotalUnreadMessageCount(); if (totalUnreadCount > 0) { try { common_vendor.index.setTabBarBadge({ index: 1, text: totalUnreadCount + "" }); } catch (e) { } } else { try { common_vendor.index.hideTabBarRedDot({ index: 1 }); } catch (e) { } } } catch (e) { } }); }, onShow() { this.getDoctorList(); this.getArticleList(); this.getAdvList(); this.getDepartmentList(); this.getDoctorArticleList(); this.getPackageList(); this.getConfigByKey("his.appShow"); common_vendor.index.$emit("refreshMsgCount"); }, onPageScroll(e) { this.top = e.scrollTop; }, onShareAppMessage(res) { if (this.$isLogin()) { return { title: "\u5FA1\u541B\u65B9\u4E92\u8054\u7F51\u533B\u9662", path: "/pages/index/index", imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png" }; } }, onShareTimeline(res) { if (this.utils.isLogin()) { return { title: "\u5FA1\u541B\u65B9\u4E92\u8054\u7F51\u533B\u9662", imageUrl: "https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png" }; } }, computed: { bg: function() { var top = this.top / 120; console.log(top); if (top > 0) { this.isTop = true; this.titleColor = "#fff"; this.descColor = "#fff"; } else { this.isTop = false; this.titleColor = "#2A2B2E"; this.descColor = "#626468"; } return "rgba(195,154,88, " + top + ")"; } }, methods: { dev() { common_vendor.index.showToast({ icon: "none", title: "\u656C\u8BF7\u671F\u5F85" }); }, getConfigByKey(key) { var that = this; var data = { key }; api_common.getConfigByKey(data).then((res) => { if (res.code == 200) { this.layouts = JSON.parse(res.data); this.layouts.sort((a, b) => a.sort - b.sort); console.log(this.layouts); this.layouts.forEach(function(element) { if (element.id == "4") { if (!element.isShow) { that.yangshengs.splice(6, 1); } } if (element.id == "7") ; }); } }, (rej) => { }); }, yangshengClick(item) { if (item.id == 0) { this.$isLogin().then((res) => { if (res) { common_vendor.index.navigateTo({ url: item.page }); } else { common_vendor.index.navigateTo({ url: "/pages/auth/login" }); } }); } else { if (item.page == "") { common_vendor.index.showToast({ icon: "none", title: "\u6682\u65E0\u66F4\u591A" }); return; } common_vendor.index.navigateTo({ url: item.page }); } }, switchTab(url) { common_vendor.index.switchTab({ url }); }, navToMiniProgram() { common_vendor.index.navigateToMiniProgram({ appId: "wx45cf09091aead547", path: "/pages/common/launch", extraData: {}, envVersion: "develop", success(res) { }, fail(err) { } }); }, getDictByKey(key) { var data = { key }; api_common.getDictByKey(data).then((res) => { if (res.code == 200) { if (key == "sys_hospital_level") { this.hosLevelOptions = res.data; } } }, (err) => { }); }, getDoctorArticleList(page) { var data = { pageNum: 1, pageSize: 10 }; api_doctorArticle.getDoctorArticleList(data).then((res) => { if (res.code == 200) { this.doctocArticles = res.data.list; } }); }, getDepartmentList(page) { var data = { isTui: 1 }; api_department.getDepartmentList(data).then((res) => { if (res.code == 200) { this.depts = res.data; } }); }, handleAdvClick(index) { var ad = this.advs[index]; console.log(ad.advUrl); if (ad.showType == 1) { common_vendor.index.setStorageSync("url", ad.advUrl); common_vendor.index.navigateTo({ url: "h5" }); } else if (ad.showType == 2) { common_vendor.index.navigateTo({ url: ad.advUrl }); } else if (ad.showType == 3) { common_vendor.index.setStorageSync("content", ad.content); common_vendor.index.navigateTo({ url: "content" }); } }, getAdvList() { var that = this; var data = { advType: 1 }; api_adv.getAdvList(data).then((res) => { if (res.code == 200) { that.advImgs = []; that.advs = []; res.data.forEach(function(element) { if (element.imageUrl != null && element.imageUrl != "") { that.advs.push(element); that.advImgs.push(element.imageUrl); } }); } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }); }, getArticleList() { var data = { isTui: 1, pageNum: 1, pageSize: 10 }; api_article.getArticleList(data).then((res) => { if (res.code == 200) { this.articles = res.data.list; } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }); }, getDoctorList() { var data = { isTui: 1, pageNum: 1, pageSize: 10 }; api_doctor.getDoctorList(data).then((res) => { if (res.code == 200) { this.doctors = res.data.list; this.doctors.forEach(function(value, index, array) { value.prices = JSON.parse(value.priceJson); }); } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }); }, getPackageList() { var data = { isShow: 1, pageNum: 1, pageSize: 10 }; api_package.getPackageList(data).then((res) => { if (res.code == 200) { this.packages = res.data.list; } else { common_vendor.index.showToast({ icon: "none", title: "\u8BF7\u6C42\u5931\u8D25" }); } }); }, loginNavTo(url) { this.$isLogin().then((res) => { if (res) { console.log(res); common_vendor.index.navigateTo({ url }); } else { common_vendor.index.navigateTo({ url: "/pages/auth/login" }); } }); }, navTo(url) { if (url == "dev") { common_vendor.index.showToast({ icon: "none", title: "\u5C3D\u60C5\u671F\u5F85..." }); return; } console.log(url); common_vendor.index.navigateTo({ url }); }, navToTest() { const course = { "companyId": 100, "companyUserId": 6806, "corpId": "ww5a88c4f879f204c5", "courseId": 63, "link": "1899022782092541952", "linkType": 3, "qwExternalId": 9914983, "qwUserId": "18931", "videoId": 409 }; common_vendor.index.navigateTo({ url: "/pages_course/video?course=" + JSON.stringify(course) }); } } }; if (!Array) { const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper"); _easycom_u_swiper2(); } const _easycom_u_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js"; if (!Math) { _easycom_u_swiper(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: $data.statusBarHeight, b: $data.titleColor, c: !$data.isTop }, !$data.isTop ? {} : {}, { d: $data.isTop }, $data.isTop ? {} : {}, { e: $data.descColor, f: common_vendor.o(($event) => $options.navTo("/pages_index/search")), g: !$data.isTop }, !$data.isTop ? {} : {}, { h: $data.isTop }, $data.isTop ? {} : {}, { i: $options.bg, j: $data.statusBarHeight, k: $data.advImgs.length > 0 }, $data.advImgs.length > 0 ? { l: common_vendor.o($options.handleAdvClick), m: common_vendor.p({ list: $data.advImgs, indicator: true, indicatorMode: "line", circular: true }) } : {}, { n: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList")), o: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelectType")), p: common_vendor.f($data.layouts, (item, index, i0) => { return common_vendor.e({ a: item.id == 1 && item.isShow }, item.id == 1 && item.isShow ? { b: common_vendor.t(item.name), c: common_vendor.o(($event) => $options.navTo("/pages_index/testList")), d: common_vendor.o(($event) => $options.loginNavTo("/pages_user/integralGoodsList")), e: common_vendor.o(($event) => $options.navTo("/pages_order/inquirySelect?inquiryType=3")), f: common_vendor.o(($event) => $options.switchTab("/pages/store/index")) } : {}, { g: item.id == 2 && item.isShow }, item.id == 2 && item.isShow ? { h: common_vendor.t(item.name), i: common_vendor.f($data.depts, (item2, index2, i1) => { return { a: item2.iconUrl, b: common_vendor.t(item2.deptName), c: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList?deptId=" + item2.deptId)) }; }), j: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList?deptId=0")) } : {}, { k: item.id == 3 && item.isShow }, item.id == 3 && item.isShow ? { l: common_vendor.t(item.name), m: common_vendor.f($data.yangshengs, (item2, index2, i1) => { return { a: item2.icon, b: common_vendor.t(item2.title), c: common_vendor.t(item2.isShow), d: common_vendor.o(($event) => $options.yangshengClick(item2)) }; }) } : {}, { n: item.id == 4 && item.isShow }, item.id == 4 && item.isShow ? { o: common_vendor.t(item.name), p: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorArticleList")), q: common_vendor.f($data.doctocArticles, (item2, index2, i1) => { return { a: item2.imageUrl, b: common_vendor.t(item2.views), c: item2.avatar, d: common_vendor.t(item2.doctorName), e: common_vendor.t(item2.position), f: common_vendor.t(item2.title), g: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorArticleDetails?articleId=" + item2.articleId)) }; }) } : {}, { r: item.id == 5 && item.isShow }, item.id == 5 && item.isShow ? common_vendor.e({ s: common_vendor.t(item.name), t: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorList")), v: $data.doctors.length > 0 }, $data.doctors.length > 0 ? { w: common_vendor.f($data.doctors, (item2, index2, i1) => { return common_vendor.e({ a: item2.avatar, b: item2.workStatus == 1 }, item2.workStatus == 1 ? {} : {}, { c: common_vendor.t(item2.doctorName), d: common_vendor.t(item2.position), e: common_vendor.t(item2.deptName), f: common_vendor.t(item2.hospitalName), g: common_vendor.t(item2.speciality), h: common_vendor.t(item2.pingStar), i: common_vendor.t(item2.orderNumber), j: common_vendor.f(item2.prices, (price, index3, i2) => { return common_vendor.e({ a: common_vendor.t(price.price.toFixed(2)), b: index3 == 0 }, index3 == 0 ? {} : {}); }), k: common_vendor.o(($event) => $options.navTo("/pages_doctor/doctorDetails?doctorId=" + item2.doctorId)) }); }) } : {}) : {}, { x: item.id == 6 && item.isShow }, item.id == 6 && item.isShow ? common_vendor.e({ y: common_vendor.t(item.name), z: common_vendor.o(($event) => $options.navTo("/pages_index/articleList")), A: $data.articles.length > 0 }, $data.articles.length > 0 ? { B: common_vendor.f($data.articles, (item2, index2, i1) => { return { a: common_vendor.t(item2.title), b: common_vendor.t(item2.views), c: item2.imageUrl, d: common_vendor.o(($event) => $options.navTo("/pages_index/articleDetails?articleId=" + item2.articleId)) }; }) } : {}) : {}, { C: item.id == 7 && item.isShow }, item.id == 7 && item.isShow ? { D: common_vendor.t(item.name), E: common_vendor.o(($event) => $options.navTo("/pages_index/packageList")), F: common_vendor.f($data.packages, (item2, index2, i1) => { return { a: item2.imgUrl, b: common_vendor.t(item2.packageName), c: common_vendor.t(item2.price.toFixed(2)), d: common_vendor.t(item2.sales), e: common_vendor.o(($event) => $options.navTo("/pages_index/packageDetails?packageId=" + item2.packageId)) }; }) } : {}); }) }); } 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"]]); _sfc_main.__runtimeHooks = 7; wx.createPage(MiniProgramPage);