Explorar el Código

feat:国际版

xzh hace 4 años
padre
commit
51143dea58

+ 2 - 1
mobile/src/lang/en/modules/login.js

@@ -24,5 +24,6 @@ module.exports = {
     "resendTime": "{time}s resend",
     "passwordTip": "Password must contain English case and numbers no less than 8-16 characters",
     "currentEmailTip": "Please enter a correct Email address",
-    "agreeXieyi": "Please read and agree to the user agreement"
+    "agreeXieyi": "Please read and agree to the user agreement",
+    account: 'Account'
 }

+ 1 - 0
mobile/src/lang/zh/modules/login.js

@@ -25,4 +25,5 @@ module.exports = {
   passwordTip: '密码必须包含英文大小写、数字、长度8-16个字符',
   currentEmailTip: '请填写正确的邮箱',
   agreeXieyi: '请阅读并同意四维看看用户协议',
+  account: '账号'
 }

+ 11 - 8
mobile/src/pages/account/mailRegister/index.vue

@@ -47,6 +47,7 @@ import { Base64 } from 'js-base64'
 export default {
   computed: {
     ...mapState({
+      token: state => state.user.token,
       language: state => state.language.current,
       langToast: state => state.language.home.toast,
       langLogin: state => state.language.home.home.loginAside
@@ -173,14 +174,16 @@ export default {
       if (response.code !== 0) {
         return this.$toast.show('warn', this.langToast[response.code])
       }
-      let params1 = {
-        phoneNum: params.phoneNum,
-        password: encodeStr(Base64.encode(this.password))
-      }
-      await this.$store.dispatch('login', params1)
-      if (this.token) {
-        this.$router.push({name: 'information'})
-      }
+      this.$toast.showConfirm('success', this.langToast['23'], async () => {
+        let params1 = {
+          phoneNum: params.phoneNum,
+          password: encodeStr(Base64.encode(this.password))
+        }
+        await this.$store.dispatch('login', params1)
+        if (this.token) {
+          this.$router.push({name: 'information'})
+        }
+      })
     }
   }
 }

+ 11 - 5
mobile/src/pages/account/manage/change/index.vue

@@ -4,8 +4,8 @@
       <div class="order-input-con">
         <div class="order-input-item">
           <div class="order-sub">
-            <div class="top-title">{{langModify.phone.txt}}</div>
-            <div class="top-username">+{{info.country==='中国'?'86':info.country}} {{info.userName}}</div>
+            <div class="top-title">{{ $t('login.account') }}</div>
+            <div class="top-username"><span v-if="isPhone">+{{info.country==='中国'?'86':info.country}}</span> {{info.userName}}</div>
           </div>
         </div>
         <div class="order-input-item">
@@ -58,8 +58,12 @@ export default {
       language: state => state.language.current,
       langToast: state => state.language.home.toast,
       langModify: state => state.language.home.manage.modify,
-      info: state => state.user.info
-    })
+      info: state => state.user.info,
+      isInternational: state => state.isInternational
+    }),
+    isPhone () {
+      return this.info.userName.indexOf('@') === -1
+    }
   },
   data () {
     return {
@@ -76,7 +80,9 @@ export default {
       let {userName, country} = this.info
       let res = await this.$store.dispatch('getAuthCode', {
         phone: userName,
-        code: country === '中国' ? 86 : country
+        code: country === '中国' ? 86 : country,
+        email: userName,
+        qudao: this.isPhone ? '' : 'email'
       })
       if (res) {
         this.interl && clearInterval(this.interl)

+ 1 - 1
pc/src/components/dev/Configuration.vue

@@ -31,7 +31,7 @@
 export default {
     data() {
         return {
-            menu: [{ text: "语言设置", name: "Lang" }, { text: "新闻设置", name: "News" }],
+            menu: [{ text: "语言设置", name: "Lang" }, { text: '新闻设置', name: 'News'}],
             page: "Lang"
         };
     },

+ 1 - 1
pc/src/lang/en/modules/agent.js

@@ -41,7 +41,7 @@ module.exports = {
         "phoneLabel": "Phone",
         "phonePlaceholder": "Please Input the Phone",
         "emailLabel": "Email",
-        "emailPlaceholder": "Please Input the Email",
+        "emailPlaceholder": "Please Input your account",
         "submit": "Submit"
     }
 }

+ 1 - 1
pc/src/main.js

@@ -19,7 +19,7 @@ let router = require('./router').default
 
 Vue.prototype.$http = axios
 // Vue.prototype.$serverName = 'http://192.168.0.10:8080/'
-Vue.prototype.$serverName = 'https://www.4dkankan.com/'
+Vue.prototype.$serverName = ''
 
 // Vue.prototype.$serverName = 'https://test.4dkankan.com'
 

+ 3 - 3
pc/src/page/login/components/register/index.vue

@@ -33,7 +33,7 @@
       <!-- <input placeholder="请输入昵称" type="text" v-model="emailForm.nickname"> -->
       <div class="code-w">
         <input :placeholder="$t('login.emailPlaceholder')" class="phone" type="text" v-model="emailForm.phone">
-        <div class="send-code-btn" :class="{'is-disabled': interEmailTime}" @click="getEmailAuthCode">{{ interEmailTime ? `${interEmailTime}s后重试` : '获取验证码'}}</div>
+        <div class="send-code-btn" :class="{'is-disabled': interEmailTime}" @click="getEmailAuthCode">{{ interEmailTime ? $t('login.resendTime', { time: interEmailTime }) : $t('login.sendCodeBtnText')}}</div>
       </div>
       <input :placeholder="$t('login.codePlaceholder')"  type="text" v-model="emailForm.authCode">
       <div class="password-w" :class="{'show-tip': !emailForm.password && passwordTip}" @mouseleave="passwordTip=false" @click="focusInput('emialInput')" >
@@ -124,7 +124,7 @@ export default {
     this.$bus.$on('isAgree', data => {
       this.showCluse = data
     })
-    this.type = this.$route.query.type || 'phone'
+    this.type = this.isInternational ? 'email' : 'phone'
   },
   methods: {
     changeArea (item) {
@@ -217,7 +217,7 @@ export default {
         // },
         {
           name: this.type === 'email' ? '邮箱' : '手机',
-          En: 'Phone number',
+          En: this.type === 'email' ? 'E-mail' : 'Phone number',
           val: form.phone,
           required: true
         },

+ 10 - 4
pc/src/page/manage/temp/change.vue

@@ -2,7 +2,7 @@
   <div class="change-layout">
     <div class="change-con">
       <div class="input">
-       +{{info.country==='中国'?'86':info.country}} {{info.userName}}
+       <span v-if="isPhone">+{{info.country==='中国'?'86':info.country}}</span> {{info.userName}}
       </div>
       <div class="input yanzhengma">
         <input autocomplete="off" v-model="code" type="text" :placeholder="langModify.codep">
@@ -34,8 +34,12 @@ export default {
       langModify: state => state.language.home.manage.modify,
       langToast: state => state.language.home.toast,
       language: state => state.language.current,
-      info: state => state.user.info
-    })
+      info: state => state.user.info,
+      isInternational: state => state.isInternational
+    }),
+    isPhone () {
+      return this.info.userName.indexOf('@') === -1
+    }
   },
   data () {
     return {
@@ -52,7 +56,9 @@ export default {
       let {userName, country} = this.info
       let res = await this.$store.dispatch('getAuthCode', {
         phone: userName,
-        code: country === '中国' ? 86 : country
+        code: country === '中国' ? 86 : country,
+        email: userName,
+        qudao: this.isPhone ? '' : 'email'
       })
       if (res) {
         this.interl && clearInterval(this.interl)

+ 1 - 1
pc/src/page/manage/temp/scene.vue

@@ -817,7 +817,7 @@ $font-color: #2d2d2d;
   }
 
   .scene-nothing {
-    width: 75%;
+    // width: 75%;
     padding: 42px 0 210px 0;
     text-align: center;
     img {

+ 1 - 1
pc/src/store/language/en/toast.js

@@ -65,7 +65,7 @@ export default{
   '3005': 'Verification code expired.',
   '3006': 'Incorrect verification code.',
   '3007': 'User name already exists.',
-  '3008': 'The mobile number is already registered.',
+  '3008': 'The account is already registered.',
   '3009': 'The password you typed don\'t match.',
   '3010': 'Incorrect user name length. (2-11 characters)',
   '3011': 'Password must contain English case and numbers, 8-16 characters. ',