var Request = new Object() Request = GetRequest() var patient = Request.patient, callCode = Request.callCode, 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: '' } }, mounted: function () { // top.showSuccessMessage("提交预约挂号成功!") // this.town = JSON.parse(sessionStorage.getItem('LoginUser')).town this.initData() }, methods: { 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) { 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) }) }, changeTypeHospital(value) { this.selectHospital = value console.log('W1s1neeoe', this.selectHospital) } } })