You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
6.2 KiB
1 lines
6.2 KiB
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package2/index/checkShop"],{"01b0":function(e,t,n){"use strict";n.r(t);var o=n("ee33"),i=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);t["default"]=i.a},"3d4e":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return o}));var o={uAlert:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-alert/u-alert")]).then(n.bind(null,"ed4e"))},uSwipeAction:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-swipe-action/u-swipe-action")]).then(n.bind(null,"f7ea"))},uSwipeActionItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-swipe-action-item/u-swipe-action-item")]).then(n.bind(null,"7ae7"))},uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"83a8"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"0ae5"))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-input/u-input")]).then(n.bind(null,"0d26"))}},i=function(){var e=this.$createElement;this._self._c},s=[]},"4b51":function(e,t,n){"use strict";var o=n("fb04"),i=n.n(o);i.a},"862f":function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("82ca");o(n("3240"));var i=o(n("d346"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},be05:function(e,t,n){},d346:function(e,t,n){"use strict";n.r(t);var o=n("3d4e"),i=n("01b0");for(var s in i)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(s);n("e18e"),n("4b51");var u=n("828b"),a=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,"74d68cfc",null,!1,o["a"],void 0);t["default"]=a.exports},e18e:function(e,t,n){"use strict";var o=n("be05"),i=n.n(o);i.a},ee33:function(e,t,n){"use strict";(function(e){var o=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("7ca3")),s=n("8f59");function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var r={name:"checkShop",computed:(0,s.mapState)(["userId","shopIndex"]),data:function(){return{choose:"1",options1:[{text:"编辑",style:{backgroundColor:"#3c9cff"}}],popupShow:!1,shopName:"",shopNameOld:"",shopList:[],shopId:null,current:"",shopOwnerPhone:"",name:"",type:""}},onLoad:function(e){this.type=e.type,this.getList()},methods:a(a({},(0,s.mapMutations)(["setShopIndex"])),{},{submit:function(){var t=this;"wuliu"==this.type?this.getWuliuList():this.tui.request("/auth/chooseShop","POST",{shopId:this.current},!1,!0).then((function(n){200==n.code?(e.setStorageSync("shopName",t.name),e.setStorageSync("shopAddress",n.result.shopAddress),e.setStorageSync("shopIcon",n.result.shopIcon),e.setStorageSync("type",n.result.userType),e.setStorageSync("shopId",t.current),e.setStorageSync("shopOwnerPhone",t.shopOwnerPhone),t.tui.toast("切换店铺成功",2e3,!0),e.removeStorageSync("endTime"),setTimeout((function(){e.reLaunch({url:"/pages/index/index"})}),200)):t.tui.toast(n.message)})).catch((function(e){}))},getWuliuList:function(){var t=this,n=this;e.request({url:this.tui.interfaceUrl()+"/app/logitics/chooseCompany",data:{companyId:this.current},header:{"content-type":"application/x-www-form-urlencoded",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(t){e.setStorageSync("hiver_token",t.data.result.lcomToken),e.setStorageSync("transCompany",t.data.result.logiticsCompany.id),e.setStorageSync("isOnLine",t.data.result.logiticsCompany.isOnLine),e.setStorageSync("companyMobile",t.data.result.logiticsCompany.mobile),e.setStorageSync("companyName",t.data.result.logiticsCompany.companyName),e.setStorageSync("signCompany",t.data.result.logiticsCompany.signCompany),e.setStorageSync("wayValue",n.wayValue),n.tui.toast("登录成功",2e3,!0),setTimeout((function(){e.reLaunch({url:"/package2/other/newLogisticsIndex"})}),200)},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}})},getList:function(){var t=this;"wuliu"==this.type?e.request({url:this.tui.interfaceUrl()+"/app/logitics/findByMobile",data:{mobile:e.getStorageSync("companyMobile")},header:{"content-type":"application/x-www-form-urlencoded",appWLToken:this.tui.getToken()},method:"POST",dataType:"json",success:function(n){t.shopList=n.data.result;for(var o=0;o<n.data.result.length;o++)n.data.result[o].companyName==e.getStorageSync("companyName")&&(t.current=n.data.result[o].id)},fail:function(e){t.tui.toast("网络不给力,请稍后再试~")}}):this.tui.request("/auth/getShopByUser","post",{},!1,!0).then((function(n){if(200==n.code){for(var o=0;o<n.result.length;o++)n.result[o].shopName==e.getStorageSync("shopName")&&(t.current=n.result[o].shop.id);t.shopList=n.result}else t.tui.toast(n.message)}))},onPopupClose:function(){this.popupShow=!1,this.shopName="",this.shopId="",this.shopNameOld=""},onActionItemSwipe:function(e){this.popupShow=!0,this.shopNameOld=e.shopName,this.shopId=e.shopId},onActionItemClick:function(e){"wuliu"==this.type?(this.current=e.id,this.name=e.companyName):(this.current=e.shop.id,this.name=e.shopName,this.shopOwnerPhone=e.shopOwnerPhone)},onEditSave:function(){var e=this;if(!this.shopName)return this.tui.toast("请输入新店铺名称",2e3);this.tui.request("/app/shop/modifyShopNameById","put",{id:this.shopId,shopName:this.shopName},!1,!0).then((function(t){200===t.code?(e.getList(),e.onPopupClose()):e.tui.toast(t.message)}))}})};t.default=r}).call(this,n("df3c")["default"])},fb04:function(e,t,n){}},[["862f","common/runtime","common/vendor"]]]);
|