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.3 KiB
1 lines
6.3 KiB
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package2/index/checkShop"],{"2b33":function(e,t,n){"use strict";var o=n("ee6b"),i=n.n(o);i.a},3693:function(e,t,n){},"974e":function(e,t,n){"use strict";var o=n("3693"),i=n.n(o);i.a},c868:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u})),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,"9f6d"))},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,"75fd"))},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,"4ef2"))},uIcon:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(n.bind(null,"1608"))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,"e681"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"33fa"))},uInput:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-input/u-input")]).then(n.bind(null,"a570"))}},i=function(){var e=this.$createElement;this._self._c},u=[]},d24b:function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("7859");o(n("3240"));var i=o(n("e9ce"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},df7f: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")),u=n("8f59");function s(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 r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a={name:"checkShop",computed:(0,u.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:r(r({},(0,u.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=a}).call(this,n("df3c")["default"])},e9ce:function(e,t,n){"use strict";n.r(t);var o=n("c868"),i=n("ef83");for(var u in i)["default"].indexOf(u)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(u);n("2b33"),n("974e");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"aa7c458e",null,!1,o["a"],void 0);t["default"]=r.exports},ee6b:function(e,t,n){},ef83:function(e,t,n){"use strict";n.r(t);var o=n("df7f"),i=n.n(o);for(var u in o)["default"].indexOf(u)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(u);t["default"]=i.a}},[["d24b","common/runtime","common/vendor"]]]);
|