码迷,mamicode.com
首页 > 其他好文 > 详细

angular——更多按钮的上拉菜单(路由跳转)

时间:2016-04-20 00:18:13      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:

<button  class="btn gray_text_btn list_item" ng-click="action.toMoreOptions()">
    <i class="icon ion-navicon"></i>
</button>
<!-------------------- 底部按钮  ----------------------->
    <section class="bar bar-footer lists_in_4_row">
            <button  class="btn gray_text_btn list_item" ng-click="action.toShare()"><i class="icon ion-share"></i></button>
            <button  class="btn gray_text_btn collect_btn animated_btn list_item" ng-click="collected = !collected" ng-class="{‘active‘:collected}">
                <i class=‘icon‘ ng-class=" collected ? ‘ion-ios-star‘ : ‘ion-ios-star-outline‘ "></i>68
            </button>
            <button  class="btn gray_text_btn  comment_btn list_item" ng-click=""  ng-class="{‘active‘:commented}" >
                <i class="icon" ng-class="commented ?  ‘ion-ios-chatboxes‘: ‘ion-ios-chatboxes-outline‘"></i>68
            </button>
            <button  class="btn gray_text_btn list_item" ng-click="action.toMoreOptions()">
                <i class="icon ion-navicon"></i>
            </button>
    </section>
// 「更多」action sheet
            $scope.action.toMoreOptions = function(){
                    var hideSheet = $ionicActionSheet.show({
                            buttons: [
                                    { text: ‘新建模型‘ },
                                    { text: ‘关注大V‘ },
                                    { text: ‘推荐更多大V‘ },
                                    { text: ‘我要爆料‘ },
                                    { text: ‘举报‘ },
                                    { text: ‘纠错‘ }
                            ],
                            cssClass: ‘list_action_sheet‘,
                            cancelText: ‘取消‘,
                            buttonClicked: function(index) {
                                    switch (index){
                                            case 0 :
                                                    $scope.action.toPage(‘tab.home-create-a-model‘);
                                                    return true;
                                            case 1 :
                                                    $scope.action.followVip();
                                                    return true;
                                            case 2:
                                                    $scope.action.toPage(‘tab.home-recommend-a-bigV‘);
                                                    return true;
                                            case 3:
                                                    $scope.action.toPage(‘tab.home-recommend-a-article‘);
                                                    return true;
                                            case 4:
                                                    $scope.action.toPage(‘tab.home-report-illegal‘);
                                                    return true;
                                            case 5:
                                                    $scope.action.toPage(‘tab.my-feedback‘);
                                                    return true;
                                    }
                            }
                    });
            };

 

angular——更多按钮的上拉菜单(路由跳转)

标签:

原文地址:http://www.cnblogs.com/hu-clover/p/5410718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!