合并代码
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
VITE_API_BASE_URL=http://114.55.111.44:3001/api
|
VITE_API_BASE_URL=https://www.zrbjr.com/api
|
||||||
VITE_UPLOAD_BASE_URL=http://114.55.111.44:3001/api/upload
|
VITE_UPLOAD_BASE_URL=https://www.zrbjr.com/api/upload
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
@click="handleNavClick('/mymatching')"
|
@click="handleNavClick('/mymatching')"
|
||||||
>
|
>
|
||||||
<User class="nav-icon" />
|
<User class="nav-icon" />
|
||||||
<span class="nav-label">资金匹配</span>
|
<span class="nav-label">货款匹配</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="nav-item"
|
class="nav-item"
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
@click="handleNavClick('/transfers')"
|
@click="handleNavClick('/transfers')"
|
||||||
>
|
>
|
||||||
<Money class="nav-icon" />
|
<Money class="nav-icon" />
|
||||||
<span class="nav-label">转账管理</span>
|
<span class="nav-label">货款管理</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div
|
<!-- <div
|
||||||
class="nav-item"
|
class="nav-item"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const routes = [
|
|||||||
name: 'MyMatching',
|
name: 'MyMatching',
|
||||||
component: () => import('@/views/Matching.vue'),
|
component: () => import('@/views/Matching.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '资金匹配',
|
title: '货款匹配',
|
||||||
requiresAuth: true
|
requiresAuth: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -173,7 +173,7 @@ const routes = [
|
|||||||
name: 'Matching',
|
name: 'Matching',
|
||||||
component: () => import('@/views/Matching.vue'),
|
component: () => import('@/views/Matching.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '资金匹配',
|
title: '货款匹配',
|
||||||
requiresAuth: true
|
requiresAuth: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<el-dropdown-item command="profile">个人中心</el-dropdown-item>
|
<el-dropdown-item command="profile">个人中心</el-dropdown-item>
|
||||||
<el-dropdown-item command="orders">我的订单</el-dropdown-item>
|
<el-dropdown-item command="orders">我的订单</el-dropdown-item>
|
||||||
<el-dropdown-item command="points-history">积分记录</el-dropdown-item>
|
<el-dropdown-item command="points-history">积分记录</el-dropdown-item>
|
||||||
<el-dropdown-item command="transfers">转账管理</el-dropdown-item>
|
<el-dropdown-item command="transfers">货款管理</el-dropdown-item>
|
||||||
<el-dropdown-item divided command="logout">退出登录</el-dropdown-item>
|
<el-dropdown-item divided command="logout">退出登录</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -68,14 +68,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="login-footer">
|
<!-- <div class="login-footer">
|
||||||
<p>
|
<p>
|
||||||
还没有账号?
|
还没有账号?
|
||||||
<el-link type="primary" @click="$router.push('/register')">
|
<el-link type="primary" @click="$router.push('/register')">
|
||||||
立即注册
|
立即注册
|
||||||
</el-link>
|
</el-link>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<!-- 备案信息 -->
|
<!-- 备案信息 -->
|
||||||
<div class="icp-info">
|
<div class="icp-info">
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="matching-container">
|
<div class="matching-container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>资金循环匹配</h1>
|
<h1>货款匹配</h1>
|
||||||
<p class="subtitle">智能匹配,循环增值</p>
|
<!-- <p class="subtitle">智能匹配,循环增值</p> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 统计卡片 -->
|
<!-- 统计卡片 -->
|
||||||
<div class="stats-cards">
|
<!-- <div class="stats-cards">
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-number">{{ stats.userStats?.initiated_orders || 0 }}</div>
|
<div class="stat-number">{{ stats.userStats?.initiated_orders || 0 }}</div>
|
||||||
<div class="stat-label">发起订单</div>
|
<div class="stat-label">发起订单</div>
|
||||||
@@ -15,20 +15,12 @@
|
|||||||
<div class="stat-number">{{ stats.userStats?.participated_allocations || 0 }}</div>
|
<div class="stat-number">{{ stats.userStats?.participated_allocations || 0 }}</div>
|
||||||
<div class="stat-label">参与分配</div>
|
<div class="stat-label">参与分配</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
</div> -->
|
||||||
<div class="stat-number">¥{{ formatAmount(stats.userStats?.total_initiated_amount) }}</div>
|
|
||||||
<div class="stat-label">发起总额</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-card">
|
|
||||||
<div class="stat-number">¥{{ formatAmount(stats.userStats?.total_participated_amount) }}</div>
|
|
||||||
<div class="stat-label">参与总额</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 操作区域 -->
|
<!-- 操作区域 -->
|
||||||
<div class="action-section">
|
<div class="action-section">
|
||||||
<div class="create-order-card">
|
<div class="create-order-card">
|
||||||
<h3>资金匹配</h3>
|
<h3>货款匹配</h3>
|
||||||
|
|
||||||
<!-- 匹配类型选择 -->
|
<!-- 匹配类型选择 -->
|
||||||
<div class="matching-type-selector">
|
<div class="matching-type-selector">
|
||||||
@@ -101,9 +93,9 @@
|
|||||||
|
|
||||||
<!-- 小额匹配提示 -->
|
<!-- 小额匹配提示 -->
|
||||||
<div v-if="matchingType === 'small'" class="tips">
|
<div v-if="matchingType === 'small'" class="tips">
|
||||||
<p>• 系统将为您匹配3笔转账,总金额5000元</p>
|
<p>• 系统将为您匹配3笔货款,总金额5000元</p>
|
||||||
<p>• 优先匹配已完成出款的用户</p>
|
<p>• 优先匹配已完成进货的用户</p>
|
||||||
<p>• 每笔金额随机分配,确保资金循环</p>
|
<!-- <p>• 每笔金额随机分配,确保货款循环</p> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 大额匹配提示 -->
|
<!-- 大额匹配提示 -->
|
||||||
@@ -180,9 +172,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="order-info">
|
<div class="order-info">
|
||||||
<p>金额: ¥{{ order.amount }}</p>
|
<p>金额: ¥{{ order.amount }}</p>
|
||||||
<p>发起人: {{ order.initiator_name }}</p>
|
<p>发起人: {{ order.initiator_real_name }}</p>
|
||||||
<p v-if="!order.is_system_reverse">轮次: {{ order.cycle_count + 1 }}/{{ order.max_cycles }}</p>
|
<p v-if="!order.is_system_reverse">轮次: {{ order.cycle_count + 1 }}/{{ order.max_cycles }}</p>
|
||||||
<p v-if="order.is_system_reverse" class="system-note">系统自动发起,向负余额用户补充资金</p>
|
<p v-if="order.is_system_reverse" class="system-note">系统自动发起,向负余额用户补充货款</p>
|
||||||
<p>创建时间: {{ formatDate(order.created_at) }}</p>
|
<p>创建时间: {{ formatDate(order.created_at) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -204,7 +196,7 @@
|
|||||||
<div class="order-summary">
|
<div class="order-summary">
|
||||||
<p><strong>状态:</strong> {{ getStatusText(selectedOrder.order.status) }}</p>
|
<p><strong>状态:</strong> {{ getStatusText(selectedOrder.order.status) }}</p>
|
||||||
<p><strong>金额:</strong> ¥{{ selectedOrder.order.amount }}</p>
|
<p><strong>金额:</strong> ¥{{ selectedOrder.order.amount }}</p>
|
||||||
<p><strong>发起人:</strong> {{ selectedOrder.order.initiator_name }}</p>
|
<p><strong>发起人:</strong> {{ selectedOrder.order.initiator_real_name }}</p>
|
||||||
<p><strong>轮次:</strong> {{ selectedOrder.order.cycle_count + 1 }}/{{ selectedOrder.order.max_cycles }}</p>
|
<p><strong>轮次:</strong> {{ selectedOrder.order.cycle_count + 1 }}/{{ selectedOrder.order.max_cycles }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -221,7 +213,7 @@
|
|||||||
<span class="cycle">第{{ allocation.cycle_number }}轮</span>
|
<span class="cycle">第{{ allocation.cycle_number }}轮</span>
|
||||||
<span :class="['status', allocation.status]">{{ getStatusText(allocation.status) }}</span>
|
<span :class="['status', allocation.status]">{{ getStatusText(allocation.status) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ allocation.from_user_name }} → {{ allocation.to_user_name }}</p>
|
<p>{{ allocation.from_user_real_name }} → {{ allocation.to_user_real_name }}</p>
|
||||||
<p class="amount">¥{{ allocation.amount }}</p>
|
<p class="amount">¥{{ allocation.amount }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,7 +230,7 @@
|
|||||||
>
|
>
|
||||||
<div class="record-info">
|
<div class="record-info">
|
||||||
<span class="action">{{ getActionText(record.action) }}</span>
|
<span class="action">{{ getActionText(record.action) }}</span>
|
||||||
<span class="user">{{ record.username }}</span>
|
<span class="user">{{ record.real_name }}</span>
|
||||||
<span class="time">{{ formatDate(record.created_at) }}</span>
|
<span class="time">{{ formatDate(record.created_at) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="record.amount" class="record-amount">¥{{ record.amount }}</div>
|
<div v-if="record.amount" class="record-amount">¥{{ record.amount }}</div>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="quick-login">
|
<!-- <div class="quick-login">
|
||||||
<el-divider>快速登录</el-divider>
|
<el-divider>快速登录</el-divider>
|
||||||
<div class="demo-accounts">
|
<div class="demo-accounts">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
普通用户
|
普通用户
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!-- 资金匹配部分 -->
|
<!-- 资金匹配部分 -->
|
||||||
<div class="matching-section">
|
<div class="matching-section">
|
||||||
<div class="section-title">
|
<div class="section-title">
|
||||||
<h3>资金匹配</h3>
|
<h3>货款匹配</h3>
|
||||||
<div class="toggle-switch">
|
<div class="toggle-switch">
|
||||||
<span class="toggle-label">开启大额匹配</span>
|
<span class="toggle-label">开启大额匹配</span>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
|
|||||||
@@ -67,6 +67,47 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item prop="city">
|
||||||
|
<el-select
|
||||||
|
v-model="registerForm.city"
|
||||||
|
placeholder="请选择城市"
|
||||||
|
size="large"
|
||||||
|
clearable
|
||||||
|
@change="onCityChange"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon><Location /></el-icon>
|
||||||
|
</template>
|
||||||
|
<el-option
|
||||||
|
v-for="city in cities"
|
||||||
|
:key="city"
|
||||||
|
:label="city"
|
||||||
|
:value="city"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item prop="district_id">
|
||||||
|
<el-select
|
||||||
|
v-model="registerForm.district_id"
|
||||||
|
placeholder="请选择区域"
|
||||||
|
size="large"
|
||||||
|
clearable
|
||||||
|
:disabled="!registerForm.city"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<el-icon><Location /></el-icon>
|
||||||
|
</template>
|
||||||
|
<el-option
|
||||||
|
v-for="district in filteredDistricts"
|
||||||
|
:key="district.id"
|
||||||
|
:label="district.district_name"
|
||||||
|
:value="district.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
@@ -172,7 +213,7 @@ import { ref, reactive, computed, onMounted } from 'vue'
|
|||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { User, Lock, Message, Edit, ChatDotRound, CreditCard, Ticket } from '@element-plus/icons-vue'
|
import { User, Lock, Message, Edit, ChatDotRound, CreditCard, Ticket, Location } from '@element-plus/icons-vue'
|
||||||
import Captcha from '@/components/Captcha.vue'
|
import Captcha from '@/components/Captcha.vue'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -188,6 +229,8 @@ const registerForm = reactive({
|
|||||||
username: '',
|
username: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
registrationCode: '',
|
registrationCode: '',
|
||||||
|
city: '',
|
||||||
|
district_id: '',
|
||||||
password: '',
|
password: '',
|
||||||
confirmPassword: '',
|
confirmPassword: '',
|
||||||
captcha: '',
|
captcha: '',
|
||||||
@@ -203,6 +246,23 @@ const canSendSMS = computed(() => {
|
|||||||
return phoneRegex.test(registerForm.phone)
|
return phoneRegex.test(registerForm.phone)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 地区数据
|
||||||
|
const regions = ref([])
|
||||||
|
const cities = computed(() => {
|
||||||
|
const citySet = new Set()
|
||||||
|
regions.value.forEach(region => {
|
||||||
|
if (region.city_name) {
|
||||||
|
citySet.add(region.city_name)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return Array.from(citySet).sort()
|
||||||
|
})
|
||||||
|
|
||||||
|
const filteredDistricts = computed(() => {
|
||||||
|
if (!registerForm.city) return []
|
||||||
|
return regions.value.filter(region => region.city_name === registerForm.city)
|
||||||
|
})
|
||||||
|
|
||||||
// 自定义验证函数
|
// 自定义验证函数
|
||||||
const validateUsername = (rule, value, callback) => {
|
const validateUsername = (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@@ -269,7 +329,12 @@ const registerRules = {
|
|||||||
{ required: true, message: '请输入短信验证码', trigger: 'blur' },
|
{ required: true, message: '请输入短信验证码', trigger: 'blur' },
|
||||||
{ pattern: /^\d{6}$/, message: '短信验证码为6位数字', trigger: 'blur' }
|
{ pattern: /^\d{6}$/, message: '短信验证码为6位数字', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
city: [
|
||||||
|
{ required: true, message: '请选择城市', trigger: 'change' }
|
||||||
|
],
|
||||||
|
district_id: [
|
||||||
|
{ required: true, message: '请选择区域', trigger: 'change' }
|
||||||
|
],
|
||||||
password: [{ validator: validatePassword, trigger: 'blur' }],
|
password: [{ validator: validatePassword, trigger: 'blur' }],
|
||||||
confirmPassword: [{ validator: validateConfirmPassword, trigger: 'blur' }],
|
confirmPassword: [{ validator: validateConfirmPassword, trigger: 'blur' }],
|
||||||
captcha: [
|
captcha: [
|
||||||
@@ -326,6 +391,33 @@ const startCountdown = () => {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取地区数据
|
||||||
|
*/
|
||||||
|
const fetchRegions = async () => {
|
||||||
|
try {
|
||||||
|
const response = await fetch('/api/regions/zhejiang')
|
||||||
|
const result = await response.json()
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
regions.value = result.data
|
||||||
|
} else {
|
||||||
|
ElMessage.error('获取地区数据失败')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取地区数据失败:', error)
|
||||||
|
ElMessage.error('获取地区数据失败,请刷新页面重试')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 城市变化处理
|
||||||
|
*/
|
||||||
|
const onCityChange = () => {
|
||||||
|
// 清空区域选择
|
||||||
|
registerForm.district_id = ''
|
||||||
|
}
|
||||||
|
|
||||||
// 处理注册
|
// 处理注册
|
||||||
const handleRegister = async () => {
|
const handleRegister = async () => {
|
||||||
if (!registerFormRef.value || !captchaRef.value) return
|
if (!registerFormRef.value || !captchaRef.value) return
|
||||||
@@ -350,6 +442,8 @@ const handleRegister = async () => {
|
|||||||
username: registerForm.username,
|
username: registerForm.username,
|
||||||
phone: registerForm.phone,
|
phone: registerForm.phone,
|
||||||
registrationCode: registerForm.registrationCode,
|
registrationCode: registerForm.registrationCode,
|
||||||
|
city: registerForm.city,
|
||||||
|
district_id: registerForm.district_id,
|
||||||
password: registerForm.password,
|
password: registerForm.password,
|
||||||
smsCode: registerForm.smsCode,
|
smsCode: registerForm.smsCode,
|
||||||
captchaId: captchaInfo.captchaId,
|
captchaId: captchaInfo.captchaId,
|
||||||
@@ -436,6 +530,9 @@ onMounted(() => {
|
|||||||
registerForm.registrationCode = inviteCode
|
registerForm.registrationCode = inviteCode
|
||||||
ElMessage.success('已自动填入邀请码')
|
ElMessage.success('已自动填入邀请码')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取地区数据
|
||||||
|
fetchRegions()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -417,7 +417,9 @@ const loadMore = () => {
|
|||||||
const getUserPoints = async () => {
|
const getUserPoints = async () => {
|
||||||
try {
|
try {
|
||||||
const {data} = await api.get('/user/points')
|
const {data} = await api.get('/user/points')
|
||||||
userPoints.value = data.data.points
|
console.log(data,'points');
|
||||||
|
|
||||||
|
userPoints.value = data.points
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取用户积分失败:', error)
|
console.error('获取用户积分失败:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<div class="nav-center">
|
<div class="nav-center">
|
||||||
<h1 class="nav-title">转账管理</h1>
|
<h1 class="nav-title">货款管理</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-right">
|
<div class="nav-right">
|
||||||
<!-- 移除发起转账按钮 -->
|
<!-- 移除发起转账按钮 -->
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="transfer-header">
|
<div class="transfer-header">
|
||||||
<span class="from-user">我</span>
|
<span class="from-user">我</span>
|
||||||
<el-icon class="arrow"><Right /></el-icon>
|
<el-icon class="arrow"><Right /></el-icon>
|
||||||
<span class="to-user">{{ allocation.to_user_name }}</span>
|
<span class="to-user">{{ allocation.to_user_real_name || allocation.to_real_name }}</span>
|
||||||
<span class="amount">¥{{ allocation.amount }}</span>
|
<span class="amount">¥{{ allocation.amount }}</span>
|
||||||
<el-tag
|
<el-tag
|
||||||
:type="getOrderStatusType(allocation.order_status)"
|
:type="getOrderStatusType(allocation.order_status)"
|
||||||
|
|||||||
Reference in New Issue
Block a user