flat: 邀请用户

This commit is contained in:
Apcallover
2024-05-07 16:59:22 +08:00
parent cb25a80541
commit 42e265bf0f
4 changed files with 224 additions and 0 deletions

View File

@@ -119,4 +119,19 @@ export const getDictionary = (params) => {
export const getDictionary2 = () => request({
url: '/api/jobslink-api/system/dict-biz/dictionary?code=company_nature',
method: 'get',
})
export const getInviteUserList = (params) => request({
url: '/api/jobslink-api/user/userrecruit/getInviteUserList',
method: 'get',
params
})
export const userrecruitUserInvite = (params) => request({
url: '/api/jobslink-api/user/userrecruit/userInvite',
method: 'get',
params
})
export const cancelUserInvite = (params) => request({
url: '/api/jobslink-api/user/userrecruit/cancelUserInvite',
method: 'get',
params
})

View File

@@ -40,6 +40,13 @@
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/projectInfo/sub/inviteList",
"style": {
"navigationBarTitleText": "邀请列表",
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "pages/projectInfo/userrecruitWorkInfo",
"style": {

View File

@@ -0,0 +1,179 @@
<template>
<view>
<view v-if="dataSource.length">
<u-collapse>
<u-collapse-item :title="`${item.realName} ${item.education}` " class="collapseItem" name="Docs guide"
v-for="(item, index) in dataSource" :key="item.id">
<view class="u-collapse-content">
<view class="">期望薪资{{ item.wage }}</view>
<view class="">&emsp;&emsp;{{ item.skillName }}</view>
<view class="">工作地区{{ item.workplace }}</view>
<view class="btnGr" v-if="item.isWorkInvite === 0" @click="updataRow(item)">&emsp;&emsp;
</view>
<view class="btnHuy" v-else @click="removeRow(item)">&emsp;&emsp;</view>
</view>
</u-collapse-item>
</u-collapse>
<!-- <block v-for="(item, index) in dataSource" :key="item.id">
<view class="search-item">
{{item.realName}}
<view style="flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
{{ item.telphone }}
</view>
<view class="baddd"></view>
</view>
</block> -->
</view>
<empty v-else content="暂无问卷" mrTop="300"></empty>
</view>
</template>
<script>
import {
getInviteUserList,
userrecruitUserInvite,
cancelUserInvite
} from '@/api/userrecruit.js'
export default {
data() {
return {
dataSource: [],
loadOption: {},
}
},
onLoad(option) {
this.loadOption = option
this.getList("refresh");
},
onReachBottom() {
this.getList();
},
onPullDownRefresh() {
this.getList("refresh");
},
methods: {
async updataRow(item) {
let params = {
workId: this.loadOption.id,
type: this.loadOption.jobType,
fromUid: this.loadOption.createUserId,
toUid: item.userId,
}
uni.showLoading({
title: '邀请中'
})
let resData = await userrecruitUserInvite(params)
uni.hideLoading()
if (resData.data.code === 200) {
this.$api.msg('邀请成功')
// this.getList()
console.log(this.dataSource.map((vItem) => {
if (item.userId === vItem.userId) {
return {
...item,
isWorkInvite: 1
}
}
return item
}))
this.dataSource = this.dataSource.map((vItem) => {
if (item.userId === vItem.userId) {
return {
...item,
isWorkInvite: 1
}
}
return item
})
}
},
async removeRow(item) {
let params = {
workInviteId: item.id
}
uni.showLoading({
title: '取消中'
})
let resData = await cancelUserInvite(params)
uni.hideLoading()
if (resData.data.code === 200) {
this.$api.msg('取消成功')
// this.getList()
this.dataSource = this.dataSource.map((vItem) => {
if (item.userId === vItem.userId) {
return {
...item,
isWorkInvite: 0
}
}
return item
})
}
},
async getList(type = 'add') {
if (type === "refresh") {
this.pageNumber = 1;
}
const {
jobType,
id
} = this.loadOption
let params = {
type: jobType,
workId: id
}
let resData = await getInviteUserList(params)
uni.stopPullDownRefresh()
if (resData.data.code === 200) {
this.dataSource = resData.data.data
}
}
}
}
</script>
<style scoped>
.btnGr {
background-color: green;
color: #FFFFFF;
font-size: 24rpx;
padding: 5rpx 10rpx;
border-radius: 5rpx;
text-align: center;
}
.btnHuy {
background-color: #e8e8e8;
color: #FFFFFF;
font-size: 24rpx;
padding: 5rpx 10rpx;
border-radius: 5rpx;
text-align: center;
}
.baddd {
background: #f6f6f6;
height: 20rpx;
}
.search-item {
display: flex;
align-items: center;
font-size: 26rpx;
border-bottom: 1rpx solid #ddd;
height: 80rpx;
line-height: 80rpx;
padding: 10rpx 30rpx;
}
.search-item .type {
font-size: 20rpx;
color: #707070;
background-color: #dddddd;
border-radius: 15rpx;
height: 30rpx;
line-height: 30rpx;
padding: 0 20rpx;
}
</style>

View File

@@ -26,6 +26,9 @@
<!-- <view class="fee">
{{info.wage || '暂无'}}
</view> -->
<view class="position_right" v-if="info.reviewState === 1"
@click="navTo(`/pages/projectInfo/sub/inviteList?jobType=${info.jobType}&id=${info.id}&createUserId=${info.createUserId}`)">
邀请用户</view>
</view>
<view class="head">
<view class="proname proneed">
@@ -459,6 +462,26 @@
</script>
<style lang="scss">
.head {
position: relative;
.position_right {
position: absolute;
right: 24rpx;
top: 30rpx;
color: #FFFFFF;
font-size: 24rpx;
background-color: #1B66FF;
border-radius: 12rpx;
padding: 10rpx 20rpx;
}
.position_right:active {
background-color: #e8e8e8;
color: #333333;
}
}
.codeSealBox {
padding: 285rpx 72rpx 0 72rpx;