zyz 7 years ago
parent
commit
4edaf6bfec

+ 8 - 1
api/http-request.js

@ -1,13 +1,20 @@
(function(exports) {
	
    var publish_version = false;
    var server;
	var agentName = "useragent"
	var userInfo = "userInfoForPay"
	
	var str = '{"id":4807,"uid":"xy201703150222","imei":"359357010172188","token":"69c7dc0ef9e8b31efe2b04ee470cc3b0","platform":2,"hospital":"3502050100"}'  
	window.localStorage.setItem(agentName,str)
	
	
	
    if(publish_version) { // 生产环境配置
        server = ""
        
    } else { // 测试环境配置
        server = "http://fashion.ybxin.net/hlpay/index.php?s="
        server = "http://172.19.103.88:9092/wlyy/"
    }
    function httpGet(url, options) {

+ 9 - 0
api/record-api.js

@ -0,0 +1,9 @@
(function(exports) {
    var recordAPI = {
		//咨询
		consultList: function(data) {
			return httpRequest.post("doctor/consult/list_by_team", {data: data})
		}
	}
    exports.recordAPI = recordAPI;
})(window)

+ 7 - 2
app/consultation/consultation.html

@ -9,11 +9,16 @@
	<body>
		<div id="app">
			<consultation-list></consultation-list>
			<navigation :pages="total" :current="currentPage" @navpage="msgListView"></navigation>
		</div>
		<script type="text/javascript" src="../../js/vue.js"></script>
		<!--<script type="text/javascript" src="../../js/jquery-2.2.4.js" ></script>-->
		<script type="text/javascript" src="../../js/jquery-2.2.4.js" ></script>
		<script src="../../js/es6-promise.js"></script>
		<!--<script src="../../plugins/layer/layer.min.js"></script>-->
		<script type="text/javascript" src="../../component/common/pagination.js" ></script>
		<script src="../../component/consultation/consultation-list.js"></script>
		<script src="../../component/consultation/consultation.js"></script>
		<script src="../../api/http-request.js"></script>
		<script src="../../api/record-api.js"></script>
		<script src="js/consultation.js"></script>
	</body>
</html>

+ 33 - 0
app/consultation/js/consultation.js

@ -0,0 +1,33 @@
new Vue({
  el: '#app',
  data: {
  	total:1,
  	currentPage:1,
  	list:[]
  },
  methods:{
  	msgListView(page){
  		var vm=this;
  		if(page){
  			var data = {patientCode:'fca8c658ffda42afa5be91e54e0268c8',
					patient:'fca8c658ffda42afa5be91e54e0268c8',
					teamCode:646,
					page:1,
					pagesize:10}
  			recordAPI.consultList(data).then(function(res){
  				top.toastr.error("gaga")
  				if(res.status==200){ 
  					list=res;
  				}else{
  					
  				}
  			})
  		}
  		console.log("进来了")
  	}
  },
  mounted(){
  	var vm = this
  	this.msgListView(this.currentPage)
  },
})

+ 3 - 1
app/record/record.html

@ -5,6 +5,7 @@
		<title></title>
		<link />
		<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css"/>
		<link rel="stylesheet" href="../../plugins/toastr/toastr.min.css?v=1" />
		<link rel="stylesheet" href="../record/css/record.css" />
	</head>
	<body>
@ -14,8 +15,9 @@
		<script type="text/javascript" src="../../js/vue.js"></script>
		<script type="text/javascript" src="../../js/jquery-2.2.4.js" ></script>
		<script src="../../plugins/layer/layer.min.js"></script>
		<script src="../../plugins/toastr/toastr.min.js"></script>
		<script src="../../component/record/inner-tabs.js"></script>
		<script src="../../component/record/record-tabs.js"></script>
		<!--<script type="text/javascript" src="js/record.js"></script>-->
		
	</body>
</html>

+ 71 - 0
component/common/pagination.js

@ -0,0 +1,71 @@
/**
 * Create with WebStorm
 * Author: Daxiu Huang
 * CreateTime: 2017/9/6 10:21
 */
//分页组件
var pageComponent = Vue.extend({
    template: `<nav aria-label="Page navigation">
        <ul class="pagination">
            <li :class="{\'disabled\':curPage==1}">
                <a href="javascript:;" @click="goPage(curPage==1?1:curPage-1)" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <li v-for="page in showPageBtn" :class="{\'active\':page==curPage}">
                <a href="javascript:;" v-if="page" @click="goPage(page)">{{page}}</a>
                <a href="javascript:;" v-else>···</a>
            </li>
            <li :class="{\'disabled\':curPage==pages}">
                <a href="javascript:;" @click="goPage(curPage==pages?pages:curPage+1)" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>`,
    props: {
        pages: {
            type: Number,
            default: 1
        },
        current: {
            type: Number,
            default: 1
        }
    },
    data(){
        return{
            curPage:1
        }
    },
    computed: {
        showPageBtn() {
            let pageNum = this.pages;
            let index = this.curPage;
            let arr = [];
            if (pageNum <= 5) {
                for (let i = 1; i <= pageNum; i++) {
                    arr.push(i)
                }
                return arr
            }
            if (index <= 2) return [1, 2, 3, 0, pageNum];
            if (index >= pageNum - 1) return [1, 0, pageNum - 2, pageNum - 1, pageNum];
            if (index === 3) return [1, 2, 3, 4, 0, pageNum];
            if (index === pageNum - 2) return [1, 0, pageNum - 3, pageNum - 2, pageNum - 1, pageNum];
            return [1, 0, index - 1, index, index + 1, 0, pageNum];
        }
    },
    methods: {
        goPage(page) {
            if (page != this.curPage) {
                console.log(page);
                this.curPage = page;
                this.$emit('navpage', this.curPage);
            }else{
                console.log('Already in the current page');
            }
        }
    }
});
Vue.component('navigation', pageComponent);

+ 0 - 5
component/consultation/consultation.js

@ -1,5 +0,0 @@
new Vue({
  el: '#app',
  data: {
  }
})

+ 11 - 0
plugins/toastr/toastr.min.css

@ -54,6 +54,12 @@ button.toast-close-button {
    width: 100%
}
.toast-top-center-100 {
    top: 100px;
    right: 0;
    width: 100%
}
.toast-bottom-center {
    bottom: 0;
    right: 0;
@ -154,6 +160,11 @@ button.toast-close-button {
    margin: auto
}
#toast-container.toast-bottom-center > div, #toast-container.toast-top-center-100 > div {
    width: 300px;
    margin: auto
}
#toast-container.toast-bottom-full-width > div, #toast-container.toast-top-full-width > div {
    width: 96%;
    margin: auto

+ 2 - 2
plugins/toastr/toastr.min.js

@ -171,8 +171,8 @@
                        warning: 'toast-warning'
                    },
                    iconClass: 'toast-info',
                    positionClass: 'toast-top-right',
                    timeOut: 5000, // Set timeOut and extendedTimeout to 0 to make it sticky
                    positionClass: 'toast-top-center',
                    timeOut: 3000, // Set timeOut and extendedTimeout to 0 to make it sticky
                    titleClass: 'toast-title',
                    messageClass: 'toast-message',
                    target: 'body',