productdetails.js 7.0 KB

1
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageA/productdetails"],{"2b85":function(n,o,t){"use strict";t.d(o,"b",(function(){return i})),t.d(o,"c",(function(){return s})),t.d(o,"a",(function(){return e}));var e={uNavbar:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-navbar/u-navbar")]).then(t.bind(null,"f3ae"))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-icon/u-icon")]).then(t.bind(null,"b73a"))},uTabs:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-tabs/u-tabs")]).then(t.bind(null,"4b1e"))},uniRate:function(){return t.e("uni_modules/uni-rate/components/uni-rate/uni-rate").then(t.bind(null,"6351"))},uParse:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-parse/u-parse")]).then(t.bind(null,"aca6"))},uPopup:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-popup/u-popup")]).then(t.bind(null,"f1b1"))},uNumberBox:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-number-box/u-number-box")]).then(t.bind(null,"c929"))}},i=function(){var n=this,o=n.$createElement,t=(n._self._c,n.goodinfo.images?n.goodinfo.images.split(","):null),e=0==n.goodinfo.is_discount?n.goodinfo.discount_price.slice(0,-3):null,i=0!=n.goodinfo.is_discount?n.goodinfo.price.slice(0,-3):null,s=0==n.goodinfo.is_discount?n.goodinfo.discount_price.slice(-3):null,u=0!=n.goodinfo.is_discount?n.goodinfo.price.slice(-3):null,c=n.selectArr.length,a=c>0?n.selectArr.join(","):null,r=JSON.stringify(n.sku_info),l=0==n.goodinfo.is_discount?Number(100*n.sku_info.discount_price)*Number(100*n.value)/1e4||Number(100*n.goodinfo.discount_price)*Number(100*n.value)/1e4:null,d=1==n.goodinfo.is_discount?Number(100*n.sku_info.price)*Number(100*n.value)/1e4||Number(100*n.goodinfo.price)*Number(100*n.value)/1e4:null,f=n.selectArr.join(",")||n.i18n.selection;n._isMounted||(n.e0=function(o){n.imagea}),n.$mp.data=Object.assign({},{$root:{l0:t,g0:e,g1:i,g2:s,g3:u,g4:c,g5:a,g6:r,m0:l,m1:d,g7:f}})},s=[]},"4fb1":function(n,o,t){"use strict";t.r(o);var e=t("2b85"),i=t("9014");for(var s in i)["default"].indexOf(s)<0&&function(n){t.d(o,n,(function(){return i[n]}))}(s);t("cc67");var u=t("828b"),c=Object(u["a"])(i["default"],e["b"],e["c"],!1,null,"67c7d7e2",null,!1,e["a"],void 0);o["default"]=c.exports},"729f":function(n,o,t){},"7f02":function(n,o,t){"use strict";(function(n,o){var e=t("47a9");t("abeb");e(t("3240"));var i=e(t("4fb1"));n.__webpack_require_UNI_MP_PLUGIN__=t,o(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},9014:function(n,o,t){"use strict";t.r(o);var e=t("fab3"),i=t.n(e);for(var s in e)["default"].indexOf(s)<0&&function(n){t.d(o,n,(function(){return e[n]}))}(s);o["default"]=i.a},cc67:function(n,o,t){"use strict";var e=t("729f"),i=t.n(e);i.a},fab3:function(n,o,t){"use strict";(function(n){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var t={data:function(){return{toView:"",imagea:!1,list1:[{name:"商品"},{name:"评价"},{name:"详情"}],current:0,show:!1,serve:!1,share:!1,value:1,swiptlist:[],actab:0,id:"",language:"zh-CN",goodinfo:{},duration:0,actidx:0,subIndex:[],selectArr:[],shopcar:"",sku_info:{},commentlist:[],total:"",rate:5,content:{},bao:""}},computed:{i18n:function(){return this.$t("index")}},onLoad:function(n){this.id=n.id,this.comment()},onShow:function(){""!=n.getStorageSync("language")&&(this.language=n.getStorageSync("language")),this.detail(this.id),this.recommend(),this.guarantee()},methods:{openfu:function(){this.serve=!0},returnindex:function(){n.switchTab({url:"/pages/index/index"})},chat:function(){n.navigateTo({url:"/pageA/chat/chat?user_other="+encodeURIComponent(JSON.stringify(this.goodinfo.merchant))+"&user_other_no="+this.goodinfo.merchant.member.easemob_username})},sharea:function(){this.share=!0},close:function(){this.show=!1,this.share=!1,this.serve=!1},tocomment:function(){n.navigateTo({url:"/pageA/comment?id="+this.goodinfo.merchant_goods_id})},fllow:function(){var o=this;n.$u.http.post("/api/interest/follow",{interest_type:0,interest_id:this.goodinfo.merchant_goods_id}).then((function(n){"ok1"==n?(o.$u.toast("取关成功"),o.detail(o.id)):(o.$u.toast("关注成功"),o.detail(o.id))})).catch((function(){}))},sele:function(){this.shopcar=2,this.show=!0},shopping:function(){n.switchTab({url:"/pages/cart/cart"})},comment:function(){var o=this;n.$u.http.post("/api/goods/goods_comment",{merchant_goods_id:this.goodinfo.merchant_goods_id,page:1,limit:2}).then((function(n){o.commentlist=n.data,o.total=n.total})).catch((function(){}))},recommend:function(){var o=this;n.$u.http.post("/api/goods/recommend",{keyword:""}).then((function(n){o.swiptlist=n.reduce((function(n,o){var t=n.length-1;return n[t].length<3?n[t].push(o):n.push([o]),n}),[[]])})).catch((function(){}))},scrollToPosition:function(n){var o=this;this.current=n.index,console.log(this.current),this.$nextTick((function(){o.toView="scroll"+n.index,console.log("view",o.toView)}))},goshop:function(){n.navigateTo({url:"/pageD/homepage/homepage"})},detail:function(o){var t=this;n.$u.http.get("/api/goods/detail/"+o).then((function(n){console.log(n),t.goodinfo=n,console.log("goodinfo.discount_price",t.goodinfo.discount_price),t.comment(),t.rate=n.merchant.score})).catch((function(){}))},guarantee:function(){var o=this;n.$u.http.get("/api/agreement?code=guarantee_service").then((function(n){console.log(n),o.content=n})).catch((function(){}))},actabs:function(n,o,t){var e=this;console.log(this.selectArr),this.selectArr[n]!=o?(this.$set(this.selectArr,n,o),this.$set(this.subIndex,n,t)):(this.$set(this.selectArr,n,""),this.$set(this.subIndex,n,-1)),this.goodinfo.sku_item.forEach((function(n){console.log(n.item),console.log(e.selectArr.join(",")),n.item==e.selectArr.join(",")&&(e.sku_info=n)})),console.log(this.sku_info)},order:function(){0!=this.sku_info.stock_total?n.navigateTo({url:"/pageA/order?sku="+encodeURIComponent(JSON.stringify(this.sku_info))+"&value="+this.value+"&goodinfo="+encodeURIComponent(JSON.stringify(this.goodinfo))}):(this.$u.toast("库存为0"),this.show=!1)},builder:function(){this.imagea=!0,this.share=!1},joincart:function(){var o=this;this.show=!1,0==this.sku_info.stock_total?this.$u.toast("添加失败,库存为0"):n.$u.http.post("/api/cart/save",{goods_id:this.id,goods_num:this.value,sku_item_id:this.sku_info.id,merchant_goods_id:this.goodinfo.merchant_goods_id,belong:this.goodinfo.source,share_merchant_id:""}).then((function(n){o.$u.toast("添加成功")})).catch((function(){}))},valChange:function(n){return n.value},navigateBack:function(){n.navigateBack()},join:function(n){this.show=!0,this.shopcar=n},inform:function(){n.showToast({title:this.i18n.shelves,icon:"none",duration:2e3})},onLongPress:function(o){var t=this,e=o.target.innerText;console.log(o),n.setClipboardData({data:e,success:function(){n.showToast({title:t.i18n.Copiedpaste,duration:2e3})},fail:function(){n.showToast({title:t.i18n.Replicationfailure,icon:"none",duration:2e3})}})}}};o.default=t}).call(this,t("df3c")["default"])}},[["7f02","common/runtime","common/vendor"]]]);