product.shop.js 11.8 KB
webpackJsonp([9],{0:function(t,o,e){"use strict";var n=e(2),i=e(18),s=e(50),r=e(320);n.use(i),n.use(s),new n({el:"#shop",components:{shopBox:r}})},4:function(t,o,e){(function(o){"use strict";function e(t){var e=void 0,n={mask:!1,delay:2e3,txt:""};"string"==typeof t?o.extend(n,{txt:t}):o.extend(n,t);var i='<div class="tip-box"><div class="tip">'+n.txt+"</div></div>",s=o(".tip-box");s.length&&(e=s.data("timer"),clearTimeout(e),s.remove());var r=o(i).appendTo(document.body);r.data("timer",setTimeout(function(){r.remove()},n.delay))}t.exports=e}).call(o,e(1))},5:function(t,o,e){"use strict";var n=e(2),i=new n;t.exports=i},6:function(t,o,e){"use strict";var n=e(2);n.filter("resize",function(t,o,e,n){return t?t.replace(/(\{width}|\{height}|\{mode})/g,function(t){var i={"{width}":o,"{height}":e,"{mode}":n||2};return i[t]}):""}),n.filter("clothingGenderIdentity",function(t){var o=null;switch(t){case 1:o="男款";break;case 2:o="女款";break;default:o="通用"}return o}),n.filter("brandUrl",function(t){return"/brand?domain="+t}),n.filter("convertOrderState",function(t){var o="";switch("undefined"==typeof t&&(t=parseInt(t,10)),t){case 0:o="待付款";break;case 1:o="待发货";break;case 2:o="待发货";break;case 3:o="待发货";break;case 4:o="待收货";break;case 5:o="待发货";break;case 6:o="已完成";break;default:o=""}return o}),n.filter("convertTime",function(t){if("undefined"!=typeof t){var o=new Date(1e3*parseFloat(t)),e=o.getFullYear()+"-",n=(o.getMonth()+1<10?"0"+(o.getMonth()+1):o.getMonth()+1)+"-",i=o.getDate()+" ",s=o.getHours()+":",r=o.getMinutes()+":",a=o.getSeconds();return e+n+i+s+r+a}})},24:function(t,o,e){"use strict";var n=e(5);t.exports={props:{disableFetch:Boolean,data:Array},computed:{whenEmpty:function(){return!this.data.length}},methods:{fetch:function(){n.$emit("list.paging")}}}},28:function(t,o){},30:function(t,o){t.exports=' <div class=goods-box v-infinite-scroll=fetch() infinite-scroll-disable=disableFetch> <ul class="cardlist card-large clearfix"> <li class=card v-for="item in data"> <div class=card-pic> <a href=/product/{{item.productId}}> <img v-lazy="item.goodsList[0].imagesUrl | resize 372 499" alt={{item.productName}}> </a> </div> <div class=card-bd> <h2 class=card-label> <a href=/product/{{item.productId}} class=line-clamp-2>{{item.productName}}</a> </h2> <span class=good-price :class="{\'old-price\': item.marketPrice}" v-if=item.marketPrice>¥ {{item.marketPrice}}</span> <span class=good-price :class="{\'sale-price\': item.marketPrice}">¥ {{item.salesPrice}}</span> </div> </li> </ul> <p class="cardlist--loading text-center" v-show=inLoading>正在加载...</p> <p class="cardlist--end text-center" v-show="atEnd ">--End--</p> </div> '},31:function(t,o,e){var n,i;e(28),n=e(24),i=e(30),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)},113:function(t,o){"use strict";t.exports={props:{on:Boolean}}},114:function(t,o,e){"use strict";var n=e(1),i=e(5);t.exports={props:{config:Object},data:function(){return{params:{},selected:{}}},watch:{},methods:{clearVals:function(){this.$set("params",{})},setCateParams:function(t,o){this.$set("params."+t,o)},okAction:function(){i.$emit("filter.change",{val:this.params,ref:this._uid})},entrySub:function(t){i.$emit("filter.sub.show",{val:t,ref:this._uid})}},filters:{unifyTxt:function(t,o){var e="",i=[],s=n.noop;return n.isArray(t)&&(s=function(t,e){i.push(e[o+"Name"])}),n.each(t,s),e=i.join(",")},txt:function(t){var o={color:"Color颜色",gender:"Gender性别",size:"Size尺寸",brand:"Brand品牌",priceRange:"Price价格",groupSort:"Category品类",discount:"Sale折扣"};return o[t]||""}}}},124:function(t,o,e){"use strict";var n=e(4),i={isApp:/yh_blk/i.test((navigator.userAgent||"").toLowerCase()),data:window.yohoInterfaceData,goTap:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.tab",arguments:t}):n("暂不支持,请在BLK应用中打开")},goLogin:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.login",arguments:t}):n("暂不支持,请在BLK应用中打开")},goLogout:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.loginout",arguments:t}):n("暂不支持,请在BLK应用中打开")},goShopingKey:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.shoppingkey",arguments:t}):n("暂不支持,请在BLK应用中打开")},goShopingCart:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.shopingCart",arguments:t}):n("暂不支持,请在BLK应用中打开")},goAddress:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.address",arguments:t}):n("暂不支持,请在BLK应用中打开")},goImageBrowser:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.imageBrowser",arguments:t}):n("暂不支持,请在BLK应用中打开")},goNewPage:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.newPage",arguments:t}):n("暂不支持,请在BLK应用中打开")},goPay:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.pay",arguments:t}):n("暂不支持,请在BLK应用中打开")},goBack:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.back",arguments:t}):n("暂不支持,请在BLK应用中打开")},goShare:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.share",arguments:t}):n("暂不支持,请在BLK应用中打开")},goSearch:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.search",arguments:t}):n("暂不支持,请在BLK应用中打开")},goSetting:function(t,o,e){this.isApp?window.yohoInterface.triggerEvent(o||function(){},e||function(){},{method:"go.setting",arguments:t}):n("暂不支持,请在BLK应用中打开")},addNativeMethod:function(t,o){window.yohoInterface[t]=o}};t.exports=i},130:function(t,o){},131:function(t,o){},141:function(t,o){t.exports=" <div class=drawer :class=\"{'drawer-open': on }\" v-show=on> <div class=drawer-main v-el:main> <slot></slot> </div> </div> "},142:function(t,o){t.exports=' <div class=filter> <div class=filter-actions> <a href=javascript:; class=filter-action @click=clearVals>清空</a> <button class="button button-small filter-action" @click=okAction>确定</button> </div> <div class=filter-params> <ul class=filter-cates> <li class=filter-cate v-for="classify in config" @click=entrySub($key)> <i class="icon icon-right right"></i> <span class=filter-cate-label>{{$key | txt }}</span> <span class=filter-cate-val>{{params[$key] | unifyTxt $key }}</span> </li> </ul> </div> </div> '},151:function(t,o,e){var n,i;e(130),n=e(113),i=e(141),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)},152:function(t,o,e){var n,i;e(131),n=e(114),i=e(142),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)},198:function(t,o,e){(function(o){"use strict";var n=e(1),i=e(38),s=e(5),r=e(4),a=e(322),c=e(321),p=e(31),f=e(151),u=e(152);e(6),t.exports={data:function(){return{domain:i.domain,shareData:{},shopInfo:{},sortConfig:o.sortConfig,filterConfig:o.filterConfig,url:"/product/get-brand-shop-goods",sort:"",filter:{},page:0,totalPage:3,productList:[],inSearching:!1}},watch:{domain:function(){this.getShopInfo()},sort:function(){this.research()},filter:function(){this.research()}},methods:{getShopInfo:function(){var t=this;n.get({url:"/product/get-shop-info",data:{domain:this.domain}}).done(function(o){o?(t.shopInfo=o,t.shopInfo.showBrandInfo=!0,t.shareData={title:o.brandName,link:"/brand-share?domain="+t.domain,img:o.brandBg}):t.shopInfo.showBrandInfo=!1}).fail(function(){r("网络错误")})},getProductList:function(){var t=this,o={};n.ajax({url:this.url,data:o}).done(function(o){t.productList=o.data.productList}).fail(function(){r("网络错误")})},search:function(){var t=this,o=this;this.inSearching||this.page&&this.page+1>this.totalPage||(this.inSearching=!0,this.page++,n.post(this.url,{sort:this.sort,filter:this.filter,page:this.page}).done(function(o){t.productList=o.data.productList}).fail(function(t){o.page--,console.log(t)}).always(function(){o.inSearching=!1}))},openFilterSub:function(){console.log("TODO: open filter sub")},research:function(){this.page=0,this.$set("productList",[]),this.search()}},components:{topBar:a,shopTop:c,goodsList:p,drawer:f,filter:u},created:function(){this.getShopInfo(),s.$on("list.paging",function(){this.search()}),s.$on("sort.change",function(t){var o=t.val;console.log(o),this.sort=o}),s.$on("filter.change",function(t){var o=t.val;console.log(o),this.filter=o,this.$refs.drawer.on=!1}),s.$on("filter.sub.show",function(t){var o=t.val;this.openFilterSub(o)})}}}).call(o,function(){return this}())},199:function(t,o){"use strict";t.exports={props:{shopInfo:{type:Object}},data:function(){return{showMore:!1}},methods:{introTrans:function(){this.showMore=this.showMore!==!0}}}},200:function(t,o,e){"use strict";var n=e(124),i=e(1),s=e(4);t.exports={props:{shareData:{type:Object}},methods:{goShare:function(){n.goShare(this.shareData,function(){},function(){})},goBack:function(){n.goBack({},function(){},function(){})},collectShop:function(){var t=this,o={shopId:this.shareData.shopId,isFav:this.shareData.isFav};i.post({url:"/collect-shop",data:o}).done(function(o){200===o.code?t.shareData.isFav=t.shareData.isFav!==!0:s("网络错误")}).fail(function(){s("网络错误")})},showFilter:function(){}}}},251:function(t,o){},252:function(t,o){},286:function(t,o){t.exports=" <top-bar v-bind:share-data=shareData></top-bar> <shop-top v-bind:shop-info=shopInfo></shop-top> <goods-list v-bind:data=productList></goods-list> <drawer v-ref:drawer> <filter :config.once=filterConfig></filter> </drawer> "},287:function(t,o){t.exports=' <div v-if=shopInfo.showBrandInfo class=brand-top-box v-bind:style="{ \'background-image\': `url(${shopInfo.brandBg})` }"> <div class=brand-bottom> <img v-if=shopInfo.showBrandLogo v-lazy=brandIntro.brandLogo alt="{{ shopInfo.brandName }}"> <div v-else class=brand-title>{{ shopInfo.brandName }}</div> <hr> <div v-show=showMore transition=brand-intro v-bind:class="{ \'brand-short\': !showMore }">{{ shopInfo.brandIntro }}</div> </div> <div v-if=!showMore class="showmore expand" @click=introTrans()><span class=icon>&#xe602;</span></div> <div v-else class="showmore collapse" @click=introTrans()><span class=icon>&#xe617;</span></div> </div> '},288:function(t,o){t.exports=' <div class="top-box clearfix"> <span class="icon back" @click=goBack()>&#xe606;</span> <div class=right> <span class=icon v-bind:class="{\'favorite\': shareData.isFav}" @click=collectShop()>&#xe609;</span> <span class="icon share" @click=goShare()>&#xe60e;</span> <span class="icon filter" @click=showFilter()>&#xe60b;</span> </div> </div> '},320:function(t,o,e){var n,i;n=e(198),i=e(286),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)},321:function(t,o,e){var n,i;e(251),n=e(199),i=e(287),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)},322:function(t,o,e){var n,i;e(252),n=e(200),i=e(288),t.exports=n||{},t.exports.__esModule&&(t.exports=t.exports["default"]),i&&(("function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports).template=i)}});