You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
high-mini/unpackage/dist/build/mp-weixin/pages/tabBar/home/home.js

1 lines
3.7 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/tabBar/home/home"],{"5dc0":function(t,o,n){},"6f52":function(t,o,n){"use strict";var e;n.d(o,"b",(function(){return a})),n.d(o,"c",(function(){return i})),n.d(o,"a",(function(){return e}));var a=function(){var t=this,o=t.$createElement;t._self._c},i=[]},"9b1e":function(t,o,n){"use strict";(function(t){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var e=n("524d"),a=getApp(),i={data:function(){return{showHeader:!0,afterHeaderOpacity:1,headerPosition:"fixed",headerTop:null,statusTop:null,nVueTitle:null,city:"",currentSwiper:0,imageUrl:a.globalData.imgUrl,swiperList:[{id:1,src:"url1",img:"/static/img/banner2.png"},{id:2,src:"url2",img:"/static/img/banner3.png"}],productList:[],goldproductList:[],loadingText:"正在加载..."}},onPageScroll:function(t){this.headerPosition=t.scrollTop>=0?"fixed":"absolute",this.headerTop=t.scrollTop>=0?null:0,this.statusTop=t.scrollTop>=0?null:-this.statusHeight+"px"},onPullDownRefresh:function(){setTimeout((function(){t.stopPullDownRefresh()}),1e3)},onReachBottom:function(){},authColse:function(){},onLoad:function(){t.getStorage({key:"user",success:function(o){a.globalData.userInfo=o.data,t.getStorage({key:"token",success:function(t){a.globalData.token=t.data}})},fail:function(t){}});var o=this;o.postionIng(),t.login({provider:"weixin",success:function(t){a.globalData.code=t.code;var o={code:a.globalData.code};(0,e.HandleCode)(o).then((function(t){"000000"==t.return_code&&(a.globalData.openId=t.return_data.openId)}))}})},methods:{postionIng:function(){t.showLoading({title:"加载中"});var o=this;t.getLocation({type:"wgs84",success:function(n){t.request({url:"https://apis.map.qq.com/ws/geocoder/v1/?location="+n.latitude+","+n.longitude+"&key=YQDBZ-T54K4-5J6U7-DO3BA-CNZJO-PTFMU",data:{},success:function(n){o.city=n.data.result.address_component.city.replace(/市/g,"");n.data.result.ad_info.adcode.substring(5,"");a.globalData.cityId="500100",o.getCouponListArea(),o.getCouponListgold(),t.hideLoading()},fail:function(){t.hideLoading()}})}})},getCouponListArea:function(){var t=this,o={regionId:a.globalData.cityId,pageNum:1,pageSize:4,displayArea:1};(0,e.getCouponList)(o).then((function(o){"000000"==o.return_code&&(t.productList=o.return_data.list)}))},getCouponListgold:function(){var t=this,o={regionId:a.globalData.cityId,pageNum:1,pageSize:4,displayArea:2};(0,e.getCouponList)(o).then((function(o){"000000"==o.return_code&&(t.goldproductList=o.return_data.list)}))},tao:function(o,n){console.log(o),t.navigateToMiniProgram({appId:n,path:o,success:function(t){console.log("打开成功",t)},fail:function(t){console.log(t)}})},toMsg:function(){t.showToast({title:"暂未开通",icon:"none"})},toSearch:function(){t.navigateTo({url:"../../goods/HM-search/HM-search"})},toSwiper:function(o){t.reLaunch({url:"../category/category"})},toGoods:function(o){t.navigateTo({url:"../../goods/goods?id="+o})},swiperChange:function(t){this.currentSwiper=t.detail.current}}};o.default=i}).call(this,n("543d")["default"])},bc17:function(t,o,n){"use strict";var e=n("5dc0"),a=n.n(e);a.a},c3a6:function(t,o,n){"use strict";(function(t){n("185d");e(n("66fd"));var o=e(n("c840"));function e(t){return t&&t.__esModule?t:{default:t}}t(o.default)}).call(this,n("543d")["createPage"])},c840:function(t,o,n){"use strict";n.r(o);var e=n("6f52"),a=n("db43");for(var i in a)"default"!==i&&function(t){n.d(o,t,(function(){return a[t]}))}(i);n("bc17");var c,u=n("f0c5"),r=Object(u["a"])(a["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],c);o["default"]=r.exports},db43:function(t,o,n){"use strict";n.r(o);var e=n("9b1e"),a=n.n(e);for(var i in e)"default"!==i&&function(t){n.d(o,t,(function(){return e[t]}))}(i);o["default"]=a.a}},[["c3a6","common/runtime","common/vendor"]]]);