index.js 9.9 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index","uview-ui/components/u-loadmore/u-loadmore"],{"0e89":function(t,e,n){"use strict";var o=n("7cfd"),i=n.n(o);i.a},"58e4":function(t,e,n){"use strict";n.r(e);var o=n("8255"),i=n.n(o);for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},"6acb":function(t,e,n){"use strict";n.r(e);var o=n("ccf7"),i=n("58e4");for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("dd61");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=u.exports},"7cfd":function(t,e,n){},8255:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=s(n("a34a")),i=(s(n("a21d")),n("b0c9")),r=(n("763d"),n("77a1")),a=(n("763d"),n("f764"),n("06f5")),c=(n("9901"),n("26cb")),u=n("5d67");function s(t){return t&&t.__esModule?t:{default:t}}function l(t,e,n,o,i,r,a){try{var c=t[r](a),u=c.value}catch(s){return void n(s)}c.done?e(u):Promise.resolve(u).then(o,i)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var r=t.apply(e,n);function a(t){l(r,o,i,a,c,"next",t)}function c(t){l(r,o,i,a,c,"throw",t)}a(void 0)}))}}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){h(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p=function(){Promise.all([n.e("common/vendor"),n.e("components/lee-select-city/lee-select-city")]).then(function(){return resolve(n("f790"))}.bind(null,n)).catch(n.oe)},m=function(){Promise.all([n.e("common/vendor"),n.e("components/seckill/seckill")]).then(function(){return resolve(n("3d7a"))}.bind(null,n)).catch(n.oe)},v={components:{seckill:m,LeeSelectCity:p},data:function(){var t;return t={page:1,limitt:10,loadingType:"more",district:"定位中",PXType:0,storeList:[],tabbar:u.tabbar,current:0,shareShow:!1,pageProportion:0,swiperHeight:0,checkid:0,titleNViewBackground:"",swiperCurrent:0,swiperLength:0,carouselList:[],bastList:[]},h(t,"page",1),h(t,"limit",5),h(t,"firstList",[]),h(t,"goodList",[]),h(t,"shopList",[]),t},computed:g(g({},(0,c.mapState)(["loginInterceptor","baseURL","latitude","longitude","weichatObj","chooseDistrict"])),(0,c.mapState)("user",["hasLogin","userInfo"])),onReachBottom:function(){this.getStoreList()},onLoad:function(e){this.getaddress(),e.scene&&t.setStorage({key:"spread_code",data:e.scene})},watch:{PXType:function(t,e){this.getStoreList()}},onShow:function(){this.getGoodList(),this.loadData(),this.getStoreCate()},onPullDownRefresh:function(){this.loadData()},methods:g(g({},(0,c.mapMutations)(["setLat","setLon","setChoose"])),{},{reGetStoreList:function(){this.page=1,this.loadingType="more",this.storeList=[],console.log("地址刷新"),this.getStoreList()},space:function(t,e,n,o){console.log(t,e,n,o);var i=t*Math.PI/180,r=n*Math.PI/180,a=i-r,c=e*Math.PI/180-o*Math.PI/180,u=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(i)*Math.cos(r)*Math.pow(Math.sin(c/2),2)));return u*=6378.137,u=Math.round(1e4*u)/1e4,u},makeCall:function(e){t.makePhoneCall({phoneNumber:e})},dh:function(t){wx.openLocation({latitude:1*t.latitude,longitude:1*t.longitude,name:t.name,address:t.detailed_address})},getStoreList:function(){var e=this,n=this;"loading"!=n.loadingType&&"noMore"!=n.loadingType&&(n.loadingType="loading",(0,i.getStoreList)({page:n.page,latitude:n.latitude,longitude:n.longitude,limit:n.limitt,address:n.$store.state.chooseDistrict,sales:2==n.PXType?1:0}).then((function(o){o.data.list.length>0&&(n.storeList=n.storeList.concat(o.data.list),n.page++,console.log("数据加载完毕")),n.limitt==o.data.list.length?(n.loadingType="more",console.log("加载完毕1111111")):(console.log("加载完毕1222222222211"),n.loadingType="noMore"),t.hideLoading(),e.$set(n.storeList,"loaded",!0)})))},getStoreCate:function(){var t=this;(0,i.store_cate)().then((function(e){console.log(e),t.shopList=t.chunkArr(e.data,10),console.log(t.shopList,"this.shopList+++++++++++++")}))},getLocation:function(){t.getLocation({type:"gcj02",success:function(t){console.log(t,"dingwei")}})},getGoodList:function(){var t=this;(0,a.getProducts)({page:1,limit:50,cid:1}).then((function(e){console.log(e,"libao"),t.goodList=e.data.filter((function(t){return 2999!=t.price}))}))},navto:function(e){t.navigateTo({url:e,fail:function(){t.switchTab({url:e})}})},getaddress:function(){var e=this;console.log("dizhi+++++++++++");var n=this;t.getLocation({type:"gcj02",success:function(t){console.log(t,123456),n.setLat(t.latitude),n.setLon(t.longitude),n.getCity()},fail:function(t){console.log(t,"shi+++++++++++++++"),openMap().then((function(t){e.getaddress()}))}})},navTo:function(e){""==e?this.$api.msg("暂未开通,敬请期待"):t.navigateTo({url:e})},clickSearch:function(){t.navigateTo({url:"/pages/shop/shopList?id=0"})},onImageError:function(t,e){this[t][e].image="/static/error/errorImage.jpg"},loadData:function(){var e=this;return d(o.default.mark((function n(){return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:(0,r.loadIndexs)({}).then((function(n){var o=n.data,i=o.info;console.log(i,"商品信息"),e.carouselList=o.banner,e.swiperLength=e.carouselList.length,e.bastList=o.giftInfo,o.info.firstList.forEach((function(t){t.isVip=t.store_type?"3":"0"})),e.firstList=o.info.firstList,t.stopPullDownRefresh()})).catch((function(e){t.stopPullDownRefresh()}));case 1:case"end":return n.stop()}}),n)})))()},swiperChange:function(t){var e=t.detail.current;this.swiperCurrent=e,this.titleNViewBackground=this.carouselList[e].background},bannerNavToUrl:function(e){t.navigateTo({url:e.wap_url})},chunkArr:function(t,e){if(console.log(t,"arr+++++"),!t.length||!e||e<1)return[];for(var n=null,o=null,i=[],r=0;r<Math.ceil(t.length/e);r++)n=r*e,o=n+e,i.push(t.slice(n,o));return i},getCity:function(){var t=this;(0,i.getCity)({lat:t.latitude,lng:t.longitude}).then((function(e){console.log(e,"逆解析结果"),t.setChoose({chooseProvince:e.data.province,chooseCity:e.data.city,chooseDistrict:e.data.district}),t.getStoreList()}))},toGaodeMap:function(t,e,n){window.location.href="https://uri.amap.com/marker?position=".concat(e,",").concat(t,"&name=").concat(n)}})};e.default=v}).call(this,n("543d")["default"])},"8a6d":function(t,e,n){},"9be2":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var o={uLine:function(){return n.e("uview-ui/components/u-line/u-line").then(n.bind(null,"41fd"))},uLoading:function(){return n.e("uview-ui/components/u-loading/u-loading").then(n.bind(null,"745e"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.$u.addUnit(t.height)),o=t.__get_style([t.loadTextStyle]);t.$mp.data=Object.assign({},{$root:{g0:n,s0:o}})},r=[]},a21d:function(t,e,n){"use strict";n.r(e);var o=n("9be2"),i=n("ca70");for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("0e89");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"f8168008",null,!1,o["a"],a);e["default"]=u.exports},aacd:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={name:"u-loadmore",props:{bgColor:{type:String,default:"transparent"},icon:{type:Boolean,default:!0},fontSize:{type:String,default:"28"},color:{type:String,default:"#606266"},status:{type:String,default:"loadmore"},iconType:{type:String,default:"circle"},loadText:{type:Object,default:function(){return{loadmore:"加载更多",loading:"正在加载...",nomore:"没有更多了"}}},isDot:{type:Boolean,default:!1},iconColor:{type:String,default:"#b7b7b7"},marginTop:{type:[String,Number],default:0},marginBottom:{type:[String,Number],default:0},height:{type:[String,Number],default:"auto"}},data:function(){return{dotText:"●"}},computed:{loadTextStyle:function(){return{color:this.color,fontSize:this.fontSize+"rpx",position:"relative",zIndex:1,backgroundColor:this.bgColor}},cricleStyle:function(){return{borderColor:"#e5e5e5 #e5e5e5 #e5e5e5 ".concat(this.circleColor)}},flowerStyle:function(){return{}},showText:function(){var t="";return t="loadmore"==this.status?this.loadText.loadmore:"loading"==this.status?this.loadText.loading:"nomore"==this.status&&this.isDot?this.dotText:this.loadText.nomore,t}},methods:{loadMore:function(){"loadmore"==this.status&&this.$emit("loadmore")}}};e.default=o},ca70:function(t,e,n){"use strict";n.r(e);var o=n("aacd"),i=n.n(o);for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},ccf7:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var o={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"6c4c"))}},i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.storeList,(function(e,n){var o=t.__get_orig(e),i=e.coupon&&e.coupon.length>0?t.__map(e.coupon,(function(e,n){var o=t.__get_orig(e),i=(10*e.price/(1*e.ot_price)).toFixed(1);return{$orig:o,g0:i}})):null;return{$orig:o,l0:i}})));t._isMounted||(t.e0=function(e){t.PXType=0},t.e1=function(e){t.PXType=1},t.e2=function(e){t.PXType=2}),t.$mp.data=Object.assign({},{$root:{l1:n}})},r=[]},dc20:function(t,e,n){"use strict";(function(t){n("4c14");o(n("66fd"));var e=o(n("6acb"));function o(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=n,t(e.default)}).call(this,n("543d")["createPage"])},dd61:function(t,e,n){"use strict";var o=n("8a6d"),i=n.n(o);i.a}},[["dc20","common/runtime","common/vendor"]]]);