Bladeren bron

打线上包

yinxiangke 3 weken geleden
bovenliggende
commit
f6ba358314
8 gewijzigde bestanden met toevoegingen van 66 en 25 verwijderingen
  1. 2 2
      .env.development
  2. 1 0
      .env.production
  3. 0 1
      src/App.vue
  4. 1 0
      src/locales/en.js
  5. 1 0
      src/locales/zh-CN.js
  6. 44 13
      src/pages/Member.vue
  7. 1 1
      src/pages/Personal/Wallet.vue
  8. 16 8
      src/pages/PersonalCenter.vue

+ 2 - 2
.env.development

@@ -1,6 +1,6 @@
 # 乔功
-# VITE_API_BASE_URL=http://192.168.100.134:8080/api
-VITE_API_BASE_URL=http://47.104.167.40/prod-api/api
+VITE_API_BASE_URL=http://192.168.100.134:8080/api
+# VITE_API_BASE_URL=http://47.104.167.40/prod-api/api
 # VITE_API_BASE_URL=http://192.168.100.134:8080/api
 # VITE_API_BASE_URL=http://192.168.101.12:8080/api
 # 高运甲

+ 1 - 0
.env.production

@@ -0,0 +1 @@
+VITE_API_BASE_URL=http://47.104.167.40/prod-api/api

+ 0 - 1
src/App.vue

@@ -235,7 +235,6 @@ provide('openLoginDialog', openLoginDialog);
   background: url('/src/assets/imgs/header-bj@2x.png') no-repeat;
   background-size: cover;
   position: fixed;
-  z-index: -1;
 }
 
 .el-footer {

+ 1 - 0
src/locales/en.js

@@ -348,6 +348,7 @@ export default {
     yijiejue:'Resolved',
     daijiejue:'To be resolved',
     shouxufei:'Handling fee',
+    shouxufeilv:'Handling fee rate',
     tixianfangshi:'Withdrawal method',
     tixianzhanghao:'Withdrawal account',
     shenqingshijian:'Application time',

+ 1 - 0
src/locales/zh-CN.js

@@ -351,6 +351,7 @@ export default {
     yijiejue:'已解决',
     daijiejue:'待解决',
     shouxufei:'手续费',
+    shouxufeilv:'手续费率',
     tixianfangshi:'提现方式',
     tixianzhanghao:'提现账号',
     shenqingshijian:'申请时间',

+ 44 - 13
src/pages/Member.vue

@@ -14,11 +14,11 @@
           <div class="price-left">
             <span>¥</span>
             <span>{{ item.price }}</span>
-            <span>/{{ item.durationUnit }}</span>
+            <!-- <span>/{{ item.durationUnit }}</span> -->
           </div>
           <!-- <div class="price-right">¥79.00/月</div> -->
         </div>
-        <div class="btn" @click="confirmBuy({
+        <div class="btn" :class="{btns:item.memberType == 2}" @click="confirmBuy({
           callback: getList,
           appStore,
           router,
@@ -29,11 +29,16 @@
           orderType: 'member_recharge',
           payMethod: 'BMI'
         })">{{ $t('personalCenter.activate') }}{{ item.typeName }}</div>
-        <div class="line">{{ $t('personalCenter.zxqy') }}</div>
+        <div class="line">
+          <div class=""></div>
+          <div class="">{{ $t('personalCenter.zxqy') }}</div>
+          <div class=""></div>
+        </div>
         <div class="ul">
           <div v-for="(em, ind) in privilegeRes[item.memberType]" :key="ind" class="li flex-center-between">
             <div class="">{{ em.privilegeName }}</div>
-            <div class="">{{ em.privilegeValue == -1 ? $t('personalCenter.wx') : `${em.privilegeValue}${em.unit ? em.unit : ''}`  }}</div>
+            <div class="">{{ em.privilegeValue == -1 ? $t('personalCenter.wx') : `${em.privilegeValue}${em.unit ?
+              em.unit : ''}` }}</div>
           </div>
         </div>
       </li>
@@ -72,7 +77,7 @@ const getprivilegeRes = async (memberType) => {
 }
 
 const getList = async () => {
-  
+
   let privilegeRes1 = await privilege(1);
   let privilegeRes2 = await privilege(2);
   for (const key in privilegeRes.value) {
@@ -101,6 +106,7 @@ li {
 .member {
   max-width: 1246px;
   margin: 0 auto;
+  position: relative;
 }
 
 .member-head {
@@ -189,16 +195,41 @@ li {
       background: linear-gradient(270deg, #FBE8CF 0%, #F8C79D 52.05%, #FADCB9 100%);
       border-radius: 10px;
     }
+    .btns {
+      color: #FAD8B4;
+      background: #3B3843;
+    }
 
     .line {
-      width: 164px;
-      color: #8B3D22;
-      font-weight: bold;
-      font-size: 14px;
-      text-align: center;
-      background: url('/src/assets/imgs/line@2x.png') no-repeat;
-      background-size: 164px 3px;
-      background-position: center center;
+      // width: 164px;
+      display: flex;
+      align-items: center;
+      // background: url('/src/assets/imgs/line@2x.png') no-repeat;
+      // background-size: 164px 3px;
+      // background-position: center center;
+      div {
+        &:nth-child(2) {
+          color: #8B3D22;
+          font-weight: bold;
+          font-size: 14px;
+          text-align: center;
+          margin: 0 8px;
+        }
+
+        &:first-child,
+        &:last-child {
+          width: 46px;
+          height: 3px;
+         
+         
+        }
+        &:first-child {
+           background: linear-gradient(270deg, #8B3D22 0%, rgba(139, 61, 34, 0) 100%);
+        }
+        &:last-child {
+          background: linear-gradient(90deg, #8B3D22 0%, rgba(139, 61, 34, 0) 100%);
+        }
+      }
     }
 
     .ul {

+ 1 - 1
src/pages/Personal/Wallet.vue

@@ -109,7 +109,7 @@
           <el-col :span="24">
             <div class="input">
               <el-form-item v-if="transformationIndex"
-                :label="$t('common.available') + $t('common.mibi') + `(手续费率:${walletForm.feeRate})`">
+                :label="$t('common.available') + $t('common.mibi') + `(${$t('personalCenter.shouxufeilv')}: ${walletForm.feeRate * 100}%)`">
                 <el-input v-model="walletForm.targetAmount" :placeholder="$t('common.placeholderInput')" readonly
                   disabled :input-style="{ fontSize: '28px' }" class="inputStyle" />
               </el-form-item>

+ 16 - 8
src/pages/PersonalCenter.vue

@@ -32,7 +32,7 @@
 
           </div>
           <div class="personal-head-right">
-            <div @click="dialogVisible = true" class="personal-head-right-li">
+            <div @click="changeSHow" class="personal-head-right-li">
               <img src="/src/assets/imgs/my/bianji@2x.png" alt="">
               <div class="">{{ $t('personalCenter.editProfile') }}</div>
             </div>
@@ -206,7 +206,7 @@
 
 
 
-    <el-dialog v-model="dialogVisible" :title="$t('personalCenter.editProfile')" width="784">
+    <el-dialog v-model="dialogVisible" :title="$t('personalCenter.editProfile')" width="784" :destroy-on-close="true">
       <el-form ref="userFormRef" :model="userInfo" label-width="auto" label-position="top" :rules="rules">
         <el-row :gutter="16">
           <el-col :span="12">
@@ -409,7 +409,7 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer flex-center">
-          <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
+          <el-button @click="userInfo = {},dialogVisible = false">{{ $t('common.cancel') }}</el-button>
           <el-button class="gradient" type="primary" @click="handleConfirm(userFormRef)">
             {{ $t('common.confirm') }}
           </el-button>
@@ -658,7 +658,8 @@ const emailCountdown = ref(0)
 
 // 正则表达式
 const PHONE_REGEX = /^1[3-9]\d{9}$/;
-const EMAIL_REGEX = /^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$/;
+// 优化后的邮箱正则(兼顾准确性和实用性)
+const EMAIL_REGEX = /^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/;
 const isPasswordPhone = computed(() => {
   return PHONE_REGEX.test(passwordForm.account);
 });
@@ -684,17 +685,17 @@ const sendSmsCode = async () => {
   }
 
   // 验证手机号格式 
-  if (!PHONE_REGEX.test(account) && !EMAIL_REGEX.test(account)) {
+  if ((!PHONE_REGEX.test(account) && appStore?.userInfo?.email) || (!EMAIL_REGEX.test(account) && appStore?.userInfo?.userPhone)) {
     DGTMessage.warning(appStore?.userInfo?.userPhone ? t('common.pleaseInputRightEmail') : t('common.pleaseInputRightPhoneNumber'))
     return
   }
 
   let res = null;
-  if (PHONE_REGEX.test(account)) {
+  if (PHONE_REGEX.test(account) && appStore?.userInfo?.email) {
     res = await getSmsCode({
       phone: account
     })
-  } else if (EMAIL_REGEX.test(account)) {
+  } else if (EMAIL_REGEX.test(account) && appStore?.userInfo?.userPhone) {
     res = await getEmailCode({
       email: account
     })
@@ -766,7 +767,7 @@ const handleConfirm = async (formEl) => {
       if (!appStore.userInfo.userPhone || !appStore.userInfo.email) {
         userInfo.value.bindType = appStore.userInfo.userPhone ? 'email' : 'phone'
       }
-      let obj = !appStore.userInfo.userPhone || !appStore.userInfo.email ? { email: userInfo.value.email, bindType: userInfo.value.bindType, userPhone: userInfo.value.userPhone, verifyCode: userInfo.value.verifyCode } : {}
+      let obj = !appStore.userInfo.userPhone && userInfo.value.userPhone || !appStore.userInfo.email && userInfo.value.email ? { email: userInfo.value.email, bindType: userInfo.value.bindType, userPhone: userInfo.value.userPhone, verifyCode: userInfo.value.verifyCode } : {}
       let res = await updateUserInfo({
         nickName: userInfo.value.nickName,
         userAvatar: coverImage.value.map(item => item.url).join(';'),
@@ -803,6 +804,8 @@ const getInfo = async () => {
   }
   if (res?.user?.skillTags) {
     dynamicTags.value = res.user.skillTags.split(',')
+  } else {
+    dynamicTags.value = []
   }
   userInfo.value = res.user;
   navList.value.forEach(item => {
@@ -846,6 +849,11 @@ const getCount = async () => {
   collectCount.value = res?.data?.collectCount;
 }
 
+
+const changeSHow = () => {
+   getInfo()
+  dialogVisible.value = true;
+}
 onMounted(() => {
   getInfo()
   getCount()