3be61f5.js 39 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[44],{796:function(t,e,o){var content=o(890);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(8).default)("06d56397",content,!0,{sourceMap:!1})},797:function(t,e,o){var content=o(892);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(8).default)("2c05c3f2",content,!0,{sourceMap:!1})},889:function(t,e,o){"use strict";o(796)},890:function(t,e,o){var d=o(7)(!1);d.push([t.i,".col_red[data-v-3d6db26a]{color:#f11111}.col_green[data-v-3d6db26a]{color:#44be95}.col_white[data-v-3d6db26a]{color:#fff}.flex-col[data-v-3d6db26a]{flex-direction:column}.flex-j-c[data-v-3d6db26a]{justify-content:center}.flex-j-sb[data-v-3d6db26a]{justify-content:space-between}.flex-j-ar[data-v-3d6db26a]{justify-content:space-around}.flex-a-c[data-v-3d6db26a]{align-items:center}.flex-a-e[data-v-3d6db26a]{align-items:flex-end}.w[data-v-3d6db26a]{width:1200px}.m-auto[data-v-3d6db26a]{margin:0 auto}.height-one[data-v-3d6db26a]{height:100%}.flex[data-v-3d6db26a]{display:flex}.text-overflow[data-v-3d6db26a]{-webkit-line-clamp:4}.text-overflow[data-v-3d6db26a],.text-overflow-2[data-v-3d6db26a]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.text-overflow-2[data-v-3d6db26a]{-webkit-line-clamp:2}.text-overflow-3[data-v-3d6db26a]{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.overflow-hide[data-v-3d6db26a],.text-overflow-3[data-v-3d6db26a]{overflow:hidden;text-overflow:ellipsis}.overflow-hide[data-v-3d6db26a]{white-space:nowrap}.hiddenScroll[data-v-3d6db26a]{scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:scroll}.hiddenScroll[data-v-3d6db26a]::-webkit-scrollbar{display:none}.finger-point[data-v-3d6db26a]{cursor:pointer}.cursor-default[data-v-3d6db26a]{cursor:default}.el-icon-circle-close[data-v-3d6db26a]{color:#fff}.micro-release-box[data-v-3d6db26a]{display:flex;flex-direction:column;align-items:center;background-color:#f6f8fa}.need[data-v-3d6db26a]{display:flex;align-self:center;color:#ec544a;margin:5px 5px 0 0}.micro-edit-area[data-v-3d6db26a]{box-sizing:border-box;width:1200px;padding:20px 20px 0;background-color:#fff;border-radius:4px;margin-top:10px}.micro-edit-area .title-input[data-v-3d6db26a]{display:flex;border-bottom:1px solid #e7e5e5}.micro-edit-area .title-input input[data-v-3d6db26a]{width:100%;border:none;outline:none;line-height:40px;font-size:16px}.micro-edit-area .content-input[data-v-3d6db26a]{display:flex}.micro-edit-area .content-input .need[data-v-3d6db26a]{margin-top:13px;align-self:flex-start}.micro-edit-area .content-input textarea[data-v-3d6db26a]{height:300px;width:100%;border:none;outline:none;padding:10px 10px 10px 0}.micro-edit-area .upload-img-box .el-divider[data-v-3d6db26a]{margin:10px 0}.micro-edit-area .upload-img-box .tips[data-v-3d6db26a]{font-size:12px;color:#999;cursor:pointer}.micro-edit-area .upload-img-box .tips[data-v-3d6db26a]:hover{color:var(--color)}.micro-edit-area .select-category-box[data-v-3d6db26a]{margin-top:30px;display:flex;align-items:center}.micro-edit-area .add-store-goods[data-v-3d6db26a]{margin-top:30px}.micro-edit-area .add-store-goods .goods-box[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box[data-v-3d6db26a]{display:inline-flex;align-items:center;width:300px;margin-right:30px}.micro-edit-area .add-store-goods .goods-box .left[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left[data-v-3d6db26a]{flex:1;padding:10px;background-color:#f3f3f3;border-radius:2px;box-sizing:border-box}.micro-edit-area .add-store-goods .goods-box .left .goods-img[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .goods-img[data-v-3d6db26a]{width:40px;height:40px;border-radius:4px}.micro-edit-area .add-store-goods .goods-box .left .goods-detail[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .goods-detail[data-v-3d6db26a]{flex:1;margin-left:5px}.micro-edit-area .add-store-goods .goods-box .left .title[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .title[data-v-3d6db26a]{max-width:150px;font-size:14px;color:#2c2c2c;margin-bottom:10px}.micro-edit-area .add-store-goods .goods-box .left .describe[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .describe[data-v-3d6db26a]{font-size:12px;color:#737373}.micro-edit-area .add-store-goods .goods-box .left .current-price[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .current-price[data-v-3d6db26a]{font-size:12px;color:#ec544a}.micro-edit-area .add-store-goods .goods-box .left .price[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .left .price[data-v-3d6db26a]{margin-left:15px;font-size:12px;color:#737373;text-decoration:line-through}.micro-edit-area .add-store-goods .goods-box .right[data-v-3d6db26a],.micro-edit-area .add-store-goods .store-box .right[data-v-3d6db26a]{padding:0 10px;line-height:2;color:#838181}.micro-edit-area .receiving-address[data-v-3d6db26a]{color:#616161;font-size:14px;padding:15px 0}.micro-edit-area .receiving-address.active[data-v-3d6db26a]{color:#ec544a}.micro-edit-area .cell-title[data-v-3d6db26a]{font-size:16px;font-weight:500;color:#424242}.other-set-box[data-v-3d6db26a]{display:flex;align-items:center;width:1200px}.other-set-box li[data-v-3d6db26a]{color:#616161;margin-right:15px}.other-set-box .active[data-v-3d6db26a]{color:#ec544a}.agreement-box[data-v-3d6db26a]{width:1200px;text-align:left;margin-top:15px}.agreement-box .agreement[data-v-3d6db26a]{margin-left:10px;cursor:pointer}.agreement-box .us_color[data-v-3d6db26a]{color:var(--color)}.agreement-content[data-v-3d6db26a]{height:450px;overflow-y:scroll}.submit-box[data-v-3d6db26a]{margin-top:35px;bottom:0;z-index:10;width:1200px;padding:10px 0;background-color:#fff;text-align:center;box-shadow:0 8px 22.6px 1px rgba(51,51,51,.3)}.choose-good-box[data-v-3d6db26a]{height:500px;overflow-y:scroll}.choose-good-box .good-top[data-v-3d6db26a]{display:flex;align-items:center}.choose-good-box .chooser_img[data-v-3d6db26a]{width:100px;height:100px;margin:10px}.choose-good-box .chooser_img img[data-v-3d6db26a]{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.choose-good-box .right[data-v-3d6db26a]{text-align:left;flex:1;margin:.875rem 0}.choose-good-box .right .price[data-v-3d6db26a]{color:#f15353;font-size:16px;line-height:1.875rem;height:1.875rem;overflow:hidden}.choose-good-box .right .price span[data-v-3d6db26a]{font-size:18px}.choose-good-box .right .option[data-v-3d6db26a]{color:#999;font-size:10px;line-height:1rem;height:1rem;overflow:hidden}.choose-good-box .Spec[data-v-3d6db26a]{padding-left:20px;margin-top:20px}.choose-good-box .Spec .spec-title[data-v-3d6db26a]{max-width:120px;min-width:40px;margin-right:15px;display:inline-block}.choose-good-box .Spec .item-box[data-v-3d6db26a]{display:flex;flex-wrap:wrap}.choose-good-box .Spec .item[data-v-3d6db26a]{margin:10px;cursor:pointer}.choose-good-box .Spec .item[data-v-3d6db26a] .el-radio__inner{display:none}.choose-good-box .Spec .item[data-v-3d6db26a]:last-child{margin-right:0}.choose-good-box .num[data-v-3d6db26a]{padding-left:19px;margin-top:24px;font-size:16px}.choose-good-box .num .input[data-v-3d6db26a]{border-radius:4px;box-sizing:border-box}.address-list-box[data-v-3d6db26a]{height:450px;overflow-y:scroll}.address-list-box .address-item[data-v-3d6db26a]{display:flex;align-items:center;padding:10px 15px;border-bottom:1px solid #efefef}.address-list-box .address-left[data-v-3d6db26a]{flex:0 0 30px}.address-list-box .address-right[data-v-3d6db26a]{flex:1;display:flex;align-items:center;justify-content:space-between}.address-list-box .address-item[data-v-3d6db26a]:hover{background-color:#efefef}.address-list-box .edit[data-v-3d6db26a]{color:var(--color)}.address-box .el-textarea[data-v-3d6db26a],.address-box[data-v-3d6db26a] .el-input{width:314px;height:42px;font-size:16px}.address-box .el-textarea[data-v-3d6db26a]{width:314px;height:110px}.address-box .el-textarea[data-v-3d6db26a] .el-textarea__inner{height:100%}.btn_wrap[data-v-3d6db26a]{justify-content:center}.btn_wrap .el-button[data-v-3d6db26a]{width:134px;height:43px;border-radius:4px}.add-goods-dialog .search-box .el-input[data-v-3d6db26a]{width:80%}.add-goods-dialog .search-box .el-button[data-v-3d6db26a]{margin-left:10px;padding:12px 30px}.add-goods-dialog .goods-list[data-v-3d6db26a]{max-height:400px;overflow-y:scroll;margin-top:20px;display:grid;grid-template-columns:1fr 1fr;grid-gap:10px 20px}.add-goods-dialog .goods-list li[data-v-3d6db26a]{flex:1;padding:10px;background-color:#f3f3f3;border-radius:2px;box-sizing:border-box}.add-goods-dialog .goods-list li .goods-img[data-v-3d6db26a]{width:40px;height:40px;border-radius:4px}.add-goods-dialog .goods-list li .goods-detail[data-v-3d6db26a]{flex:1;margin-left:5px}.add-goods-dialog .goods-list li .title[data-v-3d6db26a]{max-width:150px;font-size:14px;color:#2c2c2c;margin-bottom:10px}.add-goods-dialog .goods-list li .describe[data-v-3d6db26a]{font-size:12px;color:#737373}.add-goods-dialog .goods-list li .current-price[data-v-3d6db26a]{font-size:12px;color:#ec544a}.add-goods-dialog .goods-list li .price[data-v-3d6db26a]{margin-left:15px;font-size:12px;color:#737373;text-decoration:line-through}.add-goods-dialog .goods-list .el-icon-success[data-v-3d6db26a]{color:#ec544a}",""]),t.exports=d},891:function(t,e,o){"use strict";o(797)},892:function(t,e,o){var d=o(7)(!1);d.push([t.i,".agreement-content img{max-width:100%;height:auto;display:block}",""]),t.exports=d},989:function(t,e,o){"use strict";o.r(e);o(40),o(36),o(22),o(14),o(90),o(13),o(6),o(12),o(92),o(723),o(24),o(93);var d={data:function(){return{goodsCount:1,optionsMaxCount:1,popThumb:null,popPrice:0,popStock:0,goodsDescription:null,optionId:"",specsManage:[]}},methods:{getMaxCount:function(){this.specsManage.length==this.goodsInfo.has_many_specs.length&&(0==this.goodsInfo.stock&&(this.goodsCount=0),this.goodsCount>this.goodsInfo.stock&&(this.goodsCount=this.goodsInfo.stock))},setGoodsSpecsChangeInfo:function(){if(this.specsManage.sort((function(a,b){return a.id-b.id})),console.log(this.popThumb,"this.popThumb",this.specsManage),this.specsManage.length==this.goodsInfo.has_many_specs.length){for(var t="",e=0;e<this.specsManage.length;e++)t+=this.specsManage[e].id+"_";t=t.substring(0,t.length-1);for(var i=0;i<this.goodsInfo.has_many_options.length;i++)if(t==this.setGoodsSpecsBySort(this.goodsInfo.has_many_options[i].specs)){this.popPrice=this.goodsInfo.has_many_options[i].product_price,this.popThumb=this.fun.isTextEmpty(this.goodsInfo.has_many_options[i].thumb)?this.goodsInfo.thumb:this.goodsInfo.has_many_options[i].thumb,this.popStock=this.goodsInfo.has_many_options[i].stock,this.optionId=this.goodsInfo.has_many_options[i].id,this.goodsInfo.stock=this.goodsInfo.has_many_options[i].stock,this.goodsInfo.stock>0&&(this.goodsCount=1),console.log(this.popThumb,"this.popThumb");break}}},setGoodsSpecsBySort:function(t){var e=t.split("_");e.sort((function(a,b){return a-b}));for(var o="",d=0;d<e.length;d++)o+=e[d]+"_";return o=o.substring(0,o.length-1)},manageSpecs:function(data){var t={};if(t.id=data.id,t.specid=data.specid,t.title=data.title,this.specsManage.length>0){for(var i=0;i<this.specsManage.length;i++)this.specsManage[i].specid==t.specid&&this.specsManage.splice(i,1);this.specsManage.push(t)}else this.specsManage.push(t);if(this.specsManage.length==this.goodsInfo.has_many_specs.length){for(var e=[],o=0;o<this.goodsInfo.has_many_specs.length;o++)for(var d=0;d<this.specsManage.length;d++)if(this.goodsInfo.has_many_specs[o].id==this.specsManage[d].specid){e.push(this.specsManage[d]);break}this.specsManage=e}this.setGoodsDescription()},setGoodsDescription:function(){var t="";if(this.specsManage.length==this.goodsInfo.has_many_specs.length){t="已选择 ";for(var i=0;i<this.specsManage.length;i++)t+=this.specsManage[i].title+" ";this.goodsDescription=t}else{t="请选择 ";for(var e=0;e<this.goodsInfo.has_many_specs.length;e++)for(var o=0;o<this.specsManage.length;o++)if(this.goodsInfo.has_many_specs[e].id!=this.specsManage[o].specid){t+=this.goodsInfo.has_many_specs[e].title+" ";break}this.goodsDescription=t}},setGoodsSpecs:function(t){for(var i=0;i<this.goodsInfo.has_many_specs.length;i++)t.specid!=this.goodsInfo.has_many_specs[i].id&&this.setGoodsSpecsStatus(this.goodsInfo.has_many_specs[i].specitem,t.id)},setGoodsSpecsStatus:function(t,e){for(var o=[],i=0;i<this.goodsInfo.has_many_options.length;i++)for(var d=this.goodsInfo.has_many_options[i].specs.split("_"),r=0;r<d.length;r++)if(d[r]==e)return void o.push(this.goodsInfo.has_many_options[i]);for(var n=0;n<o.length;n++)for(var l=o[n].specs.split("_"),c=0;c<l.length;c++)if(l[c]!=e&&0==o[n].stock){for(var h=0;h<t.length;h++)if(l[c]==t[h].id)return void(t[h].c=!0)}else if(l[c]!=e&&o[n].stock>0)for(var f=0;f<t.length;f++)if(l[c]==t[f].id)return void(t[f].c=!1);console.log(o)}}},r={data:function(){return{dialogVisible:!1,isShowStreet:!1,district_select:[],districtVal:[],choose_type:"",form:{address_id:"",username:"",mobile:"",city:"",address:"",province:"",district:"",isdefault:!1,streetName:""},district:[],props:{value:"v",children:"c",label:"n"}}},mounted:function(){window.localStorage.getItem("provinceData")?this.district=JSON.parse(window.localStorage.getItem("provinceData")):this._initAddressInfo()},methods:{_initAddressInfo:function(){var t=this;this.fun.$get("member.member-address.address",{},"正在获取").then((function(e){if(1==e.result){var o=[],d=[];e.data.province.map((function(t){o.push({v:t.id,n:t.areaname,c:[]})})),e.data.city.map((function(t){d.push({parentid:t.parentid,v:t.id,n:t.areaname,c:[]})})),e.data.district.map((function(t){d.map((function(e){t.parentid==e.v&&e.c.push({v:t.id,n:t.areaname})}))})),d.map((function(t){o.map((function(e){t.parentid==e.v&&e.c.push({v:t.v,n:t.n,c:t.c})}))})),o.map((function(t){0==t.c.length?t.c="":t.c.map((function(t){0==t.c.length&&(t.c="")}))})),t.district=o,o&&window.localStorage.setItem("provinceData",JSON.stringify(o))}}))},handleChange:function(t){this.$refs.refSubCat.getCheckedNodes()[0].parent&&this.$refs.refSubCat.getCheckedNodes()[0].parent.parent&&(this.form.district=this.$refs.refSubCat.getCheckedNodes()[0].label,this.form.city=this.$refs.refSubCat.getCheckedNodes()[0].parent.label,this.form.province=this.$refs.refSubCat.getCheckedNodes()[0].parent.parent.label,this.form.streetName="",this.getStreet(this.district_select[2])),console.log(this.form)},add_new_address:function(t,e){e?(this.form.isdefault=1==e.isdefault,this.form.username=e.username,this.form.mobile=e.mobile,this.form.city=e.city,this.form.address=e.address,this.form.province=e.province,this.form.district=e.district,this.form.address_id=e.id,this.form.streetName=e.street,this.district_select=[e.province_id,e.city_id,e.district_id],this.getStreet(this.district_select[2])):(this.district_select=[],this.$forceUpdate(),this.districtVal=[],this.isShowStreet=!1,this.form={address_id:"",username:"",mobile:"",city:"",address:"",province:"",district:"",isdefault:!1,streetName:""}),this.choose_type=t,this.dialogVisible=!0},getStreet:function(param){var t=this;this.fun.$get("member.memberAddress.street",{district_id:param}).then((function(e){1===e.result&&!t.fun.isTextEmpty(e.data)&&e.data.length>0?(t.districtVal=e.data,t.isShowStreet=!0,t.$forceUpdate()):t.isShowStreet=!1})).catch((function(t){console.log(t)}))},alterAddresshandle:function(){var t=this;if(this.fun.isTextEmpty(this.form.username))this.$message.error("请输入收件人");else if(this.fun.isTextEmpty(this.form.mobile))this.$message.error("请输入联系电话");else if(/^[0-9]{1,}$/.test(this.form.mobile))if(this.isShowStreet&&this.fun.isTextEmpty(this.form.streetName))this.$message.error("请输入所在街道");else if(this.fun.isTextEmpty(this.form.address))this.$message.error("请输入详细地址");else{var e="add"==this.choose_type?"member.member-address.store":"member.member-address.update",o={};o="add"==this.choose_type?{username:this.form.username,mobile:this.form.mobile,city:this.form.city,address:this.form.address,province:null==this.form.province?"":this.form.province,isdefault:this.form.isdefault?1:0,district:this.form.district,street:this.form.streetName}:{address_id:this.form.address_id,username:this.form.username,mobile:this.form.mobile,city:this.form.city,address:this.form.address,province:null==this.form.province?"":this.form.province,isdefault:this.form.isdefault?1:0,district:this.form.district,street:this.form.streetName},this.isShowStreet||delete o.street,this.fun.$post(e,o,"提交中").then((function(e){1==e.result?(t.$message.success(e.msg),t.dialogVisible=!1,t.getAddress()):t.$message.error(e.msg)}))}else this.$message.error("请输入正确的联系电话")}}},n=o(771),l=o(716),map=o(772),c={mixins:[d,r],data:function(){return{tid:"",detailsData:{},order_id:"",wish_goods_id:"",order_address:"",uploadUrl:"",agreement_show:!1,agreementcontent:"",goods_open:0,store_open:0,wish_open:0,checkedWish:!1,releasetitle:"",releasecontents:"",releaseaddress:"",catid:"",catelist:[],imgData:[],fileList:[],location:{},showAddress:!1,popupSpecs:!1,optionId:"",per_page:15,total:0,page:1,storelistData:[],goodslistData:[],checked:!0,dialogTableVisible:!1,dialogType:"",dialogTitleText:"商品",dialogList:[],keyword:"",goodsInfo:"",selectStore:"",addressList:[],currentAddId:"",currentAddress:""}},components:{tinymceSimple:n.default,mapModal:map.default,pagination:l.default},mounted:function(){this.uploadUrl=this.fun.getRealUrl("upload.uploadPic",{}),this.getAgreement(),this.getClassificationData(),this.fun.getKey("tid")&&(this.tid=this.fun.getKey("tid"),this.getMicroDetails(this.tid))},methods:{getMicroDetails:function(t){var e=this;this.fun.$post("plugin.micro-communities.api.trick.getStrickDetail",{tid:t},"...").then((function(t){if(1==t.result){e.detailsData=t.data,e.catid=t.data.cat_id,e.releasecontents=t.data.contents,e.releaseaddress=t.data.address;for(var o=t.data.has_many_image,i=0;i<o.length;i++)e.imgData.push({url:o[i].url,uid:i,name:o[i].url,hasSuccess:!0});e.fileList=JSON.parse(JSON.stringify(e.imgData)),e.releasetitle=t.data.title,e.goodsInfo=t.data.has_one_goods||"",e.selectStore=t.data.has_one_store?t.data.has_one_store.arr||{}:"",e.location={city:t.data.city,lng:t.data.ylng,lat:t.data.ylat},t.data.order_id&&(e.order_id=t.data.order_id,e.order_address=t.data.order_address,e.wish_goods_id=t.data.wish_goods_id)}else e.$message.error(t.msg)}))},openMapModal:function(){this.$refs.mapModal.show(this.location)},handleOk:function(t){this.releaseaddress=t.address,this.location=t},getAgreement:function(){var t=this;this.fun.$get("plugin.micro-communities.api.trick.getAgreement",{validate_page:1}).then((function(e){1===e.result&&(t.agreementcontent=e.data.res.value,t.goods_open=e.data.goods_open,t.store_open=e.data.store_open,t.wish_open=Number(e.data.wish_open))}))},openProtocol:function(){this.agreement_show=!0},getWriteContent:function(content){this.releasecontents=content},getClassificationData:function(t){var e=this,o={};t&&(o.cName=t),this.fun.$get("plugin.micro-communities.api.index.getCate",o).then((function(t){1==t.result?(e.catelist=t.data.data||[],e.catelist.map((function(t){t.child.unshift({id:t.id,name:"".concat(t.name,":全部")})}))):e.$message.error(t.msg)}))},showDialog:function(t){"goods"===t?this.getGoodsMessageData():this.getStoreMessageData(),this.dialogType=t,this.dialogTitleText="goods"==t?"商品":"门店"},closeDialog:function(){this.dialogTableVisible=!1,this.dialogType="",this.keyword=""},getGoodsMessageData:function(t){var e=this,o={};o.goods_name=this.keyword,t&&(o.page=t),this.fun.$get("plugin.micro-communities.api.trick.getWishGoods",o,"...").then((function(t){1===t.result?(e.dialogTableVisible=!0,e.total=t.data.total,e.page=t.data.current_page,e.per_page=t.data.per_page,e.goodslistData=t.data.data,e.dialogList=e.goodslistData):e.$message.error(t.msg)}))},getStoreMessageData:function(t){var e=this,o={};o.store_name=this.keyword,t&&(o.page=t),this.fun.$get("plugin.micro-communities.api.trick.getStore",o,"...").then((function(t){1===t.result?(e.dialogTableVisible=!0,e.total=t.data.total,e.page=t.data.current_page,e.per_page=t.data.per_page,e.storelistData=t.data.data,e.dialogList=e.storelistData):e.$message.error(t.msg)}))},nextPage:function(t){"goods"===this.dialogType?this.getGoodsMessageData(t.page):this.getStoreMessageData(t.page)},handelSelect:function(t){"goods"===this.dialogType?this.goodsInfo=t:this.selectStore=t,this.closeDialog()},selectSpecs:function(data){data&&(this.manageSpecs(data),this.setGoodsSpecs(data)),this.setGoodsSpecsChangeInfo(),this.getMaxCount()},initPopView:function(){if(1==this.goodsInfo.has_option&&!this.optionId)for(var i=0;i<this.goodsInfo.has_many_specs.length;i++)this.goodsInfo.has_many_specs[i].description=this.goodsInfo.has_many_specs[i].specitem[0],this.selectSpecs(this.goodsInfo.has_many_specs[i].specitem[0]);this.popupSpecs=!0},buyNow:function(){this.popupSpecs=!1},getAddress:function(){var t=this;this.addressList=[],this.fun.$get("member.member-address.index",{},"获取中").then((function(e){1===e.result?(t.addressList=e.data,t.defaultAddress=e.data.filter((function(t){return 1===t.isdefault})),t.changeSelect(t.defaultAddress[0]),t.showAddress=!0):t.$message.error(e.msg)}))},changeSelect:function(t){t&&t.id&&(this.currentAddId=t.id,this.currentAddress=t,this.showAddress=!1)},pasting:function(t){var e=this,o=t.clipboardData&&t.clipboardData.items,d=null;if(o&&o.length)for(var i=0;i<o.length;i++)if(o[i].type.indexOf("image")>-1){d=o[i].getAsFile(),console.log(d),this.uploadImageM(d).then((function(t){console.log(t),t&&(e.fileList.push({url:t,uid:d.lastModified,hasSuccess:!0}),e.imgData.push({url:t,uid:d.lastModified}))}));break}},uploadImageM:function(t){var e=this;return new Promise((function(o,d){var r=new FormData;r.append("file",t),e.fun.$post(e.fun.getRealUrl("upload.uploadPic"),r,"loading","",{headers:{"Content-Type":"multipart/form-data"}}).then((function(t){1==t.result?o(t.data.img_url):(d(""),console.log("上传出错"))})).catch((function(){d(""),console.log("上传出错")}))}))},checkAllSuccess:function(){var t=this;return Object.keys(this.fileList).every((function(e){return t.fileList[e].hasSuccess}))},handleImgChange:function(t,e){this.fileList=e},handleSuccess:function(t,e,o){var d=this;if(1==t.result)this.fileList.map((function(o,r){o.uid==e.uid&&(d.fileList[r].hasSuccess=!0,d.imgData[r]={url:t.data.img_url,uid:e.uid})}));else{var r=0;this.fileList.map((function(t,o){t.uid==e.uid&&(r=o)})),this.fileList.splice(r,1),o.splice(r,1),this.$message.error(t.msg)}},handleRemove:function(t){this.imgData=this.imgData.filter((function(e){return e.uid!=t.uid})),this.fileList=this.fileList.filter((function(e){return e.uid!=t.uid}))},submitBtn:function(){var t=this;if(this.checkAllSuccess())if(this.releasetitle)if(this.releasecontents)if(this.catid)if(0==this.goods_open&&this.wish_open&&this.checkedWish&&!this.goodsInfo)this.$message.error("请添加商品");else if(0==this.goods_open&&this.wish_open&&this.checkedWish&&1==this.goodsInfo.has_option&&0==this.optionId)this.$message.error("请商品规格");else if(this.wish_open&&this.checkedWish&&!this.currentAddId)this.$message.error("请选择收货地址");else if(this.checked)if(this.wish_open&&this.checkedWish){var e=[{goods_id:this.goodsInfo.id,total:this.goodsCount,option_id:this.optionId}],o={address:encodeURIComponent(JSON.stringify(this.currentAddress)),goods:JSON.stringify(e),member_coupon_ids:JSON.stringify([]),orders:JSON.stringify([]),invoice_type:0,rise_type:1,call:"",email:"",company_number:"",dispatch_type_id:1},d="order.create";if(32==this.goodsInfo.plugin_id){if(0==this.goodsInfo.store_id)return void this.$message.error("数据获取失败,请刷新后重新选择商品!");o.store_id=this.goodsInfo.store_id,o.cart_ids=[],d="plugin.store-cashier.frontend.store.create"}this.fun.$post(d,o,"...").then((function(e){1==e.result?t.publishFun(e.data.order_ids):t.$message.error(e.msg)}))}else this.publishFun();else this.$message.error("请勾选用户协议");else this.$message.error("请选择分类");else this.$message.error("请添加正文");else this.$message.error("请填写标题");else this.$message("请等待所有图片上传成功!")},publishFun:function(t){var e=this,o={is_pc:1},p=this.fun.bd_encrypt(this.location.lng,this.location.lat);o.cat_id=this.catid,o.contents=this.releasecontents,o.address=this.releaseaddress,o.images=this.imgData.map((function(t){return t.url})),o.title=this.releasetitle,o.goods_id=this.goodsInfo.id,o.store_id=this.selectStore.id,o.city=this.location.city,o.lat=p.lat,o.lng=p.lng,o.ylat=this.location.lng,o.ylng=this.location.lat,t&&(o.order_id=t,o.order_address=JSON.stringify(this.currentAddress),o.wish_goods_id=this.goodsInfo.id),this.tid&&(o.tid=this.tid,this.order_id&&(o.order_id=this.order_id,o.order_address=this.order_address,o.wish_goods_id=this.wish_goods_id)),this.fun.$post("plugin.micro-communities.api.trick.publish",o,"...").then((function(t){1==t.result?(e.$message.success(t.msg),e.imgData=[],e.fileList=[],e.$refs.upload.clearFiles(),e.tid?e.$router.push(e.fun.getUrl("microcommentdetails-tid",{tid:e.tid})):e.$router.push(e.fun.getUrl("microHome-microIndex"))):e.$message.error(t.msg)}))}}},h=(o(889),o(891),o(1)),component=Object(h.a)(c,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"micro-release-box"},[o("div",{staticClass:"micro-edit-area"},[o("div",{staticClass:"title-input"},[o("span",{staticClass:"need"},[t._v("*")]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.releasetitle,expression:"releasetitle"}],attrs:{type:"text",placeholder:"请输入标题"},domProps:{value:t.releasetitle},on:{input:function(e){e.target.composing||(t.releasetitle=e.target.value)}}})]),t._v(" "),o("div",{staticClass:"content-input"},[o("span",{staticClass:"need"},[t._v("*")]),t._v(" "),o("tinymceSimple",{ref:"tinymceEditor",attrs:{modifyContent:t.releasecontents},on:{writeContent:t.getWriteContent}})],1),t._v(" "),o("div",{staticClass:"upload-img-box",on:{paste:t.pasting}},[t._m(0),t._v(" "),o("el-divider"),t._v(" "),o("el-upload",{ref:"upload",attrs:{action:t.uploadUrl,"on-change":t.handleImgChange,accept:"image/*",multiple:"","list-type":"picture-card","file-list":t.fileList,"on-success":t.handleSuccess,"on-remove":t.handleRemove}},[o("i",{staticClass:"el-icon-plus"})])],1),t._v(" "),o("div",{staticClass:"select-category-box"},[o("span",{staticClass:"need"},[t._v("*")]),t._v(" "),o("p",{staticClass:"cell-title",staticStyle:{"margin-right":"10px"}},[t._v("选择分类")]),t._v(" "),o("el-select",{attrs:{filterable:"",remote:"","remote-method":t.getClassificationData,clearable:!0,placeholder:"可输入关键词搜索"},model:{value:t.catid,callback:function(e){t.catid=e},expression:"catid"}},t._l(t.catelist,(function(e){return o("el-option-group",{key:e.id,attrs:{label:e.name}},t._l(e.child,(function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)})),1)],1),t._v(" "),o("el-divider"),t._v(" "),t.goodsInfo||t.selectStore?o("div",{staticClass:"add-store-goods"},[o("p",{staticClass:"cell-title"},[t._v("添加商品/门店")]),t._v(" "),o("el-divider"),t._v(" "),t.goodsInfo?o("div",{staticClass:"goods-box"},[o("div",{staticClass:"left flex flex-a-c"},[o("img",{staticClass:"goods-img",attrs:{src:t.goodsInfo.thumb,alt:""}}),t._v(" "),o("div",{staticClass:"goods-detail"},[o("p",{staticClass:"title overflow-hide"},[t._v(t._s(t.goodsInfo.title))]),t._v(" "),o("p",[o("span",{staticClass:"current-price"},[t._v("¥"+t._s(t.goodsInfo.price))]),t._v(" "),o("span",{staticClass:"price"},[t._v("¥"+t._s(t.goodsInfo.market_price))])])])]),t._v(" "),o("div",{staticClass:"right flex flex-col finger-point"},[o("p",{on:{click:function(e){t.goodsInfo=""}}},[o("i",{staticClass:"iconfont icon-fontclass-shanchu"})]),t._v(" "),o("p",{on:{click:function(e){return t.showDialog("goods")}}},[o("i",{staticClass:"iconfont icon-fontclass-tihuan"})])])]):t._e(),t._v(" "),t.selectStore?o("div",{staticClass:"store-box"},[o("div",{staticClass:"left flex flex-a-c"},[o("img",{staticClass:"goods-img",attrs:{src:t.selectStore.thumb,alt:""}}),t._v(" "),o("div",{staticClass:"goods-detail"},[o("p",{staticClass:"title overflow-hide"},[t._v(t._s(t.selectStore.store_name))]),t._v(" "),o("p",{staticClass:"describe"},[t._v(t._s(t.selectStore.address))])])]),t._v(" "),o("div",{staticClass:"right flex flex-col finger-point"},[o("p",{on:{click:function(e){t.selectStore=""}}},[o("i",{staticClass:"iconfont icon-fontclass-shanchu"})]),t._v(" "),o("p",{on:{click:function(e){return t.showDialog("store")}}},[o("i",{staticClass:"iconfont icon-fontclass-tihuan"})])])]):t._e()],1):t._e(),t._v(" "),o("p",{staticClass:"receiving-address",class:{active:t.releaseaddress}},[o("i",{staticClass:"iconfont icon-balance_q finger-point",on:{click:t.openMapModal}}),t._v(" "),o("span",{staticClass:"finger-point",on:{click:t.openMapModal}},[t._v("选择位置 "),t.releaseaddress?o("em",[t._v(": "+t._s(t.releaseaddress))]):t._e()])]),t._v(" "),o("ul",{staticClass:"other-set-box"},[0==t.goods_open?o("li",{staticClass:"finger-point flex flex-a-c",class:{active:t.goodsInfo},on:{click:function(e){return t.showDialog("goods")}}},[0==t.goods_open&&t.wish_open&&t.checkedWish?o("span",{staticClass:"need"},[t._v("*")]):t._e(),t._v(" "),o("i",{staticClass:"iconfont icon-shangcheng2"}),t._v(" "),o("span",[t._v("添加商品")])]):t._e(),t._v(" "),0==t.store_open?o("li",{staticClass:"finger-point",class:{active:t.selectStore},on:{click:function(e){return t.showDialog("store")}}},[o("i",{staticClass:"iconfont icon-icon-test"}),t._v(" "),o("span",[t._v("添加店铺")])]):t._e()]),t._v(" "),o("el-divider"),t._v(" "),t.tid||0!=t.goods_open||1!=t.wish_open?t._e():o("div",{staticClass:"receiving-address"},[o("div",{staticClass:"finger-point"},[o("i",{staticClass:"iconfont icon-bc_like"}),t._v(" "),o("span",{staticStyle:{"margin-right":"15px"}},[t._v("心愿商品")]),t._v(" "),o("el-switch",{model:{value:t.checkedWish,callback:function(e){t.checkedWish=e},expression:"checkedWish"}})],1),t._v(" "),t.checkedWish?[1==t.goodsInfo.has_option?o("div",{staticClass:"finger-point flex flex-a-c",staticStyle:{"margin-top":"15px"},style:{color:t.optionId?"#ec544a":""},on:{click:function(e){return e.stopPropagation(),t.initPopView.apply(null,arguments)}}},[o("span",{staticClass:"need"},[t._v("*")]),t._v(" "),o("i",{staticClass:"iconfont icon-shangcheng2"}),t._v(" "),o("span",[t._v("请选择商品规格 "),t.optionId?o("span",[t._v(": "+t._s(t.goodsDescription))]):t._e()])]):t._e(),t._v(" "),o("div",{staticClass:"finger-point flex flex-a-c",staticStyle:{"margin-top":"15px"},style:{color:t.currentAddId?"#ec544a":""},on:{click:function(e){return e.stopPropagation(),t.getAddress.apply(null,arguments)}}},[o("span",{staticClass:"need"},[t._v("*")]),t._v(" "),o("i",{staticClass:"iconfont icon-balance_q"}),t._v(" "),o("span",[t._v(t._s(t.currentAddId?"已添加收货地址:":"请添加收货地址"))]),t._v(" "),t.currentAddress?o("div",[o("p",[t._v(t._s(t.currentAddress.mobile)+"("+t._s(t.currentAddress.username)+"收)")]),t._v(" "),o("p",[t._v(t._s(t.currentAddress.province)+t._s(t.currentAddress.city)+t._s(t.currentAddress.district)+" "+t._s(t.currentAddress.street)+" "+t._s(t.currentAddress.address))])]):t._e()])]:t._e()],2)],1),t._v(" "),o("div",{staticClass:"agreement-box"},[o("el-checkbox",{model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},[t._v("阅读并同意")]),o("span",{staticClass:"agreement"},[o("span",{staticClass:"us_color",on:{click:function(e){return e.stopPropagation(),t.openProtocol.apply(null,arguments)}}},[t._v("《用户协议》")])])],1),t._v(" "),o("div",{staticClass:"submit-box"},[o("el-button",{staticStyle:{padding:"10px 30px"},attrs:{type:"primary"},on:{click:t.submitBtn}},[t._v("提交")])],1),t._v(" "),o("el-dialog",{staticClass:"add-goods-dialog",attrs:{title:"添加"+t.dialogTitleText,visible:t.dialogTableVisible,center:"",width:"60%"},on:{"update:visible":function(e){t.dialogTableVisible=e},close:t.closeDialog}},[o("div",{staticClass:"search-box"},[o("el-input",{attrs:{placeholder:"搜索"+t.dialogTitleText},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return e.stopPropagation(),t.nextPage({page:1})}}},[t._v("搜索")])],1),t._v(" "),o("ul",{staticClass:"goods-list"},t._l(t.dialogList,(function(e,d){return o("li",{key:d,staticClass:"flex flex-a-c finger-point",on:{click:function(o){return t.handelSelect(e)}}},[o("img",{staticClass:"goods-img",attrs:{src:e.thumb,alt:""}}),t._v(" "),o("div",{staticClass:"goods-detail"},[o("p",{staticClass:"title overflow-hide"},[t._v(t._s("goods"===t.dialogType?e.title:e.store_name))]),t._v(" "),"goods"===t.dialogType?o("p",[o("span",{staticClass:"current-price"},[t._v("¥"+t._s(e.price))]),t._v(" "),o("span",{staticClass:"price"},[t._v("¥"+t._s(e.market_price))])]):o("p",{staticClass:"describe"},[t._v(t._s(e.address))])]),t._v(" "),t.goodsInfo||t.selectStore?o("span",["goods"==t.dialogType&&t.goodsInfo.id==e.id||"store"==t.dialogType&&t.selectStore.id==e.id?o("i",{staticClass:"el-icon-success"}):t._e()]):t._e()])})),0),t._v(" "),o("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total,expression:"total"}],staticStyle:{"margin-top":"20px"},attrs:{total:t.total,pageSize:t.per_page,page:t.page},on:{pagination:t.nextPage}})],1),t._v(" "),o("el-dialog",{attrs:{title:"用户协议",visible:t.agreement_show,width:"60%",center:""},on:{"update:visible":function(e){t.agreement_show=e}}},[o("div",{staticClass:"agreement-content",domProps:{innerHTML:t._s(t.agreementcontent)}})]),t._v(" "),o("el-dialog",{attrs:{title:"选择商品规格",visible:t.popupSpecs,width:"60%",center:""},on:{"update:visible":function(e){t.popupSpecs=e}}},[o("div",{staticClass:"choose-good-box"},[o("div",{staticClass:"good-top"},[o("div",{staticClass:"chooser_img"},[o("img",{attrs:{src:t.popThumb?t.popThumb:t.goodsInfo.thumb}})]),t._v(" "),o("div",{staticClass:"right"},[o("div",{staticClass:"price",style:{color:"#f14e4e"}},[t._v("\n ¥\n "),o("span",{attrs:{id:"option_price"}},[t._v(t._s(t.popPrice))])]),t._v(" "),o("div",{staticClass:"option"},[t._v("库存"+t._s(t.popStock)+t._s(t.goodsInfo.sku))]),t._v(" "),o("div",{staticClass:"option"},[t._v(t._s(t.goodsDescription))])])]),t._v(" "),1==t.goodsInfo.has_option?t._l(t.goodsInfo.has_many_specs,(function(e,i){return o("div",{key:i,staticClass:"Spec flex flex-a-c"},[o("span",{staticClass:"spec-title"},[t._v(t._s(e.title))]),t._v(" "),o("el-radio-group",{staticClass:"item-box",model:{value:e.description,callback:function(o){t.$set(e,"description",o)},expression:"specs.description"}},t._l(e.specitem,(function(e,d){return o("el-radio",{key:d,staticClass:"item",attrs:{border:"",disabled:e.c,label:e},on:{change:t.selectSpecs}},[t._v("\n "+t._s(e.title)+"\n ")])})),1)],1)})):t._e(),t._v(" "),o("div",{staticClass:"num flex flex-a-c"},[o("div",{staticStyle:{"margin-right":"37px"}},[t._v("数量")]),t._v(" "),o("div",{staticClass:"input flex"},[o("el-input-number",{attrs:{min:1},model:{value:t.goodsCount,callback:function(e){t.goodsCount=e},expression:"goodsCount"}})],1),t._v(" "),o("div",{staticStyle:{"margin-left":"10px",color:"#666666"}},[t._v(t._s(t.goodsInfo.sku))])])],2),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{staticClass:"buy_once",staticStyle:{padding:"10px 30px"},on:{click:t.buyNow}},[t._v("确认")])],1)]),t._v(" "),o("el-dialog",{attrs:{title:"选择收货地址",visible:t.showAddress,width:"60%",center:""},on:{"update:visible":function(e){t.showAddress=e}}},[o("div",{staticClass:"address-list-box"},t._l(t.addressList,(function(e,d){return o("div",{key:d,staticClass:"address-item finger-point",on:{click:function(o){return t.changeSelect(e)}}},[o("span",{staticClass:"address-left"},[t.currentAddId==e.id?o("i",{staticClass:"el-icon-success",staticStyle:{color:"#f14e4e"}}):t._e()]),t._v(" "),o("div",{staticClass:"address-right"},[o("div",[o("p",[t._v(t._s(e.mobile)+"("+t._s(e.username)+"收)"),1==e.isdefault?o("span",{staticStyle:{color:"#f14e4e"}},[t._v("默认地址")]):t._e()]),t._v(" "),o("p",[t._v(t._s(e.province)+t._s(e.city)+t._s(e.district)+" "+t._s(e.street)+" "+t._s(e.address))])]),t._v(" "),o("div",{staticClass:"edit",on:{click:function(o){return o.stopPropagation(),t.add_new_address("edit",e)}}},[t._v("修改")])])])})),0),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{staticClass:"buy_once",on:{click:function(e){return t.add_new_address("add")}}},[t._v("新增地址")])],1)]),t._v(" "),o("el-dialog",{staticClass:"dialog_connect",attrs:{title:("add"==t.choose_type?"新增":"编辑")+"收货地址",visible:t.dialogVisible,width:"878px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[o("div",{staticClass:"address-box"},[o("el-form",{staticStyle:{"padding-left":"215px"},attrs:{"label-width":"106px"}},[o("el-form-item",{attrs:{label:"收件人"}},[o("el-input",{attrs:{placeholder:"请输入收件人"},model:{value:t.form.username,callback:function(e){t.$set(t.form,"username",e)},expression:"form.username"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"手机号码"}},[o("el-input",{attrs:{placeholder:"请输入手机号码"},model:{value:t.form.mobile,callback:function(e){t.$set(t.form,"mobile",e)},expression:"form.mobile"}})],1),t._v(" "),t.dialogVisible?o("el-form-item",{attrs:{label:"所在地区"}},[o("el-cascader",{ref:"refSubCat",attrs:{options:t.district,props:t.props},on:{change:t.handleChange},model:{value:t.district_select,callback:function(e){t.district_select=e},expression:"district_select"}})],1):t._e(),t._v(" "),t.isShowStreet&&t.dialogVisible?o("el-form-item",{attrs:{label:"街道"}},[o("el-select",{attrs:{placeholder:"请选择"},model:{value:t.form.streetName,callback:function(e){t.$set(t.form,"streetName",e)},expression:"form.streetName"}},t._l(t.districtVal,(function(t){return o("el-option",{key:t.id,attrs:{value:t.areaname,label:t.areaname}})})),1)],1):t._e(),t._v(" "),o("el-form-item",{attrs:{label:""}},[o("el-input",{attrs:{type:"textarea",placeholder:"请输入详细地址"},model:{value:t.form.address,callback:function(e){t.$set(t.form,"address",e)},expression:"form.address"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"设为默认地址"}},[o("el-checkbox",{model:{value:t.form.isdefault,callback:function(e){t.$set(t.form,"isdefault",e)},expression:"form.isdefault"}},[t._v("设为默认")])],1)],1),t._v(" "),o("div",{staticClass:"btn_wrap flex"},[o("el-button",{staticClass:"flex flex-a-c flex-j-c",on:{click:function(e){t.dialogVisible=!1}}},[t._v("关闭")]),t._v(" "),o("el-button",{staticClass:"flex flex-a-c flex-j-c",staticStyle:{"margin-left":"56px"},attrs:{type:"primary"},on:{click:t.alterAddresshandle}},[t._v("确定\n ")])],1)],1)]),t._v(" "),o("map-modal",{ref:"mapModal",on:{confirm:t.handleOk}})],1)}),[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("p",{staticClass:"cell-title cursor-default"},[t._v("添加图片 "),o("span",{staticClass:"tips"},[t._v("(点击这里后可以通过截图黏贴图片上传)")])])}],!1,null,"3d6db26a",null);e.default=component.exports}}]);