12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{71:function(e,t,n){"use strict";(function(e,t){var r=n(4);n(26);r(n(25));var o=r(n(72));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},72:function(e,t,n){"use strict";n.r(t);var r=n(73),o=n(75);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var a,s=n(36),c=Object(s["default"])(o["default"],r["render"],r["staticRenderFns"],!1,null,"57280228",null,!1,r["components"],a);c.options.__file="pages/index/index.vue",t["default"]=c.exports},73:function(e,t,n){"use strict";n.r(t);var r=n(74);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"]}))},74:function(e,t,n){"use strict";var r;n.r(t),n.d(t,"render",(function(){return o})),n.d(t,"staticRenderFns",(function(){return a})),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,236))},tnLoading:function(){return n.e("tuniao-ui/components/tn-loading/tn-loading").then(n.bind(null,196))},tnTabbar:function(){return n.e("tuniao-ui/components/tn-tabbar/tn-tabbar").then(n.bind(null,203))}}}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 o=function(){var e=this,t=e.$createElement;e._self._c},i=!1,a=[];o._withStripped=!0},75:function(e,t,n){"use strict";n.r(t);var r=n(76),o=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"]=o.a},76:function(e,t,n){"use strict";(function(e,r){var o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(60)),a=o(n(62)),s=o(n(58)),c=function(){n.e("pages/home/home").then(function(){return resolve(n(210))}.bind(null,n)).catch(n.oe)},u=function(){n.e("pages/comm/comm").then(function(){return resolve(n(217))}.bind(null,n)).catch(n.oe)},l=function(){n.e("pages/discovery/discovery").then(function(){return resolve(n(224))}.bind(null,n)).catch(n.oe)},d=function(){n.e("pages/mine/mine").then(function(){return resolve(n(229))}.bind(null,n)).catch(n.oe)},f={components:{Home:c,Comm:u,Discovery:l,Mine:d},data:function(){return{isTop:!0,triggered:!1,_freshing:!1,tabbarList:[{title:"我要什么",activeIcon:"trust-fill",inactiveIcon:"trust"},{title:"我有什么",activeIcon:"team-fill",inactiveIcon:"team"},{title:"供需发布平台",activeIcon:"add-fill",inactiveIcon:"add-circle"},{title:"我的",activeIcon:"my-fill",inactiveIcon:"my"}],currentIndex:0,tabberPageLoadFlag:[],shareData:{}}},onLoad:function(e){var t=Number(e.index||0);this.tabberPageLoadFlag=this.tabbarList.map((function(e,n){return t===n})),this._freshing=!1,this.switchTabbar(t)},onShow:function(){3===this.currentIndex&&this.$refs.mine&&this.$refs.mine.getContentRectInfo(),1===this.currentIndex&&this.$refs.comm&&this.$refs.comm.fetchData()},methods:{switchTabbar:function(e){var t,n;(this._switchTabbarPage(e),1!==e)&&(null===(t=this.$refs)||void 0===t||null===(n=t.commRef)||void 0===n||n.stopAllVideo())},handleScroll:function(e){console.error("eee"),console.error(e),console.error(e.detail.scrollTop),e.detail.scrollTop<1?(console.error("11111111111111111"),this.isTop=!0):this.isTop=!1,console.error(this.isTop,"11111111111111111")},getOpenId:function(t){s.default.post("/wxma/code2Session",{code:t,platType:"slb",mpType:"engineer"}).then((function(t){console.error(t),t.success&&e.setStorageSync("userMap",JSON.stringify(t.resultMap))}))},loginByCode:function(t){var n=this;e.setStorageSync("loginStatus","false"),r.getUserInfo({success:function(r){console.error(r),s.default.post("/slbMpAutoLogin",{code:t,appType:"ma",encryptedData:r.encryptedData,iv:r.iv},{login:!1,warn:!1,loading:!1}).then((function(t){console.error(t),t.success?(e.setStorageSync("loginStatus","true"),e.setStorageSync("userMap",JSON.stringify(t.resultMap)),e.setStorageSync("userNo",t.resultMap.accountName)):(console.error(12345),e.setStorageSync("loginStatus","false"),e.login({success:function(e){console.error(e),n.getOpenId(e.code)},fail:function(t){console.error(t),e.hideLoading()}})),console.error(t)}))}})},tabbarPageScrollLower:function(e){0===this.currentIndex&&this.$refs.home.loadMore(),1===this.currentIndex&&this.$refs.comm.loadMore(),2===this.currentIndex&&this.$refs.discovery.getRandomData&&this.$refs.discovery.getRandomData()},onPulling:function(e){console.log("onpulling",e),e.detail.deltaY<0||(this.triggered=!0)},onRefresh:function(){var e=this;this._freshing||(this._freshing=!0,0===this.currentIndex&&(console.error("this"),this.$refs.home.reFetchData()),1===this.currentIndex&&(console.error("this"),this.$refs.comm.reFetchData()),setTimeout((function(){console.error(11112222),e.triggered=!1,e._freshing=!1,e.isTop=!1}),2e3))},onRestore:function(){this.triggered=!1,console.error("onRestore")},addButton:function(){if(!e.getStorageSync("userNo"))return e.showToast({title:"请登录",icon:"none"}),e.navigateTo({url:"/pages/login/login"}),!1;e.navigateTo({url:0===this.currentIndex?"/circlePages/circle":"/circlePages/addShare"})},reFetchData:function(){0===this.currentIndex&&(console.error("this"),this.$refs.home.reFetchData()),1===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)},getMyCanvasAndCtx:function(e){return new Promise((function(t){var n=r.createSelectorQuery();n.select("#".concat(e)).fields({node:!0,size:!0}).exec((function(e){var n=e[0].node,o=n.getContext("2d"),i=r.getSystemInfoSync().pixelRatio;n.width=e[0].width*i,n.height=e[0].height*i,o.scale(i,i);var a={canvas:n,ctx:o};t(a)}))}))},sleep:function(e){return new Promise((function(t){return setTimeout(t,e)}))},initCanvas:function(){var e=this;return(0,a.default)(i.default.mark((function t(){var n,o,a,s,c;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getMyCanvasAndCtx("myCanvas");case 2:return n=t.sent,o=n.ctx,a=n.canvas,o.save(),o.font="24px",o.fillText(e.shareData.company||e.shareData.contactPerson,0,32),o.fillText(e.shareData.content,0,72),t.next=11,e.sleep(500);case 11:return s=null,t.next=14,r.canvasToTempFilePath({canvas:a});case 14:return c=t.sent,s=c.tempFilePath,t.abrupt("return",s);case 17:case"end":return t.stop()}}),t)})))()},onShareAppMessage:function(e){var t=this;if("button"==e.from){0===this.currentIndex&&this.$refs.home.hideSheet(),1===this.currentIndex&&this.$refs.comm.hideSheet(),this.shareData=e.target.dataset.coupon;var n=new Promise(function(){var e=(0,a.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"}},onShareAppMessage0:function(e){return"button"==e.from&&(0===this.currentIndex&&this.$refs.home.hideSheet(),1===this.currentIndex&&this.$refs.comm.hideSheet()),{title:"速立保",path:"/pages/index/index"}}}};t.default=f}).call(this,n(2)["default"],n(1)["default"])}},[[71,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|