修改
This commit is contained in:
parent
1e6418dd6c
commit
f76026a922
13
pages.json
13
pages.json
@ -34,12 +34,21 @@
|
|||||||
"navigationBarTitleText": "我的学习",
|
"navigationBarTitleText": "我的学习",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
"path": "pages/Healthknowledge/Healthknowledge",
|
{
|
||||||
|
"path": "pages/Healthitem/Healthitem",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "护理新闻",
|
"navigationBarTitleText": "护理新闻",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/Healthknowledge/Healthknowledge",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "护理新闻",
|
||||||
|
"onReachBottomDistance": 50, //距离底部多远时触发 单位为px
|
||||||
|
"enablePullDownRefresh": true //设置参数为true
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/confirmCompletion/confirmCompletion",
|
"path": "pages/confirmCompletion/confirmCompletion",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
93
pages/Healthitem/Healthitem.vue
Normal file
93
pages/Healthitem/Healthitem.vue
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<view class="title">
|
||||||
|
{{item.informationTitle}}
|
||||||
|
</view>
|
||||||
|
<u-parse :html="item.informationContent"></u-parse>
|
||||||
|
<!-- <view class="text" v-html="item.informationContent">
|
||||||
|
</view>-->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
item: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) { //获取传值
|
||||||
|
this.item = JSON.parse(decodeURIComponent(options.item))
|
||||||
|
this.item.informationContent = this.item.informationContent.replace(/\<img/gi,
|
||||||
|
"<br/> <img class='richPic'")
|
||||||
|
this.item.informationContent = this.item.informationContent.replace(/\<p/gi,
|
||||||
|
"<p class='ptext'")
|
||||||
|
// this.item.informationContent = this.item.informationContent.replace(/\<span/,
|
||||||
|
// "<span class='ql-size-small'")
|
||||||
|
// atch = match.replace(/class="ql-size-large"/gi, 'max-width:100%;')
|
||||||
|
},
|
||||||
|
onReady() {}, //更改导航栏文字
|
||||||
|
//1.分享给朋友
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let url = pages[pages.length - 1].$page.fullPath
|
||||||
|
return {
|
||||||
|
title: '泉医到家',
|
||||||
|
path: url,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//2.分享到朋友圈
|
||||||
|
onShareTimeline(res) {
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let url = pages[pages.length - 1].$page.fullPath
|
||||||
|
return {
|
||||||
|
title: '泉医到家',
|
||||||
|
path: url,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
/deep/ .ptext {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ptext:nth-child(1) {
|
||||||
|
text-indent: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ql-size-small {
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ql-size-large {
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ql-size-huge {
|
||||||
|
font-size: 46rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
padding: 0 3%;
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-all;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .richPic {
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,10 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app">
|
<view class="app">
|
||||||
<!-- <u-tabs :list="tabList" :current="tabcurrent" @change="change"></u-tabs>
|
<u-tabs :list="tabList" :current="tabcurrent" @change="change"></u-tabs>
|
||||||
<view class="Healthknowledge" v-if="informationCategoryVOList">
|
<view class="Healthknowledge" v-if="NurseNewslist">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item" v-for="(item,index) in informationCategoryVOList" :key="index"
|
<view class="item" v-for="(item,index) in NurseNewslist" :key="index" @tap='gohealthitem(item)'>
|
||||||
@tap='gohealthitem(item)'>
|
|
||||||
<view class="text">
|
<view class="text">
|
||||||
{{item.informationTitle}}
|
{{item.informationTitle}}
|
||||||
</view>
|
</view>
|
||||||
@ -12,26 +11,18 @@
|
|||||||
<image :src="item.leadThumbnailUrl" mode=""></image>
|
<image :src="item.leadThumbnailUrl" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
|
||||||
<view class="Healthknowledge">
|
|
||||||
<view class="list">
|
|
||||||
<view class="item">
|
|
||||||
<view class="text">
|
|
||||||
护理 I 致力于打造专业护理人才
|
|
||||||
</view>
|
|
||||||
<view class="author"> 生活小窍门,是指人们在日常生活中总结出来的知识和经验,和生活小常识非常相似</view>
|
|
||||||
<image src="../../static/hlxw.png" mode=""></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="noorder" v-else>
|
<view class="noorder" v-else>
|
||||||
<u-empty mode="data" icon-size='220' text='暂无内容'></u-empty>
|
<u-empty mode="data" icon-size='220' text='暂无内容'></u-empty>
|
||||||
</view> -->
|
</view>
|
||||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
selectNurseNews
|
||||||
|
} from '@/api/homepage/index.js'
|
||||||
import baseurl from '@/api/baseurl.js'
|
import baseurl from '@/api/baseurl.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -42,15 +33,13 @@
|
|||||||
}],
|
}],
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
informationCategoryVOList: null,
|
|
||||||
total: 0,
|
total: 0,
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
|
NurseNewslist: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {},
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// this.pageNum = 1
|
this.selectNurseNewsinfo();
|
||||||
// this.getHeathHousing();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//跳转item
|
//跳转item
|
||||||
@ -59,13 +48,13 @@
|
|||||||
url: `/pages/Healthitem/Healthitem?item=${encodeURIComponent(JSON.stringify(item))}`
|
url: `/pages/Healthitem/Healthitem?item=${encodeURIComponent(JSON.stringify(item))}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getHeathHousing() {
|
selectNurseNewsinfo() {
|
||||||
getHeathHousingList(this.pageNum, this.pageSize).then(res => {
|
selectNurseNews(this.pageNum, this.pageSize).then(res => {
|
||||||
if (res.rows.length > 0) {
|
if (res.rows.length > 0) {
|
||||||
res.rows.forEach(e => {
|
res.rows.forEach(e => {
|
||||||
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
|
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
|
||||||
})
|
})
|
||||||
this.informationCategoryVOList = res.rows
|
this.NurseNewslist = res.rows
|
||||||
}
|
}
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
})
|
})
|
||||||
@ -76,13 +65,13 @@
|
|||||||
this.scrollTop = e.scrollTop;
|
this.scrollTop = e.scrollTop;
|
||||||
},
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
if (this.informationCategoryVOList.length >= this.total) {} else {
|
if (this.NurseNewslist.length >= this.total) {} else {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
getHeathHousingList(this.pageNum, this.pageSize).then(res => {
|
selectNurseNews(this.pageNum, this.pageSize).then(res => {
|
||||||
if (res.rows) {
|
if (res.rows) {
|
||||||
res.rows.forEach(e => {
|
res.rows.forEach(e => {
|
||||||
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
|
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
|
||||||
this.informationCategoryVOList.push(e)
|
this.NurseNewslist.push(e)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -90,7 +79,7 @@
|
|||||||
},
|
},
|
||||||
onPullDownRefresh() { //下拉刷新
|
onPullDownRefresh() { //下拉刷新
|
||||||
this.pageNum = 1;
|
this.pageNum = 1;
|
||||||
this.getHeathHousing();
|
this.selectNurseNewsinfo();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
<u-icon name="arrow-right" color='#969494'></u-icon>
|
<u-icon name="arrow-right" color='#969494'></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="items" @tap='goHealthknowledge'>
|
<view class="items" @tap='goHealthknowledge'>
|
||||||
<view class="item" v-for='(item,index) in NurseNewslist'>
|
<view class="item" v-for='(item,index) in NurseNewslist' @tap='goHealthitem(item)'>
|
||||||
<image :src="item.leadThumbnailUrl" mode=""></image>
|
<image :src="item.leadThumbnailUrl" mode=""></image>
|
||||||
<view class="toptext">
|
<view class="toptext">
|
||||||
{{item.informationTitle}}
|
{{item.informationTitle}}
|
||||||
@ -150,6 +150,12 @@
|
|||||||
this.NurseNewslist = res.rows
|
this.NurseNewslist = res.rows
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//跳转详情
|
||||||
|
goHealthitem(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/Healthitem/Healthitem?item=${encodeURIComponent(JSON.stringify(item))}`
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -180,9 +186,12 @@
|
|||||||
|
|
||||||
.item {
|
.item {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 150rpx;
|
height: 170rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
|
padding: 0 0 20rpx;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
border-bottom: 1rpx solid #cdc9c9;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user