index.js 9.6 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{65:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var a=o(t(66));e.__webpack_require_UNI_MP_PLUGIN__=t,n(a.default)}).call(this,t(1)["default"],t(2)["createPage"])},66:function(e,n,t){"use strict";t.r(n);var o=t(67),a=t(69);for(var i in a)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(i);t(75),t(77);var s,r=t(32),c=Object(r["default"])(a["default"],o["render"],o["staticRenderFns"],!1,null,"57280228",null,!1,o["components"],s);c.options.__file="pages/index/index.vue",n["default"]=c.exports},67:function(e,n,t){"use strict";t.r(n);var o=t(68);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},68:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return a})),t.d(n,"staticRenderFns",(function(){return s})),t.d(n,"recyclableRender",(function(){return i})),t.d(n,"components",(function(){return o}));var a=function(){var e=this,n=e.$createElement,t=(e._self._c,e.shopInfo.name?e._f("getName")(e.shopInfo.name,18):null);e._isMounted||(e.e0=function(n){e.showGuide=!1},e.e1=function(n){e.showGuide=!1},e.e2=function(n){e.shareShow=!1}),e.$mp.data=Object.assign({},{$root:{f0:t}})},i=!1,s=[];a._withStripped=!0},69:function(e,n,t){"use strict";t.r(n);var o=t(70),a=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=a.a},70:function(e,n,t){"use strict";(function(e){var o=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=t(71),i=t(74),s=(o(t(63)),{data:function(){return{showPlace:!0,searchName:"",shareShow:!1,canvasWidth:0,canvasHeight:0,shopInfo:"",store:"",qrImg:"",poster:"",star:"",state:"",signCode:"",dataInfo:"",model:"",indexList:[{id:1,title:"客户",intr:"客户信息精确管理",icon:"/static/imgs/shop/icon1.png",url:"../../pagesA/pages/user-manage/user-manage",width:61,height:66},{id:4,title:"订单",intr:"订单详情及发货",icon:"/static/imgs/shop/icon4.png",url:"../order-manage/order-manage",width:66,height:53},{id:6,title:"代下单",intr:"快速帮客户下单",icon:"/static/imgs/shop/icon6.png",url:"../user-list/user-list",width:50,height:62},{id:5,title:"退货",intr:"订单退货及取消",icon:"/static/imgs/shop/icon5.png",url:"../../pagesA/pages/refund-manage/refund-manage",width:57,height:57}],isForbidden:!1,hintCon:"",timer:null,showGuide:!1,showAuth:!0,isShow:!0}},onLoad:function(){var n=this;e.getSystemInfo({success:function(e){n.model=e.model,n.canvasWidth=e.windowWidth/375,n.canvasHeight=e.windowHeight}})},onShow:function(){var n=e.getNetworkType();"none"!==n?["2g","3g"].includes(n)?e.showModal({content:"当前网络信号弱,请检查后再试",showCancel:!1}):(e.getStorageSync("token")?this.getShop():this.login(),this.searchName=""):e.showModal({content:"暂无网络连接,请检查后再试",showCancel:!1})},onPullDownRefresh:function(){e.startPullDownRefresh(),this.getShop()},methods:{checkNetStatus:function(){var n=e.getNetworkType();return"none"===n?(console.log("当前设备未连接到任何网络"),!1):["2g","3g"].includes(n)?(console.log("当前设备处于弱网环境"),!1):(console.log("当前设备正常联网"),!0)},moveHandle:function(){},getData:function(){var n=this;(0,a.getZbsRank)().then((function(t){if(200==t.code){n.scoreData=t.data;var o=t.data.type;1==o&&e.getImageInfo({src:n.shopInfo.img,success:function(e){n.shareShow=!0,n.drawImg(e.path)}})}}))},skip:function(){e.navigateToMiniProgram({appId:"wxa9d1325fd98f5a7d",path:"pages/index/index",extraData:{data1:"test"},success:function(e){}})},preview:function(){e.previewImage({current:this.poster,urls:[this.poster]})},skipPage:function(n){if(this.isForbidden)return e.showModal({content:this.hintCon,showCancel:!1}),!1;var t="";switch(n){case 0:t="../order-manage/order-manage?status=0";break;case 1:t="../../pagesA/pages/capital-manage/capital-manage";break;case 2:t="../../pagesA/pages/brow-user/brow-user";break;case 3:t="../auth-step/auth-step";break;case 4:t="../../pagesA/pages/qr-code/qr-code";default:break}e.navigateTo({url:t})},login:function(){var n=this,t=this;e.login({success:function(o){if("login:ok"==o.errMsg){var a=n.checkNetStatus();if(!a)return void e.showModal({content:"当前网络信号弱,请检查后再试",showCancel:!1});e.showLoading({title:"自动登录中..."}),(0,i.wxLogin)({wxcode:o.code}).then((function(n){if(450005==Number(n.code))return e.redirectTo({url:"../../pagesA/pages/login-fail/login-fail?hint=你已被系统删除"}),!1;if(Number(450013==n.code))return e.showModal({content:"登陆失败,请手动登录",showCancel:!1,success:function(n){n.confirm&&e.redirectTo({url:"../login/login"})}}),!1;if(200==n.code){var o=n.data,a=o.token;o.user,o.is_agent;e.setStorageSync("token",a),t.getShop()}else{var i=n.data;e.showModal({content:n.data||"登录失败",showCancel:!1,success:function(n){n.confirm&&e.redirectTo({url:"../../pagesA/pages/login-fail/login-fail?hint="+i})}})}e.hideLoading()})).catch((function(n){e.hideLoading(),e.showModal({content:n,showCancel:!1}),console.log(n,"错误消息")}))}else e.showModal({content:"登录失败!",showCancel:!1})},fail:function(n){e.hideLoading(),e.showModal({content:"登录失败",showCancel:!1})}})},skipShare:function(){e.navigateTo({url:"../goods-share/goods-share"})},skipVideo:function(){e.navigateTo({url:"../shop-video/shop-video"})},skipProtocol:function(){e.navigateTo({url:"../../pagesA/pages/protocol/protocol"})},getUrlParam:function(e){var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),t=window.location.search.substr(1).match(n);return null!=t?decodeURIComponent(t[2]):null},getShop:function(){var n=this,t=this.checkNetStatus();t?(e.showLoading({title:"加载中...",mask:!0}),(0,a.getStoreInfo)().then((function(t){if(e.stopPullDownRefresh(),450005==Number(t.code))return e.redirectTo({url:"../../pagesA/pages/login-fail/login-fail?hint=你已被系统删除"}),!1;if(450004==Number(t.code)&&e.redirectTo({url:"../../pagesA/pages/login-fail/login-fail?hint=店铺已禁用,请联系上级管理员"}),200==t.code){n.dataInfo=t.data,n.shopInfo=t.data.store,e.setStorageSync("store",t.data.store);var o=n.shopInfo,a=(o.is_apply,o.show_num1),i=o.qr_code,s=o.level,r=Date.parse(new Date),c=1675386e6;if(1==s&&r>=c){n.showPlace=!1;var l=n.indexList.findIndex((function(e){return 6==e.id}));-1!=l&&n.indexList.splice(l,1)}if(e.setStorageSync("qrCode",i),1===Number(t.data.is_delete))return e.reLaunch({url:"../../pagesA/pages/del-withdrawal/del-withdrawal"}),!1;n.showAuth=!1,n.showGuide=1==a,n.star=5-Number(t.data.store.star),n.getData()}else e.showModal({content:t.data,showCancel:!1,success:function(n){n.confirm&&e.redirectTo({url:"../../pagesA/pages/login-fail/login-fail"})}});e.hideLoading()})).catch((function(n){e.hideLoading()}))):e.showModal({content:"当前网络信号弱,请检查后再试",showCancel:!1})},dataURLtoFile:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",t=e.split(","),o=t[0].match(/:(.*?);/)[1],a=o.split("/")[1],i=atob(t[1]),s=i.length,r=new Uint8Array(s);while(s--)r[s]=i.charCodeAt(s);return new File([r],"".concat(n,".").concat(a),{type:o})},drawImg:function(n){var t=this,o=this;e.getImageInfo({src:"https://api.jiuweiyun.cn/public/uploads/icon/poster_new.png",success:function(a){e.showLoading({title:"图片加载中..."});var i=o.scoreData,s=(i.score,i.ranking),r=e.createCanvasContext("canvas"),c=o.canvasWidth;r.drawImage(a.path,0,0,270*c,450*c),r.font="italic bold 18px pingfang",r.setFillStyle("#fff"),r.textAlign="center",r.fillText(s,e.upx2px(270),e.upx2px(467)),r.beginPath(),r.setLineWidth(2),r.setStrokeStyle("#EF0A16"),r.setFillStyle("#EF0A16"),r.font="noraml bold 18px pingfang",r.textAlign="center",r.fillText(t.shopInfo.name,e.upx2px(270),e.upx2px(360)),r.moveTo(e.upx2px(175),e.upx2px(375)),r.lineTo(e.upx2px(365),e.upx2px(375)),r.stroke(),r.closePath(),r.beginPath(),r.arc(55*c/2+110*c,55*c/2+104*c,55*c/2,0,2*Math.PI,!1),r.clip(),r.drawImage(n,110*c,104*c,55*c,55*c),r.restore(),setTimeout((function(n){r.draw(!1,(function(){e.canvasToTempFilePath({width:270*c,height:450*c,canvasId:"canvas",success:function(n){if(e.hideLoading(),"iPhone"==t.model)t.poster=t.dataURLtoFile(n.tempFilePath).name;else{var o=n.tempFilePath.replace(/\. +/g,"");t.poster=o.replace(/[\r\n]/g,"")}}})})),e.hideLoading()}),1e3)}})},checkDel:function(){},skipDel:function(n){if(this.isForbidden)return e.showModal({content:"",showCancel:!1}),!1;e.navigateTo({url:n})},skipEdit:function(){if(this.isForbidden)return e.showModal({content:this.hintCon,showCancel:!1}),!1;e.navigateTo({url:"../shop-info/shop-info"})},sikpEval:function(){if(this.isForbidden)return e.showModal({content:this.hintCon,showCancel:!1}),!1;e.navigateTo({url:"../evaluate/evaluate"})},searchOrder:function(){return this.isForbidden?(e.showModal({content:this.hintCon,showCancel:!1}),!1):this.searchName?void e.navigateTo({url:"../order-manage/order-manage?order_no="+this.searchName}):(e.showModal({content:"搜索内容不能为空",showCancel:!1}),!1)}}});n.default=s}).call(this,t(2)["default"])},75:function(e,n,t){"use strict";t.r(n);var o=t(76),a=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=a.a},76:function(e,n,t){},77:function(e,n,t){"use strict";t.r(n);var o=t(78),a=t.n(o);for(var i in o)["default"].indexOf(i)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(i);n["default"]=a.a},78:function(e,n,t){}},[[65,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map