From d113dc3d1e5f3b42ea414e8be538ce2442ffc899 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 30 七月 2024 17:43:05 +0800
Subject: [PATCH] feat(支付): 支持C扫B动态码支付
---
pay/scanpay.vue | 48 +++++++++++++++++++++++++++++++++++++++---------
1 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/pay/scanpay.vue b/pay/scanpay.vue
index 398e1d7..2ac6a37 100644
--- a/pay/scanpay.vue
+++ b/pay/scanpay.vue
@@ -140,7 +140,8 @@
ACCESSTOKEN
} from 'common/config.js';
import {
- queryShop,
+ queryShopByCid,
+ queryShopByShopId,
userLogin,
queryUseSweepPayCoupon,
getWechatConfigInfo,
@@ -161,7 +162,9 @@
showRemark: false,
UNIONID: null,
payWay: this.$utils.getPlat(),
- cid: '',
+ cid: '', //鐮佺墝id C鎵獴闈欐�佺爜鏃舵湁
+ activityQrcodeId: '', //鍔ㄦ�佹敹娆剧爜 C鎵獴鍔ㄦ�佺爜鏃舵湁
+ shopId: '', //鍟嗘埛id C鎵獴鍔ㄦ�佺爜鏃舵湁
bordShow: false, // 鏄剧ず閿洏
shopInfo: {
cusid: '',
@@ -209,6 +212,14 @@
this.money = opt.smoney
}else{
this.bordShow = true
+ }
+ if (opt.activityQrcodeId) {
+ this.activityQrcodeId = opt.activityQrcodeId
+ // this.getOrderInfo()
+ }
+ if (opt.shopId) {
+ this.shopId = opt.shopId
+ this.init()
}
if (opt.cid) {
this.cid = opt.cid
@@ -305,11 +316,25 @@
this.tips = '褰撳墠鐢ㄦ埛杩囧锛岃绋嶅悗閲嶈瘯锝瀇锝�'
this.loading = false
}, 2000)
+ let api = queryShopByCid
+ let params = {
+ cid: this.cid
+ }
+ if(this.cid){
+ api = queryShopByCid
+ params = {
+ cid: this.cid
+ }
+ }
+ if(this.activityQrcodeId){
+ api = queryShopByShopId
+ params = {
+ shopId: this.shopId
+ }
+ }
//鑾峰彇鍟嗛摵淇℃伅
- queryShop({
- params: {
- cid: this.cid
- }
+ api({
+ params
}).then(res => {
clearTimeout(timer)
this.loading = false
@@ -385,14 +410,19 @@
// 閲戦 this.money
uni.showLoading()
const params = {
- money: Number(this.money * 100),
- shopId: this.shopInfo.id,
- cid: this.cid,
payWay: this.payWay,
buyerNote: this.buyerNote,
score: 0,
couponDetailId: this.couponInfo.id
}
+ if(this.activityQrcodeId){
+ params.activityQrcodeId = this.activityQrcodeId
+ }
+ if(this.cid){
+ params.money = Number(this.money * 100)
+ params.shopId = this.shopInfo.id
+ params.cid = this.cid
+ }
//鐢熸垚璁㈠崟
saveOrder(params).then(res => {
uni.hideLoading()
--
Gitblit v1.9.1