import 'package:fluro/fluro.dart';
// import 'package:liftmanager/internal/bbs/page/news_detail_page.dart';
// import 'package:liftmanager/internal/news/page/news_list_page.dart';
import 'package:liftmanager/internal/bbs/page/brand_page.dart';
import 'package:liftmanager/internal/bbs/page/interrogation_page.dart';
import 'package:liftmanager/internal/bbs/page/tab/product/product_detail.dart';
import 'package:liftmanager/internal/bbs/page/visit_page.dart';
import 'package:liftmanager/internal/bbs/page/map_choicePoint.dart';
import 'package:liftmanager/internal/bbs/page/expert_list.dart';
import 'package:liftmanager/internal/bbs/page/expert_detail.dart';
import 'package:liftmanager/internal/bbs/page/work_place.dart';
import 'package:liftmanager/internal/bbs/page/recommend_ask.dart';
import 'package:liftmanager/internal/bbs/page/recommend_exit.dart';
import 'package:liftmanager/internal/bbs/page/buy_service.dart';
import 'package:liftmanager/internal/bbs/page/chat_room.dart';
import 'package:liftmanager/internal/bbs/page/tab/question/question_list.dart';
import 'package:liftmanager/internal/bbs/page/tab/question/question_detail.dart';
import 'package:liftmanager/internal/bbs/page/tab/question/question_pay.dart';
import 'package:liftmanager/internal/bbs/page/tab/video/video_pay.dart';
import 'package:liftmanager/internal/bbs/page/tab/video/video_list.dart';
import 'package:liftmanager/internal/bbs/page/tab/video/video_detail.dart';
import 'package:liftmanager/internal/bbs/page/tab/video/video_upload.dart';
import 'package:liftmanager/internal/bbs/page/tab/position/position_list.dart';
import 'package:liftmanager/internal/bbs/page/tab/position/position_detail.dart';
import 'package:liftmanager/internal/bbs/page/tab/position/position_apply.dart';
import 'package:liftmanager/internal/bbs/page/tab/product/product_list.dart';



import 'package:liftmanager/routers/router_init.dart';


class BbsRouter implements IRouterProvider{

  static String newsDetail = "/news/detail";
  static String brandPage = "/bbs/brand";
  static String interrogationPage = "/bbs/interrogation";
  static String visitPage = "/bbs/visit";
  static String mapChoicePoint = "/map/choicePoint";
  static String expertList = "/bbs/expertList";
  static String expertDetail = "/bbs/expertDetail";
  static String buyService = "/bbs/buyService";
  static String chatRoom = "/bbs/chatRoom";
  static String questionList = "/bbs/questionList";
  static String questionDetail = "/bbs/questionDetail";
  static String questionPay = "/bbs/questionPay";
  static String videoPay = "/bbs/videoPay";
  static String videoList = "/bbs/videoList";
  static String positionList = "/bbs/positionList";
  static String videoDetail = "/bbs/videoDetail";
  static String videoUpload = "/bbs/videoUpload";
  static String positionDetail = "/bbs/positionDetail";
  static String positionApply = "/bbs/positionApply";
  static String productList = "/bbs/productList";
  static String productDetail = "/bbs/productDetail";
  static String workPlace = "/bbs/workPlace";
  static String recommendAsk = "/bbs/recommendAsk";
  static String recommendExit = "/bbs/recommendExit";
//  static String orderInfoPage = "/order/info";
//  static String orderSearchPage = "/order/search";
//  static String orderTrackPage = "/order/track";

  static String newsTopList = "/news/top/list";

  @override
  void initRouter(Router router) {
    // router.define(newsDetail, handler: Handler(handlerFunc: (_, params){
    //   String id = params["id"].first;
    //   return NewsDetailPage(id);
    // }));
    // router.define(newsTopList, handler: Handler(handlerFunc: (_, params){
    //   return NewsListPage();
    // }));
//    router.define(orderInfoPage, handler: Handler(handlerFunc: (_, params) => OrderInfoPage()));
//    router.define(orderSearchPage, handler: Handler(handlerFunc: (_, params) => OrderSearchPage()));
//    router.define(orderTrackPage, handler: Handler(handlerFunc: (_, params) => OrderTrackPage()));
      router.define(brandPage, handler: Handler(handlerFunc: (_, params){
        String index = params["index"].first;
        return BrandPage(index);
      }));
      router.define(interrogationPage, handler: Handler(handlerFunc: (_, params){
        String brandName = params["brandName"].first;
        String brandId = params["brandId"].first;
        
        return InterrogationPage(brandName,brandId);
      }));
      router.define(visitPage, handler: Handler(handlerFunc: (_, params){
        String brandName = params["brandName"].first;
        String brandId = params["brandId"].first;
        
        return VisitPage(brandName,brandId);
      }));
      router.define(mapChoicePoint, handler: Handler(handlerFunc: (_, params){
        String type = params["type"].first;
        return MyHomePage(type);
      }));
      router.define(expertList, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return ExpertList(id);
      }));
      router.define(workPlace, handler: Handler(handlerFunc: (_, params) => WorkPlace()));
      router.define(recommendAsk, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        String type = params["type"].first;
        return RecommendAsk(id,type);
      }));
      router.define(recommendExit, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return RecommendExit(id);
      }));
      router.define(chatRoom, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        String type = params["type"].first;
        String toUserId = params["toUserId"].first;
        return ChatDetailPage(id,type,toUserId);
      }));

      router.define(questionList, handler: Handler(handlerFunc: (_, params) => QuestionList()));
      router.define(questionDetail, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return QuestionDetail(id);
      }));
      router.define(questionPay, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        String type = params["type"].first;
        String name = params["name"].first;
        return QuestionPay(id, type,name);
      }));
      router.define(videoPay, handler: Handler(handlerFunc: (_, params){
        String pay = params["pay"].first;
        return VideoPay(pay);
      }));
      router.define(videoList, handler: Handler(handlerFunc: (_, params) => VideoList()));
      router.define(videoDetail, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return VideoDetail(id);
      }));
      router.define(videoUpload, handler: Handler(handlerFunc: (_, params) => VideoUpload()));
      router.define(positionList, handler: Handler(handlerFunc: (_, params) => PositionList()));
      router.define(positionDetail,
        handler: Handler(handlerFunc: (_, params) {
          String id = params["id"].first;
          return PositionDetail(id);
        }));
      router.define(positionApply,
        handler: Handler(handlerFunc: (_, params) {
          String id = params["id"].first;
          return PositionApply(id);
        }));
      router.define(productList, handler: Handler(handlerFunc: (_, params) => ProductList()));
      router.define(productDetail, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return ProductDetail(id);
      }));
      // router.define(chatRoom, handler: Handler(handlerFunc: (_, params){
      //   String type = params["type"].first;
      //   String index = params["index"].first;
      //   return ChatDetailPage(type,index);
      // }));
      router.define(expertDetail, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return ExpertDetail(id);
      }));

      router.define(buyService, handler: Handler(handlerFunc: (_, params){
        String id = params["id"].first;
        return BuyService(id);
      }));
  }

}
