a-multi-shop-master/code/multiShop/WebContent/sky/client/business/shopIndex/js/indexPage.js

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

angular.module('indexPage.module',[])
.controller("indexPageCtrl",['$timeout', '$interval', '$scope', '$routeParams', '$filter', '$document', "clientIndexHttpService", 
function($timeout, $interval, $scope, $routeParams, $filter, $document, clientIndexHttpService){
	//路由过来的参数
	$scope.routeParams = $routeParams;
	//根作用域
	$scope.shopIndexScope = angular.element($('#shopIndexId')).scope();
	//搜索关键字
	$scope.shopIndexScope.keywords = $routeParams.keywords?$routeParams.keywords:"";
	//是否显示更多类型
	$scope.isTypeMore = false;
	//搜索条件对象
	$scope.condition = {
			pageNo		: 1,		//当前页码
			pageSize		: 30,	//每页数据量
			pageCount	: 1,
			totalCount	: 0,
			shopId		: shopId,//店铺ID
			isOver		: "0",	//未过期
			status		: common.productContants.status.ONTABLE,	//状态上架
			keywords		: $routeParams.keywords?$routeParams.keywords:"",	//搜索关键字
			proType		: $routeParams.type,//商品类型
	};
	//选中的导航
	$scope.selectedNav = "index";
	
	
	/**
	 * 跳转页面
	 */
	$scope.toPage = function(url, flag){
		common.toPage($contextPath + url, flag);
	};
	
	/**
	 * 加载更多商品
	 */
	$scope.loadMoreProduct = function(){
		if($scope.condition && $scope.condition.pageNo<$scope.condition.pageCount && !$scope.isLoadingProduct){
			$scope.condition.pageNo++;
			$scope.pagedProductList(true);
		}
	};
	
	/**
	 * 选择过滤商品类型
	 */
	$scope.selectType = function(typeId){
		$scope.condition.proType = typeId;
		$scope.pagedProductList();
	};
	
	/**
	 * 分页获取商品列表
	 */
	$scope.pagedProductList = function(isMore){
		$scope.isLoadingProduct = true;
		clientIndexHttpService.pagedProductList($scope.condition)
		.then(function(response){
			var data = response.data;
后面还有 73 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。