订单审核(点击通过/不通过按钮)
- 找到订单审核按钮页面orderxq.html,有两个按钮(通过和不通过,点击确认或者取消执行)
1 2
| <button type="button" class="button button-color" ng-if="is_approval" ng-click="auditOrder(orderDetails.order_id,2)" style="background:#EB4C0F!important;">通过</button> <button type="button" class="button button-color" ng-if="is_approval" ng-click="auditOrder(orderDetails.order_id,3)" style="background:#EB4C0F!important;">不通过</button>
|
找到order.controller.js的订单详情对应控制器OrderxqCtrl写页面上对应的ng-click=”auditOrder(orderDetails.order_id,3)” 函数
auditOrder函数里传入两个参数(orderDetails.order_id,3)接受(id,type): approval=2通过/approval=3不通过
1 2
| $scope.auditOrder = function(id,type) { }
|
对应点击确定时候调用接口传入得参数:
1 2 3 4 5
| var param = { verify: $window.localStorage['verify'], order_id: id, approval: type }
|
- 点击确定时执行onTap函数()
$ionicLoading.show()打开
$ionicLoading.hide()隐藏
1 2 3
| $ionicLoading.show({ template: "审核订单..." });
|
获取提交接口:
1 2
| orderDetailsFactory.auditOrder(param).then(function(callback) { });
|
orderDetailsFactory 接口 写在services/order.service.js 里定义名字接口auditOrder
1 2 3 4 5 6 7 8 9 10 11 12
| auditOrder: function (param) { return $http({ method:'POST', url:serverIP+'/app_vip/orders.php?act=order_approval', data:$.param(param), headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }).success(function(response) { return response; }); }
|
$window.location.reload(); //加载页面