def userBackgroupCollect(request): isLogin, account = UserInfo.checkIsLogin(request); isSuperUser = UserInfo.checkIsSuperUser(request); #获取页码 try: page = int(request.GET.get('page', '1')); except Exception, e: page = 1;
def userBackgroupAddress(request): #获取order信息 isLogin, account = UserInfo.checkIsLogin(request); #获取地址 addressList = AddressInfo.getAddressData(1, 2000, account, {'account' : account}); data = { 'addressList' : addressList, 'superUser' : UserInfo.checkIsSuperUser(request) } return Responses.returnCheckLoginDrawPage(isLogin, 'myBackgroup/myAddress.html', 'data', data);
def userBackgroupUserInfo(request): #获取order信息 isLogin, account = UserInfo.checkIsLogin(request); userInfo = UserInfo.getUserInfoData(account); data = []; if userInfo: userInfo=userInfo[0]; data = { 'userInfo' : userInfo, 'superUser' : UserInfo.checkIsSuperUser(request) } return Responses.returnCheckLoginDrawPage(isLogin, 'myBackgroup/myPersonal.html', 'data', data);
def managerUploader(request): isLogin, account = UserInfo.checkIsLogin(request); data = { 'superUser' : UserInfo.checkIsSuperUser(request) } return Responses.returnCheckLoginDrawPage(isLogin, 'managerBackgroup/uploadGoods.html', 'data', data);
page = int(request.GET.get('page', '1')); except Exception, e: page = 1; #分页获取所有商品 goodsList, pageResult = GoodsInfo.getGoodsData(page, 12, None); #限定只能看到多少页,例如总的有20页,只限定看2--5页 new_page_range = []; if pageResult: for page_number in pageResult.paginator.page_range: if abs(page_number-pageResult.number) <= 3: new_page_range.append(page_number); data = { 'goodsList' : goodsList, 'pageResult' : pageResult, 'new_page_range' : new_page_range, 'superUser' : UserInfo.checkIsSuperUser(request) } return Responses.returnCheckLoginDrawPage(isLogin, 'managerBackgroup/allGoods.html', 'data', data); #管理员所有订单 def managerAllOrder(request): isLogin, account = UserInfo.checkIsLogin(request); #获取页码 try: page = int(request.GET.get('page', '1')); except Exception, e: page = 1; #获取订单 allOrder, pageResult = OrderInfo.getOrderData(page, 12, account); #限定只能看到多少页,例如总的有20页,只限定看2--5页 new_page_range = [];