瀏覽代碼

feat: NG-22: 新会员注册时增加国家与语言选项

Tyler 1 年之前
父節點
當前提交
2523e3c61e

+ 3 - 2
src/api/user.js

@@ -152,10 +152,11 @@ export function fetchFullInfo(data) {
 }
 
 // 用户升级查询
-export function fetchUpgrade() {
+export function fetchUpgrade(data) {
   return request({
     url: '/v1/user/upgrade',
-    method: 'get'
+    method: 'get',
+    params: data
   })
 }
 

+ 2 - 1
src/store/modules/user.js

@@ -116,7 +116,8 @@ const actions = {
           BANK_NO: ret.BANK_NO,
           MOBILE: ret.MOBILE,
           CREATED_AT: ret.CREATED_AT,
-          REAL_NAME: ret.REAL_NAME
+          REAL_NAME: ret.REAL_NAME,
+          COUNTRY_ID: ret.COUNTRY_ID
         })
         resolve(response)
       }).catch(error => {

+ 1 - 1
src/views/config/shipping-address-list.vue

@@ -171,7 +171,7 @@ export default {
 				address: '',
 				isDefault: '',
 			},
-			regionData: region.regionInfo.regionData,
+			regionData: [],
 			screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
 			labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
     }

+ 33 - 2
src/views/profile/components/Account.vue

@@ -4,7 +4,10 @@
       <span>{{ $t('profile.personalInformation') }}</span>
     </div>
 
-    <el-form v-loading="loading" wi>
+    <el-form v-loading="loading">
+      <el-form-item :label="$t('shop.country')">
+        <el-input v-model="countryName" size="medium" prefix-icon="el-icon-user-solid" readonly />
+      </el-form-item>
       <el-form-item :label="$t('shop.memberCode')">
         <el-input v-model="user.name" size="medium" prefix-icon="el-icon-user-solid" readonly />
       </el-form-item>
@@ -44,9 +47,27 @@ export default {
   },
   data() {
     return {
-      loading: false
+      loading: false,
+      countryName:''
     }
   },
+  mounted() {
+    this.getCountries()
+  },
+  watch:{
+    countriesList: {
+      handler(newValue, old) {
+        if (newValue) {
+          this.getCountryId()
+        }
+      },
+    },
+  },
+  computed:{
+    countriesList() {
+      return this.$store.getters.getCountriesList
+    },
+  },
   methods: {
     submit() {
       const data = {
@@ -81,6 +102,16 @@ export default {
         })
         this.loading = false
       })
+    },
+    //国家列表
+    getCountries() {
+      this.$store.dispatch('settings/getCountries')
+    },
+    getCountryId(){
+      let countryId = JSON.parse(window.localStorage.getItem('baseData')).COUNTRY_ID
+      let country =  this.countriesList.find(item => item.ID === countryId)
+      console.log(country)
+      this.countryName = country.NAME
     }
   }
 }

+ 7 - 0
src/views/profile/components/UserCard.vue

@@ -133,6 +133,13 @@ export default {
 			tool: tool,
 		}
 	},
+
+
+
+  methods: {
+
+
+  }
 }
 </script>
 

+ 5 - 2
src/views/user/member-upgrade.vue

@@ -335,14 +335,16 @@ export default {
     }
   },
   created() {
-    this.fetchUpgrade()
+    // this.fetchUpgrade()
   },
   mounted() {
   },
   methods: {
     fetchUpgrade() {
       this.loading = true
-      fetchUpgrade().then(response => {
+      fetchUpgrade({
+        userName: this.form.insertUserName
+      }).then(response => {
         this.loading = false
 
         this.userBalance = response.data.userBalance
@@ -400,6 +402,7 @@ export default {
         this.form.upgradeFunc = response.data.baseInfo.UPGRADE_FUNC
         this.nowPerf = response.data.baseInfo.NOW_PERF
         this.nextPerf = response.data.baseInfo.NEXT_PERF
+        this.fetchUpgrade()
 
         setTimeout(() => {
           this.loading = false

+ 6 - 1
src/views/user/welcome-pack.vue

@@ -430,6 +430,9 @@ export default {
     countriesList() {
       return this.$store.getters.getCountriesList
     },
+    language() {
+      return this.$store.getters.language
+    },
   },
      watch: {
      isDec: {
@@ -701,7 +704,9 @@ export default {
         goodsNum: this.form.goodsNum,
         location: this.form.location,
         decWay: this.decWay,
-        payType: this.form.payType
+        payType: this.form.payType,
+        countryId: this.countries,
+        languageId: this.languageId
       }
       createWelcomePack(params).then(response => {
         if (this.form.payType !== 'pay_stack') {