import{s as e,C as t,D as s,p as l,o,e as a,w as i,_ as c,b as d,i as n,y as r,z as u,k as p,f as g,h as _,F as f,a4 as m,a5 as C,j as x,H as k,A as b,m as y,B as h,I as L,J as M,d as w,u as v}from"./index-520dfaee.js";import{_ as j}from"./s-goods-item.cceb2670.js";import{b as S,a as A}from"./s-layout.5146c957.js";import{_ as B}from"./uni-load-more.ba4f287c.js";import{_ as G}from"./s-empty.b6c95127.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                     *//* empty css                                                                */const $=T({__name:"goods-log",setup(T){k((e=>({"0dddc1b9":v($)})));const $=e.$platform.navbar,F={data:[],current_page:1,total:1,last_page:1},I=t({pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",editMode:!1,selectedCollectList:[],selectAll:!1});async function O(t=1,s=10){I.loadStatus="loading";let l=await e.$api.user.goodsLog.list({type:"views",list_rows:s,page:t});if(1===l.code){let e=c.concat(I.pagination.data,l.data.data);I.pagination={...l.data,data:e},I.pagination.current_page<I.pagination.last_page?I.loadStatus="more":I.loadStatus="noMore"}}const z=e=>{I.selectedCollectList.includes(e)?I.selectedCollectList.splice(I.selectedCollectList.indexOf(e),1):I.selectedCollectList.push(e),I.selectAll=I.selectedCollectList.length===I.pagination.data.length},D=()=>{I.selectAll=!I.selectAll,I.selectAll?I.pagination.data.forEach((e=>{I.selectedCollectList.includes(e.goods_id)&&I.selectedCollectList.splice(I.selectedCollectList.indexOf(e.goods_id),1),I.selectedCollectList.push(e.goods_id)})):I.selectedCollectList=[]};async function E(){if(I.selectedCollectList){I.selectedCollectList=I.selectedCollectList.toString();const{code:t}=await e.$api.user.view.delete({goods_id:I.selectedCollectList});1===t&&(I.editMode=!1,I.selectedCollectList=[],I.selectAll=!1,I.pagination=F,O())}}function H(){"noMore"!==I.loadStatus&&O(I.pagination.current_page+1)}return s((()=>{H()})),l((()=>{O()})),(t,s)=>{const l=b,c=y,k=h,T=L,$=M,F=d(w("s-goods-item"),j),O=d(w("su-fixed"),S),J=d(w("uni-load-more"),B),W=d(w("s-empty"),G),q=d(w("s-layout"),A);return o(),a(q,{title:"我的足迹",bgStyle:{color:"#f2f2f2"}},{default:i((()=>[n(c,{class:"cart-box ss-flex ss-flex-col ss-row-between"},{default:i((()=>[n(c,{class:"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:i((()=>[n(c,{class:"header-left ss-flex ss-col-center ss-font-26"},{default:i((()=>[r(" 共 "),n(l,{class:"goods-number ui-TC-Main ss-flex"},{default:i((()=>[r(u(I.pagination.total),1)])),_:1}),r(" 件商品 ")])),_:1}),n(c,{class:"header-right"},{default:i((()=>[I.editMode&&I.pagination.total?(o(),a(k,{key:0,class:"ss-reset-button",onClick:s[0]||(s[0]=e=>I.editMode=!1)},{default:i((()=>[r(" 取消 ")])),_:1})):p("",!0),!I.editMode&&I.pagination.total?(o(),a(k,{key:1,class:"ss-reset-button ui-TC-Main",onClick:s[1]||(s[1]=e=>I.editMode=!0)},{default:i((()=>[r(" 编辑 ")])),_:1})):p("",!0)])),_:1})])),_:1}),n(c,{class:"cart-content"},{default:i((()=>[(o(!0),g(f,null,_(I.pagination.data,(t=>(o(),a(c,{class:"goods-box ss-r-10 ss-m-b-14",key:t.id},{default:i((()=>[n(c,{class:"ss-flex ss-col-center"},{default:i((()=>[I.editMode?(o(),a($,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:e=>z(t.goods_id)},{default:i((()=>[n(T,{checked:I.selectedCollectList.includes(t.goods_id),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:x((e=>z(t.goods_id)),["stop"])},null,8,["checked","onClick"])])),_:2},1032,["onClick"])):p("",!0),n(F,{title:t.goods.title,img:t.goods.image,price:t.goods.price[0],skuText:t.goods.subtitle,priceColor:"#FF3000",titleWidth:400,onClick:s=>v(e).$router.go("/pages/goods/index",{id:t.goods_id})},null,8,["title","img","price","skuText","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),m(n(O,{bottom:"",val:0,placeholder:""},{default:i((()=>[n(c,{class:"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"},{default:i((()=>[n(c,{class:"footer-left ss-flex ss-col-center"},{default:i((()=>[n($,{class:"check-box ss-flex ss-col-center ss-p-r-30",onClick:D},{default:i((()=>[n(T,{checked:I.selectAll,color:"var(--ui-BG-Main)",style:{transform:"scale(0.7)"},onClick:x(D,["stop"])},null,8,["checked","onClick"]),n(c,null,{default:i((()=>[r("全选")])),_:1})])),_:1})])),_:1}),n(c,{class:"footer-right"},{default:i((()=>[n(k,{class:"ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main",onClick:E},{default:i((()=>[r(" 删除足迹 ")])),_:1})])),_:1})])),_:1})])),_:1},512),[[C,I.editMode]])])),_:1}),I.pagination.total>0?(o(),a(J,{key:0,status:I.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:H},null,8,["status"])):p("",!0),0===I.pagination.total?(o(),a(W,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):p("",!0)])),_:1})}}},[["__scopeId","data-v-f139c146"]]);export{$ as default};
