Parcourir la source

修复志愿填报vip数据问题

shmily1213 il y a 5 jours
Parent
commit
554a10dc4d

+ 4 - 2
src/components/vip-guide-more/vip-guide-more.vue

@@ -5,13 +5,15 @@
 </template>
 
 <script setup>
+import { EnumEvent } from '@/common/enum';
 import {combineOssFile} from "@/utils";
 import {useSingletonBuyVip} from "@/hooks/useSingletonComponent";
 
 const img = combineOssFile('/static/guide/nomore_unless_vip.png')
 const goBuyVip = () => {
-    const buyVip = useSingletonBuyVip()
-    buyVip.open()
+  uni.$emit(EnumEvent.OPEN_VIP_POPUP);
+    // const buyVip = useSingletonBuyVip()
+    // buyVip.open()
 }
 </script>
 

+ 13 - 10
src/pagesOther/pages/video-center/index/components/video-page-layout.vue

@@ -75,16 +75,19 @@ const handleLeafClick = async ({ node, deep }) => {
   if (deep === 0) {
     node.expanded = !!!node.expanded // 强制展开
     if (empty(node.children)) {
-      if (!node.loading) {
-        node.loading = true
-        try {
-          const payload = { subject: props.subject.code, knowledge: node.code, pageNum: 1, pageSize: 100 }
-          const res = await dispatchCache(cacheActions.getVideoOfKnowledge, payload)
-          node.children = res.rows
-        } catch (e) {
-          node.expanded = false // 异常强制关闭
-        } finally {
-          node.loading = false
+      const hasAuth = hasPermission([EnumUserRole.VIP]);
+      if (hasAuth) {
+        if (!node.loading) {
+          node.loading = true
+          try {
+            const payload = { subject: props.subject.code, knowledge: node.code, pageNum: 1, pageSize: 100 }
+            const res = await dispatchCache(cacheActions.getVideoOfKnowledge, payload)
+            node.children = res.rows
+          } catch (e) {
+            node.expanded = false // 异常强制关闭
+          } finally {
+            node.loading = false
+          }
         }
       }
     }

+ 51 - 51
src/pagesOther/pages/voluntary/index/components/batch-step.vue

@@ -1,54 +1,54 @@
 <template>
-    <view class="p-30 fx-col gap-30">
-        <view class="bg-gradient-to-r from-primary-deep to-primary-light px-20 py-30 rounded-lg">
-            <view class="text-white font-bold">我的成绩</view>
-            <view class="mt-20 fx-row fx-bet-cen text-white text-2xs">
-                <text>省份:{{ userSnapshot.provinceName }}</text>
-                <text>专业类别:{{ userSnapshot.examMajorName }}</text>
-                <text>总分:{{ model.score }}</text>
-            </view>
+  <view class="p-30 fx-col gap-30">
+    <view class="bg-gradient-to-r from-primary-deep to-primary-light px-20 py-30 rounded-lg">
+      <view class="text-white font-bold">我的成绩</view>
+      <view class="mt-20 fx-row fx-bet-cen text-white text-2xs">
+        <text>省份:{{ userSnapshot.location }}</text>
+        <text>专业类别:{{ userSnapshot.examMajorName }}</text>
+        <text>总分:{{ model.score }}</text>
+      </view>
+    </view>
+    <view class="text-center mt-50">(二)选择填报批次</view>
+    <view class="fx-col gap-20 mt-20">
+      <view @click="handleBatchSelect(item)" v-for="item in batchList"
+        class="bg-gradient-to-b from-sky-100 to-white px-30 py-50 fx-row fx-bet-cen mx-card">
+        <view class="flex-1 fx-col">
+          <view class="fx-row items-center">
+            <text class="text-xl mr-10 batch-name">{{ item.name }}</text>
+            <uv-tags v-if="item.recommand" text="重点推荐" type="error" shape="circle" size="mini" />
+          </view>
+          <view class="text-2xs mt-20">{{ item.tips }}</view>
         </view>
-        <view class="text-center mt-50">(二)选择填报批次</view>
-        <view class="fx-col gap-20 mt-20">
-            <view @click="handleBatchSelect(item)" v-for="item in batchList"
-                  class="bg-gradient-to-b from-sky-100 to-white px-30 py-50 fx-row fx-bet-cen mx-card">
-                <view class="flex-1 fx-col">
-                    <view class="fx-row items-center">
-                        <text class="text-xl mr-10 batch-name">{{ item.name }}</text>
-                        <uv-tags v-if="item.recommand" text="重点推荐" type="error" shape="circle" size="mini"/>
-                    </view>
-                    <view class="text-2xs mt-20">{{ item.tips }}</view>
-                </view>
-                <view class="fx-col ai-cen">
-                    <uv-button type="primary" shape="circle" class="pointer-events-none"
-                               color="linear-gradient(to right, var(--primary-deep-color),var(--primary-light-color))"
-                               custom-style="height: 32px; border: none;" text="智能填报"/>
-                    <!--                    <text class="f-tips f10 mt5">可填{{ getCollegeLimit(item.batch) }}所院校</text>-->
-                </view>
-            </view>
+        <view class="fx-col ai-cen">
+          <uv-button type="primary" shape="circle" class="pointer-events-none"
+            color="linear-gradient(to right, var(--primary-deep-color),var(--primary-light-color))"
+            custom-style="height: 32px; border: none;" text="智能填报" />
+          <!--                    <text class="f-tips f10 mt5">可填{{ getCollegeLimit(item.batch) }}所院校</text>-->
         </view>
+      </view>
     </view>
+  </view>
 </template>
 
 <script setup>
-import {watch} from 'vue';
-import {useInjectVoluntaryForm} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
-import {useInjectUserSnapshot} from "@/pagesOther/pages/ie/hooks/useUserSnapshotInjection";
-import {useInjectVoluntaryAssistant} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
-import {useInjectVoluntaryStep} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
+import { watch } from 'vue';
+import { useInjectVoluntaryForm } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
+import { useInjectUserSnapshot } from "@/pagesOther/pages/ie/hooks/useUserSnapshotInjection";
+import { useInjectVoluntaryAssistant } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
+import { useInjectVoluntaryStep } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
 
-const {currentStep} = useInjectVoluntaryStep()
-const {model, batch, batchList, loadBatchList} = useInjectVoluntaryForm()
-const {userSnapshot} = useInjectUserSnapshot()
-const {handleForward} = useInjectVoluntaryAssistant()
+const { currentStep } = useInjectVoluntaryStep()
+const { model, batch, batchList, loadBatchList } = useInjectVoluntaryForm()
+const { userSnapshot } = useInjectUserSnapshot()
+const { handleForward } = useInjectVoluntaryAssistant()
 
 const handleBatchSelect = (item) => {
-    batch.value = item
-    handleForward()
+  batch.value = item
+  handleForward()
 }
 
 watch(currentStep, step => {
-    if (step == 1) loadBatchList()
+  if (step == 1) loadBatchList()
 })
 
 //         getCollegeLimit(batch) {
@@ -59,19 +59,19 @@ watch(currentStep, step => {
 
 <style lang="scss" scoped>
 .batch-name {
-    position: relative;
-    z-index: 10;
+  position: relative;
+  z-index: 10;
 
-    &::before {
-        position: absolute;
-        left: 0;
-        bottom: 0;
-        content: ' ';
-        width: 66rpx;
-        height: 10rpx;
-        border-radius: 5rpx;
-        background: linear-gradient(to right, #FFD423, #FFFFFF);
-        z-index: -1;
-    }
+  &::before {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    content: ' ';
+    width: 66rpx;
+    height: 10rpx;
+    border-radius: 5rpx;
+    background: linear-gradient(to right, #FFD423, #FFFFFF);
+    z-index: -1;
+  }
 }
 </style>

+ 167 - 155
src/pagesOther/pages/voluntary/index/components/cart-step.vue

@@ -1,49 +1,50 @@
 <template>
-    <z-paging ref="paging" v-model="list" :auto="false" :height="safeScrollHeight" auto-show-system-loading
-              @query="handleQuery">
-        <template #top>
-            <slot name="top"/>
-            <mx-condition-dropdown ref="dropdown" x layout="fx-row items-center gap-20 w-max"/>
-        </template>
-        <voluntary-search @search="handleSearch"/>
-        <view class="fx-col p-20 gap-20">
-            <voluntary-item v-for="item in list" :item="item" @major="openMajorPopup(item)" @notify="showNotify"/>
-            <!-- <vip-guide-more v-if="isNotVip"/> -->
-        </view>
-        <template #bottom>
-            <voluntary-bottom @modify="$refs.modifyPopup.open()" @cart="$refs.cartPopup.open()"/>
-        </template>
-    </z-paging>
-    <!--  这里渲染的弹窗不会被back-to-top遮挡  -->
-    <score-batch-popup ref="modifyPopup"/>
-    <voluntary-cart-popup ref="cartPopup"/>
-    <major-popup ref="majorPopup" @notify="showNotify"/>
-    <uv-notify ref="notifier"/>
+  <z-paging ref="paging" v-model="list" :auto="false" :height="safeScrollHeight" auto-show-system-loading
+    @query="handleQuery">
+    <template #top>
+      <slot name="top" />
+      <mx-condition-dropdown ref="dropdown" x layout="fx-row items-center gap-20 w-max" />
+    </template>
+    <voluntary-search @search="handleSearch" />
+    <view class="fx-col p-20 gap-20">
+      <voluntary-item v-for="item in list" :item="item" @major="openMajorPopup(item)" @notify="showNotify" />
+      <vip-guide-more v-if="isNotVip" />
+    </view>
+    <template #bottom>
+      <voluntary-bottom @modify="$refs.modifyPopup.open()" @cart="$refs.cartPopup.open()" />
+    </template>
+  </z-paging>
+
+  <score-batch-popup ref="modifyPopup" />
+  <voluntary-cart-popup ref="cartPopup" />
+  <major-popup ref="majorPopup" @notify="showNotify" />
+  <uv-notify ref="notifier" />
 </template>
 
 <script setup>
-import {computed, ref, watch} from 'vue';
-import {toValue} from "@vueuse/core";
-import {createPropDefine} from "@/utils";
-import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
-import {getRecommendVoluntary, getVoluntaryMarjors} from "@/api/webApi/volunteer";
-import {useUserStore} from "@/hooks/useUserStore";
-import {useInjectVoluntaryForm} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
-import {useInjectVoluntaryAssistant} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
-import {useInjectVoluntaryStep} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
-import {useInjectVoluntaryHeader} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryHeaderInjection";
-import {useVoluntaryMajorGroupIdentifier} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryMajorGroupIdentifier";
-import {useInjectVoluntaryCart} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryCartInjection";
+import { useUserStore as newUseUserStore } from '@/store/userStore';
+import { computed, ref, watch } from 'vue';
+import { toValue } from "@vueuse/core";
+import { createPropDefine } from "@/utils";
+import { sleep } from "@/uni_modules/uv-ui-tools/libs/function";
+import { getRecommendVoluntary, getVoluntaryMarjors } from "@/api/webApi/volunteer";
+import { useUserStore } from "@/hooks/useUserStore";
+import { useInjectVoluntaryForm } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
+import { useInjectVoluntaryAssistant } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
+import { useInjectVoluntaryStep } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
+import { useInjectVoluntaryHeader } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryHeaderInjection";
+import { useVoluntaryMajorGroupIdentifier } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryMajorGroupIdentifier";
+import { useInjectVoluntaryCart } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryCartInjection";
 import VoluntaryItem from "@/pagesOther/pages/voluntary/index/components/voluntary-item.vue";
 import VoluntaryBottom from "@/pagesOther/pages/voluntary/index/components/voluntary-bottom.vue";
 import MajorPopup from "@/pagesOther/pages/voluntary/index/components/major-popup.vue";
 import ScoreBatchPopup from "@/pagesOther/pages/voluntary/index/components/score-batch-popup.vue";
 import VoluntaryCartPopup from "@/pagesOther/pages/voluntary/index/components/voluntary-cart-popup.vue";
 import VoluntarySearch from "@/pagesOther/pages/voluntary/index/components/voluntary-search.vue";
-import {useProvideVoluntarySearch} from "@/pagesOther/pages/voluntary/hooks/useVoluntarySearchInjection";
+import { useProvideVoluntarySearch } from "@/pagesOther/pages/voluntary/hooks/useVoluntarySearchInjection";
 
 const props = defineProps({
-    editMode: createPropDefine(false, Boolean)
+  editMode: createPropDefine(false, Boolean)
 })
 
 const paging = ref(null)
@@ -51,176 +52,187 @@ const notifier = ref(null)
 const majorPopup = ref(null)
 const cartPopup = ref(null)
 const dropdown = ref(null)
-const {currentUser, GetInfo, isBind} = useUserStore()
-const {model, batch, mode} = useInjectVoluntaryForm()
-const {currentStep} = useInjectVoluntaryStep()
+const { currentUser, GetInfo, isBind } = useUserStore()
+const { model, batch, mode } = useInjectVoluntaryForm()
+const { currentStep } = useInjectVoluntaryStep()
+const userStore = newUseUserStore();
 const {
-    resetCart, total, list, selectedList,
-    syncMajorGroupToSelected, syncMajorsToSelectedGroup
+  resetCart, total, list, selectedList,
+  syncMajorGroupToSelected, syncMajorsToSelectedGroup
 } = useInjectVoluntaryCart()
-const {scrollHeight, onBeforeBack, save} = useInjectVoluntaryAssistant() // 填报页下面有原生tabs,必须手动设置高度
-const {isMock, ensureHistoryYears} = useInjectVoluntaryHeader()
+const { scrollHeight, onBeforeBack, save } = useInjectVoluntaryAssistant() // 填报页下面有原生tabs,必须手动设置高度
+const { isMock, ensureHistoryYears } = useInjectVoluntaryHeader()
 
-const {formatQueryParams, onSearch, reset: resetCondition} = useProvideVoluntarySearch()
+const { formatQueryParams, onSearch, reset: resetCondition } = useProvideVoluntarySearch()
 
 const safeScrollHeight = computed(() => scrollHeight ? toValue(scrollHeight) + 'px' : undefined)
 const isNotVip = computed(() => {
-    return !toValue(isBind) && toValue(total) > 1
+  return !toValue(isBind) && toValue(total) > 1
 })
 
 const showNotify = (message) => {
-    const msg = message || '未发布详细的征集信息'
-    notifier.value.show({
-        message: msg,
-        type: 'warning',
-        top: 1
-    })
+  const msg = message || '未发布详细的征集信息'
+  notifier.value.show({
+    message: msg,
+    type: 'warning',
+    top: 1
+  })
 }
 
 const openMajorPopup = (item) => {
-    if (item.isExpand) {
-        return majorPopup.value.open(item)
-    } else {
-        item.isExpand = true
-        loadMajorDetails(item)
-    }
+  if (item.isExpand) {
+    return majorPopup.value.open(item)
+  } else {
+    item.isExpand = true
+    loadMajorDetails(item)
+  }
 }
 
 const loadMajorDetails = (item) => {
-    uni.showLoading()
-    getVoluntaryMarjors({
-        batchName: toValue(batch).name,
-        collegeCode: item.recruitPlan.collegeCode,
-        jCode: item.jCode,
-        mode: toValue(mode),
-        universityId: item.recruitPlan.universityId,
-        year: item.recruitPlan.year,
-        score: toValue(model).score
-    }).then(res => {
-        syncMajorsToSelectedGroup(res.data, item)
-        item.majors = res.data
-        majorPopup.value.open(item)
-    }).finally(() => uni.hideLoading())
+  uni.showLoading()
+  getVoluntaryMarjors({
+    batchName: toValue(batch).name,
+    collegeCode: item.recruitPlan.collegeCode,
+    jCode: item.jCode,
+    mode: toValue(mode),
+    universityId: item.recruitPlan.universityId,
+    year: item.recruitPlan.year,
+    score: toValue(model).score
+  }).then(res => {
+    syncMajorsToSelectedGroup(res.data, item)
+    item.majors = res.data
+    majorPopup.value.open(item)
+  }).finally(() => uni.hideLoading())
 }
 
 
 const syncUserScoreByNeed = (query) => {
-    const {score, seatInput/*, mode*/} = toValue(currentUser)
-    // if query score mode seatInput changed, re-call getInfo.
-    if (query.score != score ||
-        // query.mode != mode ||
-        query.seatInput != seatInput) {
-        GetInfo()
-    }
+  const { score, seatInput/*, mode*/ } = toValue(currentUser)
+  // if query score mode seatInput changed, re-call getInfo.
+  if (query.score != score ||
+    // query.mode != mode ||
+    query.seatInput != seatInput) {
+    GetInfo()
+  }
 }
 
 const handleQuery = async (pageNum, pageSize) => {
-    const batchVal = toValue(batch)
-    const modelVal = toValue(model)
-    const batchData = {
-        batchName: batchVal.name,
-        batch: batchVal.batch,
-        batchMinScore: batchVal.score2 || batchVal.score1
-    }
-    const modelData = {
-        mode: toValue(mode),
-        score: modelVal.score,
-        seatInput: modelVal.seatInput
-    }
-    const data = {
-        ...batchData,
-        ...modelData,
-        ...formatQueryParams()
-    }
-    const res = await getRecommendVoluntary(data, {pageNum, pageSize})
-
-    if (pageNum == 1) syncUserScoreByNeed(data)
-    total.value = res.total
-    // make reactive properties
-    let rows = {}
-    rows = res.rows.map(item => {
-        item.isExpand = false
-        item.majors = []
-        return item
-    })
-    rows.forEach(useVoluntaryMajorGroupIdentifier)
-    // 回显
-    syncMajorGroupToSelected(rows)
+  const batchVal = toValue(batch)
+  const modelVal = toValue(model)
+  const batchData = {
+    batchName: batchVal.name,
+    batch: batchVal.batch,
+    batchMinScore: batchVal.score2 || batchVal.score1
+  }
+  const modelData = {
+    mode: toValue(mode),
+    score: modelVal.score,
+    seatInput: modelVal.seatInput
+  }
+  const data = {
+    ...batchData,
+    ...modelData,
+    ...formatQueryParams()
+  }
+  const res = await getRecommendVoluntary(data, { pageNum, pageSize })
+
+  if (pageNum == 1) syncUserScoreByNeed(data)
+  total.value = res.total
+  // make reactive properties
+  let rows = {}
+  rows = res.rows.map(item => {
+    item.isExpand = false
+    item.majors = []
+    return item
+  })
+  rows.forEach(useVoluntaryMajorGroupIdentifier)
+  // 回显
+  syncMajorGroupToSelected(rows)
+  if (!userStore.isVip) {
+    paging.value.completeByNoMore(rows, true)
+  } else {
     paging.value.completeByTotal(rows, total.value)
+  }
 }
 
 const checkPopupBlock = async () => {
-    // major popup
-    if (majorPopup.value.show) {
-        majorPopup.value.close()
-        return Promise.reject('popup close')
-    }
-    if (dropdown.value.getShow()) {
-        dropdown.value.terminate()
-        return Promise.reject('popup close')
-    }
+  // major popup
+  if (majorPopup.value.show) {
+    majorPopup.value.close()
+    return Promise.reject('popup close')
+  }
+  if (dropdown.value.getShow()) {
+    dropdown.value.terminate()
+    return Promise.reject('popup close')
+  }
 }
 
 const confirmSave = async () => {
-    return new Promise((resolve, reject) => {
-        uni.showModal({
-            content: '是否要保存当前志愿表',
-            showCancel: true,
-            cancelText: '放弃保存',
-            confirmText: '保存志愿表',
-            success: res => {
-                if (res.confirm) {
-                    reject() // to prevent back operation.
-                    save(isMock.value)
-                } else {
-                    resolve() // to continue back operation.
-                }
-            }
-        })
+  return new Promise((resolve, reject) => {
+    uni.showModal({
+      content: '是否要保存当前志愿表',
+      showCancel: true,
+      cancelText: '放弃保存',
+      confirmText: '保存志愿表',
+      success: res => {
+        if (res.confirm) {
+          reject() // to prevent back operation.
+          save(isMock.value)
+        } else {
+          resolve() // to continue back operation.
+        }
+      }
     })
+  })
 }
 
 const handleSearch = () => paging.value.reload() // 输入框触发
 onSearch(() => paging.value.reload()) // 条件选择器触发
 onBeforeBack(async () => {
-    if (currentStep.value == 2) {
-        // 先控制弹层元素 专业详情/条件筛选
-        await checkPopupBlock()
-        // 再判定志愿表
-        if (selectedList.value.length) {
-            await confirmSave()
-        }
+  if (currentStep.value == 2) {
+    // 先控制弹层元素 专业详情/条件筛选
+    await checkPopupBlock()
+    // 再判定志愿表
+    if (selectedList.value.length) {
+      await confirmSave()
     }
+  }
 })
 
 const reloadWatches = [
-    currentStep,
-    () => model.value.score * 1,
-    () => model.value.seatInput * 1,
-    () => batch.value.batch * 1
+  currentStep,
+  () => model.value.score * 1,
+  () => model.value.seatInput * 1,
+  () => batch.value.batch * 1
 ]
-watch(reloadWatches, async ([step, score, input, batch], arg2) => {
+onMounted(() => {
+  watch(reloadWatches, async ([step, score, input, batch], arg2) => {
     if (step == 2) {
-        if (!props.editMode) resetCart() // 编辑模式下保留cart数据
-        cartPopup.value.close()
-        majorPopup.value.close()
-        dropdown.value.terminate()
-        await sleep(400) // wait for animation complete
-        resetCondition()
+      if (!props.editMode) resetCart() // 编辑模式下保留cart数据
+      cartPopup.value.close()
+      majorPopup.value.close()
+      dropdown.value.terminate()
+      await sleep(400) // wait for animation complete
+      resetCondition()
     }
-})
-watch(currentStep, async (step) => {
+  }, {
+    immediate: true
+  })
+  watch(currentStep, async (step) => {
     if (step == 2) {
-        const payload = {mode: toValue(mode), year: toValue(batch).year, isMock: toValue(isMock)}
-        await ensureHistoryYears(payload)
+      const payload = { mode: toValue(mode), year: toValue(batch).year, isMock: toValue(isMock) }
+      await ensureHistoryYears(payload)
     }
+  }, {
+    immediate: true
+  })
 })
 
-defineExpose({checkPopupBlock, confirmSave})
+defineExpose({ checkPopupBlock, confirmSave })
 </script>
 
 <style scoped lang="scss">
 ::v-deep .zp-page-bottom-container {
-    z-index: 10;
+  z-index: 10;
 }
 </style>

+ 80 - 82
src/pagesOther/pages/voluntary/index/components/score-form.vue

@@ -1,113 +1,111 @@
 <template>
-    <view class="p-20 text-sm text-main">
-        <uv-text v-if="isScoreLocked&&false" type="error" :text="MxConfig.scoreLockedTips"/>
-        <uv-text v-if="isScoreUnlocked&&false" type="error" :text="MxConfig.scoreRuleTips"/>
-        <course-selector/>
-        <uv-line margin="15px 0 0 0"/>
-        <uv-input v-model="model.score" :disabled="isScoreLocked" placeholder="请输入您的分数"
-                  v-bind="inputCommon">
-            <template #prefix>您的分数:</template>
-        </uv-input>
-        <uv-input v-if="false" v-model="model.rank.lowestRank" disabled v-bind="inputCommon">
-            <template #prefix>匹配位次:</template>
-        </uv-input>
-        <uv-input v-model="model.seatInput" placeholder="输入成绩单位次" v-bind="inputCommon">
-            <template #prefix>填写位次:</template>
-        </uv-input>
-        <view class="font-[PingFang] text-content text-2xs mt-20">
-            <uv-icon name="info-circle" class="mr3" style="display: inline-block"/>
-            已根据最新位次表获取分数的最低位次,您也可以修改为成绩单上的位次
-            <template v-if="model.rank&&isScoreLocked">,位次区间[{{
-                    model.rank.highestRank
-                }}~{{ model.rank.lowestRank }}]
-            </template>
-            。
-            <text class="underline text-primary" @click="goQuerySegment">查看位次</text>
-        </view>
+  <view class="p-20 text-sm text-main">
+    <uv-text v-if="isScoreLocked && false" type="error" :text="MxConfig.scoreLockedTips" />
+    <uv-text v-if="isScoreUnlocked && false" type="error" :text="MxConfig.scoreRuleTips" />
+    <course-selector />
+    <uv-line margin="15px 0 0 0" />
+    <uv-input v-model="model.score" :disabled="isScoreLocked" placeholder="请输入您的分数" placeholderClass="text-[14px]"
+      v-bind="inputCommon">
+      <template #prefix>您的分数:</template>
+    </uv-input>
+    <uv-input v-if="false" v-model="model.rank.lowestRank" disabled placeholderClass="text-[14px]" v-bind="inputCommon">
+      <template #prefix>匹配位次:</template>
+    </uv-input>
+    <uv-input v-model="model.seatInput" placeholder="输入成绩单位次" placeholderClass="text-[14px]" v-bind="inputCommon">
+      <template #prefix>填写位次:</template>
+    </uv-input>
+    <view class="font-[PingFang] text-content text-2xs mt-20">
+      <uv-icon name="info-circle" class="mr3" style="display: inline-block" />
+      已根据最新位次表获取分数的最低位次,您也可以修改为成绩单上的位次
+      <template v-if="model.rank && isScoreLocked">,位次区间[{{
+        model.rank.highestRank
+      }}~{{ model.rank.lowestRank }}]
+      </template>
+      。
+      <text class="underline text-primary" @click="goQuerySegment">查看位次</text>
     </view>
+  </view>
 </template>
 
 <script setup>
-import {watch} from 'vue';
+import { watch } from 'vue';
 import MxConfig from "@/common/mxConfig";
-import {createPropDefine} from "@/utils";
-import {useUserStore} from "@/hooks/useUserStore";
-import {useInjectTransfer} from "@/hooks/useTransfer";
-import {useInjectVoluntaryData} from "@/hooks/useVoluntaryDataInjection";
+import { createPropDefine } from "@/utils";
+import { useUserStore } from "@/hooks/useUserStore";
+import { useInjectTransfer } from "@/hooks/useTransfer";
+import { useInjectVoluntaryData } from "@/hooks/useVoluntaryDataInjection";
 import CourseSelector from "@/pagesOther/pages/voluntary/index/components/course-selector.vue";
 import debounce from "@/uni_modules/uv-ui-tools/libs/function/debounce";
-import {useCacheStore} from "@/hooks/useCacheStore";
-import {getRankByScore} from "@/api/webApi/volunteer";
-import {toast} from "@/uni_modules/uv-ui-tools/libs/function";
+import { useCacheStore } from "@/hooks/useCacheStore";
+import { getRankByScore } from "@/api/webApi/volunteer";
+import { toast } from "@/uni_modules/uv-ui-tools/libs/function";
 
 const props = defineProps({
-    model: createPropDefine({}, Object)
+  model: createPropDefine({}, Object)
 })
 const inputCommon = {
-    type: 'number',
-    border: 'bottom',
-    fontSize: '18px',
-    customStyle: {height: '30px'}
+  type: 'number',
+  border: 'bottom',
+  fontSize: '15px',
+  customStyle: { height: '30px' }
 }
 
-const {isScoreLocked, isScoreUnlocked} = useUserStore()
-const {transferTo} = useInjectTransfer()
-const {validate, voluntaryData} = useInjectVoluntaryData()
-const {dispatchCache} = useCacheStore()
+const { isScoreLocked, isScoreUnlocked } = useUserStore()
+const { transferTo } = useInjectTransfer()
+const { validate, voluntaryData } = useInjectVoluntaryData()
+const { dispatchCache } = useCacheStore()
 
 const goQuerySegment = () => {
-    transferTo('/pages/career/query-segment/query-segment')
+  transferTo('/pages/career/query-segment/query-segment')
 }
 
 const setRankByScore = async () => {
-    const {firstSubject, score} = props.model
-    if (!score) {
-        props.model.seatInput = ''
-        props.model.rank = {}
-        return
-    }
+  const { firstSubject, score } = props.model
+  if (!score) {
+    props.model.seatInput = ''
+    props.model.rank = {}
+    return
+  }
 
-    const payload = {mode: firstSubject, scoreRank: score}
-    const res = await dispatchCache(getRankByScore, payload)
-    // 2次校验,防止串分
-    if (payload.scoreRank != props.model.score) return
-    props.model.rank = res.data
-    const {lowestRank, highestRank} = res.data
-    const {seatInput} = props.model
-    if (seatInput >= highestRank && seatInput <= lowestRank) return
-    props.model.seatInput = lowestRank
+  const payload = { mode: firstSubject, scoreRank: score }
+  const res = await dispatchCache(getRankByScore, payload)
+  // 2次校验,防止串分
+  if (payload.scoreRank != props.model.score) return
+  props.model.rank = res.data
+  const { lowestRank, highestRank } = res.data
+  const { seatInput } = props.model
+  if (seatInput >= highestRank && seatInput <= lowestRank) return
+  props.model.seatInput = lowestRank
 }
 
 const validateForm = async function () {
-    const {score, seatInput, rank} = props.model
-    // score validate
-    await validate(score)
-    // seat validate
-    let error = ''
-    if (!seatInput) error = '请输入位次'
-    else if (seatInput && !/^[1-9]\d*$/.test(seatInput)) error = '请输入合法的位次'
-    else if (!isScoreUnlocked.value && (seatInput < rank.highestRank || seatInput > rank.lowestRank)) error = `位次必须在[${rank.highestRank}~${rank.lowestRank}]之间`
-    if (error) {
-        toast(error)
-        return Promise.reject(error)
-    }
+  const { score, seatInput, rank } = props.model
+  // score validate
+  await validate(score)
+  // seat validate
+  let error = ''
+  if (!seatInput) error = '请输入位次'
+  else if (seatInput && !/^[1-9]\d*$/.test(seatInput)) error = '请输入合法的位次'
+  else if (!isScoreUnlocked.value && (seatInput < rank.highestRank || seatInput > rank.lowestRank)) error = `位次必须在[${rank.highestRank}~${rank.lowestRank}]之间`
+  if (error) {
+    toast(error)
+    return Promise.reject(error)
+  }
 }
 
 watch([() => props.model.firstSubject, () => props.model.score * 1], async ([firstSubject, score]) => {
-    // console.log('watch firstSubject and score', firstSubject, score)
-    if (/*!firstSubject || */!score) return // 单招没有firstSubject
-    // error input fix, when props.model.score assigned, watch will be triggered again.
-    if (score > voluntaryData.value.maxScore) return props.model.score = voluntaryData.value.maxScore
-    else if (score < 0) return props.model.score = 0
-    // silence validation
-    await validate(score, true)
+  // console.log('watch firstSubject and score', firstSubject, score)
+  if (/*!firstSubject || */!score) return // 单招没有firstSubject
+  // error input fix, when props.model.score assigned, watch will be triggered again.
+  if (score > voluntaryData.value.maxScore) return props.model.score = voluntaryData.value.maxScore
+  else if (score < 0) return props.model.score = 0
+  // silence validation
+  await validate(score, true)
 
-    debounce(setRankByScore)
+  debounce(setRankByScore)
 })
 
-defineExpose({validate: validateForm})
+defineExpose({ validate: validateForm })
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 12 - 2
src/pagesOther/pages/voluntary/index/index.vue

@@ -16,7 +16,7 @@
           <batch-step />
         </swiper-item>
         <swiper-item>
-          <cart-step />
+          <cart-step v-if="showCart" />
         </swiper-item>
       </swiper>
     </view>
@@ -24,7 +24,7 @@
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, watch } from 'vue';
 import { useProvideTransfer } from "@/hooks/useTransfer";
 import { useProvideVoluntaryStep } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
 import { useProvideVoluntaryData } from "@/hooks/useVoluntaryDataInjection";
@@ -55,6 +55,16 @@ const container = ref(null) // swiper必须指定明确的高度,所以多包
 const assistantSvc = useProvideVoluntaryAssistant(stepSvc, dataSvc, formSvc, cartSvc, highlightSvc)
 const { navBinding, onComplete, resetAll } = assistantSvc
 
+const showCart = ref(false);
+watch(() => currentStep.value, (val) => {
+  if (val === 2) {
+    setTimeout(() => {
+      showCart.value = true;
+    }, 300);
+  } else {
+    showCart.value = false;
+  }
+});
 const handlePrev = () => {
   currentStep.value -= 1
   if (currentStep.value < 0) {