pages-user-goods-log.b2c1b590.js 5.1 KB

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