Browse Source

添加反馈和搜索功能

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1327 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
luoq 11 years ago
parent
commit
98f2e96231

+ 33 - 1
src/main/webapp/resources/js/serve/app.js

@@ -148,11 +148,43 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
 	app.controller('IndexCtrl', ['$scope', function($scope){
 	app.controller('IndexCtrl', ['$scope', function($scope){
 		
 		
 	}]);
 	}]);
-	app.controller('ContactCtrl', ['$scope', 'toaster', function($scope, toaster){
+	app.controller('ContactCtrl', ['$scope', 'toaster', 'AuthenticationService', 'FeedBackService', function($scope, toaster, AuthenticationService, FeedBackService){
 		$scope.connect = function(type) {
 		$scope.connect = function(type) {
 			toaster.pop('warning', '连接失败', '高峰期建议选择自助服务或问题反馈');
 			toaster.pop('warning', '连接失败', '高峰期建议选择自助服务或问题反馈');
 		};
 		};
+		
+		$scope.question = {
+			classId: 1,
+			isPublic: 1,
+			title:''
+		}
+		//提交反馈
+		$scope.submit = function(){	
+			AuthenticationService.getAuthentication().success(function(data){
+				$scope.user = data;
+				if(!$scope.user){
+					$scope.userUU = null;
+				}else{
+					$scope.userUU = $scope.user.userUU;
+				}
+				FeedBackService.feedBackQuestion({classId: $scope.question.classId, isPublic: $scope.question.isPublic, title: $scope.question.title, userUU: $scope.userUU}, {}, 
+						function(data){
+							toaster.pop('success', '成功', '您的问题反馈成功!');
+							$scope.reset();
+				}, function(response){
+					toaster.pop('error', '错误', response.data);
+				});
+			});
+		};
+		
+		//重置
+		$scope.reset = function(){
+			$scope.question.classId = 1;
+			$scope.question.isPublic = 1;
+			$scope.question.title = '';
+		}
 	}]);
 	}]);
+	
 	app.controller('GuideCtrl', ['$scope', '$stateParams', 'Guide', function($scope, $stateParams, Guide) {
 	app.controller('GuideCtrl', ['$scope', '$stateParams', 'Guide', function($scope, $stateParams, Guide) {
 		Guide.get($stateParams.id).then(function(data){
 		Guide.get($stateParams.id).then(function(data){
 			$scope.slides = data;
 			$scope.slides = data;

+ 82 - 1
src/main/webapp/resources/tpl/serve/contact.html

@@ -1,3 +1,26 @@
+<style>
+	option{
+		height: 30px;
+		padding-top:4px;
+		cursor: pointer;
+		border-bottom: 1px solid #CCC;
+	}
+	.search{
+		border-collapse: separate;
+    	display: table;
+    	width:400px;
+    	margin-left: 50px;
+	}
+	.opration{
+		margin-top:80px;
+		font-size:14px;
+	}
+	.tips{
+		padding-left: 52px;
+		margin-bottom: 10px;
+	}
+</style>
+
 <div class="block contact-container">
 <div class="block contact-container">
 	<tabset justified="true"> <tab heading="客服热线"
 	<tabset justified="true"> <tab heading="客服热线"
 		ng-mouseover="select()">
 		ng-mouseover="select()">
@@ -89,6 +112,64 @@
 		</ul>
 		</ul>
 	</div>
 	</div>
 	</tab> <tab heading="问题反馈" ng-mouseover="select()">
 	</tab> <tab heading="问题反馈" ng-mouseover="select()">
-	<div class="inner"></div>
+		<div class="inner">
+			<div class="row">
+				<div class="col-md-6 opration">
+					<br><br><br>
+					<div class="tips">
+						<span>
+							<i class="fa fa-hand-o-right"></i>&nbsp;&nbsp;建议反馈问题前先搜索一下您的问题
+						</span>
+					</div>
+					<form name="searchForm">
+						<div class="search">
+		      				<input type="text" class="form-control" ng-model="keywords" required placeholder="输入您的问题...">
+		      				<span class="input-group-btn">
+		        				<a ui-sref="question.search({question: keywords})" ng-disabled="searchForm.$invalid" class="btn btn-default" type="button"><i class="fa fa-search"></i>&nbsp;搜索</a>
+		      				</span>
+		    			</div>
+    				</form>
+				</div>
+				<div class="col-md-6 opration" style="border-left: 1px solid #CCC; ">
+					<form class="form-inline" name="feedbackForm">
+						<div class="form-group" style="padding-left:60px; ">
+							<label>问题类型:</label>
+							<select  ng-model="question.classId" class="form-control" style="width:200px; ">
+							  <option value="1">用户账户</option>
+							  <option value="2">采购单</option>
+							  <option value="3">销售单</option>
+							  <option value="4">验收单</option>
+							  <option value="5">退货单</option>
+							  <option value="0">其他</option>
+							</select>
+							<span style="margin-left: 40px; ">
+												<label>公开:</label>
+								<label class="radio-inline">
+									<input type="radio" name="isPublic" ng-model="question.isPublic" value="1" checked="checked">是			
+								</label>
+								<label class="radio-inline">
+									<input type="radio" name="isPublic" ng-model="question.isPublic" value="0">否
+								</label>
+							</span>
+						</div>
+						<br>
+						<div class="form-group" style="padding-left:60px; margin-top:20px; ">
+							<table>
+								<tr>
+									<td align="left" valign="top"><label>问题描述:&nbsp;</label></td>
+									<td><textarea ng-model="question.title" class="form-control" rows="5" style="width: 375px;" required></textarea></td>
+								</tr>
+							</table>
+						</div>
+						<br><br>
+						<div style="padding-left:135px; ">
+							<button class="btn btn-primary" ng-click="submit()" style="width:170px;" ng-disabled="feedbackForm.$invalid">提&nbsp;&nbsp;交</button>
+							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+							<button class="btn btn-warning" ng-click="reset()" style="width:170px;">重&nbsp;&nbsp;置</button>
+						</div>
+					</form>
+				</div>
+			</div>
+		</div>
 	</tab></tabset>
 	</tab></tabset>
 </div>
 </div>