1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"2df2":function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("7d57");n(o("3240"));var a=n(o("b345"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(a.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},5181:function(t,e,o){"use strict";(function(t){var n=o("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;n(o("fd32"));var a={components:{diy:function(){o.e("components/diy/diy").then(function(){return resolve(o("502f"))}.bind(null,o)).catch(o.oe)},Homepush:function(){o.e("pages/index/home-push/home-push").then(function(){return resolve(o("e978"))}.bind(null,o)).catch(o.oe)},navBar:function(){o.e("components/navBar/navBar").then(function(){return resolve(o("0f96"))}.bind(null,o)).catch(o.oe)},uniLoadMore:function(){o.e("components/uni-load-more").then(function(){return resolve(o("e5dd"))}.bind(null,o)).catch(o.oe)},searchProduct:function(){o.e("components/searchProduct").then(function(){return resolve(o("a936"))}.bind(null,o)).catch(o.oe)}},data:function(){return{loading:!1,background:"",listData:[],indicatorDots:!0,autoplay:!0,interval:2e3,duration:500,items:[],is_collection:!1,is_follow:"0",is_homepush:!1,homepush_data:{},triggered:!0,target:0,thisindex:0,category_list:[],product_list:[],page:1,last_page:0,no_more:!1,indexStop:0,title_name:"",bgcolor:"",msgNum:0,title_image:!1,toplogo:"",url:"",jweixin:null,showSearch:!1,openCategory:{color:"#000000",open:0},is_auto:0}},watch:{thisindex:function(t,e){t!=e&&(this.category_id=this.category_list[t].category_id,this.toggleInit(),0!=t&&this.getProduct())}},computed:{loadingType:function(){return this.loading?1:0!=this.product_list.length&&this.no_more?2:0}},onTabItemTap:function(){},onShow:function(){this.getTabBarLinks()},onLoad:function(){this._freshing=!1,this.getData(),this.getList()},onPullDownRefresh:function(){0==this.thisindex?this.getData():(this.toggleInit(),this.getProduct())},onReachBottom:function(){this.scrolltolowerFunc(),console.log("到底了")},methods:{getData:function(){var e=this;t.showLoading({title:"加载中"}),e._get("index/index",{url:e.url},(function(o){var n=t.getStorageSync("TabBar").is_auto&&0!=t.getStorageSync("TabBar").is_auto;e.is_auto=n,e.listData=o.data.list,e.background=o.data.background,e.items=o.data.items,e.title_name=o.data.page.params.title,e.bgcolor=o.data.page.style.titleBackgroundColor,e.msgNum=o.data.msgNum,e.toplogo=o.data.page.style.toplogo,e.setPage(o.data.page),e.title_type=o.data.page.params.title_type,e.titleTextColor=o.data.page.style.titleTextColor,e.openCategory=o.data.page.category;var a=t.getStorageSync("isFirst");""==a&&"1"==o.data.setting.collection.status&&(e.is_collection=!0,t.setStorageSync("isFirst",1)),e.is_follow=o.data.setting.officia.status;var i=t.getStorageSync("homepush_name");o.data.setting.homepush.is_open&&i!=o.data.setting.homepush.name&&(e.homepush_data=o.data.setting.homepush,e.is_homepush=!0,e.is_homepush=!0),t.hideLoading(),e.loadding=!1,t.stopPullDownRefresh()}))},getList:function(){var t=this;t._get("product.category/index",{},(function(e){t.category_list=e.data.list;t.category_list.unshift({name:"推荐",category_id:"0"})}))},getProduct:function(){var e=this,o=e.page;e.loading=!0,e._get("product.product/lists",{page:o||1,category_id:e.category_id,search:"",sortType:"all",sortPrice:0,list_rows:10},(function(n){e.loading=!1,t.stopPullDownRefresh(),e.product_list=e.product_list.concat(n.data.list.data),e.last_page=n.data.list.last_page,n.data.list.last_page<=1&&(e.no_more=!0),o>=9&&(e.no_more=!0)}))},scrolltolowerFunc:function(){this.page<this.last_page&&(this.page++,this.getProduct()),this.no_more=!0},setPage:function(e){t.setNavigationBarTitle({title:e.params.name});var o="#000000";"white"==e.style.titleTextColor&&(o="#ffffff"),t.setNavigationBarColor({frontColor:o,backgroundColor:e.style.titleBackgroundColor})},onShareAppMessage:function(){return{title:this.page.params.share_title,path:"/pages/index/index?"+this.getShareUrlParams()}},setTabBarItem:function(e){2==e&&(console.log("订单"),t.setTabBarItem({index:2,pagePath:"/pages/order/myorder",text:"订单",iconPath:"static/order.png",selectedIconPath:"static/order_active.png"}))},toggleInit:function(){this.page=1,this.last_page=0,this.no_more=!1,this.product_list=[]},setIndex:function(t){this.thisindex=t},stopTouchMove:function(){return!0},scanQrcode:function(){var e=this;t.scanCode({onlyFromCamera:!0,success:function(o){"scanCode:ok"==o.errMsg?e.gotoPage("/pages/store/clerkorder?order_no="+o.result):t.showToast({title:"扫码失败,请重试"})}})},closeSearch:function(){this.showSearch=!1}}};e.default=a}).call(this,o("df3c")["default"])},"6f01":function(t,e,o){"use strict";var n=o("b39e"),a=o.n(n);a.a},ac7c:function(t,e,o){"use strict";o.d(e,"b",(function(){return a})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return n}));var n={navBar:function(){return o.e("components/navBar/navBar").then(o.bind(null,"0f96"))},diy:function(){return o.e("components/diy/diy").then(o.bind(null,"502f"))}},a=function(){var t=this,e=t.$createElement,o=(t._self._c,t.theme()||""),n=t.theme(),a=t.topBarTop(),i=t.topBarHeight(),s=0!=i?t.topBarHeight():null,r=t.topBarHeight(),c=0!=t.thisindex?0==t.product_list.length&&!t.loading:null,l=t.is_collection?t.topBarTop():null,u=t.is_collection?t.topBarHeight():null;t._isMounted||(t.e0=function(e){t.showSearch=!0},t.e1=function(e){t.is_collection=!1},t.e2=function(e){t.is_follow=0}),t.$mp.data=Object.assign({},{$root:{m0:o,m1:n,m2:a,m3:i,m4:s,m5:r,g0:c,m6:l,m7:u}})},i=[]},b345:function(t,e,o){"use strict";o.r(e);var n=o("ac7c"),a=o("fa65");for(var i in a)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(i);o("6f01");var s=o("828b"),r=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=r.exports},b39e:function(t,e,o){},fa65:function(t,e,o){"use strict";o.r(e);var n=o("5181"),a=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a}},[["2df2","common/runtime","common/vendor"]]]); |