Files
yshop-pro-uniapp/unpackage/dist/build/h5/assets/root-shoppingCart-shoppingCart.cf8b709e.js

2 lines
9.5 KiB
JavaScript
Raw Normal View History

import{a as e,x as t,a1 as a,i as o,a2 as l,u as n,o as s,j as c,w as u,I as i,h as r,B as d,a3 as p,e as f,F as m,l as _,k as g,m as v,a4 as h,C as b,D as k,G as x,H as S,Q as y,z as j,a5 as C}from"./index-90c12cc1.js";import{_ as I,a as w}from"./uv-checkbox-group.b7d5b6f9.js";import{_ as N}from"./uv-icon.c815b875.js";import{_ as P}from"./card.908936ad.js";import{G as L}from"./Goods.94b8dae8.js";import{G}from"./good-attr-select.3f64fa6c.js";import{M as V}from"./index.4bde3b32.js";import{u as A,g as O,c as T,d as z,a as B}from"./cart.031a8a42.js";import{_ as D}from"./lodash.b1309c50.js";import{u as E}from"./useInterface.bd4f041a.js";import{a as R}from"./product.4783a646.js";import{E as U}from"./index.ed915e92.js";import{e as q}from"./images.cf3befb9.js";import{_ as F}from"./_plugin-vue_export-helper.1b428a4d.js";import{H}from"./index.0e2fd26a.js";import{R as M}from"./index.cf172dbd.js";import{u as W}from"./useScroll.50272fa4.js";import{R as Q}from"./index.b6529df5.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./index.d156dd8a.js";import"./utils.80a0ac72.js";import"./uv-image.b3f882de.js";import"./uv-loading-icon.ad70964c.js";import"./uv-loading-icon.vue_vue_type_style_index_0_scoped_bad0efbf_lang.de7e0d02.js";import"./space.af0e7a6e.js";import"./uv-button.8e862d87.js";import"./uv-button.vue_vue_type_style_index_0_scoped_bc0e850d_lang.79bfdc50.js";import"./index.188c29d6.js";import"./_commonjsHelpers.02d3be64.js";import"./usePage.8865205f.js";import"./index.867e23f4.js";import"./config.6730da78.js";const Y=[{label:"商品总价",field:"costPrice",prefix:"¥"},{label:"优惠",field:"couponPrice",prefix:"-¥"},{label:"运费",field:"storePostage",prefix:"¥"},{label:"总计",field:"totalPrice",prefix:"¥"}];function $(a){const{cartList:l,doGetCartList:s}=a,{toast:c}=E(),{push:u}=n(),i=e(!1),r=t((()=>i.value?"取消":"管理")),d=e([]),p=e(!1);const f=e(void 0);async function m(){if(o(d).length<=0)return f.value=void 0;const e=await T({cartId:o(d).join(","),orderType:1,useIntegral:!1});f.value=e.priceGroup}return{manage:i,manageStr:r,shoppingSelect:d,shoppingSelectAll:p,statisticsInfo:f,handleSingleSelect:async function(e){p.value=e.length===l.value.length,setTimeout((async()=>{await m()}),100)},handleSelectAll:async function(e){d.value=e?l.value.map((e=>e.id)):[],p.value=e,await m()},computeSelectInfoByShoppingSelect:m,openDelModal:function(e){if(o(d).length<=0)return c({title:"请勾选需要删除的商品"});o(e).show()},doDelete:async function(){await z({ids:d.value}),await s(),await async function(){d.value=[],p.value=!1,await m()}()},submitOrder:function(){if(o(d).length<=0)return c({title:"请勾选需要购买的商品"});u({url:"/pages/submitOrder/submitOrder"},{data:{cartId:d.value.toString()}})}}}function J(){const{toast:t}=E(),a=e(void 0),o=e(void 0),n=e(void 0),s=e(void 0);function c(){a.value=n.value=void 0}return{openProductItem:s,openSkuSkuId:o,openSkuProductId:a,handleOpenSkuSelect:async function(e,t){await(async e=>{s.value=await R(e)})({productId:e.productId}),o.value=e.productInfo.attrInfo.id,a.value=e.productId,n.value=e.id,await l((()=>{t.open(e.cartNum)}))},handleCloseSkuSelect:c,handleSubmitSkuSelect:async function(e,o,l,s,u){if(!a.value)return;const{store:i,num:r}=e;if(await B({id:n.value,productId:a.value,productAttrUnique:i.unique}),"function"==typeof s){const e=l.find((e=>e.id===n.value));await s({detail:{value:r}},e)}setTimeout((async()=>{await u(),t({title:"修改成功",icon:"success"}),c()}),400)}}}const K=F({__name:"CartEmpty",setup(e){const{pushToTab:t}=n();return(e,a)=>{const l=d;return s(),c(U,{iconSrc:o(q),padding:"220rpx 0 0 0"},{default:u((()=>[i(" 购物车里空空如也~ ")])),bottom:u((()=>[r(l,{class:"go-on-btn",onClick:a[0]||(a[0]=e=>o(t)({url:"/root/index/index"}))},{default:u((()=>[i(" 继续逛逛 ")])),_:1})])),_:1},8,["iconSrc"])}}},[["__scopeId","data-v-694748f4"]]),X=F({__name:"shoppingCart",setup(n){const T=e(),z=e(),{showEmpty:B,cartList:R,doGetCartList:U}=function(){const o=e(!1),l=e([]),n=t((()=>l.value.length<=0));asyn