ソースを参照

默认值设置

xialei 1 年間 前
コミット
9a4d52e2a5
共有2 個のファイルを変更した9 個の追加7 個の削除を含む
  1. 2 2
      src/api/setting.js
  2. 7 5
      src/views/product/addProduct/index.vue

+ 2 - 2
src/api/setting.js

@@ -111,8 +111,8 @@ export function storeUpdateApi(data) {
111 111
  * @description 获取商户分润比例
112 112
  * @param {Object} param params {Object} 传值参数
113 113
  */
114
-export function getMerchantProfitApi() {
115
-  return request.get(`getConfig/shop_bonus_setting`)
114
+export function getMerchantProfitApi() {  
115
+  return request.get(`getConfig/base_commission`)
116 116
 }
117 117
 
118 118
 /**

+ 7 - 5
src/views/product/addProduct/index.vue

@@ -702,6 +702,7 @@ export default {
702 702
   components: { ueditorFrom },
703 703
   data() {
704 704
     return {
705
+      base_commission: '',
705 706
       merchant_type: '',
706 707
       optionsCate: {
707 708
         value: 'store_category_id',
@@ -842,6 +843,7 @@ export default {
842 843
     }
843 844
   },
844 845
   created() {
846
+    this.getMerchantProfit()
845 847
     this.merchant_type = localStorage.getItem('merchant_type')
846 848
     console.log(this.merchant_type)
847 849
     this.tempRoute = Object.assign({}, this.$route)
@@ -873,7 +875,6 @@ export default {
873 875
     this.getBrandListApi()
874 876
     this.getShippingList()
875 877
     this.productCon()
876
-    this.getMerchantProfit()
877 878
   },
878 879
   methods: {
879 880
     handleInput(value, title) {
@@ -894,7 +895,7 @@ export default {
894 895
     // 获取商户分润比例
895 896
     getMerchantProfit() {
896 897
       getMerchantProfitApi().then(res => {
897
-
898
+        this.base_commission = res.message;
898 899
       }).catch(err => {
899 900
         this.$message.error(err.message)
900 901
       })
@@ -1084,6 +1085,7 @@ export default {
1084 1085
           this.formValidate.attr = item.template_value
1085 1086
         }
1086 1087
       })
1088
+      this.onChangetype(this.formValidate.extension_type)
1087 1089
     },
1088 1090
     // 商户分类;
1089 1091
     getCategorySelect() {
@@ -1182,18 +1184,18 @@ export default {
1182 1184
       console.log(item, 'itemsss')
1183 1185
       if (item == 1) {
1184 1186
         this.OneattrValue.map(item => {
1185
-          this.$set(item, 'extension_one', null)
1187
+          this.$set(item, 'extension_one', this.base_commission)
1186 1188
           this.$set(item, 'extension_two', null)
1187 1189
         })
1188 1190
         this.ManyAttrValue.map(item => {
1189
-          this.$set(item, 'extension_one', null)
1191
+          this.$set(item, 'extension_one', this.base_commission)
1190 1192
           this.$set(item, 'extension_two', null)
1191 1193
         })
1192 1194
       } else {
1193 1195
         this.OneattrValue.map(item => {
1194 1196
           delete item.extension_one
1195 1197
           delete item.extension_two
1196
-          this.$set(item, 'extension_one', null)
1198
+          this.$set(item, 'extension_one', this.base_commission)
1197 1199
           this.$set(item, 'extension_two', null)
1198 1200
         })
1199 1201
         this.ManyAttrValue.map(item => {