diff --git a/.env.production b/.env.production index d441c26..f30164f 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ # 生产环境配置 -VITE_API_BASE_URL=http://114.55.111.44:3001/api -VITE_UPLOAD_BASE_URL=http://114.55.111.44:3001/api/upload +VITE_API_BASE_URL=https://www.zrbjr.com/api +VITE_UPLOAD_BASE_URL=https://www.zrbjr.com/api/upload diff --git a/src/views/Matching.vue b/src/views/Matching.vue index a19d1b8..bfdf38c 100644 --- a/src/views/Matching.vue +++ b/src/views/Matching.vue @@ -5,38 +5,23 @@ - - -
-

货款匹配

- - -
-
- - +
+

货款匹配

+
+ 开启大额匹配 +
@@ -102,7 +87,7 @@

• 金额范围:5000-50000元

• 15000元以下:分成3笔随机金额

-

• 15000元以上:随机分拆,每笔1000-8000元

+

• 15000元以上:随机分拆,每笔100-10000元

• 优先匹配已完成进货的用户

@@ -339,6 +324,27 @@ + + + +
+

确认要开启大额匹配吗?

+
+ + +
@@ -377,13 +383,36 @@ export default { actualAmount: 0, voucher: '', description: '' - } + }, + showLargeMatchingConfirm: false, + tempMatchingType: 'small' // 临时存储切换前的类型 } }, async mounted() { await this.loadData() }, methods: { + handleMatchingTypeChange() { + if (this.tempMatchingType === 'large') { + // 如果要切换到大额匹配,显示确认对话框 + this.showLargeMatchingConfirm = true + } else { + // 直接切换到小额匹配 + this.matchingType = this.tempMatchingType + } + }, + + confirmLargeMatching() { + this.matchingType = 'large' + this.showLargeMatchingConfirm = false + this.$message.success('已开启大额匹配模式') + }, + + cancelLargeMatching() { + this.tempMatchingType = 'small' // 重置开关状态 + this.showLargeMatchingConfirm = false + }, + async loadData() { try { await Promise.all([ @@ -635,7 +664,7 @@ export default { } else if (amount <= 15000) { return '分成3笔随机金额' } else { - return '随机分拆,每笔1000-8000元' + return '随机分拆,每笔100-10000元' } }, @@ -651,8 +680,8 @@ export default { return '3' } else { // 15000以上随机分拆,估算笔数范围 - const minCount = Math.ceil(amount / 8000) // 按最大单笔8000计算最少笔数 - const maxCount = Math.floor(amount / 1000) // 按最小单笔1000计算最多笔数 + const minCount = Math.ceil(amount / 10000) // 按最大单笔10000计算最少笔数 + const maxCount = Math.floor(amount / 100) // 按最小单笔100计算最多笔数 return `${minCount}-${Math.min(maxCount, 10)}` // 限制最大显示笔数为10 } }, @@ -790,6 +819,7 @@ export default { max-width: 1200px; margin: 0 auto; padding: 20px; + background: linear-gradient(to bottom, #72c9ffae, #f3f3f3); } .header { @@ -841,6 +871,76 @@ export default { margin-bottom: 30px; } +.card-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; +} + +.toggle-container { + display: flex; + align-items: center; + gap: 8px; +} + +.toggle-label { + font-size: 12px; + color: #666; +} + +.apple-switch { + position: relative; + display: inline-block; + width: 34px; + height: 16px; +} + +.apple-switch input { + opacity: 0; + width: 0; + height: 0; +} + +.apple-switch-slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #e0e0e0; + transition: .4s; + border-radius: 16px; +} + +.apple-switch-slider:before { + position: absolute; + content: ""; + height: 12px; + width: 12px; + left: 2px; + bottom: 2px; + background-color: white; + transition: .4s; + border-radius: 50%; +} + +.apple-switch input:checked + .apple-switch-slider { + background-color: #4CD964; +} + +.apple-switch input:checked + .apple-switch-slider:before { + transform: translateX(18px); +} + +/* 移除原有的匹配类型选择器样式 */ +.matching-type-selector, +.type-tabs, +.type-tab { + display: none; +} + .create-order-card { background: white; padding: 20px; @@ -903,15 +1003,18 @@ export default { } .create-btn { - width: 100%; + width: 50%; padding: 12px; - background: #3498db; + background: #0099ff; color: white; border: none; - border-radius: 5px; + border-radius: 1000px; /* 保持胶囊形状 */ font-size: 16px; cursor: pointer; transition: background 0.3s; + display: block; /* 改为块级元素 */ + margin: 0 auto; /* 水平居中 */ + text-align: center; /* 文字居中 */ } .create-btn:hover { diff --git a/src/views/MyProfile.vue b/src/views/MyProfile.vue index 4f55825..cdee03f 100644 --- a/src/views/MyProfile.vue +++ b/src/views/MyProfile.vue @@ -65,13 +65,6 @@ 我的余额 ¥{{ accountInfo.balance }}
-
-
- - 匹配记录 - > - -
@@ -485,35 +478,24 @@ export default { } .balance-item { - flex: 1; display: flex; flex-direction: column; - align-items: center; - justify-content: center; - padding: 10px; -} - -.divider { - width: 1px; - height: 40px; - background-color: rgba(255, 255, 255, 0.3); + gap: 8px; } .balance-label { font-size: 14px; - color: rgba(255, 255, 255, 0.8); - margin-bottom: 5px; + color: rgba(255, 255, 255, 0.9); + letter-spacing: 0.5px; + font-weight: 400; } .balance-value { - font-size: 18px; - font-weight: bold; + font-size: 28px; + font-weight: 600; color: white; -} - -.balance-arrow { - font-size: 16px; - color: rgba(255, 255, 255, 0.8); + letter-spacing: 0.5px; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } /* 我的订单 */ diff --git a/src/views/Transfers.vue b/src/views/Transfers.vue index 6584b0e..8ff3187 100644 --- a/src/views/Transfers.vue +++ b/src/views/Transfers.vue @@ -10,22 +10,6 @@ - -
- - - -
-
@@ -140,12 +124,41 @@ @@ -235,206 +248,8 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 上传凭证 - -
- 转账凭证 -
-
-
- - -
- - - -
-
-

转账信息

-
- 转账金额: - ¥{{ currentTransfer.amount }} -
-
- 转账说明: - {{ currentTransfer.description }} -
-
- 转账时间: - {{ formatTime(currentTransfer.created_at) }} -
-
- 转账类型: - {{ getTransferTypeText(currentTransfer.transfer_type) }} -
-
- -
-

转账凭证

-
- - - -
-
- -
- -

暂无转账凭证

-
-
- - -
- - - - - - - - - - - - - - - - - + + @@ -465,7 +280,6 @@ const returnForm = reactive({ description: '' }) -const accountInfo = ref({}) const pendingTransfers = ref([]) const pendingAllocations = ref([]) const transferHistory = ref([]) @@ -477,17 +291,6 @@ const pagination = reactive({ total: 0 }) -const transferForm = reactive({ - to_user_id: '', - amount: '', - transfer_type: 'user_to_user', - description: '', - voucher: '' -}) - -const transferFormRef = ref() -const uploadRef = ref() - // 移动端检测和分页布局 const windowWidth = ref(window.innerWidth) @@ -514,23 +317,8 @@ const handleResize = () => { const uploadUrl = ref(uploadURL) const uploadHeaders = computed(() => getUploadConfig().headers) -// 表单验证规则 -const transferRules = { - to_user_id: [ - { required: true, message: '请选择收款用户', trigger: 'change' } - ], - amount: [ - { required: true, message: '请输入转账金额', trigger: 'blur' }, - { pattern: /^\d+(\.\d{1,2})?$/, message: '请输入有效的金额', trigger: 'blur' } - ], - transfer_type: [ - { required: true, message: '请选择转账类型', trigger: 'change' } - ] -} - // 生命周期 onMounted(() => { - loadAccountInfo() loadPendingTransfers() loadPendingAllocations() loadTransferHistory() @@ -552,17 +340,6 @@ watch(statusFilter, () => { }) // 方法 -const loadAccountInfo = async () => { - try { - const response = await api.get(`/transfers/account/${userStore.user.id}`) - if (response.data.success) { - accountInfo.value = response.data.data - } - } catch (error) { - console.error('加载账户信息失败:', error) - } -} - const loadPendingTransfers = async () => { try { const response = await api.get('/transfers/pending') @@ -1009,12 +786,25 @@ const confirmNotReceived = async (transferId) => { confirmLoading.value = false } } + +// 计算各个状态的数量 +const totalCount = computed(() => pagination.total) +const pendingCount = computed(() => { + return transferHistory.value.filter(t => t.status === 'pending').length +}) +const confirmedCount = computed(() => { + return transferHistory.value.filter(t => t.status === 'confirmed').length +}) +const rejectedCount = computed(() => { + return transferHistory.value.filter(t => t.status === 'rejected').length +}) + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index bf75d29..d4a540e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,11 +14,11 @@ export default defineConfig({ port: 5173, proxy: { '/api': { - target: 'http://114.55.111.44:3001', + target: 'http://114.55.111.44:3000', changeOrigin: true }, '/uploads': { - target: 'http://114.55.111.44:3001', + target: 'http://114.55.111.44:3000', changeOrigin: true } }