|
|
@@ -80,6 +80,34 @@ Mock.mock(/\/api\/page-config\/home/, 'put', (options) => {
|
|
|
// 页面管理 - 权益首页配置
|
|
|
// =============================================
|
|
|
const zoneConfigData = {
|
|
|
+ identityModule: {
|
|
|
+ advance: {
|
|
|
+ bgImage: 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?w=800',
|
|
|
+ identityText: '汇丰运筹理财',
|
|
|
+ showQualifyStatus: false,
|
|
|
+ showAvgBalance: true,
|
|
|
+ avgBalanceRule: '月内日均余额 = 当月内每日账户余额之和 / 当月天数。'
|
|
|
+ },
|
|
|
+ premier: {
|
|
|
+ bgImage: 'https://images.unsplash.com/photo-1583847268964-b28dc8f51f92?w=800',
|
|
|
+ identityText: '汇丰卓越理财',
|
|
|
+ showQualifyStatus: true,
|
|
|
+ showAvgBalance: true,
|
|
|
+ avgBalanceRule: '计算规则:截止到昨日的账户月内日均余额。'
|
|
|
+ },
|
|
|
+ premierElite: {
|
|
|
+ bgImage: 'https://images.unsplash.com/photo-1557682250-33bd709cbe85?w=800',
|
|
|
+ identityText: '汇丰卓越理财·尊尚',
|
|
|
+ showQualifyStatus: true,
|
|
|
+ showAvgBalance: true,
|
|
|
+ avgBalanceRule: '计算规则:截止到昨日的账户月内日均余额。支持查看合格状态及复制编号。'
|
|
|
+ },
|
|
|
+ privateBank: {
|
|
|
+ bgImage: 'https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800',
|
|
|
+ identityText: '汇丰环球私人银行',
|
|
|
+ showPbLevel: true
|
|
|
+ }
|
|
|
+ },
|
|
|
adCarousel: [{
|
|
|
imageUrl: 'https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?w=800',
|
|
|
linkH5: '', linkApp: '', wechatAppId: '', wechatPath: '',
|
|
|
@@ -937,4 +965,124 @@ Mock.mock(/\/api\/audit\/reject/, 'post', (options) => {
|
|
|
return { code: 200, data: null, msg: '已驳回' }
|
|
|
})
|
|
|
|
|
|
+// =============================================
|
|
|
+// 发放计划
|
|
|
+// =============================================
|
|
|
+const equityGrantCampaignList = [
|
|
|
+ {
|
|
|
+ id: 'GC202604010001',
|
|
|
+ name: '春季会员尊享礼遇',
|
|
|
+ startTime: '2026-04-01 00:00:00',
|
|
|
+ endTime: '2026-06-30 23:59:59',
|
|
|
+ crowdList: ['A0000120251224'],
|
|
|
+ equityList: ['100001', '100003'],
|
|
|
+ grantCycle: 'monthly',
|
|
|
+ grantQuantity: 2,
|
|
|
+ validity: { type: 'fixed', fixedRange: ['2026-04-01', '2026-06-30'], relativeDays: 30 },
|
|
|
+ createTime: '2026-03-25 10:20:30',
|
|
|
+ updateTime: '2026-03-25 10:20:30'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'GC202605010001',
|
|
|
+ name: '夏日畅享权益月',
|
|
|
+ startTime: '2026-05-01 00:00:00',
|
|
|
+ endTime: '2026-08-31 23:59:59',
|
|
|
+ crowdList: [],
|
|
|
+ equityList: ['100001', '100004', '100005'],
|
|
|
+ grantCycle: 'total',
|
|
|
+ grantQuantity: 1,
|
|
|
+ validity: { type: 'relative', fixedRange: [], relativeDays: 30 },
|
|
|
+ createTime: '2026-04-20 14:10:00',
|
|
|
+ updateTime: '2026-04-20 14:10:00'
|
|
|
+ }
|
|
|
+]
|
|
|
+let equityGrantCampaignCounter = equityGrantCampaignList.length
|
|
|
+
|
|
|
+function nextGrantCampaignId() {
|
|
|
+ equityGrantCampaignCounter += 1
|
|
|
+ const d = new Date()
|
|
|
+ const ymd = d.getFullYear().toString() + String(d.getMonth() + 1).padStart(2, '0') + String(d.getDate()).padStart(2, '0')
|
|
|
+ return 'GC' + ymd + String(equityGrantCampaignCounter).padStart(4, '0')
|
|
|
+}
|
|
|
+
|
|
|
+Mock.mock(/\/api\/equity-grant-campaign\/list/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const name = url.searchParams.get('name') || ''
|
|
|
+ const startDate = url.searchParams.get('startDate') || ''
|
|
|
+ const endDate = url.searchParams.get('endDate') || ''
|
|
|
+ let filtered = equityGrantCampaignList
|
|
|
+ if (name) filtered = filtered.filter(c => c.name.includes(name))
|
|
|
+ if (startDate) filtered = filtered.filter(c => c.endTime.slice(0, 10) >= startDate)
|
|
|
+ if (endDate) filtered = filtered.filter(c => c.startTime.slice(0, 10) <= endDate)
|
|
|
+ return { code: 200, data: filtered, msg: 'ok' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/equity-grant-campaign\/save/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const now = nowStr()
|
|
|
+ const defaultValidity = { type: 'fixed', fixedRange: [], relativeDays: 30 }
|
|
|
+ if (body.id) {
|
|
|
+ const idx = equityGrantCampaignList.findIndex(c => c.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '发放计划不存在' }
|
|
|
+ equityGrantCampaignList[idx] = {
|
|
|
+ ...equityGrantCampaignList[idx],
|
|
|
+ name: body.name,
|
|
|
+ startTime: body.startTime,
|
|
|
+ endTime: body.endTime,
|
|
|
+ crowdList: body.crowdList || [],
|
|
|
+ equityList: body.equityList || [],
|
|
|
+ grantCycle: body.grantCycle || 'total',
|
|
|
+ grantQuantity: body.grantQuantity || 1,
|
|
|
+ validity: body.validity || defaultValidity,
|
|
|
+ updateTime: now
|
|
|
+ }
|
|
|
+ return { code: 200, data: { id: body.id }, msg: '保存成功' }
|
|
|
+ }
|
|
|
+ const newId = nextGrantCampaignId()
|
|
|
+ equityGrantCampaignList.unshift({
|
|
|
+ id: newId,
|
|
|
+ name: body.name,
|
|
|
+ startTime: body.startTime,
|
|
|
+ endTime: body.endTime,
|
|
|
+ crowdList: body.crowdList || [],
|
|
|
+ equityList: body.equityList || [],
|
|
|
+ grantCycle: body.grantCycle || 'total',
|
|
|
+ grantQuantity: body.grantQuantity || 1,
|
|
|
+ validity: body.validity || defaultValidity,
|
|
|
+ createTime: now,
|
|
|
+ updateTime: now
|
|
|
+ })
|
|
|
+ return { code: 200, data: { id: newId }, msg: '新建成功' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/equity-grant-campaign\/delete/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = equityGrantCampaignList.findIndex(c => c.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '发放计划不存在' }
|
|
|
+ equityGrantCampaignList.splice(idx, 1)
|
|
|
+ return { code: 200, data: null, msg: '删除成功' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/equity-grant-campaign\/detail/, 'get', (options) => {
|
|
|
+ const url = new URL(options.url, 'http://localhost')
|
|
|
+ const id = url.searchParams.get('id')
|
|
|
+ const item = equityGrantCampaignList.find(c => c.id === id)
|
|
|
+ return item
|
|
|
+ ? { code: 200, data: item, msg: 'ok' }
|
|
|
+ : { code: 404, data: null, msg: '发放计划不存在' }
|
|
|
+})
|
|
|
+
|
|
|
+Mock.mock(/\/api\/equity-grant-campaign\/end/, 'post', (options) => {
|
|
|
+ const body = JSON.parse(options.body)
|
|
|
+ const idx = equityGrantCampaignList.findIndex(c => c.id === body.id)
|
|
|
+ if (idx < 0) return { code: 404, data: null, msg: '发放计划不存在' }
|
|
|
+ const now = nowStr()
|
|
|
+ equityGrantCampaignList[idx] = {
|
|
|
+ ...equityGrantCampaignList[idx],
|
|
|
+ endTime: now,
|
|
|
+ updateTime: now
|
|
|
+ }
|
|
|
+ return { code: 200, data: null, msg: '已结束' }
|
|
|
+})
|
|
|
+
|
|
|
export default Mock
|