Quellcode durchsuchen

B2B物料图片显示及修改

dongbw vor 8 Jahren
Ursprung
Commit
a0619f578e
1 geänderte Dateien mit 14 neuen und 18 gelöschten Zeilen
  1. 14 18
      src/main/webapp/resources/js/index/app.js

+ 14 - 18
src/main/webapp/resources/js/index/app.js

@@ -13837,11 +13837,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.editstatus = false;
         var loadData = function () {
             GetProductInfo.getSaleProduct({id: $stateParams.id}, function (data) {
-                if (data.attach) {
-                    GetProductInfo.getAttach({id: data.attach.id}, function (data) {
-                        $scope.imgPreview = data.url;
-                        $scope.previewShow = true;
-                    });
+                if (data.attachment) {
+                    $scope.imgPreview = data.attachment;
+                    $scope.previewShow = true;
                 }
                 $scope.prodInfo = data;
                 if ($scope.prodInfo.isbusiness == 0) {
@@ -13993,7 +13991,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 删除
         $scope.clearfile = function () {
-            $scope.prodInfo.attach = null;
+            $scope.prodInfo.attachment = null;
             $scope.myFiles = null;
             $scope.previewShow = false;
         }
@@ -14093,18 +14091,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 查看范例
         $scope.showImg = function () {
-            if ($scope.prodInfo.attach) {
-                GetProductInfo.getAttach({id: $scope.prodInfo.attach.id}, function (data) {
-                    $scope.imgPreview = data.url;
-                    var src = data.url, box = $('#image-box');
-                    box.show();
-                    box.find('img').attr('src', src);
-                    box.find('a').click(function () {
-                        box.hide();
-                    });
-                    box.dblclick(function () {
-                        box.hide();
-                    });
+            if ($scope.prodInfo.attachment) {
+                $scope.imgPreview = $scope.prodInfo.attachment;
+                var src = $scope.prodInfo.attachment, box = $('#image-box');
+                box.show();
+                box.find('img').attr('src', src);
+                box.find('a').click(function () {
+                    box.hide();
+                });
+                box.dblclick(function () {
+                    box.hide();
                 });
                 $scope.previewShow = true;
             } else if (imgurl != null) {