恢复绿色ui前做备份

This commit is contained in:
lym
2026-03-18 20:21:04 +08:00
parent bc9073f7f3
commit c8115c9e7b
7 changed files with 1014 additions and 78 deletions

View File

@@ -228,7 +228,7 @@
<aliAPP_PRIVATE_KEY0 value="MIIEpQIBAAKCAQEAifSSbAM1LsUszjqx3MvtwMmTk3QC6O5/KMkZCJD0JS0TFD/psq3d2baCmiA7uJT9y9cRLivG+QwIfRM/ldz7j6IcSk2zEDkpbEgzUmPO/tnmkvwSztOn4VM4GKTzqy2fRJcncKZBS1GM+Ifxa8Lyz8aNPmuXPvljBo88w2QqjQ1J4qW9Ql4U7PZ5AG7nai7PP9AjJQIz3JgFdO5VyHRiPYFQU12bSFtv3r3X44wRDTwdeJwN89JeP853GQhysJ9ry+lg5HFcaZkln6UxRFvMWev7V0W4SD7HdCET0q7zfpRYHRMaqBee1hI90uvmiJPWFDcPwCJpDJYk0wJb1U5UJQIDAQABAoIBAF25oKTrhP1Sjn9KFz7H+a5qBO4/+h4gspmWDoDoYkbDmdu/FFoFj9zzB0YJMinUZ51Ob2ir61GWYEoBgsihSvOpkojUwxv5ie/8GYoXLzGr/t/LjEeiOsN2E32Cy913cGZcPzpkaaXvMNRFH7szxl1tKtbGqAnryuBQ/lpNOi97YUjoIRodcS3qmFzicRnag/Pyzw0+I6l4fH9Inh1u0680R3f4D9bjEgZxe5//syBhtzb1R6u5uhEHOZ0bKAkhwfpfwnkfivJIcDF88DGHbIdgyvv14c6rsuC3JXhXuurHBR8kYbAO1rtxs4RdVUPpuTzCnTrZVVYSpbwajX0+4R0CgYEAwZC5o+JCU/006/rI3+tA3UiZxFliD4VLzd4Zwg7piVj56QXjKWiJj2c3KQsRJWzfVTkjmW6GRtnpIUj6usp8tXnK1L4GugLGbgzVRdaf1sFFf7+3o7ouv+YuXWdJhiCRX8JrwfNT+WQEioys2kn8ghq5EtKTn0kUssVAkOF2lGsCgYEAtnP2kDTRE5FDVaI0eCyjURb8ZbTDng5bkw+Aez4mp4bRFhUp86pjtyRH4UREAWZMYA/KzAj11mCgpx2X/rKXgLSH1yMBx2a0ton65kqlkH23qotjwNOOC64oN5NDO6RXP3+b7cdWjhJlMR10MX0liBAfkwA0xwTQsW1RsJj8Xa8CgYEAjxAehQgXqef9k2RZz1YbLPIZ5EuD9KC6dD/xncJTzVXb7+SQDuzarwjEditd0uFy95QxwZc022z3p8g+uIwsPBz2UuLYKecfLfuCLgoBPUK/0TmryvEy2FaSciqC5wVvLO2Po1vq9up7iMOMhhIk9Sw3GbhVr2beS3sKy4o4kF0CgYEAl1sl3MVj+GaWRFDWVCc7qIZ4BWtqqBDjGOFQRWzupiUqCLav4aqlJAXd91spSzvw+fO/2XlJb3kjbN8Y+zpugl/BHNC2phNmsNNQJ4EfTflsxvbxXsJhYQEt7cSljrGri0qyMRQfkqZh+dekT3WxD+nIN6uBHOS6t6Wnkeen25MCgYEApObseYd0KVNFMLWr7iVWLoHe7n0nYZZL13WIbEru9JKsbaZdRsP6G3GxaJHDLrf2r6US+MvIBQOU95Y5Fp2kEXw1JD9/JECUjjRE/pzoNt3qO0WAVGFphOMcxzc4XsQ6LoK1b4DSXzOGj9ESjNkAPhbEK89usG49G8/C/b53F34=" des="开发者应用私钥" />
<aliPAY_PUBLIC_KEY0 value="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB" des="开发者应用公钥" />
<webXAppID value="wx7899fda6c28b65ee" des="微信小程序AppID" />
<webXAppSecret value="9320580e35e1e1d9b226270484ce8711" des="微信小程序AppSecret" />
<webXAppSecret value="75a052a32fddee48e7a95b3d908cee8d" des="微信小程序AppSecret" />
<webXaccess_token value="91_P-MAhXG1n6nbopPaaTsbqVBguCa_YCMea_AgDKz0ySkKFcIKn627w3PhImohwm7uXCj4XkeCqPXTQrJj_H4QOExkrLzhT0-YuvfXCST9q7swdAJpeP09RXrlgusQDHbAJAKXB" des="小程序access_token" />
<webXaccess_token_time value="2025-04-29 09:35:28" des="小程序access_token_time" />
<webToken value="hxgcandgengliu" des="微信Token" />

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>D:\renyipublic</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

View File

@@ -329,10 +329,10 @@
</div>
<span class="no">
<ul class="menu" style="display:none;">
<!--<li><a target="mainFrame" href="/Admin_Member_business0_list.aspx">申请线上门店列表</a></li>
<li><a target="mainFrame" href="/Admin_Member_List0.aspx">联盟部列表</a></li>
<li><a target="mainFrame" href="/Admin_Member_Products_SJ_Seef.aspx?t=2">联盟部商品列表</a></li>
<li><a target="mainFrame" href="/Admin_Member_Products_SJ_Orders.aspx?t=2">联盟部订单列表</a></li>-->
<li><a target="mainFrame" href="/Admin_Member_business0_list.aspx">申请线上门店列表</a></li>
<%-- <li><a target="mainFrame" href="/Admin_Member_List0.aspx">联盟部列表</a></li>--%>
<%-- <li><a target="mainFrame" href="/Admin_Member_Products_SJ_Seef.aspx?t=2">联盟部商品列表</a></li>
<li><a target="mainFrame" href="/Admin_Member_Products_SJ_Orders.aspx?t=2">联盟部订单列表</a></li>--%>
<!-- <li><a target="mainFrame" href="/Admin_Member_Products6.aspx">联盟部商品列表</a></li>

View File

@@ -274,7 +274,7 @@ namespace Mtxfw.VipSite
case "getmyproducts": data = getmyproducts(context); break;
case "getqiandao": data = getqiandao(context); break;
case "qiandao": data = qiandao(context); break;
case "getmytgm": data = getmytgm(context); break;
case "getmytgm": data = getmytgm2(context); break;
case "appdeclaration": data = appdeclaration(context); break;
case "kttgy": data = kttgy(context); break;
case "getkttgylist": data = getkttgylist(context); break;
@@ -8699,7 +8699,7 @@ namespace Mtxfw.VipSite
}
}
if (strdata.Substring(strdata.Length - 3, 3) != "]},")
if (i > 0 && strdata.Substring(strdata.Length - 3, 3) != "]},")
{
if (strdata.Substring(strdata.Length - 1, 1) == ",")
{
@@ -8713,7 +8713,7 @@ namespace Mtxfw.VipSite
}
}
ds.Clear();
strdata += "]";
strdata += "]";
}
if (strdata != "")
{
@@ -8725,8 +8725,8 @@ namespace Mtxfw.VipSite
int Limit = 12;
Int32 Recount = 0;//
System.Data.DataSet Ds_ = daobusiness.GetDataSet(groupby, strOrder, "id,UserId,CompanyName,picture,Companyaddress,ycoo,xcoo,dbo.GetDistance(" + latitude + "," + longitude + ",xcoo,ycoo) as distance", "", "utype='0' and (seef=1 or seef0=1) and showpic=0" + strsql + "", Start, Limit, out Recount);
//System.Data.DataSet Ds_ = daobusiness.GetDataSet(groupby, strOrder, "id,UserId,CompanyName,picture,Companyaddress,ycoo,xcoo,dbo.GetDistance(" + latitude + "," + longitude + ",xcoo,ycoo) as distance", "", "utype='0' and (seef=1 or seef0=1) and showpic=0" + strsql + "", Start, Limit, out Recount);
System.Data.DataSet Ds_ = daobusiness.GetDataSet(groupby, strOrder, "id,UserId,CompanyName,picture,Companyaddress,ycoo,xcoo,ContactPhone,dbo.GetDistance(" + latitude + "," + longitude + ",xcoo,ycoo) as distance", "", "utype='2' and (seef=1 or seef0=1) and showpic=0" + strsql + "", Start, Limit, out Recount);
if (Ds_.Tables[1].Rows.Count > 0)
{
int j = 0;
@@ -8735,6 +8735,7 @@ namespace Mtxfw.VipSite
string id = drv["id"].ToString();
string UserId = drv["UserId"].ToString();
string name = drv["CompanyName"].ToString();
string Phone = drv["ContactPhone"].ToString();
string images = drv["picture"].ToString().Split('|')[0].Split(',')[0];
if (images != "")
{
@@ -8762,7 +8763,7 @@ namespace Mtxfw.VipSite
{
strdistance = distance.ToString("f0") + "m";
}
strdata += "{\"_id\":\"" + id + "\",\"showpic\":\"0\",\"name\":\"" + Mtxfw.Utility.Common.ReplaceString(name) + "\",\"address\":\"" + Mtxfw.Utility.Common.ReplaceString(address) + "\",\"distance\":\"" + strdistance + "\",\"lon\":\"" + lon + "\",\"lat\":\"" + lat + "\",\"image\":\"" + images + "\"";
strdata += "{\"_id\":\"" + id + "\",\"showpic\":\"0\",\"name\":\"" + Mtxfw.Utility.Common.ReplaceString(name) + "\",\"address\":\"" + Mtxfw.Utility.Common.ReplaceString(address) + "\",\"distance\":\"" + strdistance + "\",\"lon\":\"" + lon + "\",\"lat\":\"" + lat + "\",\"phone\":\"" + Phone + "\",\"image\":\"" + images + "\"";
strdata += ",\"products\":[";
/*DataSet Ds_Product0 = daoProduct.GetList1("top 3 P_ID,P_NAME,P_images", "gtype=" + gtype + " And IFDelete=0 And P_qgproduct=1 And P_State=N'已处理' And P_UserID=" + UserId + " And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 order by P_IFTop Desc,P_HITED Desc");
@@ -8931,7 +8932,7 @@ namespace Mtxfw.VipSite
{
strdistance = distance.ToString("f0") + "m";
}
data += ",\"_id\":\"" + bmodel.Id + "\",\"showpic\":\"" + bmodel.showpic + "\",\"name\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.CompanyName) + "\",\"address\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.Companyaddress) + "\",\"fwbody\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.BusinessRange) + "\",\"distance\":\"" + strdistance + "\",\"lon\":\"" + bmodel.xcoo + "\",\"lat\":\"" + bmodel.ycoo + "\"";
data += ",\"_id\":\"" + bmodel.Id + "\",\"showpic\":\"" + bmodel.showpic + "\",\"name\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.CompanyName) + "\",\"address\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.Companyaddress) + "\",\"fwbody\":\"" + Mtxfw.Utility.Common.ReplaceString(bmodel.BusinessRange) + "\",\"distance\":\"" + strdistance + "\",\"lon\":\"" + bmodel.xcoo + "\",\"phone\":\"" + bmodel.ContactPhone + "\",\"lat\":\"" + bmodel.ycoo + "\"";
data += ",\"productlist\":[";
if (bmodel.utype == "0")
{
@@ -9631,10 +9632,10 @@ namespace Mtxfw.VipSite
Ds_Product.Clear();
strdata += "]";
strdata += (userinfo + ",\"IFAuto\":\"" + IFAuto + "\",\"IFYGM\":" + IFYGM + ",\"dlMemberId\":\"0\",\"province\":\"" + province + "\",\"city\":\"" + city + "\",\"county\":\"" + county + "\",\"Address\":\"" + strAddress + "\",\"servermsg\":\"" + Mtxfw.Utility.Common.ReplaceString(Mtxfw.Utility.Common.InputText(config.ServerMsg)) + "\",\"webname\":\"" + config.webName + "\"");
strdata += (userinfo +",\"IFAuto\":\"" + IFAuto + "\",\"IFYGM\":" + IFYGM + ",\"dlMemberId\":\"0\",\"province\":\"" + province + "\",\"city\":\"" + city + "\",\"county\":\"" + county + "\",\"Address\":\"" + strAddress + "\",\"servermsg\":\"" + Mtxfw.Utility.Common.ReplaceString(Mtxfw.Utility.Common.InputText(config.ServerMsg)) + "\",\"webname\":\"" + config.webName + "\"");
}
data = "{\"status\":1," + strdata + "}";
//ifxn 是否显示轮播菜单 0不显示1显示
data = "{\"status\":1," + "\"ifxn\":0," + strdata + "}";
}
}
return data;
@@ -10760,7 +10761,8 @@ namespace Mtxfw.VipSite
if (umodel != null)
{
if (umodel.LoginId2 == LoginId)
//if (umodel.LoginId2 == LoginId)
if (1 == 1)
{
string NCName = (umodel.NCName == "" ? umodel.RealName : umodel.NCName);
string UserPic = umodel.UserPic;
@@ -10845,7 +10847,118 @@ namespace Mtxfw.VipSite
}
return data;
}
#endregion
#region //获取我的推广码-----------------------------------------------------------------------------------------
/// <summary>
/// 获取我的推广码
/// </summary>
protected string getmytgm2(HttpContext context)
{
string data = "{\"status\":0}";
int userId = 0;
if (!String.IsNullOrEmpty(context.Request["userId"]) && !String.IsNullOrEmpty(context.Request["LoginId"]))
{
userId = Convert.ToInt32(context.Request["userId"].ToString());
if (userId == 0)
{
data = "{\"status\":0,\"msg\":\"参数错误\"}";
return data;
}
string LoginId = HttpUtility.UrlDecode(context.Request["LoginId"].ToString());
Mtxfw.Model.user_info umodel = daoUser.GetModel(userId);
if (umodel != null)
{
if (umodel.LoginId2 == LoginId)
{
string NCName = (umodel.NCName == "" ? umodel.RealName : umodel.NCName);
string UserPic = umodel.UserPic;
string QRcode = umodel.EWMPic2;
string yqm = Mtxfw.Utility.Security.encrypt(umodel.Id).ToString();
if (QRcode == "")
{
bool ifb = true;
DateTime dt1 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
if (config.webXaccess_token != "" && config.webXaccess_token_time != "")
{
DateTime dt2 = Convert.ToDateTime(Convert.ToDateTime(config.webXaccess_token_time).AddMinutes(100).ToString("yyyy-MM-dd HH:mm:ss"));
if (dt1 > dt2)
{
ifb = false;
}
}
else
{
ifb = false;
}
if (!ifb)
{
Mtxfw.Utility.WXaccess_token ac = Mtxfw.Utility.Common.getxaccess_token(config.webXAppID, config.webXAppSecret);
config.webXaccess_token = ac.access_token;
config.webXaccess_token_time = dt1.ToString("yyyy-MM-dd HH:mm:ss");
config.Save();
}
//string URL = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + config.webXaccess_token;
//string json = "{\"path\":\"pages/index/index?tguid=" + Mtxfw.Utility.Security.encrypt(umodel.Id) + "\"}";
string URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + config.webXaccess_token;
string json = "{\"scene\":\"" + Mtxfw.Utility.Security.encrypt(umodel.Id) + "\",\"page\":\"pages/index/index\"}";
byte[] bytes = Mtxfw.Utility.Common.GetResponsebyte(json, URL);
string str = System.Text.Encoding.Default.GetString(bytes);
//Mtxfw.Utility.Common.WriteHtml("/weixin/errcode.txt", str);
if (str.IndexOf("errcode") != -1)
{
Mtxfw.Utility.WXaccess_token ac = Mtxfw.Utility.Common.getxaccess_token(config.webXAppID, config.webXAppSecret);
config.webXaccess_token = ac.access_token;
config.webXaccess_token_time = dt1.ToString("yyyy-MM-dd HH:mm:ss");
config.Save();
URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + ac.access_token;
bytes = Mtxfw.Utility.Common.GetResponsebyte(json, URL);
str = BitConverter.ToString(bytes);
//Mtxfw.Utility.Common.WriteHtml("/weixin/errcode0.txt", str);
}
/*var filepath = "/Files/grimage/" + umodel.Id + "/";
//创建保存位置
if (!Directory.Exists(context.Server.MapPath(filepath)))
{
Directory.CreateDirectory(context.Server.MapPath(filepath));
}
string filename = filepath + "ewm.jpg";
//写入文件
System.IO.File.WriteAllBytes(context.Server.MapPath(filename), bytes);
string ewmpic = "data:image/png;base64," + Mtxfw.Utility.Common.ImageToBase64(context.Server.MapPath(filename));*/
string ewmpic = "data:image/png;base64," + Convert.ToBase64String(bytes);
new Mtxfw.DAL.user_info().UpdatePassword("EWMPic2", ewmpic, umodel.Id);
umodel.EWMPic2 = ewmpic;
}
//Mtxfw.Utility.Common.WriteHtml("/weixin/EWMPic.txt", umodel.EWMPic2);
data = "{\"status\":1,\"QRcode\":\"" + umodel.EWMPic2 + "\",\"minQRcode\":\"" + umodel.EWMPic2 + "\",\"yqm\":\"" + yqm + "\"}";
}
else
{
data = "{\"status\":0,\"msg\":\"您未登录\"}";
}
}
else
{
data = "{\"status\":0,\"msg\":\"参数错误\"}";
return data;
}
}
else
{
data = "{\"status\":0,\"msg\":\"参数为空\"}";
return data;
}
return data;
}
#endregion
#region //申请代理-----------------------------------------------------------------------------------------
@@ -16426,7 +16539,10 @@ namespace Mtxfw.VipSite
var webName = config.webName;//仁E森命or 银花支付
//0官方支付1汇付支付
var isHfPay = 1;
if (webName.Contains("仁E森命"))
if (webName.Contains("仁E森命"))
{
isHfPay = 0;
}
///银花支付目前进的这里
strProductName = strProductName.Replace("%", "度").Replace(" ", "");
if (strProductName.Length > 120)
@@ -16471,68 +16587,148 @@ namespace Mtxfw.VipSite
// 注释掉原有代码改用HuifuPaymentService
string sys_id = config.hfpaysys_id;
string product_id = config.hfpayproduct_id;
string req_date = dt.ToString("yyyyMMdd");
string req_seq_id = PayID;
string huifu_id = config.hfpayMerchantID;
string goods_desc = body;
string trade_type = "T_MINIAPP";//T_JSAPI: 微信公众号 T_MINIAPP: 微信小程序 A_JSAPI: 支付宝 A_NATIVE: 支付宝正扫 U_NATIVE: 银联正扫 U_JSAPI: 银联JS D_NATIVE: 数字人民币正扫 T_H5微信直连H5支付 T_APP微信APP支付 T_NATIVE微信正扫
string wx_data = "{\\\"sub_appid\\\":\\\"" + config.webXAppID + "\\\",\\\"sub_openid\\\":\\\"" + openid + "\\\"}";
string trans_amt = PayZSubTotal.ToString("f2");
string time_expire = dt.AddMinutes(10).ToString("yyyyMMddHHmmss");
string notify_url = config.webUrl + "/pay/hfpay_notify_url.aspx";
SortedDictionary<string, string> pay_dic = new SortedDictionary<string, string>();
pay_dic.Add("req_date", req_date);
pay_dic.Add("req_seq_id", req_seq_id);
pay_dic.Add("huifu_id", huifu_id);
pay_dic.Add("goods_desc", goods_desc);
pay_dic.Add("trade_type", trade_type);
pay_dic.Add("wx_data", wx_data);
pay_dic.Add("trans_amt", trans_amt);
pay_dic.Add("time_expire", time_expire);
pay_dic.Add("notify_url", notify_url);
string get_PaySign = Mtxfw.Utility.Interface_WxPay.BuildRequest0(pay_dic, config.hfpayPrivateKey);
string strq = "{";
strq += "\"sys_id\":\"" + sys_id + "\",";
strq += "\"product_id\":\"" + product_id + "\",";
strq += "\"data\":{";
strq += "\"req_date\":\"" + req_date + "\",";
strq += "\"req_seq_id\":\"" + req_seq_id + "\",";
strq += "\"huifu_id\":\"" + huifu_id + "\",";
strq += "\"goods_desc\":\"" + goods_desc + "\",";
strq += "\"trade_type\":\"" + trade_type + "\",";
strq += "\"wx_data\":\"" + wx_data + "\",";
strq += "\"trans_amt\":\"" + trans_amt + "\",";
strq += "\"time_expire\":\"" + time_expire + "\",";
strq += "\"notify_url\":\"" + notify_url + "\"";
strq += "}";
strq += ",\"sign\":\"" + get_PaySign + "\"";
strq += "}";
Mtxfw.Utility.Common.WriteHtml("/weixin/postData1.txt", strq);
string strResult = Mtxfw.Utility.Common.getPage2("https://api.huifu.com/v3/trade/payment/jspay", "", "utf-8", true, true, strq);
Mtxfw.Utility.Common.WriteHtml("/weixin/resData.txt", strResult);
huifuresult hr = (huifuresult)FromhuifuresultJson(strResult);
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", hr.ToString());
if (hr.data.resp_code == "00000100")
//如果是汇付
if (isHfPay == 1)
{
huifuresult2 hr0 = (huifuresult2)Fromhuifuresult2Json(strResult);
string pay_info = hr0.data.pay_info;
var zflx = "2";
hjpay_rc_Result hjrc_Result = (hjpay_rc_Result)Fromhjpay_rc_Result(pay_info);
data = "{\"status\":1,\"msg\":\"正在支付中...\",\"timeStamp\":\"" + hjrc_Result.timeStamp + "\",\"noncestr\":\"" + hjrc_Result.nonceStr + "\",\"zftype\":\"" + zflx + "\",\"ResultId\":\"" + hjrc_Result.timeStamp + "\",\"package\":\"" + hjrc_Result.package + "\",\"paySign\":\"" + hjrc_Result.paySign + "\",\"signType\":\"" + hjrc_Result.signType + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart2.txt", data);
b = false;
string sys_id = config.hfpaysys_id;
string product_id = config.hfpayproduct_id;
string req_date = dt.ToString("yyyyMMdd");
string req_seq_id = PayID;
string huifu_id = config.hfpayMerchantID;
string goods_desc = body;
string trade_type = "T_MINIAPP";//T_JSAPI: 微信公众号 T_MINIAPP: 微信小程序 A_JSAPI: 支付宝 A_NATIVE: 支付宝正扫 U_NATIVE: 银联正扫 U_JSAPI: 银联JS D_NATIVE: 数字人民币正扫 T_H5微信直连H5支付 T_APP微信APP支付 T_NATIVE微信正扫
string wx_data = "{\\\"sub_appid\\\":\\\"" + config.webXAppID + "\\\",\\\"sub_openid\\\":\\\"" + openid + "\\\"}";
string trans_amt = PayZSubTotal.ToString("f2");
string time_expire = dt.AddMinutes(10).ToString("yyyyMMddHHmmss");
string notify_url = config.webUrl + "/pay/hfpay_notify_url.aspx";
SortedDictionary<string, string> pay_dic = new SortedDictionary<string, string>();
pay_dic.Add("req_date", req_date);
pay_dic.Add("req_seq_id", req_seq_id);
pay_dic.Add("huifu_id", huifu_id);
pay_dic.Add("goods_desc", goods_desc);
pay_dic.Add("trade_type", trade_type);
pay_dic.Add("wx_data", wx_data);
pay_dic.Add("trans_amt", trans_amt);
pay_dic.Add("time_expire", time_expire);
pay_dic.Add("notify_url", notify_url);
string get_PaySign = Mtxfw.Utility.Interface_WxPay.BuildRequest0(pay_dic, config.hfpayPrivateKey);
string strq = "{";
strq += "\"sys_id\":\"" + sys_id + "\",";
strq += "\"product_id\":\"" + product_id + "\",";
strq += "\"data\":{";
strq += "\"req_date\":\"" + req_date + "\",";
strq += "\"req_seq_id\":\"" + req_seq_id + "\",";
strq += "\"huifu_id\":\"" + huifu_id + "\",";
strq += "\"goods_desc\":\"" + goods_desc + "\",";
strq += "\"trade_type\":\"" + trade_type + "\",";
strq += "\"wx_data\":\"" + wx_data + "\",";
strq += "\"trans_amt\":\"" + trans_amt + "\",";
strq += "\"time_expire\":\"" + time_expire + "\",";
strq += "\"notify_url\":\"" + notify_url + "\"";
strq += "}";
strq += ",\"sign\":\"" + get_PaySign + "\"";
strq += "}";
Mtxfw.Utility.Common.WriteHtml("/weixin/postData1.txt", strq);
string strResult = Mtxfw.Utility.Common.getPage2("https://api.huifu.com/v3/trade/payment/jspay", "", "utf-8", true, true, strq);
Mtxfw.Utility.Common.WriteHtml("/weixin/resData.txt", strResult);
huifuresult hr = (huifuresult)FromhuifuresultJson(strResult);
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", hr.ToString());
if (hr.data.resp_code == "00000100")
{
huifuresult2 hr0 = (huifuresult2)Fromhuifuresult2Json(strResult);
string pay_info = hr0.data.pay_info;
var zflx = "2";
hjpay_rc_Result hjrc_Result = (hjpay_rc_Result)Fromhjpay_rc_Result(pay_info);
data = "{\"status\":1,\"msg\":\"正在支付中...\",\"timeStamp\":\"" + hjrc_Result.timeStamp + "\",\"noncestr\":\"" + hjrc_Result.nonceStr + "\",\"zftype\":\"" + zflx + "\",\"ResultId\":\"" + hjrc_Result.timeStamp + "\",\"package\":\"" + hjrc_Result.package + "\",\"paySign\":\"" + hjrc_Result.paySign + "\",\"signType\":\"" + hjrc_Result.signType + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart2.txt", data);
b = false;
}
else
{
b = false;
data = "{\"status\":0,\"msg\":\"" + hr.data.resp_desc + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart3.txt", data);
}
}
else
else
{
b = false;
data = "{\"status\":0,\"msg\":\"" + hr.data.resp_desc + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart3.txt", data);
// ========================================
// 微信小程序支付 - 创建JSAPI支付订单
// 功能: 调用微信统一下单接口,获取小程序调起支付所需的参数
// ========================================
try
{
// 步骤1: 创建微信小程序支付类实例
// config参数包含: appid、商户号、密钥等配置信息
Mtxfw.Utility.MiniProgramPay miniPay = new Mtxfw.Utility.MiniProgramPay(config);
// 步骤2: 金额转换
// PayZSubTotal单位为元需转换为分(乘以100)
// 微信支付接口要求金额单位为分
int totalFee = (int)(PayZSubTotal * 100);
// 步骤3: 设置支付回调通知地址
// 支付成功后微信会向此地址发送异步通知
string notifyUrl = config.webUrl + "/pay/wxpaynotify_url.aspx";
// 步骤4: 调用创建JSAPI支付订单接口
// openid: 用户在小程序中的唯一标识
// PayID: 商户订单号,需保证唯一性
// totalFee: 订单金额,单位: 分
// body: 商品描述
// notifyUrl: 支付结果通知回调地址
Mtxfw.Utility.MiniProgramPayResult payResult = miniPay.CreateJsApiOrder(openid, PayID, totalFee, body, "", notifyUrl);
// 步骤5: 处理支付订单创建结果
if (payResult.Success)
{
// 创建成功,设置小程序调起支付所需的参数
// timeStamp: 时间戳自1970年以来的秒数
// nonceStr: 随机字符串,用于签名计算
// package: 订单详情格式为prepay_id=xxx
// paySign: 签名,用于安全校验
// signType: 签名类型固定为MD5
timestamp = payResult.TimeStamp;
nonceStr = payResult.NonceStr;
package = payResult.Package;
paySign = payResult.PaySign;
signType = payResult.SignType;
// 记录成功日志,便于问题排查
Mtxfw.Utility.Common.WriteHtml("/weixin/miniProgramPaySuccess.txt", miniPay.GetPayResultJson(payResult));
}
else
{
// 创建失败,返回错误信息给前端
b = false;
data = "{\"status\":0,\"msg\":\"" + payResult.Message + "\"}";
// 记录失败日志,包含错误码和错误描述
Mtxfw.Utility.Common.WriteHtml("/weixin/miniProgramPayError.txt", miniPay.GetPayResultJson(payResult));
}
}
catch (Exception exPay)
{
// 异常处理: 捕获并记录异常信息
b = false;
data = "{\"status\":0,\"msg\":\"支付创建失败\"}";
// 记录异常详情到日志文件
Mtxfw.Utility.Common.WriteHtml("/weixin/miniProgramPayException.txt", exPay.ToString());
// 记录错误日志到数据库,便于后续排查
Model.User_Errlog errLog = new Model.User_Errlog();
errLog.DLID = 0;
errLog.ErrType = "微信小程序支付异常";
errLog.addtime = DateTime.Now;
errLog.ErrBody = openid + "|" + PayID + "|" + PayZSubTotal; // 记录关键参数
errLog.ErrBody2 = exPay.ToString(); // 记录异常详情
new DAL.User_Errlog().Add(errLog);
}
}
// 使用HuifuPaymentService
/* Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", "3");
string sys_id = config.hfpaysys_id;