1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-addGoods-secound"],{"2a81":function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-uni-view",[t.showComponent?[o("v-uni-view",{staticClass:" writeBg "},[o("v-uni-view",{staticClass:"container_input marginTop_none"},[o("v-uni-view",{staticClass:"container_input_item"},[o("v-uni-view",{staticClass:"container_input_item_label"},[o("span",[t._v("是否推荐")])]),o("v-uni-view",{staticClass:"container_input_item_value"},[o("v-uni-switch",{staticStyle:{transform:"scale(0.8)"},attrs:{checked:1==t.addGoodsSecoundData.is_good,color:"#E93323"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.isGood.apply(void 0,arguments)}}})],1)],1),o("v-uni-view",{staticClass:"container_input_item"},[o("v-uni-view",{staticClass:"container_input_item_label"},[o("span",[t._v("是否开启礼包")])]),o("v-uni-view",{staticClass:"container_input_item_value"},[o("v-uni-switch",{staticStyle:{transform:"scale(0.8)"},attrs:{checked:1==t.addGoodsSecoundData.is_gift_bag,color:"#E93323"},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.isGiftBag.apply(void 0,arguments)}}})],1)],1)],1),o("v-uni-view",{staticClass:"tip"},[o("span",{staticClass:"iconfont"},[t._v("")]),o("span",[t._v("开启后此商品只能在分销礼包中展示并销售")])]),o("v-uni-view",{staticClass:"container_input marginTop_none"},[o("v-uni-view",{staticClass:"container_input_item"},[o("v-uni-view",{staticClass:"container_input_item_label"},[o("span",[t._v("限购数量")])]),o("v-uni-view",{staticClass:"container_input_item_value"},[o("v-uni-input",{attrs:{type:"number",value:"",placeholder:"请输入限购数量","placeholder-class":"inputPlaceHolder"},model:{value:t.addGoodsSecoundData.once_count,callback:function(e){t.$set(t.addGoodsSecoundData,"once_count",e)},expression:"addGoodsSecoundData.once_count"}})],1)],1),o("v-uni-view",{staticClass:"container_input_item"},[o("v-uni-view",{staticClass:"container_input_item_label"},[o("span",[t._v("商品排序")])]),o("v-uni-view",{staticClass:"container_input_item_value"},[o("v-uni-input",{attrs:{type:"number",value:"",placeholder:"请输入商品排序","placeholder-class":"inputPlaceHolder"},model:{value:t.addGoodsSecoundData.sort,callback:function(e){t.$set(t.addGoodsSecoundData,"sort",e)},expression:"addGoodsSecoundData.sort"}})],1)],1)],1),o("v-uni-view",{staticClass:"content_list"},[o("v-uni-view",{staticClass:"content_list_item",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.inputGoodsDetils.apply(void 0,arguments)}}},[o("v-uni-view",[t._v("商品详情")]),o("v-uni-view",{staticClass:"content_list_item_han"},[t.disModel?o("span",{staticStyle:{color:"#000000"}},[t._v("去修改")]):o("span",[t._v("设置详情")]),o("span",{staticClass:"iconfont"},[t._v("")])])],1),o("v-uni-view",{staticClass:"content_list_video"},[o("v-uni-view",{staticClass:"content_list_video_title"},[t._v("商品视频")]),o("v-uni-view",{staticClass:"video_list"},[t.addGoodsSecoundData.video_link?o("v-uni-view",{staticClass:"video_list_item photo"},[o("v-uni-view",{staticClass:"jiao",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.deleteImage()}}},[o("v-uni-video",{attrs:{src:t.addGoodsSecoundData.video_link}}),o("v-uni-image",{attrs:{src:n("7920"),mode:"widthFix"}})],1),o("v-uni-view",{staticStyle:{position:"absolute"}},[o("v-uni-view",{staticClass:"videoHover",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.videoshow.apply(void 0,arguments)}}}),o("v-uni-text",{staticClass:"video-text"},[t._v("点击可预览视频")])],1)],1):o("v-uni-view",{staticClass:"photo",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.uploadVideo.apply(void 0,arguments)}}},[o("v-uni-view",[o("v-uni-image",{attrs:{src:n("b90b"),mode:"widthFix"}})],1),o("v-uni-view",[t._v("添加视频")])],1)],1)],1)],1),t.showVideo?o("v-uni-view",{staticClass:"video-count"},[o("v-uni-video",{staticClass:"videoLink",attrs:{id:"myVideo",autoplay:!0,loop:!0,muted:!0,src:t.addGoodsSecoundData.video_link}})],1):t._e(),o("v-uni-view",{staticClass:"mask",attrs:{catchtouchmove:"true",hidden:0==t.showVideo},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.showVideo=!1}}}),o("v-uni-view",{staticClass:"handle dobuButton"},[o("v-uni-view",{staticClass:"handle_button margin_right",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.lastStep.apply(void 0,arguments)}}},[t._v("上一步")]),o("v-uni-view",{staticClass:"handle_button",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submitCreatedGoods.apply(void 0,arguments)}}},[t._v("提交")])],1)],1)]:t._e(),o("v-uni-view",{staticClass:"handle_button",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submitCreatedGoods.apply(void 0,arguments)}}},[t._v("提交")])],2)},i=[]},"390a":function(t,e,n){"use strict";n.r(e);var o=n("9877"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},"61a3":function(t,e,n){var o=n("24fb");e=o(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.container[data-v-838e3f96]{padding-top:%?20?%;padding-bottom:%?156?%}.bar-code[data-v-838e3f96]{height:%?80?%;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #eee;margin-bottom:%?20?%}.bar-code uni-input[data-v-838e3f96]{text-align:right}.tip[data-v-838e3f96]{padding:%?16?% 0 0 %?20?%;font-size:%?22?%;color:#e93323;display:flex;align-items:center;margin-bottom:%?40?%}.tip .iconfont[data-v-838e3f96]{display:inline-block;margin-right:%?10?%}.popup_group[data-v-838e3f96]{background:#fff;margin:%?31?% auto;width:%?710?%;font-size:%?30?%;border-radius:%?10?%}.popup_group .icon_top[data-v-838e3f96]{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup_group .icon_bottom[data-v-838e3f96]{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.popup_group .popup_group_item[data-v-838e3f96]{padding:%?32?% %?30?%;display:flex;align-items:center;justify-content:space-between}.popup_group .popup_group_item .popup_group_item_value[data-v-838e3f96]{display:flex;align-items:center}.popup_group .popup_group_item .popup_group_item_value .popup_group_item_message[data-v-838e3f96]{margin-right:%?15?%;color:#bbb;max-width:%?400?%}.popup_group .popup_group_item .popup_group_item_value .popup_group_item_message_value[data-v-838e3f96]{display:inline-block;max-width:%?400?%;color:#000}.popup_group .popup_group_item .popup_group_item_value .iconfont[data-v-838e3f96]{color:#bbb}.popup_group .popup_group_item .popup_group_item_value uni-input[data-v-838e3f96]{text-align:right}.popup_group > uni-view[data-v-838e3f96]:not(:last-child){border-bottom:1px solid #eee}.handle[data-v-838e3f96]{width:100%;height:%?126?%;background:#fff;display:flex;align-items:center;justify-content:center;position:fixed;left:0;bottom:0;z-index:10}.handle_button[data-v-838e3f96]{width:%?690?%;height:%?86?%;background:#e93323;border-radius:43px;display:flex;align-items:center;justify-content:center;font-size:%?32?%;color:#fff}.input_content[data-v-838e3f96]{background:#fff;padding:%?20?% %?30?% %?40?% %?30?%;width:%?710?%;margin:auto;box-sizing:border-box;border-radius:%?10?%}.input_content_textarea[data-v-838e3f96]{border-bottom:1px solid #eee;padding-bottom:%?19?%}.input_content_textarea uni-textarea[data-v-838e3f96]{height:%?114?%}.input_content_textarea > uni-view[data-v-838e3f96]{text-align:right;color:#666;font-size:%?24?%}.input_content_photo[data-v-838e3f96]{margin-top:%?30?%;display:flex;flex-wrap:wrap}.input_content_photo_adPh[data-v-838e3f96]{position:relative;width:%?210?%;height:%?210?%;border:1px solid #ddd;display:flex;flex-direction:column;justify-content:center;border-radius:%?8?%;margin-right:%?10?%;margin-bottom:%?10?%;box-sizing:border-box}.input_content_photo_adPh[data-v-838e3f96]:nth-child(3n){margin-right:0}.input_content_photo_adPh > uni-view[data-v-838e3f96]:nth-child(1){height:%?37?%;margin-bottom:%?16?%;display:flex;justify-content:center}.input_content_photo_adPh > uni-view:nth-child(1) uni-image[data-v-838e3f96]{width:%?45?%;display:block}.input_content_photo_adPh > uni-view[data-v-838e3f96]:nth-child(2){text-align:center;color:#bbb;font-size:%?24?%}.input_content_photo_adPh .photos[data-v-838e3f96]{width:%?206?%}.input_content_photo_adPh_jiao[data-v-838e3f96]{position:absolute;top:%?-2?%;right:%?-1?%;width:%?40?%;height:%?40?%;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;border-radius:0 %?8?% 0 %?8?%}.input_content_photo_adPh_jiao uni-image[data-v-838e3f96]{width:%?16?%;height:%?16?%}.input_content_describe[data-v-838e3f96]{border-top:1px solid #eee;padding-top:%?30?%;padding-bottom:%?47?%;border-bottom:1px solid #eee}.input_content_describe_title[data-v-838e3f96]{display:flex;align-items:center;justify-content:space-between}.input_content_describe_title_msg[data-v-838e3f96]{color:#333;font-size:%?30?%}.input_content_describe_title_num[data-v-838e3f96]{color:#666;font-size:%?24?%}.input_content_describe_textarea[data-v-838e3f96]{border-radius:10px;margin-top:%?20?%;height:%?180?%;background:#f5f5f5;padding:%?20?%}.input_content_describe_textarea uni-textarea[data-v-838e3f96]{font-size:%?28?%;height:%?150?%}.input_content_keyword[data-v-838e3f96]{padding-top:%?32?%;display:flex;align-items:center;justify-content:space-between;font-size:%?30?%}.input_content_keyword_value[data-v-838e3f96]{flex:1;margin-left:%?30?%}.input_content_keyword_value uni-input[data-v-838e3f96]{width:100%;text-align:right}.photo_count[data-v-838e3f96]{margin-top:%?28?%}.photo_count .photo_size[data-v-838e3f96]{font-size:%?24?%;color:#999}.radio[data-v-838e3f96]{padding:%?30?%}.radio_label[data-v-838e3f96]{padding-left:%?10?%;color:#333;font-size:%?30?%;display:flex;align-items:center}.radio_label .select_check[data-v-838e3f96]{display:flex;align-items:center;justify-content:center;width:%?40?%;height:%?40?%;border:1px solid #ccc;border-radius:50%;margin-right:%?20?%}.radio_label .select_check .iconfont[data-v-838e3f96]{font-size:%?24?%}.radio_label .select[data-v-838e3f96]{background:#e93323;border:none}.radio_label .select .iconfont[data-v-838e3f96]{color:#fff}.radio .select_group[data-v-838e3f96]{display:flex}.radio .flex_start[data-v-838e3f96]{padding:0 %?10?%;margin-top:%?40?%;justify-content:flex-start}.radio_select[data-v-838e3f96]{display:flex;margin-right:%?110?%}.dobuButton[data-v-838e3f96]{padding:0 %?30?%}.margin_right[data-v-838e3f96]{background:#fd6523;margin-right:%?30?%}.content_list[data-v-838e3f96]{width:%?710?%;margin:auto;padding:0 %?20?%;box-sizing:border-box;background:#fff;margin-top:%?31?%;border-radius:%?10?%}.content_list .content_list_item[data-v-838e3f96]{padding:%?32?% %?10?%;display:flex;justify-content:space-between;border-bottom:1px solid #eee}.content_list .content_list_item .content_list_item_han[data-v-838e3f96]{color:#bbb;display:flex;align-items:center}.content_list .content_list_video[data-v-838e3f96]{min-height:%?154?%;padding:%?23?% %?10?%;display:flex;justify-content:space-between}.content_list .content_list_video .content_list_video_title[data-v-838e3f96]{padding-top:%?10?%}.content_list .content_list_video .video_list[data-v-838e3f96]{flex:1;display:flex;justify-content:flex-end;flex-wrap:wrap}.videoHover[data-v-838e3f96]{width:%?180?%;height:%?180?%;display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;z-index:10}.videoHover uni-view[data-v-838e3f96]{width:%?50?%;height:%?50?%;background:#000;border-radius:%?50?%;display:flex;align-items:center;justify-content:center}.videoHover uni-view .iconfont[data-v-838e3f96]{color:#fff;font-size:%?21?%}.photo[data-v-838e3f96]{border:1px solid #ddd;opacity:1;border-radius:%?8?%;font-size:%?28?%;display:flex;flex-direction:column;justify-content:center;text-align:center;width:%?150?%;height:%?150?%;box-sizing:border-box;color:#bbb;margin-left:%?16?%;position:relative;margin-bottom:%?12?%}.photo uni-image[data-v-838e3f96]{width:%?62?%;margin-bottom:%?10?%}.jiao uni-image[data-v-838e3f96]{position:absolute;top:%?-14?%;right:%?-14?%;width:%?40?%;height:%?40?%;border-radius:50%;padding:%?8?%;background:#e93323;z-index:999}.jiao uni-video[data-v-838e3f96]{width:%?150?%;height:%?150?%}.preview_video[data-v-838e3f96]{position:absolute}.container_input[data-v-838e3f96]{background:#fff;padding:0 %?20?%;width:%?710?%;margin:auto;margin-top:%?31?%;border-radius:%?10?%}.container_input_item[data-v-838e3f96]{display:flex;height:%?106?%;align-items:center}.container_input_item .select_and_input[data-v-838e3f96]{display:flex;align-items:center;justify-content:space-between}.container_input_item .select_and_input .greyColor[data-v-838e3f96]{color:#bbb}.container_input_item .radio[data-v-838e3f96]{padding:%?30?% 0}.container_input_item_label[data-v-838e3f96]{padding-left:%?10?%;color:#333;font-size:%?30?%;display:flex;align-items:center}.container_input_item_label .select_check[data-v-838e3f96]{display:flex;align-items:center;justify-content:center;width:%?40?%;height:%?40?%;border:1px solid #ccc;border-radius:50%;margin-right:%?20?%}.container_input_item_label .select_check .iconfont[data-v-838e3f96]{font-size:%?24?%}.container_input_item_label .select[data-v-838e3f96]{background:#e93323;border:none}.container_input_item_label .select .iconfont[data-v-838e3f96]{color:#fff}.container_input_item_value[data-v-838e3f96]{padding-right:%?10?%;flex:1;display:flex;align-items:center;justify-content:flex-end}.container_input_item_value > span[data-v-838e3f96]:nth-child(1){display:inline-block;margin-right:%?15?%}.container_input_item_value .text[data-v-838e3f96]{color:#000;display:inline-block;max-width:%?400?%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.container_input_item_value uni-input[data-v-838e3f96]{text-align:right}.container_input_item_value .select_group[data-v-838e3f96]{display:flex}.container_input_item_value_select[data-v-838e3f96]{display:flex;margin-right:%?110?%}.container_input_item .flex_start[data-v-838e3f96]{padding:0 %?10?%;margin-top:%?40?%;justify-content:flex-start}.container_input > uni-view[data-v-838e3f96]:not(:last-child){border-bottom:1px solid #eee}.inputPlaceHolder[data-v-838e3f96]{color:#bbb}.paddingTop_none[data-v-838e3f96]{padding-top:0!important}.marginTop_none[data-v-838e3f96]{margin-top:0}.video-count[data-v-838e3f96]{position:fixed;width:%?600?%;height:%?500?%;top:50%;left:50%;margin-left:%?-300?%;margin-top:%?-250?%;z-index:100;display:flex;align-items:center;justify-content:center}.video-count .videoLink[data-v-838e3f96]{width:%?600?%;height:%?500?%}',""]),t.exports=e},7920:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAUdJREFUWEe91+1VAkEMheF3KsBS7EDoADvRSrQT7UDogFK0gniCu55ldz6S7A785AD3YWYnySQReQA+gNeU0oU7vETkEXgDnpOInIAn4Bs49EYM4V+A/vGzAlSjiF1vxCz8B9gnXfF7ILLhKV2ugN6IUrjm/gN6IWrhC8DWiFZ4FrAVwhJeBKxFWMOrgCjCE94EeBHecBPAioiEmwEtRDTcBSghhjo21va/8upoajeFyNIIM2Vbv6aNxR3uXoFC2da3Q+FrAeOy6++EW3l0C6Z7roBwK3cBck/7sC3hecIMqB21NfOECWA551FEE2AJL5wO04NZBXjCo4giIBIeQWQBa8K9iAVgi3APIjeUhhtLrpe0Tsd8LN803LIS04tJl/AWYryadQ2vIiaX03BLtcwRBcT1cqrDxCfw4plkPKHzzw4P5jtw/AWJuVgew27bMwAAAABJRU5ErkJggg=="},"7cc4":function(t,e,n){var o=n("61a3");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var i=n("4f06").default;i("60d365ef",o,!0,{sourceMap:!1,shadowMode:!1})},9877:function(t,e,n){"use strict";n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("ade3")),a=o(n("5530"));n("a9e3"),n("d3b7"),n("159b"),n("b64b"),n("4de4"),n("498a");var r=n("3093"),d=o(n("e9c8")),c=n("f89e"),s=n("fe63"),u={components:{},props:{merId:{type:[String,Number],default:""},product_id:{type:[String,Number],default:""},resetKey:{type:Boolean,default:!1},code:{type:[String,Number],default:0}},data:function(){return{showComponent:!1,showVideo:!1,disModel:!1,upload_max:10,uploadUrl:"".concat(r.HTTP_REQUEST_URL,"/api/upload/video"),addGoodsSecoundData:{is_good:0,is_gift_bag:0,sort:"",once_count:"",video_link:""}}},created:function(){this.initData()},watch:{addGoodsSecoundData:{handler:function(t){var e=this;setTimeout((function(){(0,c.setStorage)(e.product_id?"editGoodsDetils":"addGoodsSecoundData",t)}))},deep:!0},resetKey:{handler:function(t){this.initData()}}},methods:{videoshow:function(){var t=this;this.showVideo=!0,this.videoContext=uni.createVideoContext("myVideo",this),this.$nextTick((function(){t.videoContext.play()}))},initData:function(){var t=this,e={};if((0,c.getStorage)("goodsDis")&&(this.disModel=!0),this.product_id)return e=(0,c.getStorage)("editGoodsDetils"),Object.keys(this.addGoodsSecoundData).forEach((function(n){t.addGoodsSecoundData[n]=e[n]})),e.content&&((0,c.setStorage)("goodsDis",{store_name:e.content.title,imageList:e.content.image}),this.disModel=!0),void(0,c.setStorage)("canChangeSecound",!0);(0,c.getStorage)("addGoodsSecoundData")&&Object.keys(this.addGoodsSecoundData).forEach((function(e){((0,c.getStorage)("addGoodsSecoundData")[e]||0==(0,c.getStorage)("addGoodsSecoundData")[e])&&(t.addGoodsSecoundData[e]=(0,c.getStorage)("addGoodsSecoundData")[e])}))},lastStep:function(){this.$emit("lastStep")},submitCreatedGoods:function(){var t,e,n,o,i,r,d,u,l,f,p,g=this;(0,c.Loading)();var v=["addGoodsFormData","singleSpecification","attrValue","modifyPriceData","addGoodsSecoundData","goodsDis","editGoodsDetils","canChange","canChangeSecound","editCommodity"],h=0==(0,c.getStorage)("addGoodsFormData").spec_type?[(0,c.getStorage)("singleSpecification")]:(0,c.getStorage)("attrValue"),_=(0,a.default)((0,a.default)((0,a.default)({},this.addGoodsSecoundData),(0,c.getStorage)("addGoodsFormData")),{},{content:{title:(0,c.getStorage)("goodsDis")?(0,c.getStorage)("goodsDis").store_name:"",image:(0,c.getStorage)("goodsDis")?(0,c.getStorage)("goodsDis").imageList:[]},video_link:this.addGoodsSecoundData.video_link});h&&(_.attrValue=h.filter((function(t){return""!=t})),_.attrValue[0].bar_code);var m=(0,c.getStorage)("editCommodity");return Object.keys(m).forEach((function(t){_[t]=m[t]})),_.stock=null===(t=_.attrValue[0])||void 0===t?void 0:t.stock,!_.store_name||(null===(e=_.store_name)||void 0===e?void 0:e.trim().length)<=0?(0,c.Toast)("请输入商品名称"):!_.imageList||(null===(n=_.imageList)||void 0===n?void 0:n.length)<2?(0,c.Toast)("请上传2张以上商品图片"):!_.cate_name||(null===(o=_.cate_name)||void 0===o?void 0:o.trim().length)<=0?(0,c.Toast)("请选择平台分类"):!_.unit_name||(null===(i=_.unit_name)||void 0===i?void 0:i.trim().length)<=0?(0,c.Toast)("请输入商品单位"):null===(r=_.attrValue[0])||void 0===r||!r.price||(null===(d=_.attrValue[0])||void 0===d?void 0:d.price)<0?(0,c.Toast)("价格不能小于0"):!_.stock||_.stock<0?(0,c.Toast)("库存不能小于0"):null===(u=_.attrValue[0])||void 0===u||!u.cost||(null===(l=_.attrValue[0])||void 0===l?void 0:l.cost)<0?(0,c.Toast)("成本价不能小于0"):null===(f=_.attrValue[0])||void 0===f||!f.ot_price||(null===(p=_.attrValue[0])||void 0===p?void 0:p.ot_price)<0?(0,c.Toast)("批发价不能小于0"):((0,c.getStorage)("addGoodsFormData").spec_type,void(this.product_id?(0,s.productUpdate)(this.merId,this.product_id,_).then((function(t){v.forEach((function(t){(0,c.getStorage)(t)&&(0,c.removeStorage)(t)})),(0,c.hideLoading)(),(0,c.Modal)("提交成功","点击确定,返回商品管理",{showCancel:!1}).then((function(){uni.removeStorageSync("singleSpecification"),uni.redirectTo({url:"/pages/product/goodsOnSale/index?mer_id="+g.merId})}))})).catch((function(t){(0,c.Toast)(t)})):(0,s.productCreate)(this.merId,_).then((function(t){v.forEach((function(t){(0,c.getStorage)(t)&&(0,c.removeStorage)(t)})),(0,c.hideLoading)(),(0,c.Modal)("提交成功","点击确定,返回商品管理",{showCancel:!1}).then((function(){uni.redirectTo({url:"/pages/product/goodsOnSale/index?mer_id="+g.merId})}))})).catch((function(t){(0,c.Toast)(t)}))))},isGood:function(t){this.addGoodsSecoundData.is_good=t.detail.value?1:0},isGiftBag:function(t){this.addGoodsSecoundData.is_gift_bag=t.detail.value?1:0},switchChange:function(t,e){this.addGoodsSecoundData[e.model]=t?1:0},inputGoodsDetils:function(){(0,c.navigateTo)(1,"/pages/product/addGoods/addGoodDetils",{mer_id:this.merId})},uploadVideo:function(){var t=this;uni.chooseVideo({sourceType:["camera","album"],success:function(e){Math.ceil(e.size/1024)<1024*t.upload_max?uni.uploadFile({url:t.uploadUrl,filePath:e.tempFilePath,name:"file",formData:{user:"test"},header:(0,i.default)({},r.TOKENNAME,"Bearer "+d.default.state.app.token),success:function(e){var n=JSON.parse(e.data);t.addGoodsSecoundData.video_link=n.data.src},complete:function(t){}}):uni.showModal({title:"提示",content:"视频超出限制".concat(t.upload_max,"MB,已过滤")})},fail:function(t){}})},deleteImage:function(t){this.addGoodsSecoundData.video_link=""}}};e.default=u},b90b:function(t,e){t.exports="data:image/png;base64,i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phvdd133esw+v+va+799DT0kVw1j7jo/MlDTiVw1QgcFttO/0ENgx2bJAn17PKyRZVjrWOAg7V4JO/HrQyDASBhhR3I6g9eKJ6LwFYdB8vffHYzSFybHWBo0cNYWjgtb/WEdagOSDbpkAAAAASUVORK5CYII="},e421:function(t,e,n){"use strict";var o=n("7cc4"),i=n.n(o);i.a},f3c3:function(t,e,n){"use strict";n.r(e);var o=n("2a81"),i=n("390a");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("e421");var r=n("f0c5"),d=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,"838e3f96",null,!1,o["a"],void 0);e["default"]=d.exports},f89e:function(t,e,n){"use strict";n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.ActionSheet=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000";return new Promise((function(n,o){uni.showActionSheet({itemList:t,itemColor:e,success:function(t){n(t.tapIndex)},fail:function(t){o(t.errMsg)}})}))},e.Authorize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userInfo";return new Promise((function(e,n){uni.authorize({scope:t,success:function(t){e(t)},fail:function(t){n(t)}})}))},e.GetUserInfo=function(){return new Promise((function(t,e){uni.getUserInfo({success:function(e){t(e)},fail:function(t){e(t)}})}))},e.Loading=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"正在加载...",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uni.showLoading((0,a.default)({title:t,mask:!0},e))},e.Modal=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"提示",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"这是一个模态弹窗!",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{showCancel:!0,cancelText:"取消",confirmText:"确定"};return new Promise((function(o,i){uni.showModal((0,a.default)((0,a.default)({},n),{},{title:t,content:e,success:function(t){t.confirm&&o(),t.cancel&&i()}}))}))},e.ScrollTo=function(t){uni.pageScrollTo({scrollTop:t,duration:300})},e.Toast=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,i=(0,a.default)({title:t,duration:o,position:"center",mask:!0,icon:e||"none"},n);uni.showToast(i)},e.chooseImage=function(t){return new Promise((function(e,n){uni.chooseImage({count:t,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){e(t)},fail:function(t){n(t)}})}))},e.clearStorage=function(){try{uni.clearStorageSync()}catch(t){throw new Error("处理失败")}},e.convertObj=r,e.formatDate=d,e.getQuarterStartDate=function(){var t=new Date(u,function(){var t=0;s<3&&(t=0);2<s&&s<6&&(t=3);5<s&&s<9&&(t=6);s>8&&(t=9);return t}(),1);return d(t,"yyyy-MM-dd")},e.getStorage=function(t){var e=uni.getStorageSync(t);try{"number"!=typeof JSON.parse(e)&&(e=JSON.parse(e))}catch(n){}return e},e.hideLoading=function(){try{uni.hideLoading()}catch(t){throw new Error("处理失败")}},e.navigateBack=function(t){uni.navigateBack({delta:t})},e.navigateTo=function(t,e,n){var o=e,i="navigateTo";switch(o=n?o+"?"+r(n):o,t){case 1:i="navigateTo";break;case 2:i="redirectTo";break;case 3:i="reLaunch";break;case 4:i="switchTab";break;default:i="navigateTo";break}uni[i]({url:o,animationType:"slide-in-right",animationDuration:200})},e.pathToBase64=function(t){return new Promise((function(e,n){if("object"===("undefined"===typeof window?"undefined":(0,i.default)(window))&&"document"in window){if("function"===typeof FileReader){var o=new XMLHttpRequest;return o.open("GET",t,!0),o.responseType="blob",o.onload=function(){if(200===this.status){var t=new FileReader;t.onload=function(t){e(t.target.result)},t.onerror=n,t.readAsDataURL(this.response)}},o.onerror=n,void o.send()}var a=document.createElement("canvas"),r=a.getContext("2d"),d=new Image;return d.onload=function(){a.width=d.width,a.height=d.height,r.drawImage(d,0,0),e(a.toDataURL()),a.height=a.width=0},d.onerror=n,void(d.src=t)}"object"!==("undefined"===typeof plus?"undefined":(0,i.default)(plus))?"object"===("undefined"===typeof wx?"undefined":(0,i.default)(wx))&&wx.canIUse("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:t,encoding:"base64",success:function(t){e("data:image/png;base64,"+t.data)},fail:function(t){n(t)}}):n(new Error("not support")):plus.io.resolveLocalFileSystemURL(getLocalFilePath(t),(function(t){t.file((function(t){var o=new plus.io.FileReader;o.onload=function(t){e(t.target.result)},o.onerror=function(t){n(t)},o.readAsDataURL(t)}),(function(t){n(t)}))}),(function(t){n(t)}))}))},e.removeStorage=function(t){t&&uni.removeStorageSync(t)},e.serialize=function(t){if(null!=t&&""!=t)try{return JSON.parse(JSON.stringify(t))}catch(e){return t instanceof Array?[]:{}}return t},e.setStorage=function(t,e){if("string"==typeof e)return uni.setStorageSync(t,e),e;uni.setStorageSync(t,JSON.stringify(e))},e.showMonthFirstDay=function(){var t=(new Date).setDate(1);return d(new Date(t).getTime(),"yyyy-MM-dd")},e.showWeekFirstDay=function(){var t=new Date,e=t.getDay()||7;return t.setDate(t.getDate()-e+1),d(t,"yyyy-MM-dd")},e.throttle=function(t,e){var n,o;e=e||200;return function(){for(var i=this,a=arguments.length,r=new Array(a),d=0;d<a;d++)r[d]=arguments[d];n=r,o||(o=setTimeout((function(){o=null,t.apply(i,n)}),e))}},e.unique=function(t){t=t||[];for(var e={},n=0;n<t.length;n++){var o=JSON.stringify(t[n]);"undefined"==typeof o&&(e[o]=1)}for(var n in t.length=0,e)t[t.length]=n;return t};var i=o(n("53ca")),a=o(n("5530"));function r(t){var e,n=[];return Object.keys(t).forEach((function(e){n.push("".concat(e,"=").concat(t[e]))})),e=n.join("&"),e}function d(t,e){return t?(e=e||"yyyy-MM-dd hh:mm:ss",new Date(t).format(e)):""}n("e9c4"),n("d9e2"),n("d401"),n("d3b7"),n("159b"),n("b64b"),n("14d9"),n("99af"),n("ac1f"),n("00b4"),n("5319"),n("4d63"),n("c607"),n("2c3e"),n("25f0"),Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,String(this.getFullYear()).substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[n]:("00"+e[n]).substr(String(e[n]).length)));return t};var c=new Date,s=c.getMonth(),u=c.getYear();u+=u<2e3?1900:0},fe63:function(t,e,n){"use strict";n("7a82");var o=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.attrList=function(t,e){return i.default.get("server/".concat(t,"/attr/lst"),e,{login:!0})},e.business=function(t){return i.default.get("business/agree",t,{noAuth:!0})},e.categoryBrandlist=function(t){return i.default.get("server/".concat(t,"/category/brandlist"),{},{login:!0})},e.categoryList=function(t){return i.default.get("server/".concat(t,"/category/list"),{},{login:!0})},e.categorySelect=function(t){return i.default.get("server/".concat(t,"/category/select"),{},{login:!0})},e.getDeliveryType=function(t){return i.default.get("server/".concat(t,"/product/config"),{},{login:!0})},e.getProductDetailsAPI=void 0,e.intention=function(t){return i.default.get("intention/lst",t)},e.intentionbus=function(t){return i.default.post("intention/business",t)},e.merClassifyAdd=function(t,e){return i.default.post("server/".concat(t,"/category/create"),e,{login:!0})},e.merClassifyDetail=function(t,e){return i.default.get("server/".concat(t,"/category/detail/").concat(e),{},{login:!0})},e.merClassifyLst=function(t){return i.default.get("server/".concat(t,"/category/select"),{},{login:!0})},e.merClassifyUpdate=function(t,e,n){return i.default.post("server/".concat(t,"/category/update/").concat(e),n,{login:!0})},e.merchantUpdateAPI=e.merchantInfoAPI=void 0,e.postImport=function(t,e){return i.default.post("server/".concat(t,"/product/stockIn"),e)},e.productCreate=function(t,e){return i.default.post("server/".concat(t,"/product/create"),e,{login:!0})},e.productDeleteApi=function(t,e){return i.default.post("server/".concat(t,"/product/delete/").concat(e),{},{login:!0})},e.productDestory=function(t,e,n){return i.default.post("server/".concat(t,"/product/destory/").concat(e),n,{login:!0})},e.productDetail=function(t,e){return i.default.get("server/".concat(t,"/product/detail/").concat(e),{},{login:!0})},e.productLstApi=function(t,e){return i.default.get("server/".concat(t,"/product/lst"),e,{login:!0})},e.productOffApi=function(t,e,n){return i.default.post("server/".concat(t,"/product/status/").concat(e),n,{login:!0})},e.productRecommendApi=function(t,e,n){return i.default.post("server/".concat(t,"/product/good/").concat(e),n,{login:!0})},e.productRestore=function(t,e){return i.default.post("server/".concat(t,"/product/restore/").concat(e),{},{login:!0})},e.productTitle=function(t,e){return i.default.get("server/".concat(t,"/product/title"),e,{login:!0})},e.productUpdate=function(t,e,n){return i.default.post("server/".concat(t,"/product/update/").concat(e),n,{login:!0})},e.specificationAdd=function(t,e){return i.default.post("server/".concat(t,"/attr/create"),e,{login:!0})},e.specificationDel=function(t,e){return i.default.post("server/".concat(t,"/attr/delete"),e,{login:!0})},e.specificationDetail=function(t,e){return i.default.get("server/".concat(t,"/attr/detail/").concat(e),{},{login:!0})},e.specificationLst=function(t,e){return i.default.get("server/".concat(t,"/attr/lst"),e,{login:!0})},e.specificationUpdate=function(t,e,n){return i.default.post("server/".concat(t,"/attr/update/").concat(e),n,{login:!0})},e.spuInfo=void 0,e.storeClassifyDel=function(t,e){return i.default.post("server/".concat(t,"/category/delete/").concat(e),{},{login:!0})},e.storeClassifyLst=function(t){return i.default.get("server/".concat(t,"/category/lst"),{},{login:!0})},e.templateCreate=function(t,e){return i.default.post("server/".concat(t,"/template/create"),e,{login:!0})},e.templateDelete=function(t,e){return i.default.post("server/".concat(t,"/template/delete"),e,{login:!0})},e.templateDetail=function(t,e){return i.default.get("server/".concat(t,"/template/detail/").concat(e),{},{login:!0})},e.templateList=function(t,e){return i.default.get("server/".concat(t,"/template/lst"),e,{login:!0})},e.templateUpdate=function(t,e,n){return i.default.post("server/".concat(t,"/template/update/").concat(e),n,{login:!0})},n("99af");var i=o(n("6860"));e.getProductDetailsAPI=function(t){return i.default.get("micro/product_details",t)};e.spuInfo=function(t,e){return i.default.get("product/spu/street/"+t,e)};e.merchantInfoAPI=function(t){return i.default.get("store/merchant/info",t)};e.merchantUpdateAPI=function(t){return i.default.post("store/merchant/update",t)}}}]); |