panhui пре 5 година
родитељ
комит
c1c0ca3e30

+ 1 - 1
src/components/ChatInfo.vue

@@ -83,7 +83,7 @@ export default {
         content() {
             if (this.info.content) {
                 if (this.info.content[0] === '{' && this.isService) {
-                    return this.$t('zi-xun-1') + ':' + this.contentJson.functionalRequirements;
+                    return this.$t('zi-xun-1') + ': ' + this.contentJson.functionalRequirements;
                     // return (
                     //    +
                     //     (this.contentJson.otherProblems ? ':' + this.contentJson.otherProblems : '')

+ 3 - 1
src/components/Member.vue

@@ -54,8 +54,10 @@ export default {
                 return this.$t('xi-tong-xiao-xi');
             } else if (this.type === 'admin') {
                 return this.$t('fu-wu-guan-jia');
+            } else if (this.info.otherName) {
+                return !this.isChinese && this.info.otherEnName ? this.info.otherEnName : this.info.otherName;
             } else {
-                return this.info.otherName || this.$t('shen-mi-yong-hu');
+                return this.$t('shen-mi-yong-hu');
             }
         },
         content() {

+ 1 - 1
src/components/News/Row.vue

@@ -6,7 +6,7 @@
                 <van-tag type="warning" v-if="isList && info.top">置顶</van-tag>
                 <span> {{ info.title }}</span>
             </div>
-            <p v-if="info.type === 'INDUSTRY_NEWS'">{{ info.createdAt }}</p>
+            <p>{{ info.createdAt }}</p>
         </div>
     </div>
 </template>

+ 18 - 1
src/components/bar/FilterSortBar.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="sort" :style="{ background: background }">
+    <div class="sort" :style="{ background: background }" :class="{ isEn: !isChinese }">
         <div class="sort-top">
             <div class="sort-left">
                 <block v-for="item in sortList" :key="item.key">
@@ -293,4 +293,21 @@ export default {
         }
     }
 }
+
+.isEn {
+    .sort-top .sort-left .sort-item {
+        font-size: 12px;
+        padding: 0 12px;
+        .right {
+            right: 0px;
+        }
+    }
+
+    .sort-top .shaixuan {
+        padding: 0 10px;
+        ._span {
+            font-size: 12px;
+        }
+    }
+}
 </style>

+ 1 - 1
src/components/bar/SearchBarWithValue.vue

@@ -17,7 +17,7 @@
                     shape="round"
                     :disabled="ratio != 1"
                     background="rgba(255,255,255,0)"
-                    placeholder="搜索..."
+                    :placeholder="$t('sou-suo')"
                     @change="inputChange"
                     @search="submitSearch"
                     @clear="clearSearch"

+ 12 - 1
src/components/filter/Application.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="filterInfo filter--big">
+    <div class="filterInfo filter--big" :class="{ isEn: !isChinese }">
         <div class="title" @click="showMore = !showMore">
             <h3 class="filterInfoTitle">{{ $t('ying-yong-ling-yu') }}</h3>
             <van-icon :custom-class="showMore ? 'showMore' : ''" name="arrow-down" color="#CBCFDB" :size="18" />
@@ -147,4 +147,15 @@ export default {
         }
     }
 }
+
+.isEn {
+    .list {
+        justify-content: flex-start!important;
+        .van-button {
+            margin-right: 10px;
+            font-size: 12px !important;
+            width: auto !important;
+        }
+    }
+}
 </style>

+ 4 - 2
src/components/filter/ProductBrand.vue

@@ -4,7 +4,9 @@
             <h3 class="filterInfoTitle">{{ $t('chan-pin-pin-pai') }}</h3>
         </block>
         <div class="filter-btn" :class="{ noChoose: !valueInfo }" @click="show">
-            <h3 class="fontNormal">{{ valueInfo ? valueInfo : size === 'big' ? '请选择' : $t('pin-pai') }}</h3>
+            <h3 class="fontNormal">
+                {{ valueInfo ? valueInfo : size === 'big' ? $t('qing-xuan-ze') : $t('pin-pai') }}
+            </h3>
             <van-icon v-if="size === 'big'" color="#CBCFDB" :size="18" name="arrow" />
             <van-icon
                 v-if="size === 'small'"
@@ -27,7 +29,7 @@
                     <van-icon color="#5E636D" @click="showPopup = false" :size="24" name="arrow-down" />
                 </div>
                 <h3>{{ $t('xuan-ze-pin-pai') }}</h3>
-                <van-button :color="$colors.warn" plain @click="backChoose">确定</van-button>
+                <van-button :color="$colors.warn" plain @click="backChoose">{{ $t('que-ding') }}</van-button>
             </div>
             <van-cell-group :border="false">
                 <!-- <van-cell

+ 3 - 0
src/components/product/GridNormal.vue

@@ -40,6 +40,9 @@ export default {
                     .filter(item => {
                         return !!item;
                     })
+                    .map(item => {
+                        return this.getName(item);
+                    })
                     .slice(0, 3) || []
             );
         },

+ 4 - 1
src/components/product/RowNormal.vue

@@ -5,7 +5,7 @@
             :name="checked ? 'checked' : 'circle'"
             :color="checked ? $colors.warn : '#BCC1CC'"
             :size="16"
-            style="margin-right: 12px;"
+            style="margin-right: 12px"
         />
         <van-image :src="img" width="220rpx" height="220rpx" fit="cover" />
         <div class="info">
@@ -57,6 +57,9 @@ export default {
                     .filter(item => {
                         return !!item;
                     })
+                    .map(item => {
+                        return this.getName(item);
+                    })
                     .slice(0, 3) || []
             );
         },

+ 4 - 1
src/components/select/Country.vue

@@ -25,7 +25,7 @@
                     v-if="headerInfo"
                     :border="false"
                     :custom-class="chooseId === headerInfo.value ? 'active' : ''"
-                    style="display: none;"
+                    style="display: none"
                 >
                     <h3 class="fontNormal" slot="title">
                         {{ $t('quan-bu') }}{{ $t(headerInfo.label) }}{{ $t('di-qu') }}
@@ -125,6 +125,9 @@ export default {
                 .filter(item => {
                     return !!item;
                 })
+                .map(item => {
+                    return this.$t(item);
+                })
                 .join('/');
         },
         headerInfo() {

+ 10 - 2
src/locales/en.json

@@ -339,7 +339,7 @@
   "fen-lei": "Category",
   "xuan-ze-lei-bie": "Select category",
   "lei-bie": "Category",
-  "quan-bu": "All",
+  "quan-bu": "All ",
   "mu-lu": "Catalog",
   "biao-qian": "Tag",
   "xuan-ze-biao-qian": "Select tag",
@@ -367,5 +367,13 @@
   "bian-ji": "Edit",
   "guan-zhu-cheng-gong": "Followed!",
   "qu-xiao-guan-zhu-cheng-gong": "Unfollow successfully",
-  "cha-kan-ji-lu": "View records"
+  "cha-kan-ji-lu": "View records",
+  "que-ren": "Confirm",
+  "imt-xian-xia-zhan-ting-ti-yan": "IMT offline showroom experience",
+  "shi": "Yes",
+  "fou": "no",
+  "zai-ci-shu-ru": "re-enter",
+  "fa-song-yan-zheng-ma": "Send  code",
+  "yi-fa-song": "Has been sent",
+  "yan-zheng-ma": "Verification code"
 }

+ 6 - 1
src/locales/zh.json

@@ -414,5 +414,10 @@
   "shao-hou-zai-shuo": "稍后再说",
   "wei-deng-lu-yong-hu-zhi-you-wu-ci-cha-kan-quan-xian": "未登录用户只有五次查看权限!",
   "li-ji-deng-lu": "立即登录",
-  "que-ren": "确认"
+  "que-ren": "确认",
+  "zai-ci-shu-ru": "再次输入",
+  "yan-zheng-ma": "验证码",
+  "yi-fa-song": "已发送",
+  "fa-song-yan-zheng-ma": "发送验证码",
+  "que-ding-yao-shan-chu-gai-zi-xun-xiao-xi-ma": "确定要删除该咨询消息吗?"
 }

+ 3 - 2
src/mixins/commont.js

@@ -132,7 +132,7 @@ export default {
                 confirmButtonColor: this.$colors.warn,
                 showCancelButton: showCancelButton,
                 confirmButtonText: confirmButtonText || this.$t('que-ren'),
-                cancelText: this.$t('qu-xiao')
+                cancelButtonText: this.$t('qu-xiao')
             });
         },
         go3D() {
@@ -172,7 +172,8 @@ export default {
                                 title: this.$t('ti-shi'),
                                 message: this.$t('wei-deng-lu-yong-hu-zhi-you-wu-ci-cha-kan-quan-xian'),
                                 confirmButtonColor: this.$colors.warn,
-                                confirmButtonText: this.$t('li-ji-deng-lu')
+                                confirmButtonText: this.$t('li-ji-deng-lu'),
+                                cancelButtonText: this.$t('qu-xiao')
                             })
                                 .then(() => {
                                     wx.navigateTo({

+ 1 - 1
src/mixins/vendorInfo.js

@@ -25,7 +25,7 @@ export default {
             return this.allcategories.replace(/_\//g, '/');
         },
         country() {
-            return this.info.headquarter || this.info.country || '中国';
+            return this.$t(this.info.headquarter) || this.$t(this.info.country) || this.$t('中国');
         },
         logo() {
             return this.info.logo ? this.info.logo + '?x-oss-process=image/resize,m_fill,h_480,w_480' : '';

+ 7 - 6
src/pages/Chat.vue

@@ -72,14 +72,14 @@ export default {
         }
     },
     onLoad() {
-        wx.setNavigationBarTitle({
-            title: this.$t('zi-xun-xiao-xi')
-        });
         this.$http.post('/user/getAdmin').then(res => {
             this.adminId = res;
         });
     },
     onShow() {
+        wx.setNavigationBarTitle({
+            title: this.$t('zi-xun-xiao-xi')
+        });
         this.setMove();
         const app = getApp();
         if (app.globalData.initialize) {
@@ -131,15 +131,16 @@ export default {
         del(id) {
             Dialog.confirm({
                 title: this.$t('ti-shi'),
-                message: '确定要删除该咨询消息吗?',
+                message: this.$t('que-ding-yao-shan-chu-gai-zi-xun-xiao-xi-ma'),
                 confirmButtonColor: this.$colors.warn,
-                confirmButtonText: '删除'
+                confirmButtonText: this.$t('shan-chu'),
+                cancelButtonText: this.$t('qu-xiao')
             })
                 .then(() => {
                     return this.$http.post('/message/delBox?otherUserId=' + id);
                 })
                 .then(() => {
-                    this.toast('删除成功!', 'success');
+                    this.toast(this.$t('shan-chu-cheng-gong'), 'success');
                     this.loginMethods();
                 })
                 .catch(e => {

+ 2 - 2
src/pages/Classify.vue

@@ -22,7 +22,7 @@
                     :value="search"
                     @search="confirm"
                     shape="round"
-                    placeholder="搜索..."
+                    :placeholder="$t('sou-suo')"
                     left-icon="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/search.png"
                 />
             </div>
@@ -77,7 +77,7 @@
                     >{{ getName(item) }}</van-button
                 >
 
-                <div style="height: 20px;"></div>
+                <div style="height: 20px"></div>
             </scroll-view>
         </div>
 

+ 2 - 2
src/pagesChat/ChatDetail.vue

@@ -300,7 +300,7 @@ export default {
                     this.getDetail();
                     if (this.type === 'admin') {
                         setTimeout(() => {
-                            adminAutoReply(this.$store.state.userInfo.id).then(res => {
+                            adminAutoReply(this.$store.state.userInfo.id, this.isChinese).then(res => {
                                 this.getDetail();
                             });
                         }, 1000);
@@ -329,7 +329,7 @@ export default {
                     this.getDetail();
 
                     setTimeout(() => {
-                        adminAutoReply(this.$store.state.userInfo.id).then(res => {
+                        adminAutoReply(this.$store.state.userInfo.id, this.isChinese).then(res => {
                             this.getDetail();
                         });
                     }, 1000);

+ 15 - 2
src/pagesHome/Search.vue

@@ -85,11 +85,17 @@
                     <div class="text">{{ $t('re-men-sou-suo') }}</div>
                 </div>
 
-                <div class="history-list">
+                <div class="history-list" v-if="isChinese">
                     <div class="tags" @click="goNext(item)" v-for="(item, index) in hots" :key="index">
                         {{ item }}
                     </div>
                 </div>
+
+                <div class="history-list" v-else>
+                    <div class="tags" @click="goNext(item)" v-for="(item, index) in hotsEn" :key="index">
+                        {{ item }}
+                    </div>
+                </div>
             </div>
         </div>
         <van-dialog id="van-dialog" />
@@ -112,6 +118,7 @@ export default {
             historys: [],
             focus: false,
             hots: [],
+            hotsEn: [],
             matchList: [],
             ios: false
         };
@@ -147,6 +154,10 @@ export default {
             this.hots = res.value.split(',');
         });
 
+        this.$http.get('/sysConfig/get/SEARCH_HOT_EN').then(res => {
+            this.hotsEn = res.value.split(',');
+        });
+
         wx.getSystemInfo({
             success: res => {
                 if (res.brand === 'iPhone') {
@@ -245,7 +256,9 @@ export default {
             Dialog.confirm({
                 title: this.$t('ti-shi'),
                 message: this.$t('que-ding-yao-qing-chu-quan-bu-sou-suo-ji-lu-ma'),
-                confirmButtonColor: this.$colors.warn
+                confirmButtonColor: this.$colors.warn,
+                confirmButtonText: this.$t('que-ren'),
+                cancelButtonText: this.$t('qu-xiao')
             })
                 .then(() => {
                     var _this = this;

+ 7 - 1
src/pagesMine/Account.vue

@@ -5,7 +5,7 @@
 }
 </config>
 <template>
-    <div class="edit pageBottom">
+    <div class="edit pageBottom" :class="{ isEn: !isChinese }">
         <van-cell-group :border="false">
             <van-cell :title="$t('id-zhang-hao')" :value="myInfo.id" />
             <van-cell
@@ -94,4 +94,10 @@ export default {
     line-height: 22px;
     padding: 20px 16px;
 }
+
+.isEn {
+    .van-cell__title {
+        font-size: 12px;
+    }
+}
 </style>

+ 11 - 7
src/pagesMine/ChangePhone.vue

@@ -9,9 +9,7 @@
         <div class="page-info">
             <h3>{{ isVer ? $t('xiu-gai-shou-ji-hao') : $t('dang-qian-shou-ji-hao') }}</h3>
             <div class="page-input">
-                <div class="phoenPre">
-                    CH +86
-                </div>
+                <div class="phoenPre">CH +86</div>
                 <input
                     type="number"
                     @input="phone = $event.detail.value"
@@ -27,7 +25,7 @@
             </div>
         </div>
         <div class="page-info">
-            <h3>验证码</h3>
+            <h3>{{ $t('yan-zheng-ma') }}</h3>
             <div class="page-input code">
                 <input
                     type="number"
@@ -39,14 +37,20 @@
                     :placeholder="$t('qing-shu-ru-yan-zheng-ma')"
                     placeholder-class="pla-textarea"
                 />
-                <van-button v-if="isSend" color="#BCC1CC" size="small" plain>已发送({{ senNum }}S)</van-button>
+                <van-button v-if="isSend" color="#BCC1CC" size="small" plain
+                    >{{ $t('yi-fa-song') }}({{ senNum }}S)</van-button
+                >
 
-                <van-button v-else :color="$colors.warn" size="small" plain @click="sms">发送验证码</van-button>
+                <van-button v-else :color="$colors.warn" size="small" plain @click="sms">{{
+                    $t('fa-song-yan-zheng-ma')
+                }}</van-button>
             </div>
         </div>
 
         <div class="submit">
-            <van-button :color="$colors.warn" block :disabled="!canNext" @click="submit">确定</van-button>
+            <van-button :color="$colors.warn" block :disabled="!canNext" @click="submit">{{
+                $t('que-ding')
+            }}</van-button>
         </div>
     </div>
 </template>

+ 1 - 1
src/pagesMine/ChangePsd.vue

@@ -22,7 +22,7 @@
             </div>
         </div>
         <div class="page-info">
-            <h3>再次输入</h3>
+            <h3>{{ $t('zai-ci-shu-ru') }}</h3>
             <div class="page-input">
                 <input
                     type="password"

+ 3 - 1
src/pagesMine/ReadRecords.vue

@@ -68,7 +68,9 @@ export default {
             Dialog.confirm({
                 title: this.$t('ti-shi'),
                 message: this.$t('que-ding-yao-qing-chu-quan-bu-liu-lan-ji-lu-ma'),
-                confirmButtonColor: this.$colors.warn
+                confirmButtonColor: this.$colors.warn,
+                confirmButtonText: this.$t('shan-chu'),
+                cancelButtonText: this.$t('qu-xiao')
             })
                 .then(() => {
                     return this.$http.post('/collect/cancelAll', {

+ 3 - 1
src/pagesNews/News.vue

@@ -101,7 +101,9 @@ export default {
             return this.hotActive ? [...this.informations][this.hotActive - 1].type : 'default';
         },
         title() {
-            return this.hotActive ? this.$t([...this.informations][this.hotActive - 1].name) : '新闻资讯';
+            return this.hotActive
+                ? this.$t([...this.informations][this.hotActive - 1].name)
+                : this.$t('xin-wen-zi-xun');
         }
     },
     onLoad(options) {

+ 7 - 1
src/pagesProduct/Contrast.vue

@@ -4,7 +4,7 @@
 }
 </config>
 <template>
-    <div class="contrast">
+    <div class="contrast" :class="{ isEn: !isChinese }">
         <div class="notice" v-if="!reader">
             <van-notice-bar
                 left-icon="volume-o"
@@ -354,4 +354,10 @@ export default {
         padding: 0 16px;
     }
 }
+
+.isEn {
+    .dialog-center .dialog-title {
+        font-size: 12px;
+    }
+}
 </style>

+ 1 - 1
src/pagesProduct/ContrastDetail.vue

@@ -64,7 +64,7 @@
                 <div class="td pro" v-for="(item, index) in showContrastList" :key="index">
                     <div class="tags">
                         <div class="tag" v-for="(tag, tagIndex) in gstTags(item)" :key="tagIndex">
-                            {{ tag }}
+                            {{ getName(tag) }}
                         </div>
                         <span v-if="gstTags(item).length === 0">-</span>
                     </div>

+ 4 - 2
src/pagesProduct/Detail.vue

@@ -234,7 +234,7 @@ export default {
                         return this.getName(item);
                     })
                     .join('、') ||
-                this.productInfo.origin ||
+                this.$t(this.productInfo.origin) ||
                 ''
             );
         },
@@ -268,7 +268,9 @@ export default {
             return list.join('、');
         },
         tags() {
-            return this.productInfo.tag || [];
+            return [...(this.productInfo.tag || [])].map(item => {
+                return this.getName(item);
+            });
         },
         productCategoryName() {
             if (this.productInfo.productCategory) {

+ 9 - 0
src/store/index.js

@@ -1,4 +1,5 @@
 import Vuex from 'vuex';
+import Vue from 'vue';
 import http from '../plugins/http';
 export default new Vuex.Store({
     state: {
@@ -175,6 +176,14 @@ export default new Vuex.Store({
             http.http.get('https://imttech.oss-cn-hangzhou.aliyuncs.com/utils/area.json').then(res => {
                 context.commit('updateAreaList', res);
             });
+
+            http.http.get('http://imttech.oss-cn-hangzhou.aliyuncs.com/utils/en/area.json').then(res => {
+                Vue.i18n.add('en', res);
+            });
+
+            http.http.get('http://imttech.oss-cn-hangzhou.aliyuncs.com/utils/zh/area.json').then(res => {
+                Vue.i18n.add('zh', res);
+            });
         },
         getUnreadNumber(context) {
             let unreadNumber = 0;

+ 28 - 15
src/utils/chat.js

@@ -1,22 +1,35 @@
 import http from '../plugins/http';
 
 // 需求管家自动回复
-function adminAutoReply(userId) {
-    return http.http.post('/user/getAdmin').then(res => {
-        return http.http.post(
-            '/message/save',
-            {
-                sendUserId: res,
-                receiveUserId: userId,
-                content: '管家已收到您的消息,稍后会有专人与您联系,请您保持手机畅通哦!'
-            },
-            {
-                header: {
-                    'Content-Type': 'application/json'
-                }
+function adminAutoReply(userId, isChinese = true) {
+    return Promise.all([http.http.post('/user/getAdmin'), http.http.get('/sysConfig/get/IMT_DEMAND_BACK')])
+        .then(res => {
+            if (isChinese) {
+                return Promise.resolve({ id: res[0], content: res[1].value });
+            } else {
+                return http.http.get('/sysConfig/get/IMT_DEMAND_BACK_EN').then(res2 => {
+                    return Promise.resolve({ id: res[0], content: res2.value });
+                });
             }
-        );
-    });
+        })
+        .then(res => {
+            return http.http.post(
+                '/message/save',
+                {
+                    sendUserId: res.id,
+                    receiveUserId: userId,
+                    content: res.content
+                },
+                {
+                    header: {
+                        'Content-Type': 'application/json'
+                    }
+                }
+            );
+        });
+    // return http.http.post('/user/getAdmin').then(res => {
+    //
+    // });
 }
 
 export { adminAutoReply };