zoujiandong 9b4734acc5 111
2025-07-18 13:30:14 +08:00

417 lines
15 KiB
JavaScript

"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_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_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
(_easycom_navBarSearch2 + _easycom_up__image2 + _easycom_up_dropdown_item2 + _easycom_up_dropdown2 + _easycom_up_icon2 + _easycom_z_paging2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_popup2)();
}
const _easycom_navBarSearch = () => "../../components/navBarSearch/navBarSearch.js";
const _easycom_up__image = () => "../../node-modules/uview-plus/components/u--image/u--image.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_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_popup = () => "../../node-modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
(_easycom_navBarSearch + _easycom_up__image + _easycom_up_dropdown_item + _easycom_up_dropdown + _easycom_up_icon + _easycom_z_paging + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_popup)();
}
const _sfc_main = {
__name: "specialList",
setup(__props) {
const user_id = common_vendor.ref("");
const is_selected = common_vendor.ref(0);
const paging = common_vendor.ref(null);
const dataList = common_vendor.ref([]);
const total = common_vendor.ref(0);
const keyWord = common_vendor.ref("");
const showNum = common_vendor.ref(true);
const options = common_vendor.ref([
{
label: "正序",
value: "asc"
},
{
label: "倒序",
value: "desc"
}
]);
const order = common_vendor.reactive({
read_num: "",
push_date: ""
});
const label_iden = common_vendor.ref("");
const showCase = common_vendor.ref(false);
common_vendor.ref(false);
const caseValue1 = common_vendor.ref("");
const caseValue2 = common_vendor.ref("");
const caseValue3 = common_vendor.ref("");
const level = common_vendor.ref(1);
const labelObj = common_vendor.reactive({
list1: [],
list2: [],
list3: []
});
const getCaseLabel = (lev, pid = 0) => {
api_api.api.getCaseLabel({
pId: pid
}).then((res) => {
if (lev == 1) {
labelObj.list1 = res.data.data;
} else if (lev == 2) {
labelObj.list2 = res.data.data;
} else if (lev == 3) {
labelObj.list3 = res.data.data;
}
level.value = lev;
});
};
const openCase = () => {
getCaseLabel(1, 0);
showCase.value = true;
};
const confirmCase = () => {
if (level.value == 1 && caseValue1.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
showCase.value = false;
if (level.value == 1) {
label_iden.value = caseValue1.value;
}
if (level.value == 2) {
label_iden.value = caseValue2.value;
}
if (level.value == 3) {
label_iden.value = caseValue3.value;
}
paging.value.reload();
};
const continueCase = () => {
if (level.value == 1 && caseValue1.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 2 && caseValue2.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 3 && caseValue3.value == "") {
common_vendor.index.showToast({ title: "请选择疾病", icon: "none" });
return false;
}
if (level.value == 1) {
getCaseLabel(2, caseValue1.value);
} else if (level.value == 2) {
getCaseLabel(3, caseValue2.value);
}
paging.value.reload();
};
const closeCase = () => {
showCase.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;
}
});
common_vendor.onShow(() => {
var _a;
(_a = paging.value) == null ? void 0 : _a.refresh();
});
const changeDate = (e) => {
common_vendor.index.__f__("log", "at pages/specialList/specialList.vue:368", e);
order.read_num = "";
paging.value.reload();
};
const changeRead = (e) => {
common_vendor.index.__f__("log", "at pages/specialList/specialList.vue:373", e);
order.push_date = "";
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:395", 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 (Number(is_selected.value)) {
searchForm.is_selected = Number(is_selected.value);
}
if (!order.read_num) {
delete order.read_num;
}
if (!label_iden.value) {
delete searchForm.label_iden;
}
if (!order.push_date) {
delete order.push_date;
}
if (order.read_num || order.push_date) {
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({
navName: "肝胆相照精选病例交流"
}),
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: common_vendor.o(openCase),
i: common_vendor.o(changeDate),
j: common_vendor.o(($event) => order.push_date = $event),
k: common_vendor.p({
title: "发布时间",
options: options.value,
modelValue: order.push_date
}),
l: common_vendor.o(changeRead),
m: common_vendor.o(($event) => order.read_num = $event),
n: common_vendor.p({
title: "阅读量",
options: options.value,
modelValue: order.read_num
}),
o: common_vendor.sr("uDropdownRef", "b2cb78f4-3,b2cb78f4-0"),
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),
c: "b2cb78f4-6-" + i0 + ",b2cb78f4-0",
d: common_vendor.p({
src: item.avatar ? item.avatar : common_vendor.unref(common_assets.headImg),
width: "46rpx",
height: "46rpx",
radius: "50%"
}),
e: common_vendor.t(item.user_name),
f: common_vendor.t(item.hospital_name),
g: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id),
h: common_vendor.t(item.exchange_content),
i: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id),
j: item.exchange_content_image && item.exchange_content_image.length > 0
}, item.exchange_content_image && item.exchange_content_image.length > 0 ? {
k: common_vendor.f(item.exchange_content_image, (unit, k1, i1) => {
return {
a: "b2cb78f4-7-" + i0 + "-" + i1 + ",b2cb78f4-0",
b: common_vendor.p({
src: unit,
radius: "10",
width: "220rpx",
height: "220rpx"
})
};
}),
l: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id)
} : {}, {
m: item.exchange_content_video && item.exchange_content_video.length > 0
}, item.exchange_content_video && item.exchange_content_video.length > 0 ? {
n: common_vendor.f(item.exchange_content_video, (videoCell, index, i1) => {
return {
a: index,
b: videoCell,
c: common_vendor.o(videoErrorCallback, index)
};
})
} : {}, {
o: item.label && item.label.length > 0
}, item.label && item.label.length > 0 ? {
p: common_vendor.f(item.label, (cell, k1, i1) => {
return {
a: common_vendor.t(cell.label_name),
b: cell.exchange_label_id
};
}),
q: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id)
} : {}, {
r: "b2cb78f4-8-" + i0 + ",b2cb78f4-0",
s: common_vendor.t(item.read_num),
t: "b2cb78f4-9-" + i0 + ",b2cb78f4-0",
v: common_vendor.t(item.collect_num),
w: "b2cb78f4-10-" + i0 + ",b2cb78f4-0",
x: common_vendor.t(item.comment_num),
y: "b2cb78f4-11-" + i0 + ",b2cb78f4-0",
z: common_vendor.t(formatdate(item.push_date)),
A: common_vendor.o(($event) => goDetail(item.exchange_id), item.exchange_id),
B: item.exchange_id
});
}),
q: common_vendor.p({
name: "eye",
color: "#4B5563",
size: "28rpx"
}),
r: common_vendor.p({
name: "heart",
color: "#4B5563",
size: "28rpx"
}),
s: common_vendor.p({
name: "chat",
color: "#4B5563",
size: "28rpx"
}),
t: common_vendor.p({
name: "clock",
color: "#4B5563",
size: "28rpx"
}),
v: common_vendor.sr(paging, "b2cb78f4-0", {
"k": "paging"
}),
w: common_vendor.o(queryList),
x: common_vendor.o(($event) => dataList.value = $event),
y: common_vendor.p({
["inside-more"]: true,
["loading-more-no-more-text"]: "咱也是有底线的!",
["auto-show-back-to-top"]: true,
modelValue: dataList.value
}),
z: common_vendor.o(($event) => showCase.value = false),
A: common_vendor.o(continueCase),
B: level.value != 3,
C: common_vendor.o(confirmCase),
D: common_vendor.f(labelObj.list1, (item, k0, i0) => {
return {
a: "b2cb78f4-14-" + i0 + ",b2cb78f4-13",
b: common_vendor.p({
activeColor: "#3CC7C0 ",
label: item.label_name,
name: item.app_iden
}),
c: item.app_iden
};
}),
E: common_vendor.o(($event) => caseValue1.value = $event),
F: common_vendor.p({
iconPlacement: "right",
placement: "column",
modelValue: caseValue1.value
}),
G: level.value == 1,
H: common_vendor.f(labelObj.list2, (item, k0, i0) => {
return {
a: "b2cb78f4-16-" + i0 + ",b2cb78f4-15",
b: common_vendor.p({
activeColor: "#3CC7C0 ",
label: item.label_name,
name: item.app_iden
}),
c: item.app_iden
};
}),
I: common_vendor.o(($event) => caseValue2.value = $event),
J: common_vendor.p({
iconPlacement: "right",
placement: "column",
modelValue: caseValue2.value
}),
K: level.value == 2,
L: common_vendor.f(labelObj.list3, (item, k0, i0) => {
return {
a: "b2cb78f4-18-" + i0 + ",b2cb78f4-17",
b: common_vendor.p({
activeColor: "#3CC7C0 ",
label: item.label_name,
name: item.app_iden
}),
c: item.app_iden
};
}),
M: common_vendor.o(($event) => caseValue3.value = $event),
N: common_vendor.p({
iconPlacement: "right",
placement: "column",
modelValue: caseValue3.value
}),
O: level.value == 3,
P: common_vendor.o(closeCase),
Q: common_vendor.p({
round: 10,
zIndex: "9",
show: showCase.value,
mode: "bottom"
})
});
};
}
};
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