1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d29bd382"],{"06a8":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div")},s=[],n=a("795b"),o=a.n(n),c=(a("7f7f"),a("ac6a"),a("f20c")),r=a("5cab"),l=a("f499"),u=a.n(l),d=a("8982"),f="/industryParkApi",m="/wx/data",h="/wx/public",p="/wx/dictController";function v(t){return Object(d["a"])({url:f+m+"/listBizAll/"+t,method:"post"})}function b(t){return Object(d["a"])({url:f+h+"/listProjectAll",method:"post",data:t})}function g(t){return Object(d["a"])({url:f+p+"/getByCodes",method:"post",data:t})}function _(t){var e={codes:u()(t)};return new o.a(function(t,a){g(e).then(function(e){t(e)}).catch(function(t,e){a(t,e)})})}var y=a("3089"),k={name:"BaseData",data:function(){return{currentPage:1,totalSize:0,pageSize:10,InitialLoading:!0,allLoaded:!1,bottomStatus:"",StaffData:[],StaffMap:{},BizData:[],BizMap:{},UserProject:[],ProjectData:[],ProjectMap:{},dialogImageUrl:"",dialogImageVisible:!1,dc_map:{},dc_data:{},dc_map_no_all:{},dc_data_no_all:{}}},mounted:function(){},methods:{initDict:function(t){var e=this;return t||(t=e.dc_key),_(t).then(function(t){t.data&&e.dc_key.forEach(function(a){var i=e.getDictValue(t.data,a,!0);e.dc_data[a]=i,e.dc_map[a]=e.$common.transDcMap(i);var s=e.getDictValue(t.data,a,!1);e.dc_data_no_all[a]=s,e.dc_map_no_all[a]=e.$common.transDcMap(s)})})},initDict2:function(t){var e=this;return t||(t=e.dc_key),_(t).then(function(t){t.data&&e.dc_key.forEach(function(a){var i=e.getDictValue(t.data,a,!1);e.dc_data[a]=i,e.dc_map[a]=e.$common.transDcMap(i);var s=e.getDictValue(t.data,a,!1);e.dc_data_no_all[a]=s,e.dc_map_no_all[a]=e.$common.transDcMap(s)})})},initBiz:function(){var t=this;return this.BizData=[],v(r["a"].uid()).then(function(e){e.data&&e.data.forEach(function(e){var a={label:e.businessName,value:e.id};t.BizData.push(a),t.BizMap[e.id]=e.businessName})}).catch(function(){})},initProjectData:function(){var t=this;return this.ProjectData=[],b(r["a"].uid()).then(function(e){e.data&&e.data.forEach(function(e){var a={label:e.name,value:e.id};t.ProjectData.push(a),t.ProjectMap[a.value]=e})}).catch(function(){})},pagination:function(t){var e=this.currentPage,a=this.pageSize,i=e*a-a,s=e*a;return t.slice(i,s)},getDictValue:function(t,e,a){var i=t[e]?c["a"].castEval(t[e].dictValue):[],s=[];if(i.forEach(function(t){var e={id:t.id,isSearch:t.isSearch,label:t.label,value:t.value,active:!1};s.push(e)}),a){var n={label:"全部",value:"",active:!0};s.unshift(n)}return s},confirm:function(t,e){return new o.a(function(a,i){y["Dialog"].confirm({title:e,message:t}).then(function(t){a(t)}).catch(function(t){Object(y["Toast"])("已取消"),i(t)})})},handleBottomChange:function(t){console.log("handleBottomChange:"+t),this.bottomStatus=t,"drop"===this.bottomStatus&&this.currentPage++},loadBottom:function(){var t=this,e=this;console.log("loadBottom"),setTimeout(function(){e.getData(),t.$refs.loadmore.onBottomLoaded()},500)},imgPreview:function(t){this.dialogImageUrl="/industryParkApi/wx/img/viewImg/"+t,this.dialogImageVisible=!0},imgRemove:function(t,e){var a=e.indexOf(t);e.splice(a,1)},noImg:function(){var t=event.srcElement;t.src=a("aed7"),t.onerror=null}}},C=k,x=a("2877"),D=Object(x["a"])(C,i,s,!1,null,"3fa5b905",null);e["a"]=D.exports},4899:function(t,e,a){"use strict";var i=a("f50f"),s=a.n(i);s.a},"7f7f":function(t,e,a){var i=a("86cc").f,s=Function.prototype,n=/^\s*function ([^ (]*)/,o="name";o in s||a("9e1e")&&i(s,o,{configurable:!0,get:function(){try{return(""+this).match(n)[1]}catch(t){return""}}})},8982:function(t,e,a){"use strict";a.d(e,"a",function(){return m}),a.d(e,"b",function(){return h});var i=a("795b"),s=a.n(i),n=a("bc3a"),o=a.n(n),c=a("4328"),r=a.n(c),l=a("4360"),u=a("5cab"),d=a("a18c"),f=a("3089");function m(t,e){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var a={method:t.method,url:t.url,data:r.a.stringify(t.data)};return e&&(a.data=t.data),t.headers&&(a.headers=t.headers),new s.a(function(e,i){o()(a).then(function(t){if(t&&t.data&&200===t.status){var a=t.data;switch(a.errno){case 501:Object(f["Toast"])(a.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),i(a.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(a.errmsg),i(a.errmsg);break}e(a)}else console.log(t),i(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),i(e,a)})})}function h(t){t.headers||(t.headers={}),t.headers&&u["a"].getToken()&&(t.headers["RC-Token"]=u["a"].getToken());var e={method:t.method,url:t.url};return e.data=t.data,t.headers&&(e.headers=t.headers,e.headers["MVVM-Key"]=String((new Date).getTime()),e.headers["xx"]="anything",e.headers["Content-Type"]="application/json;charset=UTF-8"),console.log("request: ",t),new s.a(function(a,i){o.a.defaults.withCredentials=!0,o()(e).then(function(t){if(console.log("response:",t),t&&t.data&&200===t.status){var e=t.data;switch(e.errno){case 501:Object(f["Toast"])(e.errmsg),setTimeout(function(){l["a"].dispatch("user/logout").then(function(){d["a"].push("/login")})},1500),i(e.errmsg);break;case 401:case 402:case 502:case 503:case 504:case 505:case 506:case 507:case 508:case 801:Object(f["Toast"])(e.errmsg),i(e.errmsg);break}a(e)}else console.log(t),i(t)}).catch(function(e,a){console.log(t.url+" fail",e,a),Object(f["Toast"])(e),i(e,a)})})}},aed7:function(t,e,a){t.exports=a.p+"assets/img/no-result.b05bdcd3.jpg"},b7b1:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"peripheral"},[a("van-tabs",{attrs:{"title-active-color":"#2A3980",color:"#2A3980","title-inactive-color":"#666666","line-width":"120px"},on:{click:t.changeTopTabs},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[a("van-tab",{attrs:{title:"新增发布"}},[a("div",{staticClass:"tabs-box"},[a("div",{staticClass:"white-box part-1"},[a("div",{staticClass:"custom-white-box-content"},[a("div",{staticClass:"custom-input-box"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.form.businessName,expression:"form.businessName"}],attrs:{type:"text",maxlength:"50px",placeholder:"请填写店名"},domProps:{value:t.form.businessName},on:{input:function(e){e.target.composing||t.$set(t.form,"businessName",e.target.value)}}})])]),a("ul",{staticClass:"custom-select-list"},t._l(t.quickList,function(e){return""!==e.value?a("li",{key:e.value,class:[t.quickSleced.value&&e.value===t.quickSleced.value?"active":""],staticStyle:{width:"25%"},on:{click:function(a){return t.quickSelect(e)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t\t\t")]):t._e()}),0)]),a("div",{staticClass:"white-box page-2"},[a("div",{staticClass:"custom-item-tit"},[a("p",{staticClass:"tit"},[t._v("商家地址")])]),a("div",{staticClass:"address"},[a("PositionNav",{attrs:{address:t.form.businessAddress},on:{childByValue:t.addressChange}})],1),a("div",{staticClass:"custom-item-tit"},[a("p",{staticClass:"tit"},[t._v("商家电话")])]),a("div",{staticClass:"custom-white-box-content"},[a("div",{staticClass:"icon-input-box"},[a("div",{staticClass:"inp"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.form.businessPhone,expression:"form.businessPhone"}],attrs:{type:"text",maxlength:"50px"},domProps:{value:t.form.businessPhone},on:{input:function(e){e.target.composing||t.$set(t.form,"businessPhone",e.target.value)}}})]),a("div",{staticClass:"icon"},[a("i",{staticClass:"iconfont icon-dianhua1"})])])]),a("div",{staticClass:"block-cell-item"},[a("div",{staticClass:"custom-item-tit"},[a("p",{staticClass:"tit"},[t._v("商家简介")])]),a("div",{staticClass:"tit"},[a("van-uploader",{attrs:{multiple:"multiple","max-count":6,"after-read":t.afterRead,"before-delete":t.beforeDelete,capture:"camera",accept:"'image/*'"},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1)]),a("div",{staticClass:"custom-textarea-box"},[a("van-field",{attrs:{autosize:"",type:"textarea",placeholder:"请填写简介","show-word-limit":""},model:{value:t.form.introduction,callback:function(e){t.$set(t.form,"introduction",e)},expression:"form.introduction"}})],1)])]),a("div",{staticClass:"repair-bottom bottom-button"},[a("button",{staticClass:"btn",on:{click:t.submmit}},[t._v("发布")])])]),a("van-tab",{attrs:{title:"发布记录"}},[a("div",{staticClass:"tabs-box"},[a("van-tabs",{attrs:{color:"#2A3980","title-active-color":"#2A3980","title-inactive-color":"#666666"},on:{change:t.selectChange},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},t._l(t.tabsList,function(e){return a("van-tab",{attrs:{title:e.label,name:e.value}},[a("div",{staticClass:"tab-tab-box"},t._l(t.list,function(e){return a("div",{staticClass:"tab-tab-card"},[a("div",{staticClass:"card-top"},[a("div",{staticClass:"left"},[a("div",{staticClass:"top"},[t._v(t._s(e.businessName))]),a("div",{staticClass:"bottom"},[t._v("入驻时间:"+t._s(e.releaseTime))])]),a("div",{staticClass:"right"},[a("span",{staticClass:"normal-tip z-bg yd"},[t._v(t._s(e.type))]),a("div",{staticClass:"bottom"})])]),a("div",{staticClass:"card-bottom"},["2"===e.source?a("span",{staticClass:"normal-button-app z-bt",on:{click:function(a){return a.stopPropagation(),t.editPeripheral(e.id)}}},[t._v("编辑")]):t._e(),a("span",{staticClass:"normal-button-app y-bt",on:{click:function(a){return a.stopPropagation(),t.offShelf(e.id)}}},[t._v("下架")])])])}),0)])}),1)],1)])],1)],1)},s=[],n=a("795b"),o=a.n(n),c=a("f499"),r=a.n(c),l=(a("7f7f"),a("a481"),a("ac6a"),a("5176")),u=a.n(l),d=a("6382"),f=a("06a8"),m=a("3089"),h=a("bc3a"),p=a.n(h),v=a("ff65"),b=a("f7eb"),g=a("5cab"),_={components:{PositionNav:d["a"],TelNum:b["a"]},data:function(){return{dc_key:["periphery_type"],active:1,tabActive:"",businessAddress:"",quickSleced:{},quickList:[],fileList:[],activeName:" ",tabsList:[],list:[],fileUrlList:[],form:this.initForm(),params:{pageNum:1,pageSize:10,releaseType:"periphery",status:"published"},totalPage:1}},mixins:[f["a"]],mounted:function(){var t=this;this.active=this.$route.query.active?this.$route.query.active:0,this.initDict(this.dc_key).then(function(e){t.quickList=t.dc_data.periphery_type,t.tabsList=t.dc_data.periphery_type,t.selectData()})},methods:{go:function(){this.$common.goBack()},addressChange:function(t){this.form.businessAddress=t},offShelf:function(t){var e=this;m["Dialog"].confirm({title:"提示",message:"确认下架该信息吗?"}).then(function(a){Object(v["b"])({id:t,status:"off_shelf"}).then(function(t){Object(m["Toast"])("下架成功"),e.list=[],e.selectData()})}).catch(function(t){Object(m["Toast"])("已取消")})},changeTopTabs:function(){1===this.active&&(this.form=this.initForm(),this.fileList=[],this.quickSleced={},this.fileUrlList=[])},editPeripheral:function(t){var e=this;Object(v["c"])({id:t}).then(function(t){if(t.data){if(e.form=u()({},e.form,t.data),e.form.releaseTime=e.$common.transDate(e.form.releaseTime),e.quickSleced.value=e.form.type,e.form.fileUrl&&e.form.fileUrl.length>2){e.fileList=[];var a=e.$common.castEval(e.form.fileUrl);a.forEach(function(t){e.fileList.push(JSON.parse('{"url":"'+t.url.replace("/server","/industryParkApi")+'","isImage": true}'))}),e.fileUrlList=a}e.active=0}})},selectData:function(){var t=this;t.params.type=t.activeName,Object(v["d"])(t.params).then(function(e){e.data&&e.data.forEach(function(e){var a=t.getItemJson(e);t.list.push(a)}),console.log(t.list)})},selectChange:function(t,e){this.list=[],this.params.type=this.name,this.selectData()},getItemJson:function(t){return t.releaseTime=this.$common.transDate(t.releaseTime),t.type=this.dc_map.periphery_type[t.type],t},submmit:function(){var t=this;this.form.fileUrl=r()(this.fileUrlList),this.form.type=this.quickSleced.value,this.form.releaseTime=this.$common.transServDate(new Date),""!==this.form.id?Object(v["b"])(this.form).then(function(e){Object(m["Toast"])("发布成功"),t.active=1,t.form=t.initForm(),t.fileList=[],t.quickSleced={},t.fileUrlList=[],t.list=[],t.selectData()}):Object(v["a"])(this.form).then(function(e){Object(m["Toast"])("发布成功"),t.active=1,t.form=t.initForm(),t.fileList=[],t.quickSleced={},t.fileUrlList=[],t.list=[],t.selectData()})},initForm:function(){return{id:"",businessName:"",type:"",businessAddress:"",businessPhone:"",fileUrl:"",introduction:"",source:"2",releaseType:"periphery",publisherUserId:g["a"].currUser().id,status:"published"}},quickSelect:function(t){this.quickSleced.value&&this.quickSleced.value===t.value?this.quickSleced={}:this.quickSleced=t},afterRead:function(t){var e=this;t instanceof Array?t.map(function(t){e.uploadImg(t)}):this.uploadImg(t)},beforeDelete:function(t,e){var a=this;return a.fileUrlList.splice(e.index,1),function(t,i){var s=i.index;a.fileUrlList[e.index].splice(s,1)}},uploadImg:function(t){var e=this,a=new FormData;a.append("file",t.file),console.log(a.get("file"));var i={headers:{"Content-Type":"multipart/form-data","MVVM-Key":String((new Date).getTime()),xx:"anything"}};return new o.a(function(t,s){p.a.post("/industryParkApi/wx/fileController/upload",a,i).then(function(t){var a=t.data.data.substring(1,t.data.data.length);a=a.substring(0,a.length-1),e.fileUrlList.push(e.$common.castEval(a))}).catch(function(t,e){s(t,e)})})}}},y=_,k=(a("4899"),a("2877")),C=Object(k["a"])(y,i,s,!1,null,"adad904a",null);e["default"]=C.exports},f50f:function(t,e,a){},ff65:function(t,e,a){"use strict";a.d(e,"a",function(){return o}),a.d(e,"d",function(){return c}),a.d(e,"c",function(){return r}),a.d(e,"b",function(){return l});var i=a("8982"),s="/industryParkApi",n="/wx/periphery";function o(t){return Object(i["a"])({url:s+n+"/add",method:"post",data:t})}function c(t){return Object(i["a"])({url:s+n+"/list",method:"post",data:t})}function r(t){return Object(i["a"])({url:s+n+"/getById",method:"post",data:t})}function l(t){return Object(i["a"])({url:s+n+"/edit",method:"post",data:t})}}}]);
|