Selaa lähdekoodia

始宁农业管理后台:商品编辑

panyong 1 vuosi sitten
vanhempi
commit
59c3e66521

+ 0 - 14
htmldev/shiningManage/src/store/modules/common.js

@@ -122,20 +122,6 @@ const state = {
     }
   ],
   arrVideoType: [],
-  arrProductUnit: [
-    {
-      name: '件',
-      value: '1'
-    },
-    {
-      name: '只',
-      value: '2'
-    },
-    {
-      name: '个',
-      value: '3'
-    }
-  ],
   arrShopType: [
     {
       name: '大户',

+ 13 - 4
htmldev/shiningManage/src/views/productManage/products/details.vue

@@ -147,7 +147,7 @@
             <el-option
               :label="item.name"
               :value="item.name"
-              v-for="item in arrProductUnit"
+              v-for="item in productUnitList"
               :key="item.value"></el-option>
           </el-select>
         </el-form-item>
@@ -307,9 +307,6 @@ export default {
     arrBrandList() {
       return this.$store.state.common.arrBrandList
     },
-    arrProductUnit() {
-      return this.$store.state.common.arrProductUnit
-    },
     myPickerOptions() {
       const temp = this.exData.id && this.exData.product_sale_at > 0 ? this.exData.product_sale_at * 1000 : Date.now()
       return {
@@ -317,6 +314,18 @@ export default {
           return time.getTime() < temp - 8.64e7
         }
       }
+    },
+    productUnitList() {
+      const temp = this.$store.state.common.objSystemConfig
+      if (Object.prototype.toString.call(temp) === '[object Object]' && Array.isArray(temp.product_unit_list)) {
+        return temp.product_unit_list.map((item, index) => {
+          return {
+            name: item,
+            value: index
+          }
+        })
+      }
+      return []
     }
   },
   methods: {

+ 1 - 0
htmldev/shiningManage/src/views/productManage/products/index.vue

@@ -222,6 +222,7 @@ export default {
       this.$store.dispatch('common/setBrandlist')
     }
     this.init()
+    this.$store.dispatch('common/fetchSystemConfig')
   }
 }
 </script>

+ 7 - 0
htmldev/shiningManage/vue.config.js

@@ -54,6 +54,13 @@ module.exports = {
           '^/api/upload': '/api/upload'
         }
       },
+      '/api/system': {
+        target: 'http://shining-admin.codedreamit.com',
+        changeOrigin: true,
+        pathRewrite: {
+          '^/api/system': '/api/system'
+        }
+      },
       '/api/shop': {
         target: 'https://shining.codedreamit.com',
         changeOrigin: true,