From f03d8fdbb4c9bf54e3fae7121246446c98ffa445 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 19 Nov 2025 18:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=88=86=E9=94=80=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=88=86?= =?UTF-8?q?=E9=94=80=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/date-range-picker/README.md | 52 ++ .../date-range-picker/date-range-picker.vue | 342 ++++++++++++ http/api/market/distribution.js | 139 +++++ pageMarket/components/modal.vue | 84 +++ pageMarket/distribution/components/config.vue | 458 ++++++++-------- .../components/fenxiao-user-list.vue | 268 ++++++++++ pageMarket/distribution/index.vue | 497 +++++++++++------- pageMarket/distribution/level-list.vue | 292 ++++++++++ pages.json | 7 + store/market.js | 53 ++ 10 files changed, 1784 insertions(+), 408 deletions(-) create mode 100644 components/date-range-picker/README.md create mode 100644 components/date-range-picker/date-range-picker.vue create mode 100644 http/api/market/distribution.js create mode 100644 pageMarket/components/modal.vue create mode 100644 pageMarket/distribution/components/fenxiao-user-list.vue create mode 100644 pageMarket/distribution/level-list.vue create mode 100644 store/market.js diff --git a/components/date-range-picker/README.md b/components/date-range-picker/README.md new file mode 100644 index 0000000..4b9f5ec --- /dev/null +++ b/components/date-range-picker/README.md @@ -0,0 +1,52 @@ +#时间范围选择器 +#### 参数文档 + +| 参数 | 说明 | 类型 | 默认值 | 其他 | +| :---- | :---- | :---- | :---- | :---- | +| show | 显示选择器 | Boolean | false | - | +| defaultDate | 默认日期 | String | - | 不传则默认今天 | +| minYear | 最小年份 | Number | 1990 | - | +| themeColor | 主题色 | String | #43b983 | - | +| startText | 开始时间文字 | String | 开始时间 | - | +| endText | 结束时间文字 | String | 结束时间 | - | + +#### case +```vue + + + + +``` diff --git a/components/date-range-picker/date-range-picker.vue b/components/date-range-picker/date-range-picker.vue new file mode 100644 index 0000000..b686d19 --- /dev/null +++ b/components/date-range-picker/date-range-picker.vue @@ -0,0 +1,342 @@ + + + + \ No newline at end of file diff --git a/http/api/market/distribution.js b/http/api/market/distribution.js new file mode 100644 index 0000000..b877061 --- /dev/null +++ b/http/api/market/distribution.js @@ -0,0 +1,139 @@ +import http from '@/http/http.js' +const request = http.request +const urlType='market' + +export function getConfig(data) { + return request({ + url: `${urlType}/admin/distribution`, + method: "GET", + data: { + ...data + } + }) +} + + +export function editConfig(data) { + return request({ + url: `${urlType}/admin/distribution`, + method: "PUT", + data: { + ...data + } + }) +} + +export function moneyRecoders(data) { + return request({ + url: `${urlType}/admin/distribution/flow`, + method: "GET", + data: { + ...data + } + }) +} +export function cashPay(data) { + return request({ + url: `${urlType}/admin/distribution/cashPay`, + method: "POST", + data: { + ...data + } + }) +} +export function openFlow(data) { + return request({ + url: `${urlType}/admin/distribution/openFlow`, + method: "GET", + data: { + ...data + } + }) +} +export function distributionFlow(data) { + return request({ + url: `${urlType}/admin/distribution/distributionFlow`, + method: "GET", + data: { + ...data + } + }) +} +export function rechargeQrCode(data) { + return request({ + url: `${urlType}/admin/distribution/rechargeQrCode`, + method: "GET", + data: { + ...data + } + }) +} +export function withdrawFlow(data) { + return request({ + url: `${urlType}/admin/distribution/withdrawFlow`, + method: "GET", + data: { + ...data + } + }) +} + +export function distributionUser(data) { + return request({ + url: `${urlType}/admin/distribution/user`, + method: "GET", + data: { + ...data + } + }) +} + +export function addDistributionUser(data) { + return request({ + url: `${urlType}/admin/distribution/user`, + method: "POST", + data: { + ...data + } + }) +} + +export function editDistributionUser(data) { + return request({ + url: `${urlType}/admin/distribution/user`, + method: "PUT", + data: { + ...data + } + }) +} + +export function deleteDistributionUser(data) { + return request({ + url: `${urlType}/admin/distribution/user`, + method: "DELETE", + data: { + ...data + } + }) +} + +export function inviteUser(data) { + return request({ + url: `${urlType}/admin/distribution/user/inviteUser`, + method: "GET", + data: { + ...data + } + }) +} + +export function resetLevel(data) { + return request({ + url: `${urlType}/admin/distribution/user/resetLevel`, + method: "POST", + data: { + ...data + } + }) +} diff --git a/pageMarket/components/modal.vue b/pageMarket/components/modal.vue new file mode 100644 index 0000000..d8f4fc3 --- /dev/null +++ b/pageMarket/components/modal.vue @@ -0,0 +1,84 @@ + + + + \ No newline at end of file diff --git a/pageMarket/distribution/components/config.vue b/pageMarket/distribution/components/config.vue index c857bb5..1cde388 100644 --- a/pageMarket/distribution/components/config.vue +++ b/pageMarket/distribution/components/config.vue @@ -1,93 +1,175 @@ - - - - \ No newline at end of file +$height: 70rpx; +.number-box { + font-size: 28rpx; + padding: 0 26rpx; + border-radius: 6rpx 0 0 6rpx; + border-top: 2rpx solid #d9d9d9; + border-bottom: 2rpx solid #d9d9d9; + border-left: 2rpx solid #d9d9d9; + background: #fff; + box-sizing: border-box; + height: $height; + flex: 1; + line-height: $height; +} +.unit { + display: flex; + padding: 0 38rpx; + height: $height; + line-height: $height; + align-items: center; + border-radius: 0 6rpx 6rpx 0; + border: 2rpx solid #d9d9d9; + background: #f7f7fa; + font-size: 28rpx; + color: #999999; +} + diff --git a/pageMarket/distribution/components/fenxiao-user-list.vue b/pageMarket/distribution/components/fenxiao-user-list.vue new file mode 100644 index 0000000..96c9283 --- /dev/null +++ b/pageMarket/distribution/components/fenxiao-user-list.vue @@ -0,0 +1,268 @@ + + + diff --git a/pageMarket/distribution/index.vue b/pageMarket/distribution/index.vue index 83e0124..6de5d9f 100644 --- a/pageMarket/distribution/index.vue +++ b/pageMarket/distribution/index.vue @@ -1,221 +1,324 @@ \ No newline at end of file +.delete-btn { + background: #ffe7e6; + color: #ff1c1c; +} +.filter-box { + display: flex; + padding: 8rpx 24rpx; + align-items: center; + border-radius: 8rpx; + border: 2rpx solid #d9d9d9; + background: #f7f7f7; + min-height: 62rpx; + box-sizing: border-box; +} + diff --git a/pageMarket/distribution/level-list.vue b/pageMarket/distribution/level-list.vue new file mode 100644 index 0000000..045d9c8 --- /dev/null +++ b/pageMarket/distribution/level-list.vue @@ -0,0 +1,292 @@ + + + diff --git a/pages.json b/pages.json index 7854b9b..f361f21 100644 --- a/pages.json +++ b/pages.json @@ -644,6 +644,13 @@ "style": { "navigationBarTitleText": "添加限时折扣" } + }, + { + "pageId": "PAGES_DISTRIBUTION_LEVEL_LIST", + "path": "distribution/level-list", + "style": { + "navigationBarTitleText": "分销员等级" + } } ] }, diff --git a/store/market.js b/store/market.js new file mode 100644 index 0000000..9a8a526 --- /dev/null +++ b/store/market.js @@ -0,0 +1,53 @@ +// stores/counter.js +import { defineStore } from "pinia"; +import * as distributionApi from "@/http/api/market/distribution.js"; + +export const upgradeTypes = [ + { + value: "not_upgrade", + label: "不自动升级", + }, + { + value: "invite", + label: "邀请有效人数", + }, + { + value: "cost", + label: "消费金额(不含退款)", + }, +]; +// 分销 +export const useDistributionStore = defineStore("distribution", { + state: () => { + return { + //分销配置 + config: { + isEnable: 0, + openType: "pay", + inviteCount: 1, + inviteConsume: 0, + payAmount: 0, + rewardCount: 1, + settlementDay: 1, + upgradeType: "auto", + notActivatedPage: null, + levelConfigList: [], + }, + //升级条件 + upgradeTypes, + }; + }, + actions: { + async getConfig() { + const data = await distributionApi.getConfig(); + this.config = data; + return this.config; + }, + async editConfig(data) { + const res = await distributionApi.editConfig({ ...this.config, ...data }); + this.getConfig(); + return res; + }, + }, + unistorage: true, // 开启后对 state 的数据读写都将持久化 +});