pages-product-product.768b167e.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-product"],{"0a53":function(t,a,e){"use strict";e.r(a);var o=e("ad56"),i=e("5e3e");for(var n in i)"default"!==n&&function(t){e.d(a,t,(function(){return i[t]}))}(n);e("b14e");var s,r=e("f0c5"),c=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"a2177142",null,!1,o["a"],s);a["default"]=c.exports},"5e3e":function(t,a,e){"use strict";e.r(a);var o=e("61e3"),i=e.n(o);for(var n in o)"default"!==n&&function(t){e.d(a,t,(function(){return o[t]}))}(n);a["default"]=i.a},"61e3":function(t,a,e){"use strict";var o=e("4ea4");e("a4d3"),e("e01a"),e("4160"),e("ac1f"),e("5319"),e("159b"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i=o(e("ade3")),n=o(e("5530"));e("96cf");var s,r=o(e("1da1")),c=o(e("ccc2")),d=e("64ab"),l=e("26cb"),u=(o(e("8ab5")),e("7eca")),p=e("5f30"),g=e("0c67"),f=o(e("d456")),v=o(e("e6f8")),h=o(e("6022")),m=o(e("584d")),b=o(e("bb67")),w=o(e("73be")),y=o(e("4db4")),k=o(e("3315")),x=(e("b19f"),{components:{uniNumberBox:c.default,guessLike:y.default,topSwiper:f.default,productContent:v.default,discounts:h.default,freshDetail:m.default,contentText:b.default,productBottom:w.default,estimate:k.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:"",isVip:"0"}},filters:{parseIntTo:function(t){return t=100*+t,t%1===0||(t=t.toFixed(1)),t}},onLoad:function(t){var a=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var o,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:o=a,(0,u.userinfo)({}).then((function(t){var a=t.data;o.userInfo=a,console.log(a,"123456")})),a.goodsid=t.id,a.goodsType=t.type,t.spread&&uni.setStorageSync("puid",t.spread),t.isVip&&(o.isVip=t.isVip,console.log(t,"isVip")),console.log(o.isVip,"vip"),(0,p.saveUrl)(),a.goodsDetail(),a.liulan(t.id),i=uni.getStorageSync("weichatBrowser")||"",i&&(0,g.weixindata)();case 12:case"end":return e.stop()}}),e)})))()},onShow:function(){var t=uni.getStorageSync("puid");t&&(0,u.spread)({puid:t}).then((function(t){console.log(t)}))},computed:(0,n.default)({},(0,l.mapState)(["weichatObj","baseURL","urlFile"])),methods:(s={liulan:function(t){(0,d.browse)({id:t}).then((function(t){console.log(t)}))},toFavorite:function(t){var a=this;t.userCollect=!t.userCollect,t.userCollect?collectAdd({id:a.goodsid,category:"product"}).then((function(t){uni.showToast({title:"成功加入收藏",type:"top",duration:1500})})):collectDel({id:a.goodsid,category:"product"}).then((function(t){uni.showToast({title:"成功取消收藏",type:"top",duration:1500})}))},selectSpec:function(t,a,e){a.attr_value.forEach((function(t){t.check=!1})),t.check=!0;var o=this;o.specSelected[e]=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[e]=t.attr},specOPne:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=this;a.specClass="show",a.type=t},toggleSpec:function(t){var a=this;"show"===this.specClass?(this.specClass="hide",setTimeout((function(){a.specClass="none"}),250)):"none"===this.specClass&&(this.specClass="show"),this.type=t},Getcoupon:function(){uni.navigateTo({url:"/pages/coupon/getcoupon"})},numberChange:function(t){this.goodsNumber=t.number},shareDate:function(){var t=this,a=window.location.href+"&spread="+this.userInfo.uid,e=uni.getStorageSync("weichatBrowser")||"";if(e){a=a.replace(/[\?,&]from=singlemessage/g,"");var o={link:a,imgUrl:t.goodsObjact.image,desc:t.goodsObjact.store_info,title:t.goodsObjact.store_name,success:function(t){console.log(t)}};console.log(o,"分享"),(0,g.shareLoad)(o)}},navToDetailPage:function(t){var a=t.id;uni.navigateTo({url:"/pages/product/product?id="+a})},navTo:function(t){uni.navigateTo({url:"/pages/product/reply?id="+this.goodsid})},Addcar:function(t){var a=this;(0,d.cartAdd)({cartNum:"1",uniqueId:"",new:0,mer_id:"",productId:t.id}).then((function(t){uni.showToast({title:"成功加入购物车",type:"top",duration:500,icon:"none"}),a.goodsDetail()})).catch((function(t){console.log(t)}))},goodsDetail:function(){var t=this;(0,d.goodsDetail)({},this.goodsid).then((function(a){var e=a.data;t.list=e,t.good_list=e.good_list,t.reply=e.reply;var o=e.storeInfo;if(t.goodsObjact=o,console.log(e.storeInfo,"基本商品"),null!=t.goodsObjact.description&&(t.description=t.goodsObjact.description.replace(/\<img/gi,'<img class="rich-img"')),t.imgList=o.slider_image,t.specList=e.productAttr,1!=Array.isArray(e.productValue)){t.many=2,t.specList=e.productAttr,t.productValue=e.productValue,t.specSelected=[];for(var i=0;i<t.specList.length;i++){var n=t.specList[i].attr_value[0];n.check=!0,t.specSelected.push(n.attr)}var s=t.specSelected.join(",");console.log(s,"str"),t.actionPrice=t.productValue[s].price,t.goodsNumberMax=t.productValue[s].stock,t.actionImage=t.productValue[s].image,t.uniqueId=t.productValue[s].unique,t.goodsStore=t.productValue[s].quota}else t.many=1,t.productValue=e.productValue,t.actionPrice=o.price,t.actionImage=o.image_base,t.goodsNumberMax=o.stock;t.shopId=e.mer_id,t.shareDate()}))}},(0,i.default)(s,"shareDate",(function(){var t=this,a=window.location.href+"&spread="+this.userInfo.uid,e=uni.getStorageSync("weichatBrowser")||"";if(e){a=a.replace(/[\?,&]from=singlemessage/g,"");var o={link:a,imgUrl:t.goodsObjact.image,desc:t.goodsObjact.store_info,title:t.goodsObjact.store_name,success:function(t){console.log(t)}};(0,g.shareLoad)(o)}})),(0,i.default)(s,"buy",(function(){var t=this;console.log(t.userInfo);var a={cartNum:t.goodsNumber,new:1,productId:t.goodsid,uniqueId:t.uniqueId};2==t.type&&(a.new=0),(0,d.cartAdd)(a).then((function(a){var e=a.data;1==t.type&&uni.navigateTo({url:"/pages/order/createOrder?id="+e.cartId+"&isVip="+t.isVip}),2==t.type&&(uni.showToast({title:"成功加入购物车",type:"top",duration:2e3,icon:"none"}),t.goodsDetail()),t.toggleSpec()})).catch((function(t){console.log(t)}))})),(0,i.default)(s,"buy1",(function(){var t=this,a={cartNum:t.goodsNumber,new:1,productId:t.goodsid,uniqueId:t.uniqueId};2==t.type&&(a.new=0),(0,d.cartAdd)(a).then((function(a){var e=a.data;1==t.type&&uni.navigateTo({url:"/pages/order/createOrder?id="+e.cartId}),2==t.type&&(uni.showToast({title:"成功加入购物车",type:"top",duration:2e3,icon:"none"}),t.goodsDetail()),t.toggleSpec()})).catch((function(t){console.log(t)}))})),(0,i.default)(s,"stopPrevent",(function(){})),s)});a.default=x},"7b08":function(t,a,e){var o=e("aef8");"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var i=e("4f06").default;i("3d840c2e",o,!0,{sourceMap:!1,shadowMode:!1})},ad56:function(t,a,e){"use strict";var o;e.d(a,"b",(function(){return i})),e.d(a,"c",(function(){return n})),e.d(a,"a",(function(){return o}));var i=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"container"},[e("top-swiper",{attrs:{imgList:t.imgList}}),e("product-content",{attrs:{goodsObjact:t.goodsObjact}}),e("v-uni-view",{staticClass:"c-list"},[e("v-uni-view",{staticClass:"c-row b-b",on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.toggleSpec.apply(void 0,arguments)}}},[e("v-uni-text",{staticClass:"tit"},[t._v("购买数量")]),e("v-uni-view",{staticClass:"con"},[e("v-uni-text",{staticClass:"selected-text"},[t._v(t._s(t.goodsNumber))])],1),e("v-uni-text",{staticClass:"iconfont iconenter"})],1)],1),t.reply?e("estimate",{attrs:{reply:t.reply,list:t.list},on:{navTo:function(a){arguments[0]=a=t.$handleEvent(a),t.navTo("/pages/product/reply?id="+t.goodsid)}}}):t._e(),e("fresh-detail",{attrs:{goodsObjact:t.goodsObjact}}),e("content-text",{attrs:{description:t.description}}),e("v-uni-view",{staticClass:"contentBottomHeight"}),e("product-bottom",{attrs:{goodsObjact:t.goodsObjact,isVip:t.isVip,goodsid:t.goodsid},on:{buy:function(a){arguments[0]=a=t.$handleEvent(a),t.buy.apply(void 0,arguments)},specOPne:function(a){arguments[0]=a=t.$handleEvent(a),t.specOPne.apply(void 0,arguments)}}}),e("v-uni-view",{staticClass:"popup spec",class:t.specClass,on:{touchmove:function(a){a.stopPropagation(),a.preventDefault(),arguments[0]=a=t.$handleEvent(a),t.stopPrevent.apply(void 0,arguments)},click:function(a){arguments[0]=a=t.$handleEvent(a),t.toggleSpec.apply(void 0,arguments)}}},[e("v-uni-view",{staticClass:"mask"}),e("v-uni-view",{staticClass:"layer attr-content",on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.stopPrevent.apply(void 0,arguments)}}},[e("v-uni-view",{staticClass:"a-t"},[e("v-uni-image",{attrs:{src:t.actionImage}}),e("v-uni-view",{staticClass:"right"},[e("v-uni-view",{staticClass:"good-name clamp"},[t._v(t._s(t.goodsObjact.store_name))]),e("v-uni-text",{staticClass:"price"},[t._v("¥"+t._s(t.actionPrice))])],1)],1),t._l(t.specList,(function(a,o){return e("v-uni-view",{key:o,staticClass:"attr-list"},[e("v-uni-text",[t._v(t._s(a.attr_name))]),e("v-uni-view",{staticClass:"item-list"},t._l(a.attr_value,(function(i,n){return e("v-uni-text",{key:n,staticClass:"tit",class:{selected:i.check},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selectSpec(i,a,o)}}},[t._v(t._s(i.attr))])})),1)],1)})),e("v-uni-view",{staticClass:"flex"},[e("v-uni-view",[t._v("购买数量")]),e("v-uni-view",{staticClass:"item-list"},[e("uni-number-box",{staticClass:"step",attrs:{isMin:!0,value:t.goodsNumber,min:1,max:t.goodsNumberMax},on:{eventChange:function(a){arguments[0]=a=t.$handleEvent(a),t.numberChange.apply(void 0,arguments)}}})],1)],1),e("v-uni-button",{staticClass:"btn",on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.buy.apply(void 0,arguments)}}},[t._v("确定")])],2)],1)],1)},n=[]},aef8:function(t,a,e){var o=e("24fb");a=o(!1),a.push([t.i,'@charset "UTF-8";\n/* 页面左右间距 */\n/* 文字尺寸 */\n/*文字颜色*/\n/* 边框颜色 */\n/*颜色*/\n/* 图片加载中颜色 */\n/* 行为相关颜色 */\n/* 功能栏字体大小 */\n/*功能栏左侧小图标*/p[data-v-a2177142]{display:block;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}\n/* 弹出层 */.popup[data-v-a2177142]{position:fixed;left:0;top:0;right:0;bottom:0;z-index:99}.popup.show[data-v-a2177142]{display:block}.popup.show .mask[data-v-a2177142]{-webkit-animation:showPopup-data-v-a2177142 .2s linear both;animation:showPopup-data-v-a2177142 .2s linear both}.popup.show .layer[data-v-a2177142]{-webkit-animation:showLayer-data-v-a2177142 .2s linear both;animation:showLayer-data-v-a2177142 .2s linear both}.popup.hide .mask[data-v-a2177142]{-webkit-animation:hidePopup-data-v-a2177142 .2s linear both;animation:hidePopup-data-v-a2177142 .2s linear both}.popup.hide .layer[data-v-a2177142]{-webkit-animation:hideLayer-data-v-a2177142 .2s linear both;animation:hideLayer-data-v-a2177142 .2s linear both}.popup.none[data-v-a2177142]{display:none}.popup .mask[data-v-a2177142]{position:fixed;top:0;width:100%;height:100%;z-index:1;background-color:rgba(0,0,0,.4)}.popup .layer[data-v-a2177142]{position:fixed;z-index:99;bottom:0;width:100%;min-height:30vh;border-radius:%?10?% %?10?% 0 0;background-color:#fff}.popup .layer .btn[data-v-a2177142]{height:%?66?%;line-height:%?66?%;border-radius:%?100?%;background:#ff4c4c;font-size:%?30?%;color:#fff;margin:%?30?% auto %?20?%}@-webkit-keyframes showPopup-data-v-a2177142{0%{opacity:0}100%{opacity:1}}@keyframes showPopup-data-v-a2177142{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hidePopup-data-v-a2177142{0%{opacity:1}100%{opacity:0}}@keyframes hidePopup-data-v-a2177142{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes showLayer-data-v-a2177142{0%{-webkit-transform:translateY(120%);transform:translateY(120%)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes showLayer-data-v-a2177142{0%{-webkit-transform:translateY(120%);transform:translateY(120%)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes hideLayer-data-v-a2177142{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(120%);transform:translateY(120%)}}@keyframes hideLayer-data-v-a2177142{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(120%);transform:translateY(120%)}}\n/* 规格选择弹窗 */.attr-content[data-v-a2177142]{padding:%?10?% %?30?%}.attr-content .a-t[data-v-a2177142]{display:flex}.attr-content .a-t uni-image[data-v-a2177142]{width:%?170?%;height:%?170?%;flex-shrink:0;border-radius:%?8?%}.attr-content .a-t .right[data-v-a2177142]{display:flex;flex-direction:column;padding-left:%?24?%;font-size:%?26?%;color:#606266;line-height:%?42?%}.attr-content .a-t .right .good-name[data-v-a2177142]{padding-top:%?20?%;max-width:%?320?%;font-size:%?30?%;font-family:PingFang SC;font-weight:700;color:#1d2023;line-height:%?42?%;margin-bottom:%?15?%}.attr-content .a-t .right .price[data-v-a2177142]{font-size:%?60?%;font-family:PingFang SC;font-weight:700;color:#ff6f0f}.attr-content .a-t .right .selected-text[data-v-a2177142]{margin-right:%?10?%}.attr-content .attr-list[data-v-a2177142]{display:flex;flex-direction:column;font-size:%?30?%;color:#606266;padding-top:%?30?%;padding-left:%?10?%}.attr-content .item-list[data-v-a2177142]{padding:%?20?% 0 0;display:flex;flex-wrap:wrap}.attr-content .item-list .tit[data-v-a2177142]{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-a2177142]{background:#fceff1;border:1px solid #ef041f;color:#ef041f}.goodsBottom[data-v-a2177142]{height:%?160?%}uni-page-body[data-v-a2177142]{background:#f0f0f0}.contentBottomHeight[data-v-a2177142]{height:%?110?%}.goodsBottom[data-v-a2177142]{height:%?160?%}[data-v-a2177142] .iconenter{font-size:%?30?%;color:#888}[data-v-a2177142] .con_image{width:%?130?%;height:%?130?%;display:inline-block;padding:%?15?%}[data-v-a2177142] .con_image uni-image{width:100%;height:100%}\n/* 商品详情中限制图片大小 */[data-v-a2177142] .rich-img{width:100%!important;height:auto}.c-list[data-v-a2177142]{margin-top:%?20?%;font-size:%?26?%;color:#606266;background:#fff}.c-list .c-row[data-v-a2177142]{display:flex;align-items:center;padding:%?20?% %?30?%;position:relative}.c-list .tit[data-v-a2177142]{width:%?140?%}.c-list .con[data-v-a2177142]{flex:1;color:#303133}.c-list .con .selected-text[data-v-a2177142]{margin-right:%?10?%}.c-list .bz-list[data-v-a2177142]{height:%?40?%;font-size:%?26?%;color:#303133}.c-list .bz-list uni-text[data-v-a2177142]{display:inline-block;margin-right:%?30?%}.c-list .con-list[data-v-a2177142]{flex:1;display:flex;flex-direction:column;color:#303133;line-height:%?40?%}.c-list .red[data-v-a2177142]{color:#5dbc7c}body.?%PAGE?%[data-v-a2177142]{background:#f0f0f0}',""]),t.exports=a},b14e:function(t,a,e){"use strict";var o=e("7b08"),i=e.n(o);i.a}}]);