1168 lines
28 KiB
Vue
1168 lines
28 KiB
Vue
<script setup>
|
||
/**
|
||
* 邀请新用户页面
|
||
* 合伙人及以上用户可见,用于邀请新用户并获取佣金
|
||
*/
|
||
import { ref, computed, onMounted } from 'vue'
|
||
import { onShow, onPullDownRefresh, onReachBottom, onShareAppMessage } from '@dcloudio/uni-app'
|
||
import { useUserStore, USER_LEVEL } from '@/store/user.js'
|
||
import { useAuth } from '@/composables/useAuth.js'
|
||
import { useNavbar } from '@/composables/useNavbar.js'
|
||
import {
|
||
getInviteInfo,
|
||
getQrcode,
|
||
getRecordList,
|
||
getCommission,
|
||
applyWithdraw,
|
||
getWithdrawList
|
||
} from '@/api/invite.js'
|
||
import { getMiniappInfo, getInviteRule } from '@/api/system.js'
|
||
import Empty from '@/components/Empty/index.vue'
|
||
import Loading from '@/components/Loading/index.vue'
|
||
|
||
const userStore = useUserStore()
|
||
const { checkLogin } = useAuth()
|
||
const { statusBarHeight, navbarHeight, totalNavbarHeight } = useNavbar()
|
||
|
||
// 提现状态常量
|
||
const WITHDRAW_STATUS = {
|
||
APPLYING: 1, // 申请中
|
||
PROCESSING: 2, // 提现中
|
||
COMPLETED: 3, // 已提现
|
||
CANCELLED: 4 // 已取消
|
||
}
|
||
|
||
// 页面状态
|
||
const loading = ref(false)
|
||
const refreshing = ref(false)
|
||
|
||
// 佣金信息
|
||
const commissionInfo = ref({
|
||
withdrawn: 0,
|
||
pending: 0,
|
||
total: 0
|
||
})
|
||
|
||
// 邀请记录列表
|
||
const recordList = ref([])
|
||
const page = ref(1)
|
||
const pageSize = ref(10)
|
||
const total = ref(0)
|
||
const noMore = ref(false)
|
||
|
||
// 弹窗状态
|
||
const showRulePopup = ref(false)
|
||
const showQrcodePopup = ref(false)
|
||
const showWithdrawPopup = ref(false)
|
||
const showWithdrawRecordPopup = ref(false)
|
||
|
||
// 二维码数据
|
||
const qrcodeUrl = ref('')
|
||
const qrcodeLoading = ref(false)
|
||
|
||
// 小程序信息
|
||
const miniappName = ref('')
|
||
const miniappIntro = ref('')
|
||
|
||
// 规则说明内容
|
||
const ruleContent = ref('')
|
||
|
||
// 提现表单
|
||
const withdrawAmount = ref('')
|
||
const withdrawLoading = ref(false)
|
||
|
||
// 提现记录
|
||
const withdrawRecordList = ref([])
|
||
const withdrawRecordPage = ref(1)
|
||
const withdrawRecordTotal = ref(0)
|
||
const withdrawRecordNoMore = ref(false)
|
||
const withdrawRecordLoading = ref(false)
|
||
|
||
// 计算属性
|
||
const isEmpty = computed(() => !loading.value && recordList.value.length === 0)
|
||
|
||
// 导航栏样式
|
||
const navbarStyle = computed(() => ({
|
||
paddingTop: statusBarHeight.value + 'px',
|
||
height: totalNavbarHeight.value + 'rpx'
|
||
}))
|
||
|
||
/**
|
||
* 获取提现状态文本
|
||
*/
|
||
function getWithdrawStatusText(status) {
|
||
const statusMap = {
|
||
[WITHDRAW_STATUS.APPLYING]: '申请中',
|
||
[WITHDRAW_STATUS.PROCESSING]: '提现中',
|
||
[WITHDRAW_STATUS.CANCELLED]: '已取消',
|
||
[WITHDRAW_STATUS.COMPLETED]: '已提现'
|
||
}
|
||
return statusMap[status] || '未知状态'
|
||
}
|
||
|
||
/**
|
||
* 格式化日期
|
||
*/
|
||
function formatDate(dateStr) {
|
||
if (!dateStr) return ''
|
||
const date = new Date(dateStr)
|
||
const year = date.getFullYear()
|
||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||
const day = String(date.getDate()).padStart(2, '0')
|
||
return `${year}/${month}/${day}`
|
||
}
|
||
|
||
/**
|
||
* 格式化金额(整数)
|
||
*/
|
||
function formatAmount(amount) {
|
||
if (amount === undefined || amount === null) return '0.00'
|
||
return Number(amount).toFixed(2)
|
||
}
|
||
|
||
/**
|
||
* 加载佣金信息
|
||
*/
|
||
async function loadCommissionInfo() {
|
||
try {
|
||
const res = await getCommission()
|
||
if (res.code === 0 && res.data) {
|
||
commissionInfo.value = {
|
||
withdrawn: res.data.withdrawnAmount || 0,
|
||
pending: res.data.pendingAmount || 0,
|
||
total: res.data.totalIncome || 0
|
||
}
|
||
}
|
||
} catch (error) {
|
||
console.error('获取佣金信息失败:', error)
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 加载小程序信息(名称和简介)
|
||
*/
|
||
async function loadMiniappInfo() {
|
||
try {
|
||
const res = await getMiniappInfo()
|
||
if (res.code === 0 && res.data) {
|
||
miniappName.value = res.data.name || ''
|
||
miniappIntro.value = res.data.intro || ''
|
||
}
|
||
} catch (error) {
|
||
console.error('获取小程序信息失败:', error)
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 加载邀请规则说明
|
||
*/
|
||
async function loadInviteRule() {
|
||
try {
|
||
const res = await getInviteRule()
|
||
if (res.code === 0 && res.data) {
|
||
ruleContent.value = res.data
|
||
}
|
||
} catch (error) {
|
||
console.error('获取邀请规则失败:', error)
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 加载邀请记录列表
|
||
*/
|
||
async function loadRecordList(isRefresh = false) {
|
||
if (loading.value) return
|
||
if (isRefresh) {
|
||
page.value = 1
|
||
noMore.value = false
|
||
}
|
||
loading.value = true
|
||
try {
|
||
const res = await getRecordList({ page: page.value, pageSize: pageSize.value })
|
||
if (res.code === 0 && res.data) {
|
||
const list = res.data.list || []
|
||
total.value = res.data.total || 0
|
||
if (isRefresh) {
|
||
recordList.value = list
|
||
} else {
|
||
recordList.value = [...recordList.value, ...list]
|
||
}
|
||
noMore.value = recordList.value.length >= total.value
|
||
}
|
||
} catch (error) {
|
||
console.error('获取邀请记录失败:', error)
|
||
} finally {
|
||
loading.value = false
|
||
refreshing.value = false
|
||
uni.stopPullDownRefresh()
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 加载提现记录
|
||
*/
|
||
async function loadWithdrawRecordList(isRefresh = false) {
|
||
if (withdrawRecordLoading.value) return
|
||
if (isRefresh) {
|
||
withdrawRecordPage.value = 1
|
||
withdrawRecordNoMore.value = false
|
||
}
|
||
withdrawRecordLoading.value = true
|
||
try {
|
||
const res = await getWithdrawList({ page: withdrawRecordPage.value, pageSize: 10 })
|
||
if (res.code === 0 && res.data) {
|
||
const list = res.data.list || []
|
||
withdrawRecordTotal.value = res.data.total || 0
|
||
if (isRefresh) {
|
||
withdrawRecordList.value = list
|
||
} else {
|
||
withdrawRecordList.value = [...withdrawRecordList.value, ...list]
|
||
}
|
||
withdrawRecordNoMore.value = withdrawRecordList.value.length >= withdrawRecordTotal.value
|
||
}
|
||
} catch (error) {
|
||
console.error('获取提现记录失败:', error)
|
||
} finally {
|
||
withdrawRecordLoading.value = false
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 加载二维码URL(进入页面时自动调用)
|
||
*/
|
||
async function loadQrcodeUrl() {
|
||
if (qrcodeUrl.value) return
|
||
qrcodeLoading.value = true
|
||
try {
|
||
const res = await getQrcode()
|
||
if (res.code === 0 && res.data) {
|
||
qrcodeUrl.value = res.data.qrcodeUrl || res.data.url || ''
|
||
}
|
||
} catch (error) {
|
||
console.error('获取二维码失败:', error)
|
||
} finally {
|
||
qrcodeLoading.value = false
|
||
}
|
||
}
|
||
|
||
// 弹窗操作
|
||
function handleShowRule() { showRulePopup.value = true }
|
||
function handleCloseRule() { showRulePopup.value = false }
|
||
|
||
async function handleGenerateQrcode() {
|
||
showQrcodePopup.value = true
|
||
// 如果还没加载到,再请求一次
|
||
if (!qrcodeUrl.value && !qrcodeLoading.value) {
|
||
qrcodeLoading.value = true
|
||
try {
|
||
const res = await getQrcode()
|
||
if (res.code === 0 && res.data) {
|
||
qrcodeUrl.value = res.data.qrcodeUrl || res.data.url || ''
|
||
} else {
|
||
uni.showToast({ title: res.message || '生成二维码失败', icon: 'none' })
|
||
}
|
||
} catch (error) {
|
||
console.error('生成二维码失败:', error)
|
||
uni.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||
} finally {
|
||
qrcodeLoading.value = false
|
||
}
|
||
}
|
||
}
|
||
|
||
function handleCloseQrcode() { showQrcodePopup.value = false }
|
||
|
||
function handleSaveQrcode() {
|
||
if (!qrcodeUrl.value) {
|
||
uni.showToast({ title: '二维码未加载', icon: 'none' })
|
||
return
|
||
}
|
||
uni.saveImageToPhotosAlbum({
|
||
filePath: qrcodeUrl.value,
|
||
success: () => { uni.showToast({ title: '保存成功', icon: 'success' }) },
|
||
fail: (err) => {
|
||
if (err.errMsg.includes('auth deny')) {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '需要您授权保存图片到相册',
|
||
confirmText: '去设置',
|
||
success: (res) => { if (res.confirm) uni.openSetting() }
|
||
})
|
||
} else {
|
||
uni.showToast({ title: '保存失败', icon: 'none' })
|
||
}
|
||
}
|
||
})
|
||
}
|
||
|
||
function handleShowWithdraw() {
|
||
withdrawAmount.value = ''
|
||
showWithdrawPopup.value = true
|
||
}
|
||
function handleCloseWithdraw() { showWithdrawPopup.value = false }
|
||
|
||
async function handleSubmitWithdraw() {
|
||
const amount = parseFloat(withdrawAmount.value)
|
||
if (!amount || isNaN(amount) || amount <= 0) {
|
||
uni.showToast({ title: '请输入有效金额', icon: 'none' })
|
||
return
|
||
}
|
||
// 最多2位小数
|
||
if (Math.round(amount * 100) / 100 !== amount) {
|
||
uni.showToast({ title: '金额最多保留2位小数', icon: 'none' })
|
||
return
|
||
}
|
||
if (amount > commissionInfo.value.pending) {
|
||
uni.showToast({ title: '超出待提现金额', icon: 'none' })
|
||
return
|
||
}
|
||
withdrawLoading.value = true
|
||
try {
|
||
const res = await applyWithdraw(amount)
|
||
if (res.code === 0) {
|
||
uni.showToast({ title: '申请已提交', icon: 'success' })
|
||
showWithdrawPopup.value = false
|
||
loadCommissionInfo()
|
||
} else {
|
||
uni.showToast({ title: res.message || '申请失败', icon: 'none' })
|
||
}
|
||
} catch (error) {
|
||
uni.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||
} finally {
|
||
withdrawLoading.value = false
|
||
}
|
||
}
|
||
|
||
function handleShowWithdrawRecord() {
|
||
showWithdrawRecordPopup.value = true
|
||
loadWithdrawRecordList(true)
|
||
}
|
||
function handleCloseWithdrawRecord() { showWithdrawRecordPopup.value = false }
|
||
|
||
function handleWithdrawRecordScrollToLower() {
|
||
if (!withdrawRecordNoMore.value && !withdrawRecordLoading.value) {
|
||
withdrawRecordPage.value++
|
||
loadWithdrawRecordList()
|
||
}
|
||
}
|
||
|
||
// 生命周期
|
||
onPullDownRefresh(() => {
|
||
refreshing.value = true
|
||
loadCommissionInfo()
|
||
loadRecordList(true)
|
||
})
|
||
|
||
onReachBottom(() => {
|
||
if (!noMore.value && !loading.value) {
|
||
page.value++
|
||
loadRecordList()
|
||
}
|
||
})
|
||
|
||
onShareAppMessage(() => ({
|
||
title: '邀请您加入学业邑规划',
|
||
path: `/pages/index/index?inviterId=${userStore.userId}`,
|
||
imageUrl: '/static/ic_share.png'
|
||
}))
|
||
|
||
onShow(() => {
|
||
userStore.restoreFromStorage()
|
||
if (!checkLogin()) return
|
||
if (!userStore.isPartner) {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '该功能仅限合伙人使用',
|
||
showCancel: false,
|
||
confirmText: '返回',
|
||
success: () => { uni.navigateBack() }
|
||
})
|
||
return
|
||
}
|
||
loadCommissionInfo()
|
||
loadRecordList(true)
|
||
loadMiniappInfo()
|
||
loadQrcodeUrl()
|
||
loadInviteRule()
|
||
})
|
||
|
||
onMounted(() => { userStore.restoreFromStorage() })
|
||
</script>
|
||
|
||
<template>
|
||
<view class="invite-page">
|
||
<!-- 自定义导航栏 -->
|
||
<view class="custom-navbar" :style="navbarStyle">
|
||
<view class="navbar-content" :style="{ height: navbarHeight + 'rpx' }">
|
||
<view class="navbar-back" @click="() => uni.navigateBack()">
|
||
<view class="back-icon"></view>
|
||
</view>
|
||
<text class="navbar-title">邀请新用户</text>
|
||
<view class="navbar-right"></view>
|
||
</view>
|
||
</view>
|
||
<view class="navbar-placeholder" :style="{ height: totalNavbarHeight + 'px' }"></view>
|
||
|
||
<!-- Banner 区域 -->
|
||
<view class="banner-section">
|
||
<image class="banner-img" src="/static/invite/banner.png" mode="aspectFill" />
|
||
<view class="rule-btn" @click="handleShowRule">
|
||
<text>规则说明</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 操作按钮 -->
|
||
<view class="action-section">
|
||
<view class="action-btn" @click="handleGenerateQrcode">
|
||
<text>生成二维码</text>
|
||
</view>
|
||
<button class="action-btn" open-type="share">
|
||
<text>分享链接</text>
|
||
</button>
|
||
</view>
|
||
|
||
<!-- 提现记录卡片 -->
|
||
<view class="commission-card">
|
||
<image class="commission-bg" src="/static/invite/txbg.png" mode="aspectFill" />
|
||
<view class="commission-content">
|
||
<view class="commission-header">
|
||
<text class="commission-title">提现记录</text>
|
||
<view class="commission-link" @click="handleShowWithdrawRecord">
|
||
<text>查看提现记录</text>
|
||
<text class="link-arrow">›</text>
|
||
</view>
|
||
</view>
|
||
<view class="commission-amounts">
|
||
<view class="amount-item">
|
||
<text class="amount-value">{{ formatAmount(commissionInfo.pending) }}元</text>
|
||
<text class="amount-label">待提现</text>
|
||
</view>
|
||
<view class="amount-divider"></view>
|
||
<view class="amount-item">
|
||
<text class="amount-value withdrawn">{{ formatAmount(commissionInfo.withdrawn) }}元</text>
|
||
<text class="amount-label">已提现</text>
|
||
</view>
|
||
</view>
|
||
<view class="withdraw-btn" @click="handleShowWithdraw">
|
||
<text>申请提现</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 邀请记录 -->
|
||
<view class="record-section">
|
||
<view class="record-header">
|
||
<text class="record-title">我的邀请记录</text>
|
||
</view>
|
||
<!-- 表头 -->
|
||
<view class="record-table-header">
|
||
<text class="col-name">用户昵称</text>
|
||
<text class="col-uid">UID</text>
|
||
<text class="col-date">注册日期</text>
|
||
<text class="col-commission">佣金</text>
|
||
</view>
|
||
<!-- 加载中 -->
|
||
<Loading type="page" :loading="loading && recordList.length === 0" />
|
||
<!-- 列表 -->
|
||
<view class="record-table-body" v-if="!isEmpty">
|
||
<view class="record-row" v-for="record in recordList" :key="record.id">
|
||
<text class="col-name">{{ record.nickname || '用户' }}</text>
|
||
<text class="col-uid">{{ record.uid || '--' }}</text>
|
||
<text class="col-date">{{ record.registerDate || '--' }}</text>
|
||
<text class="col-commission commission-text">¥{{ formatAmount(record.commission) }}</text>
|
||
</view>
|
||
<Loading type="more" :loading="loading && recordList.length > 0" :noMore="noMore" noMoreText="没有更多记录了" />
|
||
</view>
|
||
<!-- 空状态 -->
|
||
<Empty v-if="isEmpty" text="暂无邀请记录" :showButton="false" />
|
||
</view>
|
||
|
||
<!-- 规则说明弹窗 -->
|
||
<view v-if="showRulePopup" class="popup-mask" @click="handleCloseRule">
|
||
<view class="popup-container rule-popup" @click.stop>
|
||
<view class="popup-header">
|
||
<text class="popup-title">规则说明</text>
|
||
<view class="popup-close" @click="handleCloseRule"><text>×</text></view>
|
||
</view>
|
||
<scroll-view class="popup-body" scroll-y>
|
||
<view class="rule-content">
|
||
<text class="rule-text">{{ ruleContent || '暂无规则说明' }}</text>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 二维码弹窗 -->
|
||
<view v-if="showQrcodePopup" class="popup-mask" @click="handleCloseQrcode">
|
||
<view class="qrcode-popup-wrap" @click.stop>
|
||
<!-- 二维码卡片 -->
|
||
<view class="qrcode-card">
|
||
<text class="qrcode-title">{{ miniappName || '小程序名称' }}</text>
|
||
<view class="qrcode-wrapper">
|
||
<Loading type="inline" :loading="qrcodeLoading" v-if="qrcodeLoading" />
|
||
<image v-else-if="qrcodeUrl" class="qrcode-img" :src="qrcodeUrl" mode="aspectFit" />
|
||
<text v-else class="qrcode-fail">二维码加载失败</text>
|
||
</view>
|
||
<text class="qrcode-desc">{{ miniappIntro || '' }}</text>
|
||
</view>
|
||
<!-- 操作按钮(卡片外部) -->
|
||
<view class="qrcode-actions">
|
||
<button class="qrcode-btn share" open-type="share"><text>分享给好友</text></button>
|
||
<view class="qrcode-btn save" @click="handleSaveQrcode"><text>保存二维码</text></view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 申请提现弹窗 -->
|
||
<view v-if="showWithdrawPopup" class="popup-mask" @click="handleCloseWithdraw">
|
||
<view class="popup-container withdraw-popup" @click.stop>
|
||
<text class="withdraw-title">请输入提现金额</text>
|
||
<view class="withdraw-input-wrap">
|
||
<input class="withdraw-input" type="digit" v-model="withdrawAmount" placeholder="请输入金额" placeholder-class="input-placeholder" />
|
||
</view>
|
||
<text class="withdraw-tip">提现金额支持2位小数</text>
|
||
<view class="withdraw-submit" :class="{ disabled: withdrawLoading }" @click="handleSubmitWithdraw">
|
||
<text>申请提现</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 提现记录弹窗 -->
|
||
<view v-if="showWithdrawRecordPopup" class="popup-mask" @click="handleCloseWithdrawRecord">
|
||
<view class="popup-container wr-popup" @click.stop>
|
||
<view class="popup-header">
|
||
<text class="popup-title">提现记录</text>
|
||
<view class="popup-close" @click="handleCloseWithdrawRecord"><text>×</text></view>
|
||
</view>
|
||
<scroll-view class="wr-body" scroll-y @scrolltolower="handleWithdrawRecordScrollToLower">
|
||
<!-- 表头 -->
|
||
<view class="wr-table-header">
|
||
<text class="wr-col-time">时间</text>
|
||
<text class="wr-col-amount">金额</text>
|
||
<text class="wr-col-status">状态</text>
|
||
</view>
|
||
<Loading type="inline" :loading="withdrawRecordLoading && withdrawRecordList.length === 0" />
|
||
<view v-if="withdrawRecordList.length > 0">
|
||
<view class="wr-row" v-for="record in withdrawRecordList" :key="record.id">
|
||
<text class="wr-col-time">{{ formatDate(record.createTime) }}</text>
|
||
<text class="wr-col-amount">¥{{ formatAmount(record.amount) }}</text>
|
||
<text class="wr-col-status">{{ getWithdrawStatusText(record.status) }}</text>
|
||
</view>
|
||
</view>
|
||
<view class="wr-empty" v-else-if="!withdrawRecordLoading">
|
||
<text>暂无提现记录</text>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<style lang="scss" scoped>
|
||
@import '@/styles/variables.scss';
|
||
|
||
.invite-page {
|
||
min-height: 100vh;
|
||
background-color: $bg-color;
|
||
padding-bottom: calc(#{$spacing-xl} + env(safe-area-inset-bottom));
|
||
}
|
||
|
||
// 导航栏
|
||
.custom-navbar {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
background-color: $bg-white;
|
||
z-index: 999;
|
||
|
||
.navbar-content {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 $spacing-lg;
|
||
|
||
.navbar-back {
|
||
width: 60rpx;
|
||
height: 60rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
.back-icon {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
border-left: 4rpx solid $text-color;
|
||
border-bottom: 4rpx solid $text-color;
|
||
transform: rotate(45deg);
|
||
margin-left: 8rpx;
|
||
}
|
||
}
|
||
|
||
.navbar-title {
|
||
font-size: 34rpx;
|
||
font-weight: $font-weight-medium;
|
||
color: $text-color;
|
||
}
|
||
|
||
.navbar-right {
|
||
width: 60rpx;
|
||
}
|
||
}
|
||
}
|
||
|
||
.navbar-placeholder {
|
||
width: 100%;
|
||
}
|
||
|
||
// Banner 区域
|
||
.banner-section {
|
||
position: relative;
|
||
width: 100%;
|
||
margin-top: -2rpx;
|
||
|
||
.banner-img {
|
||
width: 100%;
|
||
height: 320rpx;
|
||
display: block;
|
||
}
|
||
|
||
.rule-btn {
|
||
position: absolute;
|
||
right: 0;
|
||
bottom: 24rpx;
|
||
background-color: rgba(0, 0, 0, 0.4);
|
||
border-radius: 24rpx 0 0 24rpx;
|
||
padding: 12rpx 24rpx;
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-white;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 操作按钮
|
||
.action-section {
|
||
display: flex;
|
||
gap: $spacing-lg;
|
||
padding: $spacing-lg $spacing-lg 0;
|
||
|
||
.action-btn {
|
||
flex: 1;
|
||
height: 80rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background-color: #FF4D4F;
|
||
border-radius: $border-radius-round;
|
||
border: none;
|
||
padding: 0;
|
||
margin: 0;
|
||
line-height: normal;
|
||
|
||
&::after {
|
||
border: none;
|
||
}
|
||
|
||
&:active {
|
||
opacity: 0.85;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-lg;
|
||
color: $text-white;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 提现记录卡片
|
||
.commission-card {
|
||
margin: $spacing-lg;
|
||
border-radius: $border-radius-lg;
|
||
overflow: hidden;
|
||
position: relative;
|
||
min-height: 340rpx;
|
||
|
||
.commission-bg {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.commission-content {
|
||
position: relative;
|
||
z-index: 1;
|
||
padding: $spacing-lg;
|
||
|
||
.commission-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin: -#{$spacing-lg} -#{$spacing-lg} $spacing-lg;
|
||
padding: $spacing-md $spacing-lg;
|
||
background-color: #FF4757;
|
||
border-radius: $border-radius-lg $border-radius-lg 0 0;
|
||
|
||
.commission-title {
|
||
font-size: $font-size-lg;
|
||
font-weight: $font-weight-bold;
|
||
color: $text-white;
|
||
}
|
||
|
||
.commission-link {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-white;
|
||
}
|
||
|
||
.link-arrow {
|
||
margin-left: 4rpx;
|
||
font-size: $font-size-md;
|
||
}
|
||
}
|
||
}
|
||
|
||
.commission-amounts {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-bottom: $spacing-lg;
|
||
padding: $spacing-md 0;
|
||
|
||
.amount-item {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
|
||
.amount-value {
|
||
font-size: 48rpx;
|
||
font-weight: $font-weight-bold;
|
||
color: #FF4D4F;
|
||
margin-bottom: 8rpx;
|
||
|
||
&.withdrawn {
|
||
color: #FF4D4F;
|
||
}
|
||
}
|
||
|
||
.amount-label {
|
||
font-size: $font-size-sm;
|
||
color: $text-secondary;
|
||
}
|
||
}
|
||
|
||
.amount-divider {
|
||
width: 1rpx;
|
||
height: 60rpx;
|
||
background-color: rgba(0, 0, 0, 0.1);
|
||
}
|
||
}
|
||
|
||
.withdraw-btn {
|
||
width: 240rpx;
|
||
height: 72rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background-color: #FF4D4F;
|
||
border-radius: $border-radius-round;
|
||
margin: 0 auto;
|
||
|
||
&:active {
|
||
opacity: 0.85;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-md;
|
||
color: $text-white;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// 邀请记录
|
||
.record-section {
|
||
margin: 0 $spacing-lg;
|
||
background-color: $bg-white;
|
||
border-radius: $border-radius-lg;
|
||
overflow: hidden;
|
||
min-height: 300rpx;
|
||
border: 2rpx solid #FF4D4F;
|
||
|
||
.record-header {
|
||
background-color: #FF4D4F;
|
||
padding: $spacing-md $spacing-lg;
|
||
|
||
.record-title {
|
||
font-size: $font-size-lg;
|
||
font-weight: $font-weight-bold;
|
||
color: $text-white;
|
||
}
|
||
}
|
||
|
||
.record-table-header {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: $spacing-sm $spacing-lg;
|
||
border-bottom: 1rpx solid $border-light;
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-secondary;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
|
||
.record-table-body {
|
||
.record-row {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: $spacing-md $spacing-lg;
|
||
border-bottom: 1rpx solid $border-light;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-color;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 列宽
|
||
.col-name {
|
||
width: 25%;
|
||
text-align: left;
|
||
}
|
||
|
||
.col-uid {
|
||
width: 25%;
|
||
text-align: center;
|
||
}
|
||
|
||
.col-date {
|
||
width: 30%;
|
||
text-align: center;
|
||
}
|
||
|
||
.col-commission {
|
||
width: 20%;
|
||
text-align: right;
|
||
}
|
||
|
||
.commission-text {
|
||
color: #FF4D4F !important;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
|
||
// 弹窗通用
|
||
.popup-mask {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background-color: rgba(0, 0, 0, 0.5);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
z-index: 1000;
|
||
}
|
||
|
||
.popup-container {
|
||
width: 600rpx;
|
||
max-height: 80vh;
|
||
background-color: $bg-white;
|
||
border-radius: $border-radius-lg;
|
||
overflow: hidden;
|
||
|
||
.popup-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: $spacing-lg;
|
||
|
||
.popup-title {
|
||
font-size: $font-size-lg;
|
||
font-weight: $font-weight-bold;
|
||
color: $text-color;
|
||
}
|
||
|
||
.popup-close {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
text {
|
||
font-size: 48rpx;
|
||
color: $text-placeholder;
|
||
line-height: 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
.popup-body {
|
||
padding: 0 $spacing-lg $spacing-lg;
|
||
}
|
||
}
|
||
|
||
// 规则说明弹窗
|
||
.rule-popup {
|
||
.popup-body {
|
||
max-height: 500rpx;
|
||
padding: 0 $spacing-lg $spacing-lg;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.rule-content {
|
||
padding-right: $spacing-xs;
|
||
|
||
.rule-text {
|
||
font-size: $font-size-md;
|
||
color: $text-color;
|
||
line-height: 1.8;
|
||
word-break: break-all;
|
||
white-space: pre-wrap;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 二维码弹窗
|
||
.qrcode-popup-wrap {
|
||
width: 100%;
|
||
padding: 0 $spacing-xl;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
margin-top: -10vh;
|
||
|
||
.qrcode-card {
|
||
width: 100%;
|
||
background-color: $bg-white;
|
||
border-radius: $border-radius-lg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: $spacing-xl $spacing-lg;
|
||
|
||
.qrcode-title {
|
||
font-size: $font-size-lg;
|
||
font-weight: $font-weight-bold;
|
||
color: $text-color;
|
||
margin-bottom: $spacing-lg;
|
||
}
|
||
|
||
.qrcode-wrapper {
|
||
width: 100%;
|
||
aspect-ratio: 1;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-bottom: $spacing-lg;
|
||
|
||
.qrcode-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.qrcode-fail {
|
||
font-size: $font-size-md;
|
||
color: $text-placeholder;
|
||
}
|
||
}
|
||
|
||
.qrcode-desc {
|
||
font-size: $font-size-sm;
|
||
color: $text-secondary;
|
||
}
|
||
}
|
||
|
||
.qrcode-actions {
|
||
display: flex;
|
||
gap: $spacing-lg;
|
||
width: 100%;
|
||
margin-top: $spacing-xl;
|
||
|
||
.qrcode-btn {
|
||
flex: 1;
|
||
height: 88rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: $border-radius-round;
|
||
border: none;
|
||
padding: 0;
|
||
margin: 0;
|
||
line-height: normal;
|
||
|
||
&::after {
|
||
border: none;
|
||
}
|
||
|
||
&:active {
|
||
opacity: 0.85;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-lg;
|
||
color: $text-white;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
|
||
&.share {
|
||
background-color: #FF4D4F;
|
||
}
|
||
|
||
&.save {
|
||
background-color: $primary-color;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// 申请提现弹窗
|
||
.withdraw-popup {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: $spacing-xl;
|
||
|
||
.withdraw-title {
|
||
font-size: $font-size-lg;
|
||
font-weight: $font-weight-bold;
|
||
color: $text-color;
|
||
margin-bottom: $spacing-xl;
|
||
}
|
||
|
||
.withdraw-input-wrap {
|
||
width: 100%;
|
||
background-color: $bg-gray;
|
||
border-radius: $border-radius-md;
|
||
padding: 0 $spacing-md;
|
||
margin-bottom: $spacing-sm;
|
||
|
||
.withdraw-input {
|
||
height: 88rpx;
|
||
font-size: $font-size-lg;
|
||
color: $text-color;
|
||
width: 100%;
|
||
text-align: center;
|
||
}
|
||
|
||
.input-placeholder {
|
||
color: $text-placeholder;
|
||
}
|
||
}
|
||
|
||
.withdraw-tip {
|
||
font-size: $font-size-xs;
|
||
color: $text-placeholder;
|
||
margin-bottom: $spacing-xl;
|
||
}
|
||
|
||
.withdraw-submit {
|
||
width: 240rpx;
|
||
height: 80rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background-color: $text-color;
|
||
border-radius: $border-radius-round;
|
||
|
||
&:active {
|
||
opacity: 0.85;
|
||
}
|
||
|
||
&.disabled {
|
||
background-color: $text-disabled;
|
||
pointer-events: none;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-lg;
|
||
color: $text-white;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 提现记录弹窗
|
||
.wr-popup {
|
||
width: 680rpx;
|
||
|
||
.wr-body {
|
||
max-height: 600rpx;
|
||
padding: 0 $spacing-md $spacing-lg;
|
||
box-sizing: border-box;
|
||
|
||
.wr-table-header {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: $spacing-sm 0;
|
||
border-bottom: 1rpx solid $border-light;
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-secondary;
|
||
font-weight: $font-weight-medium;
|
||
}
|
||
}
|
||
|
||
.wr-row {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: $spacing-md 0;
|
||
border-bottom: 1rpx solid $border-light;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
text {
|
||
font-size: $font-size-sm;
|
||
color: $text-color;
|
||
}
|
||
}
|
||
|
||
.wr-col-time {
|
||
flex: 2;
|
||
text-align: left;
|
||
}
|
||
|
||
.wr-col-amount {
|
||
flex: 1;
|
||
text-align: center;
|
||
}
|
||
|
||
.wr-col-status {
|
||
flex: 1;
|
||
text-align: right;
|
||
}
|
||
|
||
.wr-empty {
|
||
padding: 60rpx 0;
|
||
text-align: center;
|
||
|
||
text {
|
||
font-size: $font-size-md;
|
||
color: $text-placeholder;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</style>
|