hurx 1 mesiac pred
rodič
commit
fb38d57873

+ 2 - 1
src/utils/siteConfig.ts

@@ -78,7 +78,8 @@ export const SITE_ROUTES: Record<any, string[]> = {
     '/valueAdded/maintenanceApply',
     '/enterprise/messageNotice',
     '/enterprise/securitySetting',
-    '/enterprise/securitySetting/resetPassword'
+    '/enterprise/securitySetting/resetPassword',
+    '/enterprise/securitySetting/changePhone'
   ], //订单列表
 
   i: ['/i'], //个人信息

+ 18 - 17
src/views/enterprise/securitySetting/changePhone.vue

@@ -44,8 +44,8 @@
       <!-- 步骤1:验证身份 -->
       <div class="step-content" v-if="currentStep === 1">
         <div class="phone-info">
-          <span>已绑定的手机:</span>
-          <span class="phone-number">180****7722</span>
+          <span>已绑定的手机:{{ step1Form.phone }}</span>
+          <span class="phone-number"></span>
         </div>
         <div class="phone-tip">若该手机号已无法使用请联系客服</div>
 
@@ -62,7 +62,7 @@
         </el-form>
 
         <div class="step-actions">
-          <el-button type="success" class="next-btn" @click="handleNextStep">下一步</el-button>
+          <el-button type="danger" class="next-btn" @click="handleNextStep">下一步</el-button>
         </div>
 
         <!-- 温馨提醒 -->
@@ -90,17 +90,17 @@
         </el-form>
         <div class="step-actions">
           <el-button @click="currentStep = 1">上一步</el-button>
-          <el-button type="success" class="next-btn" @click="handleSubmit">确认更换</el-button>
+          <el-button type="danger" class="next-btn" @click="handleSubmit">确认更换</el-button>
         </div>
       </div>
 
       <!-- 步骤3:完成 -->
       <div class="step-content" v-if="currentStep === 3">
         <div class="success-content">
-          <el-icon class="success-icon" color="#52c41a" :size="60"><CircleCheckFilled /></el-icon>
+          <el-icon class="success-icon" color="#e60012" :size="60"><CircleCheckFilled /></el-icon>
           <div class="success-title">手机号码更换成功!</div>
           <div class="success-desc">您的安全手机已更换为 {{ step2Form.newPhone }}</div>
-          <el-button type="success" @click="$router.push('/enterprise/securitySetting')">返回安全设置</el-button>
+          <el-button type="danger" @click="$router.push('/enterprise/securitySetting')">返回安全设置</el-button>
         </div>
       </div>
     </div>
@@ -109,14 +109,15 @@
 
 <script setup lang="ts">
 import { ref, reactive } from 'vue';
-import { Check, CircleCheckFilled } from '@element-plus/icons-vue';
+import { Check, CircleCheckFilled, Phone } from '@element-plus/icons-vue';
 import { ElMessage } from 'element-plus';
-
+import { useRoute } from 'vue-router';
 const currentStep = ref(1);
-
+const route = useRoute();
 // 步骤1表单
 const step1FormRef = ref();
 const step1Form = reactive({
+  phone: route.query.phone,
   code: '',
   verified: false
 });
@@ -281,22 +282,22 @@ const handleSubmit = async () => {
 
   &.active {
     .step-circle {
-      border-color: #52c41a;
-      color: #52c41a;
+      border-color: #e60012;
+      color: #e60012;
     }
     .step-label {
-      color: #52c41a;
+      color: #e60012;
     }
   }
 
   &.done {
     .step-circle {
-      border-color: #52c41a;
-      background: #52c41a;
+      border-color: #e60012;
+      background: #e60012;
       color: #fff;
     }
     .step-label {
-      color: #52c41a;
+      color: #e60012;
     }
   }
 }
@@ -309,7 +310,7 @@ const handleSubmit = async () => {
   margin-bottom: 30px;
 
   &.active {
-    background: #52c41a;
+    background: #e60012;
   }
 }
 
@@ -352,7 +353,7 @@ const handleSubmit = async () => {
 
   .send-code-btn {
     margin-left: 15px;
-    color: #52c41a;
+    color: #e60012;
   }
 
   .verify-checkbox {

+ 14 - 4
src/views/enterprise/securitySetting/index.vue

@@ -34,7 +34,7 @@
       </div>
 
       <!-- 安全手机 -->
-      <!-- <div class="setting-card">
+      <div class="setting-card">
         <div class="setting-icon">
           <el-icon :size="20" color="#fff"><Grid /></el-icon>
         </div>
@@ -43,7 +43,7 @@
           <div class="setting-desc">安全手机可以用于登录帐号,重置密码或其他安全验证</div>
         </div>
         <el-button type="danger" @click="handleChangePhone">更换</el-button>
-      </div> -->
+      </div>
     </div>
 
     <!-- 修改密码弹窗 -->
@@ -141,7 +141,12 @@ const handleBack = () => {
   router.push('/enterprise/companyInfo');
 };
 const handleModifyPassword = () => {
-  router.push('/enterprise/securitySetting/resetPassword');
+  router.push({
+    path: '/enterprise/securitySetting/resetPassword',
+    query: {
+      phone: securityData.phone
+    }
+  });
 };
 const getCurrentUser = async () => {
   const res = await getCurrentUserInfo();
@@ -157,7 +162,12 @@ const handleSavePassword = async () => {
   passwordDialogVisible.value = false;
 };
 const handleChangePhone = () => {
-  router.push('/enterprise/securitySetting/changePhone');
+  router.push({
+    path: '/enterprise/securitySetting/changePhone',
+    query: {
+      phone: securityData.phone
+    }
+  });
 };
 const handleSendCode = () => {
   if (!phoneForm.phone) {

+ 27 - 9
src/views/enterprise/securitySetting/resetPassword.vue

@@ -82,7 +82,7 @@
       <!-- 步骤3:完成 -->
       <div class="step-content" v-if="currentStep === 3">
         <div class="success-content">
-          <el-icon class="success-icon" color="#52c41a" :size="60"><CircleCheckFilled /></el-icon>
+          <el-icon class="success-icon" color="#e60012" :size="60"><CircleCheckFilled /></el-icon>
           <div class="success-title">密码重置成功!</div>
           <div class="success-desc">您的登录密码已重置成功,请使用新密码登录</div>
           <el-button type="danger" @click="$router.push('/enterprise/securitySetting')">返回安全设置</el-button>
@@ -96,13 +96,16 @@
 import { ref, reactive } from 'vue';
 import { Check, CircleCheckFilled } from '@element-plus/icons-vue';
 import { ElMessage } from 'element-plus';
+import { useRoute } from 'vue-router';
+import { changePwd } from '@/api/pc/enterprise/index';
 
 const currentStep = ref(1);
+const route = useRoute();
 
 // 步骤1表单
 const step1FormRef = ref();
 const step1Form = reactive({
-  phone: '18062697722',
+  phone: route.query.phone as any,
   code: '',
   verified: false
 });
@@ -169,9 +172,24 @@ const handleSubmit = async () => {
   const valid = await step2FormRef.value?.validate().catch(() => false);
   if (!valid) return;
 
-  // TODO: 调用修改密码接口
-  ElMessage.success('密码重置成功');
-  currentStep.value = 3;
+  try {
+    const submitData = {
+      phone: step1Form.phone,
+      code: step1Form.code,
+      password: step2Form.newPassword,
+      confirmPassword: step2Form.confirmPassword
+    };
+
+    const res: any = await changePwd(submitData);
+    if (res.code === 200) {
+      ElMessage.success('密码重置成功');
+      currentStep.value = 3;
+    } else {
+      ElMessage.error(res.msg || '密码修改失败');
+    }
+  } catch (error) {
+    console.error('修改密码失败:', error);
+  }
 };
 </script>
 
@@ -270,12 +288,12 @@ const handleSubmit = async () => {
 
   &.done {
     .step-circle {
-      border-color: #52c41a;
-      background: #52c41a;
+      border-color: #e60012;
+      background: #e60012;
       color: #fff;
     }
     .step-label {
-      color: #52c41a;
+      color: #e60012;
     }
   }
 }
@@ -288,7 +306,7 @@ const handleSubmit = async () => {
   margin-bottom: 30px;
 
   &.active {
-    background: #52c41a;
+    background: #e60012;
   }
 }
 

+ 15 - 3
src/views/order/orderManage/index.vue

@@ -361,7 +361,14 @@ const handleAddCart = async (order: any) => {
   //   }
   // });
 };
-
+const formatDate = (date: Date | string | number): string => {
+  if (!date) return '';
+  const d = new Date(date);
+  const year = d.getFullYear();
+  const month = String(d.getMonth() + 1).padStart(2, '0');
+  const day = String(d.getDate()).padStart(2, '0');
+  return `${year}-${month}-${day}`;
+};
 // 获取订单列表
 const fetchOrderList = async () => {
   loading.value = true;
@@ -377,8 +384,13 @@ const fetchOrderList = async () => {
     if (queryParams.status) params.orderStatuses = queryParams.status; // 使用orderStatuses支持多状态查询
     if (queryParams.payType) params.payType = queryParams.payType;
     if (queryParams.dateRange && queryParams.dateRange.length == 2) {
-      params.beginTime = queryParams.dateRange[0];
-      params.endTime = queryParams.dateRange[1];
+      // params.beginTime = queryParams.dateRange[0];
+      // params.endTime = queryParams.dateRange[1];
+      params.params = {
+        beginTime: formatDate(queryParams.dateRange[0]), // 将日期转换为字符串格式
+
+        endTime: formatDate(queryParams.dateRange[1]) // 将日期转换为字符串格式
+      };
     }
 
     console.log('发送到后端的参数:', params);