12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{52:function(e,t,n){"use strict";(function(e,t){var r=n(4);n(26);r(n(25));var a=r(n(53));e.__webpack_require_UNI_MP_PLUGIN__=n,t(a.default)}).call(this,n(1)["default"],n(2)["createPage"])},53:function(e,t,n){"use strict";n.r(t);var r=n(54),a=n(56);for(var i in a)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(i);var o,s=n(36),c=Object(s["default"])(a["default"],r["render"],r["staticRenderFns"],!1,null,"57280228",null,!1,r["components"],o);c.options.__file="pages/index/index.vue",t["default"]=c.exports},54:function(e,t,n){"use strict";n.r(t);var r=n(55);n.d(t,"render",(function(){return r["render"]})),n.d(t,"staticRenderFns",(function(){return r["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return r["recyclableRender"]})),n.d(t,"components",(function(){return r["components"]}))},55:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"render",(function(){return a})),n.d(t,"staticRenderFns",(function(){return o})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return r}));try{r={tnNavBar:function(){return Promise.all([n.e("common/vendor"),n.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(n.bind(null,204))},tnLoading:function(){return n.e("tuniao-ui/components/tn-loading/tn-loading").then(n.bind(null,212))},tnTabbar:function(){return n.e("tuniao-ui/components/tn-tabbar/tn-tabbar").then(n.bind(null,219))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var e=this,t=e.$createElement;e._self._c},i=!1,o=[];a._withStripped=!0},56:function(e,t,n){"use strict";n.r(t);var r=n(57),a=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t["default"]=a.a},57:function(e,t,n){"use strict";(function(e,r){var a=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n(58)),o=a(n(60)),s=a(n(61)),c=function(){n.e("pages/index/autoLogin").then(function(){return resolve(n(226))}.bind(null,n)).catch(n.oe)},u=function(){n.e("pages/home/home").then(function(){return resolve(n(231))}.bind(null,n)).catch(n.oe)},d=function(){n.e("pages/comm/comm").then(function(){return resolve(n(238))}.bind(null,n)).catch(n.oe)},l=function(){n.e("pages/discovery/discovery").then(function(){return resolve(n(245))}.bind(null,n)).catch(n.oe)},h=function(){n.e("pages/mine/mine").then(function(){return resolve(n(252))}.bind(null,n)).catch(n.oe)},f={components:{Auth:c,Home:u,Comm:d,Discovery:l,Mine:h},data:function(){return{triggered:!1,_freshing:!1,tabbarList:[{title:"供需发布平台",activeIcon:"add-fill",inactiveIcon:"add-circle"},{title:"我要什么",activeIcon:"trust-fill",inactiveIcon:"trust"},{title:"我有什么",activeIcon:"team-fill",inactiveIcon:"team"},{title:"我的",activeIcon:"my-fill",inactiveIcon:"my"}],currentIndex:0,tabberPageLoadFlag:[],shareData:{},wxFontSize:17}},onLoad:function(t){var n=e.getAppBaseInfo();this.wxFontSize=r.getStorageSync("fontSize")||n.fontSizeSetting||17;var a=Number(t.index||0);this.tabberPageLoadFlag=this.tabbarList.map((function(e,t){return a===t})),this._freshing=!1,this.switchTabbar(a);r.hideShareMenu()},onShow:function(t){if(3===this.currentIndex&&this.$refs.mine&&this.$refs.mine.fetchData(),2===this.currentIndex&&this.$refs.comm&&this.$refs.comm.fetchData(),0===this.currentIndex&&this.$refs.discovery&&this.$refs.discovery.fetchData(),r.getStorageSync("lastTime")?((new Date).getTime()-r.getStorageSync("lastTime")>3e5||!r.getStorageSync("userNo"))&&(r.setStorageSync("lastTime",(new Date).getTime()),this.$refs.authRef&&r.getStorageSync("loginOut")):r.setStorageSync("lastTime",(new Date).getTime()),r.getStorageSync("nextPage")&&r.getStorageSync("userNo")){var n=r.getStorageSync("nextPage");r.removeStorageSync("nextPage"),r.navigateTo({url:n})}else r.removeStorageSync("nextPage");if(e.canIUse("getUpdateManager")){var a=e.getUpdateManager();a&&a.onCheckForUpdate((function(e){e.hasUpdate&&(a.onUpdateReady((function(){r.showModal({title:"更新提示",content:"新版本已经准备好,是否重启应用?",success:function(e){e.confirm&&(r.clearStorageSync(),a.applyUpdate())}})})),a.onUpdateFailed((function(){r.reLaunch({url:"/pages/index/index"})})))}))}},methods:{switchTabbar:function(e){this._switchTabbarPage(e)},tabbarPageScrollLower:function(e){1===this.currentIndex&&this.$refs.home.loadMore(),2===this.currentIndex&&this.$refs.comm.loadMore()},onPulling:function(e){console.log("onpulling",e),e.detail.deltaY<0||(this.triggered=!0)},onRefresh:function(){var e=this;this._freshing||(this._freshing=!0,1===this.currentIndex&&this.$refs.home.reFetchData(),2===this.currentIndex&&this.$refs.comm.reFetchData(),setTimeout((function(){e.triggered=!1,e._freshing=!1}),2e3))},onRestore:function(){this.triggered=!1},addButton:function(){if(!r.getStorageSync("userNo"))return r.showToast({title:"请登录",icon:"none"}),r.setStorageSync("nextPage",1===this.currentIndex?"/circlePages/circle":"/circlePages/addShare"),r.navigateTo({url:"/pages/login/login"}),!1;r.navigateTo({url:1===this.currentIndex?"/circlePages/circle":"/circlePages/addShare"})},reFetchData:function(){1===this.currentIndex&&(console.error("this"),this.$refs.home.reFetchData()),2===this.currentIndex&&(console.error("this"),this.$refs.comm.reFetchData())},_switchTabbarPage:function(e){var t=this.tabberPageLoadFlag[e];void 0!==t&&(!1===t&&(this.tabberPageLoadFlag[e]=!0),this.currentIndex=e,0===this.currentIndex&&this.$refs.discovery&&this.$refs.discovery.fetchData(),3===this.currentIndex&&this.$refs.mine&&this.$refs.mine.fetchData())},getMyCanvasAndCtx:function(t){return new Promise((function(n){var r=e.createSelectorQuery();r.select("#".concat(t)).fields({node:!0,size:!0}).exec((function(t){var r=t[0].node,a=r.getContext("2d"),i=e.getSystemInfoSync().pixelRatio;r.width=t[0].width*i,r.height=t[0].height*i,a.scale(i,i);var o={canvas:r,ctx:a};n(o)}))}))},sleep:function(e){return new Promise((function(t){return setTimeout(t,e)}))},initCanvas:function(){var t=this;return(0,o.default)(i.default.mark((function n(){var r,a,o,s,c;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.getMyCanvasAndCtx("myCanvas");case 2:return r=n.sent,a=r.ctx,o=r.canvas,a.save(),a.font="24px",a.fillText(t.shareData.company||t.shareData.contactPerson,0,32),a.fillText(t.shareData.content,0,72),n.next=11,t.sleep(500);case 11:return s=null,n.next=14,e.canvasToTempFilePath({canvas:o});case 14:return c=n.sent,s=c.tempFilePath,n.abrupt("return",s);case 17:case"end":return n.stop()}}),n)})))()},addLog:function(e){var t={bisNo:e.bisNo,bisType:1===this.currentIndex?"1":"2",userNo:r.getStorageSync("userNo")};s.default.post("/slbForward/add",{slbForward:JSON.stringify(t)},{headers:{"Content-Type":"application/json"}}).then((function(e){}))},onShareAppMessage:function(e){var t=this;if("button"==e.from){1===this.currentIndex&&this.$refs.home.hideSheet(),2===this.currentIndex&&this.$refs.comm.hideSheet(),this.shareData=e.target.dataset.coupon,this.addLog(this.shareData);var n=new Promise(function(){var e=(0,o.default)(i.default.mark((function e(n){return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.initCanvas();case 2:e.sent,n({path:"/pages/index/detail/detail?id="+t.shareData.bisNo+"&isNeed="+(t.shareData.isNeed?1:0)});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());return{path:"/pages/index/detail/detail?id="+this.shareData.bisNo+"&isNeed="+(this.shareData.isNeed?1:0),promise:n}}return{path:"/pages/index/index"}}}};t.default=f}).call(this,n(1)["default"],n(2)["default"])}},[[52,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|