瀏覽代碼

Merge remote-tracking branch 'origin/development' into development

spy 3 周之前
父節點
當前提交
4c5b34cb3c

+ 37 - 8
src/views/home/components/go-enter.vue

@@ -3,11 +3,7 @@
   <div v-if="currentStep === 0" class="home-entry">
     <h3 class="title"><el-image :src="homeIcon" class="homeIcon" />免费入驻店铺</h3>
     <div class="steps-container">
-      <el-steps
-        align-center
-        :active="storeApplicationStatus == 0 || storeApplicationStatus == 2 ? 2 : 0"
-        :finish-status="storeApplicationStatus == 0 || storeApplicationStatus == 2 ? 'success' : undefined"
-      >
+      <el-steps align-center :active="stepActive" :finish-status="stepFinishStatus">
         <el-step v-for="(item, index) in entryList" :key="index">
           <template #title>
             <div class="step-title-wrapper">
@@ -28,12 +24,13 @@
         审核拒绝,重新入驻
       </el-button>
       <el-button type="primary" size="large" class="register-btn" v-else-if="storeApplicationStatus == 0"> 等待审核 </el-button>
-      <el-button type="primary" size="large" class="register-btn" @click="handleRegister" v-else> 去入驻 </el-button>
+      <el-button type="primary" size="large" class="register-btn" @click="handleGoEnter" v-else> 去入驻 </el-button>
     </div>
   </div>
 </template>
 <script setup lang="ts">
-import { ref, defineProps, defineEmits } from "vue";
+import { ref, defineProps, defineEmits, computed } from "vue";
+import { localGet } from "@/utils/index";
 import homeIcon from "../../../assets/images/home-icon.png";
 
 const entryList = ref([
@@ -71,11 +68,43 @@ const props = defineProps({
 
 const emit = defineEmits(["update:currentStep"]);
 
+// 检查用户是否已完成个人实名认证
+const hasCompletedRealName = computed(() => {
+  const geekerUser = localGet("geeker-user");
+  return geekerUser?.userInfo?.idCard ? true : false;
+});
+
+// 计算步骤的 active 值
+const stepActive = computed(() => {
+  // 如果审核状态为等待审核(0)或审核拒绝(2),显示第三步
+  if (props.storeApplicationStatus == 0 || props.storeApplicationStatus == 2) {
+    return 2;
+  }
+  // 如果已完成个人实名认证,显示第二步
+  if (hasCompletedRealName.value) {
+    return 1;
+  }
+  // 否则显示第一步
+  return 0;
+});
+
+// 计算 finish-status
+const stepFinishStatus = computed(() => {
+  // 如果审核状态为等待审核(0)或审核拒绝(2),或者已完成个人实名认证,显示成功状态
+  if (props.storeApplicationStatus == 0 || props.storeApplicationStatus == 2 || hasCompletedRealName.value) {
+    return "success";
+  }
+  return undefined;
+});
+
 // 处理入驻按钮
-// 点击后跳转到 go-flow 组件(步骤1:个人实名)
+// 点击后跳转到 go-flow 组件(步骤1:填写信息
 const handleRegister = () => {
   emit("update:currentStep", 2);
 };
+const handleGoEnter = () => {
+  emit("update:currentStep", 1);
+};
 </script>
 
 <style scoped lang="scss">

+ 7 - 4
src/views/storeDecoration/menuManagement/index.vue

@@ -131,7 +131,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, computed, onMounted } from "vue";
+import { ref, reactive, computed, onMounted, nextTick } from "vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 import type { FormInstance, FormRules } from "element-plus";
 import { Picture } from "@element-plus/icons-vue";
@@ -254,10 +254,12 @@ const rules = reactive<FormRules>({
 });
 
 // Tab切换
-const handleTabClick = async () => {
+const handleTabClick = async val => {
   pageable.pageNum = 1;
-  await loadDishList();
-  updatePagination();
+  nextTick(async () => {
+    await loadDishList();
+    updatePagination();
+  });
 };
 
 // 更新分页总数
@@ -540,6 +542,7 @@ const loadDishList = async () => {
 
     // 根据tab切换调用不同的dishType参数
     // dishType: 0表示菜单, 1表示推荐
+    console.log(activeTab.value, activeTab.value === "recommended" ? 1 : 0, "zz---xx");
     const dishType = activeTab.value === "recommended" ? 1 : 0;
     const res: any = await getDishList({ storeId: Number(storeId), dishType });
 

+ 20 - 13
src/views/ticketManagement/newCoupon.vue

@@ -38,7 +38,7 @@
             />
           </el-form-item>
           <!-- 有效期 -->
-          <el-form-item label="有效期" prop="specifiedDay">
+          <el-form-item label="有效期(天)" prop="specifiedDay">
             <el-input v-model="couponModel.specifiedDay" maxlength="15" placeholder="请输入" clearable />
           </el-form-item>
           <!-- 库存 -->
@@ -173,6 +173,7 @@ const rules = reactive({
     }
   ],
   minimumSpendingAmount: [
+    { required: true, message: "请输入最低消费金额" },
     {
       validator: (rule: any, value: any, callback: any) => {
         if (couponModel.value.hasMinimumSpend === 1) {
@@ -180,6 +181,12 @@ const rules = reactive({
             callback(new Error("请输入最低消费金额"));
             return;
           }
+          const strValue = value.toString().trim();
+          // 检查是否有前导零(除了单独的"0"或"0."开头的小数)
+          if (strValue.length > 1 && strValue.startsWith("0") && strValue !== "0" && !strValue.startsWith("0.")) {
+            callback(new Error("最低消费金额必须为正数"));
+            return;
+          }
           validatePositiveNumber("最低消费金额必须为正数")(rule, value, callback);
         } else {
           callback();
@@ -288,18 +295,18 @@ watch(
  * 监听最低消费金额变化
  * 当最低消费金额大于0时,自动设置为"是",否则设置为"否"
  */
-watch(
-  () => couponModel.value.minimumSpendingAmount,
-  newVal => {
-    if (isInitializing.value) return;
-    const amount = Number(newVal);
-    if (!isNaN(amount) && amount > 0) {
-      couponModel.value.hasMinimumSpend = 1;
-    } else {
-      couponModel.value.hasMinimumSpend = 0;
-    }
-  }
-);
+// watch(
+//   () => couponModel.value.minimumSpendingAmount,
+//   newVal => {
+//     if (isInitializing.value) return;
+//     const amount = Number(newVal);
+//     if (!isNaN(amount) && amount > 0) {
+//       couponModel.value.hasMinimumSpend = 1;
+//     } else {
+//       couponModel.value.hasMinimumSpend = 0;
+//     }
+//   }
+// );
 
 // ==================== 事件处理函数 ====================
 /**