ljc 2 месяцев назад
Родитель
Сommit
8c0bdbbfe4
3 измененных файлов с 236 добавлено и 116 удалено
  1. 2 7
      components/cwg-page-wrapper.vue
  2. 122 0
      pages/login/components/ImportModel.vue
  3. 112 109
      pages/login/regist.vue

+ 2 - 7
components/cwg-page-wrapper.vue

@@ -24,9 +24,9 @@
       </cwg-match-media>
       <view class="content-info">
         <!--      完善信息提示,-->
-        <PrefectInfo />
+        <PrefectInfo v-if="!isLoginPage" />
         <!--      申请成为ib,-->
-        <IbInfo ref="ibRef" />
+        <IbInfo ref="ibRef" v-if="!isLoginPage" />
 
         <view class="content-wrapper" :class="{ 'content-wrapper-padding': isContentPadding }">
           <!-- <cwg-header /> -->
@@ -152,11 +152,6 @@ onLoad(() => {
 onShow(() => {
   updateRoute()
 })
-onUnmounted(() => {
-  uni.$off('open-ib')
-  uni.$off('open-notice-drawer')
-  uni.$off('open-right-drawer')
-})
 
 </script>
 

+ 122 - 0
pages/login/components/ImportModel.vue

@@ -0,0 +1,122 @@
+<template>
+  <cwg-popup
+    :visible="visible"
+    :title="t('CountryNotice.title')"
+    :showClose="false"
+    :maskClick="false"
+    @close="handleClose"
+    @confirm="handleConfirm"
+    :confirmDisabled="!checked"
+    :confirmText="t(`CountryNotice.${countryKey}.confirm`)"
+  >
+    <view class="dialog-content">
+      <view class="notice-text">
+        <text>{{ t(`CountryNotice.${countryKey}.notice1`) }}</text>
+        <text style="font-weight: bold; display: inline;">{{ t(`CountryNotice.${countryKey}.notice2`) }}</text>
+      </view>
+      <view class="notice-text">
+        <text>{{ t(`CountryNotice.${countryKey}.notice3`) }}</text>
+        <text style="font-weight: bold; display: inline;">{{ t(`CountryNotice.${countryKey}.notice4`) }}</text>
+      </view>
+      <view class="notice-text">
+        <text>{{ t(`CountryNotice.${countryKey}.notice5`) }}</text>
+        <text style="font-weight: bold; display: inline;">{{ t(`CountryNotice.${countryKey}.notice6`) }}</text>
+        <text>{{ t(`CountryNotice.${countryKey}.notice7`) }}</text>
+      </view>
+      <view class="checkbox-wrapper" @click="checked = !checked">
+        <up-checkbox-group>
+          <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
+                       :checked="checked" :name="true"></up-checkbox>
+        </up-checkbox-group>
+        <text class="checkbox-label">{{ t(`CountryNotice.${countryKey}.checkbox`) }}</text>
+      </view>
+    </view>
+  </cwg-popup>
+</template>
+
+<script setup>
+  import { ref, computed, watch } from 'vue'
+  import { useI18n } from 'vue-i18n'
+
+  const { t } = useI18n()
+
+  const props = defineProps({
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    countryCode: {
+      type: String,
+      default: 'MY'
+    }
+  })
+
+  const emit = defineEmits(['update:visible', 'confirm'])
+
+  const checked = ref(false)
+
+  const countryKey = computed(() => {
+    return props.countryCode ? props.countryCode.toLowerCase() : 'my'
+  })
+
+  watch(() => props.visible, (newVal) => {
+    if (newVal) {
+      checked.value = false
+    }
+  })
+
+  const handleClose = () => {
+    if (checked.value) {
+      emit('update:visible', false)
+    } else {
+      uni.showToast({
+        title: 'Please check the confirmation box first',
+        icon: 'none'
+      })
+    }
+  }
+
+  const handleConfirm = () => {
+    if (checked.value) {
+      emit('update:visible', false)
+      emit('confirm')
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  @import "@/uni.scss";
+
+  .dialog-content {
+    padding: px2rpx(10) px2rpx(20);
+  }
+
+  .notice-text {
+    font-size: px2rpx(14);
+    line-height: 1.6;
+    color: #606266;
+    margin-bottom: px2rpx(10);
+    text-align: justify;
+    word-break: break-word;
+  }
+
+  .checkbox-wrapper {
+    margin-top: px2rpx(20);
+    margin-bottom: px2rpx(10);
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+
+    .checkbox-label {
+      font-size: px2rpx(14);
+      color: #666666;
+      margin-left: px2rpx(8);
+      user-select: none;
+    }
+
+    :deep(.u-checkbox) {
+      display: flex;
+      align-items: flex-start;
+    }
+  }
+</style>

+ 112 - 109
pages/login/regist.vue

@@ -70,73 +70,56 @@
                 </uni-forms-item>
               </uni-col>
 
-              <uni-col :xs="24" :md="24">
-                <uni-forms-item v-if="!isRouteHasId" name="linkValue" :label="t('newSignup.item14')">
-                  <uni-easyinput v-model.trim="formData.linkValue"
-                                 :disabled="!isAgeValid || !formData.birthDate"
-                                 :placeholder="t('newSignup.item15')"
-                                 @input="limitAgentIdLength"></uni-easyinput>
-                </uni-forms-item>
-              </uni-col>
-
+                <uni-col :xs="24" :md="24">
+                  <uni-forms-item v-if="!isRouteHasId" name="linkValue" :label="t('newSignup.item14')">
+                    <uni-easyinput v-model.trim="formData.linkValue"
+                                   :disabled="!isAgeValid || !formData.birthDate"
+                                   :placeholder="t('newSignup.item15')"
+                                   @input="limitAgentIdLength"></uni-easyinput>
+                  </uni-forms-item>
+                </uni-col>
+
+
+              </uni-row>
+              <uni-forms-item name="agree">
+                <view class="check-box" @click="toggleAgree">
+                  <up-checkbox-group v-model="agreeGroup" @change="onAgreeChange">
+                    <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
+                                 name="agree"
+                                 class="wcg-checkbox"></up-checkbox>
+                  </up-checkbox-group>
+                  <text class="checkbox-label">{{ t('signup.agree') }}</text>
+                </view>
+              </uni-forms-item>
+              <uni-forms-item name="isSubscribeEmail">
+                <view class="check-box" @click="toggleSubscribeEmail">
+                  <up-checkbox-group v-model="subscribeEmailGroup" @change="onSubscribeEmailChange">
+                    <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
+                                 name="subscribeEmail"
+                                 class="wcg-checkbox"></up-checkbox>
+                  </up-checkbox-group>
+                  <text class="checkbox-label">{{ t('signup.agree1') }}</text>
+                </view>
+              </uni-forms-item>
+            </uni-forms>
+            <view>
+              <u-button class="regiset-btn" @click="register">
+                {{ t('signup.button') }}
+              </u-button>
+            </view>
+            <view class="des-bottom">
+              <text v-t="'signup.agreemnet1'"></text>
+              <a @click="openUrl('pdf/Client_Agreement.pdf')" target="_blank" v-t="'signup.agreemnet2'"></a>
+              <text v-t="'signup.agreemnet3'"></text>
+              <a @click="openUrl('pdf/Terms&Conditions.pdf')" target="_blank" v-t="'signup.agreemnet4'"></a>
+              <text v-t="'signup.agreemnet5'"></text>
+              <a @click="openUrl('pdf/Privacy_Policy.pdf')" target="_blank" v-t="'signup.agreemnet6'"></a>
+              <text v-t="'signup.agreemnet7'"></text>
+            </view>
+          </uni-col>
 
-            </uni-row>
-            <uni-forms-item name="agree">
-              <view class="check-box" @click="toggleAgree">
-                <up-checkbox-group v-model="agreeGroup" @change="onAgreeChange">
-                  <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
-                               name="agree"
-                               class="wcg-checkbox"></up-checkbox>
-                </up-checkbox-group>
-                <text class="checkbox-label">{{ t('signup.agree') }}</text>
-              </view>
-            </uni-forms-item>
-            <uni-forms-item name="isSubscribeEmail">
-              <view class="check-box" @click="toggleSubscribeEmail">
-                <up-checkbox-group v-model="subscribeEmailGroup" @change="onSubscribeEmailChange">
-                  <up-checkbox size="14" labelSize="14" labelColor="#666666" activeColor="#ea002a"
-                               name="subscribeEmail"
-                               class="wcg-checkbox"></up-checkbox>
-                </up-checkbox-group>
-                <text class="checkbox-label">{{ t('signup.agree1') }}</text>
-              </view>
-            </uni-forms-item>
-          </uni-forms>
-          <view>
-            <u-button class="regiset-btn" @click="register">
-              {{ t('signup.button') }}
-            </u-button>
-          </view>
-          <view class="des-bottom">
-            <text v-t="'signup.agreemnet1'"></text>
-            <a @click="openUrl('pdf/Client_Agreement.pdf')" target="_blank" v-t="'signup.agreemnet2'"></a>
-            <text v-t="'signup.agreemnet3'"></text>
-            <a @click="openUrl('pdf/Terms&Conditions.pdf')" target="_blank" v-t="'signup.agreemnet4'"></a>
-            <text v-t="'signup.agreemnet5'"></text>
-            <a @click="openUrl('pdf/Privacy_Policy.pdf')" target="_blank" v-t="'signup.agreemnet6'"></a>
-            <text v-t="'signup.agreemnet7'"></text>
-          </view>
-          <!--          <view class="or-title">-->
-          <!--            <view class="line"></view>-->
-          <!--            <view class="qr-tit2">OR</view>-->
-          <!--            <view class="line"></view>-->
-          <!--          </view>-->
-          <!--          <uni-row :gutter="20">-->
-          <!--            <uni-col :xs="24" :md="12">-->
-          <!--              <u-button class="login-btn">-->
-          <!--                {{ t('signup.button') }}-->
-          <!--              </u-button>-->
-          <!--            </uni-col>-->
-          <!--            <uni-col :xs="24" :md="12">-->
-          <!--              <u-button class="login-btn">-->
-          <!--                {{ t('signup.button') }}-->
-          <!--              </u-button>-->
-          <!--            </uni-col>-->
-          <!--          </uni-row>-->
-        </uni-col>
-
-      </uni-row>
-    </view>
+        </uni-row>
+      </view>
 
 <!--    <cwg-custom-footer />-->
   </cwg-page-wrapper>
@@ -146,7 +129,7 @@
   import { useI18n } from 'vue-i18n'
   import { useEmailCountdown } from '@/hooks/useEmailCountdown'
   import { loginApi } from '@/api/login'
-  import { systemApi } from '@/api/system'
+  import { countryApi } from '@/api/country'
   import Config from '@/config/index'
   import { showToast } from '@/utils/toast'
   import { onLoad } from '@dcloudio/uni-app'
@@ -154,8 +137,10 @@
   import { userToken } from '@/composables/config'
   import { userApi } from '@/api/user'
   import { openLocalPdf } from '@/utils/pdf.js'
+  import ImportModel from './components/ImportModel.vue'
 
   const { t } = useI18n()
+  const { Code } = Config
   const userStore = useUserStore()
 
   const {
@@ -165,6 +150,7 @@
     start,
     restore,
   } = useEmailCountdown()
+  const status = ref(false)
 
   const isRouteHasId = ref(false)
   const formData = ref({
@@ -337,13 +323,12 @@
     }
   })
   const ho = ref('')
-  // 账号类型
-  const accountType = ref(1)
+
 
   const form = ref(null)
   const value = ref('')
   const mock_options = ref([])
-  const countryCode = ref('')
+  const countryCode = ref('my')
   const countryOptions = computed(() => {
     return mock_options.value.map(item => ({
       text: item.name,
@@ -352,16 +337,12 @@
     }))
   })
 
-  watch(value, (newValue, oldValue) => {
-    //  console.log('v-model', newValue);
-  })
-
+  // 国家列表
   async function getCountry() {
     try {
-      let res = await systemApi.countryGet({})
+      let res = await countryApi.Country({})
       if (res.code == 200) { // Code.StatusOK
         mock_options.value = res.data
-        countryCode.value = res.msg
       } else {
         showToast(res.msg)
       }
@@ -370,6 +351,16 @@
     }
   }
 
+  //获取当前国家编码
+  const getCountryMsg = async () => {
+    let res = await countryApi.CountryGet({})
+    if (res.code == Code.StatusOK) {
+      countryCode.value = res.msg
+    } else {
+      console.log(res)
+    }
+  }
+
   // 获取验证码按钮点击
   async function handleGetCode() {
     if (!formData.value.birthDate) {
@@ -414,16 +405,17 @@
     }
   }
 
+  const handleModelConfirm = () => {
+    // 弹窗确认后的处理
+    status.value = false
+  }
 
   const register = async () => {
     if (countryCode.value == 'MY' || countryCode.value == 'ID') {
       status.value = true
       return
     }
-    console.log(123333)
     form.value.validate().then(async (res) => {
-
-
       // 中国(含港澳台)使用 X-System: B,非中国使用 X-System: A
       const chinaCountryCodes = ['CN']
       const isChina = chinaCountryCodes.includes(formData.value.country)
@@ -434,12 +426,10 @@
         { ...formData.value },
         { headers: { 'X-System': xSystemValue } },
       )
-      console.log(resData)
       if (resData.code == 200) { // Code.StatusOK
         showToast(t('Msg.registerSuc'))
         login()
       } else {
-        console.log(123)
         showToast(resData.msg)
       }
 
@@ -490,47 +480,49 @@
 
   onMounted(() => {
     getCountry()
+    getCountryMsg()
+
     const hostParts = window.location.host.split('.')
     ho.value = hostParts.length > 1 ? hostParts[1] : ''
-
   })
 
 </script>
 
 
-<style lang="scss">  .pwd {
-  list-style: none;
-  padding-left: 0;
-  margin: 0;
-
-  li {
-    font-size: px2rpx(12);
-    color: #999;
-    line-height: px2rpx(20);
-    position: relative;
-    padding-left: px2rpx(16);
-
-    &::before {
-      content: '';
-      position: absolute;
-      left: 0;
-      top: 50%;
-      transform: translateY(-50%);
-      width: px2rpx(6);
-      height: px2rpx(6);
-      border-radius: 50%;
-      background-color: #999;
-    }
+<style lang="scss">
+  .pwd {
+    list-style: none;
+    padding-left: 0;
+    margin: 0;
 
-    &.fit {
-      color: #67c23a;
+    li {
+      font-size: px2rpx(12);
+      color: #999;
+      line-height: px2rpx(20);
+      position: relative;
+      padding-left: px2rpx(16);
 
       &::before {
-        background-color: #67c23a;
+        content: '';
+        position: absolute;
+        left: 0;
+        top: 50%;
+        transform: translateY(-50%);
+        width: px2rpx(6);
+        height: px2rpx(6);
+        border-radius: 50%;
+        background-color: #999;
+      }
+
+      &.fit {
+        color: #67c23a;
+
+        &::before {
+          background-color: #67c23a;
+        }
       }
     }
   }
-}
 </style>
 <style lang="scss" scoped>
   @import "@/uni.scss";
@@ -545,6 +537,17 @@
     padding: 0;
   }
 
+  .content-wrapper {
+    max-width: px2rpx(1224);
+    width: 100%;
+    margin: 0 auto;
+    padding-top: px2rpx(20);
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    min-height: calc(100vh - 56px);
+  }
   .regist-content {
     display: flex;
     align-items: center;