|
|
import{j as s,M as e,l as t,B as l,o as a,b as i,a as n,w as u,m as d,n as o,f as r,c,v as f,N as m,O as g,H as _,F as p,D as h,I as y,p as b,s as k,k as j,i as w,g as v,P as x,Q as C,E as q}from"./index.22b081e2.js";import{n as I,o as R}from"./user.b3821dab.js";import{_ as T}from"./fanhui.37cee083.js";import{_ as D}from"./plugin-vue_export-helper.21dcd24c.js";var N=D({props:["id"],onShow(){let t=this;this.details.users=s("users"),I({frequency:"1",id:this.id}).then((l=>{console.log(l),this.details.list=l.data,this.details.list.fxsj=l.data.timeSale.split(" ")[0];let a=s("users"),i=new Date(l.data.utime.replace(/-/g,"/")).getTime(),n=new Date(a.createdTime.replace(/-/g,"/")).getTime();l.data.newcomer&&i>n?this.details.sfgm=!1:this.details.sfgm=!0,this.details.list.tupian=this.details.list.imagePath,-1!=this.details.list.tupian.indexOf("mp4")?this.sftp=!1:(this.sftp=!0,e({src:this.details.list.tupian,success:function(s){console.log(s.width),console.log(s.height),s.width>s.height?t.ykwz=!0:s.width<s.height&&(t.ykwz=!1)}}));let u=this.details.list.storyText;if(u){let s=new RegExp("<img","gi");u=u.replace(s,'<img style="max-width: 100%;"'),this.details.list.storyText=u,this.details.list.isdjs=!1,this.daojishi(l.data)}else this.details.list.isdjs=!1,this.daojishi(l.data)}))},onUnload(){clearInterval(this.daojs)},setup(e){let a=t(1),i=t(!1),n=l({list:{},users:{},sfgm:!1}),u=t(!0),d=t(!0),o=t(null);n.users=s("users"),console.log(n.users);let r=!1;return{sftp:d,dowm:function(){1==a.value?h({title:"已经最少了",icon:"none"}):a.value--},guanb:function(){i.value=!1},up:function(){a.value==n.list.quota?h({title:"已经到了最大购买量",icon:"none"}):a.value++},qiehuan:function(){0!=n.list.numberRemaining&&(n.users.realNameState?n.list.isdjs&&7!=n.list.state&&n.sfgm&&(i.value=!0):b({url:"../realname/realname"}))},suliang:a,piliang:i,ykwz:u,daojs:o,fanhui:function(){y({})},details:n,goum:function(){if(console.log(n.list.numberRemaining),0!=n.list.numberRemaining)if(n.users.realNameState){if(n.list.isdjs){if(r)return;k({title:"抢购排队中"}),r=!0;let s={};s=n.list.blindState?{informationId:n.list.id,numberDeals:a.value,blindState:!0}:{informationId:n.list.id,numberDeals:a.value},R(s).then((s=>{r=!1,j(),200==s.code?s.data.ts?(h({title:"超过最大数量,已自动下降为最大购买数",icon:"none",duration:2e3}),setTimeout((()=>{b({url:"../payorder/payorder?id="+s.data.id})}),2e3)):b({url:"../payorder/payorder?id="+s.data.id}):h({title:s.msg,icon:"none"})}))}}else b({url:"../realname/realname"})},daojishi:function(s){let e=new Date(s.timeSale.replace(/-/g,"/")).getTime(),t=null,l=null;o.value=setInterval((()=>{if(t=(new Date).getTime(),l=e-t,e>t){n.list.isdjs=!1;var s=parseInt(l/864e5),a=parseInt(l%864e5/36e5),i=parseInt(l%36e5/6e4),u=parseInt(l%6e4/1e3);a<10&&(a="0"+a),i<10&&(i="0"+i),u<10&&(u="0"+u),n.list.day=s,n.list.hours=a,n.list.minutes=i,n.list.seconds=u}else clearInterval(o.value),n.list.isdjs=!0}),1e3)}}}},[["render",function(s,e,t,l,h,y){const b=w,k=v,j=x,I=C,R=q;return a(),i(p,null,[n(k,{class:"head_top"},{default:u((()=>[n(b,{onClick:l.fanhui,src:T},null,8,["onClick"]),n(k,null,{default:u((()=>[d("作品详情")])),_:1}),n(k)])),_:1}),n(k,{class:"details_top"},{default:u((()=>[n(k,{class:"max_box"},{default:u((()=>[l.sftp?(a(),i("img",{key:0,class:o(l.ykwz?"img1":"img2"),src:l.details.list.tupian},null,10,["src"])):r("",!0),l.sftp?r("",!0):(a(),c(j,{key:1,class:o(l.ykwz?"img1":"img2"),src:l.details.list.tupian,loop:"true",autoplay:"true","enable-progress-gesture":!1,controls:!1,"object-fit":"cover","show-center-play-btn":!1},null,8,["class","src"]))])),_:1})])),_:1}),n(k,{class:"prices"},{default:u((()=>[n(k,null,{default:u((()=>[n(k,null,{default:u((()=>[d(f(l.details.list.collectionName),1)])),_:1})])),_:1}),n(k,null,{default:u((()=>[n(k,null,{default:u((()=>[n(k,null,{default:u((()=>[n(b,{src:l.details.list.writerAvatar},null,8,["src"]),n(k,null,{default:u((()=>[d(f(l.details.list.artistName),1)])),_:1})])),_:1}),m(n(k,{class:"tubiao"},{default:u((()=>[n(k,null,{default:u((()=>[d("发行")])),_:1}),n(k,null,{default:u((()=>[d(f(l.details.list.issueNumber)+"份",1)])),_:1})])),_:1},512),[[g,l.details.list.issueNumber]])])),_:1}),n(k,{class:"usertx"},{default:u((()=>[n(k,{style:{}},{default:u((()=>[n(k,null,{default:u((()=>[d("¥")])),_:1}),n(k,null,{default:u((()=>[d(f(l.details.list.price),1)])),_:1})])),_:1}),m(n(k,{class:"xg"},{default:u((()=>[d("限购"+f(l.details.list.quota)+"份",1)])),_:1},512),[[g,0!=l.details.list.quota]])])),_:1})])),_:1})])),_:1}),n(k,{class:"heyuedizhi"},{default:u((()=>[n(k,null,{default:u((()=>[d("合约地址")])),_:1}),n(k,null,{default:u((()=>[d(f(l.details.list.contractAddress),1)])),_:1})])),_:1}),r("",!0),n(k,{class:"fuwenben"},{default:u((()=>[n(k,null,{default:u((()=>[d("作品描述")])),_:1}),n(I,{class:"ql-editor",nodes:l.details.list.storyText||""},null,8,["nodes"])])),_:1}),l.piliang?(a(),c(k,{key:1,onClick:l.guanb,class:"maxbox"},{default:u((()=>[n(k,{class:"tanchuangpiliang",onClick:e[0]||(e[0]=_((()=>{}),["stop"]))},{default:u((()=>[n(k,null,{default:u((()=>[n(k,{class:"left"},{default:u((()=>[n(k,null,{default:u((()=>[d("购买确认")])),_:1}),n(k,null,{default:u((()=>[n(R,{class:"text"},{default:u((()=>[d("¥")])),_:1}),d(f((l.details.list.price*l.suliang).toFixed(2)),1)])),_:1})])),_:1}),n(k,{class:"rigth"},{default:u((()=>[0==l.details.list.quota?(a(),c(k,{key:0},{default:u((()=>[d(" ")])),_:1})):(a(),c(k,{key:1},{default:u((()=>[d("当前商品限购:"+f(l.details.list.quota)+"份",1)])),_:1})),n(k,{class:"jiajcc"},{default:u((()=>[n(k,{onClick:l.dowm},{default:u((()=>[d("-")])),_:1},8,["onClick"]),n(k,null,{default:u((()=>[d(f(l.suliang),1)])),_:1}),n(k,{onClick:l.up},{default:u((()=>[d("+")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1}),n(k,{onClick:l.goum,class:"button"},{default:u((()=>[d("提交订单")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["onClick"])):r("",!0),l.piliang?r("",!0):(a(),c(k,{key:2,onClick:l.qiehuan,class:o(0!=l.details.list.numberRemaining&&7!=l.details.list.state&&l.details.sfgm?"qianggou":"qianggou shouqing")},{default:u((()=>[!l.details.list.isdjs&&l.details.list.numberRemaining>0&&7!=l.details.list.state&&l.details.sfgm?(a(),c(k,{key:0,style:{display:"flex","align-items":"center"}},{default:u((()=>[n(k,{class:"time"},{default:u((()=>[d(f(l.details.list.day),1)])),_:1}),n(R,null,{default:u((()=>[d("天")])),_:1}),n(k,{class:"time"},{default:u((()=>[d(f(l.details.list.hours),1)])),_:1}),d(": "),n(k,{class:"time"},{default:u((()=>[d(f(l.details.list.minutes),1)])),_:1}),d(": "),n(k,{class:"time"},{default:u((()=>[d(f(l.details.list.seconds),1)])),_:1})])),_:1})):r("",!0),l.details.list.isdjs&&l.details.list.numberRemaining>0&&7!=l.details.list.state&&l.details.sfgm?(a(),c(k,{key:1},{default:u((()=>[d(" 购买 ")])),_:1})):r("",!0),0==l.details.list.numberRemaining||7==l.details.list.state&&l.details.sfgm?(a(),c(k,{key:2},{default:u((()=>[d(" 已售罄 ")])),_:1})):r("",!0),!l.details.sfgm&&l.details.list.numberRemaining>0?(a(),c(k,{key:3},{default:u((()=>[d("新人专享")])),_:1})):r("",!0)])),_:1},8,["onClick","class"]))],64)}],["__scopeId","data-v-bfb060b4"]]);export{N as default};
|