|
|
@@ -3,13 +3,23 @@
|
|
|
angular.module('app').controller('WebController', ['$scope', '$timeout', 'userService', 'messageService', function($scope, $timeout, userService, messageService) {
|
|
|
//lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
|
|
|
$scope.bundle = {
|
|
|
- //userId: userService.getMe().Id,
|
|
|
- userId: 0,
|
|
|
- uesrName: "",
|
|
|
- uesrMobile: "",
|
|
|
- descr: "",
|
|
|
- mapPosition: {},
|
|
|
- imgSources: [],
|
|
|
+ userId: -1,
|
|
|
+ //不超过2000个字符
|
|
|
+ describe: '',
|
|
|
+ //不超过50个字符
|
|
|
+ name: '',
|
|
|
+ //手机号码
|
|
|
+ mobile: '',
|
|
|
+ //不超过100个字符
|
|
|
+ title: '',
|
|
|
+ /// 类型
|
|
|
+ /// 0我要咨询;1我要投诉;2我要建议;3领导信箱;4我要举报 5纠错
|
|
|
+ type: 0,
|
|
|
+ //是否建议 1-建议 0-投诉
|
|
|
+ advice: '0',
|
|
|
+ //是否公开互联网(1是;0否)
|
|
|
+ isPublic: 0,
|
|
|
+ assets: []
|
|
|
};
|
|
|
|
|
|
$scope.$on('$viewContentLoaded', function() {
|
|
|
@@ -31,14 +41,9 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', 'userSe
|
|
|
angular.element(".onView").removeClass("onView");
|
|
|
var img = $(event.target);
|
|
|
img[0].className = "onView";
|
|
|
- if (img[0].naturalHeight * 3 > (img[0].naturalWidth + 10) * 4) {
|
|
|
- angular.element(".image-view").removeClass("width-Img");
|
|
|
- angular.element(".viewModal").addClass("height-Img");
|
|
|
- } else if (img[0].naturalWidth > img[0].naturalHeight) {
|
|
|
- angular.element(".viewModal").removeClass("height-Img");
|
|
|
+ if (img[0].naturalWidth > img[0].naturalHeight) {
|
|
|
angular.element(".image-view").addClass("width-Img");
|
|
|
} else {
|
|
|
- angular.element(".viewModal").removeClass("height-Img");
|
|
|
angular.element(".image-view").removeClass("width-Img");
|
|
|
}
|
|
|
$scope.imgUrl = img[0].src;
|
|
|
@@ -97,11 +102,11 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', 'userSe
|
|
|
$scope.submit = function() {
|
|
|
var imgs = $(".images");
|
|
|
for (var i = 0, len = imgs.length; i < len; i++) {
|
|
|
- $scope.bundle.imgSources.push({ type: 1, source: imgs[i].firstElementChild.src });
|
|
|
+ $scope.bundle.assets.push({ assetType: 1, data: imgs[i].firstElementChild.src });
|
|
|
};
|
|
|
- $scope.bundle.descr = $(".descr")[0].textContent;
|
|
|
+ $scope.bundle.describe = $(".descr")[0].textContent;
|
|
|
if ($scope.mapPosition)
|
|
|
- $scope.bundle.mapPosition = { info: $scope.mapPosition.info, address: $scope.mapPosition.formattedAddress, position: $scope.mapPosition.position };
|
|
|
+ $scope.bundle.assets.push({ assetType: 0, data: { info: $scope.mapPosition.info, district: $scope.mapPosition.addressComponent.district, address: $scope.mapPosition.formattedAddress, position: $scope.mapPosition.position } });
|
|
|
console.log($scope.bundle);
|
|
|
|
|
|
$scope.submiting = true;
|
|
|
@@ -110,11 +115,10 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', 'userSe
|
|
|
$scope.successed = true;
|
|
|
}, 1000);
|
|
|
//messageService.submit($scope.bundle, "successCallback", "failsCallback");
|
|
|
- // $scope.bundle.uesrName = "";
|
|
|
- // $scope.bundle.uesrMobile = "";
|
|
|
- // $scope.bundle.descr = $(".descr")[0].textContent = "";
|
|
|
- // $scope.bundle.position = {};
|
|
|
- // $scope.bundle.imgSources = [];
|
|
|
+ // $scope.bundle.name = "";
|
|
|
+ // $scope.bundle.mobile = "";
|
|
|
+ // $scope.bundle.describe = $(".descr")[0].textContent = "";
|
|
|
+ // $scope.bundle.assets = [];
|
|
|
};
|
|
|
|
|
|
$scope.imgPreview = function(fileDom) {
|