master
yuan 7 years ago
parent ddb1ebd101
commit cedbbfe97e

@ -970,44 +970,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
};
$scope.uploadMerchant_photo1 = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.merchant_photo1 = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.uploadMerchant_photo2 = function (file) {
if (file != null) {
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.logoProgress;
$scope.partner.logo_id = resp.data.fileid;
$scope.partner.merchant_photo2 = resp.data.url;
}, function (resp) {
delete $scope.logoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
};
$scope.getMerchantLocation = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/location').then(function (resp) {
$scope.merchant_location = resp.data;

@ -250,33 +250,6 @@
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* Store Photo</label>
<div class="col-sm-4">
<div class="form-control-static"><em>1</em>:&nbsp;
<button class="btn btn-success" type="button"
ngf-select="uploadMerchant_photo1($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload Merchant Photo1
</button>
</div>
<uib-progressbar value="logoProgress.value"
ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{partner.merchant_photo1}}" class="col-sm-3">
</div>
<div class="col-sm-4">
<div class="form-control-static"><em>2</em>:&nbsp;
<button class="btn btn-success" type="button"
ngf-select="uploadMerchant_photo2($file)"
accept="image/*" ngf-max-size="1MB">
<i class="fa fa-upload"></i> Upload Merchant Photo2
</button>
</div>
<uib-progressbar value="logoProgress.value"
ng-if="logoProgress"></uib-progressbar>
<img ng-src="{{partner.merchant_photo2}}" class="col-sm-3">
</div>
</div>
<div class="form-group"
ng-class="{'has-error':partnerForm.company_phone_p.$invalid && partnerForm.company_phone_p.$dirty}">
<label class="control-label col-sm-2" for="service-phone-p-input">*

Loading…
Cancel
Save