Sfoglia il codice sorgente

生成商品规格改成前端生成,开启Gzip 压缩打包

hzj18279462576@163.com 3 mesi fa
parent
commit
eeee47640e

+ 148 - 148
build/webpack.prod.conf.js

@@ -1,148 +1,148 @@
-'use strict'
-const path = require('path')
-const utils = require('./utils')
-const webpack = require('webpack')
-const config = require('../config')
-const merge = require('webpack-merge')
-const baseWebpackConfig = require('./webpack.base.conf')
-const CopyWebpackPlugin = require('copy-webpack-plugin')
-const HtmlWebpackPlugin = require('html-webpack-plugin')
-const ExtractTextPlugin = require('extract-text-webpack-plugin')
-const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
-
-const env = process.env.NODE_ENV === 'testing'
-  ? require('../config/test.env')
-  : require('../config/prod.env')
-
-const webpackConfig = merge(baseWebpackConfig, {
-  module: {
-    rules: utils.styleLoaders({
-      sourceMap: config.build.productionSourceMap,
-      extract: true,
-      usePostCSS: true
-    })
-  },
-  devtool: config.build.productionSourceMap ? config.build.devtool : false,
-  output: {
-    path: config.build.assetsRoot,
-    filename: utils.assetsPath('js/[name].js'),
-    chunkFilename: utils.assetsPath('js/[id].js')
-  },
-  plugins: [
-    // http://vuejs.github.io/vue-loader/en/workflow/production.html
-    new webpack.DefinePlugin({
-      'process.env': env
-    }),
-    new UglifyJsPlugin({
-      uglifyOptions: {
-        compress: {
-          warnings: false
-        }
-      },
-      sourceMap: config.build.productionSourceMap,
-      parallel: true
-    }),
-    // extract css into its own file
-    new ExtractTextPlugin({
-      filename: utils.assetsPath('css/[name].css'),
-      // set the following option to `true` if you want to extract CSS from
-      // codesplit chunks into this main css file as well.
-      // This will result in *all* of your app's CSS being loaded upfront.
-      allChunks: false,
-    }),
-    // Compress extracted CSS. We are using this plugin so that possible
-    // duplicated CSS from different components can be deduped.
-    new OptimizeCSSPlugin({
-      cssProcessorOptions: config.build.productionSourceMap
-        ? { safe: true, map: { inline: false } }
-        : { safe: true }
-    }),
-    // generate dist index.html with correct asset hash for caching.
-    // you can customize output by editing /index.html
-    // see https://github.com/ampedandwired/html-webpack-plugin
-    new HtmlWebpackPlugin({
-      filename: process.env.NODE_ENV === 'testing'
-        ? 'index.html'
-        : config.build.index,
-      template: 'index.html',
-      inject: false,
-      minify: {
-        removeComments: true,
-        collapseWhitespace: true,
-        removeAttributeQuotes: true
-        // more options:
-        // https://github.com/kangax/html-minifier#options-quick-reference
-      },
-      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
-      chunksSortMode: 'dependency'
-    }),
-    // keep module.id stable when vender modules does not change
-    new webpack.HashedModuleIdsPlugin(),
-    // enable scope hoisting
-    new webpack.optimize.ModuleConcatenationPlugin(),
-    // split vendor js into its own file
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'vendor',
-      minChunks (module) {
-        // any required modules inside node_modules are extracted to vendor
-        return (
-          module.resource &&
-          /\.js$/.test(module.resource) &&
-          module.resource.indexOf(
-            path.join(__dirname, '../node_modules')
-          ) === 0
-        )
-      }
-    }),
-    // extract webpack runtime and module manifest to its own file in order to
-    // prevent vendor hash from being updated whenever app bundle is updated
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'manifest',
-      minChunks: Infinity
-    }),
-    // This instance extracts shared chunks from code splitted chunks and bundles them
-    // in a separate chunk, similar to the vendor chunk
-    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'app',
-      async: 'vendor-async',
-      children: true,
-      minChunks: 3
-    }),
-
-    // copy custom static assets
-    new CopyWebpackPlugin([
-      {
-        from: path.resolve(__dirname, '../static'),
-        to: config.build.assetsSubDirectory,
-        ignore: ['.*']
-      }
-    ])
-  ]
-})
-
-if (config.build.productionGzip) {
-  const CompressionWebpackPlugin = require('compression-webpack-plugin')
-
-  webpackConfig.plugins.push(
-    new CompressionWebpackPlugin({
-      asset: '[path].gz[query]',
-      algorithm: 'gzip',
-      test: new RegExp(
-        '\\.(' +
-        config.build.productionGzipExtensions.join('|') +
-        ')$'
-      ),
-      threshold: 10240,
-      minRatio: 0.8
-    })
-  )
-}
-
-if (config.build.bundleAnalyzerReport) {
-  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
-  webpackConfig.plugins.push(new BundleAnalyzerPlugin({ analyzerMode: 'static' }))
-}
-
-module.exports = webpackConfig
+"use strict";
+const path = require("path");
+const utils = require("./utils");
+const webpack = require("webpack");
+const config = require("../config");
+const merge = require("webpack-merge");
+const baseWebpackConfig = require("./webpack.base.conf");
+const CopyWebpackPlugin = require("copy-webpack-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const ExtractTextPlugin = require("extract-text-webpack-plugin");
+const OptimizeCSSPlugin = require("optimize-css-assets-webpack-plugin");
+const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
+
+const env =
+  process.env.NODE_ENV === "testing"
+    ? require("../config/test.env")
+    : require("../config/prod.env");
+
+const webpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({
+      sourceMap: config.build.productionSourceMap,
+      extract: true,
+      usePostCSS: true
+    })
+  },
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
+  output: {
+    path: config.build.assetsRoot,
+    filename: utils.assetsPath("js/[name].js"),
+    chunkFilename: utils.assetsPath("js/[id].js")
+  },
+  plugins: [
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
+    new webpack.DefinePlugin({
+      "process.env": env
+    }),
+    new UglifyJsPlugin({
+      uglifyOptions: {
+        compress: {
+          warnings: false
+        }
+      },
+      sourceMap: config.build.productionSourceMap,
+      parallel: true
+    }),
+    // extract css into its own file
+    new ExtractTextPlugin({
+      filename: utils.assetsPath("css/[name].css"),
+      // set the following option to `true` if you want to extract CSS from
+      // codesplit chunks into this main css file as well.
+      // This will result in *all* of your app's CSS being loaded upfront.
+      allChunks: false
+    }),
+    // Compress extracted CSS. We are using this plugin so that possible
+    // duplicated CSS from different components can be deduped.
+    new OptimizeCSSPlugin({
+      cssProcessorOptions: config.build.productionSourceMap
+        ? { safe: true, map: { inline: false } }
+        : { safe: true }
+    }),
+    // generate dist index.html with correct asset hash for caching.
+    // you can customize output by editing /index.html
+    // see https://github.com/ampedandwired/html-webpack-plugin
+    new HtmlWebpackPlugin({
+      filename:
+        process.env.NODE_ENV === "testing" ? "index.html" : config.build.index,
+      template: "index.html",
+      inject: false,
+      minify: {
+        removeComments: true,
+        collapseWhitespace: true,
+        removeAttributeQuotes: true
+        // more options:
+        // https://github.com/kangax/html-minifier#options-quick-reference
+      },
+      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
+      chunksSortMode: "dependency"
+    }),
+    // keep module.id stable when vender modules does not change
+    new webpack.HashedModuleIdsPlugin(),
+    // enable scope hoisting
+    new webpack.optimize.ModuleConcatenationPlugin(),
+    // split vendor js into its own file
+    new webpack.optimize.CommonsChunkPlugin({
+      name: "vendor",
+      minChunks(module) {
+        // any required modules inside node_modules are extracted to vendor
+        return (
+          module.resource &&
+          /\.js$/.test(module.resource) &&
+          module.resource.indexOf(path.join(__dirname, "../node_modules")) === 0
+        );
+      }
+    }),
+    // extract webpack runtime and module manifest to its own file in order to
+    // prevent vendor hash from being updated whenever app bundle is updated
+    new webpack.optimize.CommonsChunkPlugin({
+      name: "manifest",
+      minChunks: Infinity
+    }),
+    // This instance extracts shared chunks from code splitted chunks and bundles them
+    // in a separate chunk, similar to the vendor chunk
+    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
+    new webpack.optimize.CommonsChunkPlugin({
+      name: "app",
+      async: "vendor-async",
+      children: true,
+      minChunks: 3
+    }),
+
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, "../static"),
+        to: config.build.assetsSubDirectory,
+        ignore: [".*"]
+      }
+    ]),
+  ]
+});
+
+if (config.build.productionGzip) {
+  const CompressionWebpackPlugin = require("compression-webpack-plugin");
+
+  webpackConfig.plugins.push(
+    new CompressionWebpackPlugin({
+      asset: "[path].gz[query]",
+      algorithm: "gzip",
+      test: new RegExp(
+        "\\.(" + config.build.productionGzipExtensions.join("|") + ")$"
+      ),
+      threshold: 10240,
+      minRatio: 0.8,
+      deleteOriginalAssets: false
+    })
+  );
+}
+
+if (config.build.bundleAnalyzerReport) {
+  const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
+    .BundleAnalyzerPlugin;
+  webpackConfig.plugins.push(
+    new BundleAnalyzerPlugin({ analyzerMode: "static" })
+  );
+}
+
+module.exports = webpackConfig;

+ 4 - 3
config/index.js

@@ -1,6 +1,7 @@
 "use strict";
 // Template version: 1.2.5
 // see http://vuejs-templates.github.io/webpack for documentation.
+const CompressionWebpackPlugin = require("compression-webpack-plugin");
 
 const path = require("path");
 const devEnv = require("./dev.env");
@@ -32,7 +33,7 @@ module.exports = {
 
               // target: "https://mxys.meiyishuo.cn/sqx_fast/", // 新部署地址
               // target: "https://mxys.chuanghai-tech.com/sqx_fast/", // 线上
-               target: 'https://mxys.chuanghai-tech.com/wm-test/wm-api',// 测试
+              target: "https://mxys.chuanghai-tech.com/wm-test/wm-api", // 测试
 
               // target: 'http://iyfpk3.natappfree.cc/sqx_fast',// 开发
               changeOrigin: true,
@@ -99,13 +100,13 @@ module.exports = {
     // Surge or Netlify already gzip all static assets for you.
     // Before setting to `true`, make sure to:
     // npm install --save-dev compression-webpack-plugin
-    productionGzip: false,
+    productionGzip: true,
     productionGzipExtensions: ["js", "css"],
 
     // Run the build command with an extra argument to
     // View the bundle analyzer report after build finishes:
     // `npm run build --report`
     // Set to `true` or `false` to always turn it on or off
-    bundleAnalyzerReport: process.env.npm_config_report
+    bundleAnalyzerReport: process.env.npm_config_report,
   }
 };

+ 19 - 0
npm-shrinkwrap.json

@@ -2834,6 +2834,19 @@
 				}
 			}
 		},
+		"compression-webpack-plugin": {
+			"version": "1.1.12",
+			"resolved": "https://registry.npmmirror.com/compression-webpack-plugin/-/compression-webpack-plugin-1.1.12.tgz",
+			"integrity": "sha512-UpBXSHbrCSdSZieAffqXlAQpLO2fikVVRYibrWlbHYzKpOw1Y4jwkVZ/+S91GzWuJvXSbc8SBy/e8fQJh8uEMQ==",
+			"dev": true,
+			"requires": {
+				"cacache": "^10.0.1",
+				"find-cache-dir": "^1.0.0",
+				"neo-async": "^2.5.0",
+				"serialize-javascript": "^1.4.0",
+				"webpack-sources": "^1.0.1"
+			}
+		},
 		"concat-map": {
 			"version": "0.0.1",
 			"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -16328,6 +16341,12 @@
 			"resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz",
 			"integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw="
 		},
+		"serialize-javascript": {
+			"version": "1.9.1",
+			"resolved": "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz",
+			"integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==",
+			"dev": true
+		},
 		"serve-index": {
 			"version": "1.9.1",
 			"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",

+ 1 - 0
package.json

@@ -56,6 +56,7 @@
     "babel-register": "6.22.0",
     "chalk": "2.3.0",
     "chromedriver": "2.27.2",
+    "compression-webpack-plugin": "^1.1.12",
     "copy-webpack-plugin": "4.0.1",
     "cross-spawn": "5.0.1",
     "css-loader": "0.28.0",

+ 1 - 1
src/router/index.js

@@ -204,7 +204,7 @@ const mainRoutes = {
       path: "/poorStudent",
       component: _import("coupon/poorStudent"),
       name: "poorStudent",
-      meta: { title: "贫困生管理", isTab: true }
+      meta: { title: "会员兑换管理", isTab: true }
     },
     {
       path: "/promotion",

File diff suppressed because it is too large
+ 10 - 4
src/utils/httpRequest.js


+ 2 - 2
src/views/modules/sys/menu-add-or-update.vue

@@ -14,10 +14,10 @@
       </el-form-item>
       <el-form-item label="上级菜单" prop="parentName">
         <el-popover
-          ref="menuListPopover"
+          v-model="visible"
           popper-class="menu-add-update"
           placement="left-start"
-          trigger="click">
+           trigger="manual">
           <el-tree
             :data="menuList"
             :props="menuListTreeProps"

+ 95 - 32
src/views/selfShop/shopAmend.vue

@@ -587,7 +587,7 @@
             :on-success="handleUploadSuccessXq"
             :on-progress="onprogress1"
             :before-upload="beforeAvatarUpload"
-              :headers="{ token: token }"
+            :headers="{ token: token }"
           >
             <el-progress
               v-if="percentage1 > 0 && percentage1 < 100"
@@ -837,7 +837,7 @@ export default {
           // 'coverImg': this.goodsCover,
         })
       }).then(({ data }) => {
-        console.log(data," 获取单规格的sku");
+        console.log(data, " 获取单规格的sku");
 
         let returnData = data.data;
         this.valueData2 = returnData.value;
@@ -860,7 +860,7 @@ export default {
           goodsId: goodsId
         })
       }).then(({ data }) => {
-        console.log(data,'回显规格');
+        console.log(data, "回显规格");
 
         let returnData = data.data;
         this.valueData2 = returnData.value;
@@ -916,7 +916,7 @@ export default {
           goodsId: goodsId
         })
       }).then(({ data }) => {
-        console.log(data,"init接口");
+        console.log(data, "init接口");
 
         let returnData = data.data;
         if (returnData.goodsPicture) {
@@ -1235,7 +1235,7 @@ export default {
 
     // 商品规格
     specifSelect() {
-      console.log(this.shopId,"商品规格请求参数");
+      console.log(this.shopId, "商品规格请求参数");
 
       this.$http({
         url: this.$http.adornUrl("selfGoodsRule/list"),
@@ -1244,7 +1244,7 @@ export default {
           shopId: this.shopId
         })
       }).then(({ data }) => {
-        console.log(data,"商品规格");
+        console.log(data, "商品规格");
 
         let returnData = data.data;
         this.specifdata = returnData;
@@ -1291,7 +1291,7 @@ export default {
           id: val
         })
       }).then(({ data }) => {
-        console.log(data,"切换商品规格");
+        console.log(data, "切换商品规格");
 
         let returnData = data.data;
         this.ruleValue = returnData.ruleValue;
@@ -1404,6 +1404,7 @@ export default {
         attrValue: this.ruleValue,
         ruleId: this.ruleId
       });
+      // console.log(this.attr, "attr");
       if (this.originalMoney == "") {
         this.originalMoney = "0";
       }
@@ -1421,32 +1422,94 @@ export default {
         axx = [];
       }
       console.log(axx, "khg");
-      this.$http({
-        url: this.$http.adornUrl(
-          // `admin/goods/isFormatAttr?coverImg=${this.goodsCover}&originalPrice=${this.originalMoney}&price=${this.goodsMoney}`
-          `admin/goods/isFormatAttr` //?originalPrice=${this.originalMoney}&price=${this.goodsMoney}
-        ),
-        method: "post",
-        params: this.$http.adornParams({
-          originalPrice: this.originalMoney,
-          price: this.goodsMoney
-        }),
-        data: this.$http.adornData({
-          attrName: this.attr[0].attrName,
-          attrValue: axx,
-          ruleId: this.attr[0].ruleId
-        })
-      }).then(({ data }) => {
-        console.log(data, "l2");
-        let returnData = data.data;
-        this.headerData = returnData.header;
-        this.valueData = returnData.value;
-        this.valueshow = true;
-        this.valueshow1 = false;
-        this.sku = returnData.value;
-        this.detailJson = returnData.value[0].detailJson.split(",");
-      });
+      {
+        let returnData = {
+          data: {
+            header: [],
+            value: []
+          }
+        };
+        let header = [];
+        let header2 = ["图片", "原价", "售价", "操作"];
+        axx.forEach((i, ind) => {
+          header.push(i.value);
+        });
+        returnData.data.header = header.concat(header2);
+
+        // 4. 笛卡尔积生成函数(核心:生成所有规格组合)
+        const cartesian = (...arrays) => {
+          return arrays.reduce(
+            (a, b) => a.flatMap(d => b.map(e => [...d, e])),
+            [[]]
+          );
+        };
+        console.log(cartesian(axx), "笛卡尔积生成函数");
+
+        // 5. 生成目标格式数据的核心方法
+        const generateValueData = () => {
+          // 步骤1:把每个规格的detail拆分成数组
+          const specOptions = axx.map(item => item.detail.split(","));
+
+          // 步骤2:生成笛卡尔积(所有组合)
+          const combinations = cartesian(...specOptions);
+
+          // 步骤3:映射为目标格式
+          returnData.data.value = combinations.map(combo => {
+            // 拼接detailJson/json(逗号分隔的组合)
+            const detailJson = combo.join(",");
+            // 构建value0/value1/valueN... 字段
+            const valueObj = {};
+            combo.forEach((val, index) => {
+              valueObj[`value${index}`] = val;
+            });
+
+            return {
+              detailJson: detailJson,
+              json: detailJson, // json和detailJson值一致
+              skuImg: "", // 图片默认空
+              skuOriginalPrice: this.originalMoney, // 原价
+              skuPrice: this.goodsMoney, // 售价
+              ...valueObj // 展开value0/value1/...
+            };
+          });
+          console.log(returnData, "returnData");
+          this.headerData = returnData.data.header;
+          this.valueData = returnData.data.value;
+          this.valueshow = true;
+          this.valueshow1 = false;
+          this.sku = returnData.data.value;
+          this.detailJson = returnData.data.value[0].detailJson.split(",");
+        };
+        generateValueData();
+      }
+
+      // this.$http({
+      //   url: this.$http.adornUrl(
+      //     // `admin/goods/isFormatAttr?coverImg=${this.goodsCover}&originalPrice=${this.originalMoney}&price=${this.goodsMoney}`
+      //     `admin/goods/isFormatAttr` //?originalPrice=${this.originalMoney}&price=${this.goodsMoney}
+      //   ),
+      //   method: "post",
+      //   params: this.$http.adornParams({
+      //     originalPrice: this.originalMoney,
+      //     price: this.goodsMoney
+      //   }),
+      //   data: this.$http.adornData({
+      //     attrName: this.attr[0].attrName,
+      //     attrValue: axx,
+      //     ruleId: this.attr[0].ruleId
+      //   })
+      // }).then(({ data }) => {
+      //   console.log(data, "l2");
+      //   let returnData = data.data;
+      //   this.headerData = returnData.header;
+      //   this.valueData = returnData.value;
+      //   this.valueshow = true;
+      //   this.valueshow1 = false;
+      //   this.sku = returnData.value;
+      //   this.detailJson = returnData.value[0].detailJson.split(",");
+      // });
     },
+
     // 获取品牌
     brandSelect() {
       let page = this.page - 1;

+ 87 - 25
src/views/selfShop/shopPublish.vue

@@ -1576,31 +1576,93 @@ export default {
       } else {
         axx = [];
       }
-      this.$http({
-        url: this.$http.adornUrl(
-          // `admin/goods/isFormatAttr?coverImg=${this.goodsCover}&originalPrice=${this.originalMoney}&price=${this.goodsMoney}`
-          `admin/goods/isFormatAttr`
-        ),
-        method: "post",
-        params: this.$http.adornParams({
-          originalPrice: this.originalMoney,
-          price: this.goodsMoney
-        }),
-        data: this.$http.adornData({
-          attrName: this.attr[0].attrName,
-          attrValue: axx,
-          ruleId: this.attr[0].ruleId
-        })
-      }).then(({ data }) => {
-        console.log(data, "ppp");
-        let returnData = data.data;
-        this.headerData = returnData.header;
-        this.valueData = returnData.value;
-        this.propshow = true;
-        this.propshow1 = false;
-        this.sku = returnData.value;
-        this.detailJson = returnData.value[0].detailJson.split(",");
-      });
+      console.log(axx, "khg");
+      {
+        let returnData = {
+          data: {
+            header: [],
+            value: []
+          }
+        };
+        let header = [];
+        let header2 = ["图片", "原价", "售价", "操作"];
+        axx.forEach((i, ind) => {
+          header.push(i.value);
+        });
+        returnData.data.header = header.concat(header2);
+
+        // 4. 笛卡尔积生成函数(核心:生成所有规格组合)
+        const cartesian = (...arrays) => {
+          return arrays.reduce(
+            (a, b) => a.flatMap(d => b.map(e => [...d, e])),
+            [[]]
+          );
+        };
+        console.log(cartesian(axx), "笛卡尔积生成函数");
+
+        // 5. 生成目标格式数据的核心方法
+        const generateValueData = () => {
+          // 步骤1:把每个规格的detail拆分成数组
+          const specOptions = axx.map(item => item.detail.split(","));
+
+          // 步骤2:生成笛卡尔积(所有组合)
+          const combinations = cartesian(...specOptions);
+
+          // 步骤3:映射为目标格式
+          returnData.data.value = combinations.map(combo => {
+            // 拼接detailJson/json(逗号分隔的组合)
+            const detailJson = combo.join(",");
+            // 构建value0/value1/valueN... 字段
+            const valueObj = {};
+            combo.forEach((val, index) => {
+              valueObj[`value${index}`] = val;
+            });
+
+            return {
+              detailJson: detailJson,
+              json: detailJson, // json和detailJson值一致
+              skuImg: "", // 图片默认空
+              skuOriginalPrice: this.originalMoney, // 原价
+              skuPrice: this.goodsMoney, // 售价
+              ...valueObj // 展开value0/value1/...
+            };
+          });
+          console.log(returnData, "returnData");
+          this.headerData = returnData.data.header;
+          this.valueData = returnData.data.value;
+          this.valueshow = true;
+          this.valueshow1 = false;
+          this.sku = returnData.data.value;
+          this.detailJson = returnData.data.value[0].detailJson.split(",");
+        };
+        generateValueData();
+      }
+
+      // this.$http({
+      //   url: this.$http.adornUrl(
+      //     // `admin/goods/isFormatAttr?coverImg=${this.goodsCover}&originalPrice=${this.originalMoney}&price=${this.goodsMoney}`
+      //     `admin/goods/isFormatAttr`
+      //   ),
+      //   method: "post",
+      //   params: this.$http.adornParams({
+      //     originalPrice: this.originalMoney,
+      //     price: this.goodsMoney
+      //   }),
+      //   data: this.$http.adornData({
+      //     attrName: this.attr[0].attrName,
+      //     attrValue: axx,
+      //     ruleId: this.attr[0].ruleId
+      //   })
+      // }).then(({ data }) => {
+      //   console.log(data, "ppp");
+      //   let returnData = data.data;
+      //   this.headerData = returnData.header;
+      //   this.valueData = returnData.value;
+      //   this.propshow = true;
+      //   this.propshow1 = false;
+      //   this.sku = returnData.value;
+      //   this.detailJson = returnData.value[0].detailJson.split(",");
+      // });
     },
     // 删除详情图
     clearXq(index) {