Files
yshop-pro-uniapp/unpackage/dist/build/h5/assets/pages-selectRefundGood-selectRefundGood.fb8a0968.js

2 lines
5.4 KiB
JavaScript

import{_ as e}from"./uv-navbar.917fb540.js";import{a,as as t,O as l,o,j as r,w as s,u,G as c,h as i,i as n,e as f,k as d,F as _,m as p,z as v,I as m,l as g,H as x,B as b}from"./index-90c12cc1.js";import{_ as I,a as P}from"./uv-checkbox-group.b7d5b6f9.js";import{_ as h}from"./card.908936ad.js";import{_ as k}from"./space.af0e7a6e.js";import{_ as j}from"./layout.e3de63ac.js";import{k as y}from"./order.190c4706.js";import{G as w}from"./Goods.94b8dae8.js";import{u as C}from"./useInterface.bd4f041a.js";import{_ as F}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.acda7a2c.js";/* empty css */import"./uv-icon.c815b875.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./uv-navbar.vue_vue_type_style_index_0_scoped_4c301e25_lang.553ed1e6.js";/* empty css */import"./index.d156dd8a.js";import"./images.cf3befb9.js";import"./utils.80a0ac72.js";const N=[{label:"支付总价",field:"truePrice",prefix:"¥"},{label:"优惠",field:"couponPrice",prefix:"-¥"},{label:"运费",field:"postagePrice",prefix:"¥"},{label:"积分",field:"integral",prefix:"-"},{label:"总计",field:"totalPrice",prefix:"¥"}],G=F({__name:"selectRefundGood",setup(F){const{toast:G}=C(),{getParams:U,push:q,goBack:A}=u(),L=a([]),V=a(!1),z=a(null),B=a(null),E=a(null),T=a(0);a(!0);const W=a({truePrice:0,couponPrice:0,postagePrice:0,totalPrice:0,integral:0}),D=e=>{V.value=e,V.value?L.value=M.value.map((e=>e.cartInfo.productAttrUnique)):L.value=[]},H=e=>{V.value=e.length===M.value.length};t(L,(e=>{W.value={truePrice:0,couponPrice:0,postagePrice:0,totalPrice:0,integral:0};let a=0;M.value.filter((a=>e.includes(a.cartInfo.productAttrUnique))).forEach((e=>{W.value.truePrice+=e.cartInfo.truePrice*e.cartInfo.cartNum,W.value.integral+=e.refundableIntegral*e.cartInfo.cartNum,W.value.couponPrice+=e.totalCouponPrice*e.cartInfo.cartNum,a+=e.cartInfo.postagePrice,W.value.totalPrice+=e.refundablePrice*e.cartInfo.cartNum})),0===T.value&&(W.value.postagePrice=a,W.value.totalPrice+=W.value.postagePrice)}));const M=a([]),O=async e=>{L.value.length<=0||(E.value=e,q({url:"/pages/refund/refund"},{data:{refundType:E.value,goods:L.value.toString(),orderId:z.value,id:B.value},type:"redirectTo"}))};return l((e=>{const a=U(e);B.value=a.id,(async()=>{try{const e=await y({key:B.value});M.value=e,z.value=e[0].orderId,T.value=e[0].status}catch(e){"订单明细不存在!"===e.msg&&(G({title:"该笔订单已无商品可以售后"}),A({},2e3))}})()})),(a,t)=>{const l=c(x("uv-navbar"),e),u=c(x("uv-checkbox"),I),y=b,C=c(x("card"),h),F=c(x("space"),k),G=c(x("uv-checkbox-group"),P),U=c(x("layout"),j);return o(),r(U,null,{default:s((()=>[i(l,{fixed:!1,title:"选择商品","left-arrow":"",onLeftClick:n(A)},null,8,["onLeftClick"]),M.value?(o(),r(G,{key:0,modelValue:L.value,"onUpdate:modelValue":t[0]||(t[0]=e=>L.value=e),shape:"circle",activeColor:"#ec6e47",onChange:H},{default:s((()=>[i(F,{direction:"vertical",fill:""},{default:s((()=>[i(C,{class:"shopping-checkbox"},{default:s((()=>[(o(!0),f(_,null,d(M.value,((e,a)=>(o(),r(y,{key:e.id,class:"goods-row"},{default:s((()=>[i(u,{name:e.cartInfo.productAttrUnique},null,8,["name"]),i(y,{class:"goods-col"},{default:s((()=>[i(w,{row:"",imgWidth:"200rpx","info-padding":"10rpx 40rpx",goods:e.cartInfo.productInfo},{options:s((()=>[i(y,{class:"goods-options"},{default:s((()=>[i(y,{class:"sku-row flex"},{default:s((()=>[i(y,{class:"sku-info flex flex-jc__sb flex-ai__center"},{default:s((()=>[i(y,{class:"info"},{default:s((()=>[m(g(e.cartInfo.productInfo&&e.cartInfo.productInfo.attrInfo&&e.cartInfo.productInfo.attrInfo.sku),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),i(y,{class:"price-row flex flex-ai__center flex-jc__sb"},{default:s((()=>[i(y,{class:"price-box flex flex-ai__end"},{default:s((()=>[m(" ¥"+g(e.cartInfo.truePrice),1)])),_:2},1024),i(y,{class:"cart-num"},{default:s((()=>[m(" x "+g(e.cartInfo.cartNum),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["goods"])])),_:2},1024)])),_:2},1024)))),128)),i(y,{class:p({"select-product-settle-info":!0,show:L.value.length>0})},{default:s((()=>[(o(!0),f(_,null,d(n(N),((e,a)=>(o(),r(y,{class:"row flex flex-ai__center flex-jc__sb",key:a},{default:s((()=>[i(y,{class:"label"},{default:s((()=>[m(g(e.label),1)])),_:2},1024),W.value?(o(),r(y,{key:0},{default:s((()=>[m(g(e.prefix)+" "+g(W.value[e.field].toFixed(2)),1)])),_:2},1024)):v("",!0)])),_:2},1024)))),128))])),_:1},8,["class"])])),_:1})])),_:1})])),_:1},8,["modelValue"])):v("",!0),i(y,{class:"action-bar column"},{default:s((()=>[i(y,{class:"action-info"},{default:s((()=>[i(y,{class:"action-checkbox"},{default:s((()=>[i(G,{shape:"circle",activeColor:"#ec6e47"},{default:s((()=>[i(u,{name:"all",checked:V.value,onChange:D},{default:s((()=>[m(" 全选 ")])),_:1},8,["checked"])])),_:1})])),_:1}),i(y,{class:"action-total"},{default:s((()=>[m(g(L.value.length)+" 件商品 ",1)])),_:1}),i(y,{class:"action-total"},{default:s((()=>[m(" 总计:¥"+g(W.value.totalPrice.toFixed(2))+" 积分:"+g(W.value.integral.toFixed(2)),1)])),_:1})])),_:1}),i(y,{class:"action-btns"},{default:s((()=>[i(y,{class:"button only-button",onClick:t[1]||(t[1]=e=>O(0))},{default:s((()=>[m(" 仅退款 ")])),_:1}),0!==T.value&&5!==T.value?(o(),r(y,{key:0,class:"button",onClick:t[2]||(t[2]=e=>O(1))},{default:s((()=>[m(" 退货退款 ")])),_:1})):v("",!0)])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-a44f0421"]]);export{G as default};