"use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const api_api = require("../../api/api.js"); const utils_navTo = require("../../utils/navTo.js"); if (!Array) { const _easycom_navBarSearch2 = common_vendor.resolveComponent("navBarSearch"); const _easycom_up__image2 = common_vendor.resolveComponent("up--image"); const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio"); const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group"); const _easycom_up_dropdown_item2 = common_vendor.resolveComponent("up-dropdown-item"); const _easycom_up_dropdown2 = common_vendor.resolveComponent("up-dropdown"); const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon"); const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging"); const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon"); const _easycom_up_steps_item2 = common_vendor.resolveComponent("up-steps-item"); const _easycom_up_steps2 = common_vendor.resolveComponent("up-steps"); const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup"); const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay"); (_easycom_navBarSearch2 + _easycom_up__image2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_dropdown_item2 + _easycom_up_dropdown2 + _easycom_up_icon2 + _easycom_z_paging2 + _easycom_u_icon2 + _easycom_up_steps_item2 + _easycom_up_steps2 + _easycom_up_popup2 + _easycom_up_overlay2)(); } const _easycom_navBarSearch = () => "../../components/navBarSearch/navBarSearch.js"; const _easycom_up__image = () => "../../node-modules/uview-plus/components/u--image/u--image.js"; const _easycom_up_radio = () => "../../node-modules/uview-plus/components/u-radio/u-radio.js"; const _easycom_up_radio_group = () => "../../node-modules/uview-plus/components/u-radio-group/u-radio-group.js"; const _easycom_up_dropdown_item = () => "../../node-modules/uview-plus/components/u-dropdown-item/u-dropdown-item.js"; const _easycom_up_dropdown = () => "../../node-modules/uview-plus/components/u-dropdown/u-dropdown.js"; const _easycom_up_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js"; const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_up_steps_item = () => "../../node-modules/uview-plus/components/u-steps-item/u-steps-item.js"; const _easycom_up_steps = () => "../../node-modules/uview-plus/components/u-steps/u-steps.js"; const _easycom_up_popup = () => "../../node-modules/uview-plus/components/u-popup/u-popup.js"; const _easycom_up_overlay = () => "../../node-modules/uview-plus/components/u-overlay/u-overlay.js"; if (!Math) { (_easycom_navBarSearch + _easycom_up__image + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_dropdown_item + _easycom_up_dropdown + _easycom_up_icon + _easycom_z_paging + _easycom_u_icon + _easycom_up_steps_item + _easycom_up_steps + _easycom_up_popup + _easycom_up_overlay)(); } const _sfc_main = { __name: "specialList", setup(__props) { const user_id = common_vendor.ref(""); const showModal = common_vendor.ref(false); const showDeal = common_vendor.ref(false); const is_selected = common_vendor.ref(0); const navName = common_vendor.ref("肝胆相照病例交流园地"); const isMine = common_vendor.ref(false); const paging = common_vendor.ref(null); const dataList = common_vendor.ref([]); const total = common_vendor.ref(0); const keyWord = common_vendor.ref(""); const vote = common_vendor.ref(null); const showNum = common_vendor.ref(false); const label_iden = common_vendor.ref(""); const dropTitle = common_vendor.ref("发布时间"); const orderFilter = common_vendor.ref("1"); const uDropdownRef = common_vendor.ref(null); const dealId = common_vendor.ref(""); const options = common_vendor.ref([ { label: "发布时间", value: "1" }, { label: "互动更新时间", value: "2" }, { label: "互动数", value: "3" } ]); common_vendor.ref(true); const order = common_vendor.reactive({ read_num: "", push_date: "desc" }); const showCase = common_vendor.ref(false); common_vendor.ref(false); const freshKey = common_vendor.ref(0); const caseValue1 = common_vendor.reactive({ value: "", name: "" }); const caseValue2 = common_vendor.reactive({ value: "", name: "" }); const caseValue3 = common_vendor.reactive({ value: "", name: "" }); const level = common_vendor.ref(1); const labelObj = common_vendor.reactive({ list1: [], list2: [], list3: [] }); const openCaseLevel = (lev) => { freshKey.value++; level.value = lev; if (lev == 1) { caseValue2.name = ""; caseValue2.value = ""; labelObj.list2 = []; } else if (lev == 2) { labelObj.list3 = []; caseValue3.name = ""; caseValue3.value = ""; } }; const groupChange1 = (e) => { caseValue1.value = e; for (var i = 0; i < labelObj.list1.length; i++) { if (labelObj.list1[i].app_iden == caseValue1.value) { caseValue1.name = labelObj.list1[i].label_name; break; } } getCaseLabel(2, e); }; const groupChange2 = (e) => { caseValue2.value = e; for (var i = 0; i < labelObj.list2.length; i++) { if (labelObj.list2[i].app_iden == caseValue2.value) { caseValue2.name = labelObj.list2[i].label_name; break; } } getCaseLabel(3, e); }; const groupChange3 = (e) => { caseValue3.value = e; level.value = 3; for (var i = 0; i < labelObj.list3.length; i++) { if (labelObj.list3[i].app_iden == caseValue3.value) { caseValue3.name = labelObj.list3[i].label_name; break; } } }; const getCaseLabel = (lev, pid = 0) => { api_api.api.getCaseLabel({ pId: pid }).then((res) => { level.value = lev; if (lev == 1) { labelObj.list1 = res.data.data; } else if (lev == 2) { labelObj.list2 = res.data.data; if (res.data.data.length == 0) { level.value = 1; } } else if (lev == 3) { labelObj.list3 = res.data.data; if (res.data.data.length == 0) { level.value = 2; } } }); }; const openCase = () => { showCase.value = true; }; const confirmCase = () => { if (level.value == 1 && caseValue1.value == "") { common_vendor.index.showToast({ title: "请选择疾病选项", icon: "none" }); return false; } if (level.value == 1) { label_iden.value = caseValue1.value; } if (level.value == 2) { if (!caseValue2.value) { label_iden.value = caseValue1.value; } else { label_iden.value = caseValue2.value; } } if (level.value == 3) { if (!caseValue3.value) { label_iden.value = caseValue2.value; } else { label_iden.value = caseValue3.value; } } paging.value.reload(); showCase.value = false; }; const closeCase = () => { showCase.value = false; }; const openDeal = (id, voteObj) => { showDeal.value = true; dealId.value = id; vote.value = voteObj; common_vendor.index.__f__("log", "at pages/specialList/specialList.vue:507", id); }; const alertDel = () => { showDeal.value = false; showModal.value = true; }; const goEdit = () => { showDeal.value = false; if (vote.value && vote.value.is_have_voted != 1) { common_vendor.index.showToast({ icon: "none", title: "不可编辑" }); return false; } utils_navTo.navTo({ url: "/pages/publish/publish?exchange_id=" + dealId.value }); }; const htmlToText = (html) => { return html.replace(/<[^>]*>/g, "").replace(/ /gi, " ").replace(//gi, "\n").replace(/]*>/gi, "").replace(/]*>[\s\S]*?/gi, ""); }; const confirmDel = () => { api_api.api.delExchange(dealId.value).then((res) => { common_vendor.index.showToast({ title: "删除成功", icon: "none", duration: 2e3 }); }); let index = dataList.value.findIndex((item) => item.exchange_id === dealId.value); dataList.value.splice(index, 1); showModal.value = false; }; const closeDealPop = () => { showDeal.value = false; }; const formatdate = (date) => { return common_vendor.dayjs(date).format("YYYY-MM-DD"); }; common_vendor.onLoad((options2) => { if (options2.keyWord) { keyWord.value = options2.keyWord; } if (options2.userId) { user_id.value = options2.userId; } if (options2.is_selected) { is_selected.value = options2.is_selected; navName.value = "肝胆相照精选病例交流"; } if (options2.type == "mine") { isMine.value = true; } if (options2.from == "talkHome") { showNum.value = true; } getCaseLabel(1, 0); }); common_vendor.onShow(() => { var _a; (_a = paging.value) == null ? void 0 : _a.refresh(); }); const changeDate = (e) => { if (e == 1) { order.push_date = "desc"; order.comment_num = ""; order.last_comment_time = ""; dropTitle.value = "发布时间"; } else if (e == 2) { order.push_date = ""; order.comment_num = ""; order.last_comment_time = "desc"; dropTitle.value = "互动更新时间"; } else { order.push_date = ""; order.last_comment_time = ""; order.comment_num = "desc"; dropTitle.value = "互动数"; } orderFilter.value = e; uDropdownRef.value.close(); paging.value.reload(); }; const videoErrorCallback = (e) => { common_vendor.index.showModal({ content: e.target.errMsg, showCancel: false }); }; const changeWord = (val) => { if (!val) return false; showNum.value = true; keyWord.value = val; paging.value.reload(); }; const goDetail = (id) => { utils_navTo.navTo({ url: `/pages/detail/detail?id=${id}&type=exchange` }); }; const queryList = (pageNo, pageSize) => { common_vendor.index.__f__("log", "at pages/specialList/specialList.vue:620", 666666); const params = { page: pageNo, page_size: pageSize }; searchList(params); }; const searchList = async (params) => { let searchForm = { keyword: keyWord.value, user_id: user_id.value, label_iden: label_iden.value }; if (!label_iden.value) { delete searchForm.label_iden; } if (Number(is_selected.value)) { searchForm.is_selected = Number(is_selected.value); } if (!order.comment_num) { delete order.comment_num; } if (!order.last_comment_time) { delete order.last_comment_time; } if (!label_iden.value) { delete searchForm.label_iden; } if (!order.push_date) { delete order.push_date; } if (order.comment_num || order.push_date || order.last_comment_time) { searchForm.order = order; } api_api.api.searchExchage({ ...searchForm, ...params }).then((res) => { paging.value.complete(res.data.data.data); total.value = res.data.data.total; }).catch((err) => { paging.value.complete(false); }); }; return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.o(changeWord), b: common_vendor.p({ searchWord: keyWord.value, navName: navName.value }), c: showNum.value }, showNum.value ? common_vendor.e({ d: common_vendor.t(total.value), e: keyWord.value }, keyWord.value ? { f: common_vendor.t(keyWord.value) } : {}) : {}, { g: common_vendor.p({ src: common_vendor.unref(common_assets.caseImg), width: "31rpx", height: "31rpx" }), h: label_iden.value ? 1 : "", i: common_vendor.o(openCase), j: common_vendor.f(options.value, (item, k0, i0) => { return { a: "b2cb78f4-6-" + i0 + ",b2cb78f4-5", b: common_vendor.p({ activeColor: "#3CC7C0", label: item.label, name: item.value }), c: item.value, d: common_vendor.n(orderFilter.value == item.value ? "active" : "") }; }), k: common_vendor.o(changeDate), l: common_vendor.o(($event) => orderFilter.value = $event), m: common_vendor.p({ iconPlacement: "right", placement: "column", modelValue: orderFilter.value }), n: common_vendor.p({ title: dropTitle.value }), o: common_vendor.sr(uDropdownRef, "b2cb78f4-3,b2cb78f4-0", { "k": "uDropdownRef" }), p: common_vendor.f(dataList.value, (item, k0, i0) => { return common_vendor.e({ a: common_vendor.t(item.exchange_title), b: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id) }, isMine.value ? { c: common_vendor.o(($event) => openDeal(item.exchange_id, item.case_exchange_vote), item.exchange_id) } : {}, { d: "b2cb78f4-7-" + i0 + ",b2cb78f4-0", e: common_vendor.p({ src: item.avatar ? item.avatar : common_vendor.unref(common_assets.headImg), width: "46rpx", height: "46rpx", radius: "50%" }), f: common_vendor.t(item.user_name), g: common_vendor.t(item.hospital_name), h: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id), i: common_vendor.t(htmlToText(item.exchange_content)), j: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id), k: item.exchange_content_image && item.exchange_content_image.length > 0 }, item.exchange_content_image && item.exchange_content_image.length > 0 ? { l: common_vendor.f(item.exchange_content_image.splice(0, 3), (unit, k1, i1) => { return { a: "b2cb78f4-8-" + i0 + "-" + i1 + ",b2cb78f4-0", b: common_vendor.p({ src: unit, radius: "10", width: "220rpx", height: "220rpx" }), c: unit }; }), m: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id) } : {}, { n: item.exchange_content_video && item.exchange_content_video.length > 0 }, item.exchange_content_video && item.exchange_content_video.length > 0 ? { o: common_vendor.f(item.exchange_content_video.slice(0, 1), (videoCell, index, i1) => { return { a: index, b: videoCell, c: common_vendor.o(videoErrorCallback, index) }; }), p: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id) } : {}, { q: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id), r: item.exchange_label }, item.exchange_label ? { s: common_vendor.f(item.exchange_label, (cell, k1, i1) => { return { a: common_vendor.t(cell.label_name), b: cell.exchange_label_id }; }), t: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id) } : {}, { v: "b2cb78f4-9-" + i0 + ",b2cb78f4-0", w: common_vendor.t(item.read_num), x: item.collect_num > 0 }, item.collect_num > 0 ? { y: "b2cb78f4-10-" + i0 + ",b2cb78f4-0", z: common_vendor.p({ name: "heart", color: "#4B5563", size: "28rpx" }), A: common_vendor.t(item.collect_num) } : {}, { B: item.comment_num > 0 }, item.comment_num > 0 ? { C: "b2cb78f4-11-" + i0 + ",b2cb78f4-0", D: common_vendor.p({ name: "chat", color: "#4B5563", size: "28rpx" }), E: common_vendor.t(item.comment_num) } : {}, { F: "b2cb78f4-12-" + i0 + ",b2cb78f4-0", G: common_vendor.t(formatdate(item.push_date)), H: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id), I: item.exchange_id }); }), q: isMine.value, r: common_vendor.p({ name: "eye", color: "#4B5563", size: "28rpx" }), s: common_vendor.p({ name: "clock", color: "#4B5563", size: "28rpx" }), t: common_vendor.sr(paging, "b2cb78f4-0", { "k": "paging" }), v: common_vendor.o(queryList), w: common_vendor.o(($event) => dataList.value = $event), x: common_vendor.p({ ["inside-more"]: true, ["loading-more-no-more-text"]: "咱也是有底线的!", ["auto-show-back-to-top"]: true, modelValue: dataList.value }), y: common_vendor.o(closeCase), z: common_vendor.o(confirmCase), A: common_vendor.t(!caseValue1.name ? "请选择选项" : caseValue1.name), B: common_vendor.p({ name: "arrow-right" }), C: common_vendor.o(($event) => openCaseLevel("1")), D: caseValue1.name && labelObj.list2.length > 0 }, caseValue1.name && labelObj.list2.length > 0 ? { E: common_vendor.t(!caseValue2.name ? "请选择选项" : caseValue2.name), F: common_vendor.p({ name: "arrow-right" }), G: common_vendor.o(($event) => openCaseLevel("2")) } : {}, { H: caseValue2.name && labelObj.list3.length > 0 }, caseValue2.name && labelObj.list3.length > 0 ? { I: common_vendor.t(!caseValue3.name ? "请选择选项" : caseValue3.name), J: common_vendor.p({ name: "arrow-right" }), K: common_vendor.o(($event) => openCaseLevel("3")) } : {}, { L: freshKey.value, M: common_vendor.p({ current: level.value - 1, direction: "column" }), N: common_vendor.f(labelObj.list1, (item, k0, i0) => { return { a: "b2cb78f4-22-" + i0 + ",b2cb78f4-21", b: common_vendor.p({ activeColor: "#3CC7C0 ", label: item.label_name, name: item.app_iden }), c: item.app_iden, d: item.label_name != "热门话题" }; }), O: common_vendor.o(groupChange1), P: common_vendor.o(($event) => caseValue1.value = $event), Q: common_vendor.p({ name: "group1", iconPlacement: "right", placement: "column", modelValue: caseValue1.value }), R: level.value == 1, S: common_vendor.f(labelObj.list2, (item, k0, i0) => { return { a: "b2cb78f4-24-" + i0 + ",b2cb78f4-23", b: common_vendor.p({ activeColor: "#3CC7C0 ", label: item.label_name, name: item.app_iden }), c: item.app_iden }; }), T: common_vendor.o(groupChange2), U: common_vendor.o(($event) => caseValue2.value = $event), V: common_vendor.p({ name: "group2", iconPlacement: "right", placement: "column", modelValue: caseValue2.value }), W: level.value == 2, X: common_vendor.f(labelObj.list3, (item, k0, i0) => { return { a: "b2cb78f4-26-" + i0 + ",b2cb78f4-25", b: common_vendor.p({ activeColor: "#3CC7C0 ", label: item.label_name, name: item.app_iden }), c: item.app_iden }; }), Y: common_vendor.o(groupChange3), Z: common_vendor.o(($event) => caseValue3.value = $event), aa: common_vendor.p({ name: "group3", iconPlacement: "right", placement: "column", modelValue: caseValue3.value }), ab: level.value == 3, ac: common_vendor.o(closeCase), ad: common_vendor.p({ round: 10, zIndex: "9", closeOnClickOverlay: false, show: showCase.value, mode: "bottom" }), ae: common_vendor.o(goEdit), af: common_vendor.o(alertDel), ag: common_vendor.o(closeDealPop), ah: common_vendor.p({ zIndex: 60, overlayStyle: { zIndex: 59 }, show: showDeal.value, round: 10, mode: "bottom" }), ai: common_vendor.o(($event) => showModal.value = false), aj: common_vendor.o(confirmDel), ak: common_vendor.p({ show: showModal.value, ["mask-click-able"]: true }) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b2cb78f4"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/specialList/specialList.js.map