Browse Source

学生-实习报告

Xiao_123 2 months ago
parent
commit
b83e4e3a49
4 changed files with 125 additions and 5 deletions
  1. 37 0
      api/student.js
  2. 1 3
      pages/index/my.vue
  3. 86 1
      pagesA/student/internshipReport.vue
  4. 1 1
      utils/config.js

+ 37 - 0
api/student.js

@@ -52,4 +52,41 @@ export const getStudentPage = async (params) => {
 			auth: true
 		}
 	})
+}
+
+// 获得学生实习报告列表
+export const getStudentReportList = async (params) => {
+	return request({
+		url: '/app-api/menduner/system/student/get/report/list',
+		method: 'GET',
+		params,
+		custom: {
+			auth: true
+		}
+	})
+}
+
+// 保存学生实习报告
+export const saveStudentReport = async (data) => {
+	return request({
+		url: '/app-api/menduner/system/student/report/save',
+		method: 'POST',
+		data,
+		custom: {
+			openEncryption: true,
+			showLoading: false,
+			auth: true
+		}
+	})
+}
+
+// 获取学生实习的企业列表
+export const getStudentPracticeCompanyList = async () => {
+	return request({
+		url: '/app-api/menduner/system/student/record-enterprise/list',
+		method: 'GET',
+		custom: {
+			auth: true
+		}
+	})
 }

+ 1 - 3
pages/index/my.vue

@@ -105,15 +105,13 @@ const itemList = [
 const defaultList = [
 	{	title: '在线简历',	path: '/pagesA/resumeOnline/index'	},					
 	{	title: '附件简历',	path: '/pagesA/resume/index'	},					
-	// { title: '学生专区', path: '/pagesA/student/index', key: 'student', hide: false },
+	{ title: '学生专区', path: '/pagesA/student/index', key: 'student', hide: false },
 	{ title: '面试管理', path: '/pagesA/interview/index' },
 	{	title: '会员套餐', path: '/pagesA/vipPackage/index'	},		
-	// {	title: '我的分享码',	path: 'shareQrCode'	},					
 	{	title: '我的分享码',	path: '/pagesB/sharePoster/index'	},					
 	{	title: '新用户邀请记录',	path: '/pagesB/inviteRecord/index'	},
 	{ title: '门墩儿商城', appId: 'wx6decdf12f9e7a061' },
 	{ title: '我要招聘', key: 'recruit' },
-	// { title: '招聘会', path: '/pagesB/jobFair/index', open: true },
 	{ title: '联系我们', path: '/pagesB/contactUs/index' },
 	{ title: '协议中心', path: '/pagesB/agreement/index', open: true }
 ]

+ 86 - 1
pagesA/student/internshipReport.vue

@@ -1,8 +1,93 @@
 <template>
-  <view class="text-center ss-m-t-80" style="color: #777;">未开放 . . .</view>
+  <view style="padding: 20rpx 30rpx;">
+    <view v-if="items.length > 0" class="wrapper">
+      <view v-for="(item,index) in items" :key="index" style="margin: 0 0 50rpx 0;">
+        <uni-section :title="item.date" type="line"></uni-section>
+        <view>
+          <image v-for="(url, i) in item.arr" :key="i" class="img" :src="url" mode="scaleToFill" @click="previewImage(item.arr,i)"></image>
+        </view>
+      </view>
+    </view>
+    <view v-else class="nodata-img-parent">
+      <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" class="nodata-img-child"></image>
+    </view>
+    <view class="bottom-sticky">
+      <button type="primary" size="default" class="recomm-button" @click="addReport">新增实习报告</button>
+    </view>
+  </view>
 </template>
 
 <script setup>
+import { ref } from 'vue'
+import { getStudentReportList, getStudentPracticeCompanyList } from '@/api/student.js'
+import { onLoad, onShow } from '@dcloudio/uni-app'
+import { formatName } from '@/utils/index.js'
+
+const enterpriseId = ref(null)
+const items = ref([])
+
+const getCompanyList = async () => {
+  try {
+    const { data } = await getStudentPracticeCompanyList()
+		data.forEach(e => {
+			e.id = e.id.toString()
+			e.enterpriseName = formatName(e.anotherName || e.name)
+		})
+    console.log(data, '实习企业列表')
+	} catch {}
+}
+
+// 实习报告列表
+const getList = async () => {
+	items.value = []
+	try {
+		const { data } = await getStudentReportList(enterpriseId.value ? { enterpriseId: enterpriseId.value } : {})
+		if (!data || !Object.keys(data).length) return
+		for (let item in data) {
+			items.value.push({ date: item, arr: data[item].map(e => e.url) })
+		}
+	} catch {}
+}
+
+onShow(() => {
+  console.log('onSHow11111111')
+  getCompanyList()
+})
+
+onLoad((options) => {
+  console.log(options, 'options-实习报告')
+  if (options.enterpriseId) {
+    enterpriseId.value = options.enterpriseId
+  }
+  getList()
+})
+
+const addReport = () => {}
+
+// 预览图片
+const previewImage = (url, i) => {
+  uni.previewImage({
+    current: i,
+    urls: url,
+    longPressActions : {
+    itemList: ['发送给朋友', '保存图片', '收藏']
+    }
+  })
+}
 </script>
+
 <style lang="scss" scoped>
+.img{
+  width: 28%;
+  height: 200rpx;
+  margin: 10rpx;
+  border: 1px solid #f4f4f4;
+}
+.wrapper{
+  height: 84vh;
+  overflow: auto;
+}
+:deep(.uni-section .uni-section-header__decoration) {
+  background-color: #00B760 !important;
+}
 </style>

+ 1 - 1
utils/config.js

@@ -13,7 +13,7 @@ const config = {
   }
 }
 
-export const envObj = config['produce']
+export const envObj = config['httpsTest']
 
 export const baseUrl = envObj.baseUrl