pages-user-goods-log.BOalWt1h.js 5.6 KB

1
  1. import{M as e,s as t,v as s,bM as o,m as a,o as l,a as i,b as n,d as c,w as d,u,bN 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 L,i as j,O as v,P as w,Q as C}from"./index-DNuNVpwk.js";import{_ as $}from"./s-goods-item.C3Lar4EO.js";import{a as A,_ as B}from"./s-layout.D9p6eCz-.js";import{_ as G}from"./uni-load-more.Dn3a6J_F.js";import{_ as N}from"./s-empty.C0MT77gG.js";import{_ as z}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./points.DDTOnulC.js";import"./useGoods.CrGbmvFq.js";/* empty css */import"./s-menu-tools.CEs7fo1o.js";import"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.nx0iNK_l.js";import"./uni-icons.BwI1_kKT.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.C_5j2fBR.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.CZSqjCi7.js";import"./s-search-block.DtORRFbA.js";import"./phone-international-input.CCPqViBY.js";/* empty css */const T=z({__name:"goods-log",setup(z){e((e=>({"5b2ab681":u(T)})));const T=t.$platform.navbar,F={list:[],pageNo:1,total:1,pageSize:10},H=s({pagination:o(F),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function O(){H.loadStatus="loading";const{code:e,data:t}=await p.getBrowseHistoryPage({pageNo:H.pagination.pageNo,pageSize:H.pagination.pageSize});0===e&&(H.pagination.list=r.concat(H.pagination.list,t.list),H.pagination.total=t.total,H.loadStatus=H.pagination.list.length<H.pagination.total?"more":"noMore")}const P=e=>{H.selectedSpuIdList.includes(e)?H.selectedSpuIdList.splice(H.selectedSpuIdList.indexOf(e),1):H.selectedSpuIdList.push(e),H.selectAll=H.selectedSpuIdList.length===H.pagination.list.length},E=()=>{H.selectAll=!H.selectAll,H.selectAll?H.pagination.list.forEach((e=>{H.selectedSpuIdList.includes(e.spuId)&&H.selectedSpuIdList.splice(H.selectedSpuIdList.indexOf(e.spuId),1),H.selectedSpuIdList.push(e.spuId)})):H.selectedSpuIdList=[]};async function Q(){if(H.selectedSpuIdList.length<=0)return;const{code:e}=await p.deleteBrowseHistory(H.selectedSpuIdList);0===e&&q()}async function U(){const{code:e}=await p.cleanBrowseHistory();0===e&&q()}function q(){H.editMode=!1,H.selectedSpuIdList=[],H.selectAll=!1,H.pagination=F,O()}function J(){"noMore"!==H.loadStatus&&(H.pagination.pageNo+=1,O())}return a((()=>{J()})),l((()=>{O()})),(e,s)=>{const o=L,a=j,l=v,p=w,r=C,z=i(n("s-goods-item"),$),T=i(n("su-fixed"),A),F=i(n("uni-load-more"),G),O=i(n("s-empty"),N),q=i(n("s-layout"),B);return _(),c(q,{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:H.pagination.total})),1)])),_:1})])),_:1}),f(a,{class:"header-right"},{default:d((()=>[H.editMode&&H.pagination.total?(_(),c(l,{key:0,class:"ss-reset-button",onClick:s[0]||(s[0]=e=>H.editMode=!1)},{default:d((()=>[m(g(e.$t("common.cancel")),1)])),_:1})):y("",!0),!H.editMode&&H.pagination.total?(_(),c(l,{key:1,class:"ss-reset-button ui-TC-Main",onClick:s[1]||(s[1]=e=>H.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(H.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((()=>[H.editMode?(_(),c(r,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:t=>P(e.spuId)},{default:d((()=>[f(p,{checked:H.selectedSpuIdList.includes(e.spuId),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:I((t=>P(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(T,{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:H.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":H.selectedSpuIdList.length>0,"ui-Shadow-Main":H.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:U},{default:d((()=>[m(g(e.$t("common.clear")),1)])),_:1})])),_:1})])),_:1})])),_:1},512),[[S,H.editMode]])])),_:1}),H.pagination.total>0?(_(),c(F,{key:0,status:H.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:J},null,8,["status"])):y("",!0),0===H.pagination.total?(_(),c(O,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):y("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-f16b2f86"]]);export{T as default};