Browse Source

使用简历附件生成在线简历

lifanagju_citu 5 months ago
parent
commit
4e3e99a5f1
2 changed files with 31 additions and 13 deletions
  1. 26 8
      pagesA/resumeAnalysis/index.vue
  2. 5 5
      pagesA/resumeOnline/index.vue

+ 26 - 8
pagesA/resumeAnalysis/index.vue

@@ -6,7 +6,7 @@
       <uni-card v-for="item of formLIst" :key="item.id" :id="item.id">
 		    <uni-section :title="item.text" type="line">
           <template v-slot:right>
-            <view style="color: #e64340;" @click="null">删除</view>
+            <view v-if="item.path !== 'baseInfoEdit'" style="color: #e64340;" @click="del(item)">删除</view>
           </template>
           <avatarEdit v-if="item.path === 'avatarEdit'" ref="componentRef" :id="item.id" :data="item.data" />
           <baseInfoEdit v-if="item.path === 'baseInfoEdit'" ref="componentRef" :id="item.id" :data="item.data" />
@@ -17,6 +17,18 @@
       <view v-if="loading">加载中...</view>
       <view v-else>加载失败</view>
     </view>
+    <!-- 确认框 -->
+    <uni-popup ref="confirmRef" type="dialog">
+      <uni-popup-dialog
+        type="warn"
+        cancelText="取消"
+        confirmText="确认" 
+        title="系统提示"
+        :content="dialogContent"
+        @confirm="handleConfirm"
+        @close="null"
+      ></uni-popup-dialog>
+    </uni-popup>
   </view>
 </template>
 
@@ -50,12 +62,6 @@ const exampleList = {
   trainList: { text: '培训经历', id: 'trainList', path: '' },
 }
 
-// const del = (item) => {
-//   Confirm('系统提示', `是否确认删除${item.text}?`).then(async () => {
-//     formLIst.value = formLIst.value.filter(e => e.id !== item.id)
-//   })
-// }
-
 const resumeTxt = ref([]) // 查看文本信息
 const formLIst = shallowRef([])
 const transformToLIst = async (result) => {
@@ -87,7 +93,19 @@ const transformToLIst = async (result) => {
       }
     })
   }
-  console.log('formLIst:', formLIst.value)
+  // console.log('formLIst:', formLIst.value)
+}
+
+const confirmRef = ref()
+const dialogContent = ref('')
+let delId = null
+const del = (item) => {
+  dialogContent.value =  `是否确认删除${item.text}?`
+  delId = item.id
+  confirmRef.value.open()
+}
+const handleConfirm = () => {
+  formLIst.value = formLIst.value.filter(e => e.id !== delId)
 }
 
 const result = ref(JSON.parse(JSON.stringify(data)))

+ 5 - 5
pagesA/resumeOnline/index.vue

@@ -11,10 +11,10 @@
         stroke-width="8"
       />
     </view>
-    <!-- <view class="topTip">
+    <view class="topTip">
       使用简历附件生成在线简历:
       <text class="resumeAnalysisBtn" @tap="handleToResumeAnalysis">立即生成</text>
-    </view> -->
+    </view>
     <view class="baseInfo borderLine" @tap="handleTo('baseInfoEdit')">
       <view>
         <view class="baseInfo-name">
@@ -280,9 +280,9 @@ function handleTo (str, id) {
   uni.navigateTo({ url: id ? `/pagesA/resumeOnline/${str}?id=${id}` : `/pagesA/resumeOnline/${str}` })
 }
 
-// function handleToResumeAnalysis () {
-//   uni.navigateTo({ url: '/pagesA/resumeAnalysis/index' })
-// }
+function handleToResumeAnalysis () {
+  uni.navigateTo({ url: '/pagesA/resumeAnalysis/index' })
+}
 
 // 获取基础信息
 function getBaseInfo () {