init version kelfy-mini for new gitea
This commit is contained in:
104
pages/articleDetails/articleDetails.js
Normal file
104
pages/articleDetails/articleDetails.js
Normal file
@@ -0,0 +1,104 @@
|
||||
// pages/articleDetails/articleDetails.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
hosId:'',
|
||||
msgList:[]
|
||||
},
|
||||
|
||||
getList(){
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/findHospitalArticle?hos_article_id=',
|
||||
// url:'http://sayetest.f3322.org:5000/findHospitalArticle?hos_article_id',
|
||||
method:"GET",
|
||||
data:{
|
||||
hos_article_id:this.data.hosId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
console.log(res,"百科明细")
|
||||
let data = res.data
|
||||
data.map((item,index) => {
|
||||
let str = item.IMG
|
||||
let str2 = item.CONTENT
|
||||
|
||||
var html2 = str2.replaceAll("/showFile",'https://fy.btlsoln.com:8443/showFile')
|
||||
var html3 = html2.replaceAll("<img",'<img class="img"')
|
||||
|
||||
var html = str.replace("/showFile",'https://fy.btlsoln.com:8443/showFile')
|
||||
item.IMG = html
|
||||
item.CONTENT = html3
|
||||
return data
|
||||
})
|
||||
console.log(data,"新")
|
||||
this.setData({
|
||||
msgList:data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
hosId:options.hosId
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '文章详情'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
6
pages/articleDetails/articleDetails.json
Normal file
6
pages/articleDetails/articleDetails.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"htmltowxml" : "plugin://htmltowxml/view",
|
||||
"wxparser": "plugin://wxparserPlugin/wxparser"
|
||||
}
|
||||
}
|
||||
18
pages/articleDetails/articleDetails.wxml
Normal file
18
pages/articleDetails/articleDetails.wxml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--pages/articleDetails/articleDetails.wxml-->
|
||||
<view class="banner">
|
||||
<view wx:for="{{msgList}}" wx:key="item">
|
||||
<view class="titleWrap">
|
||||
<view class="title">{{item.TITLE}}</view>
|
||||
<!-- <view class="dateWrap">
|
||||
<view>王敏</view>
|
||||
<view class="ml">2020/09/09</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="imgWrap">
|
||||
<image src="{{item.IMG}}"/>
|
||||
</view>
|
||||
<view class="msgWrap">
|
||||
<rich-text nodes="{{item.CONTENT}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
57
pages/articleDetails/articleDetails.wxss
Normal file
57
pages/articleDetails/articleDetails.wxss
Normal file
@@ -0,0 +1,57 @@
|
||||
/* pages/articleDetails/articleDetails.wxss */
|
||||
.banner{
|
||||
margin: 30rpx 0;
|
||||
width: 750rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.titleWrap{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.title{
|
||||
height: 80rpx;
|
||||
width: 100%;
|
||||
font-size: 38rpx;
|
||||
line-height: 80rpx;
|
||||
color: #333;
|
||||
}
|
||||
.dateWrap{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
.ml{
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.imgWrap{
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.img{
|
||||
height: 350rpx;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
.imgWrap image{
|
||||
height: 100%;
|
||||
width:100%;
|
||||
border-radius: 15rpx;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.msgWrap{
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
color: #555;
|
||||
font-size: 35rpx;
|
||||
line-height: 180%
|
||||
}
|
||||
Reference in New Issue
Block a user