devtools : add

master
luoyang14z7 6 years ago
parent f70ead46a9
commit 9e9f472f3d

@ -51,6 +51,14 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/phone_top_up',
templateUrl: '/static/config/devtools/templates/phone_top_up.html',
controller: 'phonetopupCtrl'
}).state('devtools.orgusertest', {
url: '/orgusertest',
templateUrl: '/static/config/devtools/templates/orgusertest.html',
controller: 'orgusertestCtrl'
}).state('devtools.aliforexcel', {
url: '/aliforexcel',
templateUrl: '/static/config/devtools/templates/aliforexcel.html',
controller: 'aliforexcelCtrl'
})
}]);
app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
@ -302,6 +310,37 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
})
}
}]);
app.controller('orgusertestCtrl', ['$scope', '$http', '$filter','commonDialog', function ($scope, $http, $filter,commonDialog) {
$scope.regist = function () {
$http.post('/dev/orgusertest',{client_moniker: $scope.company}).then(function (resp) {
commonDialog.alert({title: 'SUCCESS', content:"注册成功", type: 'success'})
}, function (resp) {
commonDialog.alert({title: 'Error', content: "商品编号已存在", type: 'Error'})
})
}
}]);
app.controller('aliforexcelCtrl', ['$scope', '$filter', function ($scope, $filter) {
$scope.params = {};
var str = $filter('date')(new Date(), 'yyyyMMdd');
var oDate = new Date(str.slice(0, 4), str.slice(4, 6) - 1, str.slice(-2));
var oDay = oDate.getDay();
var oNum = oDate.getDate();
var bWeek1 =new Date(str.slice(0, 4), str.slice(4, 6) - 1, oNum-oDay-6);
var bWeek2 =new Date(str.slice(0, 4), str.slice(4, 6) - 1, oNum-oDay);
$scope.params.datefrom = bWeek1;
$scope.params.dateto = bWeek2;
$scope.Export = function () {
var params = angular.copy($scope.params);
params.datefrom = $filter('date')(params.datefrom, 'yyyy-MM-dd');
params.dateto = $filter('date')(params.dateto, 'yyyy-MM-dd');
var url = '/dev/aliforexcel';
var connectSymbol = '?';
url += connectSymbol + 'datefrom=' + params.datefrom + '&' + 'dateto=' + params.dateto;
return url;
}
}]);
return app;
});

@ -21,7 +21,7 @@
<input ng-model="company" name="code" class="form-control" type="text"/>
</div>
<div class="form-group">
<button class="btn btn-primary btn-block" ng-click="test()">commit</button>
<button class="btn btn-primary btn-block" ng-click="regist()">commit</button>
</div>
</form>
</div>

@ -67,6 +67,14 @@
<i class="fa fa-envelope"></i>
Phone Top Up
</a>
<a class="btn btn-app" role="button" ui-sref=".orgusertest">
<i class="fa fa-envelope"></i>
Partner test
</a>
<a class="btn btn-app" role="button" ui-sref=".aliforexcel">
<i class="fa fa-envelope"></i>
支付宝进件导出
</a>
</div>
</div>
</section>

Loading…
Cancel
Save