view.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <gracePage :customHeader="false">
  3. <view class="container" slot="gBody">
  4. <swiper class="swiper" @change="change" :circular="swiper.circular">
  5. <swiper-item v-for="(v, k) in fetch.items">
  6. <dreamView :item="v" class="item"></dreamView>
  7. </swiper-item>
  8. </swiper>
  9. </view>
  10. </gracePage>
  11. </template>
  12. <script>
  13. import gracePage from "@/lib/graceUI/components/gracePage.vue";
  14. import dreamView from "@/pages/dream/view/dreamView.vue";
  15. export default{
  16. data() {
  17. return {
  18. swiper : {
  19. index : 0,
  20. circular : false,
  21. },
  22. fetch: {
  23. items : [
  24. {
  25. pic : 'https://7.jstyle.cn/1/2020/04/25/a69fdba6a0cba49d46cc07b8e269b546.jpg',
  26. name : "测试标题 001",
  27. content : '内容',
  28. type : 1
  29. },
  30. {
  31. pic : 'https://7.jstyle.cn/1/2020/04/25/224697c330eca688097b4d0e4189709e.jpg',
  32. name : "测试标题 002",
  33. content : '内容2',
  34. type : 1
  35. },
  36. ],
  37. button : {
  38. read : {
  39. name : '阅读',
  40. style : 'background: linear-gradient(to right, #FF0066,#CA00FF) !important;color:#ffffff'
  41. }
  42. }
  43. }
  44. }
  45. },
  46. methods:{
  47. change : function(e) {
  48. this.swiper.index = e.detail.current;
  49. },
  50. view : function() {
  51. this.Dever.location('dream/view?id=1');
  52. }
  53. },
  54. components:{
  55. gracePage,dreamView
  56. }
  57. }
  58. </script>
  59. <style>
  60. .container {
  61. position: absolute;
  62. height: 100%;
  63. width: 100%;
  64. left: 0;
  65. top: 0;
  66. }
  67. .swiper {
  68. width: 750rpx;
  69. height: 100%;
  70. }
  71. swiper-item>view{
  72. height: 100%;
  73. }
  74. swiper-item image{
  75. width: 750rpx;
  76. height: 100%;
  77. }
  78. .btn {
  79. position: absolute;
  80. bottom: 30rpx;
  81. left: 60rpx;
  82. right: 60rpx;
  83. }
  84. .btn .dots{
  85. display: flex;
  86. justify-content: center;
  87. margin-bottom: -88rpx;
  88. }
  89. .btn .dots text{
  90. display: block;
  91. width: 16rpx;
  92. height: 8rpx;
  93. background: rgba(255, 255, 255, 0.5);
  94. border-radius: 8rpx;
  95. margin: 0 5rpx;
  96. }
  97. .btn .dots text.cur{
  98. background-color: rgba(255, 255, 255, 1);
  99. /*background: red;*/
  100. }
  101. .button{
  102. margin-top: 8rpx;
  103. height:60rpx;
  104. width:200rpx;
  105. text-align: center;
  106. line-height: 28px;
  107. border-radius: 0;
  108. }
  109. </style>