合并代码
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
<h2>{{ agentInfo?.real_name }} - {{ agentInfo?.city_name }}{{ agentInfo?.district_name }}代理</h2>
|
<h2>{{ agentInfo?.real_name }} - {{ agentInfo?.city_name }}{{ agentInfo?.district_name }}代理</h2>
|
||||||
<p>手机号:{{ agentInfo?.phone }}</p>
|
<p>手机号:{{ agentInfo?.phone }}</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- <el-button type="danger" @click="handleLogout">退出登录</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
style="background-color: #409EFF; border-color: #409EFF; color: white; width: 84px;height: 32px;"
|
style="background-color: #409EFF; border-color: #409EFF; color: white; width: 84px;height: 32px;"
|
||||||
@click="handleLogout"
|
@click="handleLogout"
|
||||||
@@ -19,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- 统计卡片 -->
|
<!-- 统计卡片 -->
|
||||||
<div class="stats-grid">
|
<div class="stats-grid">
|
||||||
<!-- 第一行:仅 "招募商户" 和 "总佣金" 水平排列 -->
|
<!-- 仅保留 "招募商户" 和 "总佣金" -->
|
||||||
<div class="stats-row">
|
<div class="stats-row">
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon merchant">
|
<div class="stat-icon merchant">
|
||||||
@@ -43,47 +42,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 第二行:"已使用二维码" 单独一行 -->
|
|
||||||
<div class="stat-card single-stat">
|
|
||||||
<div class="stat-icon code">
|
|
||||||
<el-icon><Document /></el-icon>
|
|
||||||
</div>
|
|
||||||
<div class="stat-content">
|
|
||||||
<div class="stat-number">{{ stats.used_codes || 0 }}</div>
|
|
||||||
<div class="stat-label">已使用二维码</div>
|
|
||||||
<div class="stat-sub">有效:{{ stats.active_codes || 0 }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 功能区域 -->
|
|
||||||
<div class="function-area">
|
|
||||||
<!-- 生成邀请码 -->
|
|
||||||
<div class="function-card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3>生成注册二维码</h3>
|
|
||||||
<el-button type="primary" @click="generateInviteCode" :loading="generating">
|
|
||||||
生成新的邀请二维码
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="currentInviteCode" class="invite-code-section">
|
|
||||||
<div class="qr-code-container">
|
|
||||||
<img :src="currentInviteCode.qr_code" alt="邀请二维码" class="qr-code" />
|
|
||||||
<div class="qr-actions">
|
|
||||||
<el-button type="success" size="small" @click="saveQRCode">
|
|
||||||
保存到手机
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="code-info">
|
|
||||||
|
|
||||||
<p><strong>过期时间:</strong>{{ formatDate(currentInviteCode.expires_at) }}</p>
|
|
||||||
<p class="code-tip">商户扫描此二维码可直接进入注册页面</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 标签页 -->
|
<!-- 标签页 -->
|
||||||
@@ -224,7 +182,7 @@
|
|||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { User, Money, Document } from '@element-plus/icons-vue'
|
import { User, Money } from '@element-plus/icons-vue'
|
||||||
import api from '@/utils/api'
|
import api from '@/utils/api'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -233,8 +191,6 @@ const router = useRouter()
|
|||||||
const agentInfo = ref(null)
|
const agentInfo = ref(null)
|
||||||
const stats = ref({})
|
const stats = ref({})
|
||||||
const activeTab = ref('merchants')
|
const activeTab = ref('merchants')
|
||||||
const generating = ref(false)
|
|
||||||
const currentInviteCode = ref(null)
|
|
||||||
|
|
||||||
// 商户数据
|
// 商户数据
|
||||||
const merchants = ref([])
|
const merchants = ref([])
|
||||||
@@ -313,58 +269,6 @@ const loadCommissions = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const generateInviteCode = async () => {
|
|
||||||
if (!agentInfo.value) return
|
|
||||||
|
|
||||||
generating.value = true
|
|
||||||
try {
|
|
||||||
const { data } = await api.post('/agents/generate-invite-code', {
|
|
||||||
agent_id: agentInfo.value.id
|
|
||||||
})
|
|
||||||
|
|
||||||
currentInviteCode.value = data.data
|
|
||||||
ElMessage.success('二维码生成成功')
|
|
||||||
|
|
||||||
// 刷新统计信息
|
|
||||||
loadStats()
|
|
||||||
} catch (error) {
|
|
||||||
if (error.response?.data?.message) {
|
|
||||||
ElMessage.error(error.response.data.message)
|
|
||||||
} else {
|
|
||||||
ElMessage.error('生成二维码失败')
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
generating.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存二维码图片到设备
|
|
||||||
*/
|
|
||||||
const saveQRCode = () => {
|
|
||||||
if (!currentInviteCode.value?.qr_code) {
|
|
||||||
ElMessage.error('没有可保存的二维码')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 创建一个临时的a标签用于下载
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = currentInviteCode.value.qr_code
|
|
||||||
link.download = `注册二维码_${new Date().toISOString().slice(0, 10)}.png`
|
|
||||||
|
|
||||||
// 触发下载
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
|
|
||||||
ElMessage.success('二维码已保存到设备')
|
|
||||||
} catch (error) {
|
|
||||||
console.error('保存二维码失败:', error)
|
|
||||||
ElMessage.error('保存二维码失败')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
try {
|
try {
|
||||||
await ElMessageBox.confirm('确定要退出登录吗?', '确认退出', {
|
await ElMessageBox.confirm('确定要退出登录吗?', '确认退出', {
|
||||||
@@ -416,10 +320,6 @@ const getCommissionStatusText = (status) => {
|
|||||||
return texts[status] || status
|
return texts[status] || status
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatDate = (date) => {
|
|
||||||
return new Date(date).toLocaleDateString('zh-CN')
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatDateTime = (date) => {
|
const formatDateTime = (date) => {
|
||||||
return new Date(date).toLocaleString('zh-CN')
|
return new Date(date).toLocaleString('zh-CN')
|
||||||
}
|
}
|
||||||
@@ -474,12 +374,11 @@ onMounted(() => {
|
|||||||
.stats-row {
|
.stats-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-bottom: 12px; /* 与下方 "已使用二维码" 卡片间距 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 统计卡片通用样式 */
|
/* 统计卡片通用样式 */
|
||||||
.stat-card {
|
.stat-card {
|
||||||
flex: 1; /* 自动平分空间 */
|
flex: 1;
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -490,11 +389,6 @@ onMounted(() => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "已使用二维码" 单独一行 */
|
|
||||||
.stat-card.single-stat {
|
|
||||||
width: 100%; /* 占满整行 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 图标样式 */
|
/* 图标样式 */
|
||||||
.stat-icon {
|
.stat-icon {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
@@ -514,9 +408,6 @@ onMounted(() => {
|
|||||||
.stat-icon.commission {
|
.stat-icon.commission {
|
||||||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
||||||
}
|
}
|
||||||
.stat-icon.code {
|
|
||||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 文字样式 */
|
/* 文字样式 */
|
||||||
.stat-number {
|
.stat-number {
|
||||||
@@ -535,72 +426,6 @@ onMounted(() => {
|
|||||||
color: #909399;
|
color: #909399;
|
||||||
}
|
}
|
||||||
|
|
||||||
.function-area {
|
|
||||||
padding: 0 24px 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.function-card {
|
|
||||||
background: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 24px;
|
|
||||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
||||||
width: 343px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header h3 {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 16px;
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
|
|
||||||
.invite-code-section {
|
|
||||||
display: flex;
|
|
||||||
gap: 24px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qr-code-container {
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qr-code {
|
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
border: 1px solid #e4e7ed;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qr-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-info {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-info p {
|
|
||||||
margin: 0 0 8px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code-tip {
|
|
||||||
color: #909399 !important;
|
|
||||||
font-size: 12px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-tabs {
|
.main-tabs {
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
@@ -625,7 +450,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-tabs__content) {
|
:deep(.el-tabs__content) {
|
||||||
background: white;
|
background: #a9deffae;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
<!-- 客服二维码图片 -->
|
<!-- 客服二维码图片 -->
|
||||||
<div class="customer-service-container">
|
<div class="customer-service-container">
|
||||||
<img src="/imgs/mainpage/客服码.jpg" alt="客服码" class="customer-service-img">
|
<img src="/imgs/mainpage/客服码.jpg" alt="客服码" class="customer-service-img">
|
||||||
<div class="customer-service-text">扫码联系客服(长按可识别)</div>
|
<div class="customer-service-text">扫码联系客服(长按识别)</div>
|
||||||
<img src="/imgs/mainpage/提示.png" alt="提示" class="customer-service-img">
|
|
||||||
<div class="customer-service-text">点击关于我们,查看客服详情</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -635,7 +635,7 @@ export default {
|
|||||||
} else if (amount <= 15000) {
|
} else if (amount <= 15000) {
|
||||||
return '分成3笔随机金额'
|
return '分成3笔随机金额'
|
||||||
} else {
|
} else {
|
||||||
return '随机分拆,每笔100-10000元'
|
return '随机分拆,每笔1000-8000元'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user