1 |
- import{s,v as e,as as t,x as a,o as l,e as o,f as i,w as n,_ as c,l as d,j as u,p,t as r,g as f,k as g,r as _,F as m,aa as x,ab as k,A as S,z as y,B as h,C as I,i as b,D as C,E as M,G as L,m as w,u as j}from"./index-9880b451.js";import{_ as v}from"./s-goods-item.f5d79fd7.js";import{a as A,_ as B}from"./s-layout.dfc5b0b5.js";import{_ as G}from"./uni-load-more.aac4524a.js";import{_ as N}from"./s-empty.74111684.js";import{S as z}from"./history.256b80c0.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.bdd1c2ea.js";import"./index.df38848e.js";/* empty css *//* empty css */const F=T({__name:"goods-log",setup(T){h((s=>({"6afff93d":j(F)})));const F=s.$platform.navbar,H={list:[],pageNo:1,total:1,pageSize:10},E=e({pagination:t(H),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function O(){E.loadStatus="loading";const{code:s,data:e}=await z.getBrowseHistoryPage({pageNo:E.pagination.pageNo,pageSize:E.pagination.pageSize});0===s&&(E.pagination.list=c.concat(E.pagination.list,e.list),E.pagination.total=e.total,E.loadStatus=E.pagination.list.length<E.pagination.total?"more":"noMore")}const $=s=>{E.selectedSpuIdList.includes(s)?E.selectedSpuIdList.splice(E.selectedSpuIdList.indexOf(s),1):E.selectedSpuIdList.push(s),E.selectAll=E.selectedSpuIdList.length===E.pagination.list.length},D=()=>{E.selectAll=!E.selectAll,E.selectAll?E.pagination.list.forEach((s=>{E.selectedSpuIdList.includes(s.spuId)&&E.selectedSpuIdList.splice(E.selectedSpuIdList.indexOf(s.spuId),1),E.selectedSpuIdList.push(s.spuId)})):E.selectedSpuIdList=[]};async function P(){if(E.selectedSpuIdList.length<=0)return;const{code:s}=await z.deleteBrowseHistory(E.selectedSpuIdList);0===s&&W()}async function U(){const{code:s}=await z.cleanBrowseHistory();0===s&&W()}function W(){E.editMode=!1,E.selectedSpuIdList=[],E.selectAll=!1,E.pagination=H,O()}function Y(){"noMore"!==E.loadStatus&&(E.pagination.pageNo+=1,O())}return a((()=>{Y()})),l((()=>{O()})),(e,t)=>{const a=I,l=b,c=C,h=M,z=L,T=d(w("s-goods-item"),v),F=d(w("su-fixed"),A),H=d(w("uni-load-more"),G),O=d(w("s-empty"),N),W=d(w("s-layout"),B);return o(),i(W,{title:"我的足迹",bgStyle:{color:"#f2f2f2"}},{default:n((()=>[u(l,{class:"cart-box ss-flex ss-flex-col ss-row-between"},{default:n((()=>[u(l,{class:"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:n((()=>[u(l,{class:"header-left ss-flex ss-col-center ss-font-26"},{default:n((()=>[p(" 共 "),u(a,{class:"goods-number ui-TC-Main ss-flex"},{default:n((()=>[p(r(E.pagination.total),1)])),_:1}),p(" 件商品 ")])),_:1}),u(l,{class:"header-right"},{default:n((()=>[E.editMode&&E.pagination.total?(o(),i(c,{key:0,class:"ss-reset-button",onClick:t[0]||(t[0]=s=>E.editMode=!1)},{default:n((()=>[p(" 取消 ")])),_:1})):f("",!0),!E.editMode&&E.pagination.total?(o(),i(c,{key:1,class:"ss-reset-button ui-TC-Main",onClick:t[1]||(t[1]=s=>E.editMode=!0)},{default:n((()=>[p(" 编辑 ")])),_:1})):f("",!0)])),_:1})])),_:1}),u(l,{class:"cart-content"},{default:n((()=>[(o(!0),g(m,null,_(E.pagination.list,(e=>(o(),i(l,{class:"goods-box ss-r-10 ss-m-b-14",key:e.id},{default:n((()=>[u(l,{class:"ss-flex ss-col-center"},{default:n((()=>[E.editMode?(o(),i(z,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:s=>$(e.spuId)},{default:n((()=>[u(h,{checked:E.selectedSpuIdList.includes(e.spuId),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:S((s=>$(e.spuId)),["stop"])},null,8,["checked","onClick"])])),_:2},1032,["onClick"])):f("",!0),u(T,{title:e.spuName,img:e.picUrl,price:e.price,skuText:e.introduction,priceColor:"#FF3000",titleWidth:400,onClick:t=>j(s).$router.go("/pages/goods/index",{id:e.spuId})},null,8,["title","img","price","skuText","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),x(u(F,{bottom:"",val:0,placeholder:""},{default:n((()=>[u(l,{class:"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"},{default:n((()=>[u(l,{class:"footer-left ss-flex ss-col-center"},{default:n((()=>[u(z,{class:"check-box ss-flex ss-col-center ss-p-r-30",onClick:D},{default:n((()=>[u(h,{checked:E.selectAll,color:"var(--ui-BG-Main)",style:{transform:"scale(0.7)"},onClick:S(D,["stop"])},null,8,["checked","onClick"]),u(l,null,{default:n((()=>[p("全选")])),_:1})])),_:1})])),_:1}),u(l,{class:"footer-right ss-flex"},{default:n((()=>[u(c,{class:y(["ss-reset-button pay-btn ss-font-28 ",{"ui-BG-Main-Gradient":E.selectedSpuIdList.length>0,"ui-Shadow-Main":E.selectedSpuIdList.length>0}]),onClick:P},{default:n((()=>[p(" 删除足迹 ")])),_:1},8,["class"]),u(c,{class:"ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main ml-2",onClick:U},{default:n((()=>[p(" 清空 ")])),_:1})])),_:1})])),_:1})])),_:1},512),[[k,E.editMode]])])),_:1}),E.pagination.total>0?(o(),i(H,{key:0,status:E.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:Y},null,8,["status"])):f("",!0),0===E.pagination.total?(o(),i(O,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):f("",!0)])),_:1})}}},[["__scopeId","data-v-43e8a400"]]);export{F as default};
|