1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesPoints/index/index"],{"0db3":function(t,e,o){"use strict";o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=(this._self._c,this.loadEnd?this.goodsList.length:null);this.$mp.data=Object.assign({},{$root:{g0:e}})},i=[]},"416a":function(t,e,o){"use strict";(function(t){var n=o("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(o("af34")),a=n(o("7ca3")),s=o("8f59");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}var l={components:{mallGoods:function(){o.e("pagesPoints/component/mall/goods").then(function(){return resolve(o("8a4e8"))}.bind(null,o)).catch(o.oe)}},data:function(){return{loadEnd:!1,titleBackground:"rgba(255, 255, 255, 0)",titleColor:"#000",titleBarHeight:0,pointsInfo:{},page:1,limit:20,hasMore:!1,goodsList:[]}},computed:function(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){(0,a.default)(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}({},(0,s.mapState)({shareImage:function(t){return t.app.shareImage},shareTitle:function(t){return t.app.shareTitle}})),mounted:function(){var e=t.getSystemInfoSync().statusBarHeight,o=t.getMenuButtonBoundingClientRect();this.titleBarHeight=2*(o.top-e)+o.height+e},onLoad:function(){var e=this;t.showLoading({title:"加载中"}),this.getPointsInfo(),this.getGoodsList((function(){e.loadEnd=!0,t.hideLoading()}))},onPullDownRefresh:function(){this.getPointsInfo(),this.page=1,this.goodsList.length&&this.$refs.mallGoods.clearList(),this.getGoodsList((function(){t.stopPullDownRefresh()}))},onReachBottom:function(){this.hasMore&&(this.page++,this.getGoodsList())},onShareAppMessage:function(){return{title:this.shareTitle,imageUrl:this.shareImage}},onShareTimeline:function(){return{title:this.shareTitle,imageUrl:this.shareImage}},onPageScroll:function(e){var o=e.scrollTop;if(o>100)this.titleBackground="#fff",this.titleColor="black";else{var n=parseFloat(o/100).toFixed(4);this.titleBackground="rgba(255, 255, 255, "+n+")",o>30?(this.titleColor="black",t.setNavigationBarColor({frontColor:"#000000",backgroundColor:"#ffffff"})):(this.titleColor="#000000",t.setNavigationBarColor({frontColor:this.titleColor,backgroundColor:"transparent"}))}},methods:{getPointsInfo:function(){var e=this;this.$util.request("points.info").then((function(o){1==o.code?e.pointsInfo=o.data:t.showToast({title:o.msg,icon:"none"})})).catch((function(t){console.error("获取积分信息",t)}))},getGoodsList:function(e){var o=this;this.$util.request("points.goodsList",{page:this.page,limit:this.limit}).then((function(n){if(e&&e(),1==n.code){var a=n.data.data;o.hasMore=o.page<n.data.total/o.limit,o.goodsList=1==o.page?a:[].concat((0,i.default)(o.goodsList),(0,i.default)(a)),o.$nextTick((function(){o.goodsList.length&&o.$refs.mallGoods.getList(o.goodsList)}))}else t.showToast({title:n.msg,icon:"none"})})).catch((function(t){e&&e(),console.error("获取商品列表",t)}))},waterfallLoadEnd:function(){this.waterfallData.reset=!1,this.hasMore?this.waterfallData.status="await":this.waterfallData.status="finish"},toOrderList:function(){this.$util.toPage({mode:1,path:"/pagesPoints/order/index"})},toPointsDetails:function(){this.$util.toPage({mode:1,path:"/pagesPoints/index/details"})}}};e.default=l}).call(this,o("df3c")["default"])},"70fd":function(t,e,o){"use strict";o.r(e);var n=o("0db3"),i=o("ecbd");for(var a in i)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return i[t]}))}(a);o("eaeb");var s=o("828b"),r=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=r.exports},dd43:function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("aa6c");n(o("3240"));var i=n(o("70fd"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(i.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},e232:function(t,e,o){},eaeb:function(t,e,o){"use strict";var n=o("e232"),i=o.n(n);i.a},ecbd:function(t,e,o){"use strict";o.r(e);var n=o("416a"),i=o.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=i.a}},[["dd43","common/runtime","common/vendor"]]]); |