111
This commit is contained in:
+63
-58
@@ -3,21 +3,22 @@
|
||||
<view class="page">
|
||||
<view class="databox">
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.article_collect_num }}</view>
|
||||
<view class="name">文章</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.video_collect_num }}</view>
|
||||
<view class="name">视频</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="num">123</view>
|
||||
<view class="num">{{ numInfo.video_read_num+numInfo.article_read_num }}</view>
|
||||
<view class="name">阅读量</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kubox">
|
||||
<view class="row">
|
||||
<up--image
|
||||
@click="goList('video')"
|
||||
:src="videoImg"
|
||||
radius="20rpx"
|
||||
width="330rpx"
|
||||
@@ -26,7 +27,7 @@
|
||||
></up--image>
|
||||
<up--image
|
||||
:src="sickImg"
|
||||
|
||||
@click="goList('article')"
|
||||
width="330rpx"
|
||||
radius="20rpx"
|
||||
height="176rpx"
|
||||
@@ -42,6 +43,7 @@
|
||||
</view>
|
||||
<view class="row" style="margin-top: 30rpx">
|
||||
<up--image
|
||||
@click="goHospital"
|
||||
:src="hospitalImg"
|
||||
radius="20rpx"
|
||||
width="330rpx"
|
||||
@@ -50,7 +52,7 @@
|
||||
></up--image>
|
||||
<up--image
|
||||
:src="doctorImg"
|
||||
|
||||
@click="searchDoctor"
|
||||
width="330rpx"
|
||||
radius="20rpx"
|
||||
height="176rpx"
|
||||
@@ -60,27 +62,18 @@
|
||||
<view class="newsbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">最新上线</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goList('new')">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell">
|
||||
<view class="cell" v-for="item in new_articles" :key="item.article_id">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -90,27 +83,18 @@
|
||||
<view class="newsbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">最多阅读</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goList('read')">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell">
|
||||
<view class="cell" v-for="item in most_read_articles" :key="item.article_id">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
|
||||
<view class="tagsbox">
|
||||
<view class="tag">陈煜</view>
|
||||
<view class="tag" v-for="tag in item.author" :key="tag.author_id">{{ tag.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -119,27 +103,25 @@
|
||||
<view class="recbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">医院病例库推荐</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="goHospital">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id">{{ item.hospital_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recbox">
|
||||
<view class="titlebox">
|
||||
<view class="title">医生病例库推荐</view>
|
||||
<view class="more">
|
||||
<view class="more" @click="searchDoctor">
|
||||
<view class="morename">查看更多</view>
|
||||
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
|
||||
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id">{{ item.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -148,7 +130,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { onLoad} from "@dcloudio/uni-app";
|
||||
import tabBar from "@/components/tabBar/tabBar.vue";
|
||||
import navBar from "@/components/navBar/navBar.vue";
|
||||
@@ -160,30 +142,52 @@ import videoImg from "@/static/video.png";
|
||||
import sickImg from "@/static/sick.png";
|
||||
import hospitalImg from "@/static/hospital.png";
|
||||
import doctorImg from "@/static/doctor.png";
|
||||
import { object } from "uview-plus/libs/function/test";
|
||||
const most_read_articles = ref([]);
|
||||
const new_articles = ref([]);
|
||||
const recommend_doctor=ref([]);
|
||||
const recommend_hospital=ref([]);
|
||||
const numInfo=reactive({})
|
||||
|
||||
onLoad(() => {});
|
||||
const queryList = (pageNo, pageSize) => {
|
||||
const params = {
|
||||
pageNo: pageNo,
|
||||
pageSize: pageSize,
|
||||
type: 1,
|
||||
const getData = async() => {
|
||||
const {data}=await api.getHomeData();
|
||||
console.log(11111);
|
||||
console.log(data);
|
||||
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;
|
||||
|
||||
}
|
||||
};
|
||||
// 此处请求仅为演示,请替换为自己项目中的请求
|
||||
api
|
||||
.queryList(params)
|
||||
.then((res) => {
|
||||
// console.log(res)
|
||||
// dataList.value=dataList.value.concat(res.data.list)
|
||||
// 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
|
||||
paging.value.complete(res.data.list);
|
||||
const getStatic=()=>{
|
||||
api.getHomeStatics().then((res) => {
|
||||
let result=res.data.data;
|
||||
Object.assign(numInfo,result);
|
||||
console.log(numInfo.value)
|
||||
})
|
||||
.catch((res) => {
|
||||
// 如果请求失败写paging.value.complete(false);
|
||||
// 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
|
||||
// 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
|
||||
paging.value.complete(false);
|
||||
});
|
||||
}
|
||||
const goList=(type)=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/search/search?order='+type
|
||||
})
|
||||
};
|
||||
const searchDoctor=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/searchList/searchList?type=doctor'
|
||||
})
|
||||
}
|
||||
const goHospital=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/searchList/searchList?type=hospital'
|
||||
})
|
||||
}
|
||||
onLoad(() => {
|
||||
getStatic();
|
||||
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tagsbox {
|
||||
@@ -207,6 +211,7 @@ const queryList = (pageNo, pageSize) => {
|
||||
}
|
||||
.recbox{
|
||||
padding-bottom: 23rpx;
|
||||
margin-bottom: 16rpx;
|
||||
padding-top: 36rpx;
|
||||
background: #fff;
|
||||
.cell {
|
||||
|
||||
Reference in New Issue
Block a user