diff --git a/.env b/.env
index 90b11a9..09f6da3 100644
--- a/.env
+++ b/.env
@@ -24,17 +24,17 @@ VITE_OAUTH2_APP_CLIENT='mini:mini'
# VITE_ZZD_CORP_ID=
# --------------------------- 开发环境 api地址 ----------------------------------
-VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
+# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上
#VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上
# VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc # 邓-本地
-# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
+VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地
# VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 开发环境 图片访问基础地址 ---------------------------
-VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
+# VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上
#VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上
#VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc # 邓-本地
-# VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
+VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999
# VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上
# --------------------------- 生产环境 api地址 ----------------------------------
diff --git a/src/pages/merchant/components/coupon-card.vue b/src/pages/merchant/components/coupon-card.vue
index 229d8de..27051f8 100644
--- a/src/pages/merchant/components/coupon-card.vue
+++ b/src/pages/merchant/components/coupon-card.vue
@@ -2,19 +2,25 @@
import { reactive, ref, computed } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
+import { hooks, router } from "@/sheep"
import { serviceEnum } from "@@/constant"
const { actCouponTypeEnum } = serviceEnum
-const emit = defineEmits(["doVisibleQrcode"])
+const emit = defineEmits(["doVisibleQrcode", "doUse"])
-const props = withDefaults(defineProps<{ detail: any }>(), {
+const props = withDefaults(defineProps<{ mode?: 'list' | 'select', detail: any }>(), {
+ mode: "list",
detail: {},
})
const doVisibleQrcode = () => {
emit("doVisibleQrcode", { type: 'ACT_COUPON', detail: props.detail })
}
+
+const doUse = () => {
+ emit("doUse", { type: 'ACT_COUPON', detail: props.detail })
+}
@@ -36,17 +42,23 @@ const doVisibleQrcode = () => {
-
- ¥
- {{ detail.faceValue }}
+
+
+ 立减
+ {{ detail.faceValue }}%
+
+
+ ¥
+ {{ hooks.useMoney(detail.faceValue) }}
+
{{ detail.couponName }}
- 满{{ detail.minPoint }}可用
+ 满{{ hooks.useMoney(detail.minPoint) }}可用
+ {{ actCouponTypeEnum[detail.couponType] }}
- {{ actCouponTypeEnum[detail.couponType] }}
在{{ detail.startTime }}至{{ detail.endTime }}时间段使用
@@ -58,10 +70,18 @@ const doVisibleQrcode = () => {
-
- 核销码
- 已使用
- 已过期
+
+
+
+ 核销码
+ 去使用
+
+ 已使用
+ 已过期
+
+
+ 使用
+
@@ -119,7 +139,7 @@ const doVisibleQrcode = () => {
}
.amount {
- font-size: 48rpx;
+ font-size: 28rpx;
font-weight: bold;
margin: 0 8rpx 0 2rpx;
line-height: 1;
@@ -136,6 +156,8 @@ const doVisibleQrcode = () => {
}
.condition {
+ display: flex;
+ align-items: center;
font-size: 24rpx;
color: #0094ff;
opacity: 0.8;
@@ -190,7 +212,7 @@ const doVisibleQrcode = () => {
/* 右侧按钮区 */
.coupon-right {
- width: 160rpx;
+ width: 140rpx;
display: flex;
align-items: center;
justify-content: center;
diff --git a/src/pages/merchant/merchant-activity.vue b/src/pages/merchant/merchant-activity.vue
index 4a94024..6efbaa9 100644
--- a/src/pages/merchant/merchant-activity.vue
+++ b/src/pages/merchant/merchant-activity.vue
@@ -30,24 +30,39 @@
class="card relative rounded-lb-0! rounded-rb-0! w-full activity-card overflow-hidden">
{{ actCouponTypeEnum[state.actDetail.type] }}
- {{ state.actDetail.name }}
-
-
- {{ state.actDetail.validStartTime }}
- ~
- {{ state.actDetail.validEndTime }}
-
+ {{ state.actDetail.name }}
+
+
+ 剩余
+ {{ state.actDetail.surplusCount }}
+ /
+ {{ state.actDetail.totalCount }}
+ 张
+
+
+
+
+ 满{{ hooks.useMoney(state.actDetail.minPoint) }}元,
+
+ 立减{{ state.actDetail.faceValue }}%
+
+
+
+ 满减{{ hooks.useMoney(state.actDetail.faceValue) }}元
+
+
+ 立减{{ hooks.useMoney(state.actDetail.faceValue) }}元
-
-
+
+
领取后请在
{{ state.actDetail.validStartTime }}
~
{{ state.actDetail.validEndTime }}
时间段内使用
-
+
领取后请在
{{ state.actDetail.validDays }}
天内使用
@@ -244,18 +259,10 @@ const modifyUserClose = () => {
background-image: url("../../static/page/activity-card-bg.png");
background-repeat: no-repeat;
background-size: contain;
- background-position: 150%;
+ background-position: 130%;
background-color: #1879ff77;
}
-.activity-sr-card {
- /* background-image: url("../../static/page/act_li_quan.jpg");
- background-repeat: no-repeat;
- background-size: contain;
- background-position: 150%;
- background-color: red; */
-}
-
.ribbon {
width: 160rpx;
height: 40rpx;
@@ -268,4 +275,47 @@ const modifyUserClose = () => {
color: #fff;
font-size: 24rpx;
}
+
+.coupon-stock-badge {
+ display: flex;
+ align-items: center;
+ padding: 8rpx 18rpx;
+ border-radius: 9999rpx;
+ background: rgba(238, 238, 238, 0.28);
+ backdrop-filter: blur(2px);
+ color: #fff;
+}
+
+.coupon-stock-dot {
+ width: 12rpx;
+ height: 12rpx;
+ margin-right: 10rpx;
+ border-radius: 9999rpx;
+ background: #0094ff;
+}
+
+.coupon-stock-label,
+.coupon-stock-unit,
+.coupon-stock-split,
+.coupon-stock-total {
+ font-size: 24rpx;
+ line-height: 1;
+}
+
+.coupon-stock-value {
+ margin: 0 4rpx 0 8rpx;
+ font-size: 24rpx;
+ font-weight: 700;
+ line-height: 1;
+}
+
+.coupon-stock-total {
+ margin-left: 4rpx;
+ opacity: 0.9;
+}
+
+.coupon-stock-unit {
+ margin-left: 6rpx;
+ opacity: 0.9;
+}
diff --git a/src/pages/merchant/my-act-list.vue b/src/pages/merchant/my-act-list.vue
index 060d009..3786bd6 100644
--- a/src/pages/merchant/my-act-list.vue
+++ b/src/pages/merchant/my-act-list.vue
@@ -18,6 +18,8 @@ import CouponCard from "./components/coupon-card.vue"
const { actCouponTypeEnum } = serviceEnum
+const { scanCodeAction, processUrlScanResult, processBase64ScanResult } = hooks.useScanCode(false)
+
const pageRef = ref(null)
const showQrCodeDialog = ref(false)
@@ -70,6 +72,22 @@ const doTab = (e: any) => {
getUserTotal()
}
+// 去使用
+const doUse = async (detail: any) => {
+ const { type, detail: actDetail } = detail
+ console.log("去使用:", type, actDetail);
+ const scanResult = await scanCodeAction()
+ if (!scanResult) return uni.showToast({ title: "扫码错误", icon: "none" })
+ // 判断扫码结果
+ if (scanResult.startsWith("http")) {
+ // 扫码结果是url链接
+ processUrlScanResult(scanResult.replace("/#", ""))
+ } else {
+ // 扫码结果是base64字符串
+ processBase64ScanResult(scanResult)
+ }
+}
+
const doVisibleQrcode = async (detail: any) => {
const { type, detail: actDetail } = detail
console.log("生成二维码:", type, actDetail);
@@ -155,7 +173,7 @@ const genVerificationCode = async (params: Record) => {
+ @do-visible-qrcode="doVisibleQrcode" @doUse="doUse" />
+import { hooks } from "@/sheep"
+
+const emit = defineEmits(["doSelect"])
+
+const props = withDefaults(defineProps<{ selectId?: any, detail: any, disabled?: boolean }>(), {
+ selectId: null,
+ detail: {},
+ disabled: false,
+})
+
+const doSelect = () => {
+ if (props.disabled) return
+ emit("doSelect", { type: 'ACT_COUPON', detail: props.detail })
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 立减
+ {{ detail.faceValue }}%
+
+
+ ¥
+ {{ hooks.useMoney(detail.faceValue) }}
+
+
+ {{ detail.couponName }}
+
+
+ 满{{ hooks.useMoney(detail.minPoint) }}可用
+
+
+
+
+
+
+
+
+
+
+
+ {{ disabled ? "不可用" : "使用" }}
+
+
+
+
+
diff --git a/src/pages/pay/scanPay.vue b/src/pages/pay/scanPay.vue
index 7ed7401..e1223df 100644
--- a/src/pages/pay/scanPay.vue
+++ b/src/pages/pay/scanPay.vue
@@ -1,24 +1,33 @@
-
-
+
+
{{ scanPayState.mchName }}
-
-
- ¥
- {{ displayAmount }}
+
+
+ ¥
+ {{ displayAmount }}
+
+
+
+ 已优惠 ¥{{ couponDiscountDisplay }}
+
+
+ 券后实付
+ ¥{{ couponPayableDisplay }}
+
+
+
+ {{ couponUnavailableText }}
+
-
选择支付钱包:
-
+
-
+
{{ v.walletTypeName }}
@@ -28,7 +37,14 @@
+
+ 选择优惠券:
+
+
+
支 付
+
@@ -36,17 +52,19 @@