features-list.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. @extends('layouts.base')
  2. @section('title', "专题页")
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/pc-terminal-two/views/backend/index.css')}}">
  5. <style>
  6. /* 导航 */
  7. .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
  8. .el-radio-button__inner{border:0;}
  9. .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
  10. </style>
  11. <div class="all">
  12. <div id="app" v-cloak>
  13. <div class="vue-crumbs">
  14. <a @click="goParent(1)">PC端模板2</a> >专题页
  15. </div>
  16. <div class="vue-main">
  17. <div>
  18. <div class="vue-main-title" style="margin-bottom:20px">
  19. <div class="vue-main-title-left"></div>
  20. <div class="vue-main-title-content" style="flex:0 0 120px">专题列表</div>
  21. </div>
  22. <el-table :data="list" style="width: 100%">
  23. <el-table-column label="专题ID" align="center" prop="id" width="100"></el-table-column>
  24. <el-table-column label="专题名称" align="center" prop="name"></el-table-column>
  25. <el-table-column prop="refund_time" label="操作" align="center" width="320" :inline="true">
  26. <template slot-scope="scope">
  27. <el-input v-model="scope.row.copy_h5_url" style="opacity:0;width:33px;" :ref="'copy'+scope.$index"></el-input>
  28. <el-button type="primary" size="mini" @click="gotoDetail(scope.row)">编辑</el-button>
  29. <el-button type="primary" size="mini" @click="copyLink(scope.row,scope.$index)">复制链接</el-button>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. </div>
  34. </div>
  35. <!-- 分页 -->
  36. <div class="vue-page" v-if="total>0">
  37. <el-row>
  38. <el-col align="right">
  39. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
  40. :page-size="per_page" :current-page="current_page" background
  41. ></el-pagination>
  42. </el-col>
  43. </el-row>
  44. </div>
  45. </div>
  46. </div>
  47. <script>
  48. var app = new Vue({
  49. el: "#app",
  50. delimiters: ['[[', ']]'],
  51. name: 'test',
  52. data() {
  53. return {
  54. list:[],
  55. current_page:1,
  56. total:1,
  57. per_page:1,
  58. }
  59. },
  60. created() {
  61. },
  62. mounted() {
  63. this.getData(1);
  64. },
  65. methods: {
  66. getData(page) {
  67. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  68. this.$http.post('{!! yzWebFullUrl('plugin.pc-terminal-two.backend.features.features-list') !!}',{page:page}).then(function(response) {
  69. if (response.data.result) {
  70. console.log(response.data.data);
  71. this.list = response.data.data.data;
  72. this.current_page=response.data.data.current_page;
  73. this.total=response.data.data.total;
  74. this.per_page=response.data.data.per_page;
  75. loading.close();
  76. } else {
  77. this.$message({
  78. message: response.data.msg,
  79. type: 'error'
  80. });
  81. }
  82. loading.close();
  83. }, function(response) {
  84. this.$message({
  85. message: response.data.msg,
  86. type: 'error'
  87. });
  88. loading.close();
  89. });
  90. },
  91. gotoDetail(item) {
  92. let link = `{!! yzWebFullUrl('plugin.pc-terminal-two.backend.features.features-edit') !!}`+`&id=`+item.id;
  93. window.location.href = link;
  94. },
  95. goParent(level) {
  96. if(level==1) {
  97. window.location.href = `{!! yzWebFullUrl('plugin.pc-terminal-two.backend.set.basic') !!}`;
  98. }
  99. },
  100. copyLink(row,index) {
  101. that = this;
  102. let Url = that.$refs['copy'+index];
  103. Url.select(); // 选择对象
  104. document.execCommand("Copy",false);
  105. that.$message({message:"复制成功!",type:"success"});
  106. },
  107. search(val) {
  108. this.getData(val);
  109. },
  110. // 字符转义
  111. escapeHTML(a) {
  112. a = "" + a;
  113. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");;
  114. },
  115. },
  116. })
  117. </script>
  118. @endsection