From 26532150b50f5ed917718c324b2345dabe038739 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 24 Oct 2025 16:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=99=90=E6=97=B6=E6=8A=98?= =?UTF-8?q?=E6=89=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/market/exchange.js | 18 + common/api/market/limitTimeDiscount.js | 11 + common/api/market/suggest.js | 11 + components/birthday-modal.vue | 2 +- components/goods-price.vue | 56 + components/modal-list.vue | 1 - components/official-account.vue | 5 +- components/order-finish-modal.vue | 7 - components/paymentMethod.vue | 2 - components/wechat-ac-qrcode.vue | 3 +- distribution/index.vue | 39 + distribution/static/top_bg.png | Bin 0 -> 79628 bytes pages.json | 76 +- pages/order/components/order-item.vue | 999 +++++----- pages/order/components/orderInfo.vue | 145 +- pages/order/confirm-order.vue | 51 +- pages/order/coupon.vue | 11 +- .../components/recommend-goods-modal.vue | 196 ++ pages/product/components/shoppingCartes.vue | 1691 +++++++++-------- pages/product/index.vue | 247 ++- pages/user/coupon.vue | 9 +- pages/user/member/billDetails.vue | 4 +- pages/user/member/czzx.vue | 16 +- pages/user/user.vue | 11 +- static/icon/newUserDiscount.png | Bin 0 -> 502 bytes stores/carts.js | 31 +- stores/pay.js | 2 + .../wmf-code/components/w-qrcode/w-qrcode.vue | 8 +- user/exchange/components/confirm.vue | 17 +- user/exchange/index.vue | 69 +- user/vip/vip.vue | 4 +- utils/goods copy.ts | 1507 +++++++++++++++ utils/goods-utils - 副本.js | 820 ++++---- utils/goods-utils.js | 323 +++- utils/goods.ts | 330 +++- utils/order-utils.js | 152 ++ 36 files changed, 4989 insertions(+), 1885 deletions(-) create mode 100644 common/api/market/exchange.js create mode 100644 common/api/market/limitTimeDiscount.js create mode 100644 common/api/market/suggest.js create mode 100644 components/goods-price.vue create mode 100644 distribution/index.vue create mode 100644 distribution/static/top_bg.png create mode 100644 pages/product/components/recommend-goods-modal.vue create mode 100644 static/icon/newUserDiscount.png create mode 100644 utils/goods copy.ts create mode 100644 utils/order-utils.js diff --git a/common/api/market/exchange.js b/common/api/market/exchange.js new file mode 100644 index 0000000..5ec7b26 --- /dev/null +++ b/common/api/market/exchange.js @@ -0,0 +1,18 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +import {prveUrl} from './config.js' + +export const exchange = (data) => { + return request({ + url: prveUrl + '/user/redemption/exchange', + method: 'post', + data: data + }) +} +export const redemption = (data) => { + return request({ + url: prveUrl + '/user/redemption', + method: 'get', + data: data + }) +} diff --git a/common/api/market/limitTimeDiscount.js b/common/api/market/limitTimeDiscount.js new file mode 100644 index 0000000..9d861d0 --- /dev/null +++ b/common/api/market/limitTimeDiscount.js @@ -0,0 +1,11 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +import {prveUrl} from './config.js' + +export const getConfig = (data) => { + return request({ + url: prveUrl + '/user/limitTimeDiscount', + method: 'get', + data: data + }) +} diff --git a/common/api/market/suggest.js b/common/api/market/suggest.js new file mode 100644 index 0000000..a478c40 --- /dev/null +++ b/common/api/market/suggest.js @@ -0,0 +1,11 @@ +// 引入 request 文件 +import request from '@/common/api/request.js' +import {prveUrl} from './config.js' + +export const getGoods = (data) => { + return request({ + url: prveUrl + '/user/suggest', + method: 'get', + data: data + }) +} diff --git a/components/birthday-modal.vue b/components/birthday-modal.vue index bd0ff83..0d8d86b 100644 --- a/components/birthday-modal.vue +++ b/components/birthday-modal.vue @@ -260,7 +260,7 @@ const getCouponPopupAjax = async () => { try { const shopId = uni.cache.get("shopId"); const res = await birthdayGiftApi.config({ shopId }); - if (res.length) { + if (res&&res.length) { // 处理有效期格式(固定有效期规则) allCoupons.value = res.map((item) => { if (item.validType === "fixed") { diff --git a/components/goods-price.vue b/components/goods-price.vue new file mode 100644 index 0000000..407c91f --- /dev/null +++ b/components/goods-price.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/components/modal-list.vue b/components/modal-list.vue index c3e637e..49d1714 100644 --- a/components/modal-list.vue +++ b/components/modal-list.vue @@ -51,7 +51,6 @@ const wechatAcQrcode = ref(""); const userinfo = uni.cache.get("userInfo") || {}; const codeVal = ref(userinfo.wechatAcQrcode || ""); function qrcodeResult(e) { - console.log("qrcodeResult", e); wechatAcQrcode.value = e; } diff --git a/components/official-account.vue b/components/official-account.vue index d757766..7ac27ba 100644 --- a/components/official-account.vue +++ b/components/official-account.vue @@ -1,6 +1,5 @@ \ No newline at end of file diff --git a/pages/order/components/orderInfo.vue b/pages/order/components/orderInfo.vue index 37ad662..893eddd 100644 --- a/pages/order/components/orderInfo.vue +++ b/pages/order/components/orderInfo.vue @@ -45,62 +45,66 @@ - --> + - - - - - - - - - - - - {{ item.productName }} - {{ - item.skuName - }} - - - - {{ item.price }} - - ¥{{ - useVipPrice ? item.memberPrice || item.price : item.price - }} - + - + -¥{{ discountActivity.discountAmount }}-¥{{ cartStore.orderCostSummary.fullReduction.actualAmount }} @@ -304,7 +308,10 @@ - + 优惠折扣 { }; cartStore.setDinnerType(tebtypeList[is_type.value].val); - - // 清空 const bwcclear = () => { IntegralInputclose(); @@ -833,16 +839,13 @@ function calcDiscountActivity() { const res = discountActivityRes.value; const user = uni.cache.get("shopUserInfo"); - //不与会员同享 - if (!res.vipPriceShare && user.isVip) { - return; - } - console.log("calcDiscountActivity:originalPrice", originalPrice.value); + const usedFullReductionActivityFullAmount=cartStore.orderCostSummary.fullReduction.usedFullReductionActivityFullAmount; + console.log("usedFullReductionActivityFullAmount", usedFullReductionActivityFullAmount); if (res && res.thresholds && res.thresholds.length > 0) { const canUseThresholds = res.thresholds .filter((v) => { - return originalPrice.value >= v.fullAmount; + return usedFullReductionActivityFullAmount >= v.fullAmount; }) .sort((a, b) => { return b.discountAmount - a.discountAmount; @@ -859,9 +862,7 @@ function calcDiscountActivity() { } console.log("当前满减门槛", discountActivity.value); - if (discountActivity.value) { - cartStore.fullReductionActivities = [discountActivityRes.value]; - } + } async function getDiscountActivity() { const res = await discountActivityApi.config({ @@ -871,6 +872,8 @@ async function getDiscountActivity() { return; } discountActivityRes.value = res; + cartStore.fullReductionActivities = [res]; + calcDiscountActivity(); } onMounted(async () => { @@ -1174,6 +1177,7 @@ onMounted(async () => { display: flex; .cover { + position: relative; } .info { @@ -1561,4 +1565,19 @@ onMounted(async () => { .align-center { align-items: center; } +.limitDiscount { + background-color: #cc5617; + padding: 2rpx 10rpx; + white-space: nowrap; + text-align: center; + position: absolute; + top: 0; + left: 0; + font-weight: 400; + font-size: 24rpx; + color: #ffffff; + border-radius: 20rpx 0rpx 20rpx 0rpx; + z-index: 9; + color: #fff; +} \ No newline at end of file diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index 3cfe696..7d6cf3b 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -223,7 +223,7 @@ @close="ispws = false" /> - + + \ No newline at end of file diff --git a/pages/product/components/shoppingCartes.vue b/pages/product/components/shoppingCartes.vue index 04c9986..912e7ea 100644 --- a/pages/product/components/shoppingCartes.vue +++ b/pages/product/components/shoppingCartes.vue @@ -1,836 +1,917 @@ \ No newline at end of file diff --git a/pages/product/index.vue b/pages/product/index.vue index 412b7c2..99011b6 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -58,6 +58,9 @@ v-for="(item, index) in shopProductList.hots" :key="index" > + 限时折扣 /{{ item.unitName }} + + ¥{{ item.salePrice }} @@ -189,16 +196,21 @@ >¥ - - {{ - shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 - ? item.memberPrice || item.salePrice - : item.salePrice - }} - + + + + /{{ item.unitName }} + ¥{{ item.salePrice }} @@ -357,12 +369,16 @@ mode="" > + TOP{{ index1 + 1 }} + 限时折扣 {{ item1.name }} @@ -417,16 +433,21 @@ - - {{ - shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 - ? item1.memberPrice || item1.salePrice - : item1.salePrice - }} - + + + /{{ item1.unitName }} + ¥{{ item1.salePrice }} + 扫码关注公众号 @@ -259,10 +259,8 @@ import * as rechargeApi from "@/common/api/market/recharge.js"; import { pointsShopList } from "@/common/api/account/points.js"; -const qrcode = ref(""); function qrcodeResult(res) { - console.log("qrcodeResult", res); qrcode.value = res } @@ -470,7 +468,14 @@ onShow(() => { getData(); }); +const qrcode = ref(""); +const showQrcode = computed(() => { + const followIndex = uni.cache.get("followIndex"); + if ( followIndex == "mine" && qrcode.value) { + return true; + } +}); \ No newline at end of file diff --git a/user/exchange/components/confirm.vue b/user/exchange/components/confirm.vue index 04d9acd..374c414 100644 --- a/user/exchange/components/confirm.vue +++ b/user/exchange/components/confirm.vue @@ -11,21 +11,21 @@ 确认信息 - + 兑换码包含内容如下: 店铺 - 店铺名称 + {{data.shopName}} 名称 - 10张券兑换码 + {{data.name}} - + 优惠券 - 优惠券名称*2、优惠券名称*1 + {{data.couponInfoList.map(item=>item.title+'*'+item.num).join('、')}} 取消 @@ -39,6 +39,13 @@