productdetails.js 12 KB

12
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageA/productdetails"],{233:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var i=o(t(234));e.__webpack_require_UNI_MP_PLUGIN__=t,n(i.default)}).call(this,t(1)["default"],t(2)["createPage"])},234:function(e,n,t){"use strict";t.r(n);var o=t(235),i=t(237);for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return i[e]}))}(s);t(239);var a,r=t(45),c=Object(r["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,"3f9c3b1e",null,!1,o["components"],a);c.options.__file="pageA/productdetails.vue",n["default"]=c.exports},235:function(e,n,t){"use strict";t.r(n);var o=t(236);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},236:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return i})),t.d(n,"staticRenderFns",(function(){return a})),t.d(n,"recyclableRender",(function(){return s})),t.d(n,"components",(function(){return o}));try{o={uNavbar:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-navbar/u-navbar")]).then(t.bind(null,856))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-icon/u-icon")]).then(t.bind(null,980))},uTabs:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-tabs/u-tabs")]).then(t.bind(null,930))},uniRate:function(){return t.e("uni_modules/uni-rate/components/uni-rate/uni-rate").then(t.bind(null,996))},uParse:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-parse/u-parse")]).then(t.bind(null,1003))},uPopup:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-popup/u-popup")]).then(t.bind(null,1012))},uNumberBox:function(){return Promise.all([t.e("common/vendor"),t.e("uview-ui/components/u-number-box/u-number-box")]).then(t.bind(null,972))},lPainter:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-painter/components/l-painter/l-painter")]).then(t.bind(null,1020))},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,1031))},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,1036))},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,1041))}}}catch(r){if(-1===r.message.indexOf("Cannot find module")||-1===r.message.indexOf(".vue"))throw r;console.error(r.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var 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,r=Number(100*e.sku_info.discount_price)*Number(100*e.value)/1e4||Number(100*e.goodinfo.discount_price)*Number(100*e.value)/1e4,c=e.selectArr.join(",")||e.i18n.selection;e.$mp.data=Object.assign({},{$root:{l0:t,g0:o,g1:i,g2:s,g3:a,m0:r,g4:c}})},s=!1,a=[];i._withStripped=!0},237:function(e,n,t){"use strict";t.r(n);var o=t(238),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},238:function(e,n,t){"use strict";(function(e,o){var i=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=i(t(31)),a=t(30),r=(i(t(118)),{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("&"),r=0;r<a.length;r++)n[a[r].split("=")[0]]=decodeURI(a[r].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=r}).call(this,t(2)["default"],t(1)["default"])},239:function(e,n,t){"use strict";t.r(n);var o=t(240),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},240:function(e,n,t){}},[[233,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../.sourcemap/mp-weixin/pageA/productdetails.js.map