You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-bargain-task.046e3126.js

2 lines
9.5 KiB

11 months ago
import{ac as s,K as a,ad as t,o as e,c as l,w as o,n,e as i,i as d,a as r,f as c,t as u,b as f,F as _,j as h,d as m,k as g,r as k,g as p,V as b,S as w,x as y}from"./index-ae8bbb19.js";import{_ as v}from"./u-modal.b5d074c6.js";import{r as x}from"./uni-app.es.ee1d5b08.js";import{W as C}from"./wxofficial.cfa745b7.js";import{A as I}from"./index.0c0be40a.js";import{C as S}from"./index.002ef29d.js";import{b as B,a as L}from"./index.c0835ba6.js";import{c as j,d as $,h as P,e as D}from"./task.dfabb3d7.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading.01f91c7b.js";import"./u-popup.d74d5514.js";import"./u-icon.b463ad8a.js";const R=T({components:{AvatarImage:I,CountDown:S},mixins:[C],data:()=>({isLoading:!0,taskId:void 0,activeId:void 0,task:{},active:{},goods:{},goodsSkuInfo:{},helpList:[],isCreater:!1,isCut:!1,setting:{},showRules:!1,disabled:!1,showBuyBtn:!1,showShareBtn:!1,showCatBtn:!1,showOtherBtn:!1}),onLoad(s){this.taskId=s.taskId,this.onRefreshPage()},methods:{onRefreshPage(){const s=this;s.isLoading=!0,s.getTaskDetail().then((a=>{Promise.all([s.getActiveDetail(),s.getGoodsBasic(),s.getGoodsSku(),s.getHelpList()]).then((()=>{s.initShowBtn(),s.setWxofficialShareData()})).finally((()=>s.isLoading=!1))}))},getTaskDetail(){const s=this;return new Promise(((a,t)=>{j(s.taskId).then((t=>{s.task=t.data.taskInfo,s.activeId=s.task.active_id,s.isCreater=t.data.isCreater,s.isCut=t.data.isCut,s.setting=t.data.setting,a(t)})).catch(t)}))},getActiveDetail(){const s=this;return new Promise(((a,t)=>{$(s.activeId).then((t=>{s.active=t.data.active,a(t)})).catch(t)}))},getGoodsBasic(){const s=this,a=s.task.goods_id;return new Promise(((t,e)=>{B(a,!1).then((a=>{s.goods=a.data.detail,t(a)})).catch(e)}))},getGoodsSku(){const s=this,a=s.task.goods_id,t=s.task.goods_sku_id;return new Promise(((e,l)=>{L(a,t).then((a=>{s.goodsSkuInfo=a.data.skuInfo,e(a)})).catch(l)}))},getHelpList(){const s=this;return new Promise(((a,t)=>{P(s.taskId).then((t=>{s.helpList=t.data.list,a(t)})).catch(t)}))},initShowBtn(){const s=this,a=s.isCreater&&!s.task.is_buy&&s.task.status&&(!s.active.is_floor_buy||s.task.is_floor),t=!s.isCreater&&!s.isCut&&!s.task.is_floor&&s.task.status,e=!t&&!s.task.is_floor&&s.task.status,l=!a&&!e&&!t;s.showBuyBtn=a,s.showCatBtn=t,s.showShareBtn=e,s.showOtherBtn=l},handleShowRules(){this.showRules=!0},handleBuyNow(){this.$navTo("pages/checkout/index",{mode:"bargain",taskId:this.taskId})},handleHelpCut(){const s=this;s.disabled=!0,D(s.taskId).then((a=>{s.$toast(a.message),setTimeout((()=>s.onRefreshPage()),1800)})).finally((()=>s.disabled=!1))},handleShareBtn(){this.handleCopyLink()},handleCopyLink(){const s=this;s.getShareUrl().then((a=>{uni.setClipboardData({data:a,success:()=>s.$toast("复制链接成功,快去发送给朋友吧"),fail:a=>s.$toast("复制失败")})}))},getShareUrl(){const{path:e,query:l}=s();return new Promise(((s,o)=>{a.h5Url().then((a=>{const o=t(a,e,l);s(o)}))}))},setWxofficialShareData(){const{active:s,goods:a}=this;this.updateShareCardData({title:s.share_title,desc:s.prompt_words,imgUrl:a.goods_image})}},onShareAppMessage(){const s=this,a=s.$getShareUrlParams({taskId:s.taskId});return{title:s.active.share_title,path:`/pages/bargain/task?${a}`}},onShareTimeline(){const s=this,a=s.$getShareUrlParams({taskId:s.taskId});return{title:s.active.share_title,path:`/pages/bargain/task?${a}`}}},[["render",function(s,a,t,C,I,S){const B=g,L=d,j=k("avatar-image"),$=p,P=b,D=k("count-down"),T=w,R=x(y("u-modal"),v);return I.isLoading?i("",!0):(e(),l(L,{key:0,class:"container",style:n(s.appThemeStyle)},{default:o((()=>[r(L,{class:"header dis-flex flex-x-between"},{default:o((()=>[r(L,{class:"item-touch",onClick:a[0]||(a[0]=a=>s.$navTo("pages/index/index"))},{default:o((()=>[r(B,null,{default:o((()=>[c("返回首页")])),_:1})])),_:1}),r(L,{class:"item-touch",onClick:a[1]||(a[1]=s=>S.handleShowRules())},{default:o((()=>[r(B,null,{default:o((()=>[c("玩法详情")])),_:1})])),_:1})])),_:1}),r(L,{class:"content"},{default:o((()=>[r(L,{class:"infos-wrap"},{default:o((()=>[r(L,{class:"infos-top"},{default:o