Files
ZangShiQi/public/weapp/pages_tool/store_notes/note_detail.js
2026-04-05 10:48:38 +08:00

1 line
6.2 KiB
JavaScript
Executable File

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages_tool/store_notes/note_detail"],{"21e3":function(e,o,t){"use strict";(function(e,o){var i=t("47a9");t("d381");i(t("3240"));var n=i(t("61c7"));e.__webpack_require_UNI_MP_PLUGIN__=t,o(n.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"508c":function(e,o,t){"use strict";var i=t("7624"),n=t.n(i);n.a},"55e9":function(e,o,t){"use strict";t.d(o,"b",(function(){return n})),t.d(o,"c",(function(){return s})),t.d(o,"a",(function(){return i}));var i={nsMpHtml:function(){return t.e("components/ns-mp-html/ns-mp-html").then(t.bind(null,"d108"))},loadingCover:function(){return t.e("components/loading-cover/loading-cover").then(t.bind(null,"c003"))},hoverNav:function(){return t.e("components/hover-nav/hover-nav").then(t.bind(null,"c1f1"))},nsLogin:function(){return Promise.all([t.e("common/vendor"),t.e("components/ns-login/ns-login")]).then(t.bind(null,"2910"))}},n=function(){var e=this,o=e.$createElement,t=(e._self._c,"goods_item"==e.noteType?e.$util.img(e.goodsItemInfo.goods_image):null),i="goods_item"==e.noteType?e.goodsItemInfo.goods_highlights.length:null,n="goods_item"==e.noteType&&1==e.goodsItemInfo.is_show_release_time?e.$util.timeStampTurnTime(e.goodsItemInfo.create_time,"Y-m-d"):null,s="goods_item"==e.noteType?e.goodsItemInfo.goods_list.length:null,a="goods_item"!=e.noteType&&"shop_said"==e.noteType&&1==e.shopSaidInfo.is_show_release_time?e.$util.timeStampTurnTime(e.shopSaidInfo.create_time,"Y-m-d"):null,d="goods_item"!=e.noteType&&"shop_said"==e.noteType?e.__map(e.shopSaidInfo.goods_list,(function(o,t){var i=e.__get_orig(o),n=e.shopSaidInfo.goods_list?e.$util.img(o.goods_image.split(",")[0]):null;return{$orig:i,g5:n}})):null;e.$mp.data=Object.assign({},{$root:{g0:t,g1:i,g2:n,g3:s,g4:a,l0:d}})},s=[]},"61c7":function(e,o,t){"use strict";t.r(o);var i=t("55e9"),n=t("a282");for(var s in n)["default"].indexOf(s)<0&&function(e){t.d(o,e,(function(){return n[e]}))}(s);t("508c");var a=t("828b"),d=Object(a["a"])(n["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);o["default"]=d.exports},"729aa":function(e,o,t){"use strict";(function(e){var i=t("47a9");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;i(t("0817"));var n={components:{},data:function(){return{noteId:"",noteType:"",goodsItemInfo:{},shopSaidInfo:{},giveLikeIdent:!1,giveLikeFlag:!1,shareImg:""}},onLoad:function(o){var t=this;if(setTimeout((function(){t.addonIsExist.notes||(t.$util.showToast({title:"商家未开启店铺笔记",mask:!0,duration:2e3}),setTimeout((function(){t.$util.redirectTo("/pages/index/index")}),2e3))}),1e3),o.source_member&&e.setStorageSync("source_member",o.source_member),o.scene){var i=decodeURIComponent(o.scene);i=i.split("&"),i.length&&i.forEach((function(o){-1!=o.indexOf("sku_id")&&(t.skuId=o.split("-")[1]),-1!=o.indexOf("m")&&e.setStorageSync("source_member",o.split("-")[1]),-1!=o.indexOf("is_test")&&e.setStorageSync("is_test",1)}))}o.note_id?(this.noteId=o.note_id,this.getNoteDetail()):this.$util.redirectTo("/pages_tool/store_notes/note_list",{},"redirectTo")},onShow:function(){this.storeToken&&(e.getStorageSync("source_member")&&this.$util.onSourceMember(e.getStorageSync("source_member")),this.isDianzan())},onShareAppMessage:function(){var e="goods_item"==this.noteType?this.goodsItemInfo.note_title:this.shopSaidInfo.note_title,o="goods_item"==this.noteType?this.goodsItemInfo.cover_img:this.shopSaidInfo.cover_img;o=this.$util.img(o.split(",")[0]);var t=this.$util.getCurrentShareRoute(this.memberInfo?this.memberInfo.member_id:0),i=t.path;return{title:e,path:i,imageUrl:o}},onShareTimeline:function(){var e="goods_item"==this.noteType?this.goodsItemInfo.note_title:this.shopSaidInfo.note_title,o=this.$util.getCurrentShareRoute(this.memberInfo?this.memberInfo.member_id:0),t="goods_item"==this.noteType?this.goodsItemInfo.cover_img:this.shopSaidInfo.cover_img;t=this.$util.img(t.split(",")[0]);var i=o.query;return{title:e,query:i,imageUrl:t}},methods:{getNoteDetail:function(){var e=this;this.$api.sendRequest({url:"/notes/api/notes/detail",data:{note_id:this.noteId},success:function(o){0==o.code&&o.data?(e.noteType=o.data.note_type,"goods_item"==e.noteType?(e.goodsItemInfo=o.data,e.goodsItemInfo.goods_image?e.shareImg=e.$util.img(e.goodsItemInfo.goods_image):e.shareImg=e.$util.getDefaultImage().goods,e.goodsItemInfo.goods_list.length?e.goodsItemInfo.goods_image=e.goodsItemInfo.goods_list[0].goods_image.split(",")[0]:e.goodsItemInfo.goods_image=e.$util.getDefaultImage().goods,e.goodsItemInfo.goods_highlights&&(e.goodsItemInfo.goods_highlights=e.goodsItemInfo.goods_highlights.split(","))):e.shopSaidInfo=o.data):e.$util.redirectTo("/pages_tool/store_notes/note_list",{},"redirectTo"),e.$refs.loadingCover&&e.$refs.loadingCover.hide()}})},giveLike:function(){var e=this;if(this.storeToken){if(this.giveLikeFlag)return!1;this.giveLikeFlag=!0;var o=this.giveLikeIdent?"/notes/api/record/delete":"/notes/api/record/add";this.$api.sendRequest({url:o,data:{note_id:this.noteId},success:function(o){e.giveLikeFlag=!1,0==o.code&&o.data>0?("goods_item"!=e.noteType?e.shopSaidInfo.dianzan_num=e.giveLikeIdent?e.shopSaidInfo.dianzan_num-1:e.shopSaidInfo.dianzan_num+1:e.goodsItemInfo.dianzan_num=e.giveLikeIdent?e.goodsItemInfo.dianzan_num-1:e.goodsItemInfo.dianzan_num+1,e.giveLikeIdent=!e.giveLikeIdent):e.$util.showToast({title:o.message})}})}else this.$refs.login.open("/pages/index/index")},isDianzan:function(){var e=this;this.$api.sendRequest({url:"/notes/api/record/isDianzan",data:{note_id:this.noteId},success:function(o){0==o.code?e.giveLikeIdent=1==o.data:e.$util.showToast({title:o.message})}})},redirectToGoods:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=o?e:e.goods_list[0].goods_id;this.$util.redirectTo("/pages/goods/detail",{goods_id:t})},imageError:function(){this.goodsItemInfo.goods_image&&(this.goodsItemInfo.goods_image=this.$util.getDefaultImage().goods),this.$forceUpdate()}}};o.default=n}).call(this,t("df3c")["default"])},7624:function(e,o,t){},a282:function(e,o,t){"use strict";t.r(o);var i=t("729aa"),n=t.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){t.d(o,e,(function(){return i[e]}))}(s);o["default"]=n.a}},[["21e3","common/runtime","common/vendor"]]]);