From 4dcea9995b73191550866c4a098536323cf69d0e Mon Sep 17 00:00:00 2001
From: zpian <407488026@qq.com>
Date: Thu, 1 Feb 2024 18:59:09 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E9=94=80=E5=89=8D=E7=AB=AF=E7=9A=84?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/user.js | 8 +
pages/users/user_coupon/index.vue | 71 +++++++-
pages/users/write_off/index.vue | 293 +++++++++++++++++++++++++++---
3 files changed, 336 insertions(+), 36 deletions(-)
diff --git a/api/user.js b/api/user.js
index 55d4974..c821dc0 100644
--- a/api/user.js
+++ b/api/user.js
@@ -699,6 +699,14 @@ export function getMerchantIntegral(data) {
export function convertMerchantIntegral(merId,data) {
return request.post("user/integral/integral_convert/"+merId, data);
}
+// 创建核销二维码
+export function createQRcode(data) {
+ return request.get("coupon/create_qrcode", data);
+}
+// 完成核销操作
+export function writeOff(data) {
+ return request.post("coupon/writeOff", data);
+}
diff --git a/pages/users/user_coupon/index.vue b/pages/users/user_coupon/index.vue
index 561b432..429d673 100644
--- a/pages/users/user_coupon/index.vue
+++ b/pages/users/user_coupon/index.vue
@@ -18,17 +18,17 @@
¥{{item.coupon_price}}
-
+ 满{{ item.use_min_price }}元可用
¥{{item.coupon_price}}
-
+ 满{{ item.use_min_price }}元可用
-
+
¥{{item.coupon_price}}
-
+ 满{{ item.use_min_price }}元可用
@@ -37,15 +37,19 @@
品类券
通用券
跨店券
+ 核销券
商品券
{{item.coupon_title}}
{{item.start_time | timeYMD}}-{{item.end_time | timeYMD}}
-
+
去使用
+
+ 去使用
+
已使用
已过期
@@ -60,6 +64,15 @@
+
+
+
+ 关闭
+
+ 去使用
+
+
+
@@ -71,6 +84,9 @@
import {
getUserCoupons
} from '@/api/api.js';
+
+ import { createQRcode } from '@/api/user.js';
+
import {
mapGetters
} from "vuex";
@@ -102,7 +118,7 @@
page:1,
isScroll:true,
moneyBg: '/static/images/couponBg',
-
+ qrCode: '',
};
},
computed: configMap(['hide_mer_status'], mapGetters(['isLogin','uid','viewColor','keyColor'])),
@@ -111,7 +127,7 @@
if(value){
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
return newDate[0]
- }
+ }
}
},
onLoad(options) {
@@ -169,7 +185,27 @@
that.isScroll = that.couponsList.length {
+ console.log(res.data.qr_code)
+ this.qrCode = res.data.qr_code
+ this.$refs.qrCodePopup.open('center')
+ }).catch(err => {
+ this.$util.Tips({title: err});
+ });
+ },
+ // 关闭二维码弹框
+ closeQrCode() {
+ this.$refs.qrCodePopup.close();
+ },
},
onReachBottom() {
this.getUseCoupons()
@@ -319,4 +355,23 @@
.coupon_value{
max-width: 220rpx;
}
+ // 二维码弹框
+ .qr-code-content{
+ width: 80vw;
+ .image{
+ width: 80vw;
+ height: 80vw;
+ }
+ .close-qr-code{
+ position: fixed;
+ top: 35rpx;
+ right: 70rpx;
+ color: #FFFFFF;
+ border: 2rpx solid #FFFFFF;
+ height: 40rpx;
+ line-height: 36rpx;
+ padding: 0 20rpx;
+ border-radius: 50rpx;
+ }
+ }
diff --git a/pages/users/write_off/index.vue b/pages/users/write_off/index.vue
index 9ff1b71..2fa9b87 100644
--- a/pages/users/write_off/index.vue
+++ b/pages/users/write_off/index.vue
@@ -1,21 +1,36 @@
-
-
-
-
- 主要内容
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 搜索
+
+
+ 扫码核销
+
+
+
+
+ 扫码核销
+
+
+
+
+
+
+
+
+
+