Browse Source

修改注册手机号的翻译、区号的布局样式

master
liaoxinyu 4 days ago
parent
commit
419ffb228c
  1. 8
      element/index.js
  2. 5
      i18n/lang/en.json
  3. 3
      i18n/lang/zh-TW.json
  4. 6
      main.js
  5. 66
      pages/reg/index.vue

8
element/index.js

@ -1,8 +1,12 @@
// 导入自己需要的组件 // 导入自己需要的组件
import { Slider } from 'element-ui' import { Slider,Progress,Steps,Step,Select,Option } from 'element-ui'
const components = [Slider,Progress,Steps,Step,Select,Option]
const element = { const element = {
install: function (Vue) { install: function (Vue) {
Vue.use(Slider) // Vue.use(Slider)
components.forEach(component => {
Vue.use(component)
})
} }
} }
export default element export default element

5
i18n/lang/en.json

@ -395,7 +395,7 @@
"a0": "Mobile registration", "a0": "Mobile registration",
"a1": "Register Account", "a1": "Register Account",
"a2": "Mobile Phone", "a2": "Mobile Phone",
"a3": "Please enter your mobile number", "a3": "Enter your phone number",
"a4": "Email", "a4": "Email",
"a5": "Enter your email address", "a5": "Enter your email address",
"a6": "Email verification Code", "a6": "Email verification Code",
@ -541,7 +541,8 @@
"a7": "Register Now", "a7": "Register Now",
"a8": "Mobile", "a8": "Mobile",
"a9": "mailbox", "a9": "mailbox",
"b0": "Done" "b0": "Done",
"country": "Country code"
}, },
"contract": { "contract": {
"a0": "Open Position", "a0": "Open Position",

3
i18n/lang/zh-TW.json

@ -539,7 +539,8 @@
"a7": "立即註冊", "a7": "立即註冊",
"a8": "手機", "a8": "手機",
"a9": "郵箱", "a9": "郵箱",
"b0": "完成" "b0": "完成",
"country": "區號"
}, },
"contract": { "contract": {
"a0": "開倉", "a0": "開倉",

6
main.js

@ -3,9 +3,9 @@ import App from './App.vue'
import '@/plugins' import '@/plugins'
import i18n from "./i18n"; import i18n from "./i18n";
import store from './store' import store from './store'
// import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
// import element from './element/index' import element from './element/index'
// Vue.use(element) Vue.use(element)
//把vuex定义成全局组件 //把vuex定义成全局组件
Vue.prototype.$store = store Vue.prototype.$store = store
Vue.prototype._i18n = i18n; Vue.prototype._i18n = i18n;

66
pages/reg/index.vue

@ -72,12 +72,19 @@
<view class="form-item border-b m-b-md p-b-xs"> <view class="form-item border-b m-b-md p-b-xs">
<view> <view>
<view class="label m-b-xs">{{$t('reg.a2')}}</view> <view class="label m-b-xs">{{$t('reg.a2')}}</view>
<v-input v-model="form.phone" class="color-light" :placeholder="$t('reg.a3')"> <view class="d-flex">
<template #left> <view style="width: 30%;margin-right: 20rpx;">
<v-country ref="country" style="width: 80rpx;height: 40rpx;border: 1px solid #ccc;text-align: center;line-height: 40rpx;" <el-select v-model="form.country_id" filterable :placeholder="$t('login.country')" no-match-text="No matching data">
@country_code="country_code=$event" class="m-r-xs" v-model="form.country_id" /> <el-option v-for="(item, index) in countryList" :key="index" :value="`${item.id}`" :label="`+${item.country_code} ${item.name}`"></el-option>
</template> </el-select>
</v-input> </view>
<v-input style="width: 380rpx;" v-model="form.phone" class="color-light" :placeholder="$t('reg.a3')">
<!-- <template #left>
<v-country ref="country" style="width: 80rpx;height: 40rpx;border: 1px solid #ccc;text-align: center;line-height: 40rpx;"
@country_code="country_code=$event" class="m-r-xs" v-model="form.country_id" />
</template> -->
</v-input>
</view>
</view> </view>
</view> </view>
@ -174,8 +181,10 @@
</template> </template>
<script> <script>
import Member from "@/api/member"; import Member from "@/api/member";
import serve from "@/api/serve/index";
import app from "app.js"; import app from "app.js";
import tfVerifyImg from '@/components/tf-verify-img/tf-verify-img.vue'; import tfVerifyImg from '@/components/tf-verify-img/tf-verify-img.vue';
import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
@ -183,7 +192,7 @@ export default {
form: { form: {
type: 2, type: 2,
country_code: "", country_code: "",
country_id: 1, country_id: "",
account: "", account: "",
code: "", code: "",
password: "", password: "",
@ -214,6 +223,9 @@ export default {
}, },
computed: { computed: {
...mapState({
countryList: "countryList",
}),
}, },
components:{tfVerifyImg}, components:{tfVerifyImg},
methods: { methods: {
@ -243,7 +255,7 @@ export default {
this.$toast(this.$t('common.c14')); this.$toast(this.$t('common.c14'));
return; return;
} }
if(!this.country_code||!this.form.phone){ if(!this.form.country_code||!this.form.phone){
this.$toast(this.$t('common.phonenumber')); this.$toast(this.$t('common.phonenumber'));
return; return;
} }
@ -345,24 +357,34 @@ export default {
}); });
}, },
// //
changeSLider(){ changeSLider(){
this.showVerify = true;
},
open(){
// console.log("open");
this.showVerify = true; this.showVerify = true;
}, },
open(){ chenggong(){
// console.log("open"); uni.showToast({
this.showVerify = true; title: this.$t('homeNewText.dd1')
}, });
chenggong(){ this.showVerify = false;
uni.showToast({ this.sendAAA = true;
title: this.$t('homeNewText.dd1') },
});
this.showVerify = false; ...mapActions({
this.sendAAA = true; setCountryList: "countryList",
} }),
getCountry() {
serve.get("/getCountryList").then((res) => {
this.setCountryList(res.data);
});
},
}, },
mounted() { mounted() {
this.gett_gc_code(); this.gett_gc_code();
this.getCountry();
}, },
onLoad(query){ onLoad(query){
this.query = query this.query = query

Loading…
Cancel
Save