123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <template>
- <view class="upload-container">
- <!-- 顶部插图区域 -->
- <view class="header-notice">
- <image style="width: 30rpx;height: 30rpx;" src="https://data.qicai321.com/minlong/57d03f34-47de-43fe-8730-b764ed8bdda2.png" mode="aspectFit"></image>请上传简历文件,格式支持pdf及doc格式
- </view>
- <view class="illustration">
- <image class="img" src="https://data.qicai321.com/minlong/09d4daa6-6507-4133-81ff-68e47b0259e5.png" mode="aspectFit"></image>
- </view>
-
- <!-- 上传按钮 -->
- <button class="upload-btn" @click="chooseFile">
- 选择并上传文件
- </button>
-
- <!-- 使用说明区域 -->
- <view class="instructions">
- <view class="title">使用说明及注意事项</view>
- <view class="instruction-list">
- <view class="instruction-item">1. 点击【选择并上传文件】按钮,上传简历;</view>
- <view class="instruction-item">2. 请在本地选择简历文件,文件小于30mb;</view>
- <view class="instruction-item">3. 支持pdf及doc格式。</view>
- </view>
-
- <!-- 隐私提示 -->
- <view class="privacy-notice">
- * 我们将对您的隐私保护,所内容仅用于评估岗位的匹配度。
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- fileType: ['pdf', 'doc', 'docx'],
- maxSize: 30 * 1024 * 1024 // 30MB in bytes
- }
- },
- methods: {
- chooseFile() {
- // #ifdef H5
- uni.chooseFile({
- count: 1,
- type: 'file',
- extension: this.fileType,
- success: (res) => {
- if (res.tempFiles[0].size > this.maxSize) {
- uni.showToast({
- title: '文件大小不能超过30MB',
- icon: 'none'
- })
- return
- }
- this.uploadFile(res.tempFiles[0])
- }
- })
- // #endif
-
- // #ifdef APP-PLUS || MP
- uni.chooseMessageFile({
- count: 1,
- type: 'file',
- extension: this.fileType,
- success: (res) => {
- if (res.tempFiles[0].size > this.maxSize) {
- uni.showToast({
- title: '文件大小不能超过30MB',
- icon: 'none'
- })
- return
- }
- this.uploadFile(res.tempFiles[0])
- }
- })
- // #endif
- },
-
- uploadFile(file) {
- uni.showLoading({
- title: '上传中...'
- })
-
- // 这里替换为实际的上传接口
- uni.uploadFile({
- url: 'YOUR_UPLOAD_API_URL',
- filePath: file.path,
- name: 'file',
- success: (res) => {
- uni.showToast({
- title: '上传成功',
- icon: 'success'
- })
- },
- fail: (err) => {
- uni.showToast({
- title: '上传失败',
- icon: 'none'
- })
- },
- complete: () => {
- uni.hideLoading()
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .upload-container {
- padding: 30rpx;
- background-color: #f5f6fa;
- min-height: 100vh;
- .header-notice{
- display: flex;
- align-items: center;
- justify-content: center;
- text-align: center;
- font-size: 24rpx;
- color: #999;
- line-height: 1.5;
- }
-
- .illustration {
- text-align: center;
- margin: 40rpx auto;
- padding: 20rpx;
-
- border-radius: 12rpx;
-
- image {
- width: 650rpx;
- height: 550rpx;
- }
- }
-
- .upload-btn {
- width: 90%;
- height: 88rpx;
- line-height: 88rpx;
- background-color: #2b4acb;
- color: #ffffff;
- border-radius: 8rpx;
- font-size: 32rpx;
- margin: 60rpx auto;
- text-align: center;
-
- &::after {
- border: none;
- }
- }
-
- .instructions {
- padding: 0 30rpx;
-
- .title {
- font-size: 28rpx;
- color: #333;
- margin-bottom: 30rpx;
- }
-
- .instruction-list {
- .instruction-item {
- font-size: 26rpx;
- color: #666;
- line-height: 44rpx;
- margin-bottom: 20rpx;
- }
- }
-
- .privacy-notice {
- margin-top: 40rpx;
- font-size: 24rpx;
- color: #999;
- line-height: 1.5;
- }
- }
- }
- </style>
|