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.
2 lines
9.5 KiB
2 lines
9.5 KiB
11 months ago
|
import{af as s,S as a,ag 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 _,k as h,d as m,l as g,r as k,g as p,U as b,j as w,y}from"./index-4ddb689d.js";import{_ as v}from"./u-modal.9219359e.js";import{r as x}from"./uni-app.es.24af5d4f.js";import{W as C}from"./wxofficial.956096a5.js";import{A as I}from"./index.1169d7d7.js";import{C as S}from"./index.994d85b2.js";import{b as B,a as L}from"./index.85d62ccb.js";import{c as j,d as $,h as P,e as D}from"./task.812dd4ac.js";import{_ as T}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading.7bd69747.js";import"./u-popup.37b3343e.js";import"./u-icon.e981d1c2.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:({errMsg:a})=>s.$toast("复制失败 "+a)})}))},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"},{
|