index.js 5.8 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"0910":function(t,e,o){"use strict";o.r(e);var n=o("7f9e"),i=o.n(n);for(var a in n)"default"!==a&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=i.a},"6aa2":function(t,e,o){"use strict";o.r(e);var n=o("d20a"),i=o("0910");for(var a in i)"default"!==a&&function(t){o.d(e,t,(function(){return i[t]}))}(a);o("cdfa");var r,s=o("f0c5"),c=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],r);e["default"]=c.exports},"7f9e":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o("2f62"),i=a(o("4f2a"));function a(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,n)}return o}function s(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?r(Object(o),!0).forEach((function(e){c(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function c(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var l=function(){o.e("component/uni-nav-bar/uni-nav-bar").then(function(){return resolve(o("9d62"))}.bind(null,o)).catch(o.oe)},u=function(){o.e("component/uni-icon/uni-icon").then(function(){return resolve(o("d4ee"))}.bind(null,o)).catch(o.oe)},f=function(){o.e("component/loginDialog").then(function(){return resolve(o("3478"))}.bind(null,o)).catch(o.oe)},g={components:{uniNavBar:l,uniIcon:u,logionDialog:f},data:function(){return{page:1,ispull:!0,pagesize:10,store_summary:[],pictureUrl:this.pictureUrl,amapPlugin:null,key:"7277de7a5833626b7da8f2496e9d6bf9",showdialog:!1,backgroundlist:["color1","color2","color3"],hotelist:[],indicatorDots:!0,autoplay:!0,interval:2e3,duration:500,title:"Hello",location:"正在定位...",scrollTop:0,old:{scrollTop:0},allow:!1}},computed:s({},(0,n.mapState)(["hasLogin","userInfo"])),onLoad:function(){this.getswiper(),this.gethotelist(),this.allow||this.gethotelist(),this.isGetLocation(),this.isUserInfo(),this.amapPlugin=new i.default.AMapWX({key:this.key})},methods:s({},(0,n.mapMutations)(["login","showDialog"]),{decryptPhoneNumber:function(t){if(console.log(t),"getPhoneNumber:fail user deny"==t.detail.errMsg)console.log(t);else{console.log("用户同意提供手机号"),console.log(JSON.stringify(t.detail.encryptedData)),console.log(JSON.stringify(t.detail.iv));var e=t.detail.encryptedData,o=t.detail.iv;console.log(o),console.log(e)}},handler:function(){console.log("kkkkk"),this.getAuthorizeInfo()},goinfor:function(){this.hasLogin?t.navigateTo({url:"../myCenter/information"}):this.showdialog=!0},cancelDiaolog:function(){this.showdialog=!1},confirmDiaolog:function(){this.showdialog=!1,t.navigateTo({url:"../myCenter/information"})},goSearch:function(){t.navigateTo({url:"./searchresult"})},upper:function(t){console.log("顶部")},lower:function(t){this.page=this.page+1,this.ispull&&this.gethotelist()},scroll:function(t){this.old.scrollTop=t.detail.scrollTop},isGetLocation:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userLocation",o=this;t.getSetting({success:function(t){t.authSetting[e]?o.getRegeo():o.getAuthorizeInfo()}})},isUserInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userInfo",o=this;t.getSetting({success:function(n){if(n.authSetting[e]){o.showDialog(!0);var i=t.getStorageSync("userInfo");o.login(i)}else o.showDialog(!1)}})},getAuthorizeInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userLocation",o=this;t.authorize({scope:e,success:function(t){console.log("调用位置授权"),o.getRegeo()},fail:function(){o.allow=!0,o.$msg("你拒绝了授权,无法获得周边信息")}})},getRegeo:function(){var e=this,o=this;t.showLoading({title:"获取信息中"}),o.amapPlugin.getRegeo({success:function(o){e.location=o[0].name,e.allow=!1,t.hideLoading()},fail:function(e){console.log(e),t.hideLoading()}})},getswiper:function(){var t=this;this.request({url:"/v1/entry/adv",method:"get",success:function(e){t.backgroundlist=e.data.data}})},gethotelist:function(){var t=this;this.request({url:"/v2/entry/storeList",method:"get",data:{page:this.page,page_size:10},success:function(e){var o=e.data,n=o.data,i=o.code;1e3==i?(n.store_list.length<10&&(t.ispull=!1),0==t.hotelist.length?t.hotelist=n.store_list:t.hotelist=t.hotelist.concat(n.store_list),t.hotelist.forEach((function(t){t.tages=t.store_summary.split(" ")}))):t.$msg("网络错误稍后再试")}})},scan:function(){t.scanCode({success:function(t){console.log(t)}})},openinfo:function(e){var o=e.store_id;t.navigateTo({url:"/pages/index/hotel?id=".concat(o)})},shopDetail:function(e){var o=e.adv_target.goods_id,n=e.adv_target.store_id;if("goods"==e.adv_target.type)t.navigateTo({url:"/pages/index/shop?id=".concat(o,"&store_id=").concat(n)});else if("store"==e.adv_target.type){var i=e.adv_target.store_id;e.adv_target.store_name;t.navigateTo({url:"/pages/index/hotel?id=".concat(i)})}}})};e.default=g}).call(this,o("543d")["default"])},"9e31":function(t,e,o){},cdfa:function(t,e,o){"use strict";var n=o("9e31"),i=o.n(n);i.a},d20a:function(t,e,o){"use strict";var n,i=function(){var t=this,e=t.$createElement;t._self._c},a=[];o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return n}))},d396:function(t,e,o){"use strict";(function(t){o("0bef"),o("921b");n(o("66fd"));var e=n(o("6aa2"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])}},[["d396","common/runtime","common/vendor"]]]);