| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 | <template>	<layout-page>		<scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="height: calc(100vh - 102rpx);">			<view v-if="total" class="totalShow">恭喜你,已经成功邀请{{ total }}个新用户啦!</view>      <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 || item.user.phone }}</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;}.totalShow {	margin: 30rpx 0 0 30rpx;	color: #333;}</style>
 |