1 |
- import{s as e,z as t,aH as s,A as o,o as a,f as l,g as i,w as n,aI as c,_ as d,m as u,k as p,u as r,v as f,i as g,l as m,r as _,F as x,ac as k,ad as S,G as y,E as I,H as b,I as h,j as L,J as M,K as w,L as C,n as j,x as v}from"./index-dbd18a2c.js";import{_ as $}from"./s-goods-item.8007dc00.js";import{a as A,_ as B}from"./s-layout.cc30b4d6.js";import{_ as G}from"./uni-load-more.6c799967.js";import{_ as z}from"./s-empty.09d63416.js";import{_ as H}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";import"./useGoods.12bde50a.js";/* empty css */import"./phone-international-input.18d32780.js";/* empty css */const N=H({__name:"goods-log",setup(H){b((e=>({"4d19dede":v(N)})));const N=e.$platform.navbar,T={list:[],pageNo:1,total:1,pageSize:10},F=t({pagination:s(T),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function E(){F.loadStatus="loading";const{code:e,data:t}=await c.getBrowseHistoryPage({pageNo:F.pagination.pageNo,pageSize:F.pagination.pageSize});0===e&&(F.pagination.list=d.concat(F.pagination.list,t.list),F.pagination.total=t.total,F.loadStatus=F.pagination.list.length<F.pagination.total?"more":"noMore")}const O=e=>{F.selectedSpuIdList.includes(e)?F.selectedSpuIdList.splice(F.selectedSpuIdList.indexOf(e),1):F.selectedSpuIdList.push(e),F.selectAll=F.selectedSpuIdList.length===F.pagination.list.length},J=()=>{F.selectAll=!F.selectAll,F.selectAll?F.pagination.list.forEach((e=>{F.selectedSpuIdList.includes(e.spuId)&&F.selectedSpuIdList.splice(F.selectedSpuIdList.indexOf(e.spuId),1),F.selectedSpuIdList.push(e.spuId)})):F.selectedSpuIdList=[]};async function K(){if(F.selectedSpuIdList.length<=0)return;const{code:e}=await c.deleteBrowseHistory(F.selectedSpuIdList);0===e&&U()}async function P(){const{code:e}=await c.cleanBrowseHistory();0===e&&U()}function U(){F.editMode=!1,F.selectedSpuIdList=[],F.selectAll=!1,F.pagination=T,E()}function W(){"noMore"!==F.loadStatus&&(F.pagination.pageNo+=1,E())}return o((()=>{W()})),a((()=>{E()})),(t,s)=>{const o=h,a=L,c=M,d=w,b=C,H=u(j("s-goods-item"),$),N=u(j("su-fixed"),A),T=u(j("uni-load-more"),G),E=u(j("s-empty"),z),U=u(j("s-layout"),B);return l(),i(U,{title:t.$t("common.delete_footprint"),bgStyle:{color:"#f2f2f2"}},{default:n((()=>[p(a,{class:"cart-box ss-flex ss-flex-col ss-row-between"},{default:n((()=>[p(a,{class:"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:n((()=>[p(a,{class:"header-left ss-flex ss-col-center ss-font-26"},{default:n((()=>[p(o,{class:"goods-number ui-TC-Main ss-flex"},{default:n((()=>[r(f(t.$t("common.total_goods",{number:F.pagination.total})),1)])),_:1})])),_:1}),p(a,{class:"header-right"},{default:n((()=>[F.editMode&&F.pagination.total?(l(),i(c,{key:0,class:"ss-reset-button",onClick:s[0]||(s[0]=e=>F.editMode=!1)},{default:n((()=>[r(f(t.$t("common.cancel")),1)])),_:1})):g("",!0),!F.editMode&&F.pagination.total?(l(),i(c,{key:1,class:"ss-reset-button ui-TC-Main",onClick:s[1]||(s[1]=e=>F.editMode=!0)},{default:n((()=>[r(f(t.$t("common.edit")),1)])),_:1})):g("",!0)])),_:1})])),_:1}),p(a,{class:"cart-content"},{default:n((()=>[(l(!0),m(x,null,_(F.pagination.list,(t=>(l(),i(a,{class:"goods-box ss-r-10 ss-m-b-14",key:t.id},{default:n((()=>[p(a,{class:"ss-flex ss-col-center"},{default:n((()=>[F.editMode?(l(),i(b,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:e=>O(t.spuId)},{default:n((()=>[p(d,{checked:F.selectedSpuIdList.includes(t.spuId),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:y((e=>O(t.spuId)),["stop"])},null,8,["checked","onClick"])])),_:2},1032,["onClick"])):g("",!0),p(H,{title:t.spuName,img:t.picUrl,price:t.price,skuText:t.introduction,priceColor:"#FF3000",titleWidth:400,onClick:s=>v(e).$router.go("/pages/goods/index",{id:t.spuId})},null,8,["title","img","price","skuText","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),k(p(N,{bottom:"",val:0,placeholder:""},{default:n((()=>[p(a,{class:"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"},{default:n((()=>[p(a,{class:"footer-left ss-flex ss-col-center"},{default:n((()=>[p(b,{class:"check-box ss-flex ss-col-center ss-p-r-30",onClick:J},{default:n((()=>[p(d,{checked:F.selectAll,color:"var(--ui-BG-Main)",style:{transform:"scale(0.7)"},onClick:y(J,["stop"])},null,8,["checked"]),p(a,null,{default:n((()=>[r(f(t.$t("common.select_all")),1)])),_:1})])),_:1})])),_:1}),p(a,{class:"footer-right ss-flex"},{default:n((()=>[p(c,{class:I(["ss-reset-button pay-btn ss-font-28 ",{"ui-BG-Main-Gradient":F.selectedSpuIdList.length>0,"ui-Shadow-Main":F.selectedSpuIdList.length>0}]),onClick:K},{default:n((()=>[r(f(t.$t("common.delete_footprint")),1)])),_:1},8,["class"]),p(c,{class:"ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main ml-2",onClick:P},{default:n((()=>[r(f(t.$t("common.clear")),1)])),_:1})])),_:1})])),_:1})])),_:1},512),[[S,F.editMode]])])),_:1}),F.pagination.total>0?(l(),i(T,{key:0,status:F.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:W},null,8,["status"])):g("",!0),0===F.pagination.total?(l(),i(E,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):g("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-03bbab35"]]);export{N as default};
|