pages-activity-index.94b1f8e6.js 6.1 KB

1
  1. import{v as t,x as s,o as a,e as o,f as i,w as e,_ as l,l as c,j as n,p as d,k as A,r as p,F as g,g as r,i as f,q as u,m,t as y,u as S,s as I,D as B}from"./index-9880b451.js";import{_ as x}from"./su-sticky.84aef901.js";import{_ as Q}from"./s-goods-column.2324341a.js";import{_ as U}from"./uni-load-more.aac4524a.js";import{_ as w}from"./s-layout.dfc5b0b5.js";import{R as j}from"./rewardActivity.ffbd3c12.js";import{b}from"./useGoods.bdd1c2ea.js";import{S as k}from"./spu.3137f763.js";import{_ as M}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css *//* empty css *//* empty css */import"./index.df38848e.js";const C=M({__name:"index",setup(M){const C=t({activityId:0,activityInfo:{},pagination:{list:[],total:1,pageNo:1,pageSize:8},loadStatus:"",leftGoodsList:[],rightGoodsList:[]});let _=0,v=0,H=0;function K(t=0,s="left"){C.pagination.list[_]&&("left"===s?v+=t:H+=t,v<=H?C.leftGoodsList.push(C.pagination.list[_]):C.rightGoodsList.push(C.pagination.list[_]),_++)}async function h(){const t={};2===C.activityInfo.productScope?t.ids=C.activityInfo.productSpuIds.join(","):3===C.activityInfo.productScope&&(t.categoryIds=C.activityInfo.productSpuIds.join(",")),C.loadStatus="loading";const{code:s,data:a}=await k.getSpuPage({pageNo:C.pagination.pageNo,pageSize:C.pagination.pageSize,...t});0===s&&(C.pagination.list=l.concat(C.pagination.list,a.list),C.pagination.total=a.total,C.loadStatus=C.pagination.list.length<C.pagination.total?"more":"noMore",K())}function F(){"noMore"!==C.loadStatus&&(C.pagination.pageNo++,h())}return s((()=>{F()})),a((async t=>{C.activityId=t.activityId,await async function(t){const{code:s,data:a}=await j.getRewardActivity(t);0===s&&(C.activityInfo=a)}(C.activityId),await h(C.activityId)})),(t,s)=>{const a=f,l=u,j=c(m("su-sticky"),x),k=B,M=c(m("s-goods-column"),Q),_=c(m("uni-load-more"),U),v=c(m("s-layout"),w);return o(),i(v,{class:"activity-wrap",title:C.activityInfo.title},{default:e((()=>[n(j,{bgColor:"#fff"},{default:e((()=>[n(a,{class:"ss-flex ss-col-top tip-box"},{default:e((()=>[n(a,{class:"type-text ss-flex ss-row-center"},{default:e((()=>[d("满减:")])),_:1}),n(a,{class:"ss-flex-1"},{default:e((()=>[(o(!0),A(g,null,p(C.activityInfo.rules,(t=>(o(),i(a,{class:"tip-content",key:t},{default:e((()=>[d(y(S(b)(C.activityInfo,t)),1)])),_:2},1024)))),128))])),_:1}),n(l,{class:"activity-left-image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAABICAMAAAAQ/CHDAAAAQlBMVEUAAAD/59f/5tf/59f/5tf/38//59j/59f/5tf/5tf/59f/49f/49T/5dj/5tj/5dX/5dj/5tf/5tj/5Nr/5NT/5tc+RkjZAAAAFXRSTlMAIN+f3hBff++/cFBAzq+Az76PMDD6OdBvAAABEElEQVRo3sXRS5aDMBBDUQrbGNuEX1r732oPNUhmOUhvA/eUasI8t5aOPrYyyQJbz/0Yf5MgfHTu/emr8b0zjZjY0yibCStQ1g4+WYHy4E2L0lWidO8QoqwtUpQzhxBl+yZE2bw8gApYwMACBhYwsPiheQhRlkKIsloMKPIiRbmxAcXahSjLIURZd6C4woAiL0KUVQeKHAYUeQhRVh0o9mJAkcOAIr+FKOsOFNWBojpQ3A4UyYHiVZQoVSVKVYlSNaC4HCiSA0VyoKgOFNWBYnGg69uAIocBRS4GFMmBojpQbA50DQOKlwPF7UCxOVC+FcKaA0XXoxwY0poDRVejHBjimgPFcKC5GFAcDhThQK9/qgrZLofQBLIAAAAASUVORK5CYII="}),n(l,{class:"activity-right-image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJEAAABkBAMAAAB0qc+6AAAAJ1BMVEUAAAD/gwL/cAP/cwP/hgH/gAH/fQL/dwL/dQP/ewL+iAH/bgX/dwDlI8ExAAAADXRSTlMALBUZLyglHxwiMhIK/FILewAABPNJREFUWMOlmbuLE2EUxeNrdV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QEwxkTDwHOkAJ94NrTr1bXsI8ho5kogKaIFDDNxuE5BaUoKlpBXrYIqmxE4cSZ4PHMzJntDNBE4LTCTR1KCcms1JAelH5ohHduCZinMHhCSzSbsiIImczUmdQFQRaaWwTQnUCRtOIH85SUR17fVFdxRTTG0ie4Wk1YJLwCBLFEuaMMme5/mnG6Aom9QgUctIe+FeiqYERIk5GjYnJHs+kjnZOqvibI7WdynpyBs5TkMm5c1x5ETKz08QJb1MrFXJ1YlJ+TndtbcuEUmydSZxAP2LdGSIV1yWTkgtLBMXc0KkwvfDmMRdflmkl0gqnl8FB9MGsSZxVzyfMCYJHE+vHHEEsaZlUT1mSaPcmbNRJaTa2uOoh23Cwbxb/GEpcycodDewNPm5b10pqbYP1y6zv5y4V+pOumBtnZxeYqE3IJWgBllSjCSpUwmJX9CgksS6KTEHzmfOzLRWirpIHcDEYyFJ4F8BVDKfMXCSFPP+Qi/noFq12XmxeOVa2IGGz1s3q/5LgDPyieJeepQTOKs6sxYlHscx3hSoEwuqzmqAPbq80PHmTPVngp0z6a4Qi32pYLNtr5GGtP01p+Yv+GHSkGRJRy4AAAAASUVORK5CYII="})])),_:1})])),_:1}),n(a,{class:"ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top"},{default:e((()=>[n(a,{class:"goods-list-box"},{default:e((()=>[(o(!0),A(g,null,p(C.leftGoodsList,(t=>(o(),i(a,{class:"left-list",key:t.id},{default:e((()=>[n(M,{class:"goods-md-box",size:"md",data:t,onClick:s=>S(I).$router.go("/pages/goods/index",{id:t.id}),onGetHeight:s[0]||(s[0]=t=>K(t,"left"))},{cart:e((()=>[n(k,{class:"ss-reset-button cart-btn"})])),_:2},1032,["data","onClick"])])),_:2},1024)))),128))])),_:1}),n(a,{class:"goods-list-box"},{default:e((()=>[(o(!0),A(g,null,p(C.rightGoodsList,(t=>(o(),i(a,{class:"right-list",key:t.id},{default:e((()=>[n(M,{class:"goods-md-box",size:"md",data:t,onClick:s=>S(I).$router.go("/pages/goods/index",{id:t.id}),onGetHeight:s[1]||(s[1]=t=>K(t,"right"))},{cart:e((()=>[n(k,{class:"ss-reset-button cart-btn"})])),_:2},1032,["data","onClick"])])),_:2},1024)))),128))])),_:1})])),_:1}),C.pagination.total>0?(o(),i(_,{key:0,status:C.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:F},null,8,["status"])):r("",!0)])),_:1},8,["title"])}}},[["__scopeId","data-v-ec6e6f8a"]]);export{C as default};