From c824641a9ef75de220fbf7cbab477d4e49fee2b9 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 18 Dec 2025 02:46:52 -0600 Subject: [PATCH] 's' --- src/pages/book/index.tsx | 45 +++----------------------------------- src/pages/index/index.jsx | 46 +-------------------------------------- 2 files changed, 4 insertions(+), 87 deletions(-) diff --git a/src/pages/book/index.tsx b/src/pages/book/index.tsx index 0e850dd..26036a3 100644 --- a/src/pages/book/index.tsx +++ b/src/pages/book/index.tsx @@ -99,48 +99,7 @@ const Book = () => { } }; - const payh52222 = (type, total_fee = 1000) => { - // console.log("111"); - Taro.request({ - method: "POST", - url: `${process.env.TARO_API_API}/payh5`, //仅为示例,并非真实的接口地址 - // url: "https://pay.hackrobot.cn${process.env.TARO_API_API}/payh5", //仅为示例,并非真实的接口地址 - data: { - callback_url: window.location.href, - openid: window.localStorage.getItem("openid"), - total_fee: total_fee, // 金额,单位:分 - type: type, //订单类型 book/meetup/video/vip - }, - header: { - "content-type": "application/json", // 默认值 - }, - success: function (res) { - console.log(res.data); - // window.alert(res.data.jsapi); - WeixinJSBridge.invoke( - "getBrandWCPayRequest", - { - // 以下6个支付参数通过payjs的jsapi接口获取 - // appId: "wxc5205a653b0259bf", - // timeStamp: "1701401644", - // nonceStr: "KhOYB0wFV6j9qyQK", - // package: "prepay_id=wx01113404850024729b35f4d69b73500000", - // signType: "MD5", - // paySign: "2A823C8D47CCF871C6C65A56DC228CF8", - ...(res?.data?.jsapi ?? {}), - }, - function (res) { - // 支付成功 - if (res.err_msg == "get_brand_wcpay_request:ok") { - window.localStorage.setItem(type, 1); //订单类型 book/meetup/video/vip - WeixinJSBridge.call("closeWindow"); - } - } - ); - }, - }); - }; const payh5 = (type, total_fee = 1000) => { Taro.request({ @@ -282,7 +241,9 @@ const payh5 = (type, total_fee = 1000) => { } else { if (!!isWeChat) { //198元 - payh5("book", 10); + // payh5("book", 10); + window.location.href = `https://vip.hackrobot.cn`; + } else { window.location.href = `https://mp.weixin.qq.com/s/16xcMIgxEEGBPY7fanNq0g`; } diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index a8570f2..6d2f009 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -295,7 +295,7 @@ const Index = () => { let inwechat = isWeChatFun(); if (inwechat) { // 获取openId - getOpenid(); + // getOpenid(); } else { // window.alert('不在微信') } @@ -315,50 +315,6 @@ const Index = () => { setopen(value); }; - const payh5 = (type, total_fee = 1000) => { - // console.log("111"); - Taro.request({ - method: "POST", - url: `${process.env.TARO_API_API}/payh5`, - // url: "${process.env.TARO_API_API}/payh5", - - // url: "https://pay.hackrobot.cn${process.env.TARO_API_API}/payh5", //仅为示例,并非真实的接口地址 - - data: { - callback_url: window.location.href, - openid: window.localStorage.getItem("openid"), - total_fee: total_fee, // 金额,单位:分 - type: type, //订单类型 book/meetup/video/vip - }, - header: { - "content-type": "application/json", // 默认值 - }, - success: function (res) { - console.log(res.data); - // window.alert(res.data.jsapi); - WeixinJSBridge.invoke( - "getBrandWCPayRequest", - { - // 以下6个支付参数通过payjs的jsapi接口获取 - // appId: "wxc5205a653b0259bf", - // timeStamp: "1701401644", - // nonceStr: "KhOYB0wFV6j9qyQK", - // package: "prepay_id=wx01113404850024729b35f4d69b73500000", - // signType: "MD5", - // paySign: "2A823C8D47CCF871C6C65A56DC228CF8", - ...(res?.data?.jsapi ?? {}), - }, - function (res) { - // 支付成功 - if (res.err_msg == "get_brand_wcpay_request:ok") { - window.localStorage.setItem(type, 1); //订单类型 book/meetup/video/vip - WeixinJSBridge.call("closeWindow"); - } - } - ); - }, - }); - }; const goRead = () => { Taro.navigateTo({