CaseDetails.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div class="case">
  3. <banner img="../assets/img/bgtop.jpg" />
  4. <div class="case-product">
  5. <div class="case-product-content">
  6. <img v-lazy="imgserver+caseIdList.Img" alt />
  7. <p class="product-title">{{caseIdList.Title}}</p>
  8. <p class="product-time">{{caseIdList.CreateTime}}</p>
  9. <p class="product-content">{{caseIdList.Content}}</p>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import Banner from "../components/Banner";
  16. export default {
  17. components: {
  18. Banner
  19. },
  20. data() {
  21. return {
  22. pid: 0,
  23. caseIdList: {}
  24. };
  25. },
  26. created() {
  27. this.pid = this.$route.params.id;
  28. window.console.log(this.pid);
  29. },
  30. mounted() {
  31. this.loadData();
  32. },
  33. methods: {
  34. loadData() {
  35. this.$http
  36. .get(`Cases/GetCasesById/${this.pid}`)
  37. .then(response => {
  38. //console.log(response);
  39. this.caseIdList = response.data;
  40. window.console.log(this.caseIdList);
  41. })
  42. .catch(function(error) {
  43. window.console.log(error);
  44. });
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .case {
  51. width: 100%;
  52. height: 100%;
  53. overflow: hidden;
  54. background-color: #14679f;
  55. &-product {
  56. width: 1240px;
  57. margin: 0 auto;
  58. background-color: #fff;
  59. //border: 1px solid red;
  60. &-content {
  61. width: 760px;
  62. margin: 0 auto;
  63. display: flex;
  64. flex-direction: column;
  65. align-items: flex-start;
  66. padding: 50px 0;
  67. img {
  68. width: 100%;
  69. height: 430px;
  70. }
  71. .product-title {
  72. font-size: 25px;
  73. color: #e13834;
  74. padding: 20px 0;
  75. }
  76. .product-content {
  77. font-size: 17px;
  78. font-weight: bolder;
  79. padding: 20px 0;
  80. }
  81. }
  82. }
  83. }
  84. </style>