init version kelfy-mini for new gitea
This commit is contained in:
151
pages/message/message.js
Normal file
151
pages/message/message.js
Normal file
@@ -0,0 +1,151 @@
|
||||
// pages/message/message.js
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
content:'',
|
||||
id:'',
|
||||
msgList:'',
|
||||
state:'',
|
||||
ImgMsg:'',
|
||||
url:'',
|
||||
},
|
||||
getList(){
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/findMedicalGuideById?medical_guide_id',
|
||||
// url:'http://sayetest.f3322.org:5000/findMedicalGuideById?medical_guide_id',
|
||||
method:"GET",
|
||||
data:{
|
||||
medical_guide_id:this.data.id
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
let data = res.data
|
||||
data.map((item,index) => {
|
||||
console.log(item,'item')
|
||||
let str = item.CONTENT
|
||||
var html = str.replaceAll("/showFile",'https://fy.btlsoln.com:8443/showFile')
|
||||
var html2 = html.replaceAll("<img",'<img class="img"')
|
||||
item.CONTENT = html2
|
||||
return data
|
||||
})
|
||||
this.setData({
|
||||
msgList:res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getImgMsg(){
|
||||
wx.request({
|
||||
url:'https://fy.btlsoln.com:8443/findHospitalNotice?hos_notice_id',
|
||||
// url:'http://sayetest.f3322.org:5000/findMedicalGuideById?medical_guide_id',
|
||||
method:"GET",
|
||||
data:{
|
||||
hos_notice_id:this.data.imgId
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res)=> {
|
||||
// console.log(res.data,"图片说明")
|
||||
let data = res.data
|
||||
data.map((item,index) => {
|
||||
let str = item.CONTENT
|
||||
|
||||
var html = str.replaceAll("/showFile",'https://fy.btlsoln.com:8443/showFile')
|
||||
// var html2 = html.replaceAll("<img",'<img class="img"')
|
||||
var html2 = html.replaceAll(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin:10px 0;"')
|
||||
item.CONTENT = html2
|
||||
console.log(str,"图片说明")
|
||||
return data
|
||||
})
|
||||
|
||||
// console.log(data,"1111111111")
|
||||
this.setData({
|
||||
ImgMsg:res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
console.log(options)
|
||||
this.setData({
|
||||
url:app.globalData.url2,
|
||||
})
|
||||
this.setData({
|
||||
state:options.state
|
||||
})
|
||||
if(options.state == 0){
|
||||
this.setData({
|
||||
content:options.content,
|
||||
})
|
||||
}else if(options.state == 1){
|
||||
this.setData({
|
||||
id:options.id
|
||||
})
|
||||
this.getList()
|
||||
}else if(options.state == 3){
|
||||
this.setData({
|
||||
imgId:options.imgId
|
||||
})
|
||||
this.getImgMsg()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user