goods.js 14 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/goods"],{"0d18":function(e,t,n){"use strict";var o=n("8031"),i=n.n(o);i.a},"3a32":function(e,t,n){"use strict";n.r(t);var o=n("a82f"),i=n("8f40");for(var a in i)"default"!==a&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("0d18");var s,c=n("f0c5"),r=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"61bdcc72",null,!1,o["a"],s);t["default"]=r.exports},4836:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("2f62"),i=a(n("e829"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(){n.e("components/page-component/goods/app-goods-banner").then(function(){return resolve(n("d9fb"))}.bind(null,n)).catch(n.oe)},u=function(){n.e("components/page-component/app-goods-recommend/app-goods-recommend").then(function(){return resolve(n("ee79"))}.bind(null,n)).catch(n.oe)},d=function(){n.e("components/page-component/app-quick-navigation/app-quick-navigation").then(function(){return resolve(n("d475"))}.bind(null,n)).catch(n.oe)},h=function(){n.e("components/basic-component/app-composition/app-composition").then(function(){return resolve(n("a664"))}.bind(null,n)).catch(n.oe)},p=function(){n.e("components/basic-component/uni-swiper-dot/uni-swiper-dot").then(function(){return resolve(n("662e"))}.bind(null,n)).catch(n.oe)},g=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/u-attr")]).then(function(){return resolve(n("338d"))}.bind(null,n)).catch(n.oe)},_=function(){n.e("components/page-component/goods/app-goods-full-reduce").then(function(){return resolve(n("bc5a"))}.bind(null,n)).catch(n.oe)},m=function(){n.e("components/page-component/goods/bd-info").then(function(){return resolve(n("543b"))}.bind(null,n)).catch(n.oe)},b=function(){Promise.all([n.e("common/vendor"),n.e("components/page-component/goods/bd-coupon")]).then(function(){return resolve(n("fb44"))}.bind(null,n)).catch(n.oe)},f=function(){n.e("components/page-component/goods/bd-xbc").then(function(){return resolve(n("48be"))}.bind(null,n)).catch(n.oe)},v=function(){n.e("components/page-component/goods/bd-kb").then(function(){return resolve(n("f02b"))}.bind(null,n)).catch(n.oe)},k=function(){n.e("components/page-component/goods/bd-hc").then(function(){return resolve(n("7eb9"))}.bind(null,n)).catch(n.oe)},w=function(){n.e("components/page-component/goods/bd-detail").then(function(){return resolve(n("7e0d"))}.bind(null,n)).catch(n.oe)},x=function(){n.e("components/page-component/goods/bd-comments").then(function(){return resolve(n("66eb"))}.bind(null,n)).catch(n.oe)},y=function(){n.e("components/basic-component/app-close/app-close").then(function(){return resolve(n("1653"))}.bind(null,n)).catch(n.oe)},T=function(){n.e("components/page-component/goods/bd-service").then(function(){return resolve(n("9413"))}.bind(null,n)).catch(n.oe)},$=function(){n.e("components/page-component/goods/bd-flash-sale").then(function(){return resolve(n("0f87"))}.bind(null,n)).catch(n.oe)},O=function(){n.e("components/page-component/goods/app-sell-tip").then(function(){return resolve(n("f3ad"))}.bind(null,n)).catch(n.oe)},S={name:"goods",mixins:[i.default],components:{appGoodsBanner:l,"app-goods-recommend":u,"app-quick-navigation":d,"app-composition":h,appClose:y,uniSwiperDot:p,appGoodsFullReduce:_,uAttr:g,bdInfo:m,bdCoupon:b,bdXbc:f,bdKb:v,bdHc:k,bdDetail:w,bdComments:x,bdService:T,bdFlashSale:$,appSellTip:O},data:function(){return{showClose:!1,is_open:0,goods:null,selectAttr:null,recommend_list:null,is_vip:!1,is_vip_card_user:0,current:0,discount:null,attrShow:!1,shareData:null,contact_tel:"",contact:"",contact_web:"",sendPath:"",poster_config:this.$api.goods.poster,poster_generate:this.$api.poster.goods_new,flash_sale:null,checked:null,services:null,detail:null,goodsId:null,composition:null,autoplay:!0,full_reduce:null,goods_marketing_award:null,express:null,goods_marketing:null,exchangeStatus:null,exchange:null,price:null,level_show:null,sales:null,unit:null,is_sales:null,extra_quick_share:null,price_max:null,price_min:null,price_member_max:null,price_member_min:null,original_price:null,subtitle:null,is_negotiable:null,name:null,app_share_pic:null,app_share_title:null,goodsType:null,favorite:null,goods_coupon_center:null,guarantee_title:null,guarantee_pic:null,param_content:null,param_name:null,attr_groups:null,goods_num:null,good_stock:null,min_number:null,limit_buy:null,disable:"disable",sell_time:0,template_message_list:[],is_finish_sell:!1,origin_icon:null,origin_name:null,goods_type:0,trade_name:null,brand_logo:null,brand_name:null}},computed:c(c(c({},(0,o.mapState)({mall:function(e){return e.mallConfig.mall},gConfig:function(e){return e.gConfig},isTip:function(e){return e.mallConfig.mall.setting.is_remind_sell_time}})),(0,o.mapGetters)("mallConfig",{getTheme:"getTheme"})),{},{good_negotiable:function(){var e=this.mall.setting.good_negotiable;this.contact_tel="",this.contact="",this.contact_web="";for(var t=[],n=0;n<e.length;n++)"contact_tel"===e[n]&&(this.contact_tel="contact_tel"),"contact"===e[n]&&(this.contact="contact"),"contact_web"===e[n]&&(this.contact_web="contact_web");return this.contact_tel&&t.push(this.contact_tel),this.contact&&t.push(this.contact),this.contact_web&&t.push(this.contact_web),t},contactBtnStyle:function(){var e=this.good_negotiable.length,t=this.getTheme.key;return 3!==e||"a"!==t&&"b"!==t&&"f"!==t?3===e&&"a"!==t&&"b"!==t&&"f"!==t?"background:".concat(this.getTheme.background_gradient_btn,";color:").concat(this.getTheme.background_s):2!==e||"a"!==t&&"b"!==t&&"f"!==t||this.contact_tel?2!==e||"a"!==t&&"b"!==t&&"f"!==t||!this.contact_tel?2!==e||"a"===t||"b"===t||"f"===t||this.contact_tel?2===e&&"a"!==t&&"b"!==t&&"f"!==t&&this.contact_tel?"background:".concat(this.getTheme.background_gradient_btn,";color:").concat(this.getTheme.background_s):"background:".concat(this.getTheme.background_gradient_btn):"background:".concat(this.getTheme.background_s_gradient_btn,";color:").concat(this.getTheme.background_s):"background:".concat(this.getTheme.background):"background:".concat(this.getTheme.background_s_gradient_btn,";"):"background:".concat(this.getTheme.background_gradient_btn)},uBottomHeight:function(){return this.full_reduce&&this.sell_time>0?"u-bottom-height-2":this.full_reduce||this.sell_time>0?"u-bottom-height-1":"u-bottom-height-0"},leftTip:function(){var e="";return e=0==this.isTip&&this.sell_time>0?"box-grow-1":"bd-btn-left bd-btn-half",this.goods&&"goods"===this.goods.type?e:""},disableBtn:function(){return this.is_finish_sell?"btn-finish-sell":"bd-oversell-btn"},contactBtn:function(){var e=this.good_negotiable.length,t=this.getTheme.key;return 3!==e||"a"!==t&&"b"!==t&&"f"!==t?3===e&&"a"!==t&&"b"!==t&&"f"!==t?"bd-three-one bd-no-radius ":2!==e||"a"!==t&&"b"!==t&&"f"!==t||this.contact_tel?2!==e||"a"!==t&&"b"!==t&&"f"!==t||!this.contact_tel?2!==e||"a"===t||"b"===t||"f"===t||this.contact_tel?2===e&&"a"!==t&&"b"!==t&&"f"!==t&&this.contact_tel?"bd-btn-half bd-content-radius-1":"text all-width all-radius ":"bd-btn-half bd-content-radius-0":"bd-btn-half bd-content-radius-1":"text bd-btn-half bd-content-radius-0":"text bd-three-one bd-no-radius "}}),onLoad:function(e){this.$commonLoad.onload(e),wx.showShareMenu({menus:["shareAppMessage","shareTimeline"]}),this.isLogin&&this.$store.dispatch("user/info"),this.goodsId=e.id,this.loadData(this.goodsId,e),this.sendPath="/pages/goods/goods?id="+e.id,console.log(this.sendPath),e&&e.exchange&&(this.exchangeStatus=e.exchange,this.exchange=e)},onShow:function(){var e=this;this.autoplay=!0,this.showClose=!1,setTimeout((function(){e.showClose=!0}))},onHidden:function(){this.autoplay=!1},onShareTimeline:function(){return this.$shareTimeline({title:this.app_share_title?this.app_share_title:this.name,imageUrl:this.goods.pic_url[0].pic_url,query:{id:this.goodsId}})},methods:{hShareAppMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.$shareAppMessage({title:this.app_share_title?this.app_share_title:this.name,imageUrl:this.app_share_pic?this.app_share_pic:this.goods.pic_url[0].pic_url,path:"/pages/goods/goods",desc:this.subtitle,params:{id:this.goodsId}},e)},getMall:function(e){this.is_open=e.is_open},toExchange:function(){var t=[{mch_id:0,goods_list:[{id:this.exchange.id,attr:this.exchange.attr,num:this.exchange.goods_num,cat_id:0,goods_attr_id:this.exchange.attr_id}],code:this.exchange.code,token:this.exchange.token}],n="/pages/order-submit/order-submit?mch_list=".concat(JSON.stringify(t));n+="&preview_url=".concat(encodeURIComponent(this.$api.exchange.exchange_preview),"&submit_url=").concat(encodeURIComponent(this.$api.exchange.exchange_submit),"&plugin=exchange"),e.navigateTo({url:n})},check:function(e){var t=e.item;this.checked=t},change:function(e){"touch"===e.detail.source&&(this.current=e.detail.current),"autoplay"===e.detail.source&&(this.current=e.detail.current)},quickShare:function(e){this.shareData=e},toComposition:function(t){var n=t.id>0?t.id:this.composition.list[0].id;e.navigateTo({url:this.composition.url+"?goods_id="+this.goodsId+"&composition_id="+n})},loadData:function(t,n){var o=this;return new Promise((function(i,a){o.$showLoading(),o.$request({url:o.$api.goods.detail,data:{id:t,plugin:n&&n.exchange?"exchange":"mall"}}).then((function(t){if(o.$hideLoading(),0===t.code){var n=t.data.goods,s=n.services,c=n.detail,r=n.name,l=n.vip_card_appoint,u=n.plugin_extra,d=n.id,h=n.goods_activity,p=n.goods_marketing_award,g=n.goods_marketing,_=n.express,m=n.price,b=n.sales,f=n.level_show,v=n.is_sales,k=n.unit,w=n.extra_quick_share,x=n.price_max,y=n.price_min,T=n.price_member_max,$=n.price_member_min,O=n.original_price,S=n.subtitle,C=n.is_negotiable,P=n.app_share_title,j=n.app_share_pic,I=n.type,M=n.favorite,D=n.goods_coupon_center,q=n.guarantee_title,A=n.guarantee_pic,L=n.param_content,B=n.param_name,R=n.attr_groups,U=n.goods_num,E=n.good_stock,F=n.min_number,G=n.limit_buy,H=n.sell_time,J=n.template_message_list,N=n.is_finish_sell,K=n.origin_icon,X=n.origin_name,z=n.goods_type,Q=n.trade_name,V=n.brand_logo,W=n.brand_name;e.setNavigationBarTitle({title:r}),o.name=r,o.app_share_pic=j,o.app_share_title=P,o.goods=t.data.goods,o.services=s,o.detail=c,o.goodsId=d,o.flash_sale=u.flash_sale,o.composition=u.composition,o.goods_marketing_award=p,o.goods_marketing=g,o.express=_,o.price=m,o.level_show=f,o.sales=b,o.unit=k,o.is_sales=v,o.price_max=x,o.price_min=y,o.price_member_max=T,o.price_member_min=$,o.original_price=O,o.subtitle=S,o.is_negotiable=C,o.extra_quick_share=w,o.goodsType=I,o.favorite=M,o.goods_coupon_center=D,o.guarantee_title=q,o.param_content=L,o.guarantee_pic=A,o.attr_groups=R,o.param_name=B,o.goods_num=U,o.good_stock=E,o.min_number=F,o.limit_buy=G,o.sell_time=H,o.template_message_list=J,o.is_finish_sell=N,o.origin_icon=K,o.origin_name=X,o.goods_type=z,o.trade_name=Q,o.brand_logo=V,o.brand_name=W,h&&(o.full_reduce=h.full_reduce),(l.discount||"0.00"===l.discount)&&(o.is_vip=!0,o.discount=l.discount),o.is_vip_card_user=l.is_vip_card_user,o.loadRecommend(),i()}else e.showToast({title:t.msg,icon:"none"}),a()})).catch((function(){a(),o.$hideLoading()}))}))},onAttr:function(e){this.selectAttr=e},loadRecommend:function(){var e=this;this.$request({url:this.$api.goods.new_recommend,data:{goods_id:this.goodsId,type:"goods"}}).then((function(t){0===t.code&&(e.recommend_list=t.data.list)}))},back:function(){e.reLaunch({url:"/pages/index/index"})},setFavorite:function(){var t=this.$api.user.favorite_add,n=!0;this.favorite&&(t=this.$api.user.favorite_remove,n=!1),this.favorite=n,this.$request({url:t,data:{goods_id:this.goodsId}}).then((function(t){0===t.code||e.showModal({title:"提示",content:t.msg,showCancel:!1})}))},clickAttr:function(t){1===t&&this.sell_time>0?this.rightTip():this.goods.buy_goods_auth?"ecard"!==this.goods.type||0!==t?this.attrShow=!0:this.$tips.showToast({title:"虚拟商品不允许加入购物车",icon:"none"}):e.showModal({title:"提示",content:"加入会员购买商品哦~亲~",success:function(t){t.confirm&&e.navigateTo({open_type:"navigate",url:"/pages/member/index/index"})}})},setCoupon:function(e){this.$set(this.goods_coupon_center[e],"is_receive",1)},router:function(t){e.navigateTo({url:t})},makePhoneCall:function(t){e.makePhoneCall({phoneNumber:t})},changeTime:function(e){this.sell_time=e,this.goods.sell_time=e}},onShareAppMessage:function(e){return"button"===e.from&&this.shareData?this.$shareAppMessage(this.shareData):this.hShareAppMessage()}};t.default=S}).call(this,n("543d")["default"])},8031:function(e,t,n){},"83b4":function(e,t,n){"use strict";(function(e){n("2d0a");o(n("66fd"));var t=o(n("3a32"));function o(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},"8f40":function(e,t,n){"use strict";n.r(t);var o=n("4836"),i=n.n(o);for(var a in o)"default"!==a&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},a82f:function(e,t,n){"use strict";var o;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.goods&&1==e.is_open&&null==e.exchangeStatus&&1===e.is_negotiable?e.__map(e.good_negotiable,(function(t,n){var o=e.__get_orig(t),i="contact_tel"!==t&&"contact"!==t&&"contact_web"===t?encodeURIComponent(e.mall.setting.web_service_url):null;return{$orig:o,m0:i}})):null);e.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]}},[["83b4","common/runtime","common/vendor"]]]);