From 56d58b4c0b75efc267f5e0a681931bc3698aba70 Mon Sep 17 00:00:00 2001
From: 13405411873 <1994398261@qq.com>
Date: Fri, 20 Jun 2025 15:20:04 +0800
Subject: [PATCH] =?UTF-8?q?crm=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/business/member.js | 1 -
pages/mine/coupon/my-coupon.vue | 64 ++++++++++++++---
pages/mine/member/member-card.vue | 69 ++++++++++++++++---
pages/mine/points/points.vue | 111 +++++++++++++++++++-----------
pages/notice/public-notice.vue | 66 ++++++++++++++++--
utils/request.js | 2 +
6 files changed, 243 insertions(+), 70 deletions(-)
diff --git a/api/business/member.js b/api/business/member.js
index 0a3f334..4d700de 100644
--- a/api/business/member.js
+++ b/api/business/member.js
@@ -176,7 +176,6 @@ export function prepayment(data) {
params: data
})
}
-
export function saveOrder(data) {
return request({
url: '/member/order/uniSaveOrder',
diff --git a/pages/mine/coupon/my-coupon.vue b/pages/mine/coupon/my-coupon.vue
index f205c6b..0e3f530 100644
--- a/pages/mine/coupon/my-coupon.vue
+++ b/pages/mine/coupon/my-coupon.vue
@@ -30,7 +30,9 @@
-
+
+
+ 购买
@@ -95,12 +97,16 @@
import {
getToken
} from '@/utils/auth'
+ import {
+ getConfigByCode
+ } from '@/api/system/config.js'
export default {
components: {
navigationBarVue
},
data() {
return {
+ payType: 'h5',
globalConfig: getApp().globalData.config,
menus: ['急招券', '购买记录'],
menuIndex: 0,
@@ -124,6 +130,7 @@
},
onLoad(option) {
this.menuIndex = option.index || 0
+ this.getConfigKey()
this.initCoupon();
this.initOrder()
//获取url中的search
@@ -162,6 +169,13 @@
}
},
methods: {
+ getConfigKey() {
+ getConfigByCode('payType').then(res => {
+ if (res.msg) {
+ this.payType = res.msg
+ }
+ })
+ },
initMyCoupon() {
getMemberCoupon().then(res => {
this.coupon = res.data
@@ -257,7 +271,8 @@
if (res.code == 200) {
//吊起支付
let payData = {
- orderNo: res.data.orderNo
+ orderNo: res.data.orderNo,
+ type: that.payType
}
prepayment(payData).then(paymentData => {
that.wxpay(paymentData)
@@ -312,16 +327,47 @@
},
// 检测支付环境中的 WeixinJSBridge
wxpay(data) {
- if (typeof WeixinJSBridge == "undefined") {
- if (document.addEventListener) {
- document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
- } else if (document.attachEvent) {
- document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
- document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
+ if (this.payType == 'h5') {
+ if (typeof WeixinJSBridge == "undefined") {
+ if (document.addEventListener) {
+ document.addEventListener('WeixinJSBridgeReady', onBridgeReady(data), false);
+ } else if (document.attachEvent) {
+ document.attachEvent('WeixinJSBridgeReady', onBridgeReady(data));
+ document.attachEvent('onWeixinJSBridgeReady', onBridgeReady(data));
+ }
+ } else {
+ this.onBridgeReady(data);
}
} else {
- this.onBridgeReady(data);
+ console.log(data, 381);
+ uni.requestPayment({
+ provider: 'wxpay', // 支付提供商
+ timeStamp: data.timeStamp + '', // 时间戳
+ nonceStr: data.nonceStr, // 随机字符串
+ appId: data.appId,
+ package: data.packageVal, // 统一下单接口返回的prepay_id参数值
+ signType: data.signType, // 签名算法
+ paySign: data.paySign, // 签名
+ success: (res) => {
+ // 支付成功回调
+ uni.showToast({
+ title: "支付成功",
+ icon: "success",
+ duration: 2000
+
+ })
+ },
+ fail: (err) => {
+ console.log(err, 160);
+ // 支付失败回调
+ uni.showToast({
+ title: "支付失败,请联系管理员!",
+ icon: "none"
+ })
+ }
+ });
}
+
},
onBridgeReady(data) {
diff --git a/pages/mine/member/member-card.vue b/pages/mine/member/member-card.vue
index aae2a4f..3fc145b 100644
--- a/pages/mine/member/member-card.vue
+++ b/pages/mine/member/member-card.vue
@@ -33,9 +33,9 @@
-
+
-
+ 立即开通
@@ -77,6 +77,9 @@