Jelajahi Sumber

学生专区-企业推荐信

Xiao_123 2 bulan lalu
induk
melakukan
ab08fe57fb

+ 15 - 0
api/student.js

@@ -0,0 +1,15 @@
+import request from "@/utils/request"
+
+// 获取企业推荐信列表
+export const getEnterpriseRecommendationList = async (data) => {
+	return request({
+		url: '/app-api/flames/student/recommendation/list',
+		method: 'POST',
+		data,
+		custom: {
+			openEncryption: true,
+			showLoading: false,
+			auth: true
+		}
+	})
+}

+ 65 - 1
pagesA/student/enterpriseRecommendationLetter.vue

@@ -1,8 +1,72 @@
 <template>
-  <view class="text-center ss-m-t-80" style="color: #777;">未开放 . . .</view>
+  <view style="height: 98vh; background-color: #f2f4f7; padding-top: 10px;">
+    <view v-if="list.length > 0">
+      <uni-card v-for="(item, index) in list" class="list-item" @tap.stop="viewReport(item)" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
+        <view class="font-weight-bold">From: {{ formatName(item.enterprise.enterpriseName) }}</view>
+				<view>创建时间:{{ timesTampChange(item.entity.createDate) }}</view>
+        <view style="text-align: end;">
+          <text class="color-primary" @tap.stop="viewReport(item)">点击查看</text>
+        </view>
+      </uni-card>
+		</view>
+		<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>
+		</view>
+  </view>
 </template>
 
 <script setup>
+import { ref } from 'vue'
+import { getEnterpriseRecommendationList } from '@/api/student'
+import { onShow } from '@dcloudio/uni-app'
+import { formatName } from '@/utils/getText'
+import { timesTampChange } from '@/utils/date'
+import { preview } from '@/utils/preview'
+
+const list = ref([
+  {
+    enterprise: {
+      enterpriseName: '门墩儿科技有限公司',
+    },
+    entity: {
+      createDate: 1740570206120,
+      fileUrl: 'https://minio.menduner.com/dev/person/725759784858554368/attachment/7cde29dc69c1403649be55d4c2bfd3d8304c088dc79ab25afe9c4bf55d3b382f.docx'
+    }
+  }
+])
+
+// 推荐信预览
+const viewReport = (item) => {
+  if (!item.entity.fileUrl) {
+    uni.showToast({
+      title: '加载失败,请稍后重试',
+      icon: 'none',
+      duration: 2000
+    })
+    return
+  }
+  preview(item.entity.fileUrl)
+}
+
+// 获取推荐信列表
+const getList = async () => {
+  try {
+    const { data } = await getEnterpriseRecommendationList({ size: 9999, current: 1 })
+    console.log(data, '推荐信列表')
+    // list.value = data.records.reverse()
+  } catch {}
+}
+
+onShow(async () => {
+  // await getList()
+})
 </script>
+
 <style lang="scss" scoped>
+.list-item {
+  background-color: #fff;
+  border-radius: 3px;
+  padding: 20px;
+  box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.1);
+}
 </style>

+ 1 - 1
pagesA/student/index.vue

@@ -23,7 +23,7 @@ const defaultList = [
 	{	title: '实习企业',	path: '/pagesA/student/internshipCompany', rightTex: '未开放' },
 	{	title: '实习报告',	path: '/pagesA/student/internshipReport', rightTex: '未开放' },
 	{	title: '实习证书',	path: '/pagesA/student/internshipCertificate', rightTex: '未开放'	},
-	{	title: '企业推荐信',	path: '/pagesA/student/enterpriseRecommendationLetter', rightTex: '未开放' },
+	{	title: '企业推荐信',	path: '/pagesA/student/enterpriseRecommendationLetter' },
 	{	title: '实习管家',	path: '/pagesA/student/internshipButler' },
 ]
 const list = ref(defaultList.filter(e => !e.hide))