huangmp 2 lat temu
rodzic
commit
8ff723eede

+ 2 - 2
.env.development

@@ -2,8 +2,8 @@
 ENV = 'development'
 
 // api接口请求地址
-VUE_APP_BASE_API = 'http://lymall-platform.58for.com/apis'
-//VUE_APP_BASE_API = 'http://192.168.1.176:8088'
+//VUE_APP_BASE_API = 'http://lymall-platform.58for.com/apis'
+VUE_APP_BASE_API = 'http://127.0.0.1:8088'
 
 // 客服api接口请求地址
 //VUE_APP_IM_API = 'https://b2b2c-im.mall4j.com'

+ 51 - 5
src/views/modules/sys/pset/service-components.vue

@@ -2,6 +2,13 @@
   <div>
     <el-tabs type="card">
       <el-tab-pane :label="this.$i18n.t('sysManagement.chineseInformation')">
+        <el-select v-model="shopId" placeholder="关联店铺" controls-position="right" @change="getInfo(shopId)">
+          <el-option v-for="item in shopList"
+                     :key="item.shopId"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
         <tiny-mce
           v-model="contentCN.content"
           ref="content"
@@ -9,6 +16,13 @@
         ></tiny-mce>
       </el-tab-pane>
       <el-tab-pane :label="this.$i18n.t('sysManagement.englishInformation')">
+        <el-select v-model="shopId" placeholder="关联店铺" controls-position="right" @change="getInfo(shopId)">
+          <el-option v-for="item in shopList"
+                     :key="item.shopId"
+                     :label="item.shopName"
+                     :value="item.shopId">
+          </el-option>
+        </el-select>
         <tiny-mce
           v-model="contentEN.content"
           ref="content"
@@ -47,15 +61,47 @@ export default {
       // 英文配置信息
       contentEN: {
         content: ''
-      }
+      },
+      shopId: null,
+      shopList: [],
     }
   },
   mounted () {
-    this.init()
+    this.getShopList()
+    // this.init()
   },
   methods: {
+    getShopList () {
+      this.$http({
+        url: this.$http.adornUrl('/shop/shopAuditing/list'),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data) {
+          this.shopList = data
+        }
+      })
+    },
+    getInfo (shopId) {
+      this.$http({
+        url: this.$http.adornUrl('/sys/pconfig/info/' + this.params.keyCN + "_" + shopId),
+        method: 'get',
+        params: this.$http.adornParams()
+      }).then(({data}) => {
+        if (data) {
+          this.contentCN = data
+        }
+      })
+      this.$http({
+        url: this.$http.adornUrl('/sys/pconfig/info/' + this.params.keyEN + "_" + shopId),
+        method: 'get',
+        params: this.$http.adornParams()
+      }).then(({data}) => {
+        if (data) {
+          this.contentEN = data
+        }
+      })
+    },
     init () {
-      console.log(this.params)
       this.$nextTick(() => {
         this.$http({
           url: this.$http.adornUrl('/sys/pconfig/info/' + this.params.keyCN),
@@ -83,7 +129,7 @@ export default {
         url: this.$http.adornUrl('/sys/pconfig/save'),
         method: 'post',
         data: this.$http.adornData({
-          'paramKey': this.params.keyCN,
+          'paramKey': this.params.keyCN + "_" + this.shopId,
           'paramValue': JSON.stringify(this.contentCN),
           'remark': this.params.remarkCN
         })
@@ -92,7 +138,7 @@ export default {
         url: this.$http.adornUrl('/sys/pconfig/save'),
         method: 'post',
         data: this.$http.adornData({
-          'paramKey': this.params.keyEN,
+          'paramKey': this.params.keyEN + "_" + this.shopId,
           'paramValue': JSON.stringify(this.contentEN),
           'remark': this.params.remarkEN
         })