view.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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" v-if="v.data">
  6. <scroll-view scroll-y="true" class="scroll-height">
  7. <dream :item="v" :config="config" class="item"></dream>
  8. <view class="page-num" v-if="swiper.index != -1">P{{swiper.index+1}}</view>
  9. </scroll-view>
  10. </swiper-item>
  11. </swiper>
  12. </view>
  13. </gracePage>
  14. </template>
  15. <script>
  16. import gracePage from "@/lib/graceUI/components/gracePage.vue";
  17. import dream from "@/pages/dream/view/dream.vue";
  18. var graceRichText = require("@/lib/graceUI/jsTools/richText.js");
  19. export default{
  20. data() {
  21. return {
  22. id : 1,
  23. swiper : {
  24. index : 0,
  25. circular : false,
  26. },
  27. fetch: {
  28. items : []
  29. },
  30. config : {
  31. position: ["tl","tc","tr","cl","cc","cr","bl","bc","br"],
  32. position_f: ["tl","tr","bl","br"],
  33. }
  34. }
  35. },
  36. onLoad(option) {
  37. this.id = option.id;
  38. this.getData();
  39. },
  40. // 下拉刷新
  41. onPullDownRefresh: function() {
  42. this.getData();
  43. },
  44. // 重新加载
  45. onPullDownRefresh: function() {
  46. this.getData();
  47. },
  48. methods:{
  49. change : function(e) {
  50. this.swiper.index = e.detail.current;
  51. },
  52. view : function() {
  53. this.Dever.location('dream/view?id=1');
  54. },
  55. getData : function() {
  56. this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id});
  57. }
  58. },
  59. components:{
  60. gracePage,dream
  61. }
  62. }
  63. </script>
  64. <style>
  65. .container {
  66. position: absolute;
  67. height: 100%;
  68. width: 100%;
  69. left: 0;
  70. top: 0;
  71. }
  72. .swiper {
  73. width: 750rpx;
  74. height: 100%;
  75. }
  76. swiper-item>view{
  77. height: 100%;
  78. }
  79. swiper-item image{
  80. width: 750rpx;
  81. height: 100%;
  82. }
  83. .scroll-height {
  84. height:100%;
  85. }
  86. .page-num {
  87. position: fixed;
  88. right: 30rpx;
  89. bottom: 30rpx;
  90. width: 80rpx;
  91. height: 80rpx;
  92. background-color: rgba(0, 0, 0, 0.75);
  93. border-radius: 80rpx;
  94. color: #fff;
  95. font-size: 30rpx;
  96. line-height: 80rpx;
  97. text-align: center;
  98. z-index: 200;
  99. }
  100. </style>