Files
PropertyDeployment/resources/Web/WechatOwnerService/html/static/js/pages-appointment-appointmentPay.a826ea6d.js
2025-12-09 22:41:31 +08:00

1 line
32 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-appointment-appointmentPay"],{"1fde":function(e,t,o){"use strict";o.r(t);var a=o("d398"),i=o("9307");for(var n in i)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return i[e]}))}(n);o("bcc6");var s=o("828b"),c=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"d2e1d348",null,!1,a["a"],void 0);t["default"]=c.exports},2803:function(e,t,o){"use strict";o.r(t);var a=o("d7ae"),i=o("592b");for(var n in i)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return i[e]}))}(n);o("b372");var s=o("828b"),c=Object(s["a"])(i["default"],a["b"],a["c"],!1,null,"ffe06bc0",null,!1,a["a"],void 0);t["default"]=c.exports},"374b":function(e,t,o){"use strict";o("6a54");var a=o("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.getBetweenTime=function(e,t){var o=+e.split(":")[0],a=+t.split(":")[0],i=[];while(o<=a){var n=o>=10?"".concat(o,":00"):"0".concat(o,":00");i.push(n),o+=1}return i},t.getBookingList=function(e){return new Promise((function(t,o){(0,i.requestNoAuth)({url:n.default.querySpacePerson,method:"GET",data:e,success:function(e){if(200!=e.statusCode)o();else{var a=e.data;t(a)}},fail:function(e){o(e)}})}))},t.getChangGuan=function(e){return new Promise((function(t,o){(0,i.requestNoAuth)({url:n.default.queryChangGuan,method:"GET",data:e,success:function(e){if(200!=e.statusCode);else{var o=e.data;t(o)}},fail:function(e){wx.showToast({title:"服务器异常了",icon:"none",duration:2e3})}})}))},t.getChangdi=function(e){return new Promise((function(t,o){(0,i.requestNoAuth)({url:n.default.queryChangDi,method:"GET",data:e,success:function(e){if(200!=e.statusCode)o();else{var a=e.data;t(a)}},fail:function(e){o(e)}})}))},t.getCommunitySpacePriceRule=function(e){return new Promise((function(t,o){(0,i.requestNoAuth)({url:n.default.queryCommunitySpacePriceRule,method:"GET",data:e,success:function(e){if(200!=e.statusCode);else{var o=e.data;t(o)}},fail:function(e){wx.showToast({title:"查询价格规则失败",icon:"none",duration:2e3})}})}))},t.getCommunitySpacePriceRules=function(e){return new Promise((function(t,o){(0,i.requestNoAuth)({url:n.default.queryCommunitySpacePriceRules,method:"GET",data:e,success:function(e){if(200!=e.statusCode);else{var o=e.data;t(o)}},fail:function(e){wx.showToast({title:"批量查询价格规则失败",icon:"none",duration:2e3})}})}))},o("aa9c"),o("bf0f");var i=o("a7bc"),n=a(o("79d4"));a(o("d5d0")),a(o("bce4"))},"469d":function(e,t,o){"use strict";o("6a54");var a=o("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(o("2634")),n=a(o("2fdc"));o("bf0f"),o("2797"),o("c223"),o("64aa"),o("e838"),o("aa77"),o("4626"),o("5ac7"),o("8f71"),o("fd3c"),o("aa9c"),o("d4b5"),o("5c47"),o("2c10"),o("9db6");var s=a(o("d5d0")),c=o("1c9a"),l=o("b9a1"),r=o("374b"),u=a(o("79d4")),p=a(o("4a5f")),d=a(o("1fde")),f=(o("fcd3"),s.default.constant),h=(o("14e5"),{components:{vcDiscount:p.default,vcUserAccount:d.default},data:function(){return{bookparams:[],bookList:[],switchA:!1,totalMoney:0,canPay:"f",ownerInfo:[],link:"",appUserName:"",btnDisabled:!1,timeOrder:void 0,communityId:"",ruleType:"1001",courtTypeControl:"both",courtTypeIndex:0,courtTypeOptions:["全场","半场"],showPriceComparison:!0,fullPriceTotal:0,halfPriceTotal:0,priceRules:[],paymentOption:"abapay_khqr",paymentMethods:[{value:"abapay_khqr",label:this.$t("pages.appointment.appointmentPay.ABA支付"),icon:"/static/pay_images/abapay_khqr.png"},{value:"alipay",label:this.$t("pages.appointment.appointmentPay.支付宝"),icon:"/static/pay_images/alipay.png"},{value:"wechat",label:this.$t("pages.appointment.appointmentPay.微信支付"),icon:"/static/pay_images/wechat.png"},{value:"google_pay",label:"Google Pay",icon:"/static/pay_images/google_pay.png"},{value:"cards",label:this.$t("pages.appointment.appointmentPay.银行卡支付"),icon:"/static/pay_images/cards.png"}],pickerIndex:0}},onLoad:function(e){console.log("=== appointmentPay页面加载参数 ==="),console.log("原始options:",e),this.loadOwenrInfo(),s.default.onLoad(e),this.appId=uni.getStorageSync(f.mapping.W_APP_ID);var t=JSON.parse(e.fee);this.bookparams=t,this.bookList=JSON.parse(t.bookList),e.courtTypeControl?(this.courtTypeControl=e.courtTypeControl,console.log("从URL参数获取到场地类型控制策略:",this.courtTypeControl)):t.courtTypeControl?(this.courtTypeControl=t.courtTypeControl,console.log("从fee参数获取到场地类型控制策略:",this.courtTypeControl)):(console.log("未获取到场地类型控制策略,使用默认值"),this.courtTypeControl="both"),"full"===this.courtTypeControl?(this.ruleType="1001",this.courtTypeIndex=0,console.log("场地类型控制策略为full设置为全场courtTypeControl:",this.courtTypeControl)):(this.ruleType="1001",this.courtTypeIndex=0,console.log("场地类型控制策略为",this.courtTypeControl,",使用默认值全场")),this.communityId=(0,c.getCommunityId)(),console.log("预约支付页面加载参数:",{bookparams:this.bookparams,bookList:this.bookList,communityId:this.communityId,courtTypeControl:this.courtTypeControl}),this.bookparams.data&&this.bookparams.data.priceRules&&(this.priceRules=this.bookparams.data.priceRules,console.log("获取到价格规则数据:",this.priceRules)),this.calculateAllPrices(),this.fetchPricesFromAPI(),console.log("=== 检查所有场地的规则名称 ==="),this.bookList.forEach((function(e,t){console.log("场地 ".concat(t+1," - ").concat(e.changdiName,":"),{fullPriceRuleName:e.fullPriceRuleName||"未设置",halfPriceRuleName:e.halfPriceRuleName||"未设置"})})),Number(this.totalMoney).toFixed(2)==Number(this.bookparams.totalMoney).toFixed(2)&&(this.canPay="t")},onShow:function(){},methods:{onCourtTypeChange:function(e){var t=e.detail.value;console.log("=== 场地类型切换 ==="),console.log("切换前 - courtTypeIndex:",this.courtTypeIndex,"ruleType:",this.ruleType),this.courtTypeIndex=t,0===t?this.ruleType="1001":1===t&&(this.ruleType="2002"),console.log("切换后 - courtTypeIndex:",this.courtTypeIndex,"ruleType:",this.ruleType),this.calculateAllPrices()},calculateAllPrices:function(){if(console.log("=== 开始统一计算所有价格 ==="),this.bookList&&Array.isArray(this.bookList)){this.bookList.forEach((function(e,t){if((!e.fullPrice||"0"===e.fullPrice)&&(!e.halfPrice||"0"===e.halfPrice)&&e.cdMoney){var o=parseFloat(e.cdMoney);e.fullPrice=o.toFixed(2),e.halfPrice=(o/2).toFixed(2),console.log("为时间段 ".concat(t+1," 设置价格:"),{changdiName:e.changdiName,fullPrice:e.fullPrice,halfPrice:e.halfPrice,cdMoney:e.cdMoney})}}));var e=this.bookList.length;console.log("场地总数:",e);var t=0,o=0;e>0&&(t=parseFloat(this.bookList[0].fullPrice||"0"),o=parseFloat(this.bookList[0].halfPrice||"0"));var a=0,i=0,n=0;"1001"===this.ruleType?(a=t*e,i=a):(a=o*e,n=a),this.totalMoney=a.toFixed(2),this.fullPriceTotal=i.toFixed(2),this.halfPriceTotal=n.toFixed(2),console.log("统一计算完成,总价:",this.totalMoney,"全场总价:",this.fullPriceTotal,"半场总价:",this.halfPriceTotal),console.log("计算方式: 基准价格 × 场地数量",{"基准全场价格":t.toFixed(2),"基准半场价格":o.toFixed(2),"场地数量":e,"当前规则类型":"1001"===this.ruleType?"全场":"半场"})}else console.log("❌ bookList不存在或不是数组")},fetchPricesFromAPI:function(){var e=this;return(0,n.default)((0,i.default)().mark((function t(){var o,a,n,s,c,l,u,p;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,console.log("开始调用API获取价格信息..."),o={page:1,row:100,communityId:e.communityId,appointmentTime:e.bookparams.bookDate,venueId:e.bookparams.venueId},console.log("API请求参数:",o),t.next=6,(0,r.getChangdi)(o);case 6:a=t.sent,console.log("API响应:",a),a&&0===a.code&&a.data&&a.data.length>0?(n=new Date(e.bookparams.bookDate).getDay(),s=["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"],c=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],l=s[n],u=c[n],console.log("当前日期: ".concat(e.bookparams.bookDate,", 星期").concat(n,", ").concat(u)),a.data.forEach((function(t){var o=e.bookList.find((function(e){return e.spaceId===t.spaceId}));if(!o&&t.name&&(o=e.bookList.find((function(e){return e.changdiName===t.name}))),!o&&t.cdId&&(o=e.bookList.find((function(e){return e.cdId===t.cdId}))),o&&t.priceRules&&t.priceRules.length>0){var a=0,i=0;console.log("场地 ".concat(t.name||t.spaceId," 的价格规则:"),t.priceRules);var s=t.priceRules.find((function(e){var t=e.ruleName||"";return(t.includes(l)||t.includes(u))&&("1001"===e.ruleType||t.includes("全场"))})),c=t.priceRules.find((function(e){var t=e.ruleName||"";return(t.includes(l)||t.includes(u))&&("2002"===e.ruleType||t.includes("半场"))})),r=t.priceRules.find((function(e){var t=e.ruleName||"";return t.includes("统一全场")||"1001"===e.ruleType&&!t.includes("星期")&&!t.includes(l)})),p=t.priceRules.find((function(e){var t=e.ruleName||"";return t.includes("统一半场")||"2002"===e.ruleType&&!t.includes("星期")&&!t.includes(l)}));if(console.log("匹配到的规则:",{dayFullRule:s,dayHalfRule:c,uniformFullRule:r,uniformHalfRule:p}),s)a=parseFloat(s.price)||0,i=c?parseFloat(c.price)||0:a/2,console.log("使用星期规则: ".concat(s.ruleName||""," 全场价格: ").concat(a));else if(r)a=parseFloat(r.price)||0,i=p?parseFloat(p.price)||0:a/2,console.log("使用统一规则: ".concat(r.ruleName||""," 全场价格: ").concat(a));else{var d=0===n||6===n;a=d?parseFloat(t.fullPriceWeekend)||0:parseFloat(t.fullPriceWeekday)||0,i=d?parseFloat(t.halfPriceWeekend)||0:parseFloat(t.halfPriceWeekday)||0,console.log("使用默认价格: 全场价格: ".concat(a,", 半场价格: ").concat(i))}o.fullPrice=a.toFixed(2),o.halfPrice=i.toFixed(2),o.cdMoney="1001"===e.ruleType?a.toFixed(2):i.toFixed(2),o.fullPriceRuleName=s?s.ruleName:r?r.ruleName:"默认全场价格",o.halfPriceRuleName=c?c.ruleName:p?p.ruleName:"默认半场价格",console.log("更新场地 ".concat(o.changdiName," 价格信息:"),{spaceId:t.spaceId,name:t.name,fullPrice:o.fullPrice,halfPrice:o.halfPrice,currentPrice:o.cdMoney,fullPriceRuleName:o.fullPriceRuleName,halfPriceRuleName:o.halfPriceRuleName}),console.log("=== 场地 ".concat(o.changdiName," 规则名称设置完成 ===")),console.log("fullPriceRuleName:",o.fullPriceRuleName),console.log("halfPriceRuleName:",o.halfPriceRuleName)}else if(o&&(console.warn("场地 ".concat(o.changdiName," 没有找到价格规则")),void 0!==o.cdMoney&&null!==o.cdMoney)){var f=parseFloat(o.cdMoney);o.fullPrice||o.halfPrice?(console.log("场地 ".concat(o.changdiName," 已有价格信息,跳过计算:"),{fullPrice:o.fullPrice,halfPrice:o.halfPrice,cdMoney:o.cdMoney}),"1001"===e.ruleType?o.cdMoney=o.fullPrice||0:o.cdMoney=o.halfPrice||0):(o.fullPrice=f.toFixed(2),o.halfPrice=(f/2).toFixed(2),o.fullPriceRuleName="基于cdMoney计算的全场价格",o.halfPriceRuleName="基于cdMoney计算的半场价格",console.log("根据cdMoney计算场地 ".concat(o.changdiName," 价格:"),{fullPrice:o.fullPrice,halfPrice:o.halfPrice,cdMoney:o.cdMoney}))}})),p=e.bookList.filter((function(e){return!e.fullPrice&&!e.halfPrice})),p.length>0&&(console.warn("有 ".concat(p.length," 个场地未匹配到价格信息:"),p.map((function(e){return e.changdiName}))),p.forEach((function(e){if(void 0!==e.cdMoney&&null!==e.cdMoney){var t=parseFloat(e.cdMoney);e.fullPrice=t.toFixed(2),e.halfPrice=(t/2).toFixed(2),e.fullPriceRuleName="基于cdMoney计算的全场价格",e.halfPriceRuleName="基于cdMoney计算的半场价格",console.log("为未匹配场地 ".concat(e.changdiName," 设置价格:"),{fullPrice:e.fullPrice,halfPrice:e.halfPrice,cdMoney:e.cdMoney,fullPriceRuleName:e.fullPriceRuleName,halfPriceRuleName:e.halfPriceRuleName})}}))),console.log("=== 所有场地的最终价格信息 ==="),e.bookList.forEach((function(t){console.log("场地: ".concat(t.changdiName),{"全场价格":t.fullPrice,"半场价格":t.halfPrice,"当前选择价格":t.cdMoney,"规则类型":"1001"===e.ruleType?"全场":"半场","全场价格规则":t.fullPriceRuleName||"未设置","半场价格规则":t.halfPriceRuleName||"未设置"})})),e.calculateAllPrices(),console.log("价格信息更新完成")):console.warn("API响应中没有找到有效的价格信息"),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](0),console.error("调用API获取价格信息失败:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})))()},onPaymentChange:function(e){this.pickerIndex=e.detail.value,this.paymentOption=this.paymentMethods[this.pickerIndex].value},loadOwenrInfo:function(){var e=this;s.default.getOwner((function(t){console.log("用户信息"),console.log(t),e.ownerInfo=t}))},SwitchA:function(e){this.switchA=e.detail.value},HoursStr:function(e){var t=e+":00-"+(Number(e)+1)+":00";return t},onFeeMonthChange:function(e){console.log("选择包月套餐:",e),this.feeMonthIndex=e.detail.value,this.feeMonth=this.feeMonths[this.feeMonthIndex],this.calculateAllPrices()},onFeeMonthCancel:function(e){this.showFeeMonth=!1},_payWxApp:function(e){console.log("=== APP端开始处理支付费用 ==="),console.log("当前场地数量:",this.bookList.length),console.log("当前选择的场地类型:","1001"===this.ruleType?"全场":"半场");var t=this;if(this.calculateAllPrices(),console.log("统一价格计算完成,当前总价:",this.totalMoney),parseFloat(this.totalMoney)>0){wx.showLoading({title:t.$t("pages.appointment.appointmentPay.支付中")});for(var o=[],a=0;a<this.bookList.length;a++){var i=this.bookList[a].hours,n=this.bookList[a].spaceId,r=[],p=!1,d=parseFloat(this.bookList[a].fullPrice||"0"),f=parseFloat(this.bookList[a].halfPrice||"0"),h=0;h="1001"===this.ruleType?d:f,console.log("处理场地 ".concat(this.bookList[a].changdiName," 时间段 ").concat(i,":"),{fullPrice:d.toFixed(2),halfPrice:f.toFixed(2),finalPrice:h.toFixed(2),ruleType:this.ruleType,"时间段":this.HoursStr(i),"全场价格规则":this.bookList[a].fullPriceRuleName||"未设置","半场价格规则":this.bookList[a].halfPriceRuleName||"未设置"});for(var m=0;m<o.length;m++)if(n==o[m].spaceId){r=o[m].openTimes,p=!0;break}if(r.push({hours:i}),p){for(var y=0;y<o.length;y++)if(n==o[y].spaceId){o[y].openTimes=r,o[y].ruleType=this.ruleType,o[y].price=h.toFixed(2);var v="1001"===this.ruleType?this.bookList[a].fullPriceRuleName||"":this.bookList[a].halfPriceRuleName||"";console.log("更新场地 ".concat(this.bookList[a].changdiName," 获取规则名称:"),{ruleType:this.ruleType,fullPriceRuleName:this.bookList[a].fullPriceRuleName,halfPriceRuleName:this.bookList[a].halfPriceRuleName,"原始ruleName":v});var g=this.processRuleName(v);console.log('处理后的规则名称: "'.concat(g,'"')),o[y].ruleName=g;break}}else{var P="1001"===this.ruleType?this.bookList[a].fullPriceRuleName||"":this.bookList[a].halfPriceRuleName||"";console.log("场地 ".concat(this.bookList[a].changdiName," 获取规则名称:"),{ruleType:this.ruleType,fullPriceRuleName:this.bookList[a].fullPriceRuleName,halfPriceRuleName:this.bookList[a].halfPriceRuleName,"原始ruleName":P});var b=this.processRuleName(P);console.log('处理后的规则名称: "'.concat(b,'"')),o.push({spaceId:n,openTimes:r,ruleType:this.ruleType,price:h.toFixed(2),ruleName:b})}}var T={business:"venueReservation",tradeType:"APP",communityId:(0,c.getCommunityId)(),spaces:JSON.stringify(o),personName:(0,l.getUserName)(),personTel:(0,l.getUserTel)(),payWay:"4",paymentOption:this.paymentOption,rule_type:this.ruleType,ruleType:this.ruleType,courtTypeControl:this.courtTypeControl,state:"S",remark:"",appointmentTime:this.bookparams.bookDate,totalMoney:this.totalMoney};console.log("APP端支付请求数据:",T),console.log("使用的ruleType:",this.ruleType),console.log("spaces数据:",JSON.stringify(o)),console.log("=== APP端处理后的ruleName ==="),o.forEach((function(e,t){console.log("场地 ".concat(t+1," - spaceId: ").concat(e.spaceId,", ruleName: ").concat(e.ruleName,", ruleType: ").concat(e.ruleType))})),s.default.request({url:u.default.unifiedPayment,header:s.default.getHeaders(),method:"POST",data:T,success:function(e){if(console.log("APP端支付接口返回状态码:",e.statusCode),console.log("APP端支付接口返回数据:",e.data),wx.hideLoading(),200===e.statusCode)if("0"===e.data.code){console.log("APP端支付成功准备调用支付"),t.saveOrderToLocalStorage(e.data);var o;e.data;o=JSON.stringify({}),uni.requestPayment({provider:"wxpay",orderInfo:o,success:function(e){uni.showToast({title:t.$t("pages.appointment.appointmentPay.支付成功"),duration:2e3}),uni.reLaunch({url:"../../pages/appointment/myBoomList",fail:function(e){console.log(e)}})},fail:function(e){console.log("APP端支付失败:"+JSON.stringify(e)),wx.showToast({title:t.$t("pages.appointment.appointmentPay.支付失败"),icon:"none",duration:2e3})}})}else"100"===e.data.code?(console.log("APP端直接支付成功"),uni.showToast({title:t.$t("pages.appointment.appointmentPay.支付成功"),duration:2e3}),setTimeout((function(){uni.reLaunch({url:"../../pages/appointment/myBoomList",fail:function(e){console.log(e)}})}),2e3)):(console.error("APP端支付接口返回错误:",e.data),wx.showToast({title:e.data.msg||t.$t("pages.appointment.appointmentPay.支付失败"),icon:"none",duration:2e3}));else console.error("APP端支付接口HTTP错误:",e.statusCode),wx.showToast({title:t.$t("pages.appointment.appointmentPay.服务器异常")+" (".concat(e.statusCode,")"),icon:"none",duration:2e3})},fail:function(e){wx.hideLoading(),console.error("APP端支付请求失败:",e),wx.showToast({title:t.$t("pages.appointment.appointmentPay.服务器异常了"),icon:"none",duration:2e3})}})}else wx.showLoading({title:t.$t("pages.appointment.appointmentPay.支付失败")}),setTimeout((function(){wx.hideLoading()}),2e3)},onPayFee:function(){console.log("=== 开始处理支付费用 ==="),console.log("当前场地数量:",this.bookList.length),console.log("当前选择的场地类型:","1001"===this.ruleType?"全场":"半场"),this.btnDisabled=!0;var e=this;if(this.calculateAllPrices(),console.log("统一价格计算完成,当前总价:",this.totalMoney),parseFloat(this.totalMoney)>0){var t,o;wx.showLoading({title:e.$t("pages.appointment.appointmentPay.支付中")});for(var a=[],i=0;i<this.bookList.length;i++){var n=this.bookList[i].hours,r=this.bookList[i].spaceId,p=[],d=!1,f=parseFloat(this.bookList[i].fullPrice||"0"),h=parseFloat(this.bookList[i].halfPrice||"0"),m=0;m="1001"===this.ruleType?f:h,console.log("处理场地 ".concat(this.bookList[i].changdiName," 时间段 ").concat(n,":"),{fullPrice:f.toFixed(2),halfPrice:h.toFixed(2),finalPrice:m.toFixed(2),ruleType:this.ruleType,"时间段":this.HoursStr(n),"全场价格规则":this.bookList[i].fullPriceRuleName||"未设置","半场价格规则":this.bookList[i].halfPriceRuleName||"未设置"});for(var y=0;y<a.length;y++)if(r==a[y].spaceId){p=a[y].openTimes,d=!0;break}if(p.push({hours:n}),d){for(var v=0;v<a.length;v++)if(r==a[v].spaceId){a[v].openTimes=p,a[v].ruleType=this.ruleType,a[v].price=m.toFixed(2);var g="1001"===this.ruleType?this.bookList[i].fullPriceRuleName||"":this.bookList[i].halfPriceRuleName||"";console.log("更新场地 ".concat(this.bookList[i].changdiName," 获取规则名称:"),{ruleType:this.ruleType,fullPriceRuleName:this.bookList[i].fullPriceRuleName,halfPriceRuleName:this.bookList[i].halfPriceRuleName,"原始ruleName":g});var P=this.processRuleName(g);console.log('处理后的规则名称: "'.concat(P,'"')),a[v].ruleName=P;break}}else{var b="1001"===this.ruleType?this.bookList[i].fullPriceRuleName||"":this.bookList[i].halfPriceRuleName||"";console.log("场地 ".concat(this.bookList[i].changdiName," 获取规则名称:"),{ruleType:this.ruleType,fullPriceRuleName:this.bookList[i].fullPriceRuleName,halfPriceRuleName:this.bookList[i].halfPriceRuleName,"原始ruleName":b});var T=this.processRuleName(b);console.log('处理后的规则名称: "'.concat(T,'"')),a.push({spaceId:r,openTimes:p,ruleType:this.ruleType,price:m.toFixed(2),ruleName:T})}}var k={business:"venueReservation",tradeType:"JSAPI",communityId:(0,c.getCommunityId)(),spaces:JSON.stringify(a),personName:(0,l.getUserName)(),personTel:(0,l.getUserTel)(),payWay:"4",paymentOption:this.paymentOption,rule_type:this.ruleType,ruleType:this.ruleType,booking_type:this.ruleType,resourceid:(null===(t=this.bookList[0])||void 0===t?void 0:t.spaceId)||"",applicationData:JSON.stringify({appointmentTime:this.bookparams.bookDate,spaceId:(null===(o=this.bookList[0])||void 0===o?void 0:o.spaceId)||"",ruleType:this.ruleType}),courtTypeControl:this.courtTypeControl,state:"S",remark:"",appointmentTime:this.bookparams.bookDate,totalMoney:this.totalMoney};console.log("支付请求数据:",k),console.log("使用的ruleType:",this.ruleType),console.log("spaces数据:",JSON.stringify(a)),console.log("=== 处理后的ruleName ==="),a.forEach((function(e,t){console.log("场地 ".concat(t+1," - spaceId: ").concat(e.spaceId,", ruleName: ").concat(e.ruleName,", ruleType: ").concat(e.ruleType))})),s.default.request({url:u.default.unifiedPayment,header:s.default.getHeaders(),method:"POST",data:k,success:function(t){console.log("支付接口返回状态码:",t.statusCode),console.log("支付接口返回数据:",t.data),e.btnDisabled=!1,wx.hideLoading(),200===t.statusCode?"0"===t.data.code?(console.log("支付成功,准备跳转到收银台"),e.saveOrderToLocalStorage(t.data),uni._nativeNavigateTo({url:"/pages/fee/unifiedPaymentCashier?orderData=".concat(encodeURIComponent(JSON.stringify(t.data)),"&amount=").concat(e.totalMoney,"&timeOrder=").concat(Date.now())})):(console.error("支付接口返回错误:",t.data),wx.showToast({title:t.data.msg||e.$t("pages.appointment.appointmentPay.支付失败"),icon:"none",duration:2e3})):(console.error("支付接口HTTP错误:",t.statusCode),wx.showToast({title:e.$t("pages.appointment.appointmentPay.服务器异常")+" (".concat(t.statusCode,")"),icon:"none",duration:2e3}))},fail:function(t){e.btnDisabled=!1,wx.hideLoading(),console.error("支付请求失败:",t),wx.showToast({title:e.$t("pages.appointment.appointmentPay.网络错误"),icon:"none",duration:2e3})}})}else this.btnDisabled=!1,console.error("支付条件不满足,详细信息:",{totalMoney:this.totalMoney,totalMoneyFloat:parseFloat(this.totalMoney)}),wx.showToast({title:"支付金额必须大于0当前金额"+this.totalMoney,icon:"none",duration:3e3})},processRuleName:function(e){if(console.log("processRuleName 输入:",e),!e)return console.log("ruleName为空返回空字符串"),"";console.log("尝试匹配英文格式,输入字符串:",e);var t=e.match(/星期([A-Z]{3,})/);if(console.log("正则匹配结果:",t),t&&t[1])return console.log("匹配英文格式,返回:",t[1]),t[1];if(e.startsWith("星期")){var o=e.substring(0,3);return console.log("匹配中文格式,返回:",o),o}return console.log("未匹配任何格式,返回原值:",e),e},saveOrderToLocalStorage:function(e){var t=e.returnData,o=[];try{var a=uni.getStorageSync("order_list");a&&(o=a)}catch(i){console.log("无存储数据,使用默认空列表",i)}this.timeOrder=Date.now(),o.push({order_id:e.orderId,train_id:t.status.tran_id,qr_image:t.qrImage,abapayDeeplink:t.abapay_deeplink,money:this.totalMoney,des:this.$t("pages.appointment.appointmentPay.球场预约"),time:this.timeOrder,feeIds:void 0,ruleType:this.ruleType,courtTypeControl:this.courtTypeControl});try{uni.setStorageSync("order_list",o),console.log("列表存储成功")}catch(i){console.log("列表存储失败",i)}}}});t.default=h},"592b":function(e,t,o){"use strict";o.r(t);var a=o("469d"),i=o.n(a);for(var n in a)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return a[e]}))}(n);t["default"]=i.a},"67f4":function(e,t,o){var a=o("76cd");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var i=o("967d").default;i("b13dcf0e",a,!0,{sourceMap:!1,shadowMode:!1})},"76cd":function(e,t,o){var a=o("c86c");t=a(!1),t.push([e.i,".ppf_item[data-v-ffe06bc0]{padding:%?0?% %?0?% %?0?% %?0?%}.block__title[data-v-ffe06bc0]{margin:0;font-weight:400;font-size:14px;color:rgba(69,90,100,.6);padding:%?40?% %?30?% %?20?%}.button_up_blank[data-v-ffe06bc0]{height:%?40?%}.block__bottom[data-v-ffe06bc0]{height:%?180?%}.fee-last[data-v-ffe06bc0]{margin-bottom:%?200?%}.cu-btn.lgplus[data-v-ffe06bc0]{padding:0 20px;font-size:18px;height:%?100?%}.cu-btn.sharp[data-v-ffe06bc0]{border-radius:%?0?%}.line-height[data-v-ffe06bc0]{line-height:%?100?%}.icon-img[data-v-ffe06bc0]{width:%?48?%;height:%?48?%;border-radius:%?8?%;background-color:#f5f5f5;padding:%?6?%}.picker[data-v-ffe06bc0]{display:flex;align-items:center}.ml-2[data-v-ffe06bc0]{margin-left:%?12?%;font-size:%?28?%;color:#333}",""]),e.exports=t},9307:function(e,t,o){"use strict";o.r(t);var a=o("cd9a"),i=o.n(a);for(var n in a)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return a[e]}))}(n);t["default"]=i.a},"9d3f":function(e,t,o){var a=o("b0b7");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var i=o("967d").default;i("6f84205c",a,!0,{sourceMap:!1,shadowMode:!1})},b0b7:function(e,t,o){var a=o("c86c");t=a(!1),t.push([e.i,".block__title[data-v-d2e1d348]{margin:0;font-weight:400;font-size:14px;color:rgba(69,90,100,.6);padding:%?40?% %?30?% %?20?%}",""]),e.exports=t},b372:function(e,t,o){"use strict";var a=o("67f4"),i=o.n(a);i.a},bcc6:function(e,t,o){"use strict";var a=o("9d3f"),i=o.n(a);i.a},cd9a:function(e,t,o){"use strict";o("6a54");var a=o("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("bf0f"),o("2797"),o("4626"),o("5ac7"),o("e838"),o("aa9c");a(o("d5d0"));var i=o("b9a1"),n=(o("1c9a"),{components:{},data:function(){return{accounts:[],selectedAccounts:[]}},props:{},computed:{},watch:{selectedAccounts:function(e){var t=0,o=[];this.accounts.forEach((function(a){e.includes(a.acctId)&&("2004"==a.acctType?parseFloat(a.amount)>=parseFloat(a.maximumNumber)?(t+=parseFloat(a.maximumNumber/a.deductionProportion),o.push(a)):(t+=parseFloat(a.amount/a.deductionProportion),o.push(a)):(a.acctType,t+=parseFloat(a.amount),o.push(a)))})),this.$emit("getUserAmount",{totalUserAmount:t,selectedAccounts:o})}},methods:{checkboxChange:function(e){var t=e.detail.value;this.selectedAccounts=t,this.accounts.forEach((function(e,o){t.includes(e.acctId)&&(e.checked=!0)}))},_listOwnerAccount:function(e){var t=this;(0,i.queryOwnerAccount)({page:1,row:99,communityId:e,acctType:"2003"}).then((function(e){t.accounts=e||[]}))},_viewAccountDetail:function(e){}}});t.default=n},d398:function(e,t,o){"use strict";o.d(t,"b",(function(){return a})),o.d(t,"c",(function(){return i})),o.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("v-uni-view",[e.accounts.length>0?o("v-uni-view",[o("v-uni-view",{staticClass:"block__title"},[e._v(" "+e._s(e.$t("components.vc-user-account.vc-user-account.业主账户")))]),o("v-uni-checkbox-group",{on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.checkboxChange.apply(void 0,arguments)}}},e._l(e.accounts,(function(t,a){return o("v-uni-view",{key:a,staticClass:"cu-list menu",attrs:{"data-item":t},on:{click:function(o){arguments[0]=o=e.$handleEvent(o),e._viewAccountDetail(t)}}},[o("v-uni-view",{staticClass:"cu-item "},[o("v-uni-view",{staticClass:"content padding-tb-sm"},[o("v-uni-view",[o("v-uni-view",{staticClass:"text-cut",staticStyle:{width:"220px"}},[o("v-uni-checkbox",{attrs:{value:t.acctId,checked:t.checked}}),e._v(" "+e._s(e.$t("components.vc-user-account.vc-user-account."+t.acctTypeName))+" ")],1)],1)],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-text",{staticClass:"text-grey text-sm"},[e._v(" "+e._s(t.amount)+e._s("2004"==t.acctType?e.$t("components.vc-user-account.vc-user-account.分"):e.$t("components.vc-user-account.vc-user-account.元"))+" ")])],1)],1)],1)})),1)],1):e._e()],1)},i=[]},d7ae:function(e,t,o){"use strict";o.d(t,"b",(function(){return a})),o.d(t,"c",(function(){return i})),o.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("v-uni-view",[o("v-uni-scroll-view",{attrs:{"scroll-y":!0}},[o("v-uni-view",{staticClass:"block__title"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.订单信息")))]),o("v-uni-form",[o("v-uni-view",{staticClass:"cu-list menu"},[o("v-uni-view",{staticClass:"cu-item"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-b"},[e._v(e._s(e.bookparams.cgName))])],1)],1),o("v-uni-view",{staticClass:"cu-item"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-grey"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.预约日期")))])],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-text",{staticClass:"text-grey text-sm"},[e._v(e._s(e.bookparams.bookDate))])],1)],1)],1),"half"===e.courtTypeControl||"both"===e.courtTypeControl?o("v-uni-view",{staticClass:"block__title"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.场地类型")))]):e._e(),"half"===e.courtTypeControl||"both"===e.courtTypeControl?o("v-uni-view",{staticClass:"cu-list menu"},[o("v-uni-view",{staticClass:"cu-item arrow"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-grey"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.选择场地类型")))])],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-picker",{attrs:{value:e.courtTypeIndex,range:e.courtTypeOptions},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.onCourtTypeChange.apply(void 0,arguments)}}},[o("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.courtTypeOptions[e.courtTypeIndex])+" ")])],1)],1)],1)],1):e._e(),o("v-uni-view",{staticClass:"block__title"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.场地信息")))]),e._l(this.bookList,(function(t,a){return o("v-uni-view",{key:a,staticClass:"cu-list menu"},[o("v-uni-view",{staticClass:"cu-item"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-grey"},[e._v(e._s(t.changdiName))])],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-text",{staticClass:"text-grey text-sm"},[e._v(e._s(e.HoursStr(t.hours)))])],1)],1),"half"===e.courtTypeControl||"both"===e.courtTypeControl?o("v-uni-view",{staticClass:"cu-item"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-grey"},[e._v("价格")])],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-text",{staticClass:"text-grey text-sm"},[e._v(" "+e._s("1001"===e.ruleType?"全场":"半场")+": ¥"+e._s("1001"===e.ruleType?t.fullPrice||"0.00":t.halfPrice||"0.00")+" "),"1001"===e.ruleType&&t.fullPriceRuleName?o("v-uni-text",{staticClass:"text-grey text-xs"},[e._v("("+e._s(t.fullPriceRuleName)+")")]):e._e(),"2002"===e.ruleType&&t.halfPriceRuleName?o("v-uni-text",{staticClass:"text-grey text-xs"},[e._v("("+e._s(t.halfPriceRuleName)+")")]):e._e()],1)],1)],1):e._e()],1)}))],2),o("v-uni-view",{staticClass:"block__title"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.支付方式")))]),o("v-uni-view",{staticClass:"cu-list menu"},[o("v-uni-view",{staticClass:"cu-item arrow"},[o("v-uni-view",{staticClass:"content"},[o("v-uni-text",{staticClass:"text-grey"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.支付方式")))])],1),o("v-uni-view",{staticClass:"action"},[o("v-uni-picker",{attrs:{value:e.pickerIndex,range:e.paymentMethods.map((function(e){return e.label}))},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.onPaymentChange.apply(void 0,arguments)}}},[o("v-uni-view",{staticClass:"picker flex align-center"},[o("v-uni-image",{staticClass:"icon-img",attrs:{src:e.paymentMethods[e.pickerIndex].icon}}),o("v-uni-text",{staticClass:"ml-2"},[e._v(e._s(e.paymentMethods[e.pickerIndex].label))])],1)],1)],1)],1)],1)],1),o("v-uni-view",{staticClass:"bg-white border flex cu-form-group",staticStyle:{position:"fixed",width:"100%",bottom:"0"}},[o("v-uni-view",{staticClass:"title"},[e._v(e._s(e.$t("pages.appointment.appointmentPay.总计:"))+" "),o("v-uni-text",{staticClass:"solid-bottom text-xxl text-price text-red"},[e._v(e._s(e.totalMoney))])],1),o("v-uni-view",{staticClass:"btn-group"},[o("v-uni-button",{staticClass:"cu-btn round bg-blue",staticStyle:{"background-color":"#1cbbb4"},attrs:{disabled:this.btnDisabled},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.onPayFee()}}},[e._v(e._s(e.$t("pages.appointment.appointmentPay.提交订单"))+" ")])],1)],1)],1)},i=[]}}]);