abpcoder hai 3 semanas
pai
achega
09296e3d59

+ 4 - 2
src/pagesOther/components/ie-condition-dropdown/ie-condition-dropdown-popup.vue

@@ -3,10 +3,12 @@
         <scroll-view scroll-y style="max-height: 35vh;">
             <view class="w-screen px-30 py-10 box-border ie-condition-group" @touchmove.stop>
                 <uv-checkbox-group v-if="multiple" v-model="model[config.key]" placement="column" icon-placement="right">
-                    <uv-checkbox v-for="i in list" :name="getValue(i)" :label="getLabel(i)" :custom-style="optionStyle"/>
+                    <uv-checkbox v-for="(item,i) in list" :key="i" :name="getValue(item)" :label="getLabel(item)"
+                                 :custom-style="optionStyle"/>
                 </uv-checkbox-group>
                 <uv-radio-group v-else v-model="model[config.key]" placement="column" icon-placement="right">
-                    <uv-radio v-for="i in list" :name="getValue(i)" :label="getLabel(i)" :custom-style="optionStyle"/>
+                    <uv-radio v-for="(item,i) in list" :key="i" :name="getValue(item)" :label="getLabel(item)"
+                              :custom-style="optionStyle"/>
                 </uv-radio-group>
             </view>
         </scroll-view>

+ 2 - 1
src/pagesOther/components/ie-condition-dropdown/ie-condition-dropdown.vue

@@ -1,7 +1,8 @@
 <template>
     <scroll-view :scroll-x="x" :style="{zIndex: z}">
         <view class="bg-white h-[44px] text-xs text-main px-30" :class="layout">
-            <ie-condition-dropdown-item v-for="c in conditions" :condition="c" :use-value-as-title="useValueAsTitle"/>
+            <ie-condition-dropdown-item v-for="c in conditions" :key="c.config.key" :condition="c"
+                                        :use-value-as-title="useValueAsTitle"/>
         </view>
     </scroll-view>
     <ie-condition-dropdown-popup ref="popup"/>

+ 0 - 22
src/pagesOther/components/ie-condition/ie-condition-dropdown.vue

@@ -1,22 +0,0 @@
-<template>
-    <uv-drop-down ref="dropdown">
-        <uv-drop-down-item v-for="c in conditions" :label="c.config.title"/>
-        <uv-drop-down-popup/>
-    </uv-drop-down>
-</template>
-
-<script setup>
-import {ref, watch} from 'vue';
-import {useInjectPageScroll} from "@/hooks/usePageScrollInjection";
-import {useInjectSearchModel} from "@/components/mx-condition/useSearchModelInjection";
-
-const {scrollTop} = useInjectPageScroll()
-const {conditions} = useInjectSearchModel()
-const dropdown = ref(null)
-
-watch(scrollTop, () => dropdown.value.init()) // 位置修正
-</script>
-
-<style scoped>
-
-</style>

+ 1 - 1
src/pagesOther/components/ie-condition/ie-condition.vue

@@ -1,6 +1,6 @@
 <template>
     <view class="h-90 flex items-center gap-40">
-        <view v-for="c in conditions" :prop="c.config.key">
+        <view v-for="c in conditions" :key="c.config.key">
             <ie-vhs-picker v-model="queryParams[c.config.key]" :data="c.list"
                        :label-prop="c.config.keyName" :value-prop="c.config.keyValue"
                        :empty-display="c.config.title" class="!flex-none"/>

+ 2 - 1
src/pagesOther/pages/vhs/detail/detail.vue

@@ -6,7 +6,8 @@
                 <ie-navbar :title="prevData.name"/>
             </template>
             <view class="flex flex-col gap-20 p-20">
-                <voluntary-item v-for="item in list" :item="item" @major="openMajorPopup(item)" @notify="showNotify"/>
+                <voluntary-item v-for="item in list" :key="item.id" :item="item"
+                                @major="openMajorPopup(item)" @notify="showNotify"/>
             </view>
             <major-popup ref="majorPopup" readonly @notify="showNotify"/>
             <uv-notify ref="notifier"/>

+ 1 - 1
src/pagesOther/pages/vhs/index/components/batch-step.vue

@@ -10,7 +10,7 @@
         </view>
         <view class="text-center mt-50">(二)选择填报批次</view>
         <view class="flex flex-col gap-20 mt-20">
-            <view @click="handleBatchSelect(item)" v-for="item in batchList"
+            <view @click="handleBatchSelect(item)" v-for="item in batchList" :key="item.batch"
                   class="bg-gradient-to-b from-sky-100 to-white px-30 py-50 flex justify-between items-center rounded-lg shadow-card">
                 <view class="flex-1 flex flex-col">
                     <view class="flex items-center">

+ 9 - 2
src/pagesOther/pages/vhs/index/components/cart-step.vue

@@ -7,7 +7,8 @@
         </template>
         <voluntary-search @search="handleSearch"/>
         <view class="flex flex-col p-20 gap-20">
-            <voluntary-item v-for="item in list" :item="item" @major="openMajorPopup(item)" @notify="showNotify"/>
+            <voluntary-item v-for="item in list" :key="item.id" :item="item"
+                            @major="openMajorPopup(item)" @notify="showNotify"/>
             <vip-guide-more v-if="isNotVip"/>
         </view>
         <template #bottom>
@@ -24,6 +25,7 @@
 <script setup>
 import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
 import {useUserStore} from "@/store/userStore";
+import {useEnv} from "@/hooks/useEnv";
 import VoluntaryItem from "@/pagesOther/pages/vhs/index/components/voluntary-item.vue";
 import IeConditionDropdown from "@/pagesOther/components/ie-condition-dropdown/ie-condition-dropdown.vue";
 import VipGuideMore from "@/pagesOther/components/vip-guide-more/vip-guide-more.vue";
@@ -54,6 +56,7 @@ const majorPopup = ref(null)
 const cartPopup = ref(null)
 const dropdown = ref(null)
 const currentUser = useUserStore()
+const {isMP} = useEnv()
 const {model, batch, mode} = useInjectVoluntaryForm()
 const {currentStep} = useInjectVoluntaryStep()
 const {
@@ -172,7 +175,7 @@ const confirmSave = async () => {
             content: '是否要保存当前志愿表',
             showCancel: true,
             cancelText: '放弃保存',
-            confirmText: '保存志愿表',
+            confirmText: isMP.value ? '保存' : '保存志愿表',
             success: res => {
                 if (res.confirm) {
                     reject() // to prevent back operation.
@@ -180,6 +183,10 @@ const confirmSave = async () => {
                 } else {
                     resolve() // to continue back operation.
                 }
+            },
+            fail: (e) => {
+                console.log('modal fail', e)
+                reject()
             }
         })
     })

+ 1 - 1
src/pagesOther/pages/vhs/index/components/major-popup.vue

@@ -6,7 +6,7 @@
         <scroll-view scroll-y class="bg-bg" style="height: 50vh" lower-threshold="100"
                      @scrolltolower="handleMajorScroll">
             <view class="p-30">
-                <view v-for="item in pagedMajors" class="flex flex-col">
+                <view v-for="item in pagedMajors" :key="item.id" class="flex flex-col">
                     <view class="flex justify-between items-center">
                         <view class="flex-1 fx-row items-center">
                             <text :class="{'highlight-major': isSearchingMajorFired(item)}">

+ 1 - 1
src/pagesOther/pages/vhs/index/components/score-step.vue

@@ -30,7 +30,7 @@
                     填报须知
                 </view>
                 <view class="mb-30 text-fore-content text-xs flex flex-col gap-30">
-                    <view v-for="line in noticeTips" class="indent-50">{{ line }}</view>
+                    <view v-for="(line,i) in noticeTips" :key="i" class="indent-50">{{ line }}</view>
                 </view>
                 <uv-button type="primary" text="我知道了" shape="circle" @click="$refs.popup.close()"/>
             </view>

+ 17 - 0
src/pagesOther/pages/vhs/index/components/voluntary-cart-popup.vue

@@ -62,9 +62,26 @@
                             <uv-button type="primary" size="mini" plain shape="circle" icon="trash"
                                        icon-color="primary" @click="handleRemoveAll(college)"/>
                         </view>
+                        <!-- #ifdef MP-WEIXIN -->
+                        <view class="mt-10 flex flex-col gap-12">
+                            <view v-for="(m,i) in getSelectedSortedMajors(college)" :key="i"
+                                class="bg-back rounded-6 h-[44px] pl-30 pr-20 relative flex items-center gap-x-16 mb-[10px]
+                                border border-solid border-border">
+                                <view class="text-32 text-fore-placeholder font-bold">{{ i+1 }}</view>
+                                <view class="flex-1 w-1 h-full leading-[44px] text-28 text-fore-title font-bold ellipsis-1">
+                                    {{ m.marjorName }}[{{ m.marjorBelongs }}]
+                                </view>
+                                <uv-icon name="arrow-up" size="18" @click="handleMajorUp(m, college)"/>
+                                <uv-icon name="arrow-down" size="18" @click="handleMajorDown(m, college)"/>
+                                <uv-icon name="trash" size="18" color="error" @click="handleMajorDelete(m, college)" />
+                            </view>
+                        </view>
+                        <!-- #endif -->
+                        <!-- #ifndef MP-WEIXIN -->
                         <vhs-majors-draggable-list ref="draggableListRef" :majors="getSelectedSortedMajors(college)"
                                                    @delete="handleMajorDelete($event, college)"
                                                    @change="handleDragComplete($event, college)" />
+                        <!-- #endif -->
                     </view>
                 </view>
             </view>

+ 1 - 1
src/pagesOther/pages/vhs/index/index.vue

@@ -46,7 +46,7 @@ const assistantSvc = useProvideVoluntaryAssistant(stepSvc, dataSvc, formSvc, car
 const {navBinding, handleBack, onComplete, resetAll} = assistantSvc
 
 onComplete((id) => {
-    transferTo(routes.VHSDetail, {data: {id}})
+    transferTo(routes.VHSDetail, {data: {id}, type: 'redirectTo'})
     currentStep.value = 0
     resetAll()
 })

+ 1 - 1
src/pagesOther/pages/vhs/list/list.vue

@@ -5,7 +5,7 @@
                 <ie-navbar title="我的志愿表"/>
             </template>
             <view class="p-30 flex flex-col gap-30">
-                <view v-for="item in list"
+                <view v-for="item in list" :key="item.id"
                       class="bg-white p-30 flex justify-between items-center rounded-lg shadow-card"
                       @click="goDetails(item)">
                     <view class="flex flex-col gap-10">