1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <gracePage :customHeader="false">
- <view class="container" slot="gBody">
- <swiper class="swiper" @change="change" :circular="swiper.circular">
- <swiper-item v-for="(v, k) in fetch.items" v-if="v.data" :key="k" >
- <scroll-view scroll-y="true" scroll-x="true" class="scroll-height">
- <dream ref="dream" :index="k" :item="v" :control="control" class="item"></dream>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </gracePage>
- </template>
- <script>
- import gracePage from "@/lib/graceUI/components/gracePage.vue";
- import dream from "@/pages/dream/view/dream.vue";
- var graceRichText = require("@/lib/graceUI/jsTools/richText.js");
- export default{
- data() {
- return {
- id : 1,
- swiper : {
- index : 0,
- circular : false,
- },
- fetch: {
- items : []
- },
- control : {}
- }
- },
- onLoad(option) {
- this.id = option.id;
- this.getData();
- },
- // 下拉刷新
- onPullDownRefresh: function() {
- this.getData();
- },
- // 重新加载
- onPullDownRefresh: function() {
- this.getData();
- },
- methods:{
- change : function(e) {
- this.swiper.index = e.detail.current;
- if (this.control) {
- var i = 0;
- for (i in this.control) {
- if (this.control[i].load) {
- if (this.swiper.index == i) {
- this.control[i].start();
- } else {
- this.control[i].stop();
- }
- }
- }
- }
- },
- view : function() {
- this.Dever.location('dream/view?id=1');
- },
- getData : function() {
- this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id});
- }
- },
- components:{
- gracePage,dream
- }
- }
- </script>
- <style>
- .container {
- position: absolute;
- height: 100%;
- width: 100%;
- left: 0;
- top: 0;
- }
- .swiper {
- width: 750rpx;
- height: 100%;
- }
- swiper-item>view{
- height: 100%;
- }
- swiper-item image{
- width: 750rpx;
- height: 100%;
- }
- .scroll-height {
- height:100%;
- }
- </style>
|