yurong/unpackage/dist/dev/mp-weixin/components/taoke/source/home-source.js

12 lines
9.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/taoke/source/home-source"],{496:function(t,e,n){"use strict";n.r(e);var o=n(497),i=n(499);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n(501);var s,c=n(32),r=Object(c["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,"12be2f83",null,!1,o["components"],s);r.options.__file="components/taoke/source/home-source.vue",e["default"]=r.exports},497:function(t,e,n){"use strict";n.r(e);var o=n(498);n.d(e,"render",(function(){return o["render"]})),n.d(e,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(e,"components",(function(){return o["components"]}))},498:function(t,e,n){"use strict";var o;n.r(e),n.d(e,"render",(function(){return i})),n.d(e,"staticRenderFns",(function(){return s})),n.d(e,"recyclableRender",(function(){return a})),n.d(e,"components",(function(){return o}));try{o={bottomNav:function(){return n.e("components/bottom-nav/bottom-nav").then(n.bind(null,532))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.noticeList.slice(0,3));t._isMounted||(t.e0=function(e){t.worthTabActive=0},t.e1=function(e){t.worthTabActive=1},t.e2=function(e){t.worthTabActive=2}),t.$mp.data=Object.assign({},{$root:{l0:n}})},a=!1,s=[];i._withStripped=!0},499:function(t,e,n){"use strict";n.r(e);var o=n(500),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},500:function(t,e,n){"use strict";(function(t){var o=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n(18)),a=o(n(127)),s=function(){n.e("components/bottom-nav/bottom-nav").then(function(){return resolve(n(532))}.bind(null,n)).catch(n.oe)},c={components:{BottomNav:s},data:function(){return{statusBarHeight:44,activeBottomTab:0,currentTab:0,navList:[{name:"首页",cat_id:0},{name:"推荐",cat_id:-1}],banners:["https://images.unsplash.com/photo-1483985988355-763728e1935b?w=800&q=80","https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=800&q=80","https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?w=800&q=80"],gridCurrent:0,menus:[],noticeList:[{img:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100&q=80",msg:"正在获取最新订单信息..."}],qiangNum:2263,adList:["https://images.unsplash.com/photo-1607083206968-13611e3d76db?w=800&q=80","https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?w=800&q=80"],worthTabActive:0,deserveList:[],nineList:[],nineteenList:[],recommendData:{left:{title:"今日必抢",sub:"爆款直降",img:"https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=400&q=80"},topRight:{title:"百亿补贴",sub:"大牌正品",img:"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&q=80"},bottomRight:{title:"热销榜单",sub:"闭眼入",img:"https://images.unsplash.com/photo-1546868871-7041f2a55e12?w=400&q=80"}},brandSaleList:[{logo:"https://cdn-icons-png.flaticon.com/512/732/732229.png",image:"https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=400&q=80",price:"39.9",oldPrice:"99"},{logo:"https://cdn-icons-png.flaticon.com/512/882/882730.png",image:"https://images.unsplash.com/photo-1618354691373-d851c5c3a990?w=400&q=80",price:"59.0",oldPrice:"159"},{logo:"https://cdn-icons-png.flaticon.com/512/732/732244.png",image:"https://images.unsplash.com/photo-1583743814966-8936f5b7be1a?w=400&q=80",price:"89.0",oldPrice:"299"},{logo:"https://cdn-icons-png.flaticon.com/512/732/732221.png",image:"https://images.unsplash.com/photo-1511556532299-8f662fc26c06?w=400&q=80",price:"129",oldPrice:"499"}],brandSaleShops:[],platformActive:0,goodsList:[]}},onLoad:function(){this.initializePage()},mounted:function(){this.__taokeInitialized||(this.__taokeInitialized=!0,this.initializePage())},onPullDownRefresh:function(){this.getIndexData(),this.getCategoryList(),this.getNoticeList(),this.getGoodsList(),this.getWorthBuyLists(),this.getBrandSaleList(),setTimeout((function(){t.stopPullDownRefresh()}),600)},computed:{homeHeaderHeight:function(){return this.statusBarHeight+100},gridMenuPages:function(){var t=[];if(!this.menus||0===this.menus.length)return t;for(var e=0;e<this.menus.length;e+=10)t.push(this.menus.slice(e,e+10));return t},worthBuyGoods:function(){return 0===this.worthTabActive?this.deserveList:1===this.worthTabActive?this.nineList:2===this.worthTabActive?this.nineteenList:[]},worthBuyChunks:function(){for(var t=[],e=0;e<this.worthBuyGoods.length;e+=2)t.push(this.worthBuyGoods.slice(e,e+2));return t}},methods:{initializePage:function(){if(!this.__pageInitialized){this.__pageInitialized=!0;var e=t.getSystemInfoSync();this.statusBarHeight=e.statusBarHeight||44,this.getIndexData(),this.getCategoryList(),this.getNoticeList(),this.getGoodsList(),this.getWorthBuyLists(),this.getBrandSaleList()}},goSearch:function(){t.navigateTo({url:"/pages/search/search"})},getIndexData:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/index/index?cid=YsWZ21tx").then((function(e){var n=e.data;Array.isArray(n.navs)&&(t.menus=n.navs),Array.isArray(n.banners)&&n.banners.length>0&&(t.banners=n.banners.map((function(t){return t.img})).filter(Boolean)),Array.isArray(n.tile_long)&&n.tile_long.length>0&&(t.adList=n.tile_long.map((function(t){return t.img})).filter(Boolean))})).catch((function(t){console.error("获取首页数据失败:",t.message)}))},goToDetail:function(e){console.log("正在跳转到详情页商品ID:",e),t.navigateTo({url:"/pages/detail/detail?id=".concat(e)})},getCategoryList:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/index/category?cid=YsWZ21tx").then((function(e){e.data.category&&(t.navList=[{name:"首页",cat_id:0},{name:"推荐",cat_id:-1}].concat((0,i.default)(e.data.category)))})).catch((function(t){console.error("获取分类失败:",t.message)}))},getNoticeList:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/msg/getMsgs?cid=YsWZ21tx").then((function(e){t.noticeList=e.data.msgs,e.data.num&&(t.qiangNum=e.data.num)})).catch((function(t){console.error("获取通知失败:",t.message)}))},getGoodsList:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/recommend/getRecommend?page_size=200&page=1&type=2&cid=YsWZ21tx").then((function(e){var n=e.data.recommends.map((function(t){var e=t.itemsale;return t.itemsale>=1e4&&(e=(t.itemsale/1e4).toFixed(1)+"万"),{id:t.id,image:t.itempic,title:t.itemshorttitle,finalPrice:t.itemendprice,couponValue:t.couponmoney,sales:e,brandTag:t.brand_name,lowestTag:t.label&&t.label.length>0?t.label[0]:"",shopType:"B"===t.shoptype?"天猫":"淘宝",tkmoney:t.tkmoney}}));t.goodsList=n})).catch((function(t){console.error("获取商品列表失败:",t.message)}))},getWorthBuyLists:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/index/deserveLists?cid=YsWZ21tx").then((function(e){var n=function(t){return t.map((function(t){return{id:t.id,img:t.itempic,title:t.itemshorttitle,label1:t.label&&t.label[0]?t.label[0]:"",label2:t.label&&t.label[1]?t.label[1]:"",price:t.itemendprice,oldPrice:t.itemprice,coupon:t.couponmoney,todaySale:t.todaysale>=1e4?(t.todaysale/1e4).toFixed(1)+"万":t.todaysale,sold:t.itemsale>=1e4?(t.itemsale/1e4).toFixed(1)+"万":t.itemsale,shopType:"B"===t.shoptype?"天猫":"淘宝"}}))};t.deserveList=n(e.data.deserve_lists),t.nineList=n(e.data.nine_lists),t.nineteenList=n(e.data.nineteen_lists)})).catch((function(t){console.error("获取值得买列表失败:",t.message)}))},getBrandSaleList:function(){var t=this;a.default.get("https://api.cmspro.haodanku.com/brandItem/choiceness?cid=YsWZ21tx").then((function(e){e.data.brand_prefecture&&(t.brandSaleShops=e.data.brand_prefecture.map((function(t){return{bg:t.backimage||"https://images.unsplash.com/photo-1556228720-195a672e8a03?w=800&q=80",logo:t.brand_logo||"https://images.unsplash.com/photo-1560155016-bd4879ae8f21?w=200&q=80",name:t.fq_brand_name||"大牌特卖",desc:t.title||"官方直降 爆款秒杀",tags:t.label?t.label.slice(0,2):["抢限量大额券","霸榜天猫3大榜单"],items:(t.items||[]).slice(0,3).map((function(t){return{id:t.id,img:t.itempic,title:t.itemshorttitle,sold:t.itemsale>=1e4?(t.itemsale/1e4).toFixed(1)+"万":t.itemsale,promo:t.couponmoney?"领"+t.couponmoney+"元券":"官方直降",price:t.itemendprice,coupon:t.couponmoney}}))}})))})).catch((function(t){console.error("获取品牌特卖失败:",t.message)}))},switchTab:function(e){var n=this.navList[e],o=n.cat_id,i=n.name;o>0?t.navigateTo({url:"/pages/category/category?cat_id=".concat(o)}):(this.currentTab=e,t.pageScrollTo({selector:"推荐"===i?"#goods-list-section":"#top-section",duration:300}))},goToChoiceness:function(){console.log("触发品牌特卖更多跳转"),t.navigateTo({url:"/pages/special-sale/choicen"})},goToSaveMoney:function(){t.navigateTo({url:"/pages/save-money/save-money"})}}};e.default=c}).call(this,n(2)["default"])},501:function(t,e,n){"use strict";n.r(e);var o=n(502),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},502:function(t,e,n){}}]);
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/components/taoke/source/home-source.js.map
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/taoke/source/home-source-create-component',
{
'components/taoke/source/home-source-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('2')['createComponent'](__webpack_require__(496))
})
},
[['components/taoke/source/home-source-create-component']]
]);