本帖最后由 谷粒姐姐 于 2018-8-30 14:26 编辑
运营商后台-商品管理【商品审核】 3.1 待审核商品列表 需求:参照商家后台商品列表。代码: (1)修改 pinyougou-manager-web 的 goodsController.js,注入 itemCatService,添加代码 [AppleScript] 纯文本查看 复制代码 $scope.status=['未审核','已审核','审核未通过','关闭'];//商品状态
$scope.itemCatList=[];//商品分类列表
//查询商品分类
$scope.findItemCatList=function(){ itemCatService.findAll().success(
function(response){
for(var i=0;i<response.length;i++){
$scope.itemCatList[response[i].id ]=response[i].name;
}
}
);
} (2)修改 goods.html ,引入 js [AppleScript] 纯文本查看 复制代码 <script type="text/javascript" src="../plugins/angularjs/angular.min.js"></script>
<!-- 分页组件开始 -->
<script src="../plugins/angularjs/pagination.js"></script>
<link rel="stylesheet" href="../plugins/angularjs/pagination.css">
<!-- 分页组件结束 --> [AppleScript] 纯文本查看 复制代码 <script type="text/javascript" src="../js/base_pagination.js"></script>
<script type="text/javascript" src="../js/service/goodsService.js"></script>
<script type="text/javascript" src="../js/service/itemCatService.js"></script>
<script type="text/javascript" src="../js/controller/baseController.js"></script>
<script type="text/javascript" src="../js/controller/goodsController.js"></script> (3)指令,完成初始调用 (4)循环列表 [AppleScript] 纯文本查看 复制代码 <tr ng-repeat="entity in list">
<td><input type="checkbox"></td>
<td>{{entity.id}}</td>
<td>{{entity.goodsName}}</td>
<td>{{entity.price}}</td>
<td>{{itemCatList[entity.category1Id]}}</td>
<td>{{itemCatList[entity.category2Id]}}</td>
<td>{{itemCatList[entity.category3Id]}}</td>
<td>{{status[entity.auditStatus]}}</td>
<td class="text-center"> </td>
</tr> (5)分页控件 [AppleScript] 纯文本查看 复制代码 <tm-pagination conf="paginationConf"></tm-pagination> |