2 lines
26 KiB
JavaScript
2 lines
26 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1885b06e"],{"24e5":function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("店铺信息")]),t("div",[t("el-button",{attrs:{size:"small"},on:{click:function(t){return e._queryShopMethod()}}},[e._v("刷新")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openAddShopModal()}}},[t("i",{staticClass:"el-icon-plus"}),e._v("开店 ")])],1)]),t("div",{},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.shopInfo.shops,border:"",stripe:"",size:"small"}},[t("el-table-column",{attrs:{prop:"shopLogo",label:"店铺logo",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[e.row.shopLogo?t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:e.row.shopLogo}}):t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:"/img/noPhoto.jpg"}})]}}])}),t("el-table-column",{attrs:{prop:"areaName",label:"店铺区域",align:"center"}}),t("el-table-column",{attrs:{prop:"shopName",label:"店铺名称",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.shopName)+"("+e._s(t.row.shopTypeName)+") ")]}}])}),t("el-table-column",{attrs:{prop:"shopId",label:"店铺编号",align:"center"}}),t("el-table-column",{attrs:{prop:"openType",label:"开店类型",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.shopInfo.openTypeName[t.row.openType])+" ")]}}])}),t("el-table-column",{attrs:{prop:"shopDesc",label:"店铺描述",align:"center"}}),t("el-table-column",{attrs:{prop:"returnPerson",label:"退货联系人",align:"center"}}),t("el-table-column",{attrs:{prop:"returnLink",label:"退货电话",align:"center"}}),t("el-table-column",{attrs:{prop:"stateName",label:"状态",align:"center"}}),t("el-table-column",{attrs:{label:"操作",align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e._openEditShopModel(o.row)}}},[e._v("修改")]),"004"==o.row.state?t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e._payFee(o.row.shopId)}}},[e._v(" 缴保证金 ")]):e._e(),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e._openShopQrCode(o.row)}}},[e._v("二维码")])],1)]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"20px"},attrs:{"current-page":e.shopInfo.conditions.page,"page-size":e.DEFAULT_ROWS,layout:"total, prev, pager, next",total:e.shopInfo.total},on:{"current-change":e.handleCurrentChange,"update:currentPage":function(t){return e.$set(e.shopInfo.conditions,"page",t)},"update:current-page":function(t){return e.$set(e.shopInfo.conditions,"page",t)}}})],1)]),t("add-shop",{ref:"addShop",on:{listShop:e._queryShopMethod}}),t("edit-shop",{ref:"editShop",on:{listShop:e._queryShopMethod}}),t("view-qr-code",{ref:"viewQrCode",on:{listShop:e._queryShopMethod}})],1)},s=[],n=o("7323"),r=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"开店",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.clearAddShopInfo}},[t("el-form",{ref:"addShopForm",attrs:{model:e.addShopInfo,"label-width":"120px"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"商铺名称",prop:"shopName",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写商铺名称"},model:{value:e.addShopInfo.shopName,callback:function(t){e.$set(e.addShopInfo,"shopName",t)},expression:"addShopInfo.shopName"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"商铺类型",prop:"shopType",required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择商铺类型"},on:{change:e._changeAddShopType},model:{value:e.addShopInfo.shopType,callback:function(t){e.$set(e.addShopInfo,"shopType",t)},expression:"addShopInfo.shopType"}},e._l(e.shopInfo.shopTypes,(function(e){return t("el-option",{key:e.shopTypeId,attrs:{label:e.typeName,value:e.shopTypeId}})})),1)],1)],1)],1),t("el-form-item",{attrs:{label:"店铺地区",required:""}},[t("el-row",{attrs:{gutter:10}},[t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择省"},on:{change:e.getProv},model:{value:e.addShopInfo.selectProv,callback:function(t){e.$set(e.addShopInfo,"selectProv",t)},expression:"addShopInfo.selectProv"}},e._l(e.addShopInfo.provs,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1),e.addShopInfo.selectProv?t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择城市"},on:{change:e.getCity},model:{value:e.addShopInfo.selectCity,callback:function(t){e.$set(e.addShopInfo,"selectCity",t)},expression:"addShopInfo.selectCity"}},e._l(e.addShopInfo.citys,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1):e._e(),e.addShopInfo.selectCity?t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择区县"},model:{value:e.addShopInfo.areaCode,callback:function(t){e.$set(e.addShopInfo,"areaCode",t)},expression:"addShopInfo.areaCode"}},e._l(e.addShopInfo.areas,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1):e._e()],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"开店类型",prop:"openType",required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择开店类型"},model:{value:e.addShopInfo.openType,callback:function(t){e.$set(e.addShopInfo,"openType",t)},expression:"addShopInfo.openType"}},e._l(e.addShopInfo.openTypes,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"商铺logo",prop:"shopLogo",required:""}},[t("upload-image-url",{ref:"uploadImage",attrs:{imageCount:1},on:{notifyUploadCoverImage:e.handleUploadImage}})],1)],1)],1),e.addShopInfo.accountBondAmount?t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"保证金金额"}},[t("el-input",{attrs:{disabled:""},model:{value:e.addShopInfo.accountBondAmount,callback:function(t){e.$set(e.addShopInfo,"accountBondAmount",t)},expression:"addShopInfo.accountBondAmount"}})],1)],1)],1):e._e(),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"商铺描述",prop:"shopDesc",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写商铺描述"},model:{value:e.addShopInfo.shopDesc,callback:function(t){e.$set(e.addShopInfo,"shopDesc",t)},expression:"addShopInfo.shopDesc"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"发货地址",prop:"sendAddress",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写发货地址"},model:{value:e.addShopInfo.sendAddress,callback:function(t){e.$set(e.addShopInfo,"sendAddress",t)},expression:"addShopInfo.sendAddress"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"退货联系人",prop:"returnPerson",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写退货联系人"},model:{value:e.addShopInfo.returnPerson,callback:function(t){e.$set(e.addShopInfo,"returnPerson",t)},expression:"addShopInfo.returnPerson"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"退货联系电话",prop:"returnLink",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写退货联系电话"},model:{value:e.addShopInfo.returnLink,callback:function(t){e.$set(e.addShopInfo,"returnLink",t)},expression:"addShopInfo.returnLink"}})],1)],1)],1),t("el-form-item",{attrs:{label:"退货地址",prop:"returnAddress",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写退货地址"},model:{value:e.addShopInfo.returnAddress,callback:function(t){e.$set(e.addShopInfo,"returnAddress",t)},expression:"addShopInfo.returnAddress"}})],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"坐标X位置",prop:"mapX",required:""}},[t("el-input",{attrs:{placeholder:"请点击地图获取坐标",disabled:""},model:{value:e.addShopInfo.mapX,callback:function(t){e.$set(e.addShopInfo,"mapX",t)},expression:"addShopInfo.mapX"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"坐标Y位置",prop:"mapY",required:""}},[t("el-input",{attrs:{placeholder:"请点击地图获取坐标",disabled:""},model:{value:e.addShopInfo.mapY,callback:function(t){e.$set(e.addShopInfo,"mapY",t)},expression:"addShopInfo.mapY"}})],1)],1)],1),t("el-form-item",{attrs:{label:"定位"}},[t("select-map-pos",{ref:"selectMapPos",on:{"position-change":e.handlePositionChange}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveShopInfo}},[e._v("保存")]),t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),t("span",{staticStyle:{"margin-left":"20px",color:"#999"}},[e._v(" 保存成功后,管理员审核通过即可使用。 ")])],1)],1)],1)},l=[],i=o("b103"),p=o("5e31"),d=function(){var e=this;e._self._c;return e._m(0)},c=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"select-map-pos-container"},[t("div",{staticStyle:{width:"100%",height:"100%"},attrs:{id:"selectMap"}})])}],h={name:"SelectMapPos",props:{elementId:{type:String,default:"selectMap"},initData:{type:Object,default:()=>({})}},data(){return{map:null,marker:null,shopId:"",mapData:{lat:0,lng:0}}},mounted(){this.shopId=Object(n["f"])()},methods:{initMap(e){let t=116.397128,o=39.916527;e.lng&&(t=e.lng),e.lat&&(o=e.lat);try{this.map&&this.map.destroy()}catch(r){console.log(r)}let a,s=new window.TMap.Map("selectMap",{center:new window.TMap.LatLng(o,t),zoom:13}),n=this;s.on("click",(function(e){console.log(e),a||(a=new window.TMap.MultiMarker({styleId:"marker",position:e.latLng,map:s,id:"1"})),console.log(e),n.$emit("position-change",{lat:e.latLng.lat,lng:e.latLng.lng}),a.updateGeometries([{styleId:"marker",id:"1",position:e.latLng}])})),this.map=s},addMarker(e){this.marker&&this.marker.setMap(null);let t=window.TMap;this.marker=new t.MultiMarker({map:this.map,styles:{marker:new t.MarkerStyle({width:25,height:35,src:"/img/maper.png",anchor:{x:32,y:32}})},geometries:[{id:"1",styleId:"marker",position:e}]}),this.map.setCenter(e),this.map.setZoom(16)},updatePosition(e,t){if(!this.map)return;const o=new window.TMap.LatLng(e,t);this.addMarker(o)}},beforeDestroy(){this.map&&(this.map.destroy(),this.map=null)}},u=h,f=(o("d6fc"),o("2877")),m=Object(f["a"])(u,d,c,!1,null,"54a412ce",null),g=m.exports,S={components:{UploadImageUrl:p["a"],SelectMapPos:g},data(){return{dialogVisible:!1,addShopInfo:{shopName:"",shopLogo:"",shopType:"",openType:"",shopDesc:"",sendAddress:"",returnPerson:"",returnLink:"",returnAddress:"",accountBondAmount:"",mapX:"",mapY:"",accountBonds:[],selectProv:"",selectCity:"",selectArea:"",areaCode:"",areas:[],provs:[],citys:[],openTypes:[],communitys:[]},shopInfo:{shopTypes:[]}}},methods:{open(){this.dialogVisible=!0,this._initArea("101","0"),this.queryShopTypes(),this.getDictData(),setTimeout(()=>{this.$refs.selectMapPos.initMap({}),this.clearAddShopInfo()},100)},async queryShopTypes(){const e=await Object(n["j"])({page:1,row:100});this.shopInfo.shopTypes=e.data},async getDictData(){try{const{data:e}=await Object(n["e"])("s_shop","open_type");this.addShopInfo.openTypes=e}catch(e){console.error("获取字典数据失败:",e)}},handleUploadImage(e){console.log(e),e.length>0?this.addShopInfo.shopLogo=e[0]:this.addShopInfo.shopLogo=""},async _listAddAccountBonds(e){try{const t=await Object(i["b"])({page:1,row:100,bondType:"6006",objId:e});if(this.addShopInfo.accountBonds=t.data,0===t.data.length)return void this.$message.warning("请联系管理员设置该商铺类型的保证金!");this.addShopInfo.accountBondAmount=t.data[0].amount}catch(t){console.error(t)}},_changeAddShopType(e){this.addShopInfo.shopRangeSel=[],this.addShopInfo.accountBondAmount="",this._listAddAccountBonds(e)},async _initArea(e,t){try{const o=await Object(n["c"])({areaLevel:e,parentAreaCode:t}),a=o.data;"101"===e?this.addShopInfo.provs=a:"202"===e?this.addShopInfo.citys=a:this.addShopInfo.areas=a}catch(o){console.error(o),this.$message.error("查询地区失败")}},getProv(e){this._initArea("202",e)},getCity(e){this._initArea("303",e)},clearAddShopInfo(){this.$refs.uploadImage.clearImages();const e=this.addShopInfo.openTypes;this.addShopInfo={shopName:"",shopLogo:"",shopType:"",openType:"",shopDesc:"",sendAddress:"",returnPerson:"",returnLink:"",returnAddress:"",accountBondAmount:"",mapX:"",mapY:"",accountBonds:[],selectProv:"",selectCity:"",selectArea:"",areaCode:"",areas:[],provs:[],citys:[],openTypes:e,communitys:[]},console.log(this.addShopInfo.communitys)},handlePositionChange(e){this.addShopInfo.mapX=e.lng,this.addShopInfo.mapY=e.lat},async saveShopInfo(){try{const e=await this.$refs.addShopForm.validate();if(!e)return;if(!this.addShopInfo.accountBondAmount)return this.addShopInfo.accountBondAmount="",void this.$message.warning("请联系管理员设置该商铺类型的保证金!");const t=await Object(n["l"])(this.addShopInfo);0===t.code&&(this.dialogVisible=!1,this.clearAddShopInfo(),this.$emit("listShop"),this.$message.success("开店成功"))}catch(e){console.error(e)}}}},I=S,y=Object(f["a"])(I,r,l,!1,null,null,null),b=y.exports,v=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"修改店铺",visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.refreshEditShopInfo}},[t("el-form",{ref:"editShopForm",attrs:{model:e.editShopInfo,"label-width":"120px"}},[t("el-form-item",{attrs:{label:"商铺名称",prop:"shopName",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写商铺名称"},model:{value:e.editShopInfo.shopName,callback:function(t){e.$set(e.editShopInfo,"shopName",t)},expression:"editShopInfo.shopName"}})],1),t("el-form-item",{attrs:{label:"商铺logo",prop:"shopLogo",required:""}},[t("upload-image-url",{ref:"uploadImage",attrs:{imageCount:1},on:{notifyUploadCoverImage:e.handleUploadImage}})],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"商铺类型",prop:"shopType",required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择商铺类型"},on:{change:e._changeEditShopType},model:{value:e.editShopInfo.shopType,callback:function(t){e.$set(e.editShopInfo,"shopType",t)},expression:"editShopInfo.shopType"}},e._l(e.shopInfo.shopTypes,(function(e){return t("el-option",{key:e.shopTypeId,attrs:{label:e.typeName,value:e.shopTypeId}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"开店类型",prop:"openType",required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择开店类型"},model:{value:e.editShopInfo.openType,callback:function(t){e.$set(e.editShopInfo,"openType",t)},expression:"editShopInfo.openType"}},e._l(e.editShopInfo.openTypes,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1)],1),t("el-form-item",{attrs:{label:"商铺描述",prop:"shopDesc",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写商铺描述"},model:{value:e.editShopInfo.shopDesc,callback:function(t){e.$set(e.editShopInfo,"shopDesc",t)},expression:"editShopInfo.shopDesc"}})],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"退货联系人",prop:"returnPerson",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写退货联系人"},model:{value:e.editShopInfo.returnPerson,callback:function(t){e.$set(e.editShopInfo,"returnPerson",t)},expression:"editShopInfo.returnPerson"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"退货联系电话",prop:"returnLink",required:""}},[t("el-input",{attrs:{placeholder:"必填,请填写退货联系电话"},model:{value:e.editShopInfo.returnLink,callback:function(t){e.$set(e.editShopInfo,"returnLink",t)},expression:"editShopInfo.returnLink"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"发货地址",prop:"sendAddress",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写发货地址"},model:{value:e.editShopInfo.sendAddress,callback:function(t){e.$set(e.editShopInfo,"sendAddress",t)},expression:"editShopInfo.sendAddress"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"退货地址",prop:"returnAddress",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写退货地址"},model:{value:e.editShopInfo.returnAddress,callback:function(t){e.$set(e.editShopInfo,"returnAddress",t)},expression:"editShopInfo.returnAddress"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"坐标X位置",prop:"mapX",required:""}},[t("el-input",{attrs:{placeholder:"请点击地图获取坐标",disabled:""},model:{value:e.editShopInfo.mapX,callback:function(t){e.$set(e.editShopInfo,"mapX",t)},expression:"editShopInfo.mapX"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"坐标Y位置",prop:"mapY",required:""}},[t("el-input",{attrs:{placeholder:"请点击地图获取坐标",disabled:""},model:{value:e.editShopInfo.mapY,callback:function(t){e.$set(e.editShopInfo,"mapY",t)},expression:"editShopInfo.mapY"}})],1)],1)],1),t("el-form-item",{attrs:{label:"选择定位"}},[t("select-map-pos",{ref:"selectMapPos",on:{"position-change":e.handlePositionChange}})],1),"002"==e.editShopInfo.state?t("el-form-item",{attrs:{label:"修改原因",prop:"applyOpinion",required:""}},[t("el-input",{attrs:{type:"textarea",placeholder:"必填,请填写修改原因"},model:{value:e.editShopInfo.applyOpinion,callback:function(t){e.$set(e.editShopInfo,"applyOpinion",t)},expression:"editShopInfo.applyOpinion"}})],1):e._e(),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:e.editShop}},[e._v("保存")]),t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")])],1)],1)],1)},w=[],_={components:{UploadImageUrl:p["a"],SelectMapPos:g},data(){return{dialogVisible:!1,editShopInfo:{shopId:"",shopName:"",shopLogo:"2",shopType:"",openType:"",shopDesc:"",changeLogo:"",sendAddress:"",storeId:"",returnPerson:"",returnLink:"",returnAddress:"",shopRange:"",shopRangeSel:[],shopRanges:[],openTypes:[],applyOpinion:"",mapX:"",mapY:"",state:"",areaCode:""},shopInfo:{shopTypes:[]},map:null}},methods:{open(e){this.dialogVisible=!0,this.$nextTick(()=>{this.$refs.selectMapPos.initMap({}),this.refreshEditShopInfo(),this.getDictData(),Object.assign(this.editShopInfo,e),this.$refs.uploadImage.setImages([e.shopLogo])})},async getDictData(){try{const{data:e}=await Object(n["e"])("s_shop","open_type");this.editShopInfo.openTypes=e}catch(e){console.error("获取字典数据失败:",e)}},handlePositionChange(e){this.editShopInfo.mapX=e.lng,this.editShopInfo.mapY=e.lat},handleUploadImage(e){e.length>0?this.editShopInfo.shopLogo=e[e.length-1]:this.editShopInfo.shopLogo=""},refreshEditShopInfo(){this.$refs.uploadImage.clearImages(),this.editShopInfo={shopId:"",shopName:"",applyOpinion:"",shopLogo:"2",storeId:"",changeLogo:"",shopType:"",openType:"",shopDesc:"",sendAddress:"",returnPerson:"",returnLink:"",returnAddress:"",shopRange:"",shopRangeSel:[],shopRanges:[],openTypes:[],mapX:"",mapY:"",state:"",areaCode:""}},_changeEditShopType(){console.log(this.editShopInfo.shopRangeSel),this.editShopInfo.shopRangeSel=[]},async editShop(){try{const e=await this.$refs.editShopForm.validate();if(!e)return;const t=await Object(n["m"])(this.editShopInfo);0===t.code&&(this.dialogVisible=!1,this.$emit("listShop"),this.$message.success(t.msg))}catch(e){console.error(e)}}}},k=_,T=Object(f["a"])(k,v,w,!1,null,null,null),C=T.exports,A=o("4fb4"),x={components:{AddShop:b,EditShop:C,viewQrCode:A["a"]},data(){return{DEFAULT_PAGE:1,DEFAULT_ROWS:10,shopInfo:{openTypeName:["","商家","服务","商家和服务"],shops:[],total:0,records:1,moreCondition:!1,shopId:"",codeUrl:"",shopTypes:[],conditions:{ruleId:"",page:1,row:10}}}},created(){this._listShops(this.DEFAULT_PAGE,this.DEFAULT_ROWS),this._listShopTypes(1,50),console.log(this.shopInfo.moreCondition)},methods:{async _listShopTypes(e,t){try{const o=await Object(n["i"])({page:e,row:t});this.shopInfo.shopTypes=o.data}catch(o){console.error(o)}},async _listShops(e,t){this.shopInfo.conditions.page=e,this.shopInfo.conditions.row=t;try{const e=await Object(n["g"])(this.shopInfo.conditions);this.shopInfo.total=e.total,this.shopInfo.records=e.records,this.shopInfo.shops=e.data}catch(o){console.error(o)}},_openAddShopModal(){this.$refs.addShop.open()},_openEditShopModel(e){this.$refs.editShop.open(e)},_queryShopMethod(){this._listShops(this.DEFAULT_PAGE,this.DEFAULT_ROWS)},handleCurrentChange(e){this._listShops(e,this.DEFAULT_ROWS)},async _payFee(e){try{const t=await this.$api.post("/payment/toQrBondFeePay",{shopId:e});if(0!==t.code)return void this.$message.error(t.msg);this.$refs.viewQrCode.open({title:"扫码缴保证金",url:t.data.qrCode,remark:t.data.remark})}catch(t){console.error(t)}},_openShopQrCode(e){this.$refs.viewQrCode.open({qrcodeName:e.shopName+"二维码",qrCodeUrl:e.phoneIndexUrl,remark:"手机扫码查看店铺"})}}},q=x,$=(o("8b4f"),Object(f["a"])(q,a,s,!1,null,"c60305b8",null));t["default"]=$.exports},"430d":function(e,t,o){},"4fb4":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.form.qrcodeName,visible:e.visible,width:"400px"},on:{"update:visible":function(t){e.visible=t},close:e.handleClose}},[t("div",{staticClass:"text-center"},[t("div",{staticStyle:{width:"200px",height:"200px",margin:"0 auto"},attrs:{id:"qrcode"}}),t("p",{staticStyle:{margin:"15px 0","font-size":"16px","font-weight":"bold"}},[e._v(" "+e._s(e.form.qrcodeName)+" ")]),t("p",{staticStyle:{color:"#999"}},[e._v(" "+e._s(e.form.remark)+" ")])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.visible=!1}}},[e._v(" "+e._s(e.$t("common.close"))+" ")])],1)])},s=[],n=o("d044"),r=o.n(n),l={name:"ViewQrcode",data(){return{visible:!1,form:{qrcodeName:"",qrCodeUrl:"",remark:""},qrcode:null}},methods:{open(e){this.visible=!0,this.form={...e},this.$nextTick(()=>{this.generateQRCode()})},handleClose(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form={qrcodeName:"",qrCodeUrl:"",remark:""}},generateQRCode(){this.qrcode&&(this.qrcode.clear(),document.getElementById("qrcode").innerHTML=""),this.form.qrCodeUrl&&(this.qrcode=new r.a(document.getElementById("qrcode"),{text:this.form.qrCodeUrl,width:200,height:200,colorDark:"#000000",colorLight:"#ffffff",correctLevel:r.a.CorrectLevel.L}))}},beforeDestroy(){this.qrcode&&this.qrcode.clear()}},i=l,p=(o("5cbf"),o("2877")),d=Object(p["a"])(i,a,s,!1,null,"b2ac6c9c",null);t["a"]=d.exports},"55ba":function(e,t,o){},"5cbf":function(e,t,o){"use strict";o("430d")},"5e31":function(e,t,o){"use strict";var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"upload-image-container"},[e._l(e.photos,(function(o,a){return t("div",{key:a,staticClass:"image-item"},[t("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:o,fit:"cover","preview-src-list":e.photos}}),t("i",{staticClass:"el-icon-delete delete-icon",on:{click:function(t){return e.removeImage(a)}}})],1)})),e.photos.length<e.imageCount?t("div",{staticClass:"upload-button",on:{click:e.triggerUpload}},[t("i",{staticClass:"el-icon-plus"})]):e._e(),t("input",{ref:"fileInput",attrs:{type:"file",accept:"image/*",hidden:""},on:{change:e.handleFileChange}})],2)},s=[],n=o("3549"),r={name:"UploadImageUrl",props:{imageCount:{type:Number,default:1}},data(){return{photos:[],photosUrl:[]}},methods:{triggerUpload(){this.$refs.fileInput.click()},async handleFileChange(e){const t=e.target.files[0];if(!t)return;if(t.size>2097152)return void this.$message.error("图片大小不能超过2MB");const o=new FileReader;o.onload=e=>{this.photos.push(e.target.result)},o.readAsDataURL(t);try{const e=new FormData;e.append("uploadFile",t),e.append("communityId","-1");const{data:o}=await Object(n["b"])(e);this.photosUrl.push(o.url),this.$emit("notifyUploadCoverImage",this.photosUrl)}catch(a){this.$message.error(a.message||"上传失败")}e.target.value=null},removeImage(e){this.photos.splice(e,1),this.photosUrl.splice(e,1),this.$emit("notifyUploadCoverImage",this.photosUrl)},clearImages(){this.photos=[],this.photosUrl=[]},setImages(e){this.clearImages(),e.forEach(e=>{if(!(e.indexOf("base64,")>-1))return e.indexOf("http")>-1?(this.photos.push(e),void this.photosUrl.push(e)):void this.photosUrl.push(e);this.photos.push(e)})}}},l=r,i=(o("e457"),o("2877")),p=Object(i["a"])(l,a,s,!1,null,"c3e7566c",null);t["a"]=p.exports},"8b4f":function(e,t,o){"use strict";o("f143")},b103:function(e,t,o){"use strict";o.d(t,"b",(function(){return s})),o.d(t,"c",(function(){return n})),o.d(t,"d",(function(){return r})),o.d(t,"e",(function(){return l})),o.d(t,"a",(function(){return i}));var a=o("b775");function s(e){return new Promise((t,o)=>{Object(a["a"])({url:"/accountBond.queryAccountBond",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function n(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shopType.queryShopType",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function r(e){return new Promise((t,o)=>{Object(a["a"])({url:"/accountBond.saveAccountBond",method:"post",data:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function l(e){return new Promise((t,o)=>{Object(a["a"])({url:"/accountBond.updateAccountBond",method:"post",data:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function i(e){return new Promise((t,o)=>{Object(a["a"])({url:"/accountBond.deleteAccountBond",method:"post",data:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}},d6fc:function(e,t,o){"use strict";o("d846")},d846:function(e,t,o){},e457:function(e,t,o){"use strict";o("55ba")},f143:function(e,t,o){}}]);
|
|
//# sourceMappingURL=chunk-1885b06e.65f78536.js.map
|