index.vue 2.4 KB

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