productdetails.js 11 KB

1
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageA/productdetails"],{"182d":function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return s})),t.d(n,"a",(function(){return o}));var o={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,"aca60"))},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"))},lPainter:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-painter/components/l-painter/l-painter")]).then(t.bind(null,"154b"))},lPainterImage:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-painter/components/l-painter-image/l-painter-image")]).then(t.bind(null,"3b58"))},lPainterText:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-painter/components/l-painter-text/l-painter-text")]).then(t.bind(null,"6679"))},lPainterQrcode:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-painter/components/l-painter-qrcode/l-painter-qrcode")]).then(t.bind(null,"d1e3"))}},i=function(){var e=this,n=e.$createElement,t=(e._self._c,e.goodinfo.images?e.goodinfo.images.split(","):null),o=e.goodinfo.discount_price?e.goodinfo.discount_price.slice(0,-3):null,i=e.goodinfo.discount_price?e.goodinfo.discount_price.slice(-3):null,s=e.selectArr.length,a=s>0?e.selectArr.join(","):null,c=Number(100*e.sku_info.discount_price)*Number(100*e.value)/1e4||Number(100*e.goodinfo.discount_price)*Number(100*e.value)/1e4,u=e.selectArr.join(",")||e.i18n.selection;e.$mp.data=Object.assign({},{$root:{l0:t,g0:o,g1:i,g2:s,g3:a,m0:c,g4:u}})},s=[]},"30ae":function(e,n,t){},"4fb1":function(e,n,t){"use strict";t.r(n);var o=t("182d"),i=t("9014");for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(s);t("f835");var a=t("828b"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"82c493ea",null,!1,o["a"],void 0);n["default"]=c.exports},"7f02":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("abeb");o(t("3240"));var i=o(t("4fb1"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},9014:function(e,n,t){"use strict";t.r(n);var o=t("fab3"),i=t.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(s);n["default"]=i.a},f835:function(e,n,t){"use strict";var o=t("30ae"),i=t.n(o);i.a},fab3:function(e,n,t){"use strict";(function(e,o){var i=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=i(t("abf2")),a=t("bab7"),c=(i(t("0661")),{data:function(){return{share_merchant_id:"",toView:"",imagea:!1,goodinfoname:"",goodinfoyuan:"",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:"",picture2:"",userid:"",fu:"",name_c:"",childA:""}},computed:{i18n:function(){return this.$t("index")},list1:function(){var e=[{name:this.i18n.mineCommodity},{name:this.i18n.evaluate},{name:this.i18n.particulars}];return e}},onLoad:function(n){if(console.log(n),n.q&&"undefined"!=n.q){var t=decodeURIComponent(n.q),o=this.GetwxUrlParam(t);console.log("jsonUrl",o);var i=o.id;this.share_merchant_id=o.userid,this.id=i,this.comment(),this.detail(this.id)}else{if(e.getStorageSync("user_info")){var s=e.getStorageSync("user_info");this.userid=s.id,console.log(this.userid)}this.id=n.id,this.comment(),this.detail(this.id)}},onShow:function(){""!=e.getStorageSync("language")&&(this.language=e.getStorageSync("language")),this.recommend(),this.guarantee()},mounted:function(){var e=this;this.$refs.poster.canvasToTempFilePathSync({fileType:"jpg",quality:1,success:function(n){e.picture2=n.tempFilePath}})},methods:{toxieyi:function(){e.navigateTo({url:"/pageB/xieyi?code=rebate_proportion"})},GetwxUrlParam:function(e){var n={};if(-1!=e.indexOf("#"))for(var t=e.split("#")[1],o=t.split("&"),i=0;i<o.length;i++)n[o[i].split("=")[0]]=decodeURI(o[i].split("=")[1]);else if(-1!=e.indexOf("?"))for(var s=e.split("?")[1],a=s.split("&"),c=0;c<a.length;c++)n[a[c].split("=")[0]]=decodeURI(a[c].split("=")[1]);return n},onShareAppMessage:function(e){return"button"===e.from&&console.log(e.target),{title:"自定义分享标题",path:"/pageA/productdetails?id="+this.id}},saveImage:function(){var n=this,t=e.getFileSystemManager();t.writeFile({filePath:o.env.USER_DATA_PATH+"/img.jpg",data:this.picture2.slice(23),encoding:"base64",success:function(t){console.log(o.env.USER_DATA_PATH+"/img.jpg"),e.saveImageToPhotosAlbum({filePath:o.env.USER_DATA_PATH+"/img.jpg",success:function(t){e.showToast({title:this.i18n.savesuccessfully}),n.imagea=!1},fail:function(e){console.log("保存失败",e),n.imagea=!1}})},file:function(e){console.log("写入文件失败",e)}})},copylink:function(){this.$u.toast(this.i18n.window)},openfu:function(){this.serve=!0},returnindex:function(){e.navigateBack()},chat:function(){var n=e.getStorageSync("user_info"),t=this,o=a.conn.getUniqueId(),i=new s.default.message("txt",o);i.set({type:"txt",msg:this.i18n.merchandiseNews,to:this.goodinfo.merchant.member.easemob_username,chatType:"singleChat",ext:{type:"shopinfo",order:{name:t.name_c,image:t.goodinfo.image,discount_price:t.goodinfo.discount_price,fu:t.fu,id:t.id},user_other:t.goodinfo.merchant,user:n},success:function(n,o){e.navigateTo({url:"/pageA/chat/chat?user_other="+encodeURIComponent(JSON.stringify(t.goodinfo.merchant))+"&user_other_no="+t.goodinfo.merchant.member.easemob_username})},fail:function(e){console.log("发送消息失败")}}),a.conn.send(i.body)},sharea:function(){this.share=!0},close:function(){this.show=!1,this.share=!1,this.serve=!1,this.imagea=!1},tocomment:function(){e.navigateTo({url:"/pageA/comment?id="+this.goodinfo.merchant_goods_id})},fllow:function(){var n=this;e.$u.http.post("/api/interest/follow",{interest_type:0,interest_id:this.goodinfo.merchant_goods_id}).then((function(e){"ok1"==e?(n.$u.toast(n.i18n.shutdown),n.detail(n.id)):(n.$u.toast(n.i18n.Focus),n.detail(n.id))})).catch((function(){}))},sele:function(){this.shopcar=2,this.show=!0},shopping:function(){e.switchTab({url:"/pages/cart/cart"})},comment:function(){var n=this;e.$u.http.post("/api/goods/goods_comment",{merchant_goods_id:this.goodinfo.merchant_goods_id,page:1,limit:2}).then((function(e){n.commentlist=e.data,n.total=e.total})).catch((function(){}))},recommend:function(){var n=this;e.$u.http.post("/api/goods/recommend",{keyword:""}).then((function(e){n.swiptlist=e.reduce((function(e,n){var t=e.length-1;return e[t].length<3?e[t].push(n):e.push([n]),e}),[[]])})).catch((function(){}))},scrollToPosition:function(n){console.log(n);var t=this;this.current=n.index,console.log(this.current),this.$nextTick((function(){t.toView="scroll"+n.index,console.log("view",t.toView)})),n.index?1!=n.index&&2!=n.index||e.createSelectorQuery().select(1==n.index?"#scroll1":"#scroll2").boundingClientRect((function(n){e.createSelectorQuery().select(".page").boundingClientRect((function(t){e.pageScrollTo({duration:100,scrollTop:n.top-t.top-66})})).exec()})).exec():e.pageScrollTo({scrollTop:0,duration:300})},goshop:function(n){e.navigateTo({url:"/pageD/homepage/homepage?user_other="+encodeURIComponent(JSON.stringify(this.goodinfo.merchant))+"&user_other_no="+this.goodinfo.merchant.member.easemob_username+"&merchant_id="+n+"&show="+!0})},detail:function(n){var t=this;e.$u.http.get("/api/goods/detail/"+n).then((function(e){console.log(e),t.goodinfo=e,"en-US"==t.language&&(t.name_c=t.goodinfo.name_en),"es-ES"==t.language&&(t.name_c=t.goodinfo.name_es),"it-IT"==t.language&&(t.name_c=t.goodinfo.name_ita),"zh-CN"==t.language&&(t.name_c=t.goodinfo.name_cn),t.goodinfoname=t.goodinfo.name_cn,t.goodinfoyuan=t.goodinfo.discount_price,t.comment(),t.rate=e.merchant.score})).catch((function(){}))},guarantee:function(){var n=this;e.$u.http.get("/api/agreement?code=guarantee_service").then((function(e){console.log(e),n.content=e,"en-US"==n.language&&(n.fu=n.content.name_en),"es-ES"==n.language&&(n.fu=n.content.name_es),"it-IT"==n.language&&(n.fu=n.content.name_ita),"zh-CN"==n.language&&(n.fu=n.content.name_cn)})).catch((function(){}))},actabs:function(e,n,t){var o=this;console.log("index",e),console.log("child",n),console.log("idx",t),"en-US"==this.language&&(this.childA=n.name_en),"es-ES"==this.language&&(this.childA=n.name_es),"it-IT"==this.language&&(this.childA=n.name_ita),"zh-CN"==this.language&&(this.childA=n.name),this.selectArr[e]!=this.childA?(this.$set(this.selectArr,e,this.childA),this.$set(this.subIndex,e,t)):(this.$set(this.selectArr,e,""),this.$set(this.subIndex,e,-1)),console.log("select",this.selectArr),console.log("this.selectArrindex",this.selectArr[e]),console.log("this.childA",this.childA),this.goodinfo.sku_item.forEach((function(e){console.log("ite",e),console.log('this.selectArr.join(",")',o.selectArr.join(","));var n="";"en-US"==o.language&&(n=e.item_en),"es-ES"==o.language&&(n=e.item_es),"it-IT"==o.language&&(n=e.item_ita),"zh-CN"==o.language&&(n=e.item),n==o.selectArr.join(",")&&(o.sku_info=e,o.goodinfo.discount_price=(Number(100*o.sku_info.discount_price)*Number(100*o.value)/1e4).toFixed(2),o.goodinfo.price=o.sku_info.price)})),console.log("2222",this.sku_info)},order:function(){"{}"!=JSON.stringify(this.sku_info)?0!=this.sku_info.stock_total?e.navigateTo({url:"/pageA/order?sku="+encodeURIComponent(JSON.stringify(this.sku_info))+"&value="+this.value+"&goodinfo="+encodeURIComponent(JSON.stringify(this.goodinfo))+"&share_merchant_id="+this.share_merchant_id}):(this.$u.toast(this.i18n.understock),this.show=!1):this.$u.toast(this.i18n.selection+this.i18n.specification)},builder:function(){this.imagea=!0,this.share=!1},joincart:function(){var n=this;"{}"!=JSON.stringify(this.sku_info)?0==this.sku_info.stock_total?this.$u.toast(this.i18n.understock):e.$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_member_id:this.share_merchant_id}).then((function(e){n.$u.toast(n.i18n.successfullyAdded),n.show=!1})).catch((function(){})):this.$u.toast(this.i18n.selection+this.i18n.specification)},valChange:function(e){return this.goodinfo.discount_price=(Number(100*this.sku_info.discount_price)*Number(100*e.value)/1e4).toFixed(2),e.value},navigateBack:function(){e.navigateBack()},join:function(e){this.show=!0,this.shopcar=e},inform:function(){e.showToast({title:this.i18n.shelves,icon:"none",duration:2e3})},onLongPress:function(n){var t=this,o=n.target.innerText;console.log(n),e.setClipboardData({data:o,success:function(){e.showToast({title:t.i18n.Copiedpaste,duration:2e3})},fail:function(){e.showToast({title:t.i18n.Replicationfailure,icon:"none",duration:2e3})}})}}});n.default=c}).call(this,t("df3c")["default"],t("3223")["default"])}},[["7f02","common/runtime","common/vendor"]]]);