AboutApp.js 1.04 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
// 医生列表

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

Page({
data:{
doctorList:{},
hospitalName:''
},
/*---------生命周期--------*/
onLoad:function(options){
networkUtil.showLoading()
this.requestData()
},
toDoctorDetail:function(e){
console.log(e.currentTarget.dataset.myid)
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){

})
},
})