This commit is contained in:
zoujiandong
2025-07-30 13:58:39 +08:00
parent afc79a0f26
commit 43abd1f3d6
360 changed files with 27253 additions and 0 deletions
+205
View File
@@ -0,0 +1,205 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_navTo = require("../../utils/navTo.js");
const api_api = require("../../api/api.js");
const common_assets = require("../../common/assets.js");
if (!Array) {
const _easycom_up__image2 = common_vendor.resolveComponent("up--image");
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
(_easycom_up__image2 + _easycom_u_icon2)();
}
const _easycom_up__image = () => "../../node-modules/uview-plus/components/u--image/u--image.js";
const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
if (!Math) {
(navBar + _easycom_up__image + _easycom_u_icon + tabBar)();
}
const tabBar = () => "../../components/tabBar/tabBar.js";
const navBar = () => "../../components/navBar/navBar.js";
const _sfc_main = {
__name: "index",
setup(__props) {
common_vendor.ref(null);
common_vendor.ref([]);
const most_read_articles = common_vendor.ref([]);
const new_articles = common_vendor.ref([]);
const recommend_doctor = common_vendor.ref([]);
const recommend_hospital = common_vendor.ref([]);
const numInfo = common_vendor.reactive({});
const goDetail = (id, isLink, src) => {
if (isLink == 1) {
api_api.api.readRecord({
type: 1,
id
}).then((res) => {
});
utils_navTo.navTo({
url: `/pages/web/web?src=${src}`
});
} else {
utils_navTo.navTo({
url: `/pages/detail/detail?id=${id}&type=article`
});
}
};
const goListBy = (id, name, type) => {
let url = "";
if (type == "doctor") {
url = `/pages/search/search?doctor_id=${id}&doctor_name=${name}`;
} else {
url = `/pages/search/search?hospital_id=${id}&hospital_name=${name}`;
}
utils_navTo.navTo({
url
});
};
const getData = async () => {
const { data } = await api_api.api.getHomeData();
if (data.code == 200) {
most_read_articles.value = data.data.most_read_articles;
new_articles.value = data.data.new_articles;
recommend_doctor.value = data.data.recommend_doctor;
recommend_hospital.value = data.data.recommend_hospital;
}
};
const getStatic = () => {
api_api.api.getHomeStatics().then((res) => {
let result = res.data.data;
Object.assign(numInfo, result);
});
};
const goList = (type) => {
utils_navTo.navTo({
url: "/pages/search/search?order=" + type
});
};
const goVideo = () => {
utils_navTo.navTo({
url: "/pages/videoList/videoList"
});
};
const goSick = () => {
utils_navTo.navTo({
url: "/pages/sickList/sickList"
});
};
const searchDoctor = () => {
utils_navTo.navTo({
url: "/pages/searchList/searchList?type=doctor&name=医生&id="
});
};
const goHospital = () => {
utils_navTo.navTo({
url: "/pages/searchList/searchList?type=hospital&name=医院&id="
});
};
common_vendor.onShow(() => {
getStatic();
getData();
});
return (_ctx, _cache) => {
return {
a: common_vendor.p({
type: "home"
}),
b: common_vendor.t(numInfo.article_num),
c: common_vendor.t(numInfo.video_num),
d: common_vendor.t(numInfo.video_read_num && numInfo.article_read_num ? numInfo.video_read_num + numInfo.article_read_num : 0),
e: common_vendor.o(goVideo),
f: common_vendor.p({
src: common_vendor.unref(common_assets.videoImg),
radius: "20rpx",
width: "330rpx",
height: "176rpx"
}),
g: common_vendor.o(goSick),
h: common_vendor.p({
src: common_vendor.unref(common_assets.sickImg),
width: "330rpx",
radius: "20rpx",
height: "176rpx"
}),
i: common_vendor.o(goHospital),
j: common_vendor.p({
src: common_vendor.unref(common_assets.hospitalImg),
radius: "20rpx",
width: "330rpx",
height: "176rpx"
}),
k: common_vendor.o(searchDoctor),
l: common_vendor.p({
src: common_vendor.unref(common_assets.doctorImg),
width: "330rpx",
radius: "20rpx",
height: "176rpx"
}),
m: common_vendor.p({
name: "arrow-right",
size: "16",
color: "#3CC7C0"
}),
n: common_vendor.o(($event) => goList("new")),
o: common_vendor.f(new_articles.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.article_title),
b: common_vendor.f(item.author, (tag, k1, i1) => {
return {
a: common_vendor.t(tag.doctor_name),
b: tag.author_id
};
}),
c: item.article_id,
d: common_vendor.o(($event) => goDetail(item.article_id, item.is_link, item.is_link_url), item.article_id)
};
}),
p: common_vendor.p({
name: "arrow-right",
size: "16",
color: "#3CC7C0"
}),
q: common_vendor.o(($event) => goList("read")),
r: common_vendor.f(most_read_articles.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.article_title),
b: common_vendor.f(item.author, (tag, k1, i1) => {
return {
a: common_vendor.t(tag.doctor_name),
b: tag.author_id
};
}),
c: item.article_id,
d: common_vendor.o(($event) => goDetail(item.article_id, item.is_link, item.is_link_url), item.article_id)
};
}),
s: common_vendor.p({
name: "arrow-right",
size: "16",
color: "#3CC7C0"
}),
t: common_vendor.o(goHospital),
v: common_vendor.f(recommend_hospital.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.hospital_name),
b: item.hospital_id,
c: common_vendor.o(($event) => goListBy(item.hospital_id, item.hospital_name, "hospital"), item.hospital_id)
};
}),
w: common_vendor.p({
name: "arrow-right",
size: "16",
color: "#3CC7C0"
}),
x: common_vendor.o(searchDoctor),
y: common_vendor.f(recommend_doctor.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.doctor_name),
b: item.doctor_id,
c: common_vendor.o(($event) => goListBy(item.doctor_id, item.doctor_name, "doctor"), item.doctor_id)
};
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
+10
View File
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom",
"usingComponents": {
"up--image": "../../node-modules/uview-plus/components/u--image/u--image",
"u-icon": "../../node-modules/uview-plus/components/u-icon/u-icon",
"tab-bar": "../../components/tabBar/tabBar",
"nav-bar": "../../components/navBar/navBar"
}
}
+1
View File
@@ -0,0 +1 @@
<nav-bar wx:if="{{a}}" class="data-v-1cf27b2a" u-i="1cf27b2a-0" bind:__l="__l" u-p="{{a}}"></nav-bar><view class="page data-v-1cf27b2a"><view class="databox data-v-1cf27b2a"><view class="cell data-v-1cf27b2a"><view class="num data-v-1cf27b2a">{{b}}</view><view class="name data-v-1cf27b2a">文章</view></view><view class="cell data-v-1cf27b2a"><view class="num data-v-1cf27b2a">{{c}}</view><view class="name data-v-1cf27b2a">视频</view></view><view class="cell data-v-1cf27b2a"><view class="num data-v-1cf27b2a">{{d}}</view><view class="name data-v-1cf27b2a">阅读量</view></view></view><view class="kubox data-v-1cf27b2a"><view class="row data-v-1cf27b2a"><up--image wx:if="{{f}}" class="data-v-1cf27b2a" bindclick="{{e}}" u-i="1cf27b2a-1" bind:__l="__l" u-p="{{f}}"></up--image><up--image wx:if="{{h}}" class="data-v-1cf27b2a" bindclick="{{g}}" u-i="1cf27b2a-2" bind:__l="__l" u-p="{{h}}"></up--image></view><view class="row data-v-1cf27b2a" style="margin-top:30rpx"><up--image wx:if="{{j}}" class="data-v-1cf27b2a" bindclick="{{i}}" u-i="1cf27b2a-3" bind:__l="__l" u-p="{{j}}"></up--image><up--image wx:if="{{l}}" class="data-v-1cf27b2a" bindclick="{{k}}" u-i="1cf27b2a-4" bind:__l="__l" u-p="{{l}}"></up--image></view></view><view class="newsbox data-v-1cf27b2a"><view class="titlebox data-v-1cf27b2a"><view class="title data-v-1cf27b2a">最新上线</view><view class="more data-v-1cf27b2a" bindtap="{{n}}"><view class="morename data-v-1cf27b2a">查看更多</view><u-icon wx:if="{{m}}" class="data-v-1cf27b2a" u-i="1cf27b2a-5" bind:__l="__l" u-p="{{m}}"></u-icon></view></view><view class="listbox data-v-1cf27b2a"><view wx:for="{{o}}" wx:for-item="item" wx:key="c" class="cell data-v-1cf27b2a" bindtap="{{item.d}}"><view class="circle data-v-1cf27b2a"></view><view class="info data-v-1cf27b2a"><view class="name ellipsis-two-lines data-v-1cf27b2a">{{item.a}}</view><view class="tagsbox data-v-1cf27b2a"><view wx:for="{{item.b}}" wx:for-item="tag" wx:key="b" class="tag data-v-1cf27b2a">{{tag.a}}</view></view></view></view></view></view><view class="newsbox data-v-1cf27b2a"><view class="titlebox data-v-1cf27b2a"><view class="title data-v-1cf27b2a">最多阅读</view><view class="more data-v-1cf27b2a" bindtap="{{q}}"><view class="morename data-v-1cf27b2a">查看更多</view><u-icon wx:if="{{p}}" class="data-v-1cf27b2a" u-i="1cf27b2a-6" bind:__l="__l" u-p="{{p}}"></u-icon></view></view><view class="listbox data-v-1cf27b2a"><view wx:for="{{r}}" wx:for-item="item" wx:key="c" class="cell data-v-1cf27b2a" bindtap="{{item.d}}"><view class="circle data-v-1cf27b2a"></view><view class="info data-v-1cf27b2a"><view class="name ellipsis-two-lines data-v-1cf27b2a">{{item.a}}</view><view class="tagsbox data-v-1cf27b2a"><view wx:for="{{item.b}}" wx:for-item="tag" wx:key="b" class="tag data-v-1cf27b2a">{{tag.a}}</view></view></view></view></view></view><view class="recbox data-v-1cf27b2a"><view class="titlebox data-v-1cf27b2a"><view class="title data-v-1cf27b2a">医院病例库推荐</view><view class="more data-v-1cf27b2a" bindtap="{{t}}"><view class="morename data-v-1cf27b2a">查看更多</view><u-icon wx:if="{{s}}" class="data-v-1cf27b2a" u-i="1cf27b2a-7" bind:__l="__l" u-p="{{s}}"></u-icon></view></view><view class="list data-v-1cf27b2a"><view wx:for="{{v}}" wx:for-item="item" wx:key="b" class="cell data-v-1cf27b2a" bindtap="{{item.c}}">{{item.a}}</view></view></view><view class="recbox data-v-1cf27b2a"><view class="titlebox data-v-1cf27b2a"><view class="title data-v-1cf27b2a">医生病例库推荐</view><view class="more data-v-1cf27b2a" bindtap="{{x}}"><view class="morename data-v-1cf27b2a">查看更多</view><u-icon wx:if="{{w}}" class="data-v-1cf27b2a" u-i="1cf27b2a-8" bind:__l="__l" u-p="{{w}}"></u-icon></view></view><view class="list data-v-1cf27b2a"><view wx:for="{{y}}" wx:for-item="item" wx:key="b" class="cell data-v-1cf27b2a" bindtap="{{item.c}}">{{item.a}}</view></view></view></view><tab-bar class="data-v-1cf27b2a" u-i="1cf27b2a-9" bind:__l="__l"></tab-bar>
+152
View File
@@ -0,0 +1,152 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.tagsbox.data-v-1cf27b2a {
margin-top: 20rpx;
display: flex;
flex-wrap: wrap;
}
.tagsbox .tag.data-v-1cf27b2a {
padding: 0 10rpx;
margin-right: 16rpx;
height: 46rpx;
line-height: 46rpx;
text-align: center;
background: rgba(60, 199, 192, 0.1);
border-radius: 8rpx;
font-weight: 400;
font-size: 24rpx;
color: #3cc7c0;
}
.newsbox.data-v-1cf27b2a {
margin-bottom: 16rpx;
}
.recbox.data-v-1cf27b2a {
padding-bottom: 23rpx;
margin-bottom: 16rpx;
padding-top: 36rpx;
background: #fff;
}
.recbox .cell.data-v-1cf27b2a {
margin: 23rpx 30rpx 0;
padding: 34rpx;
background: #f3f4f6;
font-size: 30rpx;
color: #4b5563;
line-height: 43rpx;
border-radius: 15rpx;
}
.listbox .cell.data-v-1cf27b2a {
margin: 0 30rpx;
display: flex;
align-items: flex-start;
border-bottom: 1rpx solid #f3f4f6;
padding: 34rpx 0;
}
.listbox .cell .circle.data-v-1cf27b2a {
margin-right: 30rpx;
margin-top: 18rpx;
width: 16rpx;
height: 16rpx;
flex-shrink: 0;
background: #3cc7c0;
border-radius: 50%;
}
.listbox .cell .name.data-v-1cf27b2a {
font-size: 32rpx;
color: #000000;
line-height: 46rpx;
}
.listbox .cell .author.data-v-1cf27b2a {
font-size: 28rpx;
color: #4b5563;
line-height: 38rpx;
}
.titlebox.data-v-1cf27b2a {
margin: 0 30rpx;
display: flex;
justify-content: space-between;
}
.titlebox .more.data-v-1cf27b2a {
display: flex;
align-items: center;
}
.titlebox .more .morename.data-v-1cf27b2a {
margin-right: 10rpx;
font-size: 28rpx;
color: #3cc7c0;
}
.newsbox.data-v-1cf27b2a {
padding-top: 36rpx;
background: #fff;
}
.page.data-v-1cf27b2a {
background: #f9fafb;
height: calc(100vh - 425rpx);
overflow-y: scroll;
}
.kubox.data-v-1cf27b2a {
padding: 30rpx 0;
width: 100%;
background: rgba(0, 0, 0, 0);
}
.kubox .row.data-v-1cf27b2a {
padding: 0 30rpx;
display: flex;
justify-content: space-between;
}
.kubox .row .item.data-v-1cf27b2a {
margin-left: 30rpx;
padding: 32rpx;
flex: 1;
background: #e9fafb;
border-radius: 15rpx;
}
.kubox .row .item .name.data-v-1cf27b2a {
font-size: 32rpx;
color: #00919e;
line-height: 46rpx;
}
.databox.data-v-1cf27b2a {
height: 162rpx;
background: #ffffff;
display: flex;
padding: 0 30rpx;
justify-content: space-between;
}
.databox .cell.data-v-1cf27b2a {
flex: 1;
padding: 35rpx 0;
text-align: center;
}
.databox .cell .num.data-v-1cf27b2a {
font-size: 38rpx;
color: #3cc7c0;
}
.databox .cell .name.data-v-1cf27b2a {
margin-top: 18rpx;
font-size: 28rpx;
color: #4b5563;
}