You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							57 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							57 lines
						
					
					
						
							1.1 KiB
						
					
					
				
								import {HTTP, Method} from '../utils/http.js'
							 | 
						|
								
							 | 
						|
								const HOMEConst = {
							 | 
						|
								  home_banner_url: '/api/content/getListByCode',
							 | 
						|
								  home_hot_url: '/api/content/getListByCode',
							 | 
						|
								  home_list_url: '/api/content/getListByCode',
							 | 
						|
								}
							 | 
						|
								
							 | 
						|
								class HomeModel extends HTTP {
							 | 
						|
								  constructor () {
							 | 
						|
								    super()
							 | 
						|
								  }
							 | 
						|
								  // 获取 Banner 数据
							 | 
						|
								  getHomeBanner(success) {
							 | 
						|
								    let params = {
							 | 
						|
								      url:  HOMEConst.home_banner_url,
							 | 
						|
								      method: Method.POST,
							 | 
						|
								      data: {
							 | 
						|
								        typeCode: 'sc-banner',
							 | 
						|
								        page: 1,
							 | 
						|
								        pageSize: 20,
							 | 
						|
								      },
							 | 
						|
								      success: success
							 | 
						|
								    }
							 | 
						|
								    this.request(params)
							 | 
						|
								  }
							 | 
						|
								  // 获取首页热点数据
							 | 
						|
								  getHomeHot(success) {
							 | 
						|
								    let params = {
							 | 
						|
								      url:  HOMEConst.home_hot_url,
							 | 
						|
								      method: Method.POST,
							 | 
						|
								      data: {
							 | 
						|
								        typeCode: 'sc-jdtz',
							 | 
						|
								        page: 1,
							 | 
						|
								        pageSize: 20,
							 | 
						|
								      },
							 | 
						|
								      success: success
							 | 
						|
								    }
							 | 
						|
								    this.request(params)
							 | 
						|
								  }
							 | 
						|
								  // 首页列表
							 | 
						|
								  getHomeList(page, success){
							 | 
						|
								    let params = {
							 | 
						|
								      url: HOMEConst.home_list_url,
							 | 
						|
								      method: Method.POST,
							 | 
						|
								      data: {
							 | 
						|
								        typeCode: 'sc-tzgg',
							 | 
						|
								        page: page,
							 | 
						|
								        pageSize: 20,
							 | 
						|
								      },
							 | 
						|
								      success: success
							 | 
						|
								    }
							 | 
						|
								    this.request(params)
							 | 
						|
								  }
							 | 
						|
								}
							 | 
						|
								
							 | 
						|
								export {HomeModel}
							 |