subscribe.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="container">
  3. <!-- 头部区域 -->
  4. <top-box v-bind:timeStamp="timeStamp"></top-box>
  5. <!-- 列表区域 -->
  6. <view class="card-box">
  7. <view class="card-item" v-for="(item,index) in subArr" :style="{backgroundImage:`url(${item.image})`}"></view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import {
  13. mapState
  14. } from 'vuex'
  15. export default {
  16. computed: {
  17. ...mapState('m_parent', ['parentinfo'])
  18. },
  19. data() {
  20. return {
  21. //时间戳
  22. timeStamp: '',
  23. subArr:[
  24. {
  25. image:'https://psycho-1300960840.cos.ap-chengdu.myqcloud.com/fu/TMD/banner_1.jpg',
  26. title:'学情分析报告',
  27. summary:'提供本学期孩子的全面考试成绩分析报告'
  28. },
  29. {
  30. image:'https://psycho-1300960840.cos.ap-chengdu.myqcloud.com/fu/TMD/banner_2.jpg',
  31. title:'大考诊断分析报告',
  32. summary:'提供本学期孩子大考分析报告'
  33. },
  34. {
  35. image:'https://psycho-1300960840.cos.ap-chengdu.myqcloud.com/fu/TMD/banner_3.jpg',
  36. title:'德育分析报告',
  37. summary:'提供本学期孩子德育发展全方位分析'
  38. }
  39. ]
  40. }
  41. },
  42. onLoad() {
  43. this.$getTimeStamp()
  44. },
  45. //刷新页面
  46. onPullDownRefresh() {
  47. this.$getTimeStamp()
  48. console.log('refresh');
  49. setTimeout(function() {
  50. uni.stopPullDownRefresh();
  51. }, 1000);
  52. },
  53. methods: {
  54. },
  55. }
  56. </script>
  57. <style lang="scss">
  58. .container {
  59. width: 100%;
  60. height: 100%;
  61. overflow-x: hidden; //隐藏多余的页面
  62. .home-topinfo {
  63. background: linear-gradient(#ffd200, $page-background-color);
  64. }
  65. .card-box {
  66. display: flex;
  67. flex-direction: row;
  68. flex-wrap: wrap;
  69. margin: -50rpx 20rpx 0 20rpx;
  70. justify-content: space-between;
  71. .card-item {
  72. margin: 10rpx 0;
  73. display: flex;
  74. flex-direction: column;
  75. justify-content: space-between;
  76. background-size: cover;
  77. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
  78. border-radius: $card-border-radius;
  79. width: 100%;
  80. height: 300rpx;
  81. }
  82. }
  83. }
  84. </style>