Files
shangbangbang/uniapp/unpackage/dist/build/web/static/js/pages-payment-purchase.86bc2862.js
T
solosw 99b11b04e4 1.0
2026-01-05 14:11:34 +08:00

1 line
18 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-payment-purchase"],{38408:function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return n}));var n={uniIcons:a("f01b").default},i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",{staticClass:"container"},[a("v-uni-view",{staticClass:"page-header"},[a("v-uni-text",{staticClass:"page-title"},[e._v("确认付款")])],1),a("v-uni-view",{staticClass:"order-section"},[a("v-uni-view",{staticClass:"section-title"},[e._v("订单信息")]),a("v-uni-view",{staticClass:"order-item"},[e.productInfo.image?a("v-uni-image",{staticClass:"product-image",attrs:{src:e.getFullImageUrl(e.productInfo.image),mode:"aspectFill"}}):e._e(),a("v-uni-view",{staticClass:"product-details"},[a("v-uni-text",{staticClass:"product-name"},[e._v(e._s(e.productInfo.name))]),a("v-uni-view",{staticClass:"product-price-info"},[a("v-uni-text",{staticClass:"unit-price"},[e._v("单价:¥"+e._s(e.orderInfo.unit_price))]),a("v-uni-text",{staticClass:"quantity"},[e._v("数量:"+e._s(e.orderInfo.quantity))])],1)],1)],1),a("v-uni-view",{staticClass:"total-amount"},[a("v-uni-text",{staticClass:"total-label"},[e._v("总金额:")]),a("v-uni-text",{staticClass:"total-price"},[e._v("¥"+e._s(e.orderInfo.total_amount))])],1)],1),a("v-uni-view",{staticClass:"address-section"},[a("v-uni-view",{staticClass:"section-title"},[e._v("收货地址")]),a("v-uni-view",{staticClass:"address-selector",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.selectAddress.apply(void 0,arguments)}}},[e.selectedAddress?a("v-uni-view",{staticClass:"address-content"},[a("v-uni-view",{staticClass:"address-info"},[a("v-uni-text",{staticClass:"consignee"},[e._v(e._s(e.selectedAddress.consignee_name))]),a("v-uni-text",{staticClass:"phone"},[e._v(e._s(e.selectedAddress.consignee_phone))])],1),a("v-uni-text",{staticClass:"address-detail"},[e._v(e._s(e.formatAddress(e.selectedAddress)))])],1):a("v-uni-view",{staticClass:"no-address"},[a("v-uni-text",{staticClass:"no-address-text"},[e._v("请选择收货地址")])],1),a("uni-icons",{attrs:{type:"right",size:"16",color:"#ccc"}})],1)],1),a("v-uni-view",{staticClass:"payment-section"},[a("v-uni-view",{staticClass:"section-title"},[e._v("请扫码付款")]),a("v-uni-view",{staticClass:"payment-qr-container"},[1===e.orderInfo.product_type?a("v-uni-view",{staticClass:"qr-section"},[a("v-uni-view",{staticClass:"qr-title"},[a("v-uni-text",{staticClass:"qr-label"},[e._v("请扫描以下二维码付款")]),a("v-uni-text",{staticClass:"qr-subtitle"},[e._v("官方收款账户")])],1),a("v-uni-view",{staticClass:"qr-code-wrapper"},[e.adminPaymentQr.main?a("v-uni-image",{staticClass:"qr-code",attrs:{src:e.getFullImageUrl(e.adminPaymentQr.main),mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewQrCode(e.adminPaymentQr.main)}}}):a("v-uni-view",{staticClass:"qr-placeholder"},[a("v-uni-text",{staticClass:"placeholder-text"},[e._v("暂无付款码")])],1)],1),e.adminPaymentQr.sub?a("v-uni-view",{staticClass:"backup-qr"},[a("v-uni-text",{staticClass:"backup-label"},[e._v("备用付款码")]),a("v-uni-image",{staticClass:"backup-qr-image",attrs:{src:e.getFullImageUrl(e.adminPaymentQr.sub),mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewQrCode(e.adminPaymentQr.sub)}}})],1):e._e()],1):e._e(),2===e.orderInfo.product_type?a("v-uni-view",{staticClass:"qr-section"},[a("v-uni-view",{staticClass:"qr-title"},[a("v-uni-text",{staticClass:"qr-label"},[e._v("请扫描以下二维码付款")]),a("v-uni-text",{staticClass:"qr-subtitle"},[e._v("卖家收款账户")])],1),a("v-uni-view",{staticClass:"seller-info"},[e.sellerInfo.avatar?a("v-uni-image",{staticClass:"seller-avatar",attrs:{src:e.getFullImageUrl(e.sellerInfo.avatar),mode:"aspectFill"}}):a("v-uni-view",{staticClass:"seller-avatar-placeholder"},[a("uni-icons",{attrs:{type:"person",size:"30",color:"#ccc"}})],1),a("v-uni-view",{staticClass:"seller-details"},[a("v-uni-text",{staticClass:"seller-name"},[e._v(e._s(e.sellerInfo.customer_name||e.sellerInfo.real_name))]),a("v-uni-text",{staticClass:"seller-code"},[e._v("ID: "+e._s(e.sellerInfo.identity_code))])],1)],1),a("v-uni-view",{staticClass:"qr-code-wrapper"},[e.sellerPaymentQr.main?a("v-uni-image",{staticClass:"qr-code",attrs:{src:e.getFullImageUrl(e.sellerPaymentQr.main),mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewQrCode(e.sellerPaymentQr.main)}}}):a("v-uni-view",{staticClass:"qr-placeholder"},[a("v-uni-text",{staticClass:"placeholder-text"},[e._v("卖家暂未设置付款码")])],1)],1),e.sellerPaymentQr.sub?a("v-uni-view",{staticClass:"backup-qr"},[a("v-uni-text",{staticClass:"backup-label"},[e._v("备用付款码")]),a("v-uni-image",{staticClass:"backup-qr-image",attrs:{src:e.getFullImageUrl(e.sellerPaymentQr.sub),mode:"aspectFit"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.previewQrCode(e.sellerPaymentQr.sub)}}})],1):e._e()],1):e._e()],1)],1),a("v-uni-view",{staticClass:"upload-section"},[a("v-uni-view",{staticClass:"section-title"},[e._v("上传付款凭证")]),a("v-uni-view",{staticClass:"upload-container"},[a("v-uni-view",{staticClass:"upload-item",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.uploadPaymentProof.apply(void 0,arguments)}}},[e.paymentProofImage?a("v-uni-image",{staticClass:"proof-image",attrs:{src:e.getFullImageUrl(e.paymentProofImage),mode:"aspectFill"}}):a("v-uni-view",{staticClass:"upload-placeholder"},[a("uni-icons",{attrs:{type:"camera",size:"40",color:"#ccc"}}),a("v-uni-text",{staticClass:"upload-text"},[e._v("点击上传付款截图")])],1)],1),a("v-uni-view",{staticClass:"upload-tips"},[a("v-uni-text",{staticClass:"tip-text"},[e._v("请上传完整的付款截图,包含金额和时间信息")])],1)],1)],1),a("v-uni-view",{staticClass:"submit-section"},[a("v-uni-view",{staticClass:"action-buttons"},[e.canCancel?a("v-uni-button",{staticClass:"cancel-btn",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.cancelOrder.apply(void 0,arguments)}}},[e._v("取消订单")]):e._e(),a("v-uni-button",{staticClass:"submit-btn",attrs:{disabled:!e.canSubmit||e.submitting},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.submitOrder.apply(void 0,arguments)}}},[e.submitting?a("v-uni-text",[e._v("提交中...")]):a("v-uni-text",[e._v("提交付款凭证")])],1)],1)],1)],1)},s=[]},"6d50":function(e,t,a){"use strict";a.r(t);var n=a("8fc1"),i=a.n(n);for(var s in n)["default"].indexOf(s)<0&&function(e){a.d(t,e,(function(){return n[e]}))}(s);t["default"]=i.a},"6d76":function(e,t,a){"use strict";var n=a("9c46"),i=a.n(n);i.a},"857e":function(e,t,a){"use strict";a.r(t);var n=a("38408"),i=a("6d50");for(var s in i)["default"].indexOf(s)<0&&function(e){a.d(t,e,(function(){return i[e]}))}(s);a("6d76");var r=a("828b"),o=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,"611d1580",null,!1,n["a"],void 0);t["default"]=o.exports},"8fc1":function(e,t,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("7a76"),a("c9b5"),a("0c26"),a("c223");var i=n(a("2634")),s=n(a("2fdc")),r=n(a("95a3")),o={data:function(){return{orderId:"",orderNo:"",orderInfo:{},productInfo:{name:"",image:""},selectedAddress:null,adminPaymentQr:{main:"",sub:""},sellerInfo:{},sellerPaymentQr:{main:"",sub:""},paymentProofImage:"",submitting:!1,canCancel:!0,productType:1}},computed:{canSubmit:function(){return this.paymentProofImage&&!this.submitting}},onLoad:function(e){var t=uni.getStorageSync("token");if(t){if(this.orderId=e.order_id||"",this.orderNo=e.order_no||"","true"==e.is_second?this.productType=2:this.productType=1,!this.orderId)return uni.showToast({title:"订单信息有误",icon:"none"}),void setTimeout((function(){uni.navigateBack()}),1500);this.loadOrderData()}else uni.reLaunch({url:"/pages/login/login"})},methods:{getFullImageUrl:function(e){return r.default.getImageUrl(e)},loadOrderData:function(){var e=this;return(0,s.default)((0,i.default)().mark((function t(){var a;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.default.get("/back/user/orders/purchase?order_id=".concat(e.orderId));case 3:if(a=t.sent,!(a.success&&a.data.list&&a.data.list.length>0)){t.next=14;break}return e.orderInfo=a.data.list[0],e.selectedAddress=e.orderInfo.address,e.productInfo={name:e.orderInfo.product_name,image:e.getFirstImage(e.orderInfo.product_images)},0!==e.orderInfo.order_status&&(e.canCancel=!1),2===e.orderInfo.product_type&&e.orderInfo.seller_id&&(e.sellerInfo=e.orderInfo.seller),t.next=12,e.loadPaymentInfo();case 12:t.next=15;break;case 14:throw new Error("订单不存在");case 15:t.next=22;break;case 17:t.prev=17,t.t0=t["catch"](0),console.error("加载订单失败:",t.t0),uni.showToast({title:"加载订单失败",icon:"none"}),setTimeout((function(){uni.navigateBack()}),1500);case 22:case"end":return t.stop()}}),t,null,[[0,17]])})))()},getFirstImage:function(e){return e?"string"===typeof e?e.split(",")[0].trim():Array.isArray(e)&&e.length>0?e[0]:"":""},loadPaymentInfo:function(){var e=this;return(0,s.default)((0,i.default)().mark((function t(){var a,n;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,1!==e.orderInfo.product_type){t.next=8;break}return t.next=4,r.default.get("/back/admin/payment/info");case 4:a=t.sent,a.success&&(e.adminPaymentQr={main:a.data.main_payment_qr_image||"",sub:a.data.sub_payment_qr_image||""}),t.next=12;break;case 8:return t.next=10,r.default.get("/back/user/seller/".concat(e.orderInfo.seller_id,"/payment"));case 10:n=t.sent,n.success&&(e.sellerPaymentQr={main:n.data.main_payment_qr_image||"",sub:n.data.sub_payment_qr_image||""});case 12:t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](0),console.error("加载付款信息失败:",t.t0);case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))()},formatAddress:function(e){return e?"".concat(e.province," ").concat(e.city," ").concat(e.district," ").concat(e.detail_address):""},selectAddress:function(){uni.navigateTo({url:"/pages/address/select"})},previewQrCode:function(e){e&&uni.previewImage({urls:[this.getFullImageUrl(e)],current:0})},uploadPaymentProof:function(){var e=this;uni.chooseImage({count:1,sizeType:["compressed"],sourceType:["camera","album"],success:function(){var t=(0,s.default)((0,i.default)().mark((function t(a){var n;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=a.tempFilePaths[0],t.next=3,e.uploadImage(n);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),fail:function(e){console.error("选择图片失败:",e),uni.showToast({title:"选择图片失败",icon:"none"})}})},uploadImage:function(e){var t=this;return(0,s.default)((0,i.default)().mark((function a(){var n,s;return(0,i.default)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,uni.showLoading({title:"上传中...",mask:!0}),n=uni.getStorageSync("token"),a.next=5,r.default.upload("/back/upload",e,{token:n,name:"file"});case 5:if(s=a.sent,!s.success){a.next=11;break}t.paymentProofImage=s.data.url,uni.showToast({title:"上传成功",icon:"success"}),a.next=12;break;case 11:throw new Error(s.message||"上传失败");case 12:a.next=18;break;case 14:a.prev=14,a.t0=a["catch"](0),console.error("上传图片失败:",a.t0),uni.showToast({title:"上传失败",icon:"none"});case 18:return a.prev=18,uni.hideLoading(),a.finish(18);case 21:case"end":return a.stop()}}),a,null,[[0,14,18,21]])})))()},submitOrder:function(){var e=this;return(0,s.default)((0,i.default)().mark((function t(){var a;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.canSubmit){t.next=3;break}return e.paymentProofImage||uni.showToast({title:"请上传付款凭证",icon:"none"}),t.abrupt("return");case 3:return e.submitting=!0,t.prev=4,t.next=7,r.default.put("/back/user/orders/purchase/".concat(e.orderId,"/payment"),{payment_proof_image:e.paymentProofImage,product_type:e.productType});case 7:if(a=t.sent,!a.success){t.next=13;break}uni.showToast({title:"付款凭证提交成功",icon:"success"}),setTimeout((function(){uni.redirectTo({url:"/pages/orders/orders"})}),1500),t.next=14;break;case 13:throw new Error(a.message||"提交付款凭证失败");case 14:t.next=20;break;case 16:t.prev=16,t.t0=t["catch"](4),console.error("提交付款凭证失败:",t.t0),uni.showToast({title:t.t0.message||"提交失败",icon:"none"});case 20:return t.prev=20,e.submitting=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[4,16,20,23]])})))()},cancelOrder:function(){var e=this;return(0,s.default)((0,i.default)().mark((function t(){return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:uni.showModal({title:"确认取消",content:"确定要取消这个订单吗?",success:function(){var t=(0,s.default)((0,i.default)().mark((function t(a){var n;return(0,i.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a.confirm){t.next=17;break}return t.prev=1,t.next=4,r.default.put("/back/user/orders/purchase/".concat(e.orderId,"/cancel"));case 4:if(n=t.sent,!n.success){t.next=10;break}uni.showToast({title:"订单已取消",icon:"success"}),setTimeout((function(){uni.navigateBack()}),1500),t.next=11;break;case 10:throw new Error(n.message||"取消订单失败");case 11:t.next=17;break;case 13:t.prev=13,t.t0=t["catch"](1),console.error("取消订单失败:",t.t0),uni.showToast({title:t.t0.message||"取消失败",icon:"none"});case 17:case"end":return t.stop()}}),t,null,[[1,13]])})));return function(e){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})))()}}};t.default=o},"9c46":function(e,t,a){var n=a("cc6c");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var i=a("967d").default;i("13b1aab2",n,!0,{sourceMap:!1,shadowMode:!1})},cc6c:function(e,t,a){var n=a("c86c");t=n(!1),t.push([e.i,".container[data-v-611d1580]{background-color:#f5f5f5;min-height:100vh;padding-bottom:%?120?%}.page-header[data-v-611d1580]{background:#fff;padding:%?30?%;text-align:center;border-bottom:%?1?% solid #eee}.page-title[data-v-611d1580]{font-size:%?36?%;font-weight:700;color:#333}.order-section[data-v-611d1580],\n.address-section[data-v-611d1580],\n.payment-section[data-v-611d1580],\n.upload-section[data-v-611d1580]{background:#fff;margin:%?20?%;border-radius:%?20?%;padding:%?30?%}.section-title[data-v-611d1580]{font-size:%?30?%;font-weight:700;color:#333;margin-bottom:%?20?%}.order-item[data-v-611d1580]{display:flex;align-items:center;margin-bottom:%?20?%}.product-image[data-v-611d1580]{width:%?120?%;height:%?120?%;border-radius:%?10?%;margin-right:%?20?%}.product-details[data-v-611d1580]{flex:1}.product-name[data-v-611d1580]{font-size:%?28?%;color:#333;font-weight:700;display:block;margin-bottom:%?10?%}.product-price-info[data-v-611d1580]{display:flex;gap:%?20?%}.unit-price[data-v-611d1580],\n.quantity[data-v-611d1580]{font-size:%?24?%;color:#666}.total-amount[data-v-611d1580]{display:flex;justify-content:space-between;align-items:center;padding-top:%?20?%;border-top:%?1?% solid #eee}.total-label[data-v-611d1580]{font-size:%?28?%;color:#333}.total-price[data-v-611d1580]{font-size:%?36?%;color:#f44;font-weight:700}.address-selector[data-v-611d1580]{display:flex;align-items:center;justify-content:space-between;padding:%?20?%;background:#f8f8f8;border-radius:%?15?%;min-height:%?100?%}.address-content[data-v-611d1580]{flex:1}.address-info[data-v-611d1580]{display:flex;gap:%?20?%;margin-bottom:%?8?%}.consignee[data-v-611d1580]{font-size:%?28?%;color:#333;font-weight:700}.phone[data-v-611d1580]{font-size:%?28?%;color:#666}.address-detail[data-v-611d1580]{font-size:%?26?%;color:#666;line-height:1.4}.no-address[data-v-611d1580]{flex:1;text-align:center}.no-address-text[data-v-611d1580]{font-size:%?28?%;color:#999}.payment-qr-container[data-v-611d1580]{text-align:center}.qr-section[data-v-611d1580]{margin-bottom:%?30?%}.qr-title[data-v-611d1580]{margin-bottom:%?20?%}.qr-label[data-v-611d1580]{font-size:%?28?%;color:#333;display:block;margin-bottom:%?8?%}.qr-subtitle[data-v-611d1580]{font-size:%?24?%;color:#666}.seller-info[data-v-611d1580]{display:flex;align-items:center;justify-content:center;margin-bottom:%?20?%;padding:%?15?%;background:#f8f8f8;border-radius:%?15?%}.seller-avatar[data-v-611d1580]{width:%?60?%;height:%?60?%;border-radius:%?30?%;margin-right:%?15?%}.seller-avatar-placeholder[data-v-611d1580]{width:%?60?%;height:%?60?%;border-radius:%?30?%;background:#e5e5e5;display:flex;align-items:center;justify-content:center;margin-right:%?15?%}.seller-details[data-v-611d1580]{text-align:left}.seller-name[data-v-611d1580]{font-size:%?26?%;color:#333;font-weight:700;display:block;margin-bottom:%?5?%}.seller-code[data-v-611d1580]{font-size:%?22?%;color:#666}.qr-code-wrapper[data-v-611d1580]{display:flex;justify-content:center;margin-bottom:%?20?%}.qr-code[data-v-611d1580]{width:%?400?%;height:%?400?%;border:%?2?% solid #eee;border-radius:%?15?%}.qr-placeholder[data-v-611d1580]{width:%?400?%;height:%?400?%;border:%?2?% dashed #ddd;border-radius:%?15?%;display:flex;align-items:center;justify-content:center}.placeholder-text[data-v-611d1580]{font-size:%?26?%;color:#999}.backup-qr[data-v-611d1580]{margin-top:%?20?%}.backup-label[data-v-611d1580]{font-size:%?24?%;color:#666;display:block;margin-bottom:%?10?%}.backup-qr-image[data-v-611d1580]{width:%?200?%;height:%?200?%;border:%?1?% solid #eee;border-radius:%?10?%}.upload-container[data-v-611d1580]{text-align:center}.upload-item[data-v-611d1580]{width:%?400?%;height:%?300?%;margin:0 auto %?20?%;border:%?2?% dashed #ddd;border-radius:%?15?%;display:flex;align-items:center;justify-content:center;overflow:hidden}.proof-image[data-v-611d1580]{width:100%;height:100%}.upload-placeholder[data-v-611d1580]{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#ccc}.upload-text[data-v-611d1580]{font-size:%?26?%;color:#999;margin-top:%?15?%}.upload-tips[data-v-611d1580]{margin-top:%?10?%}.tip-text[data-v-611d1580]{font-size:%?24?%;color:#666;line-height:1.4}.submit-section[data-v-611d1580]{padding:%?40?% %?30?%}.action-buttons[data-v-611d1580]{display:flex;gap:%?20?%}.cancel-btn[data-v-611d1580]{flex:1;height:%?80?%;background:#f5f5f5;border:%?1?% solid #ddd;border-radius:%?40?%;color:#666;font-size:%?32?%;font-weight:700;display:flex;align-items:center;justify-content:center}.submit-btn[data-v-611d1580]{flex:2;height:%?80?%;background:linear-gradient(135deg,#f44,#f66);border:none;border-radius:%?40?%;color:#fff;font-size:%?32?%;font-weight:700;display:flex;align-items:center;justify-content:center}.submit-btn[data-v-611d1580]:disabled{background:#ccc}",""]),e.exports=t}}]);