index.js 2.6 KB

1
  1. "use strict";const e=require("../../common/vendor.js"),o=require("../../utils/system.js"),t=require("./utils/source.js"),n=require("../../services/ams.js");if(!Array){(e.resolveComponent("wd-icon")+e.resolveComponent("wd-gap"))()}Math||((()=>"../../node-modules/wot-design-uni/components/wd-icon/wd-icon.js")+(()=>"../../node-modules/wot-design-uni/components/wd-gap/wd-gap.js")+i+s+r+a+u)();const i=()=>"./components/photoExamplePopup.js",s=()=>"./components/uploadReceptPopop.js",r=()=>"./components/winRecordPopup.js",a=()=>"./components/uploadRecordPopup.js",u=()=>"./components/activityDescPopup.js",c=e.defineComponent({__name:"index",setup(i){let s=e.ref(!1),r=e.ref(!1),a=e.ref(!1),u=e.ref(!1),c=e.ref(!1);const d=e.index.getStorageSync("appid"),p=e.ref("");let l=e.reactive({discounts:[]}),f=e.ref([]);const m=e.index.getStorageSync("openid");e.computed((()=>!!l.authCheck.includes("2")));const v=e.ref([]),g=()=>{console.log("openid",m),n.rewardList({openid:m,marketingActivityId:l.id}).then((e=>{v.value=e.rows})),u.value=!0},h=e.ref([]),w=()=>{n.auditSuccessList({openid:m,marketingActivityId:l.id}).then((e=>{h.value=e.rows})),a.value=!0},j=()=>{e.index.navigateBack({delta:1})},y=()=>{r.value=!0};return e.onShow((()=>{n.getActivity(d).then((o=>{l=o.data[0]||{},l.authCheck=l.authCheck.split(","),f.value=l.discounts.map((e=>({...e,checked:!1}))),e.index.setStorageSync("activityData",JSON.stringify(l)),p.value=o.data[0].activityImage,l.description=l.description.split("\n")})).catch((e=>{console.log(e)}))})),e.ref(0),e.onLoad((()=>{})),(n,i)=>({a:e.unref(o.getStatusBarHeight)()+"px",b:e.o(j),c:e.p({name:"thin-arrow-left",size:"44rpx",color:"#000"}),d:e.unref(o.getNavBarPaddingTop)()+"px",e:p.value,f:e.o((o=>e.isRef(c)?c.value=!0:c=!0)),g:e.unref(t.imgObj).rule,h:e.unref(t.imgObj).record,i:e.o(w),j:e.unref(t.imgObj).photo,k:e.o((o=>e.isRef(s)?s.value=!0:s=!0)),l:e.unref(t.imgObj).book,m:e.o(g),n:e.unref(t.gifObj).pointer,o:e.o(y),p:e.t(e.unref(l).startTime),q:e.t(e.unref(l).endTime),r:e.f(e.unref(f),((o,t,n)=>({a:e.t(o.cashbackAmount),b:e.t(o.thresholdAmount),c:e.t(o.cashbackAmount),d:o.id}))),s:e.p({"bg-color":"transparent"}),t:e.o((o=>e.isRef(s)?s.value=o:s=o)),v:e.p({show:e.unref(s)}),w:e.unref(l).id,x:e.o((o=>e.isRef(r)?r.value=o:r=o)),y:e.p({list:e.unref(f),id:e.unref(l).id,show:e.unref(r)}),z:e.o((o=>e.isRef(a)?a.value=o:a=o)),A:e.p({list:h.value,show:e.unref(a)}),B:e.o((o=>e.isRef(u)?u.value=o:u=o)),C:e.p({list:v.value,show:e.unref(u)}),D:e.o((o=>e.isRef(c)?c.value=o:c=o)),E:e.p({description:e.unref(l).description,show:e.unref(c)})})}}),d=e._export_sfc(c,[["__scopeId","data-v-878b6701"]]);wx.createPage(d);