|
@@ -2,22 +2,37 @@
|
|
<view class="ss-p-b-100">
|
|
<view class="ss-p-b-100">
|
|
<view v-if="bioList.length > 0">
|
|
<view v-if="bioList.length > 0">
|
|
<uni-card v-for="(item, index) in bioList" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
|
|
<uni-card v-for="(item, index) in bioList" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
|
|
- <view style="font-weight: bold;">{{ item.fileName ? item.fileName : `简历${index + 1}` }}</view>
|
|
|
|
- <view>上传时间:{{ item.createTime }}</view>
|
|
|
|
|
|
+ <view class="d-flex align-center">
|
|
|
|
+ <view @click="preview(item.url)" style="flex: 1;">
|
|
|
|
+ <view style="font-weight: bold;">{{ item.title }}</view>
|
|
|
|
+ <view>上传时间:{{ timesTampChange(item.createTime, 'Y-M-D') }}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="ss-m-l-30" style="width: 60rpx;">
|
|
|
|
+ <uni-icons @click="handleOpenPopup(item)" type="more-filled" size="20"></uni-icons>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</uni-card>
|
|
</uni-card>
|
|
</view>
|
|
</view>
|
|
<view v-else class="nodata-img-parent">
|
|
<view v-else class="nodata-img-parent">
|
|
<image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
|
|
<image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
|
|
</view>
|
|
</view>
|
|
<view class="bottom-sticky">
|
|
<view class="bottom-sticky">
|
|
- <button class="recomm-button" @click="handleUpload">从微信导入简历</button>
|
|
|
|
|
|
+ <button class="recomm-button" @click="handleUpload">从微信聊天中导入简历</button>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
+ <uni-popup ref="popup" type="bottom">
|
|
|
|
+ <button class="big-cancel-button" style="color: #333 !important;" @click="handleDelete">删除附件</button>
|
|
|
|
+ <button class="big-cancel-button" @click="popup.close(); currentId = ''">取消</button>
|
|
|
|
+ </uni-popup>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
-import { getPersonResumeCv } from '@/api/user'
|
|
|
|
|
|
+import { getPersonResumeCv, saveResume, deleteResume } from '@/api/user'
|
|
|
|
+import { uploadFileTest } from '@/api/file'
|
|
|
|
+import { timesTampChange } from '@/utils/date'
|
|
|
|
+import { preview } from '@/utils/preview'
|
|
|
|
|
|
// 获取附件
|
|
// 获取附件
|
|
const bioList = ref([])
|
|
const bioList = ref([])
|
|
@@ -27,19 +42,53 @@ const getList = async () => {
|
|
}
|
|
}
|
|
getList()
|
|
getList()
|
|
|
|
|
|
|
|
+// 更多
|
|
|
|
+const currentId = ref('')
|
|
|
|
+const popup = ref()
|
|
|
|
+const handleOpenPopup = (item) => {
|
|
|
|
+ currentId.value = item.id
|
|
|
|
+ popup.value.open()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 删除附件
|
|
|
|
+const handleDelete = async () => {
|
|
|
|
+ if (!currentId.value) return
|
|
|
|
+ await deleteResume(currentId.value)
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '删除成功',
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ currentId.value = ''
|
|
|
|
+ popup.value.close()
|
|
|
|
+ getList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 上传附件
|
|
const handleUpload = () => {
|
|
const handleUpload = () => {
|
|
wx.chooseMessageFile({
|
|
wx.chooseMessageFile({
|
|
count: 1,
|
|
count: 1,
|
|
type: 'file',
|
|
type: 'file',
|
|
success (res) {
|
|
success (res) {
|
|
- console.log(res,'res');
|
|
|
|
- const tempFilePaths = res.tempFiles.map(item=>{
|
|
|
|
- return item.path
|
|
|
|
- })
|
|
|
|
- let name = res.tempFiles[0].name
|
|
|
|
|
|
+ const title = res.tempFiles[0].name
|
|
|
|
+ const path = res.tempFiles[0].path
|
|
//效验是否为支持的文件格式
|
|
//效验是否为支持的文件格式
|
|
- if(/\.(pdf|docx|doc)$/.test(name)){
|
|
|
|
- console.log(tempFilePaths, name, '============')
|
|
|
|
|
|
+ if(/\.(pdf|docx|doc)$/.test(title)){
|
|
|
|
+ uploadFileTest(path).then(async (res) => {
|
|
|
|
+ if (!res.data) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '上传失败',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ await saveResume({ title, url: res.data })
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '上传成功',
|
|
|
|
+ icon: 'success'
|
|
|
|
+ })
|
|
|
|
+ getList()
|
|
|
|
+ })
|
|
}else{
|
|
}else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -54,5 +103,4 @@ const handleUpload = () => {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-
|
|
|
|
</style>
|
|
</style>
|