pyxis-page/dist/js/chunk-7a6b6eaa.3d23582a.js
2021-06-09 19:29:03 +08:00

2 lines
12 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7a6b6eaa"],{"4c9b":function(t,e,r){"use strict";r.d(e,"i",(function(){return n})),r.d(e,"g",(function(){return o})),r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return i})),r.d(e,"d",(function(){return c})),r.d(e,"b",(function(){return u})),r.d(e,"e",(function(){return p})),r.d(e,"h",(function(){return l})),r.d(e,"f",(function(){return d}));var a=r("2b0e"),n=new a["default"],o="event_shop_puzzles_update",s="event_activity_update",i="event_exam_update",c="event_game_update",u="event_coupon_update",p="event_puzzle_update",l="event_shop_update",d="event_role_update"},5e3:function(t,e,r){"use strict";r("a03e")},a03e:function(t,e,r){},da48:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"app-container"},[r("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules,"label-width":"121px"}},[r("el-form-item",{attrs:{label:t.$t("main.shop")+"名"}},[r("el-select",{staticStyle:{width:"50%"},attrs:{"remote-method":t.queryShop,filterable:"","default-first-option":"",remote:"",placeholder:"搜索"+t.$t("main.shop"),"allow-create":""},on:{change:t.areaSelectChange},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}},t._l(t.shopListOptions,(function(t){return r("el-option",{key:t.id,attrs:{label:t.showStr,value:t.title}})})),1)],1),t.postForm.sid?r("el-form-item",{attrs:{label:"ID",prop:"sid"}},[t._v(" "+t._s(t.postForm.sid)+" ")]):t._e(),t.postForm.numid?r("el-form-item",{attrs:{label:"编号",prop:"numid"}},[t._v(" "+t._s(t.postForm.numid)+" ")]):t._e(),r("el-form-item",{attrs:{label:"显示名",prop:"showName"}},[r("el-input",{staticStyle:{width:"50%"},attrs:{name:"showName",required:""},model:{value:t.postForm.showName,callback:function(e){t.$set(t.postForm,"showName",e)},expression:"postForm.showName"}})],1),r("el-form-item",{attrs:{label:"类别",prop:"category"}},[r("el-input",{staticStyle:{width:"50%"},attrs:{name:"category"},model:{value:t.postForm.category,callback:function(e){t.$set(t.postForm,"category",e)},expression:"postForm.category"}})],1),r("el-form-item",{attrs:{label:"区域"}},[r("region-picker",{on:{"area-change":t.areaChange},model:{value:t.postForm.areaCode,callback:function(e){t.$set(t.postForm,"areaCode",e)},expression:"postForm.areaCode"}})],1),r("el-form-item",{attrs:{label:"详细地址",prop:"address"}},[r("el-input",{staticStyle:{width:"50%"},attrs:{name:"address",required:""},model:{value:t.postForm.address,callback:function(e){t.$set(t.postForm,"address",e)},expression:"postForm.address"}})],1),r("el-form-item",{attrs:{label:"座标点",prop:"lng"}},[t._v(" "+t._s(t.postForm.location)+" "),r("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.querying,expression:"querying"}],attrs:{type:"success"},on:{click:t.updateLoc}},[t._v(" 更新座标 ")])],1),r("el-form-item",{attrs:{prop:"imageURL",label:"logo"}},[r("upload-image",{model:{value:t.postForm.logo,callback:function(e){t.$set(t.postForm,"logo",e)},expression:"postForm.logo"}})],1),r("el-form-item",[r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["shopman:edit"],expression:"['shopman:edit']"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(" 保存 ")]),r("el-button",{on:{click:t.onCancel}},[t._v(" 取消 ")])],1)],1)],1)},n=[],o=r("b85c"),s=r("1da1"),i=r("d4ec"),c=r("bee2"),u=r("262e"),p=r("2caf"),l=(r("99af"),r("b0c0"),r("96cf"),r("9ab4")),d=r("1b40"),m=r("ac1a"),h=r("e741"),f=r("da80"),g=r("b804"),b=r("6b45"),v=r("6a04"),y=r("db85"),w=r("b32d");function F(t,e){return O.apply(this,arguments)}function O(){return O=Object(s["a"])(regeneratorRuntime.mark((function t(e,r){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={keyword:e,region:r},t.abrupt("return",Object(w["a"])({url:"/api/area/query",method:"post",data:a}));case 2:case"end":return t.stop()}}),t)}))),O.apply(this,arguments)}function k(t){return j.apply(this,arguments)}function j(){return j=Object(s["a"])(regeneratorRuntime.mark((function t(e){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r={address:e},t.abrupt("return",Object(w["a"])({url:"/api/area/geocoder",method:"post",data:r}));case 2:case"end":return t.stop()}}),t)}))),j.apply(this,arguments)}var _=r("6ebf"),x=r("4c9b"),$=function(t){Object(u["a"])(r,t);var e=Object(p["a"])(r);function r(){var t;return Object(i["a"])(this,r),t=e.apply(this,arguments),t.validateRequire=function(e,r,a){""===r?("imageURL"===e.field?t.$message({message:"Upload cover image is required",type:"error"}):t.$message({message:e.field+" 是必填的",type:"error"}),a(new Error(e.field+" 是必填的"))):a()},t.postForm=Object.assign({},y["a"]),t.loading=!1,t.querying=!1,t.rules={name:[{validator:t.validateRequire}]},t.shopListOptions=[],t}return Object(c["a"])(r,[{key:"lang",get:function(){return m["a"].language}},{key:"created",value:function(){var t,e=null===(t=this.$route.params)||void 0===t?void 0:t.id;e&&this.fetchData(e),this.tempTagView=Object.assign({},this.$route)}},{key:"fetchData",value:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(y["e"])(e,{});case 3:r=t.sent,a=r.data,console.log(a),this.postForm=a,n="zh"===this.lang?"编辑".concat(_["a"].tc("main.shop")):"Edit Shop",this.setTagsViewTitle(n),this.setPageTitle(n),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](0),console.error(t.t0);case 15:case"end":return t.stop()}}),t,this,[[0,12]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"setTagsViewTitle",value:function(t){var e=this.tempTagView;e&&(e.title="".concat(t,"-").concat(this.postForm._id),h["a"].updateVisitedView(e))}},{key:"setPageTitle",value:function(t){document.title="".concat(t," - ").concat(this.postForm._id)}},{key:"submitForm",value:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){var e,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.$refs.postForm.validate();case 3:return this.loading=!0,t.next=6,Object(y["m"])(this.postForm);case 6:e=t.sent,r=e.data,this.postForm=r,this.loading=!1,this.$notify({title:"Success",message:"The post published successfully",type:"success",duration:2e3}),x["i"].$emit(x["h"],{}),t.next=18;break;case 14:return t.prev=14,t.t0=t["catch"](0),console.error("Submit Error!"),t.abrupt("return",!1);case 18:case"end":return t.stop()}}),t,this,[[0,14]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"onCancel",value:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.$confirm("确认不保存当前".concat(_["a"].tc("main.shop"),"信息?"),"Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:this.$store.dispatch("delView",this.$route),this.$router.go(-1),t.next=9;break;case 7:t.prev=7,t.t0=t["catch"](0);case 9:case"end":return t.stop()}}),t,this,[[0,7]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"draftForm",value:function(){this.$message({message:"The draft saved successfully",type:"success",showClose:!0,duration:1e3})}},{key:"areaChange",value:function(t){console.log("new area: ".concat(t)),this.postForm.areaStr=t}},{key:"queryShop",value:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){var r,a,n,s,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e&&!(e.length<2)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,F(e,"上海");case 4:r=t.sent,a=r.data,this.shopListOptions.length=0,n=Object(o["a"])(a.records);try{for(n.s();!(s=n.n()).done;)i=s.value,i.showStr="".concat(i.title,"(").concat(i.city,"-").concat(i.district,")")}catch(c){n.e(c)}finally{n.f()}this.shopListOptions=a.records;case 10:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"areaSelectChange",value:function(t){var e,r,a=Object(o["a"])(this.shopListOptions);try{for(a.s();!(r=a.n()).done;){var n=r.value;if(n.title===t){e=n;break}}}catch(s){a.e(s)}finally{a.f()}console.log(e),e&&(this.postForm.address=e.address,this.postForm.showName=this.postForm.name,this.postForm.areaCode=e.adcode,this.postForm.areaStr="".concat(e.province,"-").concat(e.city,"-").concat(e.district),this.postForm.extData=e.id,this.postForm.category=e.category,e.location&&(this.postForm.lat=e.location.lat,this.postForm.lng=e.location.lng,this.postForm.location=[e.location.lng,e.location.lat]))}},{key:"updateLoc",value:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){var e,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.postForm.address){t.next=2;break}return t.abrupt("return");case 2:return this.querying=!0,t.next=5,k(this.postForm.address);case 5:e=t.sent,r=e.data,console.log(r),this.querying=!1,r.location&&(this.postForm.lat=r.location.lat,this.postForm.lng=r.location.lng,this.postForm.location=[r.location.lng,r.location.lat]);case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}]),r}(d["c"]);$=Object(l["a"])([Object(d["a"])({name:"ShopEditor",components:{MaterialInput:f["a"],Sticky:g["a"],UploadImage:b["a"],RegionPicker:v["a"]}})],$);var R=$,q=R,S=(r("5000"),r("0c7c")),C=Object(S["a"])(q,a,n,!1,null,"4ffd8828",null);e["default"]=C.exports},db85:function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"k",(function(){return o})),r.d(e,"e",(function(){return s})),r.d(e,"d",(function(){return i})),r.d(e,"m",(function(){return c})),r.d(e,"b",(function(){return u})),r.d(e,"n",(function(){return p})),r.d(e,"f",(function(){return l})),r.d(e,"g",(function(){return d})),r.d(e,"q",(function(){return m})),r.d(e,"p",(function(){return h})),r.d(e,"c",(function(){return f})),r.d(e,"l",(function(){return g})),r.d(e,"h",(function(){return b})),r.d(e,"o",(function(){return v})),r.d(e,"i",(function(){return y})),r.d(e,"r",(function(){return w})),r.d(e,"j",(function(){return F}));var a=r("b32d"),n={name:"",address:"",logo:"",qtypes:[]},o=function(t){return Object(a["a"])({url:"/api/shops",method:"post",params:t})},s=function(t,e){return Object(a["a"])({url:"/api/shop/".concat(t),method:"get",params:e})},i=function(){return Object(a["a"])({url:"/api/myshop",method:"get"})},c=function(t){return Object(a["a"])({url:"/api/shop/save",method:"post",data:t})},u=function(t){return Object(a["a"])({url:"/api/shop/".concat(t,"/delete"),method:"post"})},p=function(t){return Object(a["a"])({url:"/api/shop/gameinfo/save",method:"post",data:t})},l=function(t){return Object(a["a"])({url:"/api/shop/gameinfo",method:"post",data:t})},d=function(t){return Object(a["a"])({url:"/api/shop/gameqr",method:"post",data:t})},m=function(t){return Object(a["a"])({url:"/api/shop/save_qtype",method:"post",data:t})},h=function(t){return Object(a["a"])({url:"/api/shop/publish",method:"post",data:t})},f=function(t){return Object(a["a"])({url:"/api/shop/gametheme",method:"post",data:t})},g=function(t){return Object(a["a"])({url:"/api/shop/gametheme/save",method:"post",data:t})},b=function(t){return Object(a["a"])({url:"/api/shop/lottery",method:"post",data:t})},v=function(t){return Object(a["a"])({url:"/api/shop/lottery_update",method:"post",data:t})},y=function(t){return Object(a["a"])({url:"/api/shop/share",method:"post",data:t})},w=function(t){return Object(a["a"])({url:"/api/shop/share_update",method:"post",data:t})},F=function(t){return Object(a["a"])({url:"/api/shop/game_users",method:"post",data:t})}}}]);
//# sourceMappingURL=chunk-7a6b6eaa.3d23582a.js.map