"use strict";const e=require("../../common/vendor.js"),i=require("../../sheep/index.js"),t=require("../../sheep/api/promotion/rewardActivity.js"),o=require("../../sheep/hooks/useGoods.js"),s=require("../../sheep/api/product/spu.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"),require("../../sheep/util/index.js"),!Array){(e.resolveComponent("su-sticky")+e.resolveComponent("s-goods-column")+e.resolveComponent("uni-load-more")+e.resolveComponent("s-layout"))()}Math||((()=>"../../sheep/ui/su-sticky/su-sticky.js")+(()=>"../../sheep/components/s-goods-column/s-goods-column.js")+(()=>"../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const r={__name:"index",setup(r){const a=e.reactive({activityId:0,activityInfo:{},pagination:{list:[],total:1,pageNo:1,pageSize:8},loadStatus:"",leftGoodsList:[],rightGoodsList:[]});let p=0,n=0,u=0;function d(e=0,i="left"){a.pagination.list[p]&&("left"===i?n+=e:u+=e,n<=u?a.leftGoodsList.push(a.pagination.list[p]):a.rightGoodsList.push(a.pagination.list[p]),p++)}async function c(){const i={};2===a.activityInfo.productScope?i.ids=a.activityInfo.productSpuIds.join(","):3===a.activityInfo.productScope&&(i.categoryIds=a.activityInfo.productSpuIds.join(",")),a.loadStatus="loading";const{code:t,data:o}=await s.SpuApi.getSpuPage({pageNo:a.pagination.pageNo,pageSize:a.pagination.pageSize,...i});0===t&&(a.pagination.list=e._.concat(a.pagination.list,o.list),a.pagination.total=o.total,a.loadStatus=a.pagination.list.length<a.pagination.total?"more":"noMore",d())}function l(){"noMore"!==a.loadStatus&&(a.pagination.pageNo++,c())}return e.onReachBottom((()=>{l()})),e.onLoad((async e=>{a.activityId=e.activityId,await async function(e){const{code:i,data:o}=await t.RewardActivityApi.getRewardActivity(e);0===i&&(a.activityInfo=o)}(a.activityId),await c(a.activityId)})),(t,s)=>e.e({a:e.f(a.activityInfo.rules,((i,t,s)=>({a:e.t(e.unref(o.formatRewardActivityRule)(a.activityInfo,i)),b:i}))),b:e.p({bgColor:"#fff"}),c:e.f(a.leftGoodsList,((t,o,s)=>({a:e.o((o=>e.unref(i.sheep).$router.go("/pages/goods/index",{id:t.id})),t.id),b:e.o((e=>d(e,"left")),t.id),c:"ec6e6f8a-2-"+s+",ec6e6f8a-0",d:e.p({size:"md",data:t}),e:t.id}))),d:e.f(a.rightGoodsList,((t,o,s)=>({a:e.o((o=>e.unref(i.sheep).$router.go("/pages/goods/index",{id:t.id})),t.id),b:e.o((e=>d(e,"right")),t.id),c:"ec6e6f8a-3-"+s+",ec6e6f8a-0",d:e.p({size:"md",data:t}),e:t.id}))),e:a.pagination.total>0},a.pagination.total>0?{f:e.o(l),g:e.p({status:a.loadStatus,"content-text":{contentdown:"上拉加载更多"}})}:{},{h:e.p({title:a.activityInfo.title})})}},a=e._export_sfc(r,[["__scopeId","data-v-ec6e6f8a"]]);wx.createPage(a);
