1 |
- import{c as e,s,y as t,d as a,a2 as l,l as c,m as o,e as r,f as n,w as i,j as u,A as d,v as f,k as m,F as p,r as b,B as _,t as x,u as y,a3 as g,a4 as w,g as v,a5 as h,a6 as k,a7 as $,a8 as I,q as V,E as C,i as L,x as T,G as j,a9 as S,L as F}from"./index-b48a414d.js";import{i as B,a as O}from"./s-layout.d6dcdc81.js";import{F as N}from"./favorite.ac70f83c.js";import{_ as R}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as A}from"./s-empty.6d3471cc.js";import{c as E,C as H}from"./comment-item.90dd3105.js";import{_ as M}from"./mp-html.da111812.js";const P=R({__name:"detail-navbar",props:{modelValue:{type:Object,default(){}},collectIcon:{type:Boolean,default:!0},shareIcon:{type:Boolean,default:!0}},emits:["clickLeft"],setup(j,{emit:S}){const F=e((()=>s.$store("user").isLogin)),R=s.$platform.device.statusBarHeight,A=s.$platform.navbar;s.$platform.capsule.width,s.$platform.capsule.height;const E=t({tabOpacityVal:0,curTab:"goods",tabList:[{label:"商品",value:"goods",to:"detail-swiper-selector"},{label:"评价",value:"comment",to:"detail-comment-selector"},{label:"详情",value:"detail",to:"detail-content-selector"}]}),H=j,M=S,P=s.$router.hasHistory();function U(){P?s.$router.back():s.$router.go("/pages/index/index"),M("clickLeft")}function q(){k()}let z={top:0,bottom:0};async function G(){if(F.value)if(H.modelValue.favorite){const{code:e}=await N.deleteFavorite(H.modelValue.id);if(0!==e)return;s.$helper.toast("取消收藏"),H.modelValue.favorite=!1}else{const{code:e}=await N.createFavorite(H.modelValue.id);if(await N.createCollectBefore(H.modelValue.id),0!==e)return;s.$helper.toast("收藏成功"),H.modelValue.favorite=!0}else V()}return a((e=>{E.tabOpacityVal=e.scrollTop>s.$platform.navbar?1:.01*e.scrollTop,0===z.top&&l((()=>{new Promise(((e,s)=>{$().select(".detail-comment-selector").boundingClientRect((s=>{s?(z.top=s.top,z.bottom=s.top+s.height,e(s)):e(null)})).exec()}))}),50),e.scrollTop<z.top-A?E.curTab="goods":e.scrollTop>=z.top-A&&e.scrollTop<=z.bottom-A?E.curTab="comment":E.curTab="detail"})),(e,t)=>{const a=c(o("su-status-bar"),B),l=C,k=L,$=T,V=c(o("su-fixed"),O);return r(),n(V,{alway:"",bgStyles:{background:"#fff"},val:0,noNav:"",opacity:"",placeholder:!1},{default:i((()=>[u(a),u(k,{class:"ui-bar ss-flex ss-col-center ss-row-between ss-p-x-20",style:d([{height:f(A)-f(R)+"px"}])},{default:i((()=>[u(k,{class:"icon-box ss-flex"},{default:i((()=>[u(k,{class:"icon-button icon-button-left ss-flex ss-row-center",onClick:U},{default:i((()=>[f(P)?(r(),n(l,{key:0,class:"sicon-back"})):(r(),n(l,{key:1,class:"sicon-home"}))])),_:1}),u(k,{class:"line"}),u(k,{class:"icon-button icon-button-right ss-flex ss-row-center",onClick:q},{default:i((()=>[u(l,{class:"sicon-more"})])),_:1})])),_:1}),u(k,{class:"detail-tab-card ss-flex-1",style:d([{opacity:E.tabOpacityVal}])},{default:i((()=>[u(k,{class:"tab-box ss-flex ss-col-center ss-row-around"},{default:i((()=>[(r(!0),m(p,null,b(E.tabList,(e=>(r(),n(k,{class:"tab-item ss-flex-1 ss-flex ss-row-center ss-col-center",key:e.value,onClick:s=>function(e){let s=0;"comment"===e.value?s=z.top-A+1:"detail"===e.value&&(s=z.bottom-A+1),I({scrollTop:s,duration:200})}(e)},{default:i((()=>[u(k,{class:_(["tab-title",E.curTab===e.value?"cur-tab-title":""])},{default:i((()=>[x(y(e.label),1)])),_:2},1032,["class"]),g(u(k,{class:"tab-line"},null,512),[[w,E.curTab===e.value]])])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1},8,["style"]),u(k,{class:"ui-tabbar-box",style:d([{opacity:E.tabOpacityVal}])},{default:i((()=>[u(k,{class:"ui-tabbar ss-flex ss-col-center ss-row-between"},{default:i((()=>[u(k,{class:"ss-flex ss-col-center ss-row-between"},{default:i((()=>[j.collectIcon?(r(),n(k,{key:0,class:"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",onClick:G},{default:i((()=>[j.modelValue.favorite?(r(),n($,{key:0,class:"item-icon",src:f(s).$url.static("/static/images/collect_1.gif"),mode:"aspectFit"},null,8,["src"])):(r(),n($,{key:1,class:"item-icon",src:f(s).$url.static("/static/images/collect_0.png"),mode:"aspectFit"},null,8,["src"]))])),_:1})):v("",!0),j.shareIcon?(r(),n(k,{key:1,class:"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",onClick:t[0]||(t[0]=e=>f(h)(j.modelValue.id))},{default:i((()=>[u($,{class:"item-icon",src:f(s).$url.static("/static/images/share.png"),mode:"aspectFit"},null,8,["src"])])),_:1})):v("",!0)])),_:1})])),_:1})])),_:1},8,["style"])])),_:1},8,["style"])])),_:1})}}},[["__scopeId","data-v-a461b514"]]),U=R({__name:"detail-cell",props:{label:{type:String,default:""},value:{type:String,default:""}},emits:["click"],setup(e,{emit:s}){const t=s,a=()=>{t("click")};return(s,t)=>{const l=L,c=C,o=j;return r(),n(l,{class:"detail-cell-wrap ss-flex ss-col-center ss-row-between",onClick:a},{default:i((()=>[u(l,{class:"label-text"},{default:i((()=>[x(y(e.label),1)])),_:1}),u(l,{class:"cell-content ss-line-1 ss-flex-1"},{default:i((()=>[x(y(e.value),1)])),_:1}),u(o,{class:"ss-reset-button"},{default:i((()=>[u(c,{class:"_icon-forward right-forwrad-icon"})])),_:1})])),_:1})}}},[["__scopeId","data-v-879372e1"]]),q={__name:"detail-cell-sku",props:{modelValue:{type:Array,default:()=>[]},sku:{type:Object}},setup(s){const t=s,a=e((()=>{var e;if(!(null==(e=t.sku)?void 0:e.id))return"请选择商品规格";let s="";return t.sku.properties.forEach((e=>{s+=e.propertyName+":"+e.valueName+" "})),s}));return(e,s)=>(r(),n(U,{label:"选择",value:a.value},null,8,["value"]))}},z=""+new URL("index-53a28843.png",import.meta.url).href,G=""+new URL("cart-ed457535.png",import.meta.url).href,D=R({__name:"detail-tabbar",props:{modelValue:{type:Object,default(){}},bg:{type:String,default:"bg-white"},bgStyles:{type:Object,default(){}},ui:{type:String,default:""},noFixed:{type:Boolean,default:!1},topRadius:{type:Number,default:0},collectIcon:{type:Boolean,default:!0},serviceIcon:{type:Boolean,default:!0},shareIcon:{type:Boolean,default:!0}},setup(e){t({});const a=()=>{s.$router.go("/pages/index/index")};return(t,l)=>{const d=T,m=L,p=c(o("su-fixed"),O);return r(),n(p,{bottom:"",placeholder:"",bg:"bg-white"},{default:i((()=>[u(m,{class:"ui-tabbar-box"},{default:i((()=>[u(m,{class:"ui-tabbar ss-flex ss-col-center ss-row-between"},{default:i((()=>[e.serviceIcon?(r(),n(m,{key:0,class:"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",onClick:a},{default:i((()=>[u(d,{class:"item-icon",src:z,mode:"aspectFit"}),u(m,{class:"item-title"},{default:i((()=>[x("首页")])),_:1})])),_:1})):v("",!0),e.shareIcon?(r(),n(m,{key:1,class:"detail-tabbar-item ss-flex ss-flex-col ss-row-center ss-col-center",onClick:l[0]||(l[0]=e=>{f(s).$router.go("/pages/index/cart")})},{default:i((()=>[u(d,{class:"item-icon",src:G,mode:"aspectFit"}),u(m,{class:"item-title"},{default:i((()=>[x("购物车")])),_:1})])),_:1})):v("",!0),S(t.$slots,"default",{},void 0,!0)])),_:3})])),_:3})])),_:3})}}},[["__scopeId","data-v-169918cd"]]),J=R({__name:"detail-skeleton",setup(t){const a=e((()=>s.$store("sys")));return(e,s)=>{const t=L,l=j,d=c(o("su-fixed"),O);return r(),n(t,{class:_(["skeleton-wrap",["theme-"+a.value.mode,"main-"+a.value.theme,"font-"+a.value.fontSize]])},{default:i((()=>[u(t,{class:"skeleton-banner"}),u(t,{class:"container-box"},{default:i((()=>[u(t,{class:"container-box-strip title ss-m-b-58"}),u(t,{class:"container-box-strip ss-m-b-20"}),u(t,{class:"container-box-strip ss-m-b-20"}),u(t,{class:"container-box-strip w-364"})])),_:1}),u(t,{class:"container-box"},{default:i((()=>[u(t,{class:"ss-flex ss-row-between ss-m-b-34"},{default:i((()=>[u(t,{class:"container-box-strip w-380"}),u(t,{class:"circle"})])),_:1}),u(t,{class:"ss-flex ss-row-between ss-m-b-34"},{default:i((()=>[u(t,{class:"container-box-strip w-556"}),u(t,{class:"circle"})])),_:1}),u(t,{class:"ss-flex ss-row-between"},{default:i((()=>[u(t,{class:"container-box-strip w-556"}),u(t,{class:"circle"})])),_:1})])),_:1}),u(t,{class:"container-box"},{default:i((()=>[u(t,{class:"container-box-strip w-198 ss-m-b-42"}),u(t,{class:"ss-flex"},{default:i((()=>[u(t,{class:"circle ss-m-r-12"}),u(t,{class:"container-box-strip w-252"})])),_:1})])),_:1}),u(d,{bottom:"",placeholder:"",bg:"bg-white"},{default:i((()=>[u(t,{class:"ui-tabbar-box"},{default:i((()=>[u(t,{class:"foot ss-flex ss-col-center"},{default:i((()=>[u(t,{class:"ss-m-r-54 ss-m-l-32"},{default:i((()=>[u(t,{class:"rec ss-m-b-8"}),u(t,{class:"oval"})])),_:1}),u(t,{class:"ss-m-r-54"},{default:i((()=>[u(t,{class:"rec ss-m-b-8"}),u(t,{class:"oval"})])),_:1}),u(t,{class:"ss-m-r-50"},{default:i((()=>[u(t,{class:"rec ss-m-b-8"}),u(t,{class:"oval"})])),_:1}),u(l,{class:"ss-reset-button add-btn ui-Shadow-Main"}),u(l,{class:"ss-reset-button buy-btn ui-Shadow-Main"})])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])}}},[["__scopeId","data-v-fc3678c9"]]),K=R({__name:"detail-comment-card",props:{goodsId:{type:[Number,String],default:0}},setup(e){const a=e,l=t({commentList:[],total:0});return F((()=>{!async function(e){const{data:s}=await H.getCommentPage(e,1,3,0);l.commentList=s.list,l.total=s.total}(a.goodsId)})),(t,a)=>{const d=L,_=j,g=C,w=c(o("s-empty"),A);return r(),n(d,{class:"detail-comment-card bg-white"},{default:i((()=>[u(d,{class:"card-header ss-flex ss-col-center ss-row-between ss-p-b-30"},{default:i((()=>[u(d,{class:"ss-flex ss-col-center"},{default:i((()=>[u(d,{class:"line"}),u(d,{class:"title ss-m-l-20 ss-m-r-10"},{default:i((()=>[x("评价")])),_:1}),u(d,{class:"des"},{default:i((()=>[x("("+y(l.total)+")",1)])),_:1})])),_:1}),l.commentList.length>0?(r(),n(d,{key:0,class:"ss-flex ss-col-center",onClick:a[0]||(a[0]=t=>f(s).$router.go("/pages/goods/comment/list",{id:e.goodsId}))},{default:i((()=>[u(_,{class:"ss-reset-button more-btn"},{default:i((()=>[x("查看全部")])),_:1}),u(g,{class:"cicon-forward"})])),_:1})):v("",!0)])),_:1}),u(d,{class:"card-content"},{default:i((()=>[(r(!0),m(p,null,b(l.commentList,(e=>(r(),n(d,{class:"comment-box ss-p-y-30",key:e.id},{default:i((()=>[u(E,{item:e},null,8,["item"])])),_:2},1024)))),128)),0===l.commentList.length?(r(),n(w,{key:0,paddingTop:"0",icon:"/static/comment-empty.png",text:"期待您的第一个评价"})):v("",!0)])),_:1})])),_:1})}}},[["__scopeId","data-v-f2cb4fc6"]]),Q=R({__name:"detail-content-card",props:{content:{type:String,default:""}},setup:e=>(s.$platform.device,(s,t)=>{const a=L,l=c(o("mp-html"),M);return r(),n(a,{class:"detail-content-card bg-white ss-m-x-20 ss-p-t-20"},{default:i((()=>[u(a,{class:"card-header ss-flex ss-col-center ss-m-b-30 ss-m-l-20"},{default:i((()=>[u(a,{class:"line"}),u(a,{class:"title ss-m-l-20 ss-m-r-20"},{default:i((()=>[x("详情")])),_:1})])),_:1}),u(a,{class:"card-content"},{default:i((()=>[u(l,{content:e.content},null,8,["content"])])),_:1})])),_:1})})},[["__scopeId","data-v-05c8b18d"]]);export{q as _,J as a,K as b,Q as c,P as d,D as e};
|