var Request = new Object() Request = GetRequest() var patient = Request.patient, callCode = Request.callCode, surveyCode = Request.surveyCode, backToSynergy = Request.backToSynergy $(function () { // $('#closeBtn').click(function () { // closeLayer() // }) }) function closeLayer() { var index = top.layer.getFrameIndex(window.name) top.layer.close(index) } new Vue({ el: '#app', data: function () { return { hospital: [], country: [], selectHospital: 1, town: '', show:0, fuzhen:"" } }, mounted: function () { this.fuzhen = GetRequest().fuzhen // top.showSuccessMessage("提交预约挂号成功!") // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town if(this.show == 1){ this.initData() }else{ this.initDataTwo() } }, methods: { subscribe:function(num) { this.show = num if(num == 1){ this.initData() }else{ this.initDataTwo() } }, initDataTwo:function(keyWord) { var vm = this jbscAPI.getHospitalSpecialistList({ code:'gxb', hospitalName:keyWord, pageNo:'', //后端暂无分页 pageSize:'' //后端暂无分页 }).then(function(res){ vm.hospital = res.data.hospitalSpecialistList }) }, initData: function (keyWord, keyWord2) { var loadingid = top.layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }), vm = this jbscAPI .getOrgList({ city: '350200', filter: keyWord || '', type: 1, page: 1, pageSize: 100 }) .then(function (res) { if (res.status == 200) { vm.hospital = res.data jbscAPI .getOrgList({ city: 350200, filter: keyWord2 || '', type: 2, page: 1, pageSize: 100 }) .then(function (res) { top.layer.close(loadingid) if (res.status == 200) { vm.country = res.data } else { top.showErrorMessage(res.msg || '社区列表获取失败!') } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) } else { top.showErrorMessage(res.msg || '医院列表获取失败!') } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) }, initTypeof: function (type, keyWord) { if(this.show == 1) { var loadingid = top.layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }), vm = this jbscAPI .getOrgList({ city: '350200', filter: keyWord || '', type: type, page: 1, pageSize: 100 }) .then(function (res) { top.layer.close(loadingid) if (res.status == 200) { if (type == 1) { vm.hospital = res.data } else { vm.country = res.data } } else { if (type == 1) { top.showErrorMessage(res.msg || '医院列表获取失败!') } else { top.showErrorMessage(res.msg || '社区列表获取失败!') } } }) .catch(function (e) { top.layer.close(loadingid) console && console.error(e) }) }else{ this.initDataTwo(keyWord) } }, changeTypeHospital(value) { this.selectHospital = value console.log('W1s1neeoe', this.selectHospital) } } })