1 |
- import{M as e,s as t,v as s,bO as o,m as a,o as l,a as i,b as n,d as c,w as d,u,bP as p,_ as r,e as _,f,g as m,j as g,z as y,x,y as b,F as h,af as k,ag as S,N as I,L as M,l as v,i as L,O as j,P as w,Q as C}from"./index-CRW3onsz.js";import{_ as $}from"./s-goods-item.Cu1mS14n.js";import{a as A,_ as B}from"./s-layout.DKC65HXL.js";import{_ as G}from"./uni-load-more.DqGEuLGm.js";import{_ as N}from"./s-empty.C6jDqfil.js";import{_ as z}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./useGoods.Dxoq0xk-.js";/* empty css */import"./s-menu-tools.CNNsOrh3.js";import"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.CiL8L9B_.js";import"./uni-icons.CkO1HN9g.js";import"./s-layout.vue_vue_type_style_index_0_scoped_c1143e8c_lang.HuwOimZj.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_0f0268ff_lang.Dctrwx6t.js";import"./s-search-block.9OtJrST_.js";import"./phone-international-input.vKvR7wTz.js";/* empty css */const O=z({__name:"goods-log",setup(z){e((e=>({"5b2ab681":u(O)})));const O=t.$platform.navbar,T={list:[],pageNo:1,total:1,pageSize:10},P=s({pagination:o(T),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function F(){P.loadStatus="loading";const{code:e,data:t}=await p.getBrowseHistoryPage({pageNo:P.pagination.pageNo,pageSize:P.pagination.pageSize});0===e&&(P.pagination.list=r.concat(P.pagination.list,t.list),P.pagination.total=t.total,P.loadStatus=P.pagination.list.length<P.pagination.total?"more":"noMore")}const H=e=>{P.selectedSpuIdList.includes(e)?P.selectedSpuIdList.splice(P.selectedSpuIdList.indexOf(e),1):P.selectedSpuIdList.push(e),P.selectAll=P.selectedSpuIdList.length===P.pagination.list.length},E=()=>{P.selectAll=!P.selectAll,P.selectAll?P.pagination.list.forEach((e=>{P.selectedSpuIdList.includes(e.spuId)&&P.selectedSpuIdList.splice(P.selectedSpuIdList.indexOf(e.spuId),1),P.selectedSpuIdList.push(e.spuId)})):P.selectedSpuIdList=[]};async function q(){if(P.selectedSpuIdList.length<=0)return;const{code:e}=await p.deleteBrowseHistory(P.selectedSpuIdList);0===e&&K()}async function J(){const{code:e}=await p.cleanBrowseHistory();0===e&&K()}function K(){P.editMode=!1,P.selectedSpuIdList=[],P.selectAll=!1,P.pagination=T,F()}function Q(){"noMore"!==P.loadStatus&&(P.pagination.pageNo+=1,F())}return a((()=>{Q()})),l((()=>{F()})),(e,s)=>{const o=v,a=L,l=j,p=w,r=C,z=i(n("s-goods-item"),$),O=i(n("su-fixed"),A),T=i(n("uni-load-more"),G),F=i(n("s-empty"),N),K=i(n("s-layout"),B);return _(),c(K,{title:e.$t("common.delete_footprint"),bgStyle:{color:"#f2f2f2"}},{default:d((()=>[f(a,{class:"cart-box ss-flex ss-flex-col ss-row-between"},{default:d((()=>[f(a,{class:"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:d((()=>[f(a,{class:"header-left ss-flex ss-col-center ss-font-26"},{default:d((()=>[f(o,{class:"goods-number ui-TC-Main ss-flex"},{default:d((()=>[m(g(e.$t("common.total_goods",{number:P.pagination.total})),1)])),_:1})])),_:1}),f(a,{class:"header-right"},{default:d((()=>[P.editMode&&P.pagination.total?(_(),c(l,{key:0,class:"ss-reset-button",onClick:s[0]||(s[0]=e=>P.editMode=!1)},{default:d((()=>[m(g(e.$t("common.cancel")),1)])),_:1})):y("",!0),!P.editMode&&P.pagination.total?(_(),c(l,{key:1,class:"ss-reset-button ui-TC-Main",onClick:s[1]||(s[1]=e=>P.editMode=!0)},{default:d((()=>[m(g(e.$t("common.edit")),1)])),_:1})):y("",!0)])),_:1})])),_:1}),f(a,{class:"cart-content"},{default:d((()=>[(_(!0),x(h,null,b(P.pagination.list,(e=>(_(),c(a,{class:"goods-box ss-r-10 ss-m-b-14",key:e.id},{default:d((()=>[f(a,{class:"ss-flex ss-col-center"},{default:d((()=>[P.editMode?(_(),c(r,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:t=>H(e.spuId)},{default:d((()=>[f(p,{checked:P.selectedSpuIdList.includes(e.spuId),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:I((t=>H(e.spuId)),["stop"])},null,8,["checked","onClick"])])),_:2},1032,["onClick"])):y("",!0),f(z,{title:e.spuName,img:e.picUrl,price:e.price,skuText:e.introduction,priceColor:"#FF3000",titleWidth:400,onClick:s=>u(t).$router.go("/pages/goods/index",{id:e.spuId})},null,8,["title","img","price","skuText","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),k(f(O,{bottom:"",val:0,placeholder:""},{default:d((()=>[f(a,{class:"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"},{default:d((()=>[f(a,{class:"footer-left ss-flex ss-col-center"},{default:d((()=>[f(r,{class:"check-box ss-flex ss-col-center ss-p-r-30",onClick:E},{default:d((()=>[f(p,{checked:P.selectAll,color:"var(--ui-BG-Main)",style:{transform:"scale(0.7)"},onClick:I(E,["stop"])},null,8,["checked"]),f(a,null,{default:d((()=>[m(g(e.$t("common.select_all")),1)])),_:1})])),_:1})])),_:1}),f(a,{class:"footer-right ss-flex"},{default:d((()=>[f(l,{class:M(["ss-reset-button pay-btn ss-font-28 ",{"ui-BG-Main-Gradient":P.selectedSpuIdList.length>0,"ui-Shadow-Main":P.selectedSpuIdList.length>0}]),onClick:q},{default:d((()=>[m(g(e.$t("common.delete_footprint")),1)])),_:1},8,["class"]),f(l,{class:"ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main ml-2",onClick:J},{default:d((()=>[m(g(e.$t("common.clear")),1)])),_:1})])),_:1})])),_:1})])),_:1},512),[[S,P.editMode]])])),_:1}),P.pagination.total>0?(_(),c(T,{key:0,status:P.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:Q},null,8,["status"])):y("",!0),0===P.pagination.total?(_(),c(F,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):y("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-f16b2f86"]]);export{O as default};
|