6.13
This commit is contained in:
+35
-9
@@ -18,7 +18,7 @@
|
||||
<view class="kubox">
|
||||
<view class="row">
|
||||
<up--image
|
||||
@click="goList('video')"
|
||||
@click="goVideo"
|
||||
:src="videoImg"
|
||||
radius="20rpx"
|
||||
width="330rpx"
|
||||
@@ -27,7 +27,7 @@
|
||||
></up--image>
|
||||
<up--image
|
||||
:src="sickImg"
|
||||
@click="goList('article')"
|
||||
@click="goSick"
|
||||
width="330rpx"
|
||||
radius="20rpx"
|
||||
height="176rpx"
|
||||
@@ -68,7 +68,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell" v-for="item in new_articles" :key="item.article_id">
|
||||
<view class="cell" v-for="item in new_articles" :key="item.article_id" @click="goDetail(item.article_id)">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
@@ -89,7 +89,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="listbox">
|
||||
<view class="cell" v-for="item in most_read_articles" :key="item.article_id">
|
||||
<view class="cell" v-for="item in most_read_articles" :key="item.article_id" @click="goDetail(item.article_id)">
|
||||
<view class="circle"></view>
|
||||
<view class="info">
|
||||
<view class="name">{{item.article_title }}</view>
|
||||
@@ -109,7 +109,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id">{{ item.hospital_name }}</view>
|
||||
<view class="cell" v-for="item in recommend_hospital" :key="item.hospital_id" @click="goListBy(item.hospital_id,item.hospital_name ,'hospital')">{{ item.hospital_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recbox">
|
||||
@@ -121,7 +121,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id">{{ item.doctor_name }}</view>
|
||||
<view class="cell" v-for="item in recommend_doctor" :key="item.doctor_id" @click="goListBy(item.doctor_id,item.doctor_name ,'doctor')">{{ item.doctor_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -130,7 +130,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ref, reactive, onMounted,getCurrentInstance } from "vue";
|
||||
import { onLoad} from "@dcloudio/uni-app";
|
||||
import tabBar from "@/components/tabBar/tabBar.vue";
|
||||
import navBar from "@/components/navBar/navBar.vue";
|
||||
@@ -148,6 +148,22 @@ const new_articles = ref([]);
|
||||
const recommend_doctor=ref([]);
|
||||
const recommend_hospital=ref([]);
|
||||
const numInfo=reactive({})
|
||||
const goDetail = (id) => {
|
||||
uni.navigateTo({
|
||||
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}`
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:url,
|
||||
});
|
||||
}
|
||||
|
||||
const getData = async() => {
|
||||
const {data}=await api.getHomeData();
|
||||
@@ -163,7 +179,7 @@ const getData = async() => {
|
||||
api.getHomeStatics().then((res) => {
|
||||
let result=res.data.data;
|
||||
Object.assign(numInfo,result);
|
||||
console.log(numInfo.value)
|
||||
|
||||
})
|
||||
}
|
||||
const goList=(type)=>{
|
||||
@@ -171,6 +187,16 @@ const goList=(type)=>{
|
||||
url:'/pages/search/search?order='+type
|
||||
})
|
||||
};
|
||||
const goVideo=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/videoList/videoList'
|
||||
})
|
||||
}
|
||||
const goSick=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/sickList/sickList'
|
||||
})
|
||||
}
|
||||
const searchDoctor=()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/searchList/searchList?type=doctor&name=医生&id='
|
||||
@@ -183,8 +209,8 @@ const goHospital=()=>{
|
||||
}
|
||||
onLoad(() => {
|
||||
getStatic();
|
||||
|
||||
getData();
|
||||
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user