From 084084c008a08dc1d2dad964ca0c20ed560c46af Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 13 Jan 2026 17:19:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E7=AD=BElogo?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9B=B4=E6=8D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/online-shop/index.vue | 7 +- .../tool/Instead/components/choose-user.vue | 4 +- src/views/tool/Instead/components/order.vue | 78 ++++++++++++------- src/views/user/list/config/content.ts | 2 +- 4 files changed, 57 insertions(+), 34 deletions(-) diff --git a/src/views/online-shop/index.vue b/src/views/online-shop/index.vue index dd790dd..76e6694 100644 --- a/src/views/online-shop/index.vue +++ b/src/views/online-shop/index.vue @@ -233,7 +233,7 @@ import shopExtendApi from "@/api/account/shopExtend"; export default { data() { return { - tableActive: "", + tableActive: "ticket_logo", tableData: [], selectItem: {}, imageUrl: "", @@ -248,7 +248,10 @@ export default { methods: { // 刷新列表数据 async doSubmit() { - this.selectItem.value = JSON.stringify(this.imgList) + // console.log('this.selectItem.value', this.selectItem.value); + // return + + // this.selectItem.value = JSON.stringify(this.imgList) await shopExtendApi.edit({ ...this.selectItem, autokey: this.selectItem.autoKey, diff --git a/src/views/tool/Instead/components/choose-user.vue b/src/views/tool/Instead/components/choose-user.vue index 76dbd0c..63107d9 100644 --- a/src/views/tool/Instead/components/choose-user.vue +++ b/src/views/tool/Instead/components/choose-user.vue @@ -47,9 +47,9 @@ {{ multiplyAndFormat(scope.row.amount || 0) }} - + diff --git a/src/views/tool/Instead/components/order.vue b/src/views/tool/Instead/components/order.vue index 8aca734..3c1ec4b 100644 --- a/src/views/tool/Instead/components/order.vue +++ b/src/views/tool/Instead/components/order.vue @@ -439,11 +439,17 @@ async function pointsInit() { // 保险取值 const eq = pointsConfig?.equivalentPoints || 0; - const maxRatio = pointsConfig?.maxDeductionRatio || 0; + const rawMaxRatio = pointsConfig?.maxDeductionRatio || 0; + // 兼容后端返回的百分比或小数两种形式:如果大于1,则视为百分比(如100表示100%),需除以100 + const maxRatio = rawMaxRatio > 1 ? rawMaxRatio / 100 : rawMaxRatio; const minPay = pointsConfig?.minPaymentAmount || 0; // 计算当前订单可抵扣金额上限(元) + // 使用“抵扣前实付金额”作为门槛判断(即把当前已应用的积分抵扣金额加回), + // 避免在已经抵扣导致 finalPay 变小后错误地判定为不可用。 let finalPay = Number(carts.orderCostSummary.finalPayAmount) || 0; + const currentPointDeduction = Number(carts.orderCostSummary.pointDeductionAmount) || 0; + const basePay = finalPay + currentPointDeduction; const res = { usable: true, @@ -455,8 +461,9 @@ async function pointsInit() { unusableReason: "", }; - // 如果订单实付低于最小使用门槛,则不可用 - if (finalPay <= 0 || (minPay > 0 && finalPay < minPay)) { + // 如果订单实付低于最小使用门槛,则不可用(门槛仅作为启用条件) + // 这里使用 basePay(抵扣前实付)进行判断,确保已填写积分后不会回退为不可用 + if (basePay <= 0 || (minPay > 0 && basePay < minPay)) { res.usable = false; res.unusableReason = `订单实付金额低于 ${minPay} 元,无法使用积分抵扣`; } else if (eq <= 0) { @@ -464,23 +471,22 @@ async function pointsInit() { res.unusableReason = `积分换算比例配置错误,无法使用积分抵扣`; } else { // 计算基于比例限制的最大抵扣金额(元) - let maxByRatio = finalPay * maxRatio; - // 保证抵扣后剩余金额 >= minPaymentAmount - if (minPay > 0) { - const allowed = finalPay - minPay; - if (allowed <= 0) { - res.usable = false; - res.unusableReason = `抵扣后实付金额必须大于等于 ${minPay} 元,当前不可使用积分`; - } else { - maxByRatio = Math.min(maxByRatio, allowed); - } - } + // 注意:此处不再减少 minPaymentAmount,minPaymentAmount 仅用作是否可用的门槛; + // 真正的最大抵扣由 maxRatio(抵扣比例)与用户积分数量共同决定。 + // 计算基于比例限制的最大抵扣金额(元),基于抵扣前实付金额 + let maxByRatio = basePay * maxRatio; if (res.usable) { - // 可用积分上限(向下取整为 eq 的倍数) + // 可用积分上限(按等价积分步长对齐到 eq 的倍数) const maxByMoney = Math.floor(maxByRatio * eq); const userPoints = carts.vipUser.pointBalance || 0; - res.maxUsablePoints = Math.min(userPoints, maxByMoney); + let computedMax = Math.min(userPoints, maxByMoney); + // 对齐到等价积分步长,保证输入步长生效 + if (eq > 0) { + computedMax = Math.floor(computedMax / eq) * eq; + } + res.maxUsablePoints = computedMax; + console.debug("pointsInit debug:", { finalPay: finalPay, basePay: basePay, eq, rawMaxRatio, maxRatio, maxByMoney, userPoints, computedMax }); // 最小抵扣积分为配置值或等于换算比 res.minDeductionPoints = pointsConfig?.minDeductionPoints || eq; if (res.maxUsablePoints < res.minDeductionPoints) { @@ -498,8 +504,20 @@ async function pointsInit() { return res; } - // 如果可用则默认填充可用最大值,否则清零 - usePointsNumber.value = res.usable ? res.maxUsablePoints : 0; + // 如果可用则默认填充可用最大值(对齐步长),否则清零 + if (res.usable) { + // 计算默认填充值:基于抵扣前实付的比例上限与等价比计算需要的积分数 + const defaultMaxByMoney = Math.floor(basePay * res.maxDeductionRatio * res.equivalentPoints); + let defaultPts = Math.min(res.maxUsablePoints || 0, defaultMaxByMoney || 0); + if (res.equivalentPoints > 0) { + defaultPts = Math.floor(defaultPts / res.equivalentPoints) * res.equivalentPoints; + } + // 最终确保不超过用户积分 + const userPts = carts.vipUser.pointBalance || 0; + usePointsNumber.value = Math.min(defaultPts, userPts); + } else { + usePointsNumber.value = 0; + } if (!res.usable) score.sel = -1; return res; @@ -532,17 +550,15 @@ function pointsToMoney(val) { // 再次校验不超过允许的最大抵扣金额(基于比例或门槛) let finalPay = Number(carts.orderCostSummary.finalPayAmount) || 0; let maxByRatio = finalPay * cfg.maxDeductionRatio; - if (cfg.minPaymentAmount > 0) { - const allowed = finalPay - cfg.minPaymentAmount; - if (allowed <= 0) { - usePointsNumber.value = 0; - carts.orderCostSummary.pointUsed = 0; - carts.orderCostSummary.pointDeductionAmount = 0; - return; - } - maxByRatio = Math.min(maxByRatio, allowed); + // 对于单笔抵扣:若订单实付低于配置的最小门槛,则不可使用(作为启用条件) + if (cfg.minPaymentAmount > 0 && finalPay < cfg.minPaymentAmount) { + usePointsNumber.value = 0; + carts.orderCostSummary.pointUsed = 0; + carts.orderCostSummary.pointDeductionAmount = 0; + return; } const maxAllowedMoney = new BigNumber(maxByRatio).decimalPlaces(2, BigNumber.ROUND_DOWN).toNumber(); + console.debug("pointsToMoney debug:", { finalPay, cfg, pts, money, maxByRatio, maxAllowedMoney }); if (money > maxAllowedMoney) { // 调整积分到允许的最大金额对应的积分 const allowedPts = Math.floor(maxAllowedMoney * cfg.equivalentPoints); @@ -858,9 +874,13 @@ defineExpose({ .order-info { font-size: 14px; - .title {} + .title { + display: inline-block; + } - .value {} + .value { + display: inline-block; + } .price { color: #fa5555; diff --git a/src/views/user/list/config/content.ts b/src/views/user/list/config/content.ts index 51d360e..f739756 100644 --- a/src/views/user/list/config/content.ts +++ b/src/views/user/list/config/content.ts @@ -82,7 +82,7 @@ const contentConfig: IContentConfig = { { label: "消费次数累计", align: "center", - prop: "consumeAmount", + prop: "consumeCount", }, { label: "注册时间", From 3b19d58f2794d97ebda563ac886a6a856029ed31 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Wed, 14 Jan 2026 15:31:48 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=B0=86=E8=BF=9B=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E5=9C=A8=E5=BA=97=E9=93=BA=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shop/list/components/detailModal.vue | 82 ++++--- .../shop/list/components/payStatusCard.vue | 208 ++++++++++++++++++ src/views/shop/list/index.vue | 19 +- src/views/shop/list/pay_setting.vue | 127 +++++++++++ 4 files changed, 389 insertions(+), 47 deletions(-) create mode 100644 src/views/shop/list/components/payStatusCard.vue create mode 100644 src/views/shop/list/pay_setting.vue diff --git a/src/views/shop/list/components/detailModal.vue b/src/views/shop/list/components/detailModal.vue index da4a678..751a277 100644 --- a/src/views/shop/list/components/detailModal.vue +++ b/src/views/shop/list/components/detailModal.vue @@ -1,56 +1,52 @@ @@ -132,7 +133,7 @@ layout="total, sizes , prev, pager ,next, jumper " @current-change="paginationChange" /> - + @@ -145,6 +146,10 @@ import ShopApi from "@/api/account/shop"; import { ElNotification, ElMessageBox } from "element-plus"; import addShop from "./components/addShop.vue"; import detailModal from "./components/detailModal.vue"; +import { useRouter } from "vue-router"; + +const router = useRouter() + const refActivateCode = ref(null); function activateCodeShow(row) { refActivateCode.value.open(row); @@ -186,12 +191,18 @@ function dropdownClick(e, row) { console.log(e); console.log(row); if (e == 0) { - refAddShop.value.show({mainId:row.id,shopType:row.shopType,isHeadShop:0},'addBranch'); + refAddShop.value.show({ mainId: row.id, shopType: row.shopType, isHeadShop: 0 }, 'addBranch'); return; } if (e.command == 1) { - refDetailModal.value.show(e.row); + // refDetailModal.value.show(e.row); + router.push({ + name: 'pay_setting', + query: { + shopId: row.id + } + }) return; } if (e == 5) { diff --git a/src/views/shop/list/pay_setting.vue b/src/views/shop/list/pay_setting.vue new file mode 100644 index 0000000..1533d0a --- /dev/null +++ b/src/views/shop/list/pay_setting.vue @@ -0,0 +1,127 @@ + + + + + + \ No newline at end of file From ed8be8a16ab69f99d16a06d2aeff94ec5673e498 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Thu, 15 Jan 2026 13:54:19 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E7=89=88?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E7=AE=A1=E7=90=86=E4=B8=89=E6=96=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account/shopMerchant.ts | 7 +- src/api/common/index.ts | 41 ++- src/api/coup/group.js | 6 +- .../shop/list/components/detailModal.vue | 233 +++++++----------- .../shop/list/components/payStatusCard.vue | 94 ++++++- src/views/shop/list/index.vue | 8 +- src/views/shop/list/pay_setting.vue | 56 +++-- 7 files changed, 271 insertions(+), 174 deletions(-) diff --git a/src/api/account/shopMerchant.ts b/src/api/account/shopMerchant.ts index 561e836..b2739c0 100644 --- a/src/api/account/shopMerchant.ts +++ b/src/api/account/shopMerchant.ts @@ -1,10 +1,11 @@ import request from "@/utils/request"; -import { Account_BaseUrl } from "@/api/config"; +import { Account_BaseUrl, Order_BaseUrl } from "@/api/config"; const baseURL = Account_BaseUrl + "/admin/shopMerchant"; +const orderURL = Order_BaseUrl + "/admin/shopMerchant"; const API = { get(shopId: string | number) { return request({ - url: `${baseURL}`, + url: `${orderURL}`, method: "get", params: { shopId: shopId @@ -14,7 +15,7 @@ const API = { edit(shopId: string | number, data: shopMerchantType) { delete data.id return request({ - url: `${baseURL}`, + url: `${orderURL}`, method: "put", data: { ...data, shopId }, }); diff --git a/src/api/common/index.ts b/src/api/common/index.ts index 57055a4..eeac0be 100644 --- a/src/api/common/index.ts +++ b/src/api/common/index.ts @@ -124,4 +124,43 @@ export const queryEntry = (params: Object) => { method: "get", params }); -} \ No newline at end of file +} + +/** + * 商户支付信息获取 + * @data { params } + * @returns + */ +export const shopMerchantGet = (params: Object) => { + return request({ + url: `/order/admin/shopMerchant`, + method: "get", + params + }); +} + +/** + * 商户支付信息修改 修改聚合支付信息 + * @data { params } + * @returns + */ +export const shopMerchantPut = (data: Object) => { + return request({ + url: `/order/admin/shopMerchant`, + method: "put", + data + }); +} + +/** + * 获取当前店铺的主店进件信息 + * @data { params } + * @returns + */ +export const getMainMerchant = (params: Object) => { + return request({ + url: `/order/admin/shopMerchant/getMainMerchant`, + method: "get", + params + }); +} diff --git a/src/api/coup/group.js b/src/api/coup/group.js index 4fccbd6..e843ced 100644 --- a/src/api/coup/group.js +++ b/src/api/coup/group.js @@ -10,7 +10,7 @@ export function searchstorestatus(type) { return request_php({ method: "post", headers: { - clint_type: type + 'ClintType': type }, url: "/meituan/searchstorestatus" }); @@ -79,7 +79,7 @@ export function getuisdk(data) { return request_php({ method: "post", headers: { - clint_type: 2 + 'ClintType': 2 }, url: "/douyin/getuisdk", data, @@ -214,7 +214,7 @@ export function thirdPartyCoupon_bindUrl(data) { return request_php({ method: "post", headers: { - clint_type: 1 + 'ClintType': 1 }, url: "/meituan/getuisdkurl", data, diff --git a/src/views/shop/list/components/detailModal.vue b/src/views/shop/list/components/detailModal.vue index 751a277..ab2d074 100644 --- a/src/views/shop/list/components/detailModal.vue +++ b/src/views/shop/list/components/detailModal.vue @@ -1,152 +1,105 @@ - + \ No newline at end of file diff --git a/src/views/shop/list/components/payStatusCard.vue b/src/views/shop/list/components/payStatusCard.vue index f7fe363..297022f 100644 --- a/src/views/shop/list/components/payStatusCard.vue +++ b/src/views/shop/list/components/payStatusCard.vue @@ -10,6 +10,9 @@ + + + 是否复用主店? + + From 042dacec9897778cd639564bce276010dcc22715 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Fri, 16 Jan 2026 09:36:56 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2=E9=A1=B5=E9=9D=A2=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/shop/list/components/detailModal.vue | 13 +++++++++---- src/views/shop/list/components/payStatusCard.vue | 4 ++-- src/views/shop/list/index.vue | 5 +++-- src/views/shop/list/pay_setting.vue | 4 ++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/views/shop/list/components/detailModal.vue b/src/views/shop/list/components/detailModal.vue index ab2d074..92bc3f2 100644 --- a/src/views/shop/list/components/detailModal.vue +++ b/src/views/shop/list/components/detailModal.vue @@ -2,16 +2,17 @@
- + - + - + - + 保存 @@ -25,6 +26,10 @@ import { ref } from 'vue' import { useRoute } from 'vue-router' import { shopMerchantPut } from '@/api/common' +const inputStyle = { + width: '500px' +} + const props = defineProps({ detail: { type: Object, diff --git a/src/views/shop/list/components/payStatusCard.vue b/src/views/shop/list/components/payStatusCard.vue index 297022f..a98c93c 100644 --- a/src/views/shop/list/components/payStatusCard.vue +++ b/src/views/shop/list/components/payStatusCard.vue @@ -10,8 +10,8 @@