doctorList.js 2.79 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
// 医生列表

// 网络请求工具类
var networkUtil = require('../../utils/network_util.js')
var api = require('../../utils/apiFile.js')
var hospitalName = ''

Page({
data: {
doctorList: [
{
"account": "zcf",
"areaId": "13",
"chartroomId": "212756700659718",
"cityId": "14",
"dept": "产科",
"description": "张春芳:副主任医师,从事医疗保健专业近30年,对于不同人群、各种疾病的营养能给予正确的指导,尤其对儿童、孕产妇的营养指导具有丰富的临床经验,擅长妊娠期糖尿病,围产期营养指导,产妇保健等。获省、市级科技进步奖2项,发表国家级、省级论文20篇。",
"hospitalId": "216",
"hospitalName": "秦皇岛市妇幼保健院",
"hxName": "mommydoctorwx20004",
"id": 20004,
"lastLoginTime": "2020-10-11 17:25:06",
"name": "张春芳",
"openId": "",
"parentId": 1000,
"phone": "",
"positional": "副主任医师",
"price": 20,
"provinceId": "1",
"pwd": "E10ADC3949BA59ABBE56E057F20F883E",
"status": 0,
"type": 1
},
{
"account": "zcf",
"areaId": "13",
"chartroomId": "212756700659718",
"cityId": "14",
"dept": "产科",
"description": "李琦:副主任医师,从事医疗保健专业近30年,对于不同人群、各种疾病的营养能给予正确的指导,尤其对儿童、孕产妇的营养指导具有丰富的临床经验,擅长妊娠期糖尿病,围产期营养指导,产妇保健等。获省、市级科技进步奖2项,发表国家级、省级论文20篇。",
"hospitalId": "216",
"hospitalName": "秦皇岛市妇幼保健院",
"hxName": "mommydoctorwx20004",
"id": 99,
"lastLoginTime": "2020-10-11 17:25:06",
"name": "李琦",
"openId": "",
"parentId": 1000,
"phone": "",
"positional": "副主任医师",
"price": 20,
"provinceId": "1",
"pwd": "E10ADC3949BA59ABBE56E057F20F883E",
"status": 0,
"type": 1
}
],
hospitalName: '',

},
/*---------生命周期--------*/
onLoad: function(options) {
// networkUtil.showLoading()
if (!!options.isAdvertisingPage) {

} else {
// this.requestData()
}
},
toDoctorDetail: function(e) {
console.log(e.currentTarget.dataset.myid,e)
wx.navigateTo({
// url: '../doctor/doctor?doctorInfo='+JSON.stringify(this.data.doctorList[e.currentTarget.dataset.myid]), 这个url长度有限,参数太多会被剪切
url: '../doctor/doctor?doctorId=' + this.data.doctorList[e.currentTarget.dataset.myid]
.doctorId + '&' + 'hospitalId=' + this.data.doctorList[e.currentTarget.dataset.myid]
.hospitalId,
})
},
/*---------自定义函数--------*/
requestData() {
var self = this
networkUtil._get(api.doctorList, {
}, function(res) {
console.log(res)
self.setData({
doctorList: res.data.data,
})

}, function(res) {

})
},
})