You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

90 line
2.9 KiB

  1. <template>
  2. <el-main class="main-container">
  3. <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
  4. <el-breadcrumb-item class="location">您的位置:</el-breadcrumb-item>
  5. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  6. <el-breadcrumb-item>会员产品</el-breadcrumb-item>
  7. </el-breadcrumb>
  8. <el-row class="card_menu">
  9. <el-col :span="4">
  10. <el-card class="box-card" shadow="never" :body-style="{ padding: '10px 0'}">
  11. <div slot="header">
  12. <span>会员产品</span>
  13. </div>
  14. <!-- <div class="menu-item active">SICA简介</div> -->
  15. <div class="menu-item" v-for="(item, index) in titleList" :key="index"
  16. :class="{'active' : (index == activeIndex)}" @click="changeType(index)">
  17. {{item.channelName}}</div>
  18. </el-card>
  19. </el-col>
  20. <el-col :span="20">
  21. <el-card shadow="never" style="margin: 0 10px;">
  22. <ul style="list-style: none">
  23. <li style="padding: 10px;border-bottom: 1px solid #eee;margin: 5px 0"
  24. v-for="(item,index) in dataList" :key="index">{{ index+1 }}、{{item.title}}<span style="float:right">{{item.publishTime}}</span></li>
  25. </ul>
  26. <el-pagination
  27. background
  28. layout="prev, pager, next"
  29. :total="total" prev-text="上一页" next-text="下一页" style="float: right;margin: 10px">
  30. </el-pagination>
  31. </el-card>
  32. </el-col>
  33. </el-row>
  34. </el-main>
  35. </template>
  36. <script>
  37. import {getChannelInformationsRequest, getChannelsRequest, getChannelSecond} from "../api/data";
  38. export default {
  39. data () {
  40. return {
  41. titleList: [],
  42. activeIndex: 0,
  43. dataList: []
  44. }
  45. },
  46. methods: {
  47. async getChannelsRequest(){
  48. let res = await getChannelsRequest({current:1,size:100})
  49. if(res.code == 200){
  50. res.data.records.map((item) => {
  51. if(item.channelName == '会员产品'){
  52. this.getChannelSecond(item.id)
  53. }
  54. })
  55. }
  56. },
  57. async getChannelSecond(id){
  58. let res = await getChannelSecond(id)
  59. if(res.code == 200){
  60. // console.log(JSON.stringify(res.data))
  61. this.titleList = res.data
  62. if(this.titleList){
  63. this.getChannelInformationsRequest(this.titleList[0].id)
  64. }
  65. }
  66. },
  67. async getChannelInformationsRequest(id){
  68. let res = await getChannelInformationsRequest({channelId: id})
  69. if(res.code == 200){
  70. this.dataList = res.data.records
  71. console.log("this.dataList:"+JSON.stringify(this.dataList))
  72. }
  73. },
  74. changeType(index){
  75. this.activeIndex = index;
  76. this.getChannelInformationsRequest(this.titleList[index].id)
  77. }
  78. },
  79. mounted() {
  80. this.getChannelsRequest()
  81. }
  82. }
  83. </script>