"use strict";const e=require("../../common/vendor.js"),t=require("../../sheep/index.js"),s=require("../../sheep/api/product/history.js"),i=require("../../sheep/helper/utils.js");if(require("../../sheep/url/index.js"),require("../../sheep/store/index.js"),require("../../sheep/store/app.js"),require("../../sheep/api/promotion/diy.js"),require("../../sheep/request/index.js"),require("../../sheep/config/index.js"),require("../../sheep/platform/index.js"),require("../../sheep/platform/provider/wechat/index.js"),require("../../sheep/platform/provider/wechat/miniProgram.js"),require("../../sheep/api/member/auth.js"),require("../../sheep/api/member/social.js"),require("../../sheep/api/member/user.js"),require("../../sheep/platform/provider/apple/index.js"),require("../../sheep/platform/share.js"),require("../../sheep/router/index.js"),require("../../sheep/hooks/useModal.js"),require("../../sheep/helper/index.js"),require("../../sheep/helper/test.js"),require("../../sheep/helper/digit.js"),require("../../sheep/api/member/signin.js"),require("../../sheep/helper/throttle.js"),require("../../sheep/platform/pay.js"),require("../../sheep/api/pay/order.js"),require("../../sheep/store/user.js"),require("../../sheep/store/cart.js"),require("../../sheep/api/trade/cart.js"),require("../../sheep/api/pay/wallet.js"),require("../../sheep/api/trade/order.js"),require("../../sheep/api/promotion/coupon.js"),require("../../sheep/store/sys.js"),require("../../sheep/store/modal.js"),require("../../sheep/config/zIndex.js"),!Array){(e.resolveComponent("s-goods-item")+e.resolveComponent("su-fixed")+e.resolveComponent("uni-load-more")+e.resolveComponent("s-empty")+e.resolveComponent("s-layout"))()}Math||((()=>"../../sheep/components/s-goods-item/s-goods-item.js")+(()=>"../../sheep/ui/su-fixed/su-fixed.js")+(()=>"../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../sheep/components/s-empty/s-empty.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const o={__name:"goods-log",setup(o){e.useCssVars((t=>({"6afff93d":e.unref(p)})));const p=t.sheep.$platform.navbar,r={list:[],pageNo:1,total:1,pageSize:10},a=e.reactive({pagination:i.cloneDeep(r),loadStatus:"",editMode:!1,selectedSpuIdList:[],selectAll:!1});async function n(){a.loadStatus="loading";const{code:t,data:i}=await s.SpuHistoryApi.getBrowseHistoryPage({pageNo:a.pagination.pageNo,pageSize:a.pagination.pageSize});0===t&&(a.pagination.list=e._.concat(a.pagination.list,i.list),a.pagination.total=i.total,a.loadStatus=a.pagination.list.length<a.pagination.total?"more":"noMore")}const d=e=>{a.selectedSpuIdList.includes(e)?a.selectedSpuIdList.splice(a.selectedSpuIdList.indexOf(e),1):a.selectedSpuIdList.push(e),a.selectAll=a.selectedSpuIdList.length===a.pagination.list.length},l=()=>{a.selectAll=!a.selectAll,a.selectAll?a.pagination.list.forEach((e=>{a.selectedSpuIdList.includes(e.spuId)&&a.selectedSpuIdList.splice(a.selectedSpuIdList.indexOf(e.spuId),1),a.selectedSpuIdList.push(e.spuId)})):a.selectedSpuIdList=[]};async function u(){if(a.selectedSpuIdList.length<=0)return;const{code:e}=await s.SpuHistoryApi.deleteBrowseHistory(a.selectedSpuIdList);0===e&&h()}async function c(){const{code:e}=await s.SpuHistoryApi.cleanBrowseHistory();0===e&&h()}function h(){a.editMode=!1,a.selectedSpuIdList=[],a.selectAll=!1,a.pagination=r,n()}function g(){"noMore"!==a.loadStatus&&(a.pagination.pageNo+=1,n())}return e.onReachBottom((()=>{g()})),e.onLoad((()=>{n()})),(s,i)=>e.e({a:e.t(a.pagination.total),b:a.editMode&&a.pagination.total},a.editMode&&a.pagination.total?{c:e.o((e=>a.editMode=!1))}:{},{d:!a.editMode&&a.pagination.total},!a.editMode&&a.pagination.total?{e:e.o((e=>a.editMode=!0))}:{},{f:e.f(a.pagination.list,((s,i,o)=>e.e(a.editMode?{a:a.selectedSpuIdList.includes(s.spuId),b:e.o((e=>d(s.spuId)),s.id),c:e.o((e=>d(s.spuId)),s.id)}:{},{d:e.o((i=>e.unref(t.sheep).$router.go("/pages/goods/index",{id:s.spuId})),s.id),e:"43e8a400-1-"+o+",43e8a400-0",f:e.p({title:s.spuName,img:s.picUrl,price:s.price,skuText:s.introduction,priceColor:"#FF3000",titleWidth:400}),g:s.id}))),g:a.editMode,h:a.selectAll,i:e.o(l),j:e.o(l),k:e.n({"ui-BG-Main-Gradient":a.selectedSpuIdList.length>0,"ui-Shadow-Main":a.selectedSpuIdList.length>0}),l:e.o(u),m:e.o(c),n:a.editMode,o:e.p({bottom:!0,val:0,placeholder:!0}),p:a.pagination.total>0},a.pagination.total>0?{q:e.o(g),r:e.p({status:a.loadStatus,"content-text":{contentdown:"上拉加载更多"}})}:{},{s:0===a.pagination.total},0===a.pagination.total?{t:e.p({text:"暂无浏览记录",icon:"/static/collect-empty.png"})}:{},{v:e.s(s.__cssVars()),w:e.p({title:"我的足迹",bgStyle:{color:"#f2f2f2"}})})}},p=e._export_sfc(o,[["__scopeId","data-v-43e8a400"]]);wx.createPage(p);
