cinema.js 4.5 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/components/cinema"],{"1a0f":function(t,n,e){"use strict";var i=e("7c2f"),a=e.n(i);a.a},"5a8a":function(t,n,e){"use strict";e.r(n);var i=e("eaee"),a=e.n(i);for(var o in i)"default"!==o&&function(t){e.d(n,t,(function(){return i[t]}))}(o);n["default"]=a.a},"7c2f":function(t,n,e){},"91ac":function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return o})),e.d(n,"a",(function(){return i}));var i={topbar:function(){return e.e("components/topbar/topbar").then(e.bind(null,"6778"))}},a=function(){var t=this,n=t.$createElement;t._self._c},o=[]},e45e:function(t,n,e){"use strict";e.r(n);var i=e("91ac"),a=e("5a8a");for(var o in a)"default"!==o&&function(t){e.d(n,t,(function(){return a[t]}))}(o);e("1a0f");var c,r=e("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"b7c91baa",null,!1,i["a"],c);n["default"]=s.exports},eaee:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=c(e("a34a")),a=(e("ab66"),e("0a5a")),o=e("482c");function c(t){return t&&t.__esModule?t:{default:t}}function r(t,n,e,i,a,o,c){try{var r=t[o](c),s=r.value}catch(u){return void e(u)}r.done?n(s):Promise.resolve(s).then(i,a)}function s(t){return function(){var n=this,e=arguments;return new Promise((function(i,a){var o=t.apply(n,e);function c(t){r(o,i,a,c,s,"next",t)}function s(t){r(o,i,a,c,s,"throw",t)}c(void 0)}))}}var u=function(){e.e("components/skeleton/index/index").then(function(){return resolve(e("2ecc"))}.bind(null,e)).catch(e.oe)},d={components:{loadSke:u},data:function(){return{tabActive:0,hotList:[],soonList:{},hotLoading:!0,soonLoading:!0,location:[119.13139,26.15021],cityList:[],cityId:188,address:"定位中",cinemaList:{},cinemaLoading:!0}},mounted:function(){var t=this;return s(i.default.mark((function n(){return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.setFilmDiscount(),n.next=3,t.getLocation();case 3:case"end":return n.stop()}}),n)})))()},watch:{cityId:function(){this.init(),this.cinemaListInit()}},methods:{setFilmDiscount:function(){var t=this;(0,o.getFilmDiscount)().then((function(n){t.$store.commit("SET_FILMDISCOUNT",n.data)}))},getLocation:function(){var t=this;return s(i.default.mark((function n(){var e,c,r,s,u;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,wx.getLocation();case 2:return e=n.sent,t.location=[e.longitude.toFixed(6),e.latitude.toFixed(6)],n.next=6,(0,a.amapRegeo)({location:t.location});case 6:return c=n.sent,n.next=9,(0,o.getCityList)();case 9:r=n.sent,s=r.data.data.list,u={},s.map((function(n){u[n.pinYin]||(u[n.pinYin]=[]),u[n.pinYin].push(n),n.regionName==c.regeocode.addressComponent.city.slice(0,-1)&&t.selectCity(n)})),t.cityList=u;case 14:case"end":return n.stop()}}),n)})))()},init:function(){var t=this;return s(i.default.mark((function n(){var e,a,c;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.hotLoading=!0,t.soonLoading=!0,t.tabActive=null,t.$nextTick((function(){t.tabActive=0})),n.next=6,(0,o.getHotList)({cityId:t.cityId});case 6:return e=n.sent,t.hotList=e.data.data.list,t.hotLoading=!1,n.next=11,(0,o.getSoonList)({cityId:t.cityId});case 11:a=n.sent,c={},a.data.data.list.forEach((function(t){c[t.publishDate.slice(0,10)]||(c[t.publishDate.slice(0,10)]=[]),c[t.publishDate.slice(0,10)].push(t)})),t.soonList=c,t.$store.commit("SET_FILMLIST",t.hotList.concat(a.data.data.list)),t.soonLoading=!1;case 17:case"end":return n.stop()}}),n)})))()},cinemaListInit:function(){var t=this;return s(i.default.mark((function n(){var e;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,o.getCinemaList)({cityId:t.cityId,latitude:t.location[1],longitude:t.location[0]});case 2:e=n.sent,e.data.data.list.map((function(n){return n.distance=(111*Math.sqrt(Math.pow(n.latitude-t.location[1],2)+Math.pow(n.longitude-t.location[0],2))).toFixed(2),n})),e.data.data.list.sort((function(t,n){return t.distance-n.distance})),t.cinemaList=e.data.data.list,t.cinemaLoading=!1;case 7:case"end":return n.stop()}}),n)})))()},selectCity:function(t){this.address=t.regionName,this.cityId=t.cityId}}};n.default=d}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'pages/index/components/cinema-create-component',
  4. {
  5. 'pages/index/components/cinema-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("e45e"))
  7. })
  8. },
  9. [['pages/index/components/cinema-create-component']]
  10. ]);