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 () {
|
||||
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user