ソースを参照

评价:前端添加订单数据传值,前端请求

wangdy 8 年 前
コミット
d9a413092a

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/rate/controller/RateController.java

@@ -227,7 +227,7 @@ public class RateController {
      * @param orderId
      * @return
      */
-    @RequestMapping(value = "/rateGoods/{orderId}", method = RequestMethod.GET)
+    @RequestMapping(value = "/rateGoodsByOrderId/{orderId}", method = RequestMethod.GET)
     public ResultMap getRateGoodsByOrderId(@PathVariable("orderId")String orderId){
         List<RateGoods> result = rateService.getRateGoodsByOrderId(orderId);
         return new ResultMap(CodeType.OK.code(), "查询成功",result);
@@ -237,7 +237,7 @@ public class RateController {
      * @param goodsId
      * @return
      */
-    @RequestMapping(value = "/rateGoods/{goodsId}", method = RequestMethod.GET)
+    @RequestMapping(value = "/rateGoodsByGoodsId/{goodsId}", method = RequestMethod.GET)
     public ResultMap getRateGoodsByGoodsId(@PathVariable("goodsId")Long goodsId){
         RateGoods result = rateService.getRateGoodsByGoodsId(goodsId);
         return new ResultMap(CodeType.OK.code(), "查询成功",result);

+ 72 - 0
src/main/webapp/resources/js/common/query/rate.js

@@ -0,0 +1,72 @@
+define([ 'ngResource' ], function() {
+    angular.module('rateServices', [ 'ngResource' ]).factory('Rate', ['$resource', function($resource) {
+        return $resource('rate/rateBuyer/:orderId', {}, {
+            //查询该订单的卖家评价买家
+            getRateBuyer : {
+                url : 'rate/rateBuyer/:orderId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价商品(根据goodsId)
+            getRateGoodsByGoodsId : {
+                url : 'rate/rateGoodsByGoodsId/:goodsId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价商品(根据订单id)
+            getRateGoodsByOrderId : {
+                url : 'rate/rateGoodsByOrderId/:orderId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价卖家
+            getRateVendor : {
+                url : 'rate/rateVendor/:orderId',
+                method : 'GET'
+            },
+            // 查询该企业下的所有模版信息
+            getRateTemplate : {
+                url : 'rate/rateTemplate/:storeuuid',
+                method : 'POST'
+            },
+
+            // 买家评价卖家店铺
+            saveRateVendor : {
+                url : 'rate/rateVendor/:orderId',
+                method : 'POST'
+            },
+            // 买家评价商品
+            saveRateGoods : {
+                url : 'rate/rateGoods/:orderId',
+                method : 'POST'
+            },
+            //买家追评评价商品
+            saveAfterRateGoods : {
+                url : 'rate/afterRateGoods/:orderId',
+                method : 'POST'
+            },
+            //卖家评价买家
+            saveRateBuyer : {
+                url : 'rate/rateBuyer/:purchaseId',
+                method : 'POST'
+            },
+            //卖家追评价买家
+            saveAfterRateBuyer : {
+                url : 'rate/afterRateBuyer/:purchaseId',
+                method : 'POST'
+            },
+            //保存或修改评价模版
+            saveRateTemplate : {
+                url : 'rate/rateTemplate/:storeuuid',
+                method : 'POST'
+            },
+            //卖家为商品评价添加回复(初评)
+            saveReply : {
+                url : 'rate/rateReply/:orderId',
+                method : 'POST'
+            },
+            //卖家为商品评价添加回复(追评)
+            saveAfterReply : {
+                url : 'rate/afterRateReply/:orderId',
+                method : 'POST'
+            }
+        });
+    }]);
+});

+ 2 - 2
src/main/webapp/resources/js/usercenter/app.js

@@ -1,7 +1,7 @@
 
-define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'common/services', 'common/directives','common/query/kind', 'common/query/brand', 'common/query/component', 'common/query/order', 'common/query/cart', 'common/query/goods', 'common/query/return' ,'angular-toaster', 'common/query/urlencryption', 'ui-jquery', 'common/query/bankTransfer', 'common/query/bankInfo', 'common/query/change', 'common/query/logistics', 'common/query/address' ,'angular-toaster','common/query/collection', 'common/query/proofing', 'common/query/bill', 'common/query/user','file-upload', 'file-upload-shim', 'common/query/bankInfo' , 'common/query/responseLogistics', 'common/query/payment', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/importDeclaration', 'common/query/enterprise', 'common/query/invoice', 'common/query/refund', 'common/query/recommendation', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/tradeMessageNotice', 'common/query/tradeBasicProperties', 'common/query/browsingHistory', 'common/query/internalMessage', 'common/module/chat_web_module', 'angular-filter'], function(angularAMD) {
+define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'common/services', 'common/directives','common/query/kind', 'common/query/brand', 'common/query/component', 'common/query/order', 'common/query/cart', 'common/query/goods', 'common/query/return' ,'angular-toaster', 'common/query/urlencryption', 'ui-jquery', 'common/query/bankTransfer', 'common/query/bankInfo', 'common/query/change','common/query/rate', 'common/query/logistics', 'common/query/address' ,'angular-toaster','common/query/collection', 'common/query/proofing', 'common/query/bill', 'common/query/user','file-upload', 'file-upload-shim', 'common/query/bankInfo' , 'common/query/responseLogistics', 'common/query/payment', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/importDeclaration', 'common/query/enterprise', 'common/query/invoice', 'common/query/refund', 'common/query/recommendation', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/tradeMessageNotice', 'common/query/tradeBasicProperties', 'common/query/browsingHistory', 'common/query/internalMessage', 'common/module/chat_web_module', 'angular-filter'], function(angularAMD) {
 	'use strict';
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'common.services', 'common.directives', 'tool.directives', 'common.query.kind', 'brandServices', 'componentServices', 'orderServices', 'cartServices', 'goodsServices', 'returnServices' , 'toaster', 'urlencryptionServices', 'ui.jquery', 'bankTransfer', 'bankInfo', 'changeServices', 'logisticsServices', 'addressServices', 'toaster','collection','proofingServices', 'billServices', 'common.query.user', 'angularFileUpload', 'bankInfo', 'responseLogisticsService', 'PaymentService', 'afterSaleService', 'messageBoardServices', 'table.directives', 'importDeclaration', 'common.query.enterprise', 'invoiceServices', 'refundModule', 'recommendation','logisticsPortService', 'storeInfoServices', 'tradeMessageNoticeModule', 'tradeBasicPropertiesServices', 'BrowsingHistory', 'internalMessageServices', 'WebChatModule', 'angular.filter']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'common.services', 'common.directives', 'tool.directives', 'common.query.kind', 'brandServices', 'componentServices', 'orderServices', 'cartServices', 'goodsServices', 'returnServices' , 'toaster', 'urlencryptionServices', 'ui.jquery', 'bankTransfer', 'bankInfo', 'changeServices', 'rateServices', 'logisticsServices', 'addressServices', 'toaster','collection','proofingServices', 'billServices', 'common.query.user', 'angularFileUpload', 'bankInfo', 'responseLogisticsService', 'PaymentService', 'afterSaleService', 'messageBoardServices', 'table.directives', 'importDeclaration', 'common.query.enterprise', 'invoiceServices', 'refundModule', 'recommendation','logisticsPortService', 'storeInfoServices', 'tradeMessageNoticeModule', 'tradeBasicPropertiesServices', 'BrowsingHistory', 'internalMessageServices', 'WebChatModule', 'angular.filter']);
 	app.init = function() {
 		angularAMD.bootstrap(app);
 	};

+ 19 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/first_rate_ctrl.js

@@ -1,6 +1,6 @@
 define(['app/app'], function(app) {
     'use strict';
-    app.register.controller('firstRateCtrl', ['$scope', '$rootScope', '$stateParams','$filter','Order', 'toaster', function ($scope, $rootScope, $stateParams , $filter , Order , toaster) {
+    app.register.controller('firstRateCtrl', ['$scope', '$rootScope', '$stateParams','$filter','Order', 'toaster', 'Rate', function ($scope, $rootScope, $stateParams , $filter , Order , toaster , Rate) {
 
         if ($stateParams.orderid && $stateParams.orderid != '') {
             $scope.orderid = $stateParams.orderid;
@@ -15,6 +15,24 @@ define(['app/app'], function(app) {
                 $scope.order = data[0];
             });
         }
+        /**
+         * 获取买家评价店铺的信息
+         */
+
+        $scope.saveRateGoods = function () {
+            Rate.saveRateGoods({orderId : $scope.order.orderid},{}, function (data) {
+                if(data.length != 1) {
+                    toaster.pop('warning', '获取订单信息失败');
+                    return ;
+                }
+
+                console.log("$scope.order", $scope.order);
+            }, function() {
+                toaster.pop('warning', '评价失败。');
+            });
+        };
+
+
     }]);
 });