1 |
- import{s as e,v as t,bI as s,m as o,o as a,a as l,b as i,w as n,bJ as c,_ as d,j as u,d as p,e as r,f,x as _,y as m,z as g,F as x,ad as y,ae as b,K as k,J as S,L as h,l as I,i as M,M as L,N as w,O as v,k as C,u as j}from"./index-39e65128.js";import{_ as $}from"./s-goods-item.dcdda97e.js";import{a as G,_ as A}from"./s-layout.69eddd84.js";import{_ as B}from"./uni-load-more.4cfd6f67.js";import{_ as N}from"./s-empty.637bbf42.js";import{_ as z}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";import"./useGoods.133fe7ed.js";/* empty css */import"./s-layout.vue_vue_type_style_index_0_scoped_0789db2f_lang.a57fff0d.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a2d557af_lang.dec8d7d1.js";import"./s-tabbar.6c197486.js";import"./phone-international-input.20ca2464.js";/* empty css */const F=z({__name:"goods-log",setup(z){h((e=>({"4d19dede":j(F)})));const F=e.$platform.navbar,T={list:[],pageNo:1,total:1,pageSize:10},H=t({pagination:s(T),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function O(){H.loadStatus="loading";const{code:e,data:t}=await c.getBrowseHistoryPage({pageNo:H.pagination.pageNo,pageSize:H.pagination.pageSize});0===e&&(H.pagination.list=d.concat(H.pagination.list,t.list),H.pagination.total=t.total,H.loadStatus=H.pagination.list.length<H.pagination.total?"more":"noMore")}const E=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},J=()=>{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 K(){if(H.selectedSpuIdList.length<=0)return;const{code:e}=await c.deleteBrowseHistory(H.selectedSpuIdList);0===e&&P()}async function q(){const{code:e}=await c.cleanBrowseHistory();0===e&&P()}function P(){H.editMode=!1,H.selectedSpuIdList=[],H.selectAll=!1,H.pagination=T,O()}function U(){"noMore"!==H.loadStatus&&(H.pagination.pageNo+=1,O())}return o((()=>{U()})),a((()=>{O()})),(t,s)=>{const o=I,a=M,c=L,d=w,h=v,z=u(C("s-goods-item"),$),F=u(C("su-fixed"),G),T=u(C("uni-load-more"),B),O=u(C("s-empty"),N),P=u(C("s-layout"),A);return l(),i(P,{title:t.$t("common.delete_footprint"),bgStyle:{color:"#f2f2f2"}},{default:n((()=>[p(a,{class:"cart-box ss-flex ss-flex-col ss-row-between"},{default:n((()=>[p(a,{class:"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:n((()=>[p(a,{class:"header-left ss-flex ss-col-center ss-font-26"},{default:n((()=>[p(o,{class:"goods-number ui-TC-Main ss-flex"},{default:n((()=>[r(f(t.$t("common.total_goods",{number:H.pagination.total})),1)])),_:1})])),_:1}),p(a,{class:"header-right"},{default:n((()=>[H.editMode&&H.pagination.total?(l(),i(c,{key:0,class:"ss-reset-button",onClick:s[0]||(s[0]=e=>H.editMode=!1)},{default:n((()=>[r(f(t.$t("common.cancel")),1)])),_:1})):_("",!0),!H.editMode&&H.pagination.total?(l(),i(c,{key:1,class:"ss-reset-button ui-TC-Main",onClick:s[1]||(s[1]=e=>H.editMode=!0)},{default:n((()=>[r(f(t.$t("common.edit")),1)])),_:1})):_("",!0)])),_:1})])),_:1}),p(a,{class:"cart-content"},{default:n((()=>[(l(!0),m(x,null,g(H.pagination.list,(t=>(l(),i(a,{class:"goods-box ss-r-10 ss-m-b-14",key:t.id},{default:n((()=>[p(a,{class:"ss-flex ss-col-center"},{default:n((()=>[H.editMode?(l(),i(h,{key:0,class:"check-box ss-flex ss-col-center ss-p-l-10",onClick:e=>E(t.spuId)},{default:n((()=>[p(d,{checked:H.selectedSpuIdList.includes(t.spuId),color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},onClick:k((e=>E(t.spuId)),["stop"])},null,8,["checked","onClick"])])),_:2},1032,["onClick"])):_("",!0),p(z,{title:t.spuName,img:t.picUrl,price:t.price,skuText:t.introduction,priceColor:"#FF3000",titleWidth:400,onClick:s=>j(e).$router.go("/pages/goods/index",{id:t.spuId})},null,8,["title","img","price","skuText","onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1}),y(p(F,{bottom:"",val:0,placeholder:""},{default:n((()=>[p(a,{class:"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"},{default:n((()=>[p(a,{class:"footer-left ss-flex ss-col-center"},{default:n((()=>[p(h,{class:"check-box ss-flex ss-col-center ss-p-r-30",onClick:J},{default:n((()=>[p(d,{checked:H.selectAll,color:"var(--ui-BG-Main)",style:{transform:"scale(0.7)"},onClick:k(J,["stop"])},null,8,["checked"]),p(a,null,{default:n((()=>[r(f(t.$t("common.select_all")),1)])),_:1})])),_:1})])),_:1}),p(a,{class:"footer-right ss-flex"},{default:n((()=>[p(c,{class:S(["ss-reset-button pay-btn ss-font-28 ",{"ui-BG-Main-Gradient":H.selectedSpuIdList.length>0,"ui-Shadow-Main":H.selectedSpuIdList.length>0}]),onClick:K},{default:n((()=>[r(f(t.$t("common.delete_footprint")),1)])),_:1},8,["class"]),p(c,{class:"ss-reset-button ui-BG-Main-Gradient pay-btn ss-font-28 ui-Shadow-Main ml-2",onClick:q},{default:n((()=>[r(f(t.$t("common.clear")),1)])),_:1})])),_:1})])),_:1})])),_:1},512),[[b,H.editMode]])])),_:1}),H.pagination.total>0?(l(),i(T,{key:0,status:H.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:U},null,8,["status"])):_("",!0),0===H.pagination.total?(l(),i(O,{key:1,text:"暂无浏览记录",icon:"/static/collect-empty.png"})):_("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-03bbab35"]]);export{F as default};
|