1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-product"],{"094d":function(t,e,a){"use strict";var o=a("4ea4");a("a4d3"),a("e01a"),a("4160"),a("ac1f"),a("5319"),a("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(a("5530"));a("96cf");var s=o(a("1da1")),n=a("6884"),d=a("26cb"),r=(o(a("450b")),a("0cf6")),c=o(a("f58d")),u=a("76a9"),p=o(a("bc68")),l=o(a("785b")),g=o(a("2d0b")),v=o(a("ab3d")),f=o(a("584f")),h=o(a("ea55")),m=o(a("d3c5")),b=o(a("2070")),y={components:{guessLike:m.default,topSwiper:p.default,productContent:l.default,discounts:g.default,freshDetail:v.default,contentText:f.default,productBottom:h.default,estimate:b.default,uniNumberBox:c.default},data:function(){return{goodsStore:0,specList:[],buys_show:!0,buys_shows:!1,specSelected:[],specClass:"none",many:1,reply:"",list:"",type:1,goodsType:0,goodsNumber:1,goodsid:"",description:"",goodsObjact:{percent:1},imgList:[],actionPrice:0,actionImage:"",good_list:"",goodsNumberMax:0,seckillObj:{stopTime:0,stop:!1,stopTimeH:0,stopTimeM:0,stopTimeS:0,stopTimeD:0,upTime:0},pink:{id:"",uid:"",people:"",price:"",stop_time:"",nickname:"",avatar:"",count:"",h:"",i:"",s:""},userInfo:""}},filters:{parseIntTo:function(t){return t=100*+t,t%1===0||(t=t.toFixed(1)),t}},onLoad:function(t){var e=this;return(0,s.default)(regeneratorRuntime.mark((function a(){var o,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:o=e,o.userInfo=uni.getStorageSync("userInfo"),e.goodsid=t.id,e.goodsType=t.type,t.spread&&uni.setStorageSync("spread",t.spread),(0,r.saveUrl)(),e.goodsDetail(),i=uni.getStorageSync("weichatBrowser")||"",i&&(0,u.weixindata)();case 9:case"end":return a.stop()}}),a)})))()},computed:(0,i.default)({},(0,d.mapState)(["weichatObj","baseURL","urlFile"])),onShareAppMessage:function(t){var e=getCurrentPages(),a=e[e.length-1],o=a.route,i=a.options,s={title:this.goodsObjact.store_name+" 价格:"+this.goodsObjact.price,path:o+"?id="+i.id+"&spread="+this.userInfo.uid,imageUrl:this.goodsObjact.image,success:function(t){t.errMsg},fail:function(){"shareAppMessage:fail cancel"==res.errMsg||res.errMsg}};return s},methods:{numberChange:function(t){this.goodsNumber=t.number},selectSpec:function(t,e,a){e.attr_value.forEach((function(t){t.check=!1})),t.check=!0;var o=this;o.specSelected[a]=t.attr;var i=o.specSelected.join(",");o.productValue[i]?(o.buys_show=!0,o.buys_shows=!1,o.actionPrice=o.productValue[i].price,o.goodsNumberMax=o.productValue[i].stock,o.actionImage=o.productValue[i].image,o.uniqueId=o.productValue[i].unique,o.goodsStore=o.productValue[i].stock):(o.buys_show=!1,o.buys_shows=!0),0==o.goodsStore&&(o.buys_show=!1,o.buys_shows=!0),o.specSelected[a]=t.attr},specOPne:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this;e.specClass="show",e.type=t},toggleSpec:function(t){var e=this;"show"===this.specClass?(this.specClass="hide",setTimeout((function(){e.specClass="none"}),250)):"none"===this.specClass&&(this.specClass="show"),this.type=t},Getcoupon:function(){uni.navigateTo({url:"/pages/coupon/getcoupon"})},navToDetailPage:function(t){var e=t.id;uni.navigateTo({url:"/pages/product/product?id="+e})},navTo:function(t){uni.navigateTo({url:"/pages/product/reply?id="+this.goodsid})},Addcar:function(t){var e=this,a={cartNum:"1",uniqueId:"",new:0,mer_id:"",productId:t.id};(0,n.cartAdd)(a).then((function(t){uni.showToast({title:"成功加入购物车",type:"top",duration:500,icon:"none"}),e.goodsDetail()})).catch((function(t){console.log(t)}))},goodsDetail:function(){var t=this;(0,n.goodsDetail)({},this.goodsid).then((function(e){var a=e.data;t.list=a,t.good_list=a.good_list,t.reply=a.reply;var o=a.storeInfo;if(t.goodsObjact=o,null!=t.goodsObjact.description&&(t.description=t.goodsObjact.description.replace(/\<img/gi,'<img class="rich-img"')),t.imgList=o.slider_image,t.specList=a.productAttr,t.goodsStore=o.stock,1!=Array.isArray(a.productValue)){t.many=2,t.specList=a.productAttr,t.productValue=a.productValue,t.specSelected=[];for(var i=0;i<t.specList.length;i++){var s=t.specList[i].attr_value[0];s.check=!0,t.specSelected.push(s.attr)}var n=t.specSelected.join(",");console.log(n,"str"),t.actionPrice=t.productValue[n].price,t.goodsNumberMax=t.productValue[n].stock,t.actionImage=t.productValue[n].image,t.uniqueId=t.productValue[n].unique,t.goodsStore=t.productValue[n].quota}else t.many=1,t.productValue=a.productValue,t.actionPrice=o.price,t.actionImage=o.image_base,t.goodsNumberMax=o.stock;t.shopId=a.mer_id}))},buy:function(){var t=this,e={cartNum:t.goodsNumber,new:1,productId:t.goodsid,uniqueId:t.uniqueId};2==t.type&&(e.new=0),1==t.goodsObjact.is_gp&&(e.is_gp=1),(0,n.cartAdd)(e).then((function(a){var o=a.data;if(1==t.type){var i="/pages/order/createOrder?id="+o.cartId;1==t.goodsObjact.is_gp&&(e.is_gp=1,i+="&is_gp=1"),uni.navigateTo({url:i})}2==t.type&&(uni.showToast({title:"成功加入购物车",type:"top",duration:2e3,icon:"none"}),t.goodsDetail()),t.toggleSpec()})).catch((function(t){console.log(t)}))},stopPrevent:function(){}}};e.default=y},"29af":function(t,e,a){"use strict";a.r(e);var o=a("094d"),i=a.n(o);for(var s in o)"default"!==s&&function(t){a.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a},"2fec":function(t,e,a){"use strict";a.r(e);var o=a("e4ae"),i=a("29af");for(var s in i)"default"!==s&&function(t){a.d(e,t,(function(){return i[t]}))}(s);a("3d29");var n,d=a("f0c5"),r=Object(d["a"])(i["default"],o["b"],o["c"],!1,null,"ed767dd8",null,!1,o["a"],n);e["default"]=r.exports},"3d29":function(t,e,a){"use strict";var o=a("6255"),i=a.n(o);i.a},"57c3":function(t,e,a){var o=a("24fb");e=o(!1),e.push([t.i,'@charset "UTF-8";\n/* 页面左右间距 */\n/* 文字尺寸 */\n/*文字颜色*/\n/* 边框颜色 */\n/*颜色*/\n/* 图片加载中颜色 */\n/* 行为相关颜色 */\n/* 功能栏字体大小 */\n/*功能栏左侧小图标*/\n/* 弹出层 */.popup[data-v-ed767dd8]{position:fixed;left:0;top:0;right:0;bottom:0;z-index:99}.popup.show[data-v-ed767dd8]{display:block}.popup.show .mask[data-v-ed767dd8]{-webkit-animation:showPopup-data-v-ed767dd8 .2s linear both;animation:showPopup-data-v-ed767dd8 .2s linear both}.popup.show .layer[data-v-ed767dd8]{-webkit-animation:showLayer-data-v-ed767dd8 .2s linear both;animation:showLayer-data-v-ed767dd8 .2s linear both}.popup.hide .mask[data-v-ed767dd8]{-webkit-animation:hidePopup-data-v-ed767dd8 .2s linear both;animation:hidePopup-data-v-ed767dd8 .2s linear both}.popup.hide .layer[data-v-ed767dd8]{-webkit-animation:hideLayer-data-v-ed767dd8 .2s linear both;animation:hideLayer-data-v-ed767dd8 .2s linear both}.popup.none[data-v-ed767dd8]{display:none}.popup .mask[data-v-ed767dd8]{position:fixed;top:0;width:100%;height:100%;z-index:1;background-color:rgba(0,0,0,.4)}.popup .layer[data-v-ed767dd8]{position:fixed;z-index:99;bottom:0;width:100%;min-height:35vh;border-radius:%?10?% %?10?% 0 0;background-color:#fff}.popup .layer .btn[data-v-ed767dd8]{height:%?66?%;line-height:%?66?%;border-radius:%?100?%;background:#5dbc7c;font-size:%?30?%;color:#fff;margin:%?30?% auto %?20?%}@-webkit-keyframes showPopup-data-v-ed767dd8{0%{opacity:0}100%{opacity:1}}@keyframes showPopup-data-v-ed767dd8{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hidePopup-data-v-ed767dd8{0%{opacity:1}100%{opacity:0}}@keyframes hidePopup-data-v-ed767dd8{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes showLayer-data-v-ed767dd8{0%{-webkit-transform:translateY(120%);transform:translateY(120%)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes showLayer-data-v-ed767dd8{0%{-webkit-transform:translateY(120%);transform:translateY(120%)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes hideLayer-data-v-ed767dd8{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(120%);transform:translateY(120%)}}@keyframes hideLayer-data-v-ed767dd8{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(120%);transform:translateY(120%)}}\n/* 规格选择弹窗 */.attr-content[data-v-ed767dd8]{padding:%?25?% %?30?%}.attr-content .a-t[data-v-ed767dd8]{display:flex}.attr-content .a-t uni-image[data-v-ed767dd8]{width:%?170?%;height:%?170?%;flex-shrink:0;border-radius:%?8?%}.attr-content .a-t .right[data-v-ed767dd8]{display:flex;flex-direction:column;padding-left:%?24?%;font-size:%?26?%;color:#606266;line-height:%?42?%;width:75%}.attr-content .a-t .right .price[data-v-ed767dd8]{font-size:%?32?%;color:#5dbc7c;margin:%?10?% %?0?%}.attr-content .a-t .right .name[data-v-ed767dd8]{font-size:%?32?%;color:#303133;height:%?50?%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.attr-content .a-t .right .selected-text[data-v-ed767dd8]{margin-right:%?10?%}.attr-content .attr-list[data-v-ed767dd8]{display:flex;flex-direction:column;font-size:%?30?%;color:#606266;padding-top:%?30?%;padding-left:%?10?%}.attr-content .item-list[data-v-ed767dd8]{padding:%?20?% 0 0;display:flex;flex-wrap:wrap}.attr-content .item-list uni-text[data-v-ed767dd8]{display:flex;align-items:center;justify-content:center;background:#eee;margin-right:%?20?%;margin-bottom:%?20?%;border-radius:%?100?%;min-width:%?60?%;height:%?60?%;padding:0 %?20?%;font-size:%?28?%;color:#303133}.attr-content .item-list .selected[data-v-ed767dd8]{background:#ddffdf;color:#5dbc7c}.goodsBottom[data-v-ed767dd8]{height:%?160?%}uni-page-body[data-v-ed767dd8]{background:#f0f0f0}.contentBottomHeight[data-v-ed767dd8]{height:%?110?%}.goodsBottom[data-v-ed767dd8]{height:%?160?%}[data-v-ed767dd8] .iconenter{font-size:%?30?%;color:#888}[data-v-ed767dd8] .con_image{width:%?130?%;height:%?130?%;display:inline-block;padding:%?15?%}[data-v-ed767dd8] .con_image uni-image{width:100%;height:100%}\n/* 商品详情中限制图片大小 */[data-v-ed767dd8] .rich-img{width:100%!important;height:auto}body.?%PAGE?%[data-v-ed767dd8]{background:#f0f0f0}',""]),t.exports=e},6255:function(t,e,a){var o=a("57c3");"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var i=a("4f06").default;i("6801cbe0",o,!0,{sourceMap:!1,shadowMode:!1})},e4ae:function(t,e,a){"use strict";var o;a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return s})),a.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"container"},[a("top-swiper",{attrs:{imgList:t.imgList}}),a("product-content",{attrs:{goodsObjact:t.goodsObjact}}),t.reply?a("estimate",{attrs:{reply:t.reply,list:t.list},on:{navTo:function(e){arguments[0]=e=t.$handleEvent(e),t.navTo("/pages/product/reply?id="+t.goodsid)}}}):t._e(),a("fresh-detail",{attrs:{goodsObjact:t.goodsObjact}}),a("content-text",{attrs:{description:t.description}}),a("v-uni-view",{staticClass:"contentBottomHeight"}),t.goodsObjact.id?a("product-bottom",{attrs:{goodsObjact:t.goodsObjact,goodsid:t.goodsid},on:{buy:function(e){arguments[0]=e=t.$handleEvent(e),t.buy.apply(void 0,arguments)},specOPne:function(e){arguments[0]=e=t.$handleEvent(e),t.specOPne.apply(void 0,arguments)}}}):t._e(),a("v-uni-view",{staticClass:"popup spec",class:t.specClass,on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e),t.stopPrevent.apply(void 0,arguments)},click:function(e){arguments[0]=e=t.$handleEvent(e),t.toggleSpec.apply(void 0,arguments)}}},[a("v-uni-view",{staticClass:"mask"}),a("v-uni-view",{staticClass:"layer attr-content",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.stopPrevent.apply(void 0,arguments)}}},[a("v-uni-view",{staticClass:"a-t"},[a("v-uni-image",{attrs:{src:t.actionImage}}),a("v-uni-view",{staticClass:"right"},[a("v-uni-text",{staticClass:"name"},[t._v(t._s(t.goodsObjact.store_name))]),a("v-uni-text",{staticClass:"price"},[t._v("¥"+t._s(t.actionPrice*t.goodsNumber))]),a("v-uni-text",{staticClass:"stock"},[t._v("库存:"+t._s(t.goodsStore)+"件")]),""!=t.specList?a("v-uni-view",{staticClass:"selected"},[t._v("已选:"),t._l(t.specSelected,(function(e,o){return a("v-uni-text",{key:o,staticClass:"selected-text"},[t._v(t._s(e))])}))],2):t._e()],1)],1),t._l(t.specList,(function(e,o){return a("v-uni-view",{key:o,staticClass:"attr-list"},[a("v-uni-text",[t._v(t._s(e.attr_name))]),a("v-uni-view",{staticClass:"item-list"},t._l(e.attr_value,(function(i,s){return a("v-uni-text",{key:s,staticClass:"tit",class:{selected:i.check},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.selectSpec(i,e,o)}}},[t._v(t._s(i.attr))])})),1)],1)})),1!=t.goodsObjact.is_gp?a("v-uni-view",{staticClass:"attr-list"},[a("v-uni-text",[t._v("购买数量")]),a("v-uni-view",{staticClass:"item-list"},[a("uni-number-box",{staticClass:"step",attrs:{isMin:!0,value:t.goodsNumber,min:1,max:t.goodsNumberMax},on:{eventChange:function(e){arguments[0]=e=t.$handleEvent(e),t.numberChange.apply(void 0,arguments)}}})],1)],1):t._e(),a("v-uni-button",{directives:[{name:"show",rawName:"v-show",value:t.buys_show,expression:"buys_show"}],staticClass:"btn",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.buy.apply(void 0,arguments)}}},[t._v("完成")]),a("v-uni-button",{directives:[{name:"show",rawName:"v-show",value:t.buys_shows,expression:"buys_shows"}],staticClass:"btn",staticStyle:{"background-color":"#999999"}},[t._v("售罄")])],2)],1)],1)},s=[]}}]);
|