Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安卓 list 上滑加载不触发 #45

Closed
shaibaoj opened this issue Jan 24, 2018 · 0 comments
Closed

安卓 list 上滑加载不触发 #45

shaibaoj opened this issue Jan 24, 2018 · 0 comments

Comments

@shaibaoj
Copy link

简略的描述你的问题。

使用list 做更多加载,loadmore 事件无法执行,@loadmore="loadmore" 事件无法触发
#

<list class="list" @loadmore="loadmore" loadmoreoffset="0">

#        <cell class="cell" v-for="item in items">
  #          <div class="goods" v-if="item.object_type=='goods'" >
    #            <div class="title flex-row">
                    <div class="line" ></div>
                    <div class="point"></div>
                    <text class="text-title full-rest">{{item.create_date}}</text>
                </div>
                <div class="content flex-row">
                    <div class="line"></div>
                    <div class="full-rest">
                       # <ydh-goods viewStyle="list"  
                            #:title="item.obj.title" 
                            #:price="item.obj.price" 
                            #:numIid="item.obj.num_iid" 
                            #:couponMoney="item.obj.coupon_money" 
                            #:couponStartTime="item.obj.coupon_start_time"
                            #:couponEndTime="item.obj.coupon_end_time"
                            #:couponStatus="item.obj.coupon_status"
                          #  :picUrl="item.obj.pic_url" 
                        #    :comment="item.obj.comment" 
                      #      :volume="item.obj.volume" 
                    #        :buyPrice="item.obj.buy_price" 
                  #          v-if="initShow" :customSet="local.config.skin.common"
                #        />
              #      </div>
            #    </div>
          #  </div>
        #</cell>
      #  <loading class="loading" @loading="onloading" :display="showLoading">
            <loading-indicator>
                <text class="indicator">加载中...</text>
            </loading-indicator>
        </loading>
    </list>
    <wxc-loading :show="!isShow" type="trip"></wxc-loading>
</div>
<script> if(process.env.NODE_ENV === 'development') require('Config') import util from '../../utils/util'; export default { components: { 'ydh-goods':goodsBox, WxcResult,WxcLoading,WxcMinibar ,YdhMinibar,YdhResult,YdhRefresh,CommonUtils,Tools }, created() { util.initIconFont() this.init() }, data() { return { local:{}, initShow:false, isShow:false, hasItems:false, items: [], showLoading: 'hide', min_time:'', max_time:'', }, } }, computed : { showList : function() { return this.isShow; } }, methods: { init_query(){

    },
    loadmore(){
        this.$notice.loading.show("加载中..")
        this.showLoading = 'show';
        this.queryItems({
            min_date:this.min_time
        },resData =>{
            this.$notice.loading.hide()
            this.showLoading = 'hide'
            this.items.push.apply(this.items,resData.items)
            if(CommonUtils.dateDiff(this.min_time,resData.min_time)){
                this.min_time = resData.min_time;
            }
        },error => {
            this.$notice.loading.hide()
            this.showLoading = 'hide'
        })
    },
    onloading() {
        
    },
    loadingDown() {
        this.queryItems({},resData =>{
            this.$notice.loading.hide()
            this.showLoading = 'hide'
            this.items.push(resData.items);
        },error => {
            this.$notice.loading.hide()
            this.showLoading = 'hide'
            this.items.push(resData.items);
        })
    },
    queryItems(options,success,reject){
        this.$fetch({
            method: 'POST',
            name: 'cms.member.favorite.list',
            data: options
        }).then(resData => {
            success(resData);
        }, error => {
            reject(error);
        })
    },
    queryInitItems() {
        this.$fetch({
            method: 'POST',
            name: 'cms.member.favorite.list',
            data: {}
        }).then(resData => {
            this.items = resData.items;
            if(CommonUtils.dateDiff(this.min_time,resData.min_time)){
                this.min_time = resData.min_time;
            }
            this.isShow = true;
            if(this.items.length>0){
                this.hasItems = true;
            }

        }, error => {

        })
    },
    wxcResultButtonClicked(){
        this.queryItems();
    },
    onchange(index) {
        // console.log(index);
        // dom.scrollToElement(this.$refs[`page_${index}`][0], { animated: false })
    },
}

}
</script>

<style scoped> .wrapper { /* width:750px; */ position: absolute; top: 0; left: 0; right: 0; bottom: 0; /* justify-content: center; */ /* flex-direction: column; */ } .list{ margin-bottom:0px; background-color: #ffffff; } .loading{ /* flex-direction: row; */ justify-content: center; align-items: center; width:750px; /* flex: 1; */ /* height:0px; */ } .indicator { /* background-color: black; */ color: #888888; font-size: 30px; padding-top: 20px; padding-bottom: 20px; } .history{ } .flex-row { flex-direction: row; } .full-rest { flex: 1; } .root { padding-top: 28px; padding-bottom: 24px; background-color: #ffffff; } .title { height: 40px; } .content { padding-top: 9px; padding-bottom: 42px; } .last-one-content { padding-bottom: 0; } .title, .content { padding-left: 60px; padding-right: 0px; } .line { position: absolute; top: 0; bottom: 0; left: 38px; width: 2px; background-color: #FFC300; } .first-one-title-line { top: 20px; } .last-one-title-line { bottom: 20px; } .last-one-content-line { width: 0; } .point { position: absolute; top: 13px; left: 32px; width: 14px; height: 14px; background-color: #FFF0BD; border-style: solid; border-width: 2px; border-color: #EE9900; border-radius: 100px; } .highlight-point { top: 7px; left: 26px; width: 26px; height: 26px; background-color: #EE9900; border-style: solid; border-width: 6px; border-color: #FFE78D; } .text-title { font-size: 30px; color: #3d3d3d; } .text-highlight-title { color: #EE9900; } .text-desc, .text-date { font-size: 24px; color: #a5a5a5; } .text-desc { margin-bottom: 12px; } </style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant