checkupInput.js 3.52 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
var networkUtil = require('../../utils/network_util.js')
var api = require('../../utils/apiFile.js')
var networkUtil = require('../../utils/network_util.js')
var api = require('../../utils/apiFile.js')

var page
var isRefresh = false;
// 是否有更多
var app = getApp()
Page({
data: {
array: [],
hospitalId: "",
pid:"",
toDay: "",
temperature: "",
height: "",
weight: "",
headWidth: "",
bust: "",
feedArray:["母乳喂养","混合喂养","人工喂养"],
feed: "0",
},
// 下拉刷新回调接口
onPullDownRefresh() {},
onLoad(e) {
var d = new Date();
var toDay = d.getFullYear() + "-" + ("00" + (d.getMonth() + 1)).substr(-2) + "-" + ("00" + d.getDate()).substr(-2);
this.setData({
toDay: toDay,
})
this.setData({
hospitalId:app.globalData.userInfo.hospitalId,
})
this.getList();
networkUtil._get(api.checkList,
{ patientId: getApp().globalData.currentId},
function (res) {
console.log(res)
})
},
getList() {
networkUtil._post(api.getCheckUpHistory, {
pid: this.data.pid,
hospitalId: this.data.hospitalId,
}, res => {
console.log(res)
if (res.statusCode == 200 && res.data.errorcode == 0) {
var data = res.data.data;
for (let o of data) {
o.fhr = JSON.parse(o.fhr);
}
this.setData({
array: res.data.data
})
}
}, err => {

})
},

inputtemperature(e) {
var temperature = this.data.temperature;
var data = e.detail.value;
if (data <= 50 && data >= 0) {
this.setData({
temperature: e.detail.value
})
}else{
this.setData({
temperature:temperature
})
}
},
inputheight(e) {
var height = this.data.height;
var data = e.detail.value;
if (data <= 200 && data >= 0) {
this.setData({
height: e.detail.value
})
}else{
this.setData({
height:height
})
}
},
inputweight(e) {
var weight = this.data.weight;
var data = e.detail.value;
if (data <= 50 && data >= 0) {
this.setData({
weight: e.detail.value
})
}else{
this.setData({
weight:weight
})
}
},
inputheadWidth(e) {
var headWidth = this.data.headWidth;
var data = e.detail.value;
if (data <= 100 && data >= 0) {
this.setData({
headWidth: e.detail.value
})
}else{
this.setData({
headWidth:headWidth
})
}
},
inputbust(e) {
var bust = this.data.bust;
var data = e.detail.value;
if (data <= 100 && data >= 0) {
this.setData({
bust: e.detail.value
})
}else{
this.setData({
bust:bust
})
}
},
bindPickerChange: function (e) {
this.setData({
fhrLength: e.detail.value,
})
},
toMyApport() {
if (isRefresh) {
return;
}
isRefresh = true;
networkUtil._post(api.setCheckUp, {
babyInfos: [
{
temperature: this.data.temperature,
height: this.data.height,
weight: this.data.weight,
headWidth: this.data.headWidth,
bust: this.data.bust,
feed: this.data.feed,
}
],
pid: this.data.pid,
hospitalId: this.data.hospitalId,
}, (res) => {
isRefresh = false
this.getList();
wx.showToast({
title: '产检信息已成功提交',
icon: 'success',
duration: 1000
});
}, (err) => {
isRefresh = false
}, 'application/json')
}
})