Aucune description

application.html 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>合乐文化网红申请表</title>
  7. <link rel="stylesheet" href="./common/reset.css">
  8. <link rel="stylesheet" href="./common/elementUI.css">
  9. <script src="./common/jquery-2.1.0.js"></script>
  10. <script src="./common/vue.min.js"></script>
  11. <script src="./common/elementUI.js"></script>
  12. <style>
  13. body{
  14. width: 100%;
  15. min-height: 100vh;
  16. background: #f0f2f5;
  17. }
  18. .table{
  19. width: 100%;
  20. text-align: center;
  21. color: #333333;
  22. }
  23. .table tr{
  24. height: 40px;
  25. font-size: 14px;
  26. border-bottom: 1px solid #ebeef5;
  27. }
  28. .table tr:hover{
  29. background: #f5f7fa;
  30. }
  31. .table tr:nth-of-type(0):hover{
  32. background: #f7faff;
  33. }
  34. .content{
  35. width: 1200px;
  36. padding: 20px;
  37. background: #ffffff;
  38. margin: auto;
  39. }
  40. .hint{
  41. text-align: center;
  42. font-size: 18px;
  43. padding: 20px;
  44. color: #999;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <div class="content" id="app" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
  50. <table class="table">
  51. <tr style="background: #f7faff;"><th>姓名</th><th>性别</th><th>所在地</th><th>手机号</th><th>申请时间</th></tr>
  52. <tr v-for="(item,index) in list" :key="index">
  53. <td>{{item.name}}</td>
  54. <td>{{item.sex}}</td>
  55. <td>{{item.city}}</td>
  56. <td>{{item.phone}}</td>
  57. <td>{{item.created_at}}</td>
  58. </tr>
  59. </table>
  60. <div class="hint" v-if="list.length == 0 && !loading">暂无数据</div>
  61. <div class="block" style="text-align: center;padding-top: 20px;">
  62. <el-pagination
  63. background
  64. @current-change="handleCurrentChange"
  65. :current-page.sync="page"
  66. :page-size="pageSize"
  67. layout="total, prev, pager, next"
  68. :total="total">
  69. </el-pagination>
  70. </div>
  71. </div>
  72. </body>
  73. </html>
  74. <script>
  75. var vm = new Vue({
  76. el:"#app",
  77. data:{
  78. list:[],
  79. pageSize:20,// 每页大小
  80. total:0,
  81. page:1,
  82. loading:true
  83. },
  84. created(){
  85. this.getData(1)
  86. },
  87. methods:{
  88. getData (page) {
  89. this.page = page;
  90. this.loading = true;
  91. $.ajax({
  92. type:"get",
  93. url:'http://www.helemedia.cn/select',
  94. dataType:'json',
  95. data:{
  96. page:this.page,
  97. pagesize:this.pageSize
  98. },
  99. success: (res) => {
  100. this.loading = false;
  101. if(res.errno == 0) {
  102. this.list = res.rst.list
  103. this.total = res.rst.page.count;
  104. }else{
  105. this.$message({
  106. message: res.err,
  107. type:'warning'
  108. });
  109. }
  110. },
  111. error: function (){
  112. this.loading = false;
  113. }
  114. })
  115. },
  116. handleCurrentChange(val){
  117. this.getData(val)
  118. }
  119. }
  120. });
  121. </script>