瀏覽代碼

Merge branch 'master' of https://git.citupro.com/zhengnaiwen_citu/menduner-uniapp

Xiao_123 6 月之前
父節點
當前提交
923e373911
共有 5 個文件被更改,包括 197 次插入1 次删除
  1. 13 0
      api/position.js
  2. 6 0
      pages.json
  3. 2 1
      pages/index/my.vue
  4. 110 0
      pagesB/inviteRecord/index.vue
  5. 66 0
      pagesB/inviteRecord/list.vue

+ 13 - 0
api/position.js

@@ -133,6 +133,19 @@ export const getRecommendCount = (params) => {
   })
 }
 
+// 二维码拉新记录
+export const getInviteRecord = (params) => {
+  return request({
+    url: '/app-api/menduner/system/person/get/invite/person/page',
+    method: 'GET',
+    params,
+    custom: {
+      showLoading: false,
+      auth: true
+    }
+  })
+}
+
 // 获取统计信息
 export const getRecommendationList = (params) => {
   return request({

+ 6 - 0
pages.json

@@ -193,6 +193,12 @@
 						"navigationBarTitleText": "职位详情"
 					}
 				},
+				{
+					"path": "inviteRecord/index",
+					"style": {
+						"navigationBarTitleText": "新用户邀请记录"
+					}
+				},
 				{
 					"path": "agreement/index",
 					"style": {

+ 2 - 1
pages/index/my.vue

@@ -104,6 +104,7 @@ const itemList = [
 
 const list = ref([
 	{	title: '我的分享码',	path: 'shareQrCode'	},					
+	{	title: '新用户邀请记录',	path: '/pagesB/inviteRecord/index'	},					
 	{	title: '在线简历',	path: '/pagesA/resumeOnline/index'	},					
 	{	title: '附件简历',	path: '/pagesA/resume/index'	},					
 	{ title: '面试管理', path: '/pagesA/interview/index' },
@@ -114,7 +115,7 @@ const list = ref([
 watch(
   () => vip.value, 
   (newVal) => {
-		if (newVal) list.value.splice(1, 0, {	title: 'vip权益', key: 'vip',	path: '/pagesA/vip/index'	})
+		if (newVal) list.value.splice(2, 0, {	title: 'vip权益', key: 'vip',	path: '/pagesA/vip/index'	})
 		else list.value = list.value.filter(e => !e.key || e.key !== 'vip')
   },
   { immediate: true },

+ 110 - 0
pagesB/inviteRecord/index.vue

@@ -0,0 +1,110 @@
+<template>
+	<layout-page>
+    <scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="height: calc(100vh - 72rpx);">
+      <view v-if="items.length" class="listBox">
+        <!-- <m-list :items="items"></m-list> -->
+				<uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据" style="width: 100%;">
+					<uni-tr>
+						<uni-th width="100" align="center">用户名</uni-th>
+						<uni-th align="center">性别</uni-th>
+						<uni-th align="center">邀请时间</uni-th>
+					</uni-tr>
+					<uni-tr v-for="(item, index) in items" :key="index">
+						<uni-td align="center">{{ item.person.name }}</uni-td>
+						<uni-td align="center">{{ item.person.sexName }}</uni-td>
+						<uni-td align="center">{{ item.user.createTime }}</uni-td>
+						<!-- <uni-td align="center">
+							<view class="uni-group">
+								<button class="uni-button" size="mini" type="warn">删除</button>
+							</view>
+						</uni-td> -->
+					</uni-tr>
+				</uni-table>
+        <uni-load-more :status="more" />
+      </view>
+      <view v-else class="nodata-img-parent">
+        <image
+          src="https://minio.citupro.com/dev/static/nodata.png"
+          mode="widthFix"
+          style="width: 100vw"
+        ></image>
+      </view>
+    </scroll-view>
+  </layout-page>
+</template>
+
+<script setup>
+import { ref, watch } from 'vue'
+import layoutPage from '@/layout'
+import { dealDictObjData } from '@/utils/position'
+import { timesTampChange } from '@/utils/date'
+
+// import MList from './list'
+// import { getDict } from '@/hooks/useDictionaries.js'
+import { getInviteRecord } from '@/api/position.js'
+// import { onLoad } from '@dcloudio/uni-app'
+
+import { userStore } from '@/store/user'
+const useUserStore = userStore()
+
+watch(() => useUserStore.refreshToken, (newVal, oldVal) => {
+  if (useUserStore.refreshToken) {
+		// 监听登录状态
+		console.log('重新登录了')
+	}
+})
+
+// 获取参数
+const pageInfo = ref({
+	pageNo: 1,
+	pageSize: 100
+})
+const total = ref(0)
+const items = ref([])
+const loading = ref(false)
+const more = ref('more')
+
+async function init () {
+	try {
+		loading.value = true
+		const res = await getInviteRecord({
+			...pageInfo.value,
+		})
+		const data = res?.data?.list || []
+		if (!data.length) {
+			pageInfo.value.pageNo--
+			return
+		}
+		const dealData = data.map(e => {
+			e.person = dealDictObjData({}, e.person)
+			if (e.user?.createTime) e.user.createTime = timesTampChange(e.user.createTime)
+			return e
+		})
+		items.value.push(...dealData)
+		total.value = items.value.length
+		more.value = items.value.length === total.value ? 'noMore' : 'more'
+	} catch (error) {
+		pageInfo.value.pageNo--
+	} finally {
+		loading.value = false
+	}
+}
+init()
+
+function loadingMore () {
+	if (total.value === items.value.length) {
+		return
+	}
+	if (loading.value) {
+		return
+	}
+	more.value = 'loading'
+  pageInfo.value.pageNo++
+	init()
+}
+</script>
+<style scoped lang="scss">
+.listBox {
+	padding: 30rpx;
+}
+</style>

+ 66 - 0
pagesB/inviteRecord/list.vue

@@ -0,0 +1,66 @@
+<template>
+	<view
+		class="list"
+		v-for="item in items"
+		:key="item.id"
+	>
+		<view class="list-top">
+			<text class="list-top-person">牛人:{{ item.sendPerson?.name }}</text>
+			<text class="list-top-time">{{ timesTampChange(item.createTime) }}</text>
+		</view>
+		<view class="list-remuneration">
+			薪酬:
+			{{ item.job?.payFrom }}
+			{{ item.job?.payFrom && item.job?.payTo ? ' - ' : '' }}
+			{{ item.job?.payTo }}
+		</view>
+		<view class="list-company">
+			<text>{{ item.enterprise?.anotherName }}</text>
+			<text>{{ item.enterprise?.anotherName && item.job?.name ? ' · ' : '' }}</text>
+			<text>{{ item.job?.name }}</text>
+		</view>
+	</view>
+</template>
+
+<script setup>
+import { timesTampChange } from '@/utils/date'
+const props = defineProps({
+	items: {
+		type: Array,
+		default: () => []
+	}
+})
+</script>
+
+<style lang="scss" scoped>
+.list {
+	background: #FFF;
+	margin-top: 20rpx;
+	&-top {
+		padding: 20rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		&-person {
+			font-size: .9em;
+			color: #333;
+		}
+		&-time {
+			font-size: .75em;
+			color: #999;
+		}
+	}
+	&-company {
+		padding: 30rpx 20rpx;
+		font-size: 28rpx;
+		color: #666;
+		background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
+	}
+	&-remuneration {
+		padding: 20rpx;
+		font-size: 28rpx;
+		color: #666;
+	}
+	
+}
+</style>