// pages/jfMsg/jfMsg.js Page({ /** * 页面的初始数据 */ data: { msgList:[], ksmc:'', sflb:'', num:'', name:'', date:'' // cfdj: "1.044",单价 // cfks: "内科", // cfrq: "2016060522:48:03",日期 // cfsl: "2",数量 // cfxh: 164440,序号 // cfys: "supervisor",医生 // czyh: "00",操作员 // xmmc: "[甲]$口服葡萄糖粉",名称 // ypdw: "包",单位 // ypgg: "50克*0.5包/包",规格 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ sflb:options.sflb, ksmc:options.ksmc, name:options.name, card:options.card }) let sjh = options.sjh wx.request({ url:'https://fy.btlsoln.com:8443/his/getPayDetailList?cxlb=1&sjh&czyh=1', method:"GET", data:{ sjh:sjh }, header: { 'content-type': 'application/json' }, success: (res)=> { console.log(res.data.list,"详情") this.setData({ msgList:res.data.list, }) let num2 = res.data.list[0].cfrq var year = String(num2).substr(0,4) var month = String(num2).substr(4,5).substr(0,2) var date = String(num2).substr(6,7).substr(0,2) var time = String(num2).substr(8,15) var result2 = year+'/'+ month +'/'+date+' '+time console.log(result2) this.setData({ date : result2 }) } }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { wx.setNavigationBarTitle({ title: '缴费详情' }) }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })